:root {
  --bg: #ffffff; --fg: #1a1d21; --muted: #6b7280; --line: #e5e7eb;
  --accent: #2563eb; --ok: #15803d; --bad: #b91c1c; --chip: #f3f4f6;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115; --fg: #e6e8eb; --muted: #9aa1ab; --line: #262b33;
    --accent: #7aa2ff; --ok: #4ade80; --bad: #f87171; --chip: #1a1f27;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
header {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: .75rem 1.25rem; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: var(--bg); flex-wrap: wrap;
}
.brand { font-size: 15px; }
.muted { color: var(--muted); font-weight: normal; }
nav { display: flex; gap: .35rem; flex-wrap: wrap; }
nav button {
  border: 1px solid var(--line); background: none; color: var(--fg);
  padding: .35rem .9rem; border-radius: 999px; cursor: pointer; font: inherit;
}
nav button.active { background: var(--accent); border-color: var(--accent); color: #fff; }
nav button.ghost { border: none; color: var(--muted); }
main { padding: 1.25rem; max-width: 1200px; margin: 0 auto; }
h1 { font-size: 1.3rem; margin: 0 0 .25rem; }
h2 { font-size: 1.05rem; margin: 1.5rem 0 .5rem; }

#login-form {
  max-width: 340px; margin: 12vh auto 0; display: flex; flex-direction: column; gap: .8rem;
}
#login-form label { display: flex; flex-direction: column; gap: .25rem; font-weight: 600; }
#login-form input {
  font: inherit; padding: .5rem .6rem; border: 1px solid var(--line);
  border-radius: 8px; background: var(--bg); color: var(--fg);
}
#login-form button {
  font: inherit; font-weight: 600; padding: .55rem; border: none;
  border-radius: 8px; background: var(--accent); color: #fff; cursor: pointer;
}
.error { color: var(--bad); min-height: 1.2em; margin: 0; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; white-space: nowrap; }
th, td { text-align: left; padding: .45rem .75rem; border-top: 1px solid var(--line); }
thead th {
  border-top: none; font-size: 12px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); background: var(--chip); position: sticky; top: 0;
}
tbody tr:hover { background: var(--chip); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.ok { color: var(--ok); font-weight: 600; }
.bad { color: var(--bad); font-weight: 600; }
.chip {
  display: inline-block; background: var(--chip); border: 1px solid var(--line);
  border-radius: 999px; padding: 0 .5rem; font-size: 12px; margin-right: .2rem;
}
.totals { margin: .25rem 0 1rem; font-size: 15px; }
.totals b { font-variant-numeric: tabular-nums; }
#page-meta { margin-bottom: .75rem; }
code { background: var(--chip); padding: .05rem .3rem; border-radius: 4px; }

button.mini {
  font: inherit; font-size: 12px; padding: .1rem .55rem; border-radius: 6px;
  border: 1px solid var(--line); background: var(--chip); color: var(--fg); cursor: pointer;
}
button.mini.danger { color: var(--bad); border-color: var(--bad); }

#alert-banner {
  padding: .45rem 1.25rem; border-bottom: 1px solid var(--line);
  background: var(--chip); font-size: 13px;
}
.warnp { color: #b45309; font-weight: 600; }
@media (prefers-color-scheme: dark) { .warnp { color: #fbbf24; } }


/* Windy Word headline tiles — the six numbers Grant asked to see without
   hunting: installs, sign-ups, dictations, words, active people, crashes. */
.ww-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin: .6rem 0 .4rem;
}

.ww-tile {
  border: 1px solid var(--border, #d8dee9);
  border-radius: 10px;
  padding: 12px 14px;
  background: var(--card, rgba(127, 127, 127, .06));
}

.ww-tile-n {
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.15;
}

.ww-tile-l {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  opacity: .7;
  margin-top: 2px;
}

.ww-tile-s {
  font-size: .75rem;
  opacity: .55;
  margin-top: 3px;
}

/* Tooltips everywhere (2026-08-27). The popup is #wa-tip, a JS-positioned
   singleton — .table-wrap scrolls horizontally, which would clip a pure-CSS
   ::after tooltip at the table edge. Elements carrying data-tip get a
   dotted underline so the reader can SEE what is explainable. */
[data-tip] { cursor: help; }
th[data-tip], .ww-tile[data-tip] .ww-tile-l, h2[data-tip] {
  text-decoration: underline dotted var(--muted);
  text-underline-offset: 3px;
}
#wa-tip {
  display: none; position: fixed; z-index: 1000;
  background: var(--fg); color: var(--bg);
  padding: .55rem .7rem; border-radius: 8px;
  font-size: 12.5px; line-height: 1.45; font-weight: normal;
  box-shadow: 0 4px 16px rgba(0,0,0,.25);
  pointer-events: none; white-space: normal;
}

/* ── Overview (presentation view) ──────────────────────────────────────
   Chart tokens live beside the app tokens so light and dark swap in one
   place. The four categorical slots are the validated default palette
   (blue/orange/aqua/yellow); the dark column is the same four hues stepped
   for the dark surface, not an automatic flip. Every chart also ships a
   visible value label — three of the light steps sit under 3:1 on white,
   so the label IS the accessible encoding, not decoration. */
:root {
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100;
  --grid: #eceef1; --axis: #9aa1ab;
  --good: #15803d; --warn: #9a6700; --crit: #b91c1c;
}
@media (prefers-color-scheme: dark) {
  :root {
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500;
    --grid: #232830; --axis: #6b7280;
    --good: #4ade80; --warn: #d9a83f; --crit: #f87171;
  }
}
.ov-hero { border: 1px solid var(--line); border-radius: 12px; padding: 1.1rem 1.25rem; margin-bottom: 1rem; }
.ov-hero h2 { margin: 0 0 .2rem; font-size: 1.15rem; }
.ov-lede { color: var(--muted); margin: 0 0 .9rem; max-width: 70ch; }
.ov-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: .8rem; }
.ov-card { border: 1px solid var(--line); border-radius: 10px; padding: .9rem 1rem; }
.ov-card h3 { margin: 0 0 .15rem; font-size: .95rem; }
.ov-note { color: var(--muted); font-size: .85rem; margin: .3rem 0 0; }
.ov-figure { margin: .5rem 0 .2rem; overflow-x: auto; }
.ov-legend { display: flex; flex-wrap: wrap; gap: .25rem .9rem; margin: .4rem 0 0; font-size: .83rem; color: var(--muted); }
.ov-legend i { display: inline-block; width: .7rem; height: .7rem; border-radius: 2px; margin-right: .3rem; vertical-align: -1px; }
.ov-big { font-size: 2rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.ov-sub { color: var(--muted); font-size: .85rem; }
.ov-pill { display: inline-block; border-radius: 999px; padding: .1rem .55rem; font-size: .76rem; font-weight: 600; }
.ov-pill.good { background: color-mix(in srgb, var(--good) 15%, transparent); color: var(--good); }
.ov-pill.warn { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.ov-pill.crit { background: color-mix(in srgb, var(--crit) 15%, transparent); color: var(--crit); }
.ov-pill.off  { background: var(--chip); color: var(--muted); }

/* ── Overview: window control, deltas, explanations ────────────────────── */
.ov-window {
  display: flex; align-items: center; gap: .4rem; flex-wrap: wrap;
  margin: 0 0 1rem; padding: .5rem .65rem;
  border: 1px solid var(--line); border-radius: 10px; background: var(--chip);
}
.ov-wbtn {
  border: 1px solid var(--line); background: var(--bg); color: var(--fg);
  padding: .3rem .8rem; border-radius: 999px; cursor: pointer; font: inherit;
  font-size: .85rem;
}
.ov-wbtn:hover { border-color: var(--accent); }
.ov-wbtn.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.ov-wbtn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* A quiet pulse on the freshness dot: the one piece of motion on the page,
   and it earns its place by saying "this is live, not a screenshot". */
.ov-live {
  display: inline-block; width: .5rem; height: .5rem; border-radius: 50%;
  background: var(--ok); margin-right: .4rem; vertical-align: 1px;
  animation: ovpulse 2.4s ease-in-out infinite;
}
@keyframes ovpulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .ov-live { animation: none; } }

.ov-why {
  border: 1px solid var(--line); border-radius: 10px;
  padding: .55rem .85rem; margin: .5rem 0 1rem; background: var(--chip);
}
.ov-why > summary {
  cursor: pointer; font-weight: 600; font-size: .92rem; list-style: revert;
}
.ov-why > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ov-why > div { margin-top: .5rem; color: var(--muted); font-size: .9rem; }
.ov-why > div p { margin: .4rem 0; max-width: 78ch; }
.ov-why > div strong { color: var(--fg); }
.ov-why-lead { background: none; border-color: var(--accent); }
