/* weather_center dashboard.
   Palette is the colorblind-validated reference set: hues are assigned to a
   role once and never cycled, so temperature is always orange and sound is
   always aqua no matter which panel you are reading. */

:root {
  color-scheme: light;

  --page: #f9f9f7;
  --surface: #fcfcfb;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #898781;
  --grid: #e1e0d9;
  --baseline: #c3c2b7;

  --good: #0ca30c;
  --warn: #d03b3b;

  --temp: #eb6834;
  --hum: #2a78d6;
  --press: #008300;
  --sound: #1baf7a;
  --peak: #4a3aa7;
  --sudden: #184f95;
  --ambient: #898781;

  --border: 1px solid rgba(11, 11, 11, 0.07);
  --radius: 16px;
  --shadow-sm: 0 1px 2px rgba(11, 11, 11, 0.04);
  --shadow: 0 1px 3px rgba(11, 11, 11, 0.05), 0 12px 28px -16px rgba(11, 11, 11, 0.16);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--page);
  background-image: radial-gradient(120% 60% at 100% 0%, rgba(27, 175, 122, 0.05), transparent 60%);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 1240px; margin: 0 auto; padding: 34px 24px 76px; }

/* --- masthead ------------------------------------------------------------ */

.masthead {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 20px; flex-wrap: wrap; margin-bottom: 22px;
  padding-bottom: 22px; border-bottom: var(--border);
}
.eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--sound);
}
.brand h1 { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; margin: 5px 0; }
.brand .sub { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.status { text-align: right; }
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface); border: var(--border); border-radius: 999px;
  padding: 7px 14px; font-size: 13px; color: var(--ink-2);
  box-shadow: var(--shadow-sm); white-space: nowrap;
}
.pill .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--muted); box-shadow: 0 0 0 3px rgba(137, 135, 129, 0.16);
}
.pill.live .dot { background: var(--good); box-shadow: 0 0 0 3px rgba(12, 163, 12, 0.16); }
.pill.stale .dot { background: var(--warn); box-shadow: 0 0 0 3px rgba(208, 59, 59, 0.16); }
.status-meta { color: var(--muted); font-size: 12px; margin-top: 9px; font-variant-numeric: tabular-nums; }

/* --- controls ------------------------------------------------------------ */

.controls {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 24px;
}
.seg {
  display: inline-flex; background: var(--surface); border: var(--border);
  border-radius: 999px; padding: 3px; box-shadow: var(--shadow-sm);
}
.seg button {
  border: 0; background: none; cursor: pointer; font: inherit; font-size: 13px;
  color: var(--ink-2); padding: 5px 13px; border-radius: 999px;
  transition: background .14s ease, color .14s ease;
}
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; }
select {
  font: inherit; font-size: 13px; color: var(--ink-2); background: var(--surface);
  border: var(--border); border-radius: 999px; padding: 6px 12px;
  box-shadow: var(--shadow-sm); cursor: pointer;
}
.spacer { flex: 1 1 auto; }
.toggle { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-2); cursor: pointer; }

/* --- layout -------------------------------------------------------------- */

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 292px; gap: 24px; align-items: start; }
.rail { position: sticky; top: 20px; }
.main section { margin-bottom: 28px; }
.section-h {
  font-size: 12px; font-weight: 700; letter-spacing: 0.07em;
  text-transform: uppercase; color: var(--muted); margin: 0 0 11px 3px;
}

@media (max-width: 880px) {
  .layout { grid-template-columns: 1fr; }
  .rail { position: static; }
  .masthead { align-items: flex-start; }
  .status { text-align: left; }
}

/* --- cards --------------------------------------------------------------- */

.card {
  background: var(--surface); border: var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.chart-card { padding: 12px 14px 8px; min-height: 320px; }
.mix-card, .dev-card { padding: 18px; }
.dev-card { margin-top: 18px; }
.card-h { font-size: 14px; font-weight: 700; letter-spacing: -0.01em; }
.card-sub { font-size: 12px; color: var(--muted); margin: 3px 0 14px; }

/* --- hero ---------------------------------------------------------------- */

.hero {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; padding: 22px 26px; margin-bottom: 22px;
}
.hero-l { display: flex; align-items: center; gap: 20px; min-width: 0; }
.hero-icon { font-size: 52px; line-height: 1; }
.hero-temp {
  font-size: 48px; font-weight: 680; letter-spacing: -0.03em; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.hero-temp .deg { font-size: 22px; font-weight: 600; color: var(--ink-2); margin-left: 2px; letter-spacing: 0; }
.hero-cond { font-size: 16px; font-weight: 600; margin-top: 8px; }
.hero-meta { font-size: 13px; color: var(--muted); margin-top: 4px; font-variant-numeric: tabular-nums; }
.hero-spark { flex: 0 0 230px; max-width: 40%; opacity: .95; }
.hero-spark .spark { width: 100%; height: 54px; display: block; }
@media (max-width: 620px) { .hero-spark { display: none; } }

/* --- tiles --------------------------------------------------------------- */

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 14px; margin-bottom: 28px; }
.tile {
  position: relative; background: var(--surface); border: var(--border);
  border-radius: 14px; padding: 15px 16px 14px 18px; box-shadow: var(--shadow-sm);
  overflow: hidden; transition: box-shadow .16s ease, transform .16s ease;
}
.tile:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.tile::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent, var(--muted)); }
.tile .label { color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
.tile .val { margin-top: 9px; letter-spacing: -.01em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.tile .num { font-size: 26px; font-weight: 600; }
.tile .unit { font-size: 14px; font-weight: 500; color: var(--ink-2); margin-left: 3px; }
.tile-spark { margin: 10px 0 6px; }
.tile-spark .spark { width: 100%; height: 34px; display: block; }
.tile-cap { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* --- sound mix ----------------------------------------------------------- */

.mix-bar {
  display: flex; height: 12px; border-radius: 999px; overflow: hidden;
  background: var(--page); box-shadow: inset 0 0 0 1px var(--grid); margin-bottom: 14px;
}
.mix-bar span { display: block; height: 100%; }
.mix-row { display: flex; align-items: center; gap: 8px; font-size: 12px; padding: 3px 0; }
.mix-row .sw { width: 10px; height: 10px; border-radius: 3px; flex: 0 0 auto; }
.mix-label { color: var(--ink-2); }
.mix-pct { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; }

/* --- device card --------------------------------------------------------- */

.dev-row {
  display: flex; align-items: baseline; gap: 8px; font-size: 12px;
  padding: 4px 0; border-top: 1px solid rgba(11, 11, 11, .05);
}
.dev-row:first-of-type { border-top: 0; }
.dev-k { color: var(--muted); }
.dev-v { margin-left: auto; font-variant-numeric: tabular-nums; }

/* --- banners / empty states ---------------------------------------------- */

.banner {
  border-radius: var(--radius); padding: 18px 20px; margin-bottom: 22px;
  border: var(--border); background: var(--surface); box-shadow: var(--shadow-sm);
  border-left: 3px solid var(--warn);
}
.banner.info { border-left-color: var(--hum); }
.banner h2 { margin: 0 0 6px; font-size: 15px; }
.banner p { margin: 0 0 10px; font-size: 13px; color: var(--ink-2); line-height: 1.5; }
.banner p:last-child { margin-bottom: 0; }
.banner code, pre.snippet {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  font-size: 12px;
}
pre.snippet {
  background: var(--page); border: 1px solid var(--grid); border-radius: 10px;
  padding: 11px 13px; overflow-x: auto; margin: 0; color: var(--ink-2); line-height: 1.55;
}
.hidden { display: none !important; }

footer {
  color: var(--muted); font-size: 12px; margin-top: 26px; padding-top: 18px;
  border-top: var(--border); font-variant-numeric: tabular-nums;
}
footer a { color: var(--ink-2); }
