:root {
  --bg: #07111b;
  --panel: rgba(12, 24, 37, .86);
  --panel-strong: rgba(15, 31, 48, .96);
  --panel-soft: rgba(18, 36, 54, .72);
  --line: rgba(156, 178, 206, .16);
  --text: #eef6ff;
  --muted: #91a4ba;
  --subtle: #5f7288;
  --green: #25d6a2;
  --blue: #4aa7ff;
  --cyan: #49d6ff;
  --violet: #9d8cff;
  --amber: #ffc05c;
  --red: #ff6577;
  --shadow: 0 18px 60px rgba(0, 0, 0, .28);
  --radius: 8px;
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }

html {
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(7, 17, 27, .94), rgba(6, 12, 20, .98)),
    #07111b;
  overflow-x: hidden;
}

button, input, select {
  font: inherit;
}

button {
  cursor: pointer;
}

svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hidden { display: none !important; }

.toast {
  position: fixed;
  top: 18px;
  left: 50%;
  z-index: 200;
  min-width: min(420px, calc(100vw - 32px));
  transform: translate(-50%, -18px);
  opacity: 0;
  pointer-events: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 16px;
  background: rgba(7, 17, 27, .96);
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: 14px;
  transition: opacity .18s ease, transform .18s ease;
}

.toast.show {
  transform: translate(-50%, 0);
  opacity: 1;
}

.toast.error { border-color: rgba(255, 101, 119, .42); color: #ffd8de; }
.toast.success { border-color: rgba(37, 214, 162, .42); color: #d9fff4; }

.btn {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 0 14px;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}

.btn:hover { transform: translateY(-1px); }
.btn.primary { background: linear-gradient(135deg, #21c795, #2c9cff); color: #03111b; }
.btn.secondary { width: 100%; border-color: rgba(74, 167, 255, .34); background: rgba(74, 167, 255, .08); }
.btn.ghost { border-color: rgba(156, 178, 206, .16); background: rgba(255, 255, 255, .04); }
.btn.light { border-color: rgba(255, 255, 255, .24); background: rgba(255, 255, 255, .1); }

.auth-screen {
  position: relative;
  display: grid;
  min-height: 100vh;
  place-items: center;
  overflow: hidden;
  padding: 86px 24px 42px;
  background:
    linear-gradient(180deg, rgba(1, 8, 21, .04), rgba(1, 8, 21, .18) 42%, rgba(1, 8, 21, .48)),
    url("earth-bg-optimized.jpg") center / cover no-repeat,
    #061326;
}

.auth-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 42%, rgba(54, 157, 255, .18), transparent 34%),
    linear-gradient(90deg, rgba(0, 0, 0, .34), transparent 24%, transparent 76%, rgba(0, 0, 0, .36));
}

.auth-screen::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 36%;
  pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(0, 8, 20, .5));
}

.auth-brand-lockup {
  position: absolute;
  z-index: 3;
  top: 30px;
  left: 44px;
  width: 260px;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, .45)) drop-shadow(0 0 22px rgba(63, 255, 203, .18));
}

.auth-brand-lockup img {
  display: block;
  width: 100%;
  height: auto;
}

.auth-shell {
  position: relative;
  z-index: 2;
  display: block;
  width: min(420px, calc(100vw - 32px));
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .62);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(238, 245, 255, .8), rgba(215, 227, 244, .72));
  box-shadow: 0 24px 62px rgba(0, 17, 46, .36), inset 0 1px 0 rgba(255, 255, 255, .72);
  backdrop-filter: blur(8px) saturate(108%);
}

.auth-shell::before {
  content: "";
  position: absolute;
  inset: 1px;
  pointer-events: none;
  border-radius: 11px;
  background: linear-gradient(135deg, rgba(255, 255, 255, .34), transparent 46%, rgba(55, 143, 255, .08));
}

.auth-panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 34px 28px 28px;
  background: transparent;
}

.auth-panel h2 {
  margin: 0;
  color: #27364d;
  text-align: center;
  font-size: 24px;
  line-height: 1.25;
  font-weight: 700;
}

.auth-note, .auth-help {
  color: rgba(44, 61, 86, .68);
  font-size: 14px;
  line-height: 1.65;
  text-align: center;
}

.login-form {
  display: grid;
  gap: 15px;
  margin-top: 24px;
}

.login-form label {
  display: grid;
  gap: 8px;
  color: #4c5b70;
  font-size: 13px;
  font-weight: 700;
}

.login-form input {
  min-height: 42px;
  border: 1px solid rgba(28, 49, 79, .1);
  border-radius: 5px;
  outline: none;
  padding: 0 13px;
  background: rgba(255, 255, 255, .88);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .88), 0 8px 20px rgba(25, 45, 78, .06);
  color: #1c2d45;
}

.search-field input,
select {
  min-height: 42px;
  border: 1px solid rgba(156, 178, 206, .18);
  border-radius: 7px;
  outline: none;
  background: rgba(255, 255, 255, .055);
  color: var(--text);
}

.login-form input:focus,
.search-field input:focus,
select:focus {
  border-color: rgba(12, 122, 255, .46);
}

.login-form .btn.primary {
  min-height: 44px;
  border-radius: 5px;
  background: linear-gradient(180deg, #1487ff, #006cf0);
  box-shadow: 0 12px 26px rgba(0, 106, 240, .32), inset 0 1px 0 rgba(255, 255, 255, .28);
  color: #fff;
  letter-spacing: .08em;
}

.auth-panel .secondary {
  margin-top: 12px;
}

.auth-help {
  margin-top: 18px;
  border-top: 1px solid rgba(35, 53, 77, .1);
  padding-top: 16px;
}

.app-shell {
  min-height: 100vh;
}

.workspace,
.workspace > section,
#overviewView,
#stationView,
#adminView,
.ops-layout,
.detail-layout,
.panel,
.side-stack,
.station-switch,
.pile-grid,
.pile-card,
.chart {
  min-width: 0;
  max-width: 100%;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 50;
  display: flex;
  width: 252px;
  flex-direction: column;
  border-right: 1px solid var(--line);
  padding: 26px 18px;
  background: rgba(5, 14, 24, .92);
  backdrop-filter: blur(18px);
}

.brand img {
  width: 168px;
}

.nav {
  display: grid;
  gap: 8px;
  margin-top: 36px;
}

.nav-item {
  display: flex;
  min-height: 46px;
  align-items: center;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 0 12px;
  background: transparent;
  color: #b9c7d9;
  font-weight: 800;
  text-align: left;
}

.nav-item.active,
.nav-item:hover {
  border-color: rgba(37, 214, 162, .28);
  background: rgba(37, 214, 162, .09);
  color: var(--text);
}

.sidebar-status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, .04);
}

.sidebar-status strong,
.sidebar-status span {
  display: block;
}

.sidebar-status span:last-child {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.status-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--muted);
}

.status-dot.ok { background: var(--green); box-shadow: 0 0 0 4px rgba(37, 214, 162, .12); }
.status-dot.warn { background: var(--amber); box-shadow: 0 0 0 4px rgba(255, 192, 92, .12); }
.status-dot.bad { background: var(--red); box-shadow: 0 0 0 4px rgba(255, 101, 119, .12); }

.workspace {
  min-height: 100vh;
  padding: 26px 28px 42px 280px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.brand-line {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 13px;
}

.topbar h1 {
  margin: 0;
  font-size: 26px;
  line-height: 1.2;
}

.top-actions,
.hero-actions,
.filters,
.detail-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.time-chip {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px 12px;
  color: #b8c7d9;
  background: rgba(255, 255, 255, .035);
  font-size: 13px;
  white-space: nowrap;
}

.hero-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  overflow: hidden;
  border: 1px solid rgba(37, 214, 162, .18);
  border-radius: 10px;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(37, 214, 162, .15), rgba(74, 167, 255, .08)),
    rgba(13, 29, 45, .82);
}

.hero-band h2,
.panel-head h2,
.detail-title-row h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.25;
}

.hero-band p,
.panel-head p,
.detail-title-row p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.kpi-card {
  position: relative;
  overflow: hidden;
  min-height: 118px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 15px;
  background: var(--panel);
}

.kpi-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: currentColor;
}

.kpi-card span,
.kpi-card em {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.kpi-card strong {
  display: block;
  margin: 12px 0 8px;
  color: var(--text);
  font-size: 26px;
  line-height: 1;
}

.kpi-card b {
  font: inherit;
}

.accent-green { color: var(--green); }
.accent-blue { color: var(--blue); }
.accent-cyan { color: var(--cyan); }
.accent-violet { color: var(--violet); }
.accent-amber { color: var(--amber); }
.accent-red { color: var(--red); }

.ops-layout,
.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.48fr) minmax(330px, .72fr);
  gap: 16px;
  margin-top: 16px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .12);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  padding: 16px;
}

.panel-head.compact {
  align-items: flex-start;
  padding: 15px 16px;
}

.search-field {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 220px;
  border: 1px solid rgba(156, 178, 206, .18);
  border-radius: 7px;
  padding: 0 10px;
  background: rgba(255, 255, 255, .055);
}

.search-field input {
  width: 100%;
  min-height: 40px;
  border: 0;
  padding: 0;
  background: transparent;
}

select {
  min-width: 128px;
  padding: 0 11px;
}

.table-wrap {
  padding: 0 16px 16px;
}

.station-table-head,
.station-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, .88fr) minmax(116px, auto);
  gap: 12px;
  align-items: center;
}

.station-table-head > *,
.station-row > * {
  min-width: 0;
}

.station-table-head {
  min-height: 42px;
  color: var(--subtle);
  font-size: 12px;
  font-weight: 800;
}

.station-row {
  min-height: 92px;
  overflow: hidden;
  border-top: 1px solid rgba(156, 178, 206, .1);
  padding: 12px 0;
}

.station-name {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.station-name > div {
  min-width: 0;
  flex: 1 1 auto;
}

.station-title-line {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.station-code {
  flex: 0 0 auto;
  border: 1px solid rgba(74, 167, 255, .28);
  border-radius: 6px;
  padding: 5px 7px;
  color: #bfe2ff;
  background: rgba(74, 167, 255, .08);
  font-size: 12px;
  font-weight: 900;
}

.station-name strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  flex: 1 1 auto;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.station-name small {
  display: block;
  overflow: hidden;
  margin-top: 4px;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 999px;
  padding: 6px 9px;
  font-size: 12px;
  font-weight: 900;
}

.status-pill.ok { color: #c9fff0; background: rgba(37, 214, 162, .12); }
.status-pill.warn { color: #ffe2aa; background: rgba(255, 192, 92, .12); }
.status-pill.bad { color: #ffd0d7; background: rgba(255, 101, 119, .12); }

.metric-line {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  min-width: 0;
  gap: 8px;
}

.metric-line > div {
  min-width: 0;
}

.metric-line span {
  display: block;
  overflow: hidden;
  color: var(--subtle);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-line strong {
  display: block;
  overflow: hidden;
  margin-top: 4px;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.row-actions .btn {
  min-height: 34px;
  padding: 0 10px;
  font-size: 13px;
}

.side-stack {
  display: grid;
  align-content: start;
  gap: 16px;
}

.load-rank,
.alert-list {
  display: grid;
  gap: 10px;
  padding: 14px 16px 16px;
}

.load-item {
  display: grid;
  gap: 8px;
}

.load-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #dbe8f7;
  font-size: 13px;
}

.load-bar {
  overflow: hidden;
  height: 7px;
  border-radius: 999px;
  background: rgba(156, 178, 206, .12);
}

.load-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--blue));
}

.alert-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(255, 101, 119, .18);
  border-radius: 7px;
  padding: 10px;
  background: rgba(255, 101, 119, .06);
}

.alert-item strong {
  display: block;
  font-size: 13px;
}

.alert-item span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.empty-state {
  border: 1px dashed rgba(156, 178, 206, .22);
  border-radius: 8px;
  padding: 18px;
  color: var(--muted);
  text-align: center;
}

.chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.chart {
  height: 290px;
  min-width: 0;
}

.chart > div,
.chart canvas {
  max-width: 100% !important;
}

.chart.small {
  height: 250px;
}

.trend-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 12px 16px 0;
}

.trend-chip {
  position: relative;
  overflow: hidden;
  min-height: 50px;
  border: 1px solid rgba(156, 178, 206, .13);
  border-radius: 6px;
  padding: 9px 10px;
  background: rgba(255, 255, 255, .035);
}

.trend-chip::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 2px;
  background: var(--blue);
  content: "";
}

.trend-chip.avg::before { background: var(--green); }
.trend-chip.low::before { background: var(--amber); }

.trend-chip span,
.trend-chip strong {
  display: block;
}

.trend-chip span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.trend-chip strong {
  margin-top: 5px;
  overflow: hidden;
  font-size: 15px;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart.trend-chart {
  height: 202px;
}

.status-matrix {
  display: grid;
  gap: 14px;
  padding: 14px 16px 16px;
}

.status-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
  gap: 8px;
}

.device-cell {
  min-width: 0;
  min-height: 52px;
  border: 1px solid rgba(156, 178, 206, .12);
  border-left: 3px solid rgba(156, 178, 206, .35);
  border-radius: 6px;
  padding: 8px;
  background: rgba(255, 255, 255, .035);
  overflow: hidden;
}

.device-cell strong,
.device-cell span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.device-cell strong {
  color: var(--text);
  font-size: 13px;
  line-height: 1;
  letter-spacing: 0;
}

.device-cell span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.device-cell.charging { border-left-color: var(--green); background: rgba(37, 214, 162, .055); }
.device-cell.idle { border-left-color: #8bd37c; }
.device-cell.unknown { border-left-color: var(--amber); background: rgba(255, 192, 92, .045); }
.device-cell.fault { border-left-color: var(--amber); background: rgba(255, 192, 92, .055); }
.device-cell.offline { border-left-color: var(--red); background: rgba(255, 101, 119, .055); }

.status-bars {
  display: grid;
  gap: 9px;
}

.status-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.status-row strong {
  color: var(--text);
  text-align: right;
}

.status-track {
  overflow: hidden;
  height: 7px;
  border-radius: 999px;
  background: rgba(156, 178, 206, .14);
}

.status-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.status-row.idle .status-track i { background: #8bd37c; }
.status-row.unknown .status-track i { background: var(--amber); }
.status-row.fault .status-track i { background: var(--amber); }
.status-row.offline .status-track i { background: var(--red); }

.detail-hero {
  overflow: hidden;
  padding: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .032), rgba(255, 255, 255, .012)),
    var(--panel);
}

.detail-toolbar {
  justify-content: space-between;
}

.station-switch {
  display: flex;
  width: 100%;
  max-width: 100%;
  gap: 8px;
  overflow-x: auto;
  margin: 16px 0;
  padding-bottom: 4px;
}

.station-switch button {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 11px;
  background: rgba(255, 255, 255, .045);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.station-switch button.active {
  border-color: rgba(37, 214, 162, .36);
  background: rgba(37, 214, 162, .12);
  color: var(--text);
}

.detail-title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.detail-status {
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 900;
}

.detail-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 9px;
  margin-top: 16px;
}

.detail-metrics div {
  position: relative;
  overflow: hidden;
  min-height: 74px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px 13px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .052), rgba(255, 255, 255, .022));
}

.detail-metrics div::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 2px;
  background: rgba(37, 214, 162, .62);
  content: "";
}

.detail-metrics span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.detail-metrics strong {
  display: block;
  margin-top: 9px;
  font-size: 18px;
  line-height: 1;
  white-space: nowrap;
}

.pile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(236px, 1fr));
  gap: 10px;
  padding: 16px;
}

.pile-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 13px 13px 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, .018));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
}

.pile-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: rgba(37, 214, 162, .7);
  content: "";
}

.pile-card.bad::before {
  background: rgba(255, 101, 119, .72);
}

.pile-card.warn::before {
  background: rgba(255, 192, 92, .72);
}

.pile-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.pile-title {
  min-width: 0;
}

.pile-head h3 {
  margin: 0;
  font-size: 14px;
  line-height: 1.1;
  letter-spacing: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pile-head small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.soc-line {
  display: grid;
  grid-template-columns: auto minmax(54px, auto);
  align-items: end;
  gap: 10px;
  margin-top: 15px;
}

.soc-line span {
  color: #d7e4f2;
  font-size: 13px;
  line-height: 1.1;
}

.soc-line strong {
  justify-self: end;
  max-width: 72px;
  overflow: hidden;
  font-size: clamp(20px, 1.12vw, 23px);
  line-height: 1;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.progress {
  overflow: hidden;
  height: 6px;
  margin-top: 9px;
  border-radius: 999px;
  background: rgba(156, 178, 206, .13);
}

.progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--blue));
}

.rated-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 8px;
  margin-top: 10px;
  border: 1px solid rgba(74, 167, 255, .18);
  border-radius: 6px;
  padding: 8px 10px;
  background: linear-gradient(135deg, rgba(74, 167, 255, .13), rgba(37, 214, 162, .06));
}

.rated-band span {
  overflow: hidden;
  color: #9fb4ca;
  font-size: 11px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rated-band strong {
  overflow: hidden;
  color: #eef6ff;
  font-size: 18px;
  line-height: 1;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pile-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: 14px;
}

.pile-stats div {
  min-width: 0;
  border: 1px solid rgba(156, 178, 206, .08);
  border-radius: 5px;
  padding: 7px 8px;
  background: rgba(255, 255, 255, .04);
}

.pile-stats span {
  display: block;
  color: var(--subtle);
  font-size: 10px;
  font-weight: 800;
}

.pile-stats strong {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  font-size: 12px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fullscreen-view {
  position: fixed;
  inset: 0;
  z-index: 180;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: clamp(10px, .8vw, 14px);
  overflow: hidden;
  padding: clamp(12px, 1vw, 20px);
  background:
    linear-gradient(180deg, rgba(5, 13, 22, .9), rgba(5, 13, 22, .98)),
    url("earth-bg-optimized.jpg") center / cover no-repeat;
}

.fullscreen-header {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  gap: clamp(12px, 1vw, 18px);
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: clamp(10px, .8vw, 14px);
  background: rgba(5, 13, 22, .78);
  backdrop-filter: blur(14px);
}

.fullscreen-header p,
.fullscreen-header h2 {
  margin: 0;
}

.fullscreen-header p {
  color: var(--muted);
  font-size: clamp(12px, .85vw, 15px);
  font-weight: 800;
}

.fullscreen-header h2 {
  margin-top: 4px;
  font-size: clamp(22px, 1.65vw, 34px);
  line-height: 1.05;
}

.fullscreen-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(78px, 1fr));
  gap: 6px;
}

.fullscreen-summary div {
  min-width: 0;
  border: 1px solid rgba(156, 178, 206, .16);
  border-radius: 4px;
  padding: 7px 9px;
  background: rgba(255, 255, 255, .045);
}

.fullscreen-summary span,
.fullscreen-summary strong {
  display: block;
}

.fullscreen-summary span {
  color: var(--muted);
  font-size: clamp(10px, .6vw, 11px);
  font-weight: 800;
}

.fullscreen-summary strong {
  margin-top: 3px;
  font-size: clamp(15px, .9vw, 18px);
}

.fs-close {
  display: inline-flex;
  min-width: 72px;
  height: 34px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgba(255, 255, 255, .06);
  color: var(--text);
  font-weight: 900;
}

.fullscreen-grid {
  display: grid;
  min-height: 0;
  align-content: start;
  gap: clamp(8px, .75vw, 14px);
  overflow: hidden;
}

.fullscreen-grid.layout-4x2 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(2, clamp(310px, 36vh, 380px));
}

.fullscreen-grid.layout-2x2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, clamp(350px, 41vh, 430px));
}

.fullscreen-grid.layout-5x2 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-template-rows: repeat(2, clamp(285px, 32vh, 340px));
}

.fullscreen-grid.layout-3x2 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(2, clamp(330px, 39vh, 420px));
}

.fullscreen-grid.layout-auto {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  grid-auto-rows: minmax(220px, 1fr);
  overflow-y: auto;
}

.fullscreen-grid .pile-card {
  display: flex;
  min-height: 0;
  flex-direction: column;
  justify-content: stretch;
  border-color: rgba(156, 178, 206, .18);
  border-width: 1px;
  border-radius: 5px;
  padding: clamp(9px, .76vw, 15px);
  background:
    linear-gradient(180deg, rgba(12, 26, 40, .82), rgba(6, 15, 25, .76)),
    repeating-linear-gradient(0deg, rgba(156, 178, 206, .035) 0 1px, transparent 1px 36px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035);
  font-variant-numeric: tabular-nums;
}

.fullscreen-grid .fs-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-content: stretch;
  gap: clamp(7px, .58vw, 11px);
}

.fullscreen-grid .fs-card .pile-head {
  align-items: center;
  gap: clamp(8px, .7vw, 12px);
}

.fullscreen-grid .pile-head h3 {
  font-size: clamp(15px, 1vw, 20px);
  line-height: 1;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .1), 0 2px 10px rgba(0, 0, 0, .65);
}

.fullscreen-grid .pile-head small {
  display: block;
  font-size: clamp(10px, .68vw, 12px);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fullscreen-grid .status-pill {
  border-radius: 4px;
  padding: clamp(3px, .36vw, 5px) clamp(6px, .55vw, 9px);
  font-size: clamp(10px, .62vw, 12px);
  line-height: 1.15;
  white-space: nowrap;
}

.fullscreen-grid .soc-line {
  align-items: center;
  margin-top: clamp(12px, 1.2vw, 22px);
}

.fs-card-body {
  position: relative;
  display: grid;
  grid-template-columns: minmax(118px, .58fr) minmax(0, 1.42fr);
  height: 100%;
  align-content: center;
  align-items: stretch;
  gap: clamp(8px, .68vw, 14px);
  overflow: hidden;
  border: 1px solid rgba(156, 178, 206, .11);
  border-radius: 4px;
  padding: clamp(9px, .72vw, 14px);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .035), rgba(255, 255, 255, .01)),
    repeating-linear-gradient(90deg, rgba(156, 178, 206, .025) 0 1px, transparent 1px 42px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .055),
    inset 0 -1px 0 rgba(0, 0, 0, .38);
}

.fs-charge-panel {
  display: grid;
  gap: clamp(8px, .62vw, 12px);
  align-content: center;
  min-width: 0;
  height: 100%;
}

.fs-soc-block {
  display: flex;
  min-height: 0;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid rgba(156, 178, 206, .12);
  border-radius: 4px;
  padding: clamp(7px, .58vw, 11px) clamp(8px, .7vw, 13px);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .025));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .07),
    inset 0 -1px 0 rgba(0, 0, 0, .32);
}

.fs-soc-block span {
  color: var(--muted);
  font-size: clamp(10px, .62vw, 12px);
  font-weight: 900;
  letter-spacing: 0;
}

.fs-soc-block strong {
  font-size: clamp(24px, 1.75vw, 38px);
  line-height: 1;
  letter-spacing: 0;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, .12),
    0 -1px 0 rgba(0, 0, 0, .66),
    0 0 16px color-mix(in srgb, currentColor 36%, transparent);
}

.fullscreen-grid .soc-line strong {
  font-size: clamp(32px, 3vw, 60px);
  line-height: 1;
}

.fullscreen-grid .progress {
  height: clamp(5px, .38vw, 7px);
  margin-top: 0;
  border-radius: 3px;
}

.fullscreen-grid .pile-stats {
  gap: clamp(7px, .7vw, 12px);
  margin-top: clamp(12px, 1vw, 18px);
}

.fullscreen-grid .pile-stats div {
  padding: clamp(8px, .8vw, 12px);
}

.fullscreen-grid .pile-stats span {
  font-size: clamp(10px, .72vw, 13px);
}

.fullscreen-grid .pile-stats strong {
  font-size: clamp(13px, 1vw, 18px);
}

.fs-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(0, 1fr));
  align-self: stretch;
  height: 100%;
  gap: clamp(3px, .32vw, 6px);
}

.fs-metrics div {
  display: grid;
  grid-template-columns: minmax(34px, .62fr) minmax(0, 1fr) auto;
  align-items: center;
  align-content: center;
  column-gap: clamp(5px, .45vw, 10px);
  position: relative;
  min-height: 0;
  border: 1px solid rgba(156, 178, 206, .13);
  border-radius: 3px;
  padding: clamp(5px, .46vw, 8px) clamp(8px, .62vw, 12px);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .052), rgba(255, 255, 255, .024));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .055),
    inset 0 -1px 0 rgba(0, 0, 0, .28);
}

.fs-metrics div::before {
  position: absolute;
  top: 7px;
  bottom: 7px;
  left: 0;
  width: 2px;
  border-radius: 2px;
  content: "";
}

.fs-metric.rated::before { background: var(--violet); }
.fs-metric.power::before { background: var(--blue); }
.fs-metric.voltage::before { background: var(--green); }
.fs-metric.current::before { background: var(--amber); }
.fs-metric.energy::before { background: var(--cyan); }
.fs-metric.temp::before { background: var(--red); }
.fs-metric.duration::before { background: var(--violet); }

.fs-metrics strong,
.fs-metrics span,
.fs-metrics em {
  display: inline-flex;
  align-items: baseline;
  white-space: nowrap;
}

.fs-metrics strong {
  margin-top: 0;
  color: var(--text);
  font-size: clamp(15px, .86vw, 20px);
  line-height: 1;
  justify-self: center;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .1), 0 -1px 0 rgba(0, 0, 0, .55);
}

.fs-metric.rated strong { color: #d7c4ff; }
.fs-metric.power strong { color: #8ecbff; }
.fs-metric.voltage strong { color: #a7f7d5; }
.fs-metric.current strong { color: #ffd08a; }
.fs-metric.energy strong { color: #9be8ff; }
.fs-metric.temp strong { color: #ff9daa; }
.fs-metric.duration strong { color: #c1b8ff; }

.fs-metrics span {
  color: var(--muted);
  font-size: clamp(9px, .58vw, 11px);
  font-weight: 900;
}

.fs-metrics em {
  margin-top: 0;
  color: #8fb0d0;
  font-size: clamp(9px, .58vw, 11px);
  font-style: normal;
  font-weight: 900;
  justify-self: end;
}

@media (min-width: 2600px) and (min-aspect-ratio: 21 / 9) {
  .fs-card-body {
    grid-template-columns: minmax(190px, .54fr) minmax(0, 1.6fr);
    gap: clamp(10px, .72vw, 18px);
  }

  .fullscreen-grid .fs-card .pile-head {
    margin-bottom: 2px;
  }

  .fs-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
  }

  .fs-metrics div {
    min-height: 0;
  }
}

.fullscreen-grid {
  align-content: start;
  gap: clamp(10px, .9vw, 16px);
}

.fullscreen-grid.layout-4x2 {
  grid-template-rows: repeat(2, clamp(245px, 28vh, 315px));
}

.fullscreen-grid.layout-3x2 {
  grid-template-rows: repeat(2, clamp(250px, 29vh, 330px));
}

.fullscreen-grid.layout-5x2 {
  grid-template-rows: repeat(2, clamp(230px, 26vh, 285px));
}

.fullscreen-grid.layout-2x2 {
  grid-template-rows: repeat(2, clamp(290px, 35vh, 390px));
}

.fullscreen-grid .pile-card {
  border: 1px solid rgba(174, 203, 230, .22);
  border-radius: 7px;
  padding: clamp(12px, .9vw, 18px);
  background:
    linear-gradient(135deg, rgba(34, 54, 75, .56), rgba(12, 22, 36, .7)),
    radial-gradient(circle at 18% 18%, rgba(120, 188, 255, .12), transparent 32%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .1),
    inset 0 -1px 0 rgba(0, 0, 0, .42),
    0 14px 34px rgba(0, 0, 0, .22);
  backdrop-filter: blur(16px) saturate(118%);
}

.fullscreen-grid .fs-card {
  grid-template-rows: auto minmax(0, 1fr);
  gap: clamp(10px, .7vw, 14px);
}

.fullscreen-grid .pile-head h3 {
  font-size: clamp(16px, 1.02vw, 22px);
  font-weight: 950;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .1), 0 2px 12px rgba(0, 0, 0, .72);
}

.fullscreen-grid .status-pill {
  border-radius: 5px;
  padding: 4px 9px;
  background: rgba(38, 214, 162, .12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 0 18px rgba(37, 214, 162, .12);
}

.fs-card-body {
  display: grid;
  grid-template-columns: minmax(118px, .62fr) minmax(0, 2.18fr);
  height: 100%;
  align-items: center;
  gap: clamp(12px, .9vw, 18px);
  overflow: hidden;
  border: 1px solid rgba(190, 218, 246, .13);
  border-radius: 6px;
  padding: clamp(11px, .8vw, 16px);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .025)),
    repeating-linear-gradient(90deg, rgba(156, 178, 206, .025) 0 1px, transparent 1px 44px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .07),
    inset 0 -1px 0 rgba(0, 0, 0, .36);
}

.fs-charge-panel {
  display: grid;
  height: auto;
  min-width: 0;
  justify-items: center;
  align-content: center;
  gap: clamp(8px, .62vw, 12px);
}

.fs-soc-ring {
  --soc-color: var(--amber);
  position: relative;
  display: grid;
  width: clamp(92px, 7.1vw, 142px);
  aspect-ratio: 1;
  place-items: center;
  border-radius: 50%;
  background:
    conic-gradient(var(--soc-color) 0 calc(var(--soc) * 1%), rgba(122, 148, 174, .18) 0 100%);
  box-shadow:
    0 0 24px color-mix(in srgb, var(--soc-color) 24%, transparent),
    inset 0 0 0 1px rgba(255, 255, 255, .12),
    inset 0 0 22px rgba(0, 0, 0, .52);
}

.fs-soc-ring.no-soc {
  --soc-color: #91a4ba;
  background: conic-gradient(rgba(145, 164, 186, .28) 0 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, .1),
    inset 0 0 22px rgba(0, 0, 0, .52);
}

.fs-soc-ring::before {
  position: absolute;
  inset: 8px;
  border-radius: inherit;
  border: 1px solid rgba(255, 255, 255, .11);
  background:
    radial-gradient(circle at 50% 45%, rgba(255, 255, 255, .08), transparent 48%),
    rgba(8, 18, 31, .9);
  box-shadow:
    inset 0 2px 11px rgba(255, 255, 255, .06),
    inset 0 -6px 18px rgba(0, 0, 0, .5);
  content: "";
}

.fs-soc-ring::after {
  position: absolute;
  inset: 17px;
  border-radius: inherit;
  border: 1px solid rgba(156, 178, 206, .18);
  content: "";
}

.fs-soc-core {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 2px;
}

.fs-soc-core span {
  color: #9fb3c9;
  font-size: clamp(9px, .55vw, 11px);
  font-weight: 900;
  letter-spacing: 0;
}

.fs-soc-core strong {
  color: var(--soc-color);
  font-size: clamp(24px, 1.75vw, 36px);
  line-height: 1;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, .14),
    0 -1px 0 rgba(0, 0, 0, .68),
    0 0 18px color-mix(in srgb, var(--soc-color) 32%, transparent);
}

.fullscreen-grid .progress {
  width: min(100%, clamp(92px, 7.1vw, 142px));
  height: clamp(5px, .42vw, 8px);
  background: rgba(90, 115, 142, .24);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .4);
}

.fs-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  height: 100%;
  gap: clamp(6px, .55vw, 10px);
}

.fs-metrics div {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  align-items: center;
  gap: clamp(5px, .42vw, 9px);
  min-width: 0;
  border: 1px solid rgba(193, 219, 245, .16);
  border-radius: 6px;
  padding: clamp(7px, .58vw, 11px);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .075), rgba(255, 255, 255, .025));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .09),
    inset 0 -1px 0 rgba(0, 0, 0, .34),
    0 8px 18px rgba(0, 0, 0, .12);
}

.fs-metrics div::before {
  display: none;
}

.fs-metrics i {
  display: inline-grid;
  grid-row: 1 / 3;
  grid-column: 1;
  width: clamp(17px, 1.1vw, 22px);
  aspect-ratio: 1;
  place-items: center;
  border-radius: 50%;
  color: #a9bdd2;
  font-size: clamp(9px, .58vw, 11px);
  font-style: normal;
  font-weight: 950;
  background: rgba(182, 205, 230, .13);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), inset 0 -1px 0 rgba(0, 0, 0, .35);
}

.fs-metrics span {
  grid-column: 2 / 4;
  grid-row: 1;
  color: #a8b8ca;
  font-size: clamp(10px, .64vw, 12px);
  font-weight: 850;
}

.fs-metrics strong {
  grid-column: 2;
  grid-row: 2;
  justify-self: end;
  min-width: 0;
  font-size: clamp(15px, .92vw, 21px);
  font-weight: 950;
  text-align: right;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, .1),
    0 -1px 0 rgba(0, 0, 0, .6),
    0 0 16px rgba(120, 202, 255, .12);
}

.fs-metrics em {
  grid-column: 3;
  grid-row: 2;
  justify-self: end;
  color: #9cb1c8;
  font-size: clamp(9px, .58vw, 11px);
  font-style: normal;
  font-weight: 850;
}

@media (min-width: 2600px) and (min-aspect-ratio: 21 / 9) {
  .fullscreen-grid.layout-3x2 {
    grid-template-rows: repeat(2, clamp(245px, 30vh, 315px));
  }

  .fs-card-body {
    grid-template-columns: minmax(132px, .5fr) minmax(0, 2.8fr);
  }
}

.fullscreen-grid {
  --fs-cols: 3;
  --fs-rows: 2;
  --metric-cols: 3;
  --metric-rows: 2;
  --soc-size: clamp(92px, 6.4vw, 132px);
  --card-pad: clamp(10px, .72vw, 15px);
  --inner-pad: clamp(9px, .68vw, 14px);
  --metric-value-size: clamp(14px, .82vw, 19px);
  --metric-label-size: clamp(9px, .56vw, 11px);
  --metric-unit-size: clamp(8px, .5vw, 10px);
  grid-template-columns: repeat(var(--fs-cols), minmax(0, 1fr));
  grid-template-rows: repeat(var(--fs-rows), minmax(0, 1fr));
  align-content: stretch;
  height: 100%;
  min-height: 0;
}

.fullscreen-grid.layout-1 {
  --fs-cols: 1;
  --fs-rows: 1;
  --soc-size: clamp(150px, 10vw, 220px);
  --metric-value-size: clamp(20px, 1.18vw, 30px);
  --metric-label-size: clamp(12px, .68vw, 15px);
  --metric-unit-size: clamp(10px, .58vw, 13px);
  align-content: center;
  grid-template-rows: clamp(420px, 66vh, 680px);
  width: min(1180px, 100%);
  margin-inline: auto;
}

.fullscreen-grid.layout-2 {
  --fs-cols: 2;
  --fs-rows: 1;
  --soc-size: clamp(132px, 8.6vw, 190px);
  --metric-value-size: clamp(18px, 1.02vw, 26px);
  align-content: start;
  grid-template-rows: clamp(390px, 60vh, 620px);
}

.fullscreen-grid.layout-3 {
  --fs-cols: 3;
  --fs-rows: 1;
  --soc-size: clamp(118px, 7.3vw, 160px);
  --metric-value-size: clamp(16px, .92vw, 22px);
  align-content: start;
  grid-template-rows: clamp(360px, 52vh, 520px);
}

.fullscreen-grid.layout-4 {
  --fs-cols: 2;
  --fs-rows: 2;
  --soc-size: clamp(118px, 7.2vw, 160px);
  align-content: start;
  grid-template-rows: repeat(2, clamp(330px, 38vh, 400px));
}

.fullscreen-grid.layout-5,
.fullscreen-grid.layout-6 {
  --fs-cols: 3;
  --fs-rows: 2;
  align-content: start;
  grid-template-rows: repeat(2, minmax(0, 1fr));
}

.fullscreen-grid.layout-7,
.fullscreen-grid.layout-8 {
  --fs-cols: 4;
  --fs-rows: 2;
  --metric-cols: 2;
  --metric-rows: 3;
  --soc-size: clamp(62px, 4.1vw, 88px);
  --metric-value-size: clamp(13px, .74vw, 17px);
  align-content: start;
  grid-template-rows: repeat(2, minmax(0, 1fr));
}

.fullscreen-grid.layout-9,
.fullscreen-grid.layout-10 {
  --fs-cols: 5;
  --fs-rows: 2;
  --metric-cols: 2;
  --metric-rows: 3;
  --soc-size: clamp(68px, 4.35vw, 92px);
  --card-pad: clamp(8px, .55vw, 12px);
  --inner-pad: clamp(7px, .48vw, 10px);
  --metric-value-size: clamp(13px, .76vw, 17px);
  --metric-label-size: clamp(9px, .52vw, 11px);
  --metric-unit-size: clamp(8px, .44vw, 9px);
  align-content: start;
  grid-template-rows: repeat(2, minmax(0, 1fr));
}

.fullscreen-grid .pile-card {
  min-width: 0;
  min-height: 0;
  padding: var(--card-pad);
}

.fullscreen-grid .fs-card {
  overflow: hidden;
}

.fs-card-body {
  grid-template-columns: minmax(calc(var(--soc-size) + 18px), .6fr) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  gap: clamp(8px, .68vw, 14px);
  padding: var(--inner-pad);
  align-items: stretch;
  align-content: stretch;
}

.fullscreen-grid.layout-dense .fs-card-body,
.fullscreen-grid.layout-compact .fs-card-body {
  grid-template-columns: minmax(calc(var(--soc-size) + 10px), .52fr) minmax(0, 1fr);
}

.fullscreen-grid.layout-compact .fs-card-body {
  grid-template-columns: minmax(calc(var(--soc-size) + 8px), .28fr) minmax(0, 1fr);
  gap: clamp(6px, .5vw, 10px);
}

.fs-soc-ring {
  width: var(--soc-size);
}

.fs-charge-panel {
  height: 100%;
  align-content: center;
}

.fullscreen-grid.layout-compact .fs-charge-panel {
  gap: 5px;
}

.fullscreen-grid .progress {
  width: var(--soc-size);
}

.fullscreen-grid.layout-compact .progress {
  height: 3px;
  width: min(var(--soc-size), 58px);
}

.fs-metrics {
  grid-template-columns: repeat(var(--metric-cols), minmax(0, 1fr));
  grid-template-rows: repeat(var(--metric-rows), minmax(0, 1fr));
  min-width: 0;
  min-height: 0;
  gap: clamp(5px, .45vw, 9px);
}

.fs-metrics div {
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  align-content: center;
  column-gap: clamp(5px, .38vw, 8px);
  row-gap: 2px;
  padding: clamp(6px, .5vw, 10px);
}

.fullscreen-grid.layout-compact .fs-metrics div {
  padding: clamp(5px, .38vw, 8px);
  column-gap: 5px;
}

.fs-metrics i {
  grid-column: 1;
  grid-row: 1 / 3;
  width: clamp(16px, .95vw, 21px);
}

.fs-metrics span {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  overflow: hidden;
  font-size: var(--metric-label-size);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fs-metrics b {
  grid-column: 2;
  grid-row: 2;
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 3px;
  overflow: hidden;
  font-weight: 900;
}

.fs-metrics strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  font-size: var(--metric-value-size);
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fs-metrics em {
  display: block;
  flex: 0 0 auto;
  font-size: var(--metric-unit-size);
  white-space: nowrap;
}

.fs-metrics em:empty {
  display: none;
}

.fullscreen-grid.layout-compact .fs-metrics i {
  width: 16px;
  font-size: 8px;
}

.fullscreen-grid.layout-compact .fs-soc-ring::before {
  inset: 5px;
}

.fullscreen-grid.layout-compact .fs-soc-ring::after {
  inset: 10px;
}

.fullscreen-grid.layout-compact .fs-soc-core {
  gap: 1px;
}

.fullscreen-grid.layout-compact .fs-soc-core span {
  font-size: clamp(7px, .42vw, 9px);
}

.fullscreen-grid.layout-compact .fs-soc-core strong {
  font-size: clamp(12px, .84vw, 16px);
  letter-spacing: 0;
}

@media (max-width: 1500px) {
  .fullscreen-grid.layout-compact .fs-metrics div {
    grid-template-columns: minmax(0, 1fr);
    column-gap: 0;
  }

  .fullscreen-grid.layout-compact .fs-metrics i {
    display: none;
  }

  .fullscreen-grid.layout-compact .fs-metrics span,
  .fullscreen-grid.layout-compact .fs-metrics b {
    grid-column: 1;
  }

  .fullscreen-grid.layout-compact .fs-metrics strong {
    font-size: clamp(12px, .74vw, 14px);
  }
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.42fr) minmax(340px, .72fr);
  gap: 16px;
  margin-top: 16px;
}

.admin-kpi-grid .kpi-card strong {
  font-size: 24px;
}

.admin-table {
  min-width: 0;
  padding: 0 16px 16px;
}

.admin-table-head,
.admin-row {
  display: grid;
  grid-template-columns: minmax(210px, 1fr) 100px minmax(260px, 1fr) 132px minmax(220px, .9fr);
  gap: 12px;
  align-items: center;
}

.admin-table-head {
  min-height: 42px;
  color: var(--subtle);
  font-size: 12px;
  font-weight: 900;
}

.admin-row {
  min-height: 86px;
  border-top: 1px solid rgba(156, 178, 206, .1);
  padding: 12px 0;
}

.admin-row strong,
.admin-site-item strong {
  display: block;
  color: var(--text);
}

.admin-row small,
.admin-site-item span,
.muted-text {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.site-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.site-tag {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(74, 167, 255, .22);
  border-radius: 999px;
  padding: 0 8px;
  color: #cfe9ff;
  background: rgba(74, 167, 255, .08);
  font-size: 12px;
  font-weight: 800;
}

.site-tag button {
  display: inline-grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .1);
  color: currentColor;
  font-size: 13px;
  line-height: 1;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: flex-end;
}

.admin-actions .btn {
  min-height: 32px;
  padding: 0 9px;
  font-size: 12px;
}

@media (max-width: 1799px) and (min-width: 1281px) {
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .admin-layout > .side-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.readiness-list,
.admin-site-list {
  display: grid;
  gap: 10px;
  padding: 14px 16px 16px;
}

.readiness-item,
.admin-site-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(156, 178, 206, .12);
  border-radius: 7px;
  padding: 10px;
  background: rgba(255, 255, 255, .035);
}

.readiness-item strong {
  display: block;
  font-size: 13px;
}

.readiness-item span {
  display: block;
  overflow: hidden;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.readiness-item.waiting {
  border-color: rgba(255, 192, 92, .2);
  background: rgba(255, 192, 92, .055);
}

.admin-site-item {
  grid-template-columns: minmax(0, 1fr) auto;
}

.admin-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.admin-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
}

.admin-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.admin-form input,
.admin-form select {
  min-height: 42px;
  width: 100%;
  border: 1px solid rgba(156, 178, 206, .18);
  border-radius: 7px;
  outline: none;
  padding: 0 11px;
  background: rgba(255, 255, 255, .055);
  color: var(--text);
}

.admin-form input:focus,
.admin-form select:focus {
  border-color: rgba(37, 214, 162, .42);
}

.admin-form .btn {
  align-self: end;
}

@media (max-width: 1280px) {
  .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ops-layout, .detail-layout, .admin-layout { grid-template-columns: 1fr; }
  .side-stack { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-table-head, .admin-row { grid-template-columns: 1fr; }
  .admin-actions { justify-content: flex-start; }
}

@media (max-width: 1023px) {
  .sidebar { display: none; }
  .workspace { padding: 18px; }
  .topbar, .hero-band, .panel-head, .detail-title-row { align-items: flex-start; flex-direction: column; }
  .top-actions, .hero-actions, .filters { width: 100%; flex-wrap: wrap; }
  .top-actions .btn, .hero-actions .btn { flex: 1 1 130px; }
  .search-field { flex: 1 1 220px; }
  .chart-grid, .side-stack { grid-template-columns: 1fr; }
  .station-table-head { display: none; }
  .station-row {
    grid-template-columns: 1fr;
    gap: 10px;
    min-height: 0;
    border: 1px solid rgba(156, 178, 206, .1);
    border-radius: 8px;
    margin-top: 10px;
    padding: 13px;
    background: rgba(255, 255, 255, .025);
  }
  .row-actions { justify-content: flex-start; }
  .fullscreen-header { grid-template-columns: 1fr; }
  .fullscreen-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .admin-form-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .auth-screen { padding: 92px 14px 20px; }
  .auth-brand-lockup {
    top: 22px;
    left: 50%;
    width: 210px;
    transform: translateX(-50%);
  }
  .auth-shell { width: min(420px, 100%); }
  .auth-panel { padding: 28px 22px 24px; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-line { grid-template-columns: 1fr 1fr; }
  .chart { height: 240px; }
  .fullscreen-view {
    overflow-y: auto;
    gap: 10px;
    padding: 12px;
  }
  .fullscreen-header {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 12px;
  }
  .fullscreen-header h2 {
    font-size: clamp(28px, 9vw, 38px);
    line-height: 1.08;
    white-space: normal;
    word-break: break-word;
  }
  .fullscreen-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .fullscreen-grid,
  .fullscreen-grid.layout-2x2,
  .fullscreen-grid.layout-3x2,
  .fullscreen-grid.layout-4x2,
  .fullscreen-grid.layout-5x2,
  .fullscreen-grid[class*="layout-"] {
    --fs-cols: 1;
    --fs-rows: 1;
    --metric-cols: 2;
    --metric-rows: 3;
    --soc-size: 116px;
    grid-template-columns: 1fr;
    grid-template-rows: none;
    grid-auto-rows: auto;
    overflow: visible;
    width: 100%;
  }
  .fullscreen-grid .pile-card {
    min-height: auto;
    justify-content: flex-start;
    gap: 12px;
    padding: 14px;
  }
  .fullscreen-grid .pile-head h3 {
    font-size: 24px;
  }
  .fullscreen-grid .status-pill {
    font-size: 13px;
  }
  .fs-soc-block {
    gap: 4px;
  }
  .fs-soc-block strong,
  .fullscreen-grid .soc-line strong {
    font-size: 44px;
    line-height: 1;
  }
  .fullscreen-grid .progress {
    margin-top: 0;
  }
  .fs-metrics {
    gap: 8px;
  }
  .fs-metrics div {
    padding: 8px;
  }
  .fs-metrics strong {
    font-size: 18px;
  }
  .fs-metrics span {
    font-size: 11px;
  }
  .admin-form { grid-template-columns: 1fr; }
  .admin-site-item { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
  .workspace { padding: 14px; }
  .kpi-grid { grid-template-columns: 1fr; }
  .metric-line, .pile-stats, .detail-metrics { grid-template-columns: 1fr; }
  .btn { width: 100%; }
  .time-chip { width: 100%; text-align: center; }
}
