/* Dispo Radar: one stylesheet, no frameworks. Tokens first, then layout, components, motion. */

/* Dispo.tech brand: navy and harbor blue, lime for actions, cyan for signals (from dispo.tech). */
@font-face {
  font-family: "Inter";
  src: url("/static/brand/inter-latin.woff2") format("woff2");
  font-weight: 400 800; font-style: normal; font-display: swap;
}

:root {
  --navy: #0a2640;
  --harbor: #0d4579;
  --ocean: #006f99;
  --lime: #9de115;
  --lime-deep: #86c605;
  --cyan: #0dbbfc;
  --mist: #e7f0f5;

  --bg: #eef4f8;
  --surface: #ffffff;
  --surface-2: #e4eef4;
  --ink: #0a2640;
  --muted: #4a6075;
  --line: #d3e0ea;
  --field-line: #6b87a1;        /* form field borders: 3.4:1+ on white and --bg (WCAG 1.4.11) */
  --accent: var(--lime);
  --accent-ink: #0a2640;        /* text on lime (AA: 11:1) */
  --accent-text: #006f99;       /* accent-colored text on white (AA: 5.2:1) */
  --accent-soft: #eaf7cf;
  --signal: var(--cyan);
  --warn: #a15c07;
  --warn-soft: #fdf1d8;
  --danger: #b91c1c;
  --danger-soft: #fde4e4;
  --info: #006f99;
  --info-soft: #ddf3fc;
  --bar: #0a2640;
  --bar-ink: #e7f0f5;
  --bar-muted: #8fb6d5;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow-1: 0 1px 2px rgb(10 38 64 / .07), 0 2px 8px rgb(10 38 64 / .05);
  --shadow-2: 0 2px 4px rgb(10 38 64 / .07), 0 14px 34px -10px rgb(10 38 64 / .25);
  --ring: 0 0 0 3px var(--bg), 0 0 0 6px var(--cyan);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-in: cubic-bezier(.5, 0, .75, 0);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #061a2d;
    --surface: #0b2742;
    --surface-2: #10314f;
    --ink: #e7f0f5;
    --muted: #9db8cf;
    --line: #1c4266;
    --field-line: #4f7aa3;     /* 3.4:1 on --surface, 3.9:1 on --bg */
    --accent-text: #9de115;
    --accent-soft: #1f3a12;
    --warn: #fbbf24;
    --warn-soft: #3a2a0a;
    --danger: #f87171;
    --danger-soft: #3b1414;
    --info: #5fd3fd;
    --info-soft: #0a3552;
    --bar: #041526;
    --shadow-1: 0 1px 2px rgb(0 0 0 / .4);
    --shadow-2: 0 2px 4px rgb(0 0 0 / .4), 0 18px 40px -12px rgb(0 0 0 / .7);
    color-scheme: dark;
  }
}

/* ---- base -------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 16px/1.5 var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 85% -10%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 70%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.02em; }
h1 { font-size: clamp(1.9rem, 4.5vw, 3rem); font-weight: 850; letter-spacing: -.035em; }
h2 { font-size: 1.15rem; font-weight: 800; }
h3 { font-size: 1.2rem; font-weight: 800; }
p { margin: 0 0 .5em; }
a { color: var(--accent-text); text-underline-offset: .18em; text-decoration-thickness: .08em; }
a:hover { text-decoration-thickness: .14em; }
.muted { color: var(--muted); }
s { color: var(--muted); }
kbd {
  font: 700 .72rem/1 var(--mono);
  padding: .22em .42em;
  border-radius: 5px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  background: var(--surface);
  color: var(--ink);
}
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
h1, h3 { overflow-wrap: anywhere; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
::selection { background: color-mix(in srgb, var(--accent) 35%, transparent); }

.page {
  --gutter: 24px;
  max-width: calc(1180px + 2 * var(--gutter)); margin: 0 auto; padding: 28px var(--gutter) 96px;
  container: page / inline-size;  /* page parts size to the main column, not the window */
}
@media (max-width: 767.98px) { .page { --gutter: 16px; padding-top: 18px; } }

/* ---- app shell: sidebar --------------------------------------------- */
/* Full sidebar from 1100px, an icon rail from 768px (or when collapsed), a drawer under 768px. */

.shell {
  --side-w: 248px;
  display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh;
  transition: grid-template-columns .28s var(--ease-out);
}
.shell-main { min-width: 0; }
.sidebar {
  position: sticky; top: 0; height: 100vh; height: 100dvh; z-index: 30;
  overflow-x: hidden; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgb(255 255 255 / .2) transparent;
  display: flex; flex-direction: column; gap: 14px; padding: 16px 12px 12px;
  color: var(--bar-ink);
  background:
    radial-gradient(320px 220px at 0% 0%, rgb(13 187 252 / .16), transparent 70%),
    linear-gradient(180deg, var(--bar), color-mix(in srgb, var(--bar) 80%, #000));
  border-right: 1px solid rgb(255 255 255 / .06);
  view-transition-name: sidebar;
}
.side-top { display: flex; align-items: center; min-height: 44px; }
.side-brand {
  display: flex; align-items: center; gap: 10px; min-height: 44px; min-width: 0; flex: 1;
  padding: 0 6px; border-radius: 10px; color: var(--bar-ink); text-decoration: none;
}
.side-logo { display: block; height: 22px; width: auto; flex: none; }
.side-pill {
  padding: 2px 9px; border-radius: 999px; font-weight: 800; font-size: .82rem; letter-spacing: -.01em;
  color: var(--accent-ink); background: var(--lime); box-shadow: 0 0 14px rgb(157 225 21 / .35);
}
.side-nav { display: grid; align-content: start; }
.side-group { margin: 12px 12px 6px; font-size: .8rem; font-weight: 700; color: var(--bar-muted); white-space: nowrap; overflow: hidden; }
.side-group:first-child { margin-top: 4px; }
.side-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.side-link, button.side-link {
  position: relative; display: flex; align-items: center; justify-content: flex-start; gap: 12px;
  width: 100%; min-height: 44px; padding: 0 12px; border: 0; border-radius: 10px;
  background: transparent; color: var(--bar-muted); font: 650 .95rem/1.2 var(--font); text-decoration: none;
  transition: background-color .15s, color .15s;
}
.side-link:hover, button.side-link:hover { color: var(--bar-ink); background: rgb(255 255 255 / .07); transform: none; border-color: transparent; }
.side-link:active, button.side-link:active { transform: none; }
.side-link[aria-current="page"] { color: #fff; background: rgb(255 255 255 / .11); }
/* The lime marker beside the current page. It has its own view-transition name, so when
   you move to another page it glides down (or up) the sidebar to the new item. */
.side-marker {
  position: absolute; left: -12px; top: 8px; bottom: 8px; width: 4px;
  border-radius: 0 4px 4px 0; background: var(--lime); box-shadow: 0 0 14px rgb(157 225 21 / .65);
  view-transition-name: side-marker;
}
::view-transition-group(side-marker) { animation-duration: .42s; animation-timing-function: var(--ease-out); }
::view-transition-old(side-marker), ::view-transition-new(side-marker) { animation: none; mix-blend-mode: normal; }
.side-link[aria-current="page"] .side-icon { color: var(--lime); }
.side-icon { width: 22px; height: 22px; flex: none; transition: transform .28s var(--ease-out); }
.side-link:hover .side-icon { transform: scale(1.08); }
.side-label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left; }
.side-count {
  min-width: 1.75em; height: 1.6em; padding: 0 .5em; border-radius: 999px; flex: none;
  display: inline-grid; place-items: center;
  font: 800 .76rem/1 var(--font); font-variant-numeric: tabular-nums;
  background: var(--lime); color: var(--accent-ink);
}
.side-count.bump { animation: bump .5s var(--ease-out); }
.side-dot {
  width: 10px; height: 10px; border-radius: 50%; flex: none; background: #f43f3f;
  box-shadow: 0 0 0 0 rgb(244 63 63 / .6); animation: dot-ping 1.8s ease-out infinite;
}
.side-foot { margin-top: auto; display: grid; gap: 4px; padding-top: 10px; border-top: 1px solid rgb(255 255 255 / .08); }
.side-link:focus-visible, .side-brand:focus-visible, .usermenu summary:focus-visible, .menu-btn:focus-visible, .mobile-brand:focus-visible {
  outline: 3px solid var(--cyan); outline-offset: -3px;
}
@keyframes tip-in { from { opacity: 0; transform: translateX(-6px); } }
@keyframes dot-ping { 70%, 100% { box-shadow: 0 0 0 7px rgb(244 63 63 / 0); } }

.brand-mark, .empty-radar, .login-radar {
  position: relative; display: inline-block; border-radius: 50%; overflow: hidden;
  background:
    radial-gradient(circle, transparent 31%, rgb(13 187 252 / .35) 32%, transparent 34%, transparent 64%, rgb(13 187 252 / .35) 65%, transparent 67%),
    radial-gradient(circle, #0d4579, #0a2640);
  box-shadow: inset 0 0 0 2px rgb(13 187 252 / .55), 0 0 18px rgb(13 187 252 / .35);
}
.brand-mark { width: 26px; height: 26px; flex: none; }
.sweep {
  position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 0deg, rgb(13 187 252 / .75), rgb(13 187 252 / 0) 70deg, transparent 360deg);
  animation: sweep 3.2s linear infinite;
}
.brand-mark .blip {
  position: absolute; border-radius: 50%; background: #c8f0ff;
  top: 6px; left: 15px; width: 4px; height: 4px; box-shadow: 0 0 6px var(--cyan);
  animation: blip 3.2s linear infinite;
}

.usermenu { position: relative; }
.usermenu summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px;
  min-height: 48px; padding: 6px 8px; border-radius: 10px; color: var(--bar-ink); font-weight: 650;
}
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu summary:hover, .usermenu[open] summary { background: rgb(255 255 255 / .07); }
.username { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: linear-gradient(135deg, var(--lime), var(--lime-deep)); color: var(--accent-ink); font-weight: 900;
}
.usermenu-panel {
  position: absolute; left: 0; right: 0; bottom: calc(100% + 8px); z-index: 40;
  display: grid; gap: 2px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-2); padding: 12px;
  animation: pop-in .18s var(--ease-out);
}
.usermenu-panel .btn { justify-content: flex-start; width: 100%; border-color: transparent; }
.usermenu-panel .btn[aria-current="page"] { background: var(--surface-2); }
.usermenu-panel form { display: grid; margin: 0; }
.usermenu-name { font-weight: 700; margin: 0 0 6px; padding: 0 6px; }

/* phone top bar (hidden from 768px) */
.mobilebar { display: none; }
.scrim { display: none; }

@media (min-width: 1100px) {

  :is(.shell.is-rail, .side-rail .shell) { --side-w: 72px; }
  :is(.shell.is-rail, .side-rail .shell) .sidebar { padding-inline: 10px; }
  :is(.shell.is-rail, .side-rail .shell) .side-brand { justify-content: center; padding: 0; }
  :is(.shell.is-rail, .side-rail .shell) .side-logo, :is(.shell.is-rail, .side-rail .shell) .side-pill { display: none; }
  /* Rail: the label and name stay in the accessibility tree, clipped like .sr-only. */
  :is(.shell.is-rail, .side-rail .shell) .username, :is(.shell.is-rail, .side-rail .shell) .side-label {
    position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap; flex: none;
  }
  :is(.shell.is-rail, .side-rail .shell) .side-group { height: 1px; margin: 12px 8px; font-size: 0; background: rgb(255 255 255 / .12); }
  :is(.shell.is-rail, .side-rail .shell) .side-link { justify-content: center; padding: 0; }
  :is(.shell.is-rail, .side-rail .shell) .side-link[aria-current="page"] .side-marker { left: -10px; }
  :is(.shell.is-rail, .side-rail .shell) .side-link:hover .side-label, :is(.shell.is-rail, .side-rail .shell) .side-link:focus-visible .side-label {
    position: fixed; left: calc(var(--side-w) + 8px); z-index: 60;
    width: auto; height: auto; overflow: visible; clip: auto;
    padding: 7px 11px; border-radius: 9px; font-size: .88rem; font-weight: 700;
    background: var(--surface); color: var(--ink); box-shadow: var(--shadow-2); border: 1px solid var(--line);
    animation: tip-in .16s var(--ease-out);
  }
  :is(.shell.is-rail, .side-rail .shell) .side-count {
    position: absolute; top: 3px; right: 6px; min-width: 1.45em; height: 1.45em; padding: 0 .3em;
    font-size: .64rem; box-shadow: 0 0 0 2px var(--bar);
  }
  :is(.shell.is-rail, .side-rail .shell) .side-dot { position: absolute; top: 9px; right: 14px; }
  :is(.shell.is-rail, .side-rail .shell) .side-collapse .side-icon { transform: scaleX(-1); }
  :is(.shell.is-rail, .side-rail .shell) .usermenu summary { justify-content: center; padding: 4px; }
  :is(.shell.is-rail, .side-rail .shell) .usermenu-panel { position: fixed; left: calc(var(--side-w) + 8px); right: auto; bottom: 12px; width: 230px; }
}

@media (min-width: 768px) and (max-width: 1099.98px) {
  .sidebar .side-collapse { display: none; }

  .shell { --side-w: 72px; }
  .shell .sidebar { padding-inline: 10px; }
  .shell .side-brand { justify-content: center; padding: 0; }
  .shell .side-logo, .shell .side-pill { display: none; }
  /* Rail: the label and name stay in the accessibility tree, clipped like .sr-only. */
  .shell .username, .shell .side-label {
    position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap; flex: none;
  }
  .shell .side-group { height: 1px; margin: 12px 8px; font-size: 0; background: rgb(255 255 255 / .12); }
  .shell .side-link { justify-content: center; padding: 0; }
  .shell .side-link[aria-current="page"] .side-marker { left: -10px; }
  .shell .side-link:hover .side-label, .shell .side-link:focus-visible .side-label {
    position: fixed; left: calc(var(--side-w) + 8px); z-index: 60;
    width: auto; height: auto; overflow: visible; clip: auto;
    padding: 7px 11px; border-radius: 9px; font-size: .88rem; font-weight: 700;
    background: var(--surface); color: var(--ink); box-shadow: var(--shadow-2); border: 1px solid var(--line);
    animation: tip-in .16s var(--ease-out);
  }
  .shell .side-count {
    position: absolute; top: 3px; right: 6px; min-width: 1.45em; height: 1.45em; padding: 0 .3em;
    font-size: .64rem; box-shadow: 0 0 0 2px var(--bar);
  }
  .shell .side-dot { position: absolute; top: 9px; right: 14px; }
  .shell .side-collapse .side-icon { transform: scaleX(-1); }
  .shell .usermenu summary { justify-content: center; padding: 4px; }
  .shell .usermenu-panel { position: fixed; left: calc(var(--side-w) + 8px); right: auto; bottom: 12px; width: 230px; }
}

@media (max-width: 767.98px) {
  .shell { display: block; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: min(288px, 86vw); z-index: 45;
    transform: translateX(-100%); visibility: hidden;
    transition: transform .26s var(--ease-out), visibility 0s linear .26s;
    box-shadow: 18px 0 40px -12px rgb(0 0 0 / .5);
  }
  .sidebar.is-open { transform: none; visibility: visible; transition: transform .26s var(--ease-out); }
  html.drawer-open { overflow: hidden; }
  .side-link[aria-current="page"] .side-marker { left: -12px; }
  .sidebar .side-collapse { display: none; }
  .scrim:not([hidden]) {
    display: block; position: fixed; inset: 0; z-index: 44;
    background: rgb(4 21 38 / .55); animation: scrim-in .2s ease-out;
  }
  .mobilebar {
    display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 20;
    min-height: 56px; padding: 6px 12px;
    background: color-mix(in srgb, var(--bar) 94%, transparent); color: var(--bar-ink);
    border-bottom: 1px solid rgb(255 255 255 / .06);
    view-transition-name: mobilebar;
  }
  .menu-btn {
    min-height: 44px; padding: 0 14px 0 10px; border-radius: 10px;
    background: rgb(255 255 255 / .08); border: 1px solid rgb(255 255 255 / .14); color: var(--bar-ink);
  }
  .menu-btn:hover { background: rgb(255 255 255 / .14); border-color: rgb(255 255 255 / .2); }
  .mobile-brand { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 4px; border-radius: 10px; text-decoration: none; }
  .mobile-brand .side-logo { height: 20px; }
}
@keyframes scrim-in { from { opacity: 0; } }

/* ---- page heads, panels, chips ---------------------------------------- */

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 20px; margin-bottom: 22px; }
.page-head-text { min-width: 0; }
.page-head h1 { margin: 0; font-size: clamp(1.9rem, 4.5cqi, 2.8rem); }
.page-sub { margin: 8px 0 0; max-width: 70ch; color: var(--muted); }
.page-head-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; flex: none; }
.page-head[data-stacked] { flex-direction: column; align-items: stretch; gap: 0; }
.page-head[data-stacked] .page-head-actions { display: block; }
.page-head:has(.prio-ring) { flex-wrap: nowrap; align-items: flex-start; margin-bottom: 12px; }

/* Hero variant: the navy band on Dashboard and Today. */
.page-head[data-variant="hero"] {
  margin: -8px -4px 22px; padding: 26px 28px 24px; border-radius: 20px; color: #fff;
  background: radial-gradient(120% 140% at 100% 0%, rgb(13 187 252 / .28), transparent 55%),
              linear-gradient(160deg, var(--navy) 15%, var(--harbor));
  box-shadow: 0 24px 50px -28px rgb(10 38 64 / .8);
  position: relative; overflow: hidden;
}
.page-head[data-variant="hero"]::after {
  content: ""; position: absolute; right: -90px; top: -90px; width: 260px; height: 260px; border-radius: 50%;
  border: 1px solid rgb(13 187 252 / .25); box-shadow: 0 0 0 40px rgb(13 187 252 / .05), 0 0 0 80px rgb(13 187 252 / .03);
  pointer-events: none;
}
.page-head[data-variant="hero"] > * { position: relative; z-index: 1; }
.page-head[data-variant="hero"] h1 { color: #fff; font-size: clamp(2.1rem, 5cqi, 3.2rem); font-weight: 800; letter-spacing: -.035em; }
.page-head[data-variant="hero"] .eyebrow { color: #8fb6d5; }
.page-head[data-variant="hero"] .head-stat { color: #c9d9e4; }
.page-head[data-variant="hero"] .head-stat-num { background: none; -webkit-text-fill-color: var(--lime); color: var(--lime); }
.eyebrow { font-size: .9rem; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.eyebrow a { color: var(--muted); text-decoration: none; }
.eyebrow a:hover { color: var(--accent-text); }
.head-stat { margin: 0; display: flex; align-items: baseline; gap: 8px; color: var(--muted); font-weight: 700; }
.head-stat-num {
  font-size: clamp(2.4rem, 6vw, 3.6rem); font-weight: 900; line-height: 1; letter-spacing: -.04em;
  font-variant-numeric: tabular-nums; color: var(--ink);
  background: linear-gradient(180deg, var(--ink) 40%, var(--accent-text));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}

.day-meter { margin: -8px 0 18px; }
.meter-track {
  position: relative; height: 12px; border-radius: 999px; overflow: hidden;
  background: color-mix(in srgb, var(--accent) 12%, var(--surface)); border: 1px solid var(--line);
}
.meter-fill {
  position: absolute; inset: 0 auto 0 0; width: var(--pct); border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #fff));
  transition: width .7s var(--ease-out);
}
.meter-fill::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.45) 50%, transparent 70%);
  transform: translateX(-100%); animation: meter-shine 2.6s ease-in-out infinite;
}
@keyframes meter-shine { to { transform: translateX(100%); } }
.meter-text { margin: 6px 2px 0; font-size: .92rem; color: var(--muted); font-weight: 600; }
.meter-text strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.day-meter.is-complete .meter-track { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); animation: meter-done .9s var(--ease-out); }
.day-meter.is-complete .meter-text strong { color: var(--accent-text); }
@keyframes meter-done { 0% { transform: scale(1); } 40% { transform: scale(1.03, 1.6); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) {
  .meter-fill { transition: none; } .meter-fill::after, .day-meter.is-complete .meter-track { animation: none; }
}

.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-1); padding: 20px; margin-bottom: 18px;
}
.chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px;
  font-size: .8rem; font-weight: 700; line-height: 1.4; white-space: nowrap;
  background: var(--surface-2); color: var(--ink); border: 1px solid var(--line);
}
.chip-devices { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; }
.chip-accent { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; }
.chip-warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.chip-danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.count {
  display: inline-grid; place-items: center; min-width: 1.7em; height: 1.7em; padding: 0 .45em;
  border-radius: 999px; font-size: .78rem; font-weight: 800; font-variant-numeric: tabular-nums;
  background: var(--surface-2); color: var(--muted); vertical-align: .12em; margin-left: 4px;
}
.count.bump { animation: bump .5s var(--ease-out); }

.feed-list { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 8px; }
.feed-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.feed-list form { margin: 0; }
.feed-url { flex: 1 1 260px; min-width: 0; overflow-wrap: anywhere; }

.flash, .error, .errors {
  border-radius: var(--radius-sm); padding: 10px 14px; font-weight: 600;
}
.flash { background: var(--accent-soft); color: var(--accent-text); margin-bottom: 18px; }
.error, .errors { background: var(--danger-soft); color: var(--danger); }
.errors { margin: 0 0 14px; padding-left: 32px; }
[role="alert"]:not(.error):not(.errors) { color: var(--danger); font-weight: 600; }

/* ---- skip link ------------------------------------------------------------ */
.skip-link {
  position: fixed; top: 10px; left: 10px; z-index: 100;
  transform: translateY(-200%); padding: 10px 18px; min-height: 44px; display: inline-flex; align-items: center;
  border-radius: 999px; background: var(--lime); color: #0a2640; font-weight: 800; text-decoration: none;
  box-shadow: var(--shadow-2);
}
.skip-link:focus, .skip-link:focus-visible { transform: none; outline: 3px solid var(--cyan); outline-offset: 3px; }
main:focus { outline: none; }

/* ---- form controls ----------------------------------------------------- */

label { display: grid; gap: 6px; font-size: .88rem; font-weight: 700; color: var(--muted); }
input, select, textarea {
  font: 500 1rem/1.3 var(--font); color: var(--ink);
  background: var(--surface); border: 1.5px solid var(--field-line); border-radius: var(--radius-sm);
  padding: 10px 12px; min-height: 44px; width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
input[type="file"] { padding: 8px; }
textarea { resize: vertical; min-height: 64px; }
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--field-line)); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }
.stack { display: grid; gap: 14px; max-width: 560px; }
.stack > button { justify-self: start; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; margin-top: 12px; }
.form-grid .span-2 { grid-column: 1 / -1; }
details form:not(.form-grid) { display: grid; gap: 12px; margin-top: 12px; }

.btn, button {
  font: 750 .95rem/1.2 var(--font); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px; border-radius: 11px;
  border: 1.5px solid var(--line); background: var(--surface); color: var(--ink);
  text-decoration: none;
  transition: transform .12s var(--ease-out), background-color .15s, border-color .15s, box-shadow .15s, color .15s;
}
.btn:hover, button:hover { border-color: color-mix(in srgb, var(--ink) 35%, var(--line)); transform: translateY(-1px); }
.btn:active, button:active { transform: translateY(1px) scale(.98); }
.btn-primary {
  background: var(--accent); border-color: var(--accent); color: var(--accent-ink);
  box-shadow: 0 6px 18px -8px color-mix(in srgb, var(--accent) 80%, transparent);
}
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, white); border-color: var(--accent); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
@media (prefers-color-scheme: dark) { .btn-danger { color: #2a0606; } }
.btn-ghost { background: transparent; }
.btn-small { min-height: 36px; padding: 6px 12px; font-size: .85rem; }
.btn-danger-ghost { background: transparent; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); }
.btn-danger-ghost:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn-block { width: 100%; }
button[disabled], .htmx-request button { opacity: .7; cursor: progress; }

details.disclose { margin-top: 12px; }
details.disclose > summary {
  cursor: pointer; display: inline-flex; align-items: center; gap: 8px; min-height: 40px;
  font-weight: 750; color: var(--accent-text); list-style: none; border-radius: 8px; padding: 4px 2px;
}
details.disclose > summary::-webkit-details-marker { display: none; }
details.disclose > summary::before {
  content: ""; width: 18px; height: 18px; border-radius: 6px; flex: none;
  background:
    linear-gradient(var(--accent-text), var(--accent-text)) center / 10px 2px no-repeat,
    linear-gradient(var(--accent-text), var(--accent-text)) center / 2px 10px no-repeat,
    var(--accent-soft);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent);
  transition: transform .25s var(--ease-out);
}
details.disclose[open] > summary::before { transform: rotate(45deg); }
details[open] > form { animation: unfold .28s var(--ease-out); }

/* ---- Today ------------------------------------------------------------- */

.band { margin-bottom: 30px; --band: var(--accent); --band-soft: var(--accent-soft); --band-text: var(--accent-text); }
.band-callback { --band: #f59e0b; --band-soft: var(--warn-soft); --band-text: var(--warn); }
.band-intro { --band: #0dbbfc; --band-soft: var(--info-soft); --band-text: var(--info); }
.band.is-empty { display: none; }
.band-title { display: flex; align-items: center; gap: 10px; font-size: 1.05rem; font-weight: 800; letter-spacing: -.01em; color: var(--band-text); margin-bottom: 12px; }
.band-title .count { background: var(--band-soft); color: var(--band-text); }
.band-dot {
  width: 10px; height: 10px; border-radius: 50%; background: var(--band); flex: none;
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--band) 60%, transparent);
  animation: ping 2.4s var(--ease-out) infinite;
}
.cards { display: grid; gap: 14px; }

.card {
  --band: var(--accent); --band-soft: var(--accent-soft);
  position: relative; display: grid; gap: 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px 18px 26px; box-shadow: var(--shadow-1);
  overflow: hidden;
  animation: card-in .2s var(--ease-out) backwards;
  animation-delay: calc(min(var(--i, 0), 6) * 40ms);
  transition: box-shadow .25s, border-color .25s, transform .25s var(--ease-out);
}
.card.band-callback { --band: #f59e0b; --band-soft: var(--warn-soft); }
.card.band-intro { --band: #0dbbfc; --band-soft: var(--info-soft); }
.card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px;
  background: linear-gradient(180deg, var(--band), color-mix(in srgb, var(--band) 40%, transparent));
}
.card:hover { box-shadow: var(--shadow-2); }
.card.is-active {
  border-color: color-mix(in srgb, var(--band) 55%, var(--line));
  box-shadow: var(--shadow-2), 0 0 0 4px color-mix(in srgb, var(--band) 16%, transparent);
}
.card.htmx-swapping { animation: card-out .22s var(--ease-in) forwards; pointer-events: none; }
.card-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
.card-head h3 { margin: 0; font-size: 1.32rem; }
.card-head h3 a { color: var(--ink); text-decoration: none; background: linear-gradient(var(--band), var(--band)) 0 100% / 0 3px no-repeat; transition: background-size .3s var(--ease-out); }
.card-head h3 a:hover { background-size: 100% 3px; }
.card-meta { color: var(--muted); font-weight: 600; margin: 4px 0 8px; font-variant-numeric: tabular-nums; }
.card-reason { font-size: 1.05rem; font-weight: 600; max-width: 70ch; }
.card-evidence { font-size: .92rem; }
.card-foot { display: flex; flex-wrap: wrap; gap: 6px 20px; align-items: center; justify-content: space-between; margin-top: 8px; padding-top: 10px; border-top: 1px dashed var(--line); }
.card-foot p { margin: 0; }
.card-contact { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; font-weight: 600; }
.phone {
  display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-variant-numeric: tabular-nums;
  text-decoration: none; padding: 4px 10px; border-radius: 999px; background: var(--accent-soft); min-height: 32px;
}
.phone::before { content: "\260E"; font-size: .9em; }
.phone:hover { background: color-mix(in srgb, var(--accent) 25%, var(--surface)); }
.card-last { font-size: .88rem; }
.card-note { margin: 0 0 6px; font-size: 1rem; font-weight: 600; max-width: 70ch; }
.card-phone { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.phone-warn { flex-basis: 100%; margin: 0; padding: 3px 10px; border-radius: 8px; background: var(--warn-soft); color: var(--warn); font-size: .85rem; font-weight: 600; }
.phone-source { font-size: .85rem; opacity: .75; }
.card-email-addr { display: inline-flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; font-weight: 400; }
.card-email-addr:empty { display: none; }
.email-wrong { margin: 0; }
.inhouse { margin: .35rem 0; }
.inhouse-line { display: flex; flex-wrap: wrap; gap: .4rem .6rem; align-items: center; margin: 0; }
.inhouse-hint { margin: .2rem 0 0; font-size: .9rem; }
.inhouse-note { overflow-wrap: anywhere; font-size: .85rem; }
.inhouse-answer { display: flex; flex-wrap: wrap; gap: .5rem; margin: .4rem 0; }
.inhouse-answer .btn { min-height: 44px; }
.chip-inhouse { background: color-mix(in srgb, var(--warn, #ff8a3d) 22%, transparent); }
.org-email { overflow-wrap: anywhere; }
.phone-source-ai { opacity: 1; color: var(--info); font-weight: 600; }
.card-phone .error { flex-basis: 100%; margin: 0; padding: 4px 10px; font-size: .85rem; }
.lookup { border: 2px dashed color-mix(in srgb, var(--accent) 55%, var(--line)); }
.lookup::before { content: "\1F50E\FE0E"; margin-right: 4px; }
.phone-save { display: flex; gap: 6px; align-items: center; }
.phone-save input { width: 13ch; min-height: 36px; padding: 4px 10px; font-weight: 600; }
.card-phone .phone { animation: phone-in .45s var(--ease-out); }
@keyframes phone-in { from { transform: scale(.85); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .card-phone .phone { animation: none; } }

.outcomes { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); grid-auto-flow: row dense; gap: 8px; }
.outcome-form { display: contents; }
.outcome {
  position: relative; min-height: 48px; padding: 8px 10px; font-size: .9rem; border-radius: 12px;
  background: var(--surface-2); border-color: transparent; text-align: center; line-height: 1.15;
}
.outcome kbd { position: absolute; top: 5px; left: 6px; font-size: .62rem; padding: .15em .35em; opacity: .75; }
.outcome:hover { background: var(--surface); border-color: var(--line); box-shadow: var(--shadow-1); }
.outcome.flash-press { animation: press .3s var(--ease-out); }
.outcome-not-interested:hover { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
.outcome-book-pickup { background: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 20px -10px var(--accent); }
.outcome-book-pickup:hover { background: color-mix(in srgb, var(--accent) 88%, white); border-color: var(--accent); }
.outcome-book-pickup kbd { background: rgb(255 255 255 / .55); border-color: rgb(0 0 0 / .15); color: var(--accent-ink); }
.outcome-snooze { color: var(--muted); }

details.talked { min-width: 0; }
details.talked > summary { list-style: none; cursor: pointer; display: flex; height: 100%; align-items: center; justify-content: center; }
details.talked > summary::-webkit-details-marker { display: none; }
details.talked[open] { grid-column: 1 / -1; order: 99 !important; background: var(--surface-2); border-radius: 12px; padding: 10px; }
details.talked[open] > summary { height: auto; justify-content: flex-start; padding-left: 32px; background: var(--accent-soft); border-color: transparent; }
details.talked > form { display: grid; grid-template-columns: 2fr 1fr auto; gap: 10px; align-items: end; margin-top: 10px; }

/* Focus Today: JS adds .focus-today, so without JS every card keeps its full controls. */
.card-expand { display: none; }
.focus-today .card:not(.is-active) { gap: 8px; padding-top: 14px; padding-bottom: 14px; cursor: pointer; box-shadow: none; }
.focus-today .card:not(.is-active):hover { box-shadow: var(--shadow-1); }
.focus-today .card:not(.is-active) .outcomes,
.focus-today .card:not(.is-active) .card-last { display: none; }
.focus-today .card:not(.is-active) .card-evidence {
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; margin: 0;
}
.focus-today .card:not(.is-active) .card-meta { margin-bottom: 4px; }
.focus-today .card:not(.is-active) .card-head h3 { font-size: 1.12rem; }
.focus-today .card:not(.is-active) .card-foot { margin-top: 4px; padding-top: 8px; }
.focus-today .card:not(.is-active) .card-expand { display: inline-flex; }

.kbd-hint { margin: 2px 0 6px 4px; font-size: .85rem; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
@media (hover: none) { .kbd-hint, .outcome kbd { display: none; } }
body[data-shortcuts="off"] .outcome kbd, body[data-shortcuts="off"] .kbd-hint { display: none; }

.empty { text-align: center; padding: 56px 20px; display: grid; justify-items: center; gap: 10px; }
.empty-radar { width: 120px; height: 120px; margin-bottom: 10px; }
.empty-title { font-size: 1.3rem; font-weight: 800; max-width: 34ch; }
.empty.pop { animation: card-in .25s var(--ease-out) both; }

/* ---- Lead -------------------------------------------------------------- */

.lead-head { margin-bottom: 22px; }
.prio-ring {
  --deg: calc(var(--p, 0) * 3.6deg);
  flex: none; width: 74px; height: 74px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--accent) var(--deg), var(--surface-2) 0);
  box-shadow: var(--shadow-1);
}
.prio-ring b { width: 58px; height: 58px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-size: 1.3rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.lead-links, .lead-facts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.lead-reason { font-size: 1.08rem; max-width: 75ch; }
.lead-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.lead-grid .panel { margin: 0; }
.panel-log { grid-column: 1 / -1; }
.panel-log .outcomes { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.notes-text { white-space: pre-wrap; }

.timeline { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid var(--line); display: grid; gap: 14px; }
.evidence { position: relative; }
.evidence::before {
  content: ""; position: absolute; left: -25px; top: 6px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 3px var(--surface);
}
.evidence.trust-unverified::before { background: #f59e0b; }
.evidence.trust-rejected::before { background: var(--line); }
.evidence.trust-rejected .evidence-title, .evidence.trust-rejected .evidence-summary { text-decoration: line-through; color: var(--muted); }
.evidence-meta { font-size: .88rem; color: var(--muted); }
.trust-confirmed .chip-trust { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; }
.trust-unverified .chip-trust { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.evidence .chip-ai { background: transparent; color: var(--accent-text); border: 1px dashed var(--accent-text); }
.evidence.trust-rejected .chip-ai { color: var(--muted); border-color: var(--muted); }
.evidence-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.contact-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.contact { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--surface); }
.contact.is-primary { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); background: linear-gradient(90deg, var(--accent-soft), var(--surface) 60%); }
.contact-links { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 6px; }

.notice-pages { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.notice-pages h3 { margin: 0 0 4px; font-size: 1rem; }
.notice-form { display: grid; gap: 10px; margin: 10px 0 14px; }
.notice-form input { width: 100%; box-sizing: border-box; }
.notice-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.notice-item { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--surface); }
.notice-info { display: grid; gap: 2px; min-width: 0; flex: 1 1 200px; }
.notice-url { overflow-wrap: anywhere; font-size: .9rem; }
.notice-warn { color: var(--warn); }
.notice-item.is-new { animation: pop-in .45s ease-out both; border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
@media (prefers-reduced-motion: reduce) { .notice-item.is-new { animation: none; } }

.history { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; counter-reset: h; }
.history li { padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: .94rem; }

/* ---- Pickups ----------------------------------------------------------- */

.board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; align-items: start; }
.column { background: color-mix(in srgb, var(--surface-2) 70%, transparent); border: 1px solid var(--line); border-radius: calc(var(--radius) + 4px); padding: 14px; --band: var(--accent); --band-soft: var(--accent-soft); --band-text: var(--accent-text); }
.stage-booked { --band: #f59e0b; --band-soft: var(--warn-soft); --band-text: var(--warn); }
.stage-scheduled { --band: #0dbbfc; --band-soft: var(--info-soft); --band-text: var(--info); }
.stage-lost { --band: #94a3b8; --band-soft: var(--surface-2); --band-text: var(--muted); }
.column-title { display: flex; align-items: center; gap: 8px; font-size: 1rem; font-weight: 800; color: var(--band-text); }
.column-title .count { background: var(--band-soft); color: var(--band-text); }
.column-cards { display: grid; gap: 12px; }
.column-empty { color: var(--muted); font-size: .9rem; padding: 18px 8px; text-align: center; border: 2px dashed var(--line); border-radius: 12px; }
.column-cards:has(.pickup-card) .column-empty { display: none; }
.column-foot { margin-top: 14px; padding: 12px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-text); font-weight: 800; font-variant-numeric: tabular-nums; }
.pickup-card {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 14px 14px 18px; box-shadow: var(--shadow-1); overflow: hidden;
  animation: card-in .2s var(--ease-out) backwards; animation-delay: calc(min(var(--i, 0), 6) * 40ms);
}
.pickup-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 5px; background: var(--band); }
.pickup-card h3 { font-size: 1.05rem; margin-bottom: 4px; }
.pickup-card h3 a { color: var(--ink); text-decoration: none; }
.pickup-card h3 a:hover { color: var(--accent-text); text-decoration: underline; }
.pickup-card p { font-size: .9rem; }
.pickup-date { font-weight: 800; color: var(--band-text); }
.pickup-haul { font-weight: 800; font-variant-numeric: tabular-nums; }
.pickup-notes { color: var(--muted); font-style: italic; }
.inline-form { display: grid; gap: 8px; margin-top: 8px; }
.pickup-actions { display: flex; flex-direction: column; }
.pickup-actions details.disclose { margin-top: 4px; }
.board-tabs { display: none; }

/* ---- Find -------------------------------------------------------------- */

.search-panel { display: grid; gap: 14px; margin-bottom: 18px; }
.search-box { font-size: .95rem; font-weight: 700; }
.search-box input {
  font-size: 1.3rem; font-weight: 600; min-height: 60px; padding: 14px 18px 14px 52px; border-radius: var(--radius);
  background: var(--surface) no-repeat 18px center / 22px 22px
    radial-gradient(circle at 40% 40%, transparent 6px, var(--muted) 6.5px, var(--muted) 8.5px, transparent 9px);
  box-shadow: var(--shadow-1);
}
.filters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 12px; align-items: end; }
.check { display: flex; gap: 10px; align-items: center; min-height: 44px; cursor: pointer; font-weight: 600; }
.check input { width: 20px; height: 20px; min-height: 0; flex: none; accent-color: var(--accent); }
.filters .check { grid-column: 1 / -1; }
.check-list { border: 0; padding: 0; margin: 0; display: grid; gap: 4px; }
.check-list legend { padding: 0; margin-bottom: 6px; font-weight: 700; color: var(--muted); font-size: .88rem; }
.results { margin-bottom: 26px; }
.results-count { color: var(--muted); }
.results-count strong { color: var(--ink); font-size: 1.15rem; }
.results.flash-in .table, .results.flash-in .empty-inline { animation: fade-up .35s var(--ease-out); }
.table-wrap { max-width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-1); margin-bottom: 18px; }
.table { width: 100%; border-collapse: collapse; font-size: .94rem; }
.table-wrap-plain { border: 0; border-radius: 0; background: none; box-shadow: none; margin: 0; }
.table th { text-align: left; font-size: .85rem; font-weight: 700; color: var(--muted); background: var(--surface-2); padding: 10px 14px; white-space: nowrap; }
.table td { padding: 12px 14px; border-top: 1px solid var(--line); vertical-align: top; }
.table tbody tr { transition: background-color .15s; }
.table tbody tr:hover { background: color-mix(in srgb, var(--accent-soft) 60%, transparent); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.cell-name a { font-weight: 800; }
.cell-why { color: var(--muted); min-width: 220px; }
.prio {
  display: inline-grid; place-items: center; min-width: 2.4em; padding: 2px 8px; border-radius: 999px; font-weight: 800;
  background: color-mix(in srgb, var(--accent) calc(var(--p, 0) * .6%), var(--surface-2));
}
.pager { display: flex; gap: 10px; }
.empty-inline { padding: 22px; border: 2px dashed var(--line); border-radius: var(--radius); color: var(--muted); text-align: center; }

/* ---- Admin ------------------------------------------------------------- */

.seg-nav { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); margin-bottom: 18px; max-width: 100%; }
.seg-nav a { padding: 8px 16px; min-height: 40px; display: inline-flex; align-items: center; border-radius: 999px; color: var(--muted); font-weight: 750; text-decoration: none; }
.seg-nav a:hover { color: var(--ink); }
.seg-nav a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.badge { display: inline-flex; padding: 2px 8px; border-radius: 999px; font-size: .75rem; font-weight: 800; background: var(--warn-soft); color: var(--warn); animation: pulse-ring 1.6s ease-out infinite; }
.table td form { display: grid; gap: 8px; }
.table td form label { font-size: .8rem; }

/* ---- Login ------------------------------------------------------------- */

body.is-login { background: radial-gradient(900px 600px at 50% 30%, #0d4579, #041526 70%); color-scheme: dark; }
body.is-login { overflow-x: clip; }
body.is-login .page { overflow: clip; min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login { position: relative; display: grid; place-items: center; width: 100%; }
.login-radar { position: absolute; width: min(620px, 140vw); aspect-ratio: 1; opacity: .55; background: radial-gradient(circle, #0d4579, transparent 72%); box-shadow: none; }
.login-radar .ring { position: absolute; inset: var(--inset); border-radius: 50%; border: 1px solid rgb(13 187 252 / .25); }
.login-radar .r1 { --inset: 0; } .login-radar .r2 { --inset: 17%; } .login-radar .r3 { --inset: 34%; }
.login-radar .sweep { animation-duration: 4.5s; }
.login-radar .blip { position: absolute; width: 9px; height: 9px; border-radius: 50%; background: #c8f0ff; box-shadow: 0 0 14px var(--lime); animation: blip 4.5s linear infinite; }
.login-radar .b1 { top: 22%; left: 62%; } .login-radar .b2 { top: 64%; left: 74%; animation-delay: -1.6s; } .login-radar .b3 { top: 58%; left: 24%; animation-delay: -3s; }
.login-card {
  position: relative; width: min(420px, 100%); padding: 32px 28px; border-radius: 20px;
  background: rgb(6 26 45 / .84); border: 1px solid rgb(13 187 252 / .25);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 30px 80px -20px rgb(0 0 0 / .8), 0 0 0 1px rgb(255 255 255 / .03) inset;
  color: #e7f0f5; animation: card-in .7s var(--ease-out) both;
  --ink: #e7f0f5; --muted: #9db8cf; --surface: #0b2742; --line: #1c4266; --field-line: #4f7aa3; --accent-text: #9de115; --danger: #fca5a5; --danger-soft: #3b1414;
}
.login-card .stack { max-width: none; margin-top: 18px; }
.login-title { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; font-size: 1.8rem; font-weight: 800; letter-spacing: -.02em; }
.login-title img { height: 34px; width: auto; }
.login-title span { color: var(--cyan); }

/* ---- toasts ------------------------------------------------------------ */

.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 50; display: grid; gap: 10px; justify-items: end; pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 12px;
  max-width: min(420px, calc(100vw - 32px)); padding: 12px 16px 12px 14px; border-radius: 14px;
  background: var(--bar); color: var(--bar-ink); font-weight: 650;
  box-shadow: 0 18px 40px -12px rgb(0 0 0 / .55), 0 0 0 1px rgb(255 255 255 / .06) inset;
  animation: toast-in .42s var(--ease-out) both;
  position: relative; overflow: hidden;
}
.toast::before { content: ""; width: 26px; height: 26px; flex: none; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 4px rgb(13 187 252 / .2); }
.toast::after { content: ""; position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--lime); transform-origin: left; animation: toast-timer 3s linear forwards; }
.toast-check { position: absolute; left: 21px; top: 50%; width: 12px; height: 7px; margin-top: -5px; border-left: 2.5px solid var(--bar); border-bottom: 2.5px solid var(--bar); transform: rotate(-45deg); }
.toast.is-error::before { background: #f87171; box-shadow: 0 0 0 4px rgb(248 113 113 / .2); }
.toast.is-error::after { background: #f87171; }
.toast.is-error .toast-check { border: 0; width: 3px; height: 12px; margin-top: -8px; left: 25px; background: var(--bar); transform: none; box-shadow: 0 14px 0 -0.2px var(--bar); }
.toast.is-leaving { animation: toast-out .28s var(--ease-in) forwards; }

/* ---- swap highlights --------------------------------------------------- */

.flash-in { animation: highlight 1.1s var(--ease-out); }
.pickup-card.flash-in { animation: highlight 1.1s var(--ease-out), card-in .4s var(--ease-out) backwards; }
.pickup-card.arrive, .pickup-card.arrive.flash-in { animation: arrive-in .55s var(--ease-out), highlight 1.1s var(--ease-out); }

/* ---- keyframes --------------------------------------------------------- */

@keyframes sweep { to { transform: rotate(360deg); } }
@keyframes blip { 0%, 8% { opacity: 1; transform: scale(1.4); } 40% { opacity: .2; transform: scale(1); } 100% { opacity: 0; } }
@keyframes ping { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--band) 55%, transparent); } 70%, 100% { box-shadow: 0 0 0 9px transparent; } }
@keyframes card-in { from { opacity: 0; transform: translateY(26px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes arrive-in { from { opacity: 0; transform: translateX(-34px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes card-out { to { opacity: 0; transform: translateX(-56px) rotate(-1.2deg); } }
@keyframes bump { 0% { transform: scale(1); } 35% { transform: scale(1.45); } 100% { transform: scale(1); } }
@keyframes pop-in { from { opacity: 0; transform: translateY(-6px) scale(.97); } }
@keyframes unfold { from { opacity: 0; transform: translateY(-6px); } }
@keyframes fade-up { from { opacity: 0; transform: translateY(8px); } }
@keyframes press { 50% { transform: scale(.94); } }
@keyframes pulse-ring { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--warn) 45%, transparent); } 80%, 100% { box-shadow: 0 0 0 7px transparent; } }
@keyframes toast-in { from { opacity: 0; transform: translateX(110%) scale(.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(110%); } }
@keyframes toast-timer { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@keyframes highlight {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 70%, transparent); background-color: var(--accent-soft); }
  100% { box-shadow: 0 0 0 14px transparent; }
}

/* ---- page transitions (View Transitions API) --------------------------- */

@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out .18s var(--ease-in) both; }
::view-transition-new(root) { animation: vt-in .32s var(--ease-out) both; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-6px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(10px); } }

/* ---- responsive -------------------------------------------------------- */

/* Column counts follow the main column (the sidebar takes room), not the window. */
@container page (max-width: 899.98px) { .board { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container page (max-width: 779.98px) { .lead-grid { grid-template-columns: minmax(0, 1fr); } }

@media (max-width: 639.98px) {
  .page-head { flex-wrap: wrap; }
  .card { padding: 16px 14px 14px 20px; }
  .card-head h3 { font-size: 1.18rem; }
  .outcomes, .panel-log .outcomes { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .outcome { min-height: 52px; }
  details.talked > form { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters button { grid-column: 1 / -1; }
  .btn, button { min-height: 44px; }
  .btn-small { min-height: 44px; }
  details.disclose > summary { min-height: 44px; }
  .quick-note input { min-height: 44px; }
  .phone { min-height: 44px; padding: 8px 14px; }
  .prio-ring { width: 60px; height: 60px; } .prio-ring b { width: 46px; height: 46px; font-size: 1.1rem; }
  .board { grid-template-columns: minmax(0, 1fr); }
  .board.has-tabs .column { display: none; }
  .board.has-tabs .column.is-active { display: block; animation: fade-up .3s var(--ease-out); }
  .board-tabs:not([hidden]) {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; margin-bottom: 14px;
    padding: 4px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line);
  }
  .board-tab { min-height: 44px; padding: 6px 4px; font-size: .85rem; border: 0; background: transparent; color: var(--muted); flex-direction: column; gap: 2px; }
  .board-tab .count { margin: 0; }
  .board-tab[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
  .toasts { left: 16px; right: 16px; bottom: 16px; justify-items: stretch; }

  /* tap targets */
  .eyebrow a { display: inline-flex; align-items: center; min-height: 44px; }
  .seg-nav { display: flex; border-radius: 14px; }
  .seg-nav a { flex: 1; flex-wrap: wrap; justify-content: center; gap: 0 4px; min-height: 44px; padding: 6px 8px; border-radius: 10px; text-align: center; line-height: 1.2; }
  .schools-search { flex: 1 1 100%; }
  .usermenu-panel .btn { width: 100%; min-height: 48px; }

  /* Find results: one stacked card per row */
  .table-find thead, .table-stack thead { display: none; }
  .table-find, .table-find tbody, .table-stack, .table-stack tbody { display: block; }
  .table-find tr {
    display: flex; flex-wrap: wrap; align-items: center; gap: 4px 0;
    padding: 14px 16px; border-top: 1px solid var(--line);
  }
  .table-find tbody tr:first-child, .table-stack tbody tr:first-child { border-top: 0; }
  .table-find td { display: block; padding: 0; border: 0; text-align: left; min-width: 0; }
  .table-find tr::before { content: ""; flex: 0 0 100%; height: 0; order: 3; }  /* line break */
  .table-find .cell-name { flex: 0 0 100%; order: 1; font-size: 1.05rem; }
  .table-find .cell-kind, .table-find .cell-city, .table-find .cell-miles { order: 2; color: var(--muted); font-size: .9rem; }
  .table-find .cell-kind::after, .table-find .cell-city::after { content: "\0a0·\0a0"; }
  .table-find .cell-miles::after { content: "\0a0mi"; }
  .table-find .cell-devices, .table-find .cell-prio { order: 4; margin-top: 4px; font-size: .9rem; }
  .table-find .cell-devices { margin-right: 16px; }
  .table-find [data-label]::before, .table-stack [data-label]::before {
    content: attr(data-label) ": "; color: var(--muted); font-weight: 700; font-size: .8rem;
    letter-spacing: 0;
  }
  .table-find .cell-why { flex: 0 0 100%; order: 5; min-width: 0; margin-top: 6px; font-size: .9rem; }

  /* Admin tables: one card per row, action underneath */
  .table-stack tr { display: grid; gap: 6px; padding: 14px 16px; border-top: 1px solid var(--line); }
  .table-stack td { display: block; padding: 0; border: 0; }
  .table-stack td:first-child { font-weight: 800; font-size: 1.02rem; }
  .table-stack .cell-action, .table-stack td:last-child { margin-top: 6px; }
  .table-stack td form { display: grid; gap: 8px; }
  .table-stack td form .btn { width: 100%; }
  .toast { max-width: none; }
  .table-wrap { border-radius: 12px; }
}

/* ---- Ask Radar panel ---------------------------------------------------- */

.side-ask[aria-expanded="true"] { color: #fff; background: rgb(255 255 255 / .11); }
.side-ask[aria-expanded="true"] .side-icon, .side-ask:hover .side-icon { color: var(--lime); }

.assistant {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 35;
  width: 400px; max-width: 100vw;
  display: flex; flex-direction: column;
  background: var(--surface); color: var(--ink);
  border-left: 1px solid var(--line); box-shadow: var(--shadow-2);
  animation: ask-in .3s var(--ease-out);
}
.assistant[hidden] { display: none; }
.assistant.no-anim { animation: none; }
@keyframes ask-in { from { opacity: 0; transform: translateX(28px); } }

.assistant-head {
  position: relative; overflow: hidden; flex: none;
  display: flex; align-items: center; gap: 10px;
  min-height: 64px; padding: 10px 10px 10px 16px; color: var(--bar-ink);
  background:
    radial-gradient(260px 160px at 0% 0%, rgb(13 187 252 / .18), transparent 70%),
    linear-gradient(180deg, var(--bar), color-mix(in srgb, var(--bar) 82%, #000));
}
/* Quiet radar rings in the corner of the header. */
.assistant-head::after {
  content: ""; position: absolute; right: -70px; top: -90px; width: 220px; height: 220px;
  border-radius: 50%; pointer-events: none;
  background: repeating-radial-gradient(circle, transparent 0 25px, rgb(13 187 252 / .13) 26px 27px);
}
.assistant-head .brand-mark { width: 28px; height: 28px; }
.assistant-head .sweep, .assistant-head .blip { animation-duration: 6s; }
.assistant-title { flex: 1; margin: 0; font-size: 1.15rem; font-weight: 800; letter-spacing: -.015em; color: #fff; }
.assistant-head button {
  position: relative; z-index: 1; min-height: 44px; padding: 0 14px;
  color: var(--bar-ink); background: rgb(255 255 255 / .08); border-color: rgb(255 255 255 / .14);
  font-size: .88rem;
}
.assistant-head button:hover { background: rgb(255 255 255 / .15); border-color: rgb(255 255 255 / .24); }
.assistant-head button:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }
.assistant-head button[hidden] { display: none; }
.assistant-close { width: 44px; padding: 0 !important; }
.assistant-close .side-icon { width: 20px; height: 20px; }

.assistant-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 18px 16px; }
.assistant-empty p { margin: 0 0 14px; color: var(--muted); }
.assistant-empty strong { color: var(--ink); }
.assistant-off { font-weight: 750; color: var(--ink) !important; font-size: 1.05rem; }
.assistant-chips { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 8px; justify-items: start; }
.assistant-chip {
  min-height: 44px; padding: 8px 16px; border-radius: 999px; text-align: left;
  font-weight: 650; font-size: .92rem; line-height: 1.3;
  background: var(--surface-2); border-color: transparent; color: var(--ink);
}
.assistant-chip:hover { border-color: var(--accent); background: var(--accent-soft); }

.assistant-log { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.ask-msg {
  max-width: 88%; padding: 10px 14px; border-radius: 16px;
  white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.45;
  animation: ask-msg-in .22s var(--ease-out);
}
.ask-user { justify-self: end; background: var(--harbor); color: #fff; border-bottom-right-radius: 5px; }
.ask-bot { justify-self: start; background: var(--surface-2); border-bottom-left-radius: 5px; }
.ask-bot.is-error { background: var(--warn-soft); }
.ask-stopped { display: block; margin-top: 8px; font-weight: 700; color: var(--warn); }
.ask-msg a, .ask-card-result a { color: var(--accent-text); font-weight: 750; }
@keyframes ask-msg-in { from { opacity: 0; transform: translateY(6px); } }

.ask-typing { display: inline-flex; gap: 5px; align-items: center; height: 1.45em; }
.ask-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--muted); opacity: .35;
  animation: ask-dot 1.1s ease-in-out infinite;
}
.ask-dot:nth-child(3) { animation-delay: .15s; }
.ask-dot:nth-child(4) { animation-delay: .3s; }
@keyframes ask-dot { 0%, 80%, 100% { opacity: .3; transform: none; } 40% { opacity: 1; transform: translateY(-3px); background: var(--cyan); } }

.ask-card {
  display: grid; gap: 10px; padding: 14px; border-radius: var(--radius);
  background: var(--surface); border: 1.5px solid var(--line); border-left: 5px solid var(--lime);
  box-shadow: var(--shadow-1); animation: ask-msg-in .22s var(--ease-out);
}
.ask-card-tag { margin: 0; font-size: .8rem; font-weight: 700; color: var(--muted); }
.ask-card-label { margin: 0; font-weight: 800; overflow-wrap: anywhere; }
.ask-card-detail {
  margin: 0; padding: 10px 12px; max-height: 14rem; overflow-y: auto;
  white-space: pre-wrap; overflow-wrap: anywhere; font-size: .92rem; line-height: 1.45;
  background: var(--surface-2); border-radius: var(--radius-sm);
}
.ask-card-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ask-card-result { margin: 0; font-weight: 650; overflow-wrap: anywhere; }
.ask-card-result:empty { display: none; }
.ask-card.is-done { border-left-color: var(--accent-text); }
.ask-card.is-error { border-left-color: var(--danger); }
.ask-card.is-error .ask-card-result { color: var(--danger); }
.ask-card.is-cancelled { opacity: .75; border-left-color: var(--line); }

.assistant-form {
  flex: none; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 8px;
  padding: 12px 16px 6px; border-top: 1px solid var(--line);
}
.assistant-form textarea { min-height: 48px; max-height: 160px; resize: none; line-height: 1.4; }
.assistant-send { min-height: 48px; }
.assistant-count { grid-column: 1 / -1; font-size: .8rem; color: var(--muted); }
.assistant-count:empty { display: none; }
.assistant-note { flex: none; margin: 0; padding: 0 16px 12px; font-size: .8rem; color: var(--muted); }

@media (max-width: 767.98px) {
  .assistant {
    inset: 0; width: 100%; height: 100vh; height: 100dvh; z-index: 42; border-left: 0;
    padding-bottom: env(safe-area-inset-bottom); animation-name: ask-up;
  }
  html.assistant-open { overflow: hidden; }
  .ask-card-actions .btn { flex: 1 1 auto; min-height: 48px; }
  .ask-msg { max-width: 92%; }
}
@keyframes ask-up { from { opacity: 0; transform: translateY(32px); } }

@media (prefers-reduced-motion: reduce) {
  .assistant, .ask-msg, .ask-card, .ask-dot, .assistant-head .sweep, .assistant-head .blip { animation: none !important; }
  .ask-dot { opacity: .7; }
}

/* ---- reduced motion: everything off ------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
  .card.htmx-swapping { opacity: 0; }
  @view-transition { navigation: none; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

/* ---- email panel -------------------------------------------------------- */

.panel-email { grid-column: 1 / -1; margin-bottom: 18px; scroll-margin-top: 84px; }
.panel-email:target { animation: pop-in .45s var(--ease-out) both; border-color: var(--accent); }
.email-form { display: grid; gap: 12px; }
.email-pick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.email-form label, .email-form select, .email-form input, .email-form textarea { min-width: 0; max-width: 100%; }
.email-none { font-weight: 600; color: var(--muted); padding: 10px 0; }
.email-form textarea { min-height: 200px; font-family: inherit; line-height: 1.5; }
.email-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.email-actions .btn { flex: 1 1 auto; }
.email-note { margin: 0; font-size: .86rem; }
.email-note.is-error { color: var(--danger); font-weight: 700; animation: pop-in .25s var(--ease-out); }
.email-actions .btn.is-done { animation: pop-in .35s var(--ease-out); background: var(--accent-soft); color: var(--accent-text); border-color: var(--accent); }
.email-sent { display: contents; }
.email-dnc { margin: 0; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--danger); color: var(--danger); font-weight: 700; animation: pop-in .35s var(--ease-out); }
.card-email { color: var(--muted); font-size: .86rem; text-decoration: underline; text-underline-offset: 3px; }
.card-email:hover { color: var(--accent-text); }
@media (max-width: 639.98px) { .email-pick { grid-template-columns: minmax(0, 1fr); } .email-actions .btn { flex-basis: 100%; min-height: 48px; } }

/* ---- pickups: what's working ------------------------------------------- */

.view-tabs { display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 18px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.view-tabs a { display: inline-flex; align-items: center; min-height: 40px; padding: 6px 16px; border-radius: 10px; color: var(--muted); text-decoration: none; font-weight: 700; }
.view-tabs a:hover { color: var(--ink); }
.view-tabs a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.period-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.period-chip { text-decoration: none; min-height: 36px; display: inline-flex; align-items: center; padding: 4px 14px; }
.period-chip[aria-current="true"] { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 800; }
.report-headline { font-size: clamp(1.4rem, 3.2vw, 2.1rem); font-weight: 800; line-height: 1.2; letter-spacing: -.01em; margin: 0 0 22px; max-width: 30ch; animation: fade-up .2s var(--ease-out) both; }
.stat-tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 26px; }
.stat-tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: grid; gap: 4px; animation: card-in .2s var(--ease-out) both; }
.stat-tile:nth-child(2) { animation-delay: .04s; } .stat-tile:nth-child(3) { animation-delay: .08s; }
.stat-tile:nth-child(4) { animation-delay: .12s; } .stat-tile:nth-child(5) { animation-delay: .16s; }
.stat-num { font-size: 2rem; line-height: 1; color: var(--accent-text); font-variant-numeric: tabular-nums; }
.stat-tile span { color: var(--muted); font-size: .85rem; font-weight: 600; }
.report-block { margin-bottom: 18px; }
.report-block h2 { margin: 0 0 10px; }
.report-table { width: 100%; border-collapse: collapse; }
.report-table th, .report-table td { padding: 10px 8px; text-align: left; border-top: 1px solid var(--line); vertical-align: middle; }
.report-table thead th { border-top: 0; font-size: .85rem; font-weight: 700; color: var(--muted); }
.report-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.report-table tbody th { font-weight: 700; }
.report-note { display: block; font-size: .82rem; font-weight: 500; color: var(--muted); margin-top: 2px; }
.report-devices { position: relative; min-width: 150px; }
.report-devices b { position: relative; z-index: 1; }
.report-bar { position: absolute; left: 8px; top: 50%; height: 22px; width: calc((100% - 16px) * var(--w, 0%) / 100%); transform: translateY(-50%); transform-origin: left; border-radius: 6px; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); animation: bar-grow .25s var(--ease-out) both; }
.report-calls { font-size: 1.1rem; font-weight: 600; margin: 0; }
@keyframes bar-grow { from { transform: translateY(-50%) scaleX(0); } }

@container page (max-width: 779.98px) { .stat-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 639.98px) {
  .view-tabs { display: grid; grid-template-columns: 1fr 1fr; }
  .view-tabs a { justify-content: center; min-height: 44px; }
  .period-chip { min-height: 44px; }
  .stat-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .report-table, .report-table tbody, .report-table tr, .report-table th, .report-table td { display: block; }
  .report-table tr { padding: 10px 0; border-top: 1px solid var(--line); }
  .report-table th, .report-table td { border: 0; padding: 3px 0; }
  .report-table td { display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  .report-table td::before { content: attr(data-label); color: var(--muted); font-weight: 600; text-align: left; }
  .report-devices { min-width: 0; }
  .report-bar { position: static; transform: none; order: 2; flex: 1; align-self: center; width: auto; max-width: calc(var(--w, 0%) * .5); }
  .report-devices b { order: 3; }
  @keyframes bar-grow { from { transform: scaleX(0); } }
}

/* ---- source health ------------------------------------------------------ */
.health-summary { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: -4px 0 18px; }
.health-summary .pill { font-size: .9rem; padding: 6px 14px; animation: pop-in .2s var(--ease-out) both; }
.health-summary .pill:nth-child(2) { animation-delay: .04s; } .health-summary .pill:nth-child(3) { animation-delay: .08s; }
.health-summary .pill:nth-child(4) { animation-delay: .12s; } .health-summary .pill:nth-child(5) { animation-delay: .16s; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px;
  font-size: .75rem; font-weight: 800; white-space: nowrap; vertical-align: middle;
  background: var(--surface-2, color-mix(in srgb, var(--muted) 14%, var(--surface))); color: var(--muted);
}
.pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.pill-ok { background: var(--accent-soft); color: var(--accent-text); }
.pill-failed { background: var(--danger-soft); color: var(--danger); }
.pill-failed::before { animation: pulse-ring 1.6s ease-out infinite; }
.pill-late { background: var(--warn-soft); color: var(--warn); }
.pill-running { background: color-mix(in srgb, #2563eb 16%, var(--surface)); color: #3b82f6; }
.pill-running::before { animation: pulse-ring 1.2s ease-out infinite; }
@media (prefers-reduced-motion: reduce) { .health-summary .pill, .pill::before { animation: none !important; } }

/* ---- feedback ------------------------------------------------------------ */
.feedback-form { max-width: 720px; display: grid; gap: 16px; margin-bottom: 18px; }
.feedback-form h2 { margin: 0; font-size: 1.3rem; }
.feedback-page { margin: 0; font-size: .9rem; overflow-wrap: anywhere; }

/* the fields, shared by the two dialogs and the plain page */
.rf { display: grid; gap: 6px; border: 0; padding: 0; margin: 0; min-width: 0; }
.rf > label, .rf > legend, .rf-label { font-size: .92rem; font-weight: 750; color: var(--ink); padding: 0; }
.rf textarea, .rf input[type="text"] { width: 100%; }
.rf [aria-invalid="true"] { border-color: var(--danger); }
.rf .error { margin: 0; padding: 6px 10px; border-radius: 8px; font-size: .88rem; }
.choice-row { display: flex; flex-wrap: wrap; gap: 8px; }
.choice {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 14px 6px 10px;
  border: 1.5px solid var(--field-line); border-radius: 12px; background: var(--surface);
  color: var(--ink); font-size: .92rem; font-weight: 650; cursor: pointer;
  transition: border-color .15s, background-color .15s, transform .15s var(--ease-out);
}
.choice input { width: 20px; min-height: 0; height: 20px; padding: 0; margin: 0; flex: none; accent-color: var(--ocean); }
.choice:hover { border-color: var(--cyan); }
.choice:has(input:checked) { border-color: var(--cyan); background: color-mix(in srgb, var(--cyan) 10%, var(--surface)); }
.choice:has(input:focus-visible) { box-shadow: var(--ring); }
.shot-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.shot-attach { position: relative; min-height: 44px; cursor: pointer; overflow: hidden; }
.shot-attach input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; padding: 0; opacity: 0; cursor: pointer; }
.shot-attach:has(input:focus-visible) { box-shadow: var(--ring); }
[data-capture] { min-height: 44px; }
.shot-note { margin: 0; font-size: .88rem; }
.shot-preview[hidden], [data-capture][hidden] { display: none; }
.shot-preview { display: flex; align-items: center; gap: 12px; margin: 0; }
.shot-preview img { max-width: 160px; max-height: 110px; height: auto; border-radius: 8px; border: 1px solid var(--line); object-fit: cover; }
.shot-preview .btn { min-height: 44px; }

/* the two dialogs: native <dialog>, so focus is trapped and the page behind is inert */
.report-dialog {
  width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 0; margin: auto;
  border: 1px solid var(--line); border-radius: 18px; background: var(--surface); color: var(--ink);
  box-shadow: var(--shadow-2); overflow: hidden;
}
.report-dialog[open] { display: block; animation: report-in .3s var(--ease-out); }
.report-dialog::backdrop { background: rgb(4 21 38 / .6); }
.report-dialog[open]::backdrop { animation: scrim-in .25s ease-out; }
.report-dialog.is-capturing { visibility: hidden; }
.report-dialog.is-capturing::backdrop { opacity: 0; animation: none; }
.report-form { display: grid; gap: 14px; padding: 0 20px 18px; max-height: calc(100dvh - 26px); overflow-y: auto; overscroll-behavior: contain; }
.report-head {
  display: flex; align-items: flex-start; gap: 12px; margin: 0 -20px; padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
}
.report-head-text { flex: 1; min-width: 0; }
.report-head h2 { margin: 0; font-size: 1.35rem; }
.report-head p { margin: 2px 0 0; font-size: .92rem; }
.report-badge { flex: none; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; }
.report-badge .side-icon { width: 26px; height: 26px; }
.report-close { flex: none; min-height: 44px; min-width: 44px; padding: 0; border-radius: 12px; border-color: transparent; background: transparent; }
.report-close:hover { background: var(--surface-2); }
.report-close:focus-visible { box-shadow: var(--ring); outline: none; }
.report-foot { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; padding-top: 4px; }
.report-context { font-size: .88rem; color: var(--muted); }
.report-context summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 700; }
.report-context ul { margin: 0 0 4px; padding-left: 20px; display: grid; gap: 2px; }
.report-context li { overflow-wrap: anywhere; }
/* bug: warm and serious */
.report-bug { border-top: 5px solid #ff6b4a; }
.report-bug .report-head { background: linear-gradient(135deg, color-mix(in srgb, #ff6b4a 16%, var(--surface)), var(--surface) 70%); }
.report-bug .report-badge { background: #ff6b4a; color: #2a0a02; box-shadow: 0 8px 18px -8px #ff6b4a; }
/* feature: bright, lime, a lightbulb that glows */
.report-feature { border-top: 5px solid var(--lime); }
.report-feature .report-head { background: linear-gradient(135deg, color-mix(in srgb, var(--lime) 24%, var(--surface)), var(--surface) 72%); }
.report-feature .report-badge { background: var(--lime); color: var(--accent-ink); animation: bulb-glow 2.4s ease-in-out 2 .3s; }
@keyframes report-in { from { opacity: 0; transform: translateY(14px) scale(.97); } }
@keyframes bulb-glow { 0%, 100% { box-shadow: 0 0 0 0 rgb(157 225 21 / 0); } 50% { box-shadow: 0 0 0 9px rgb(157 225 21 / .3), 0 0 26px rgb(157 225 21 / .55); } }
@media (max-width: 767.98px) {
  .report-dialog { width: 100vw; max-width: 100vw; max-height: 100dvh; margin: auto 0 0; border-radius: 18px 18px 0 0; }
  .report-form { max-height: calc(100dvh - 6px); padding-bottom: max(18px, env(safe-area-inset-bottom)); }
  .report-foot .btn { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .report-dialog[open], .report-dialog[open]::backdrop, .report-feature .report-badge { animation: none; }
  .choice { transition: none; }
}

/* sidebar footer: two feedback buttons above the user menu */
.side-report { display: grid; gap: 4px; }
.side-report-bug .side-icon { color: #ff8f6b; }
.side-report-feature .side-icon { color: var(--lime); }
.side-report .side-icon { transition: transform .18s var(--ease-out); }
.side-report .side-link:hover .side-icon { transform: scale(1.12); }
@media (prefers-reduced-motion: reduce) { .side-report .side-icon { transition: none; } .side-report .side-link:hover .side-icon { transform: none; } }

/* admin inbox */
.feedback-list { list-style: none; padding: 0; display: grid; gap: 12px; }
.feedback-item { display: grid; gap: 8px; margin: 0; }
.feedback-item.feedback-bug { border-left: 4px solid var(--danger); }
.feedback-item.feedback-feature { border-left: 4px solid var(--lime-deep); }
.feedback-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0; }
.feedback-title { margin: 0; font-size: 1.1rem; overflow-wrap: anywhere; }
.feedback-text { margin: 0; white-space: pre-wrap; max-width: 75ch; overflow-wrap: anywhere; }
.feedback-details { display: grid; gap: 4px; margin: 0; font-size: .92rem; }
.feedback-details > div { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.feedback-details dt { font-weight: 700; color: var(--muted); }
.feedback-details dd { margin: 0; overflow-wrap: anywhere; }
.feedback-shot { justify-self: start; display: block; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.feedback-shot img { display: block; width: 320px; max-width: calc(100vw - 80px); height: auto; }
.feedback-shot:focus-visible { box-shadow: var(--ring); outline: none; }
.feedback-context summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 700; color: var(--muted); }
.context-table { border-collapse: collapse; font-size: .85rem; width: 100%; }
.context-table th { text-align: left; font-weight: 700; color: var(--muted); padding: 3px 12px 3px 0; white-space: nowrap; vertical-align: top; text-transform: capitalize; }
.context-table td { padding: 3px 0; overflow-wrap: anywhere; }
.feedback-item form { justify-self: start; }

/* ---- schools -------------------------------------------------------------- */
.schools-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.schools-bar .seg-nav { margin: 0; }
.tab-count { margin-left: 6px; font-variant-numeric: tabular-nums; font-weight: 600; }
.seg-nav .tab-count { margin-left: 0; }
.seg-nav a { gap: 6px; }
.schools-search input { min-width: min(320px, 100%); }
.district-list { display: grid; gap: 10px; }
.district {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-1); overflow: hidden;
}
.district[open] { border-color: color-mix(in srgb, var(--cyan) 45%, var(--line)); }
.district summary {
  list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: 8px 18px; padding: 14px 18px 14px 44px; position: relative;
}
.district summary::-webkit-details-marker { display: none; }
.district summary::before {
  content: ""; position: absolute; left: 18px; top: 50%; width: 9px; height: 9px; margin-top: -6px;
  border-right: 2.5px solid var(--ocean); border-bottom: 2.5px solid var(--ocean);
  transform: rotate(-45deg); transition: transform .25s var(--ease-out);
}
.district[open] summary::before { transform: rotate(45deg); }
.district summary:hover { background: var(--surface-2); }
.district-main { display: grid; gap: 2px; }
.district-name { font-weight: 800; font-size: 1.1rem; color: var(--ink); text-decoration: none; }
a.district-name:hover { text-decoration: underline; }
.district-facts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.school-list { list-style: none; margin: 0; padding: 4px 18px 14px 44px; display: grid; animation: unfold .3s var(--ease-out); }
.school-list li {
  display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.2fr) auto auto; gap: 4px 16px;
  align-items: center; padding: 9px 0; border-top: 1px dashed var(--line);
}
.school-list a:first-child { font-weight: 650; }
.school-devices { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.school-phone { white-space: nowrap; font-variant-numeric: tabular-nums; }
.school-none { padding: 0 18px 14px 44px; margin: 0; }
@media (max-width: 700px) {
  .school-list { padding-left: 18px; }
  .school-list li { grid-template-columns: minmax(0, 1fr) auto; }
}
@media (prefers-reduced-motion: reduce) { .school-list { animation: none; } .district summary::before { transition: none; } }

/* ---- call flow: notes, panels, undo, claims, first-time guide ---------------- */
.quick-note { grid-column: 1 / -1; order: 0; display: block; }
.quick-note input { width: 100%; min-height: 40px; font-size: .9rem; background: var(--surface); }
details.talked > form.outcome-panel { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.outcome-panel .wide, .outcome-panel .panel-error, .outcome-panel .panel-hint { grid-column: 1 / -1; }
.outcome-panel .panel-error, .outcome-panel .panel-hint { margin: 0; }
.outcome-panel > button { justify-self: start; }
.outcome-panel [aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
details.talked > summary.outcome-not-interested { border-color: transparent; background: var(--surface-2); color: inherit; font-weight: 650; }
details.talked > summary.outcome-book-pickup { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.reason-picks { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.reason-picks legend { padding: 0; margin-bottom: 6px; font-weight: 650; }
.pick { position: relative; }
.pick input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.pick span { display: inline-flex; align-items: center; min-height: 40px; padding: 6px 14px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); font-size: .9rem; transition: background .15s, border-color .15s; }
.pick input:checked + span { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); font-weight: 700; }
.pick input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.toast.has-undo::after { animation-duration: 9s; }
.toast-undo {
  margin-left: auto; flex: none; min-height: 34px; padding: 4px 14px; border-radius: 999px;
  background: var(--lime); color: var(--bar); border: 0; font-weight: 800; cursor: pointer;
}
.toast-undo:hover { filter: brightness(1.08); }
.toast-undo:disabled { opacity: .7; cursor: progress; }

.band-desc { margin: -6px 0 12px; color: var(--muted); font-size: .9rem; max-width: 70ch; }
.chip-calling { background: var(--warn-soft); color: var(--warn); border-color: transparent; font-weight: 700; }

.first-time {
  margin: 4px 0 18px; padding: 18px 20px; border-radius: 16px;
  background: var(--surface); border: 1.5px solid color-mix(in srgb, var(--accent) 45%, transparent);
  box-shadow: var(--shadow-1); animation: unfold .35s var(--ease-out) both;
}
.first-time h2 { margin: 0 0 10px; font-size: 1.05rem; }
.first-time-toggle {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; margin: -8px 0; padding: 0;
  background: none; border: 0; box-shadow: none; font: inherit; font-weight: 800; color: inherit; text-align: left; cursor: pointer;
}
.first-time-toggle::after {
  content: ""; width: 8px; height: 8px; margin-left: auto; border: solid currentColor; border-width: 0 2px 2px 0;
  transform: rotate(45deg) translate(-2px, -2px); transition: transform .2s var(--ease-out);
}
.first-time-toggle[aria-expanded="false"]::after { transform: rotate(-45deg); }
.first-time-toggle:hover { transform: none; }
.first-time.is-collapsed { padding-top: 8px; padding-bottom: 8px; }
.first-time.is-collapsed h2 { margin: 0; }
.first-time.is-collapsed .first-time-toggle { margin: 0; }
@media (max-width: 640px) {
  .first-time { margin: 0 0 12px; padding: 10px 14px; border-radius: 12px; }
  .first-time h2 { margin-bottom: 6px; }
  .first-time ol { gap: 2px; font-size: .92rem; }
  /* Until the guide is dismissed the steps are short; opening it from the toggle shows everything. */
  .first-time:not(.is-collapsed):not(.is-opened) .ft-more { display: none; }
  .first-time-foot { margin-top: 8px; }
}
.first-time ol { margin: 0; padding-left: 22px; display: grid; gap: 6px; max-width: 75ch; }
.first-time-foot a { display: inline-block; padding: 10px 0; }
.first-time-foot { margin: 12px 0 0; display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; }

.help { display: grid; gap: 18px; max-width: 820px; }
.help h2 { margin-top: 0; }
.help-steps, .help-list { margin: 0; padding-left: 22px; display: grid; gap: 8px; }
.help-terms { margin: 0; display: grid; grid-template-columns: minmax(120px, max-content) 1fr; gap: 8px 18px; }
.help-terms dt { font-weight: 750; }
.help-terms dd { margin: 0; }
@media (max-width: 640px) {
  .help-terms { grid-template-columns: 1fr; }
  .help-terms dd { margin-bottom: 8px; }
  details.talked > form.outcome-panel { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .first-time { animation: none; } .first-time-toggle::after { transition: none; } }
.outcome-form .enter-guard { display: none; }

/* ---- dashboard home ---------------------------------------------------- */

.dash-lede { margin: 8px 0 0; color: #c9d9e4; font-size: 1.05rem; }
.dash-cta { margin: 18px 0 4px; }
.btn-big { min-height: 56px; padding: 0 30px; font-size: 1.15rem; font-weight: 800; border-radius: 14px; }
.page-head[data-variant="hero"] .meter-text { color: #c9d9e4; }
.page-head[data-variant="hero"] .meter-text strong { color: #fff; }
.page-head[data-variant="hero"] .day-meter { margin: 16px 0 0; max-width: 520px; }

.dash-bands { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-bottom: 18px; }
.dash-band {
  display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; text-decoration: none; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--band, var(--accent));
  border-radius: var(--radius); box-shadow: var(--shadow-1);
  --band: var(--accent); --band-text: var(--accent-text);
  transition: transform .15s var(--ease-out), box-shadow .15s;
}
.dash-band.band-callback { --band: #f59e0b; --band-text: var(--warn); }
.dash-band.band-intro { --band: #0dbbfc; --band-text: var(--info); }
.dash-band:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.dash-band-num { font-size: 2.4rem; font-weight: 900; line-height: 1; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.dash-band-title { display: flex; align-items: center; gap: 8px; font-weight: 800; color: var(--band-text); }
.dash-band-desc { font-size: .9rem; color: var(--muted); }

.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 0 18px; }
.dash-list { list-style: none; margin: 10px 0 0; padding: 0; }
.dash-list li + li { border-top: 1px solid var(--line); }
.dash-list a { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; padding: 9px 2px; text-decoration: none; color: var(--ink); }
.dash-list a:hover .dash-what { text-decoration: underline; }
.dash-when, .dash-who { font-weight: 800; min-width: 7.5em; }
.dash-what { font-weight: 600; }
.dash-note { margin: 10px 0 0; font-weight: 700; }
.dash-alert { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); background: var(--danger-soft); }
.dash-alert ul { margin: 6px 0; padding-left: 20px; }
/* Radar AI: clues the researcher found on the web, and its desk on the Dashboard. */
.chip-found-ai { background: var(--info-soft); color: var(--info); border-color: transparent; }
.card-evidence .chip-found-ai { margin-left: 4px; font-size: .74rem; padding: 1px 8px; vertical-align: 1px; }
.ai-desk { border-top: 4px solid var(--cyan); }
.ai-desk h2 { display: flex; align-items: center; gap: 10px; }
.ai-desk h3 { margin: 14px 0 0; font-size: .95rem; font-weight: 800; color: var(--info); }
.ai-desk-lede { margin: 4px 0 0; }
.ai-desk-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 24px; }
.ai-desk-queue { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.ai-desk-queue li { padding: 4px 12px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-weight: 600; font-size: .88rem; }
.ai-desk-find { flex-basis: 100%; color: var(--ink); }
.ai-desk .dash-list a { min-height: 44px; }
.ai-desk-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 0 0 color-mix(in srgb, var(--cyan) 60%, transparent); }
@media (prefers-reduced-motion: no-preference) {
  .ai-desk-dot { animation: ai-desk-pulse 2.4s var(--ease-out) infinite; }
}
@keyframes ai-desk-pulse { 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.dash-won-num { margin: 4px 0 0; font-size: clamp(2.6rem, 7vw, 4rem); font-weight: 900; line-height: 1; letter-spacing: -.04em; font-variant-numeric: tabular-nums; color: var(--accent-text); }

/* One page-load moment: the hero settles in, its pieces following one after another. */
@media (prefers-reduced-motion: no-preference) {
  .page-head[data-variant="hero"] { animation: dash-hero-in .25s var(--ease-out) both; }
  .page-head[data-variant="hero"]::after { animation: dash-ring .4s var(--ease-out) both; }
  .page-head[data-variant="hero"] :is(h1, .head-stat, .dash-lede, .dash-cta, .day-meter) { animation: fade-up .2s var(--ease-out) both; }
  .page-head[data-variant="hero"] h1 { animation-delay: .04s; }
  .page-head[data-variant="hero"] :is(.dash-lede, .head-stat) { animation-delay: .08s; }
  .page-head[data-variant="hero"] .dash-cta { animation-delay: .12s; }
  .page-head[data-variant="hero"] .day-meter { animation-delay: .16s; }
}
@keyframes dash-hero-in { from { opacity: 0; transform: translateY(10px) scale(.99); } }
@keyframes dash-ring { from { transform: scale(.6); opacity: 0; } }

/* Phones: make card title links at least 44px tall to tap, without moving anything. */
@media (max-width: 768px) {
  .card-head h3 a, .pickup-card h3 a { display: inline-block; padding: 12px 0; margin: -12px 0; }
}

/* ==========================================================================
   Polish layer: the Dashboard radar (the one bold piece), then quiet,
   consistent finishing for everything else.
   ========================================================================== */

/* ---- Dashboard radar ------------------------------------------------------
   Rings every quarter of the range, a crosshair, and a lime sweep that turns
   once every 6 s (SWEEP_SECONDS in radar/dashboard.py). Each blip lights up as
   the sweep passes it: its animation delay is its compass angle in seconds. */

.page-head[data-variant="hero"]:has(.radar) { min-height: 300px; padding-right: calc(clamp(200px, 26cqi, 260px) + 64px); }
.page-head[data-variant="hero"]:has(.radar) .page-head-actions { position: static; }
.page-head[data-variant="hero"]:has(.radar)::after { display: none; }

.radar {
  --size: clamp(200px, 26cqi, 260px);
  position: absolute; z-index: 0; right: 36px; top: 50%; width: var(--size); aspect-ratio: 1;
  translate: 0 -50%; border-radius: 50%;
  background:
    linear-gradient(rgb(13 187 252 / .3), rgb(13 187 252 / .3)) center / 1px 90% no-repeat,
    linear-gradient(90deg, rgb(13 187 252 / .3), rgb(13 187 252 / .3)) center / 90% 1px no-repeat,
    repeating-radial-gradient(circle closest-side, transparent 0 calc(22.5% - 1px), rgb(13 187 252 / .42) calc(22.5% - 1px) 22.5%),
    radial-gradient(circle closest-side, rgb(13 187 252 / .14), rgb(10 38 64 / .2) 70%, transparent 100%);
  box-shadow: inset 0 0 40px rgb(13 187 252 / .12), 0 0 0 1px rgb(13 187 252 / .25), 0 0 60px -10px rgb(13 187 252 / .35);
  animation: radar-on .4s var(--ease-out) both;
}
@keyframes radar-on { from { opacity: 0; scale: .86; rotate: -12deg; } }

.radar-sweep {
  position: absolute; inset: 5%; border-radius: 50%; pointer-events: none;
  background: conic-gradient(from 0deg, transparent 0deg 290deg, rgb(157 225 21 / .05) 300deg,
                             rgb(157 225 21 / .32) 359deg, rgb(157 225 21 / .9) 359.6deg, transparent 360deg);
  animation: radar-turn 6s linear infinite;
}
@keyframes radar-turn { to { rotate: 1turn; } }

.radar-home {
  position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 0 3px rgb(13 187 252 / .5), 0 0 16px 4px rgb(13 187 252 / .6);
}

.radar-blip {
  --c: var(--lime);
  position: absolute; left: var(--x); top: var(--y); width: 10px; height: 10px; margin: -5px 0 0 -5px;
  border-radius: 50%; background: var(--c); opacity: .6;
  box-shadow: 0 0 0 0 var(--c);
  animation: radar-blip-ping 6s linear infinite var(--d) both;
  transition: scale .2s var(--ease-out), opacity .2s;
}
.radar-blip-callback { --c: #f8a93a; }
.radar-blip-intro { --c: var(--cyan); }
.radar-blip::before { content: ""; position: absolute; inset: -9px; border-radius: 50%; } /* bigger hover target */
.radar-blip:hover { opacity: 1; scale: 1.5; z-index: 3; animation-play-state: paused; }
@keyframes radar-blip-ping {
  0%   { opacity: 1; box-shadow: 0 0 0 0 var(--c), 0 0 12px 2px var(--c); }
  12%  { box-shadow: 0 0 0 9px transparent, 0 0 8px 1px var(--c); }
  45%, 100% { opacity: .55; box-shadow: 0 0 0 0 transparent, 0 0 0 0 transparent; }
}
.radar-blip-label {
  position: absolute; left: 50%; bottom: calc(100% + 9px); translate: -50% 4px;
  padding: 4px 9px; border-radius: 8px; white-space: nowrap; pointer-events: none;
  font: 700 .78rem/1.2 var(--font); color: var(--navy); background: #fff;
  box-shadow: 0 8px 20px -6px rgb(0 0 0 / .5); opacity: 0; scale: calc(1 / 1.5);
  transition: opacity .15s, translate .2s var(--ease-out);
}
.radar-blip:hover .radar-blip-label { opacity: 1; translate: -50% 0; }

/* Narrow: the radar becomes a quiet backdrop behind the greeting. */
@container page (max-width: 640px) {
  .page-head[data-variant="hero"]:has(.radar) { padding-right: 24px; min-height: 0; }
  .radar { --size: 230px; right: -70px; top: 0; translate: 0 -10%; opacity: .45; }
  .radar-blip { pointer-events: none; }
}

/* ---- page headers ----------------------------------------------------------
   Plain page headers get a thin brand rule, so every page starts the same way. */
.page-head:not([data-variant="hero"]) {
  position: relative; padding-bottom: 16px;
}
.page-head:not([data-variant="hero"])::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, var(--lime), var(--cyan) 28%, color-mix(in srgb, var(--line) 80%, transparent) 60%, transparent);
  transform-origin: left; animation: rule-in .3s var(--ease-out) both;
}
@keyframes rule-in { from { transform: scaleX(0); } }
.page-head:not([data-variant="hero"]) h1 { letter-spacing: -.04em; }
.page-sub { color: var(--muted); max-width: 68ch; margin-top: 6px; }

/* ---- surfaces --------------------------------------------------------------
   Panels, cards and tables share one depth system: a hairline edge, a soft
   two-layer shadow, and a faint top highlight. */
:root {
  --shadow-1: 0 1px 1px rgb(10 38 64 / .04), 0 2px 4px rgb(10 38 64 / .04), 0 8px 24px -12px rgb(10 38 64 / .14);
  --shadow-2: 0 2px 4px rgb(10 38 64 / .06), 0 18px 40px -14px rgb(10 38 64 / .3);
}
@media (prefers-color-scheme: dark) {
  :root {
    --shadow-1: 0 1px 2px rgb(0 0 0 / .35), 0 10px 28px -14px rgb(0 0 0 / .6);
    --shadow-2: 0 2px 6px rgb(0 0 0 / .4), 0 22px 48px -16px rgb(0 0 0 / .75);
  }
}
.panel, .card, .pickup-card, .table-wrap:not(.table-wrap-plain), .dash-band {
  background-image: linear-gradient(180deg, color-mix(in srgb, #fff 55%, transparent), transparent 60px);
}
@media (prefers-color-scheme: dark) {
  .panel, .card, .pickup-card, .table-wrap:not(.table-wrap-plain), .dash-band {
    background-image: linear-gradient(180deg, rgb(255 255 255 / .035), transparent 60px);
  }
}
.panel h2 { display: flex; align-items: center; gap: 10px; }

/* Links that open a business: the name underlines from the left. */
.card-head h3 a, .pickup-card h3 a, .cell-name a, .dash-what {
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) left bottom / 0 2px no-repeat;
  transition: background-size .3s var(--ease-out), color .15s;
}
.card-head h3 a:hover, .pickup-card h3 a:hover, .cell-name a:hover, a:hover .dash-what { background-size: 100% 2px; text-decoration: none; }

/* ---- tables ---------------------------------------------------------------- */
.table th { letter-spacing: .01em; border-bottom: 1px solid var(--line); }
.table tbody tr { position: relative; }
.table tbody tr:hover { background: color-mix(in srgb, var(--cyan) 7%, transparent); }
.table tbody tr:hover td:first-child { box-shadow: inset 3px 0 0 var(--cyan); }
.table td, .num, .count, .tab-count, .nav-count, .side-count { font-variant-numeric: tabular-nums; }

/* ---- buttons ----------------------------------------------------------------
   The lime button catches a light sweep on hover; every button presses in. */
.btn-primary {
  background-image: linear-gradient(110deg, transparent 35%, rgb(255 255 255 / .5) 50%, transparent 65%);
  background-size: 250% 100%; background-position: 130% 0; background-repeat: no-repeat;
  transition: background-position .7s var(--ease-out), transform .15s var(--ease-out), box-shadow .2s;
  box-shadow: 0 1px 0 rgb(255 255 255 / .35) inset, 0 8px 18px -10px color-mix(in srgb, var(--lime) 90%, #000);
}
.btn-primary:hover { background-position: -30% 0; box-shadow: 0 1px 0 rgb(255 255 255 / .35) inset, 0 12px 24px -10px color-mix(in srgb, var(--lime) 90%, #000); }
.btn:active, button:active { transition-duration: .05s; }

/* ---- Pickups board: four real columns, never squeezed ------------------------ */
.board { grid-template-columns: repeat(4, minmax(216px, 1fr)); overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x proximity; }
.board > * { scroll-snap-align: start; }
.board.has-tabs { overflow-x: visible; }

/* ---- forms ------------------------------------------------------------------ */
input, select, textarea { transition: border-color .15s, box-shadow .2s; }
input:focus, select:focus, textarea:focus { border-color: var(--cyan); box-shadow: 0 0 0 4px color-mix(in srgb, var(--cyan) 22%, transparent); }

/* ---- scrollbars -------------------------------------------------------------- */
html { scrollbar-color: color-mix(in srgb, var(--muted) 45%, transparent) transparent; }

/* ---- motion off ---------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .radar, .radar-sweep, .radar-blip, .page-head:not([data-variant="hero"])::after { animation: none !important; }
  .radar-sweep { opacity: .5; }
  .btn-primary { transition: none; }
}

/* ---- Write with AI ------------------------------------------------------ */
.email-ai { display: grid; gap: 8px; justify-items: start; }
.email-ai .btn { min-height: 44px; }
.email-ai .ai-busy, .email-ai .ai-shimmer, .email-ai .ai-wait { display: none; }
.panel-email.htmx-request .email-ai .ai-idle { display: none; }
.panel-email.htmx-request .email-ai .ai-busy { display: inline; }
.panel-email.htmx-request .email-ai .ai-wait { display: block; font-size: .86rem; }
.panel-email.htmx-request .email-ai .ai-shimmer { display: block; }
.ai-shimmer { width: 100%; height: 6px; border-radius: 3px; overflow: hidden; background: var(--accent-soft); position: relative; }
.ai-shimmer::after { content: ""; position: absolute; inset: 0; width: 40%; border-radius: 3px; background: var(--accent); animation: ai-slide 1.2s ease-in-out infinite; }
@keyframes ai-slide { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
@media (prefers-reduced-motion: reduce) { .ai-shimmer::after { animation: none; width: 100%; opacity: .5; } }
.email-ai-note { margin: 0; font-size: .86rem; font-weight: 600; color: var(--accent-text); }
.email-ai-note.is-off { color: var(--muted); }

/* Source ideas (admin) */
.idea-list { list-style: none; margin: 0 0 24px; padding: 0; display: grid; gap: 12px; }
.idea-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 6px; }
.idea-title { margin: 0 0 4px; font-size: 1.05rem; }
.idea-gives, .idea-link { margin: 0 0 6px; overflow-wrap: anywhere; }
.idea-actions { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-top: 10px; }
.idea-watch { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; }
.idea-watch select { min-height: 44px; max-width: 100%; }

/* Admin AI page */
.plain-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
#ai-engine .pill, #ai-speed .pill { margin-left: 4px; }

/* Admin AI page: the two speed-test buttons side by side, wrapping on phones. */
.ai-bench-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ==========================================================================
   Module mode: the push home, the push list, push results, Admin -> Areas.
   One bold piece (the scope on the start screen); everything else is quiet.
   ========================================================================== */

.js .no-js-only { display: none; }

/* ---- sidebar: what is running ---------------------------------------------- */
.side-count[hidden] { display: none; }
.side-push {
  display: flex; gap: 8px; align-items: baseline; margin: 10px 8px 4px; padding: 9px 11px;
  border-radius: 10px; background: rgb(157 225 21 / .08); border: 1px solid rgb(157 225 21 / .22);
  color: var(--bar-ink); font-size: .8rem; line-height: 1.35;
}
.side-push strong { font-weight: 750; }
.side-push-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--lime); translate: 0 -1px; box-shadow: 0 0 0 3px rgb(157 225 21 / .18); }
@media (min-width: 1100px) { :is(.shell.is-rail, .side-rail .shell) .side-push { display: none; } }
@media (min-width: 768px) and (max-width: 1099.98px) { .shell .side-push { display: none; } }

/* ---- start screen -------------------------------------------------------- */
.last-push { margin: -6px 0 22px; color: var(--muted); font-size: .95rem; max-width: 80ch; }
.last-push a { font-weight: 700; color: var(--accent-text); }

.launch-grid {
  display: grid; grid-template-columns: minmax(260px, 400px) minmax(0, 1fr); gap: 28px 48px; align-items: start;
}
@container page (max-width: 860px) { .launch-grid { grid-template-columns: minmax(0, 1fr); } }

/* the scope */
.scope-wrap { position: sticky; top: 24px; display: grid; justify-items: center; gap: 12px; }
@container page (max-width: 860px) { .scope-wrap { position: static; } }
.scope {
  --size: min(100%, 400px);
  position: relative; width: var(--size); aspect-ratio: 1; border-radius: 50%;
  background:
    linear-gradient(rgb(13 187 252 / .22), rgb(13 187 252 / .22)) center / 1px 88% no-repeat,
    linear-gradient(90deg, rgb(13 187 252 / .22), rgb(13 187 252 / .22)) center / 88% 1px no-repeat,
    repeating-radial-gradient(circle closest-side, transparent 0 calc(21% - 1px), rgb(13 187 252 / .32) calc(21% - 1px) 21%),
    radial-gradient(circle closest-side, #0f4a80 0%, #0b2d4f 62%, #081f37 100%);
  box-shadow: 0 0 0 1px rgb(13 187 252 / .28), 0 0 0 10px color-mix(in srgb, var(--navy) 6%, transparent),
              0 30px 60px -30px rgb(10 38 64 / .75), inset 0 0 50px rgb(13 187 252 / .12);
  animation: scope-on .4s var(--ease-out) both;
}
@container page (max-width: 860px) { .scope { --size: min(100%, 300px); } }
@keyframes scope-on { from { opacity: 0; scale: .92; } }
.scope-sweep {
  position: absolute; inset: 6%; border-radius: 50%; pointer-events: none;
  background: conic-gradient(from 0deg, transparent 0deg 280deg, rgb(157 225 21 / .04) 290deg,
                             rgb(157 225 21 / .28) 358deg, rgb(157 225 21 / .95) 359.5deg, transparent 360deg);
  animation: scope-turn 9s linear infinite;
}
@keyframes scope-turn { to { rotate: 1turn; } }
/* turning to an area (app.js drives it), then settled: the sweep narrows to a beam */
.scope.is-turning .scope-sweep { animation: none; }
.scope.is-settled .scope-sweep {
  animation: none;
  background: conic-gradient(from 0deg, transparent 0deg 322deg, rgb(157 225 21 / .08) 330deg,
                             rgb(157 225 21 / .42) 358deg, rgb(157 225 21 / 1) 359.5deg, transparent 360deg);
}
.scope-home {
  position: absolute; left: 50%; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 0 4px rgb(13 187 252 / .35), 0 0 18px 4px rgb(13 187 252 / .5);
}
.scope-blip {
  --d: calc(8px + var(--s, 0) * .16px);
  position: absolute; left: var(--x); top: var(--y); width: var(--d); height: var(--d);
  translate: -50% -50%; border-radius: 50%; cursor: pointer;
  background: var(--cyan); box-shadow: 0 0 10px rgb(13 187 252 / .7);
  transition: opacity .3s, background-color .3s, box-shadow .3s, scale .3s var(--ease-out);
}
.scope-blip::before { content: ""; position: absolute; inset: -8px; border-radius: 50%; } /* easier to hit */
.scope-label {
  position: absolute; left: 50%; bottom: calc(100% + 8px); translate: -50% 3px; white-space: nowrap;
  padding: 3px 9px; border-radius: 8px; font: 700 .78rem/1.3 var(--font); color: var(--navy); background: #fff;
  box-shadow: 0 8px 20px -6px rgb(0 0 0 / .5); opacity: 0; pointer-events: none;
  transition: opacity .2s, translate .25s var(--ease-out);
}
.scope-blip:hover .scope-label { opacity: 1; translate: -50% 0; }
.scope.has-lock .scope-blip:not(.is-locked) { opacity: .38; }
.scope-blip.is-locked { background: var(--lime); box-shadow: 0 0 0 4px rgb(157 225 21 / .25), 0 0 18px 3px rgb(157 225 21 / .7); scale: 1.25; z-index: 2; }
.scope-blip.is-locked .scope-label { opacity: 1; translate: -50% 0; }
.scope-blip.is-locked::after {
  content: ""; position: absolute; inset: -2px; border-radius: 50%; border: 2px solid var(--lime);
  animation: scope-lock .7s var(--ease-out) both;
}
@keyframes scope-lock { from { opacity: 1; scale: 1; } to { opacity: 0; scale: 3.2; } }
.scope-caption { margin: 0; max-width: 34ch; text-align: center; font-size: .85rem; color: var(--muted); }

/* the three questions */
.launch-qs { display: grid; gap: 26px; min-width: 0; }
.q { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 12px; }
.q > legend { display: flex; align-items: center; gap: 12px; padding: 0; margin-bottom: 12px; font-size: 1.2rem; font-weight: 800; letter-spacing: -.015em; color: var(--ink); }
.q-num {
  flex: none; display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  border: 1.5px solid color-mix(in srgb, var(--cyan) 60%, var(--line)); color: var(--accent-text);
  font-size: .9rem; font-weight: 800; font-variant-numeric: tabular-nums;
}
.q-hint { margin: -6px 0 0; color: var(--muted); font-size: .92rem; }
.q-hint strong { color: var(--ink); }
.q-error { margin: 0; }
.q-pair { display: flex; flex-wrap: wrap; gap: 16px 28px; }
.q-sub { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; }
.q-sub > legend { padding: 0; margin-bottom: 8px; font-size: .88rem; font-weight: 700; color: var(--muted); }
.q-empty { padding: 16px 18px; border: 1.5px dashed var(--line); border-radius: var(--radius); color: var(--muted); }
.q-empty p { margin: 0 0 8px; } .q-empty p:last-child { margin: 0; }

/* segmented choices: real radios, the whole segment is the target */
.seg { display: inline-flex; flex-wrap: wrap; gap: 0; border: 1.5px solid var(--field-line); border-radius: 12px; overflow: hidden; background: var(--surface); width: max-content; max-width: 100%; }
.seg-pick { position: relative; display: block; font-size: 1rem; font-weight: 750; color: var(--ink); }
.seg-pick + .seg-pick { border-left: 1px solid var(--line); }
.seg-pick input { position: absolute; inset: 0; opacity: 0; margin: 0; width: 100%; height: 100%; cursor: pointer; min-height: 0; }
.seg-pick span { display: grid; place-items: center; min-width: 64px; min-height: 46px; padding: 0 16px; font-variant-numeric: tabular-nums; transition: background-color .15s, color .15s; }
.seg-pick:hover span { background: color-mix(in srgb, var(--cyan) 9%, transparent); }
.seg-pick input:checked + span { background: var(--navy); color: #fff; }
.seg-pick:has(input:focus-visible) { outline: 3px solid var(--cyan); outline-offset: -3px; z-index: 1; }
@media (prefers-color-scheme: dark) { .seg-pick input:checked + span { background: var(--lime); color: var(--accent-ink); } }
.goal-other { max-width: 220px; }
.q:has([data-goal-other]:not(:checked)) .goal-other { display: none; }

/* the areas: a quiet list, one row each */
.areas {
  display: grid; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  max-height: 27rem; overflow-y: auto; overscroll-behavior: contain;
}
.area-pick {
  position: relative; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 2px 16px;
  min-height: 56px; padding: 12px 16px 12px 20px; cursor: pointer; color: var(--ink); font-size: 1rem;
  transition: background-color .15s;
}
.area-pick + .area-pick { border-top: 1px solid var(--line); }
.area-pick input { position: absolute; opacity: 0; width: 1px; height: 1px; min-height: 0; }
.area-pick::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: transparent; transition: background-color .2s; }
.area-pick:hover { background: color-mix(in srgb, var(--cyan) 6%, transparent); }
.area-pick:has(input:checked) { background: color-mix(in srgb, var(--lime) 10%, var(--surface)); }
.area-pick:has(input:checked)::before { background: var(--lime-deep); }
.area-pick:has(input:focus-visible) { outline: 3px solid var(--cyan); outline-offset: -3px; }
.area-name { flex: 1 0 auto; max-width: 100%; font-weight: 800; letter-spacing: -.01em; overflow-wrap: anywhere; }
.area-facts { font-size: .9rem; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.area-cb { color: var(--warn); }
.area-pick.is-empty .area-name { color: var(--muted); }

/* the preview and the start button */
.launch-go {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px 32px; align-items: end;
  margin-top: 32px; padding-top: 22px; border-top: 2px solid var(--line);
}
@container page (max-width: 860px) { .launch-go { grid-template-columns: minmax(0, 1fr); } }
.preview { min-height: 3.2em; }
.preview-line { margin: 0; font-size: clamp(1.1rem, 2.4cqi, 1.35rem); font-weight: 600; line-height: 1.4; max-width: 46ch; color: var(--ink); }
.preview-line strong { font-weight: 850; }
.preview-more { margin: 6px 0 0; color: var(--muted); }
.preview-act { margin: 10px 0 0; }
.preview-goal { display: grid; gap: 6px; margin-top: 12px; max-width: 420px; }
.preview-track { position: relative; height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.preview-fill { position: absolute; inset: 0 auto 0 0; width: var(--pct); border-radius: inherit; background: linear-gradient(90deg, var(--cyan), var(--lime)); transition: width .35s var(--ease-out); }
.preview-goal-text { font-size: .88rem; font-weight: 600; color: var(--muted); }
.launch-start { display: grid; gap: 10px; justify-items: stretch; width: min(100%, 320px); }
.launch-name { font-size: .85rem; }
.launch-name .muted { font-weight: 600; }
@container page (max-width: 860px) { .launch-start { width: 100%; } }
.launch-btn { width: 100%; }

/* ---- the push list ---------------------------------------------------------- */
.push-bar { margin: -6px 0 18px; }
.push-progress {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin: 0;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-1);
}
.pp-item { display: grid; align-content: start; gap: 4px; padding: 14px 18px; min-width: 0; }
.pp-item + .pp-item { border-left: 1px solid var(--line); }
.pp-item dt { font-size: .82rem; font-weight: 700; color: var(--muted); }
.pp-item dd { margin: 0; color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.pp-item dd strong { font-size: 1.5rem; font-weight: 850; letter-spacing: -.02em; color: var(--ink); margin-right: 2px; }
.pp-track { display: block; height: 5px; margin-top: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.pp-track > span { display: block; height: 100%; width: var(--pct); border-radius: inherit; background: var(--cyan); transition: width .6s var(--ease-out); }
.pp-track-goal > span { background: var(--lime-deep); }
@media (max-width: 560px) {
  .push-progress { grid-template-columns: minmax(0, 1fr); }
  .pp-item + .pp-item { border-left: 0; border-top: 1px solid var(--line); }
  .pp-item { grid-template-columns: 5.5rem minmax(0, 1fr); align-items: baseline; padding: 10px 14px; }
  .pp-track { grid-column: 1 / -1; margin-top: 0; }
  .pp-item dd strong { font-size: 1.2rem; }
}
.band-list { --band: var(--cyan); --band-soft: var(--info-soft); --band-text: var(--info); }
.push-more { margin: 4px 0 0; font-size: .92rem; }

/* the end-push confirm: a modal with scripts, a plain section without */
.confirm-dialog {
  width: min(460px, calc(100vw - 24px)); padding: 22px 22px 18px; margin: auto;
  border: 1px solid var(--line); border-radius: 18px; background: var(--surface); color: var(--ink);
  box-shadow: var(--shadow-2);
}
.confirm-dialog[open] { animation: report-in .25s var(--ease-out); }
.confirm-dialog::backdrop { background: rgb(4 21 38 / .6); }
.confirm-dialog h2 { margin: 0 0 8px; font-size: 1.3rem; }
.confirm-dialog p { margin: 0 0 16px; color: var(--muted); }
.confirm-dialog[data-no-js-open] { position: static; margin: 24px 0 0; }
.confirm-actions { display: flex; flex-wrap: wrap; gap: 10px; }
@media (prefers-reduced-motion: reduce) { .confirm-dialog[open] { animation: none; } }

/* ---- push results --------------------------------------------------------------- */
.push-history { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-1); }
.ph-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 20px; padding: 14px 18px; align-items: baseline; }
.ph-row + .ph-row { border-top: 1px solid var(--line); }
.ph-name { font-weight: 800; font-size: 1.08rem; color: var(--ink); }
.ph-when { grid-column: 1; font-size: .9rem; color: var(--muted); }
.ph-facts { grid-column: 2; grid-row: 1 / span 2; align-self: center; text-align: right; color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.ph-facts strong { color: var(--ink); }
@media (max-width: 560px) { .ph-row { grid-template-columns: minmax(0, 1fr); } .ph-facts { grid-column: 1; grid-row: auto; text-align: left; } }

.result { display: grid; gap: 26px; max-width: 900px; }
.result h2 { font-size: 1.05rem; margin: 0 0 10px; }
.result-big { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; font-size: 1.15rem; font-weight: 700; color: var(--muted); }
.result-num { font-size: clamp(2.8rem, 8cqi, 4.2rem); font-weight: 900; line-height: 1; letter-spacing: -.045em; color: var(--ink); font-variant-numeric: tabular-nums; }
.result-vs { margin: 8px 0 8px; font-weight: 700; color: var(--accent-text); }
.result-track { display: block; height: 10px; max-width: 520px; border-radius: 5px; background: var(--surface-2); overflow: hidden; }
.result-track > span { display: block; height: 100%; width: var(--pct); border-radius: inherit; background: linear-gradient(90deg, var(--cyan), var(--lime)); }
.result-figures { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); margin: 0; border-block: 1px solid var(--line); }
.result-figures > div { padding: 14px 16px 14px 0; }
.result-figures > div + div { padding-left: 16px; border-left: 1px solid var(--line); }
.result-figures dt { font-size: .82rem; font-weight: 700; color: var(--muted); }
.result-figures dd { margin: 2px 0 0; font-size: 1.45rem; font-weight: 850; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
@container page (max-width: 720px) {
  .result-figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .result-figures > div, .result-figures > div + div { padding: 12px 12px 12px 0; border-left: 0; border-top: 1px solid var(--line); }
  .result-figures > div:nth-child(-n+2) { border-top: 0; }
}
.result-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 40px; }
@container page (max-width: 720px) { .result-cols { grid-template-columns: minmax(0, 1fr); } }
.result-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.result-bars li { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr) 3rem; align-items: center; gap: 10px; font-weight: 600; }
.rb-bar { height: 10px; border-radius: 5px; background: linear-gradient(90deg, var(--harbor), var(--cyan)); width: max(4px, var(--w)); }
.rb-num { text-align: right; font-variant-numeric: tabular-nums; }
.result-top { margin: 0; padding-left: 1.3em; display: grid; gap: 6px; }
.result-top a { font-weight: 700; }
.result-next p { margin: 0; }
.result-areas { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.result-areas li { padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); font-size: .88rem; font-weight: 600; }
.result-note { font-size: .85rem; margin: 0; }

/* ---- Admin -> Areas ------------------------------------------------------------ */
.area-admin { list-style: none; margin: 0; padding: 0; }
.aa-row { display: grid; gap: 6px; padding: 14px 0; }
.aa-row + .aa-row { border-top: 1px solid var(--line); }
.aa-rename { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.aa-rename label { flex: 1 1 240px; max-width: 420px; }
.aa-facts { margin: 0; font-size: .9rem; overflow-wrap: anywhere; }
.aa-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.aa-actions form { margin: 0; }
.county-table select { min-width: 180px; }
.county-table th[scope="row"] { font-weight: 700; text-align: left; }
.aa-merge { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; }
.aa-merge label { flex: 1 1 180px; max-width: 280px; }

/* ---- motion off --------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .scope, .scope-sweep, .scope-blip.is-locked::after { animation: none !important; }
  .scope-sweep { opacity: .6; }
  .scope-blip, .scope-label, .preview-fill, .pp-track > span { transition: none; }
}

/* ---- print: the push result fits one letter page ------------------------------- */
@media print {
  /* @page (letter, .5in) lives in push_results.html so only that page changes paper settings */
  /* Paper is white even when the screen is in dark mode. */
  .is-printable {
    --bg: #fff; --surface: #fff; --surface-2: #e4eef4; --ink: #0a2640; --muted: #4a6075;
    --line: #d3e0ea; --accent-text: #006f99; --warn: #a15c07; color-scheme: light;
  }
  .is-printable :is(.sidebar, .mobilebar, .scrim, .toasts, #assistant, .report-dialog, .skip-link, .no-print, .icon-sprite) { display: none !important; }
  .is-printable .shell { display: block; }
  body.is-printable { background: #fff; color: #0a2640; }
  .is-printable .page { max-width: none; padding: 0; }
  .is-printable .page-head { margin-bottom: 14px; }
  .is-printable .page-head::after { animation: none; }
  .result { gap: 16px; max-width: none; }
  .result-num { font-size: 2.6rem; }
  .result-cols, .result-figures, .result-goal, .result-next { break-inside: avoid; }
  .result a { color: inherit; text-decoration: none; }
  .result-track, .rb-bar, .result-track > span { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}

/* ---- truck days, customers -------------------------------------------------- */
.truck-days { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; grid-column: 1 / -1; }
.truck-label { font-size: .85rem; font-weight: 700; color: var(--muted); }
.chip-truck {
  min-height: 44px; padding: 8px 14px; cursor: pointer; font: inherit; font-size: .88rem;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line);
}
.chip-truck:hover { border-color: var(--accent, currentColor); }
.chip-truck[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.chip-truck:focus-visible { outline: 3px solid var(--focus, currentColor); outline-offset: 2px; }
.customer-flag { margin: 6px 0 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.chip-customer { background: var(--ok-soft, rgb(157 225 21 / .18)); color: var(--ok, var(--ink)); font-weight: 700; border-color: transparent; }
.cust-tally { font-size: 1.05rem; }
.cust-list { margin: 8px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.cust-list li { overflow-wrap: anywhere; }
@media print { .truck-days, .customer-flag { display: none; } }
