:root {
  color-scheme: light;
  --page: #f5f4f0;
  --surface: #fcfcfb;
  --surface-2: #f0efec;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #898781;
  --line: #e1e0d9;
  --line-strong: #c3c2b7;
  --accent: #ff4742;
  --accent-soft: rgba(255, 71, 66, 0.1);
  --good: #006300;
  --bad: #c0342f;
  --m-clicks: #2a78d6;
  --m-impressions: #4a3aa7;
  --m-ctr: #1baf7a;
  --m-position: #eb6834;
  --tier-good: #0ca30c;
  --tier-warn: #fab219;
  --tier-bad: #d03b3b;
  --r-card: 16px;
  --r-pill: 999px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 12px 30px -16px rgba(0, 0, 0, 0.35);
  --font: 'Figtree', ui-sans-serif, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0d0d0d;
    --surface: #1a1a19;
    --surface-2: #232321;
    --ink: #ffffff;
    --ink-2: #c3c2b7;
    --line: #2c2c2a;
    --line-strong: #383835;
    --accent-soft: rgba(255, 71, 66, 0.16);
    --good: #0ca30c;
    --bad: #ff6b66;
    --m-clicks: #3987e5;
    --m-impressions: #9085e9;
    --m-ctr: #199e70;
    --m-position: #d95926;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 30px -16px rgba(0, 0, 0, 0.8);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d;
  --surface: #1a1a19;
  --surface-2: #232321;
  --ink: #ffffff;
  --ink-2: #c3c2b7;
  --line: #2c2c2a;
  --line-strong: #383835;
  --accent-soft: rgba(255, 71, 66, 0.16);
  --good: #0ca30c;
  --bad: #ff6b66;
  --m-clicks: #3987e5;
  --m-impressions: #9085e9;
  --m-ctr: #199e70;
  --m-position: #d95926;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 30px -16px rgba(0, 0, 0, 0.8);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 500 15px/1.4 var(--font);
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
[hidden] { display: none !important; }

/* ── Top bar ─────────────────────────────────────────── */
.bar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--page) 94%, transparent);
  border-bottom: 1px solid transparent;
  padding: 16px 32px 12px;
}
.bar.scrolled { border-bottom-color: var(--line); }
.bar-row { display: flex; align-items: center; gap: 10px; max-width: 1560px; margin: 0 auto; }
.spacer { flex: 1; }
.logo {
  flex: none; width: 46px; height: 46px; border-radius: 50%;
  background: var(--accent); color: #fff; display: grid; place-items: center;
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.logo svg { width: 24px; height: 24px; }
.logo.big { width: 64px; height: 64px; margin: 0 auto 12px; }
.logo.big svg { width: 34px; height: 34px; }
.pill {
  height: 44px; display: inline-flex; align-items: center; gap: 8px;
  padding: 0 18px; border-radius: var(--r-pill);
  border: 1.5px solid var(--line); background: var(--surface);
  font-weight: 700; font-size: 15px; white-space: nowrap;
}
.pill:hover { border-color: var(--line-strong); }
.pill-accent { color: var(--accent); border-color: var(--accent); }
.pill-accent:hover { background: var(--accent-soft); border-color: var(--accent); }
.pill-accent[aria-expanded="true"] { background: var(--accent); color: #fff; }
.pill .count { background: var(--accent); color: #fff; border-radius: var(--r-pill); font-size: 12px; padding: 1px 7px; }
.pill-accent[aria-expanded="true"] .count { background: #fff; color: var(--accent); }
.pill.icon { width: 44px; padding: 0; justify-content: center; }
.pill.icon svg { width: 18px; height: 18px; }
.pill.icon.spinning svg { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.search { flex: 0 1 340px; min-width: 0; cursor: text; }
.search svg { width: 18px; height: 18px; flex: none; color: var(--muted); }
.search input { border: 0; background: transparent; outline: none; min-width: 0; width: 100%; font-weight: 600; font-size: 16px; }
.search:focus-within { border-color: var(--ink); }
.sort select { border: 0; background: transparent; font-weight: 700; outline: none; cursor: pointer; padding-right: 2px; }
.sort:focus-within { border-color: var(--ink); }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: var(--r-pill); background: var(--surface); border: 1.5px solid var(--line); height: 44px; }
.seg button {
  border: 0; background: transparent; border-radius: var(--r-pill); padding: 0 12px;
  font-weight: 700; font-size: 14px; color: var(--ink-2); min-width: 36px;
}
.seg button:hover { color: var(--ink); background: var(--surface-2); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--surface); }

.filters {
  max-width: 1560px; margin: 12px auto 0; padding: 16px 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card);
  display: flex; flex-wrap: wrap; gap: 18px 28px; align-items: flex-start;
}
.filters h4 { margin: 0 0 8px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1.5px solid var(--line); background: var(--surface); border-radius: var(--r-pill);
  padding: 5px 12px; font-weight: 700; font-size: 14px; display: inline-flex; gap: 6px; align-items: center;
}
.chip .n { color: var(--muted); font-weight: 600; }
.chip[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.chip[aria-pressed="true"] .n { color: inherit; opacity: 0.8; }
.toggle { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; cursor: pointer; padding: 3px 0; }
.toggle input { width: 18px; height: 18px; accent-color: var(--accent); }

/* ── Main ───────────────────────────────────────────── */
main { max-width: 1560px; margin: 0 auto; padding: 8px 32px 64px; }
.status { color: var(--muted); font-weight: 600; margin: 8px 0 16px; min-height: 1.4em; }
.status .err { color: var(--bad); }
#results { transition: opacity 0.2s; }
#results.stale { opacity: 0.45; pointer-events: none; }

.fleet { display: flex; flex-wrap: wrap; align-items: stretch; gap: 12px; margin: 8px 0 4px; }
.tile {
  flex: 1 1 170px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card);
  padding: 14px 18px 12px; position: relative; overflow: hidden;
}
.tile .label { font-size: 13px; font-weight: 700; color: var(--ink-2); display: flex; align-items: center; gap: 7px; }
.tile .key { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.tile .value { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; margin-top: 2px; }
.tile .delta { font-size: 13px; font-weight: 700; }
.tile .spark { position: absolute; right: 12px; bottom: 12px; width: 96px; height: 34px; }
.tile .spark .l { fill: none; stroke: var(--c); stroke-width: 1.5; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.fleet .meta { flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: 4px 18px; color: var(--ink-2); font-size: 14px; font-weight: 600; padding: 2px 4px 0; }
.fleet .meta b { color: var(--ink); }
.fleet .meta .owner { color: var(--accent); }
.fleet .meta .owner b { color: var(--accent); }

.up { color: var(--good); }
.down { color: var(--bad); }
.flat { color: var(--muted); }

/* ── Cards (the Nomads grid) ─────────────────────────── */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(236px, 1fr)); gap: 24px; }
.card {
  position: relative; aspect-ratio: 1 / 1.08; border-radius: var(--r-card); overflow: hidden; color: #fff; cursor: pointer;
  background: linear-gradient(165deg, #282c39 0%, #15161c 100%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: var(--shadow); isolation: isolate; container-type: inline-size;
  transition: transform 0.18s ease;
  --art: #b3c0ff;
  --k: 0;
  --up-ink: #9ff0bf;
  --down-ink: #ffb3aa;
}
/* Growth tint: the colour layer's opacity follows the size of the move (set per card as --k). */
.card::before {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: var(--tint, none); opacity: var(--k);
}
.card.t-up { --tint: linear-gradient(165deg, #33805a 0%, #102a1d 100%); --art: #8ae6ae; }
.card.t-down { --tint: linear-gradient(165deg, #8f3a33 0%, #2d1212 100%); --art: #ffa197; }
.card.t-none { background: linear-gradient(165deg, #2d2d2b 0%, #1b1b1a 100%); --art: #74736d; }
.card:hover { transform: translateY(-3px); }
.card:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

/* Face: four rows that line up on every card (top stats, title, chart, bottom stats). */
.card .face {
  --px: clamp(12px, 7cqi, 18px);
  --tf: clamp(16px, 10.5cqi, 24px);
  --sub: clamp(12px, 5.8cqi, 15px);
  position: absolute; inset: 0; display: grid;
  grid-template-rows: auto calc(var(--tf) * 2.2 + var(--sub) * 1.3 + 10px) minmax(0, 1fr) auto;
  padding: clamp(11px, 6.5cqi, 16px) var(--px) clamp(10px, 5.5cqi, 14px);
  transition: opacity 0.16s ease;
}
.card .c-top { display: flex; justify-content: space-between; align-items: flex-start; }
.card .rank {
  font-size: clamp(17px, 8.5cqi, 21px); font-weight: 800; line-height: 1; margin-top: 3px;
  padding-bottom: 5px; border-bottom: 3px solid #fff; min-width: 15px; text-align: center;
}
.card .c-title { display: grid; align-content: end; justify-items: center; text-align: center; gap: 3px; padding-bottom: 2px; min-height: 0; }
.card .c-title h3 {
  margin: 0; font-size: min(var(--tf), calc(86cqi / (var(--len) * 0.57))); font-weight: 800;
  letter-spacing: -0.01em; line-height: 1.1; text-wrap: balance;
}
.card .c-title p { margin: 0; font-size: var(--sub); font-weight: 600; opacity: 0.8; display: inline-flex; gap: 6px; align-items: center; }
.card .c-title img { width: 1em; height: 1em; border-radius: 4px; background: rgba(255, 255, 255, 0.85); }
.card .c-art { position: relative; margin: clamp(4px, 2.5cqi, 8px) calc(var(--px) * -1) clamp(4px, 2.5cqi, 8px); min-height: 0; }
.card .c-art svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.card .art .line { fill: none; stroke: var(--art); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; opacity: 0.95; }
.card .c-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 8px; }
.card .grp { display: flex; gap: clamp(10px, 6cqi, 18px); }
.card .stat { display: flex; flex-direction: column; gap: 2px; line-height: 1.05; min-width: 0; }
.card .stat.r { align-items: flex-end; text-align: right; }
.card .stat .vl { display: flex; align-items: center; gap: 6px; }
.card .stat b { font-size: clamp(15px, 8cqi, 20px); font-weight: 800; letter-spacing: -0.01em; }
.card .c-top .stat b { font-size: clamp(17px, 9.5cqi, 24px); }
.card .stat small { font-size: clamp(9px, 4.2cqi, 10.5px); font-weight: 800; letter-spacing: 0.06em; opacity: 0.66; }
.card .dp {
  font-size: clamp(9.5px, 4.6cqi, 11.5px); font-weight: 800; line-height: 1; padding: 3px 6px; border-radius: var(--r-pill);
  white-space: nowrap; color: rgba(255, 255, 255, 0.8); background: rgba(255, 255, 255, 0.1);
}
.card .dp.up { color: var(--up-ink); background: rgba(138, 230, 174, 0.15); }
.card .dp.down { color: var(--down-ink); background: rgba(255, 161, 151, 0.15); }
.card .empty-note { font-size: clamp(11px, 5cqi, 13px); font-weight: 600; opacity: 0.65; }

/* Hover face: this period vs the previous one, plus top queries */
.card .hov {
  position: absolute; inset: 0; background: rgba(12, 12, 14, 0.5); opacity: 0; transition: opacity 0.16s ease;
  padding: clamp(42px, 20cqi, 52px) var(--hpx, clamp(12px, 7cqi, 18px)) clamp(10px, 5.5cqi, 14px);
  display: flex; flex-direction: column; gap: clamp(6px, 3cqi, 9px); pointer-events: none;
}
.card:hover .hov, .card:focus-visible .hov { opacity: 1; pointer-events: auto; }
.card:hover .face, .card:focus-visible .face { opacity: 0; }
.card .hov h5 { margin: 0; font-size: clamp(10.5px, 4.8cqi, 12px); font-weight: 700; opacity: 0.6; }
.cmp { display: grid; grid-template-columns: max-content 1fr auto; gap: clamp(5px, 2.6cqi, 8px) 10px; align-items: center; }
.cmp .l { font-size: clamp(12px, 5.6cqi, 14px); font-weight: 700; }
.cmp .v { font-size: clamp(10.5px, 5cqi, 12.5px); font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; color: rgba(255, 255, 255, 0.7); }
.cmp .v.up { color: var(--up-ink); }
.cmp .v.down { color: var(--down-ink); }
.bar2 { position: relative; height: clamp(7px, 3.4cqi, 9px); border-radius: var(--r-pill); background: rgba(255, 255, 255, 0.1); }
.bar2 .c { position: absolute; left: 0; top: 0; bottom: 0; border-radius: var(--r-pill); background: rgba(255, 255, 255, 0.5); }
.bar2.up .c { background: linear-gradient(90deg, rgba(138, 230, 174, 0.45), #8ae6ae); }
.bar2.down .c { background: linear-gradient(90deg, rgba(255, 161, 151, 0.45), #ffa197); }
.bar2 .p { position: absolute; top: -3px; bottom: -3px; width: 2px; border-radius: 1px; background: #fff; opacity: 0.85; }
.tq { margin-top: auto; border-top: 1px solid rgba(255, 255, 255, 0.12); padding-top: clamp(5px, 2.6cqi, 8px); font-size: clamp(11px, 5.2cqi, 13px); }
.tq h5 { margin: 0 0 2px; }
.tq div { display: flex; justify-content: space-between; gap: 10px; line-height: 1.5; }
.tq span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tq b { font-variant-numeric: tabular-nums; flex: none; font-weight: 700; opacity: 0.8; }
.card .corner {
  position: absolute; top: 12px; z-index: 2; height: 30px; border-radius: var(--r-pill); border: 0;
  background: rgba(255, 255, 255, 0.14); color: #fff; font-weight: 700; font-size: 13px;
  display: inline-flex; align-items: center; gap: 5px; padding: 0 11px; opacity: 0; transition: opacity 0.16s ease;
  text-decoration: none;
}
.card .corner:hover { background: rgba(255, 255, 255, 0.26); }
.card .corner svg { width: 15px; height: 15px; }
.card .pin { left: 12px; }
.card .gsc { right: 12px; }
.card:hover .corner, .card:focus-within .corner, .card .pin.on { opacity: 1; }
.card .pin.on { background: var(--accent); }
.card.pinned .rank { visibility: hidden; }
.card .pin.on svg path { fill: #fff; }

/* ── List view ──────────────────────────────────────── */
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { padding: 10px 14px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--line); }
th { font-size: 13px; font-weight: 700; color: var(--ink-2); position: sticky; top: 0; background: var(--surface); z-index: 1; }
th button { border: 0; background: none; padding: 0; font-weight: 700; color: inherit; display: inline-flex; align-items: center; gap: 4px; }
th button:hover { color: var(--ink); }
th[aria-sort] button { color: var(--ink); }
th .arrow { font-size: 10px; }
th:first-child, td:first-child { text-align: left; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: 0; }
td .sub { display: block; font-size: 12px; font-weight: 700; }
.prop { display: flex; align-items: center; gap: 10px; }
.prop img { width: 18px; height: 18px; border-radius: 4px; flex: none; }
.prop b { font-weight: 700; }
.prop .g { color: var(--muted); font-weight: 600; font-size: 13px; }
.rk { color: var(--muted); width: 28px; display: inline-block; font-weight: 700; }
td.sp svg { width: 120px; height: 28px; display: block; margin-left: auto; }
td.sp .line { fill: none; stroke: var(--m-impressions); stroke-width: 1.5; vector-effect: non-scaling-stroke; }

/* ── Detail sheet ───────────────────────────────────── */
dialog {
  width: min(1180px, calc(100vw - 48px)); max-width: none; height: calc(100vh - 48px); max-height: none;
  padding: 0; border: 0; border-radius: var(--r-card); background: var(--surface); color: var(--ink);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.5);
}
dialog::backdrop { background: rgba(10, 10, 10, 0.55); }
.sheet { height: 100%; overflow-y: auto; overscroll-behavior: contain; outline: none; }
.sheet-head {
  position: sticky; top: 0; z-index: 5; background: var(--surface); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px; padding: 14px 20px;
}
.sheet-head img { width: 28px; height: 28px; border-radius: 7px; }
.sheet-head h2 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.sheet-head .g { color: var(--muted); font-weight: 600; }
.sheet-head .grow { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.btn-ghost {
  height: 38px; border-radius: var(--r-pill); border: 1.5px solid var(--line); background: var(--surface);
  padding: 0 14px; font-weight: 700; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; color: var(--ink); text-decoration: none;
}
.btn-ghost:hover { border-color: var(--line-strong); }
.btn-ghost.sq { width: 38px; padding: 0; justify-content: center; }
.btn-ghost svg { width: 16px; height: 16px; }
.sheet-body { padding: 16px 20px 28px; }
.drill { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; min-height: 0; }
.drill:empty { display: none; }
.drill .chip { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); max-width: 100%; }
.drill .chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 520px; }
.drill .chip button { border: 0; background: none; color: inherit; padding: 0 0 0 2px; font-size: 16px; line-height: 1; font-weight: 800; }
.drill .clear { border: 0; background: none; color: var(--ink-2); font-weight: 700; font-size: 14px; text-decoration: underline; }
.mtiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.mtile {
  text-align: left; border: 1.5px solid var(--line); background: var(--surface); border-radius: 12px;
  padding: 12px 14px; position: relative; overflow: hidden;
}
.mtile::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--c); opacity: 0.35; }
.mtile[aria-pressed="true"] { border-color: var(--c); box-shadow: inset 0 0 0 1px var(--c); }
.mtile[aria-pressed="true"]::before { opacity: 1; }
.mtile .label { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.mtile .value { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; }
.mtile .delta { font-size: 13px; font-weight: 700; }
.chart { position: relative; margin: 16px 0 6px; min-height: 250px; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .grid-l { stroke: var(--line); stroke-width: 1; }
.chart .base { stroke: var(--line-strong); stroke-width: 1; }
.chart text { fill: var(--muted); font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.chart .cur { fill: none; stroke: var(--c); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: var(--c); opacity: 0.1; }
.chart .prev { fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-linejoin: round; opacity: 0.8; }
.chart .xh { stroke: var(--ink-2); stroke-width: 1; }
.chart .dot { stroke: var(--surface); stroke-width: 2; }
.chart:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 8px; }
.legend { display: flex; gap: 18px; font-size: 13px; font-weight: 600; color: var(--ink-2); margin: 16px 0 0; flex-wrap: wrap; }
.legend:empty { display: none; }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 16px; height: 0; border-top: 2px solid var(--c); display: inline-block; }
.legend i.p { border-top: 1.5px solid var(--muted); }
.tip {
  position: absolute; pointer-events: none; background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow); padding: 8px 11px; font-size: 13px; min-width: 150px; z-index: 3;
}
.tip .dt { color: var(--ink-2); font-weight: 700; margin-bottom: 4px; }
.tip .row { display: flex; align-items: center; gap: 8px; line-height: 1.6; }
.tip .row b { font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; }
.tip .row span { color: var(--muted); font-weight: 600; }
.tip .row i { width: 12px; border-top: 2px solid var(--c); }
.tip .row i.p { border-top-color: var(--muted); }

.tabs-row { display: flex; align-items: center; gap: 12px; margin: 18px 0 10px; flex-wrap: wrap; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); flex: 1; min-width: 0; overflow-x: auto; }
.tabs button {
  border: 0; background: none; padding: 10px 14px; font-weight: 700; font-size: 15px; color: var(--ink-2);
  border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.rowsearch { height: 38px; border-radius: var(--r-pill); border: 1.5px solid var(--line); background: var(--surface); padding: 0 14px; font-weight: 600; font-size: 16px; width: 240px; outline: none; }
.rowsearch:focus { border-color: var(--ink); }
.dtable { border: 1px solid var(--line); border-radius: 12px; overflow: auto; max-height: 70vh; }
.dtable td:first-child { max-width: 520px; overflow: hidden; text-overflow: ellipsis; }
.dtable td .key { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; }
.dtable td .key span { overflow: hidden; text-overflow: ellipsis; }
.dtable td .new { font-size: 11px; font-weight: 800; color: var(--accent); background: var(--accent-soft); border-radius: var(--r-pill); padding: 1px 7px; flex: none; }
.dtable td .ext { color: var(--muted); display: inline-flex; flex: none; }
.dtable td .ext:hover { color: var(--ink); }
.dtable td .ext svg { width: 14px; height: 14px; }
.dtable tr.nodrill { cursor: default; }
.dtable .v { display: inline-block; min-width: 44px; }
.dtable .dl { display: inline-block; min-width: 78px; padding-left: 8px; font-size: 12.5px; font-weight: 700; text-align: right; }
.hbar { display: block; height: 3px; border-radius: 2px; background: var(--c); opacity: 0.55; margin-top: 3px; margin-left: auto; }
.dnote { color: var(--muted); font-size: 13px; font-weight: 600; margin: 8px 2px 0; }
.loading-soft { opacity: 0.45; transition: opacity 0.2s; }

/* row-hover popover */
.pop {
  position: fixed; z-index: 1000; background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow); padding: 10px 12px; width: 280px; pointer-events: none; font-size: 13px;
}
.pop .pt { font-weight: 700; margin-bottom: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pop .ps { color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.pop svg { width: 100%; height: 60px; display: block; }
.pop svg .l { fill: none; stroke: var(--c); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }

/* ── Landing / sign in ──────────────────────────────── */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: min(520px, 100%); text-align: center; padding: 24px 8px; }
.login-card h1 { margin: 0; font-size: clamp(30px, 6vw, 44px); font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; text-wrap: balance; }
.login-card .lede { margin: 14px auto 26px; max-width: 440px; font-size: 17px; font-weight: 500; color: var(--ink-2); text-wrap: balance; }
.gbtn {
  display: inline-flex; align-items: center; gap: 12px; height: 54px; padding: 0 26px; border-radius: var(--r-pill);
  background: var(--accent); color: #fff; font-weight: 800; font-size: 17px; text-decoration: none;
  box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow); transition: transform 0.15s ease;
}
.gbtn:hover { transform: translateY(-1px); }
.gbtn svg { width: 24px; height: 24px; background: #fff; border-radius: 50%; padding: 3px; }
.checks { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 8px; justify-items: center; font-weight: 600; color: var(--ink-2); }
.checks li { display: flex; gap: 8px; align-items: center; }
.checks li::before { content: ''; width: 16px; height: 16px; flex: none; border-radius: 50%; background: var(--good) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 8.2l2.2 2.2 4.8-4.8' stroke='white' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/100% no-repeat; }
.login-card .err { color: var(--bad); font-weight: 700; margin: 18px 0 0; min-height: 1.2em; }
.login-card .fine { margin: 18px 0 0; font-size: 13px; color: var(--muted); font-weight: 500; }
.login-card .fine a { color: inherit; }

.empty { text-align: center; padding: 64px 16px; color: var(--ink-2); font-weight: 600; }
.empty button { margin-top: 10px; }

/* ── Small screens ─────────────────────────────────── */
@media (max-width: 1100px) {
  .bar-row { flex-wrap: wrap; }
  .spacer { display: none; }
  .search { flex: 1 1 150px; }
  .bar-row { gap: 8px; }
  .sort .muted { display: none; }
}
@media (max-width: 720px) {
  .bar { padding: 10px 16px; position: static; }
  main { padding: 4px 16px 48px; }
  .pill { height: 42px; padding: 0 14px; }
  .seg { height: 42px; }
  .seg button { padding: 0 9px; }
  .logo { width: 42px; height: 42px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .card { aspect-ratio: 4 / 5.2; }
  .card .grp .stat + .stat { display: none; }
  .card .stat small { letter-spacing: 0.03em; }
  .status { margin: 4px 0 8px; }
  .card .hov { display: none; }
  .card:hover .face { opacity: 1; }
  .card .corner { display: none; }
  .tile { flex: 1 1 calc(50% - 6px); padding: 10px 12px; }
  .fleet { gap: 8px; }
  .tile .value { font-size: 22px; }
  .tile .spark { display: none; }
  .fleet .meta { font-size: 13px; gap: 2px 12px; }
  .fleet .meta div:nth-child(n+3) { display: none; }
  #range { order: 1; }
  #refresh { order: 2; }
  .sort { order: 3; }
  #view { order: 4; }
  .bar-row { gap: 8px; }
  dialog { width: 100vw; height: 100dvh; border-radius: 0; }
  .sheet-head { padding: 10px 12px; flex-wrap: wrap; }
  .sheet-head h2 { font-size: 18px; }
  .sheet-head .gsclabel { display: none; }
  .sheet-body { padding: 12px 12px 24px; }
  .mtiles { grid-template-columns: repeat(2, 1fr); }
  .mtile .value { font-size: 22px; }
  .rowsearch { width: 100%; }
  .dtable td:first-child { max-width: 180px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

.credit { text-align: center; margin: 40px 0 0; font-size: 13px; font-weight: 600; color: var(--muted); }
.credit a { color: var(--ink-2); }
.login-card .credit { margin-top: 10px; }
