:root {
  --bg: #061321;
  --bg-2: #091b2d;
  --surface: #0d2238;
  --line: #173b59;
  --blue: #1597f6;
  --sky: #38c8f5;
  --text: #f1f7fc;
  --muted: #91a9bf;
  --ok: #22c785;
  --warn: #ffbd45;
  --alert: #ff5364;
  --idle: #62758a;
  --radius: 12px;
  --nav: 248px;
  --font: "Segoe UI", system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
}
button, input, select { font: inherit; color: inherit; }
button, select, input {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 8px;
}
button {
  padding: 0.45rem 0.75rem;
  cursor: pointer;
}
button:hover { border-color: var(--blue); }
h1, h2, h3, h4, p { margin: 0; }
h1 { font-size: 1.15rem; font-weight: 650; }
h2 { font-size: 1.25rem; font-weight: 650; }
.muted { color: var(--muted); }
.eyebrow {
  margin: 0 0 0.15rem;
  color: var(--sky);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.login {
  position: fixed;
  inset: 0;
  z-index: 40;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: var(--bg);
  overflow: auto;
}
#login[hidden],
#app[hidden],
.session-bar[hidden],
.view[hidden],
[hidden] {
  display: none !important;
}
.login-card {
  width: min(420px, 100%);
  display: grid;
  gap: 0.75rem;
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.login-card label, .account-form label, .filters label, .selector, .filter {
  display: grid;
  gap: 0.3rem;
  color: var(--muted);
  font-size: 0.85rem;
}
input, select { padding: 0.5rem 0.65rem; width: 100%; }
.account-message.is-error { color: var(--alert); }
.account-message.is-ok { color: var(--ok); }

.shell {
  display: grid;
  grid-template-columns: var(--nav) minmax(0, 1fr);
  min-height: 100vh;
  overflow-x: clip;
}
.nav {
  background: var(--bg-2);
  border-right: 1px solid var(--line);
  padding: 1rem 0.75rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
}
.nav-brand img {
  width: 100%;
  max-width: 220px;
  height: auto;
  display: block;
  margin: 0 auto 1.1rem;
}
.nav nav { display: grid; gap: 0.25rem; }
.nav button {
  display: flex;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  border-left: 3px solid transparent;
  border-radius: 0 8px 8px 0;
  padding: 0.65rem 0.75rem;
  color: var(--muted);
}
.nav button[aria-current="page"] {
  background: rgba(21, 151, 246, 0.14);
  border-left-color: var(--blue);
  color: var(--text);
  font-weight: 650;
}
.workspace { min-width: 0; }
.topbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
  position: sticky;
  top: 0;
  z-index: 20;
  min-width: 0;
}
.topbar > * { min-width: 0; }
.top-meta { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.5rem 0.75rem; align-items: center; }
.clock, .feed { color: var(--muted); font-size: 0.85rem; }
.session-bar { display: flex; align-items: center; gap: 0.5rem; }
.nav-toggle { display: none; }

main { padding: 1rem 1.25rem 2rem; }
.view-head, .filters, .filters-inline, .periods {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: end;
  justify-content: space-between;
}
.view-head { margin-bottom: 1rem; }
.filters { margin-bottom: 0.75rem; align-items: end; }
.filters label { min-width: 180px; }
.periods { justify-content: flex-start; margin-bottom: 0.75rem; }
.periods button[aria-pressed="true"] {
  border-color: var(--blue);
  color: var(--text);
}

.summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.summary article, .station, .chart-card, .side, .console, .table-wrap, .alert, .endpoint, .discovery, .map-side {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.summary article { padding: 1rem 1.05rem; min-height: 124px; display: grid; align-content: space-between; gap: 0.35rem; }
.summary span, .metric-label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  max-width: 100%;
  color: var(--muted);
  font-size: 0.92rem;
  overflow: hidden;
}
.summary span svg, .metric-label svg { width: 1.05rem; height: 1.05rem; color: var(--sky); flex: none; }
.metric-label-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.summary strong { font-size: 2rem; font-weight: 680; letter-spacing: -0.03em; line-height: 1.1; }
.summary strong small, .temp-hero small { margin-left: 0.2rem; color: var(--muted); font-size: 0.95rem; font-weight: 550; }
.summary small, .metric-hint { color: var(--muted); font-size: 0.82rem; }

.monitor {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(240px, 0.8fr);
  gap: 0.75rem;
  margin-bottom: 1rem;
  align-items: stretch;
}
.home-map { height: min(52vh, 520px); }
.map-side { padding: 1rem; display: grid; align-content: start; gap: 0.55rem; }
.map-side .temp-hero { font-size: 3rem; }

.stations { display: grid; gap: 0.85rem; }
.stations, .station, .station-body, .metrics, .channels, .forecast, .monitor, .map-stage, .sensor-detail {
  min-width: 0;
}
.station { padding: 1.05rem 1.1rem; cursor: pointer; display: grid; gap: 0.85rem; }
.station.is-selected { border-color: var(--blue); }
.station.is-stale, .station.is-offline { border-color: var(--line); }
.station-title { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.station h3 { font-size: 1.2rem; }
.station > header .muted { font-size: 0.82rem; margin-top: 0.35rem; }
.station-body {
  display: grid;
  grid-template-columns: minmax(150px, 0.55fr) minmax(0, 1.45fr);
  gap: 0.85rem 1rem;
  align-items: start;
}
.temp-block {
  display: grid;
  align-content: start;
  gap: 0.35rem;
  padding: 0.85rem 0.9rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  min-height: 100%;
}
.temp-hero {
  margin: 0;
  font-size: 3.4rem;
  font-weight: 680;
  letter-spacing: -0.04em;
  line-height: 0.95;
}
.temp-caption { color: var(--muted); font-size: 0.88rem; }
.temp-feels { color: var(--sky); font-size: 0.92rem; font-weight: 600; }
.connection {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
  background: var(--bg);
}
.connection::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--idle);
}
.connection.is-online { color: var(--ok); border-color: rgba(34, 199, 133, 0.45); }
.connection.is-online::before { background: var(--ok); }
.connection.is-offline { color: var(--idle); }
.connection.is-offline::before { background: var(--idle); }
.connection.is-stale { color: var(--warn); border-color: rgba(255, 189, 69, 0.45); }
.connection.is-stale::before { background: var(--warn); }
.connection.is-alert { color: var(--alert); border-color: rgba(255, 83, 100, 0.45); }
.connection.is-alert::before { background: var(--alert); }
.station-title .connection { flex: none; }
.station-actions { display: flex; align-items: center; gap: 0.4rem; flex: none; }

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}
.metric {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.7rem 0.75rem;
  display: grid;
  gap: 0.2rem;
  align-content: start;
  min-width: 0;
  overflow: hidden;
}
.map-side .metric-label,
.map-side .metric-value {
  font-size: 0.9rem;
}
.map-side .metric-value { font-size: 1.2rem; }
.metric-head { display: flex; align-items: center; gap: 0.35rem; }
.metric-icon { color: var(--sky); width: 1rem; height: 1rem; display: inline-flex; }
.metric-icon svg { width: 1rem; height: 1rem; }
.metric-value { font-size: 1.35rem; font-weight: 650; }
.metric-value small { margin-left: 0.2rem; color: var(--muted); font-size: 0.78rem; font-weight: 500; }

.sensor-detail { display: grid; gap: 0.65rem; }
.channels, .forecast { display: grid; gap: 0.5rem; }
.channels { grid-template-columns: 1fr 1fr; }
.forecast { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.channel, .forecast article {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
}
.channel h4, .forecast strong { color: var(--muted); font-size: 0.78rem; margin-bottom: 0.35rem; display: block; }
.channel-rows { display: grid; gap: 0.3rem; }
.channel-rows p, .forecast p { display: flex; justify-content: space-between; gap: 0.5rem; font-size: 0.9rem; }
.channel-rows p span { color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.6rem; }

.net-map { height: min(68vh, 640px); border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); }
.net-map.home-map { height: min(52vh, 520px); }
.leaflet-container { font-family: var(--font); background: var(--bg-2); }
.pin {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #061321;
  font-weight: 800;
  border: 2px solid #f1f7fc;
}
.pin-online { background: var(--ok); }
.pin-stale { background: var(--warn); }
.pin-offline { background: var(--idle); color: #f1f7fc; }
.map-popup { display: grid; gap: 0.2rem; min-width: 200px; color: #102033; }
.map-popup button { margin-top: 0.35rem; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 0.55rem 0.65rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; font-size: 0.75rem; }
tr.station-row { cursor: pointer; }
tr.station-row:hover td { background: rgba(21, 151, 246, 0.08); }

.chart-card { padding: 0.8rem; min-height: 220px; }
.chart-card svg { width: 100%; height: 260px; display: block; }
.chart-card text { fill: var(--muted); font-size: 11px; }
.chart-empty { color: var(--muted); padding: 1rem 0; }
.picks { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; margin-bottom: 0.75rem; }
.picks label { display: flex; gap: 0.4rem; align-items: center; color: var(--text); }
.chart-tip {
  margin-top: 0.45rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.alerts { display: grid; gap: 0.6rem; }
.alert { padding: 0.8rem 0.9rem; display: grid; gap: 0.25rem; }
.alert header { display: flex; justify-content: space-between; gap: 0.5rem; flex-wrap: wrap; }

.side, .console { margin-top: 0.75rem; }
.side summary, .console summary {
  cursor: pointer;
  padding: 0.85rem 1rem;
  font-weight: 650;
}
.side-body, .console-body { padding: 0 1rem 1rem; }
.account-form { display: grid; gap: 0.65rem; max-width: 520px; }
.account-list { list-style: none; padding: 0; margin: 0.8rem 0 0; display: grid; gap: 0.55rem; }
.account-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.4rem 0.6rem;
  align-items: center;
}
.account-mail { grid-column: 1 / -1; }
.account-actions { display: flex; gap: 0.35rem; }
.discoveries, .endpoints, .log-list { display: grid; gap: 0.5rem; }
.discovery, .endpoint, .log-row { padding: 0.7rem 0.8rem; }
.badge { color: var(--sky); font-size: 0.78rem; }
.log-summary { display: flex; flex-wrap: wrap; gap: 0.35rem 0.7rem; cursor: pointer; }
.log-time, .log-label { color: var(--muted); }
.log-station { color: var(--sky); }
.log-detail { margin-top: 0.45rem; white-space: pre-wrap; color: var(--muted); font-size: 0.82rem; }
.log-row:not(.is-open) .log-detail { display: none; }
.console-bar, .console-tools { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; justify-content: space-between; }
.hold { color: var(--warn); }
.empty { padding: 1rem; color: var(--muted); }

[data-admin][hidden] { display: none !important; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.tabbar { display: none; }
.more-sheet, .nav-backdrop { display: none; }

.wall-view {
  margin: -1rem -1.25rem -2rem;
  min-height: calc(100vh - 5.5rem);
}
.wall-stage {
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 0.45rem;
  min-height: calc(100vh - 5.5rem);
  padding: 0.75rem 0.9rem 0.9rem;
  background: #040d18;
}
.wall-stage:fullscreen {
  width: 100%;
  height: 100%;
  min-height: 100%;
  padding: 0.75rem 1rem 1rem;
}
.wall-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.65rem 1rem;
}
.wall-bar h2 { font-size: 1.05rem; }
.wall-controls { display: flex; flex-wrap: wrap; gap: 0.45rem; align-items: center; }
.wall-layouts {
  display: inline-flex;
  gap: 0.25rem;
  padding: 0.2rem;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.wall-layouts button {
  min-width: 2.4rem;
  padding: 0.4rem 0.55rem;
  background: transparent;
  border: 0;
  border-radius: 7px;
  color: var(--muted);
  font-weight: 650;
}
.wall-layouts button[aria-pressed="true"] {
  background: rgba(21, 151, 246, 0.2);
  color: var(--text);
}
.wall-note { font-size: 0.8rem; }
.wall-grid {
  display: grid;
  gap: 0.45rem;
  min-height: 0;
  height: 100%;
}
.wall-grid[data-layout="4"] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
}
.wall-grid[data-layout="6"] {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
}
.wall-grid[data-layout="8"] {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
}
.wall-grid[data-layout="10"] {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
}
.wall-tile {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 0.25rem;
  min-height: 0;
  padding: 0.55rem 0.65rem 0.5rem;
  background: linear-gradient(180deg, #0b1c2e 0%, #071421 100%);
  border: 1px solid #1a3f5c;
  border-radius: 8px;
  overflow: hidden;
}
.wall-tile.is-empty {
  place-items: center;
  color: var(--idle);
  border-style: dashed;
}
.wall-tile.is-stale { border-color: rgba(255, 189, 69, 0.55); }
.wall-tile.is-offline { border-color: rgba(98, 117, 138, 0.7); opacity: 0.85; }
.wall-tile.is-online { border-color: rgba(34, 199, 133, 0.35); }
.wall-tile.is-smn {
  border-color: rgba(56, 200, 245, 0.55);
  background: linear-gradient(180deg, #0c2438 0%, #081828 100%);
}
.wall-live.is-smn { color: var(--sky); }
.wall-live.is-smn::before { background: var(--sky); box-shadow: none; animation: none; }
.wall-smn-hint {
  color: var(--muted);
  font-size: clamp(0.62rem, 0.9vw, 0.75rem);
  line-height: 1.3;
}
.wall-empty-copy {
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
  padding: 0.5rem;
  font-size: 0.85rem;
}
.wall-tile-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.4rem;
}
.wall-tile-name {
  font-size: clamp(0.72rem, 1.1vw, 0.95rem);
  font-weight: 650;
  line-height: 1.2;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.wall-live {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ok);
}
.wall-live::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 0 rgba(34, 199, 133, 0.55);
  animation: wall-pulse 1.8s ease-out infinite;
}
.wall-live.is-stale { color: var(--warn); animation: none; }
.wall-live.is-offline { color: var(--idle); animation: none; }
@keyframes wall-pulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 199, 133, 0.55); }
  70% { box-shadow: 0 0 0 0.45rem rgba(34, 199, 133, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 199, 133, 0); }
}
.wall-temp {
  display: grid;
  place-content: center;
  text-align: center;
  font-size: clamp(1.8rem, 4.6vw, 3.6rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 0.95;
}
.wall-temp small {
  margin-left: 0.15rem;
  color: var(--muted);
  font-size: 0.4em;
  font-weight: 550;
}
.wall-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.25rem;
}
.wall-meta span {
  display: grid;
  gap: 0.05rem;
  padding: 0.28rem 0.3rem;
  background: rgba(6, 19, 33, 0.75);
  border: 1px solid rgba(23, 59, 89, 0.8);
  border-radius: 6px;
  text-align: center;
}
.wall-meta em {
  font-style: normal;
  color: var(--muted);
  font-size: clamp(0.58rem, 0.85vw, 0.7rem);
}
.wall-meta strong {
  font-size: clamp(0.72rem, 1.15vw, 0.95rem);
  font-weight: 650;
}
.wall-stamp {
  position: absolute;
  right: 0.55rem;
  bottom: 0.4rem;
  color: rgba(145, 169, 191, 0.75);
  font-size: 0.65rem;
}
@media (prefers-reduced-motion: reduce) {
  .wall-live::before { animation: none; }
}

@media (max-width: 1100px) {
  .summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.6rem;
    padding: 0.45rem 0.55rem;
    font-size: 0.78rem;
  }
  .nav {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 32;
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    width: min(84vw, 300px);
    box-shadow: 8px 0 28px rgba(0, 0, 0, 0.35);
  }
  body.nav-open .nav { transform: none; }
  .nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 31;
    background: rgba(2, 8, 16, 0.55);
    border: 0;
    padding: 0;
  }
  .nav-backdrop[hidden] { display: none !important; }
  .channels, .forecast { grid-template-columns: 1fr; }
  .monitor, .station-body { grid-template-columns: minmax(0, 1fr); }
  .home-map { height: min(48vh, 380px); }
  .net-map { height: min(58vh, 460px); }
  .temp-hero { font-size: 2.8rem; }
  .temp-block { min-height: 0; }
  .topbar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.55rem 0.7rem;
    padding: 0.7rem 0.9rem;
  }
  .brand-sub, .clock { display: none; }
  .topbar h1 { font-size: 0.98rem; line-height: 1.25; }
  .top-meta {
    justify-content: flex-end;
    gap: 0.35rem;
  }
  .top-meta .feed {
    max-width: 9.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.75rem;
  }
  .top-meta .connection { display: none; }
  .session-bar span { display: none; }
  .session-bar button { padding: 0.35rem 0.55rem; font-size: 0.8rem; }

  .view-head { margin-bottom: 0.7rem; }
  .view-head h2 { font-size: 1.1rem; }
  .view-head .muted { font-size: 0.82rem; }

  .summary {
    display: flex;
    gap: 0.65rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.35rem;
    margin-bottom: 0.85rem;
    grid-template-columns: none;
  }
  .summary article {
    flex: 0 0 min(70vw, 200px);
    scroll-snap-align: start;
    min-height: 108px;
    padding: 0.85rem 0.9rem;
  }
  .summary strong { font-size: 1.65rem; }

  .monitor { gap: 0.65rem; margin-bottom: 0.85rem; }
  .map-side {
    order: 2;
    padding: 0.9rem;
  }
  .map-side .temp-hero { font-size: 2.5rem; }
  .map-side .metrics { grid-template-columns: 1fr 1fr; }

  .station { padding: 0.95rem; gap: 0.7rem; }
  .station > header .muted {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .station-title { align-items: flex-start; }
  .station h3 { font-size: 1.08rem; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric { padding: 0.6rem 0.65rem; }
  .metric-value { font-size: 1.2rem; }

  .tabbar {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 25;
    background: rgba(9, 27, 45, 0.96);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--line);
    padding: 0.3rem 0.2rem calc(0.35rem + env(safe-area-inset-bottom));
  }
  .tabbar button {
    display: grid;
    justify-items: center;
    gap: 0.15rem;
    background: transparent;
    border: 0;
    color: var(--muted);
    font-size: 0.68rem;
    padding: 0.35rem 0.1rem;
    border-radius: 10px;
  }
  .tabbar button svg {
    width: 1.25rem;
    height: 1.25rem;
  }
  .tabbar button[aria-current="page"],
  .tabbar button[aria-expanded="true"] {
    color: var(--sky);
    font-weight: 700;
  }
  .more-sheet {
    display: grid;
    place-items: end center;
    position: fixed;
    inset: 0;
    z-index: 28;
    background: rgba(2, 8, 16, 0.55);
    padding: 0 0.75rem calc(4.8rem + env(safe-area-inset-bottom));
  }
  .more-sheet[hidden] { display: none !important; }
  .more-sheet-card {
    width: min(420px, 100%);
    display: grid;
    gap: 0.35rem;
    padding: 0.9rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px 14px 10px 10px;
  }
  .more-sheet-card button {
    text-align: left;
    background: var(--bg);
    border: 1px solid var(--line);
    padding: 0.75rem 0.85rem;
  }
  main { padding-bottom: 5.6rem; }
  .wall-view {
    margin: -1rem -0.75rem -2rem;
    min-height: calc(100vh - 8.5rem);
  }
  .wall-stage { min-height: calc(100vh - 8.5rem); padding-bottom: 0.75rem; }
  .wall-grid[data-layout="4"],
  .wall-grid[data-layout="6"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .wall-grid[data-layout="6"] { grid-template-rows: repeat(3, minmax(0, 1fr)); }
  .wall-grid[data-layout="8"],
  .wall-grid[data-layout="10"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .wall-grid[data-layout="8"] { grid-template-rows: repeat(4, minmax(0, 1fr)); }
  .wall-grid[data-layout="10"] { grid-template-rows: repeat(5, minmax(0, 1fr)); }
  .wall-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wall-temp { font-size: clamp(1.5rem, 8vw, 2.4rem); }
}
@media (max-width: 640px) {
  .channels, .forecast { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .account-row { grid-template-columns: 1fr; }
  main, .topbar { padding-left: 0.75rem; padding-right: 0.75rem; }
  .filters { flex-direction: column; align-items: stretch; }
  .filters label { min-width: 0; width: 100%; }
  .table-wrap { border: 0; background: transparent; }
  .picks { gap: 0.55rem; }
  .picks label { width: 100%; }
  .chart-card svg { height: 220px; }
}
@media (prefers-reduced-motion: reduce) {
  .nav { transition: none; }
}
