/* ============================================================
   Cellvora — the visual system, as CSS custom properties.

   A precision instrument, not a dashboard. Dark first, because an
   agent works a phone bank in a dim room and looks at this for
   eight hours; light ("pearl") is a full second theme, not an
   inversion. Four hull tiers, one lit top edge, hairline rims in
   the signal colour, and copper only where a hand should go.

   The rules a reader should know before editing:
     - every animation must stop under prefers-reduced-motion
       (apps/web/test/motion.test.ts checks the blanket at the end)
     - the phone header may carry no backdrop-filter, transform,
       filter, perspective, will-change or contain (forms.test.ts)
     - every .topbar rule that sets a height includes the status-bar
       inset (forms.test.ts)
     - controls are 16px text and 44px tall on a touch screen
   ============================================================ */

:root {
  /* ---- pearl (light) ---------------------------------------------------- */
  --void: #eef1f6;
  --deep: #e6ebf2;
  --hull: #ffffff;
  --hull-2: #f6f8fb;
  --hull-3: #edf1f7;
  --well: #f3f6fa;
  --glass: rgba(255, 255, 255, 0.86);
  --rim: rgba(16, 60, 70, 0.14);
  --rim-hot: rgba(16, 60, 70, 0.28);
  --edge: rgba(255, 255, 255, 0.9);
  --ink: #0b1220;
  --ink-2: #334259;
  --ink-3: #4a5a70;
  --ink-4: #5e6c84;

  --copper: #a84f00;
  --copper-deep: #8f3505;
  /* Text on a saturated fill. The light palette's accents are dark, so white
     reads on them; the dark palette's are bright, so near-black does. */
  --on-fill: #ffffff;
  --aqua: #00776f;
  --aqua-dim: #3a9c94;
  --iris: #5b4bd6;
  /* Darker than the copper and crit accents on purpose: green is the lightest
     hue at a given luminance, and at #108252 it fell under 4.5:1 on a tinted box. */
  --good: #0d7048;
  --warn: #8a6100;
  --crit: #c42744;

  --glow-aqua: rgba(0, 119, 111, 0.06);
  --glow-copper: rgba(168, 79, 0, 0.05);
  --grid: transparent;
  --shadow: 0 1px 2px rgba(14, 30, 54, 0.06), 0 14px 36px -20px rgba(14, 30, 54, 0.3);
  --shadow-lift: 0 1px 2px rgba(14, 30, 54, 0.08), 0 10px 26px -12px rgba(14, 30, 54, 0.28);
  --well-shadow: inset 0 1px 2px rgba(14, 30, 54, 0.08);

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;

  --f-display: 'Chakra Petch', ui-sans-serif, system-ui, sans-serif;
  --f-ui: 'Sora', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --e-out: cubic-bezier(0.22, 1, 0.36, 1);
  --e-press: cubic-bezier(0.4, 0, 0.6, 1);
  --e-spring: cubic-bezier(0.5, 1.5, 0.42, 1);

  /* Older names still used by a few views; they mean these. */
  --ink-1: var(--ink);
  --line: var(--rim);
  --bg-2: var(--hull-2);
  --f-body: var(--f-ui);
  color-scheme: light;
}

/* ---- instrument black (dark) — the default when the device is dark ------ */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --void: #05070b;
    --deep: #080b11;
    --hull: #0d1219;
    --hull-2: #121926;
    --hull-3: #182130;
    --well: #090d14;
    --glass: rgba(13, 18, 25, 0.84);
    --rim: rgba(120, 220, 210, 0.12);
    --rim-hot: rgba(120, 220, 210, 0.28);
    --edge: rgba(255, 255, 255, 0.06);
    --ink: #e8eef8;
    --ink-2: #b8c5d9;
    --ink-3: #93a1b6;
    --ink-4: #7f8ca1;
    --copper: #ff8a3d;
    --copper-deep: #b23b00;
    --on-fill: #0a0f17;
    --aqua: #3fe0d0;
    --aqua-dim: #1f9c92;
    --iris: #8c7bff;
    --good: #39d98a;
    --warn: #ffc64d;
    --crit: #ff5e7a;
    --glow-aqua: rgba(63, 224, 208, 0.09);
    --glow-copper: rgba(255, 138, 61, 0.07);
    --grid: rgba(140, 200, 220, 0.028);
    --shadow: inset 0 1px 0 var(--edge), 0 1px 2px rgba(0, 0, 0, 0.5), 0 24px 56px -30px rgba(0, 0, 0, 0.95);
    --shadow-lift: inset 0 1px 0 var(--edge), 0 18px 40px -18px rgba(0, 0, 0, 0.85);
    --well-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4);
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --void: #05070b;
  --deep: #080b11;
  --hull: #0d1219;
  --hull-2: #121926;
  --hull-3: #182130;
  --well: #090d14;
  --glass: rgba(13, 18, 25, 0.84);
  --rim: rgba(120, 220, 210, 0.12);
  --rim-hot: rgba(120, 220, 210, 0.28);
  --edge: rgba(255, 255, 255, 0.06);
  --ink: #e8eef8;
  --ink-2: #b8c5d9;
  --ink-3: #93a1b6;
  --ink-4: #7f8ca1;
  --copper: #ff8a3d;
  --copper-deep: #b23b00;
  --on-fill: #0a0f17;
  --aqua: #3fe0d0;
  --aqua-dim: #1f9c92;
  --iris: #8c7bff;
  --good: #39d98a;
  --warn: #ffc64d;
  --crit: #ff5e7a;
  --glow-aqua: rgba(63, 224, 208, 0.09);
  --glow-copper: rgba(255, 138, 61, 0.07);
  --grid: rgba(140, 200, 220, 0.028);
  --shadow: inset 0 1px 0 var(--edge), 0 1px 2px rgba(0, 0, 0, 0.5), 0 24px 56px -30px rgba(0, 0, 0, 0.95);
  --shadow-lift: inset 0 1px 0 var(--edge), 0 18px 40px -18px rgba(0, 0, 0, 0.85);
  --well-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4);
  color-scheme: dark;
}

/* ================================================================ base -- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--void);
  color: var(--ink);
  font-family: var(--f-ui);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
/*
 * The ground. Two very faint washes — signal at the top, copper at the foot —
 * and, in the dark theme, a hairline grid that shows only in the gutters
 * because every surface above it is opaque. Fixed, behind everything, and
 * inert: it never intercepts a tap and never moves.
 */
body::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(900px 620px at 12% -8%, var(--glow-aqua), transparent 62%),
    radial-gradient(820px 700px at 102% 108%, var(--glow-copper), transparent 62%);
}
body::after {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / 96px 96px,
    linear-gradient(0deg, var(--grid) 1px, transparent 1px) 0 0 / 96px 96px;
  -webkit-mask-image: radial-gradient(120% 90% at 50% 40%, #000 30%, transparent 100%);
  mask-image: radial-gradient(120% 90% at 50% 40%, #000 30%, transparent 100%);
}
h1, h2, h3, h4, p, figure { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
a { color: var(--copper); }
table { border-collapse: collapse; width: 100%; }
:focus-visible { outline: 2px solid var(--aqua); outline-offset: 2px; border-radius: 3px; }
::selection { background: color-mix(in srgb, var(--aqua) 28%, transparent); }
.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* =============================================================== shell -- */
.shell { display: flex; flex-direction: column; min-height: 100vh; }
.topbar {
  /*
   * The status-bar inset is why this is a calc rather than a number. The app
   * declares `apple-mobile-web-app-status-bar-style: black-translucent`, so
   * on an installed iPhone the page is drawn UNDER the clock and battery.
   * Without the inset the brand sits behind the status bar — perfect in
   * Safari, broken the moment somebody installs it.
   */
  position: sticky; top: 0; z-index: 40;
  height: calc(54px + env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px);
  display: flex; align-items: center; gap: 12px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  background: color-mix(in srgb, var(--deep) 84%, transparent);
  backdrop-filter: blur(18px) saturate(1.2);
  border-bottom: 1px solid var(--rim);
}
/*
 * The meridian. A 24-tick ruler along the bottom edge of the bar, the hours
 * 8am to 9pm lit in the signal colour — the calling window, unrolled. It is
 * the Orbit ring's idea at a glance, and the place the ring's scrubber goes
 * when the ring ships. Two gradients: the lit span, then the tick marks
 * cut out of it, one every twenty-fourth of the width.
 */
.topbar::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  pointer-events: none;
  background:
    repeating-linear-gradient(90deg, transparent 0, transparent calc(100% / 24 - 1px), var(--deep) calc(100% / 24 - 1px), var(--deep) calc(100% / 24)),
    linear-gradient(90deg,
      var(--rim) 0, var(--rim) 33.3%,
      color-mix(in srgb, var(--aqua) 55%, transparent) 33.3%,
      color-mix(in srgb, var(--aqua) 55%, transparent) 87.5%,
      var(--rim) 87.5%);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; flex-shrink: 0; }
.brand svg { width: 26px; height: 26px; display: block; }
.brand b { font-family: var(--f-display); font-weight: 700; letter-spacing: 0.17em; font-size: 14px; }
.topbar .spacer { margin-left: auto; }
/*
 * The agency name: the one width in this bar a customer chooses, so it is
 * capped and truncated at every width. It reads as a readout, not a title.
 */
.tb-org {
  font-family: var(--f-mono); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-3); white-space: nowrap;
  max-width: 220px; overflow: hidden; text-overflow: ellipsis; flex-shrink: 0;
}
.tb-btn { gap: 6px; }
.tb-ico { display: none; }

/*
 * The sections. One list, rendered three ways: a rail down the left of a
 * desktop, an icon strip on a tablet, a tab bar along the bottom of a phone.
 * The label is always in the DOM; the icon never replaces it for a reader.
 */
.nav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 0 12px; height: 40px; border-radius: var(--r-sm);
  font-size: 13px; font-weight: 500; color: var(--ink-3);
  text-decoration: none; white-space: nowrap;
  transition: color 0.15s var(--e-out), background 0.15s var(--e-out), box-shadow 0.15s var(--e-out);
}
.nav-ico { display: inline-flex; width: 16px; height: 16px; flex-shrink: 0; color: var(--ink-4); transition: color 0.15s var(--e-out); }
.nav-ico svg { width: 16px; height: 16px; display: block; }
.nav a:hover { color: var(--ink); background: var(--hull-2); }
.nav a:hover .nav-ico { color: var(--ink-2); }
.nav a[aria-current='page'] {
  color: var(--ink);
  background: color-mix(in srgb, var(--copper) 8%, transparent);
  box-shadow: inset 2px 0 0 var(--copper);
}
.nav a[aria-current='page'] .nav-ico { color: var(--copper); }
/* A group heading is a rail-only word; the tablet strip draws a hairline
   instead and the phone bar shows nothing. */
.nav-group {
  display: none; font-family: var(--f-mono); font-size: 9.5px; letter-spacing: 0.26em;
  text-transform: uppercase; color: var(--ink-4); padding: 14px 12px 5px;
}
.nav-group:first-child { padding-top: 2px; }

/* Small things a few screens use. */
.rowcard { padding: 14px 16px; border: 1px solid var(--rim); border-radius: var(--r-md); background: var(--hull-2); margin-bottom: 10px; }
.fine { font-size: 11.5px; color: var(--ink-4); line-height: 1.5; }
.muted { color: var(--ink-4); }
.linkish { background: none; border: 0; padding: 0; cursor: pointer; color: var(--copper); font: inherit; text-decoration: underline; text-underline-offset: 2px; }
.chk { display: flex; align-items: center; gap: 9px; font-size: 13.5px; cursor: pointer; padding: 6px 0; }
.chk input { width: 16px; height: 16px; margin: 0; accent-color: var(--aqua); flex: none; }
.ta {
  width: 100%; padding: 10px 12px; border-radius: var(--r-sm); border: 1px solid var(--rim);
  background: var(--well); color: var(--ink); font: inherit; font-size: 13.5px; line-height: 1.5;
  box-shadow: var(--well-shadow); resize: vertical;
  transition: border-color 0.15s var(--e-out), box-shadow 0.15s var(--e-out);
}
.ta:focus { outline: none; border-color: var(--aqua); box-shadow: var(--well-shadow), 0 0 0 3px color-mix(in srgb, var(--aqua) 20%, transparent); }

main { flex: 1; width: 100%; max-width: 1360px; margin: 0 auto; padding: 22px 20px 64px; }
/* Anything mounted into main rises into place once. Nothing moves on scroll. */
main > * { animation: vin 0.32s var(--e-out) both; }
@keyframes vin { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
main > * > .panel:nth-child(2) { animation-delay: 40ms; }
main > * > .panel:nth-child(3) { animation-delay: 80ms; }
main > * > .panel:nth-child(4) { animation-delay: 120ms; }
main > * > .panel:nth-child(5) { animation-delay: 160ms; }
main > * > .panel:nth-child(6) { animation-delay: 200ms; }
main > * > .panel { animation: vin 0.36s var(--e-out) both; }

/* The rail: from a laptop up, the sections stand down the left and stay put. */
@media (min-width: 1200px) {
  .shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .topbar { grid-column: 1 / -1; }
  .nav {
    position: sticky; top: calc(54px + env(safe-area-inset-top, 0px));
    align-self: start; height: calc(100vh - 54px - env(safe-area-inset-top, 0px));
    flex-direction: column; gap: 3px; padding: 16px 12px;
    overflow-x: hidden; overflow-y: auto;
    border-right: 1px solid var(--rim);
    background: color-mix(in srgb, var(--deep) 70%, transparent);
  }
  .nav-group { display: block; }
  main { padding: 26px 30px 72px; }
}
/* Tablet and small laptop: the same rail, narrowed to its icons and a small label. */
@media (min-width: 768px) and (max-width: 1199px) {
  .shell { display: grid; grid-template-columns: 78px minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .topbar { grid-column: 1 / -1; }
  .nav {
    position: sticky; top: calc(54px + env(safe-area-inset-top, 0px));
    align-self: start; height: calc(100vh - 54px - env(safe-area-inset-top, 0px));
    flex-direction: column; gap: 4px; padding: 12px 8px;
    overflow-x: hidden; overflow-y: auto;
    border-right: 1px solid var(--rim);
    background: color-mix(in srgb, var(--deep) 70%, transparent);
  }
  .nav a {
    flex-direction: column; justify-content: center; gap: 4px;
    height: 56px; padding: 0 4px; font-size: 9.5px; letter-spacing: 0.02em; text-align: center;
  }
  .nav-ico, .nav-ico svg { width: 18px; height: 18px; }
  .nav a[aria-current='page'] { box-shadow: inset 2px 0 0 var(--copper); }
  .nav-group { display: block; font-size: 0; padding: 0; height: 1px; margin: 8px 8px; background: var(--rim); }
  .nav-group:first-child { display: none; }
  main { padding: 20px 22px 60px; }
}

.center { max-width: 460px; margin: 8vh auto; padding: 0 16px; position: relative; isolation: isolate; }
/*
 * Behind the sign-in card: the Orbit ring, drawn once in CSS. A hairline
 * circle with the 8am–9pm arc lit — the dial the product is built around,
 * on screen before anybody has typed a letter. Two radial masks cut the disc
 * to a ring; the conic gradient lights the window.
 */
.center::before {
  content: ''; position: absolute; z-index: -1; pointer-events: none;
  width: 620px; height: 620px; left: 50%; top: 50%; transform: translate(-50%, -54%);
  border-radius: 50%;
  background: conic-gradient(from 120deg,
    color-mix(in srgb, var(--aqua) 26%, transparent) 0 195deg,
    color-mix(in srgb, var(--rim-hot) 60%, transparent) 195deg 360deg);
  -webkit-mask: radial-gradient(circle, transparent 0 calc(50% - 1.5px), #000 calc(50% - 1.5px) 50%, transparent 50%);
  mask: radial-gradient(circle, transparent 0 calc(50% - 1.5px), #000 calc(50% - 1.5px) 50%, transparent 50%);
}
.center::after {
  content: ''; position: absolute; z-index: -1; pointer-events: none;
  width: 520px; height: 520px; left: 50%; top: 50%; transform: translate(-50%, -54%);
  border-radius: 50%;
  background: repeating-conic-gradient(var(--rim-hot) 0 0.6deg, transparent 0.6deg 15deg);
  -webkit-mask: radial-gradient(circle, transparent 0 calc(50% - 7px), #000 calc(50% - 7px) 50%, transparent 50%);
  mask: radial-gradient(circle, transparent 0 calc(50% - 7px), #000 calc(50% - 7px) 50%, transparent 50%);
  opacity: 0.7;
}
/* The mark draws itself on the way in, per the brand's boot sequence. */
.center svg path { stroke-dasharray: 120; animation: draw 1.1s var(--e-out) both; }
.center svg path + path { animation-delay: 0.12s; }
.center svg circle { animation: fin 0.5s var(--e-out) 0.7s both; }
@keyframes draw { from { stroke-dashoffset: 120; } to { stroke-dashoffset: 0; } }
@keyframes fin { from { opacity: 0; } to { opacity: 1; } }

/* =============================================================== parts -- */
.panel {
  position: relative;
  background:
    linear-gradient(180deg, var(--edge) 0, transparent 1px),
    var(--glass);
  border: 1px solid var(--rim);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 16px;
}
@media (min-width: 768px) { .panel { backdrop-filter: blur(14px); } }
/* A panel title is an instrument line: the label, then a hairline to the edge. */
.panel > h2 {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--ink-2); font-weight: 500; margin-bottom: 14px;
}
.panel > h2::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, var(--rim-hot), transparent); }
.phead { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.phead > h2 { margin: 0; }
.phead .spacer { margin-left: auto; }

.vhead { margin-bottom: 20px; }
.kicker {
  font-family: var(--f-mono); font-size: 9.5px; letter-spacing: 0.26em;
  text-transform: uppercase; color: var(--copper); display: block; margin-bottom: 8px;
}
.vhead h1 {
  font-family: var(--f-display); font-weight: 700;
  font-size: clamp(24px, 3.4vw, 34px); line-height: 1.08; letter-spacing: 0.005em; text-wrap: balance;
}
.vhead p { color: var(--ink-3); font-size: 13.5px; margin-top: 8px; max-width: 68ch; text-wrap: pretty; }

.grid { display: grid; gap: 16px; }
/*
 * A grid item defaults to `min-width: auto` and refuses to shrink below the
 * widest thing inside it. A panel holding a 620px-minimum table therefore
 * forced the whole page wider than the phone, and the table's own scroller
 * never engaged. The body scrolled sideways instead of the table.
 */
.grid > * { min-width: 0; }
@media (min-width: 720px) { .g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* A tile is a readout: the number is the hero, lit from its left edge. */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.tile {
  position: relative; border-radius: var(--r-md); padding: 14px 14px 13px 16px;
  background: var(--hull-2); border: 1px solid var(--rim); overflow: hidden;
  transition: border-color 0.18s var(--e-out);
}
.tile::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 90% at 0% 0%, color-mix(in srgb, var(--accent, var(--aqua)) 8%, transparent), transparent 60%);
}
.tile::after {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 2px;
  background: var(--accent, var(--aqua));
  box-shadow: 0 0 12px -1px var(--accent, var(--aqua));
}
.tile > * { position: relative; }
.tile .k { font-family: var(--f-mono); font-size: 9.5px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-3); }
.tile .v {
  font-family: var(--f-mono); font-weight: 500; font-size: 27px; line-height: 1.15;
  font-variant-numeric: tabular-nums; letter-spacing: -0.01em; margin-top: 4px;
}
.tile .d { font-size: 11px; color: var(--ink-3); margin-top: 2px; }

/* Buttons are machined keys: a lit top edge, a hairline rim. Copper is the one filled key. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 16px; border-radius: var(--r-sm); border: 1px solid var(--rim);
  background: linear-gradient(180deg, var(--edge), transparent 46%), var(--hull-2);
  font-size: 13px; font-weight: 500; white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
  transition: border-color 0.16s var(--e-out), background 0.16s var(--e-out), box-shadow 0.16s var(--e-out), transform 0.16s var(--e-out), filter 0.16s var(--e-out);
}
.btn:hover:not(:disabled) { border-color: var(--rim-hot); background: linear-gradient(180deg, var(--edge), transparent 46%), var(--hull-3); }
.btn:active:not(:disabled) { transform: translateY(1px); filter: brightness(0.95); transition-duration: 80ms; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
/*
 * The one filled key. The gradient ends at a 60/40 mix rather than at
 * copper-deep itself: a gradient cannot be measured for contrast at one point,
 * so both ends were, and the dark theme's label on pure copper-deep came out
 * at 3.2:1. On the mix it is 5.7:1, and the key still darkens towards its foot.
 */
.btn.pri {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.2), transparent 50%), linear-gradient(180deg, var(--copper), color-mix(in srgb, var(--copper) 60%, var(--copper-deep)));
  color: var(--on-fill); border-color: transparent; font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 8px 22px -10px color-mix(in srgb, var(--copper) 85%, transparent);
}
.btn.pri:hover:not(:disabled) {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.28), transparent 50%), linear-gradient(180deg, var(--copper), color-mix(in srgb, var(--copper) 60%, var(--copper-deep)));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 10px 26px -10px color-mix(in srgb, var(--copper) 95%, transparent);
}
.btn.danger { color: var(--crit); border-color: color-mix(in srgb, var(--crit) 45%, transparent); }
.btn.danger:hover:not(:disabled) { background: color-mix(in srgb, var(--crit) 9%, var(--hull-2)); }
.btn.ghost { background: transparent; box-shadow: none; }
.btn.ghost:hover:not(:disabled) { background: var(--hull-2); }
.btn.sm { height: 30px; padding: 0 11px; font-size: 12px; }
.btn.block { width: 100%; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 13px; }
.field > span { font-family: var(--f-mono); font-size: 9.5px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-4); }
.field small { color: var(--ink-4); font-size: 11.5px; line-height: 1.5; }
/* An input is a recessed well, not a raised card. */
.inp {
  width: 100%; height: 40px; padding: 0 12px; border-radius: var(--r-sm);
  border: 1px solid var(--rim); background: var(--well); color: var(--ink);
  font: inherit; font-size: 13.5px; box-shadow: var(--well-shadow);
  transition: border-color 0.15s var(--e-out), box-shadow 0.15s var(--e-out);
}
/* Full strength: at 80% the faintest tier fell under 4.5:1 in both themes. */
.inp::placeholder { color: var(--ink-4); opacity: 1; }
.inp:focus { outline: none; border-color: var(--aqua); box-shadow: var(--well-shadow), 0 0 0 3px color-mix(in srgb, var(--aqua) 20%, transparent); }
textarea.inp { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.5; }
select.inp {
  appearance: none; padding-right: 30px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-4) 50%), linear-gradient(135deg, var(--ink-4) 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}
.inp[aria-invalid='true'] { border-color: var(--crit); }

/* A chip is an engraved ring on the surface with a small lamp in it. */
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px 0 8px;
  border-radius: 20px; font-family: var(--f-mono); font-size: 9.5px; letter-spacing: 0.08em;
  text-transform: uppercase; border: 1px solid var(--rim-hot); background: transparent;
  color: var(--ink-3); white-space: nowrap;
}
.chip::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex: none; box-shadow: 0 0 6px -1px currentColor; }
.chip.good, .chip.ok { color: var(--good); border-color: color-mix(in srgb, var(--good) 50%, transparent); background: color-mix(in srgb, var(--good) 6%, transparent); }
.chip.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 50%, transparent); background: color-mix(in srgb, var(--warn) 6%, transparent); }
.chip.crit { color: var(--crit); border-color: color-mix(in srgb, var(--crit) 50%, transparent); background: color-mix(in srgb, var(--crit) 6%, transparent); }
.chip.cop { color: var(--copper); border-color: color-mix(in srgb, var(--copper) 50%, transparent); background: color-mix(in srgb, var(--copper) 6%, transparent); }
.chip.ir { color: var(--iris); border-color: color-mix(in srgb, var(--iris) 50%, transparent); background: color-mix(in srgb, var(--iris) 6%, transparent); }

.rows { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 8px; border-bottom: 1px solid var(--rim); }
.row:last-child { border-bottom: 0; }
.row.tap { cursor: pointer; border-radius: var(--r-sm); transition: background 0.14s var(--e-out), box-shadow 0.14s var(--e-out); }
/* Hover and keyboard focus are the same state; the list is worked with both. */
.row.tap:hover, .row.tap:focus-visible { background: var(--hull-2); box-shadow: inset 2px 0 0 var(--aqua); outline: none; }
.row .main { flex: 1; min-width: 0; }
.row .t { font-size: 13.5px; font-weight: 500; }
.row .s { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.row .r { flex-shrink: 0; text-align: right; }

.note, .warnbox, .okbox {
  padding: 12px 14px 12px 16px; border-radius: var(--r-md); font-size: 12.5px; line-height: 1.55;
  border: 1px solid var(--rim); background: var(--hull-2); color: var(--ink-2);
  box-shadow: inset 2px 0 0 var(--aqua);
}
.note b { color: var(--ink); }
.warnbox { background: color-mix(in srgb, var(--crit) 8%, transparent); border-color: color-mix(in srgb, var(--crit) 32%, transparent); box-shadow: inset 2px 0 0 var(--crit); }
.warnbox b { color: var(--crit); }
.okbox { background: color-mix(in srgb, var(--good) 8%, transparent); border-color: color-mix(in srgb, var(--good) 30%, transparent); box-shadow: inset 2px 0 0 var(--good); }
.okbox b { color: var(--good); }

.xscroll { overflow-x: auto; }
table.data { font-size: 12.5px; min-width: 620px; }
table.data th {
  font-family: var(--f-mono); font-size: 9.5px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink-3); text-align: left; padding: 10px 10px; border-bottom: 1px solid var(--rim-hot);
  font-weight: 500; white-space: nowrap;
}
table.data td { padding: 10px 10px; border-bottom: 1px solid var(--rim); vertical-align: middle; }
table.data td.num { font-family: var(--f-mono); font-variant-numeric: tabular-nums; text-align: right; }
table.data tbody tr { transition: background 0.14s var(--e-out); }
table.data tbody tr.tap { cursor: pointer; }
table.data tbody tr.tap:hover { background: var(--hull-2); box-shadow: inset 2px 0 0 var(--aqua); }

.ring { position: relative; width: 38px; height: 38px; flex-shrink: 0; }
.ring svg { transform: rotate(-90deg); width: 100%; height: 100%; overflow: visible; }
.ring circle { fill: none; stroke-linecap: round; }
.ring .bg { stroke: var(--rim-hot); stroke-width: 3; }
.ring .fg { stroke: var(--aqua); stroke-width: 3; transition: stroke-dashoffset 0.6s var(--e-out); filter: drop-shadow(0 0 3px color-mix(in srgb, currentColor 0%, var(--aqua))); }
.ring.hi .fg { stroke: var(--good); filter: drop-shadow(0 0 3px var(--good)); }
.ring.mid .fg { stroke: var(--warn); filter: drop-shadow(0 0 3px var(--warn)); }
.ring.lo .fg { stroke: var(--ink-4); filter: none; }
.ring b { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--f-mono); font-size: 11px; font-weight: 700; }

.empty { padding: 38px 16px; text-align: center; color: var(--ink-3); }
.empty h3 { font-family: var(--f-display); font-size: 17px; margin-bottom: 6px; color: var(--ink-2); }
.empty p { font-size: 12.5px; max-width: 46ch; margin: 0 auto 14px; text-wrap: pretty; }

/* Loading reads as light passing through the surface. */
.skeleton {
  background: linear-gradient(90deg, var(--hull-2), color-mix(in srgb, var(--aqua) 6%, var(--hull-3)), var(--hull-2));
  background-size: 200% 100%; animation: sk 1.6s linear infinite; border-radius: var(--r-sm); height: 14px;
}
@keyframes sk { to { background-position: -200% 0; } }

#toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: 20px; z-index: 90; display: flex; flex-direction: column; gap: 8px; width: min(440px, 92vw); }
.toast {
  display: flex; gap: 9px; align-items: flex-start; padding: 12px 14px 12px 16px; border-radius: var(--r-md);
  background: var(--glass); backdrop-filter: blur(16px); border: 1px solid var(--rim-hot);
  box-shadow: var(--shadow-lift), inset 2px 0 0 var(--aqua); font-size: 12.5px;
  animation: tin 0.3s var(--e-spring) both; transition: opacity 0.22s var(--e-out);
}
.toast.crit { border-color: color-mix(in srgb, var(--crit) 50%, transparent); box-shadow: var(--shadow-lift), inset 2px 0 0 var(--crit); }
.toast.ok { border-color: color-mix(in srgb, var(--good) 50%, transparent); box-shadow: var(--shadow-lift), inset 2px 0 0 var(--good); }
@keyframes tin { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }

.scrim { position: fixed; inset: 0; background: color-mix(in srgb, var(--void) 70%, transparent); backdrop-filter: blur(8px); z-index: 60; animation: fin 0.24s var(--e-out) both; }
.drawer {
  position: fixed; right: 0; top: 0; bottom: 0; width: min(640px, 100vw); z-index: 70;
  background: var(--glass); backdrop-filter: blur(20px); border-left: 1px solid var(--rim-hot);
  box-shadow: -30px 0 80px -30px rgba(0, 0, 0, 0.6);
  display: flex; flex-direction: column;
  animation: din 0.34s var(--e-out) both;
}
@keyframes din { from { transform: translateX(28px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer header {
  display: flex; align-items: center; gap: 10px;
  padding: calc(16px + env(safe-area-inset-top, 0px)) 18px 16px;
  border-bottom: 1px solid var(--rim);
}
.drawer header h2 { font-family: var(--f-display); font-size: 18px; flex: 1; min-width: 0; }
.drawer .body { padding: 18px; overflow-y: auto; flex: 1; }

.steps { display: flex; flex-direction: column; gap: 8px; }
.step { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: var(--r-md); border: 1px solid var(--rim); background: var(--hull-2); }
.step.current { border-color: color-mix(in srgb, var(--copper) 60%, transparent); box-shadow: inset 2px 0 0 var(--copper), 0 0 0 1px color-mix(in srgb, var(--copper) 25%, transparent); }
/* A finished step recedes by colour, not by opacity: a whole step at 72% put
   its text under 4.5:1, and a finished step is still something to read. */
.step.done { border-color: var(--rim); background: color-mix(in srgb, var(--hull-2) 60%, transparent); }
.step.done h3 { color: var(--ink-2); font-weight: 500; }
.step.done p { color: var(--ink-4); }
.step .mark { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--rim-hot); flex-shrink: 0; display: grid; place-items: center; font-size: 11px; margin-top: 1px; }
.step.done .mark { background: var(--good); border-color: var(--good); color: #04120f; }
.step h3 { font-size: 14px; font-weight: 600; }
.step p { font-size: 12px; color: var(--ink-3); margin-top: 3px; }

.bar { height: 6px; border-radius: 6px; background: var(--well); overflow: hidden; border: 1px solid var(--rim); box-shadow: var(--well-shadow); }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--aqua-dim), var(--aqua)); box-shadow: 0 0 10px -2px var(--aqua); transition: width 0.5s var(--e-out); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--rim); margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { padding: 10px 13px; font-size: 13px; color: var(--ink-3); border-bottom: 2px solid transparent; white-space: nowrap; margin-bottom: -1px; transition: color 0.15s var(--e-out); }
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected='true'] { color: var(--copper); border-bottom-color: var(--copper); box-shadow: 0 6px 12px -8px var(--copper); }

.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-bottom: 16px; }
/* A field carries an intrinsic width of about twenty characters, and a grid
   item will not shrink below it. Same fix `.grid > *` carries. */
.filters > * { min-width: 0; }

/* ------------------------------------------------ the import drop area -- */

/* The whole view is the target, not just the box, so a file dropped anywhere
   on the screen lands. */
.importer { position: relative; min-height: 62vh; }
.importer.dragging::after {
  content: ''; position: absolute; inset: -10px; z-index: 5; pointer-events: none;
  border-radius: var(--r-lg); border: 2px dashed var(--aqua);
  background: color-mix(in srgb, var(--aqua) 9%, transparent);
}
.dropzone {
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
  padding: 30px 16px; cursor: pointer; border-radius: var(--r-md);
  border: 1px dashed var(--rim-hot); background: var(--hull-2);
  transition: border-color 0.18s var(--e-out), background 0.18s var(--e-out), box-shadow 0.18s var(--e-out);
}
.dropzone:hover { border-color: var(--aqua); background: var(--hull-3); box-shadow: 0 0 0 4px color-mix(in srgb, var(--aqua) 8%, transparent); }
.dropzone:focus-visible { outline: none; border-color: var(--aqua); box-shadow: 0 0 0 3px color-mix(in srgb, var(--aqua) 22%, transparent); }
.importer.dragging .dropzone { border-color: var(--aqua); background: color-mix(in srgb, var(--aqua) 5%, transparent); }
.dropzone b { font-family: var(--f-display); font-size: 15.5px; }
.dropzone span { font-size: 12px; color: var(--ink-3); max-width: 46ch; }
.dropzone .dz-mark { width: 32px; height: 32px; color: var(--aqua); filter: drop-shadow(0 0 8px color-mix(in srgb, var(--aqua) 40%, transparent)); }
.dropzone .dz-mark svg { width: 100%; height: 100%; display: block; }
.dz-fine { font-size: 11px; color: var(--ink-4); }
.dz-or { text-align: center; color: var(--ink-4); font-size: 11.5px; margin: 12px 0 6px; }
.prog-head { display: flex; align-items: baseline; gap: 9px; margin-top: 7px; flex-wrap: wrap; }
.prog-head b { font-family: var(--f-mono); font-size: 17px; font-variant-numeric: tabular-nums; }

/*
 * The blanket: everything that moves, stopped, for anyone whose system asks
 * for less motion. The iteration count is the part people leave out —
 * duration alone leaves an `infinite` animation running thousands of times a
 * second, invisibly, on a phone bank's handsets. apps/web/test/motion.test.ts
 * checks that nothing escapes this.
 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    /* The stagger delays too, or a panel sits invisible for 200ms and then pops. */
    animation-delay: 0s !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================================
   ENTRY PAGE — the public front door.
   ============================================================ */
.lp { --lp-max: 980px; }
.lp-top {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 12px;
  padding: calc(12px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px))
           12px max(16px, env(safe-area-inset-left, 0px));
  background: color-mix(in srgb, var(--deep) 82%, transparent);
  backdrop-filter: blur(16px) saturate(1.2);
  border-bottom: 1px solid var(--rim);
}
.lp-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; margin-right: auto; }
.lp-mark { display: block; width: 26px; height: 26px; flex-shrink: 0; }
.lp-mark svg { width: 26px; height: 26px; display: block; }
.lp-word { font-family: var(--f-display); font-weight: 700; font-size: 14px; letter-spacing: 0.17em; }

/* ------------------------------------------------------------ install -- */
.lp-enter {
  max-width: 680px; margin: 0 auto;
  padding: clamp(44px, 9vw, 96px) 18px clamp(28px, 5vw, 48px);
  text-align: center; position: relative;
}
.lp-h1 {
  font-family: var(--f-display); font-weight: 700;
  font-size: clamp(34px, 8vw, 60px); line-height: 1.02;
  letter-spacing: 0.01em; margin-bottom: 16px; text-wrap: balance;
}
.lp-line {
  font-size: clamp(15px, 2.4vw, 18px); line-height: 1.6;
  color: var(--ink-2); max-width: 44ch; margin: 0 auto 28px; text-wrap: pretty;
}
.lp-actions { display: flex; justify-content: center; }
/*
 * The single most important control on the site, sized like it. The label
 * colour is `--on-fill`, which flips with the theme: white on the light
 * theme's dark copper, near-black on the dark theme's bright one. A gradient
 * cannot be measured for contrast at one point, so both endpoints were.
 */
.lp-install {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 54px; padding: 0 28px; width: 100%; max-width: 340px;
  font: 600 15.5px/1 var(--f-ui); color: var(--on-fill); cursor: pointer;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.22), transparent 50%), linear-gradient(135deg, var(--copper), color-mix(in srgb, var(--copper) 60%, var(--copper-deep)));
  border: 0; border-radius: var(--r-md);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 10px 30px -10px color-mix(in srgb, var(--copper) 80%, transparent);
  transition: transform 0.12s var(--e-out), box-shadow 0.12s var(--e-out), filter 0.12s var(--e-out);
}
.lp-install:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.06); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 14px 34px -10px color-mix(in srgb, var(--copper) 95%, transparent); }
.lp-install:active:not(:disabled) { transform: translateY(0); }
.lp-install:disabled { cursor: default; box-shadow: none; }
/* Disabled because it is already installed reads as success, not failure. */
.lp-install.is-done { background: none; color: var(--aqua); border: 1px solid color-mix(in srgb, var(--aqua) 45%, transparent); opacity: 1; }
.lp-install:disabled:not(.is-done) { opacity: 0.55; }
.lp-ico { display: inline-flex; width: 18px; height: 18px; flex-shrink: 0; }
.lp-ico svg { width: 18px; height: 18px; display: block; }
.lp-hint { font-size: 12.5px; color: var(--ink-3); margin-top: 14px; min-height: 1.3em; }
.lp-alt { font-size: 13px; color: var(--ink-3); margin-top: 22px; }
.lp-alt2 { display: block; font-size: 12.5px; color: var(--ink-4); margin-top: 8px; }
.lnk { background: none; border: 0; padding: 0; cursor: pointer; color: var(--copper); font: inherit; text-decoration: underline; text-underline-offset: 2px; }

/* ---------------------------------------------------------------- how -- */
.lp-how { max-width: var(--lp-max); margin: 0 auto; padding: clamp(30px, 6vw, 64px) 18px clamp(40px, 7vw, 72px); border-top: 1px solid var(--rim); }
.lp-h2 { font-family: var(--f-display); font-weight: 700; font-size: clamp(21px, 3.4vw, 30px); line-height: 1.16; text-wrap: balance; margin-bottom: 12px; }
.lp-sub { color: var(--ink-3); font-size: 14px; line-height: 1.6; max-width: 62ch; margin-bottom: 26px; text-wrap: pretty; }

.lp-plats { display: grid; gap: 14px; }
@media (min-width: 760px) { .lp-plats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1080px) { .lp-plats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.lp-plat { background: linear-gradient(180deg, var(--edge) 0, transparent 1px), var(--hull); border: 1px solid var(--rim); border-radius: var(--r-lg); padding: 20px; box-shadow: var(--shadow); }
/* The card for the device you are actually holding comes first and says so. */
.lp-plat.is-you { border-color: color-mix(in srgb, var(--copper) 45%, var(--rim)); background: color-mix(in srgb, var(--copper) 5%, var(--hull)); box-shadow: var(--shadow), inset 2px 0 0 var(--copper); }
.lp-plathead { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; flex-wrap: wrap; }
.lp-plathead .lp-ico { color: var(--copper); }
.lp-plathead h3 { font-family: var(--f-display); font-weight: 600; font-size: 15.5px; }
.lp-tag { font-family: var(--f-mono); font-size: 9.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--copper); padding: 3px 8px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--copper) 40%, transparent); }
.lp-steps { display: flex; flex-direction: column; gap: 9px; counter-reset: step; }
.lp-steps li { position: relative; padding-left: 28px; font-size: 13px; line-height: 1.55; color: var(--ink-2); }
.lp-steps li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 0; width: 19px; height: 19px; border-radius: 50%;
  display: grid; place-items: center; font-family: var(--f-mono); font-size: 10px; font-weight: 700;
  color: var(--aqua); background: var(--hull-3); border: 1px solid color-mix(in srgb, var(--aqua) 35%, transparent);
}

/* ------------------------------------------------- explanatory sections -- */
.lp-eyebrow { font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.28em; text-transform: uppercase; color: var(--copper); margin-bottom: 16px; }
.lp-band { background: color-mix(in srgb, var(--hull) 70%, transparent); border-block: 1px solid var(--rim); }
.lp-inner { max-width: var(--lp-max); margin: 0 auto; padding: clamp(38px, 6vw, 72px) 18px; }
.lp-section { max-width: var(--lp-max); margin: 0 auto; padding: clamp(40px, 7vw, 80px) 18px; }

.lp-problem { display: grid; gap: 14px; margin-bottom: 24px; }
@media (min-width: 720px) { .lp-problem { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 28px; } }
.lp-prob { font-size: 14px; line-height: 1.6; color: var(--ink-2); padding-left: 14px; border-left: 2px solid var(--rim-hot); }
.lp-prob b { color: var(--ink); }
.lp-punch { font-size: clamp(15px, 2vw, 17px); line-height: 1.65; color: var(--ink); max-width: 64ch; padding-top: 18px; border-top: 1px solid var(--rim); }

.lp-grid { display: grid; gap: 14px; }
@media (min-width: 700px) { .lp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1060px) { .lp-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
/* Four items in a three-column grid strand one alone; a four-item section stays two-up. */
@media (min-width: 1060px) { .lp-grid.lp-grid-2up { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.lp-card {
  position: relative; background: linear-gradient(180deg, var(--edge) 0, transparent 1px), var(--hull);
  border: 1px solid var(--rim); border-radius: var(--r-lg); padding: 22px 22px 22px 25px; overflow: hidden;
  box-shadow: var(--shadow); transition: border-color 0.2s var(--e-out), transform 0.2s var(--e-out);
}
.lp-card::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 2px; background: var(--accent); box-shadow: 0 0 12px -1px var(--accent); }
.lp-card:hover { border-color: var(--rim-hot); }
.lp-card h3 { font-family: var(--f-display); font-weight: 600; font-size: 16.5px; line-height: 1.25; margin-bottom: 10px; }
.lp-card p { font-size: 13.5px; line-height: 1.65; color: var(--ink-2); }

.lp-ai { display: grid; gap: 14px; margin-bottom: 22px; }
@media (min-width: 820px) { .lp-ai { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.lp-aicard { padding: 20px; border-radius: var(--r-md); background: var(--hull-2); border: 1px solid var(--rim); }
.lp-aicard h3 { font-family: var(--f-display); font-weight: 600; font-size: 15px; line-height: 1.3; margin-bottom: 9px; color: var(--aqua); }
.lp-aicard p { font-size: 13px; line-height: 1.6; color: var(--ink-2); }

.lp-roles { display: grid; gap: 14px; }
@media (min-width: 660px) { .lp-roles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1060px) { .lp-roles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.lp-role { padding: 18px; border-radius: var(--r-md); background: var(--hull-2); border: 1px solid var(--rim); }
.lp-role h4 { font-size: 14px; font-weight: 600; margin-bottom: 7px; color: var(--copper); }
.lp-role p { font-size: 13px; line-height: 1.6; color: var(--ink-2); }

.lp-fit { display: grid; gap: 14px; margin-bottom: 22px; }
@media (min-width: 880px) { .lp-fit { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.lp-fitcard { padding: 22px; border-radius: var(--r-lg); background: var(--hull-2); border: 1px solid var(--rim); }
.lp-fitcard h3 { font-family: var(--f-display); font-weight: 600; font-size: 16px; margin-bottom: 9px; color: var(--aqua); }
.lp-fitcard p { font-size: 13.5px; line-height: 1.6; color: var(--ink-2); }

/* The two honest limits — what leaves for the model, and what the software
   will not do — given weight rather than buried in small print. */
.lp-note {
  font-size: 13px; line-height: 1.7; color: var(--ink-2);
  padding: 16px 18px; border-radius: var(--r-md);
  background: var(--hull-3); border: 1px solid var(--rim);
  box-shadow: inset 3px 0 0 var(--copper); max-width: 78ch;
}
.lp-note b { color: var(--ink); }

.lp-shift { max-width: 68ch; display: flex; flex-direction: column; gap: 16px; }
.lp-shift p { font-size: 14.5px; line-height: 1.7; color: var(--ink-2); }
.lp-shift .lp-punch { margin-top: 6px; }
.lp-close { max-width: 720px; margin: 0 auto; padding: clamp(46px, 8vw, 92px) 18px; text-align: center; }
.lp-close p { font-size: 15px; line-height: 1.65; color: var(--ink-2); max-width: 54ch; margin: 0 auto 26px; }
.lp-close .lp-actions { justify-content: center; }

/* ---------------------------------------------------- pitch components -- */
/* The hero, sized so the carrier band clears the fold on a 900px laptop. */
.lp-hero { max-width: 800px; padding-top: clamp(28px, 4vw, 40px); padding-bottom: clamp(16px, 2vw, 20px); }
.lp-hero .lp-line { margin-top: 12px; }
.lp-hero .lp-actions { margin-top: 20px; }
.lp-hero .lp-alt { margin-top: 10px; }
.lp-em {
  display: block;
  background: linear-gradient(100deg, var(--copper), var(--copper-deep));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
/* A section header that says, before anything else, whether what follows exists today. */
.lp-sechead { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.lp-badge { font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; padding: 5px 11px; border-radius: 999px; }
.lp-badge-live { color: var(--aqua); background: color-mix(in srgb, var(--aqua) 6%, transparent); border: 1px solid color-mix(in srgb, var(--aqua) 40%, transparent); }
.lp-badge-soon { color: var(--copper); background: color-mix(in srgb, var(--copper) 6%, transparent); border: 1px solid color-mix(in srgb, var(--copper) 40%, transparent); }
.lp-sechead .lp-h2 { margin: 0; }

.lp-vs { display: flex; flex-direction: column; gap: 12px; margin-bottom: 26px; }
.lp-vsrow { display: grid; gap: 10px; align-items: center; grid-template-columns: 1fr; padding: 16px 18px; border-radius: var(--r-md); background: var(--hull-2); border: 1px solid var(--rim); }
@media (min-width: 780px) { .lp-vsrow { grid-template-columns: 1fr 28px 1fr; gap: 18px; } }
.lp-vslabel { display: block; font-family: var(--f-mono); font-size: 9.5px; letter-spacing: 0.18em; text-transform: uppercase; margin-bottom: 6px; }
.lp-was .lp-vslabel { color: var(--ink-4); }
.lp-now .lp-vslabel { color: var(--copper); }
.lp-was p { font-size: 14px; line-height: 1.55; color: var(--ink-3); }
.lp-now p { font-size: 14px; line-height: 1.55; color: var(--ink); font-weight: 500; }
.lp-arrow { display: none; color: var(--rim-hot); }
.lp-arrow svg { width: 24px; height: 24px; display: block; }
@media (min-width: 780px) { .lp-arrow { display: block; } }

.lp-dialerband { background: color-mix(in srgb, var(--hull-2) 70%, transparent); }
.lp-flow { display: grid; gap: 14px; margin-bottom: 24px; }
@media (min-width: 760px) { .lp-flow { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.lp-flowstep { position: relative; padding: 22px 22px 22px 24px; background: var(--hull); border: 1px solid var(--rim); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.lp-flowstep::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 2px; background: linear-gradient(var(--copper), var(--copper-deep)); box-shadow: 0 0 12px -1px var(--copper); border-radius: var(--r-lg) 0 0 var(--r-lg); }
.lp-stepnum { font-family: var(--f-mono); font-size: 11px; font-weight: 700; color: var(--copper); letter-spacing: 0.08em; }
.lp-steplabel { font-family: var(--f-mono); font-size: 9.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-4); margin-left: 10px; }
.lp-flowstep h3 { font-family: var(--f-display); font-weight: 600; font-size: 16.5px; line-height: 1.25; margin: 10px 0 9px; }
.lp-flowstep p { font-size: 13.5px; line-height: 1.65; color: var(--ink-2); }

/* --------------------------------------------- one system, not two -- */
.lp-onesys .lp-h2 { max-width: 20ch; }
.lp-halves { display: grid; gap: 16px; margin: 26px 0 22px; align-items: stretch; }
@media (min-width: 860px) { .lp-halves { grid-template-columns: 1fr 44px 1fr; align-items: center; } }
/* Three pillars. Its own class because `.lp-halves` hard-codes three columns. */
.lp-pillars { display: grid; gap: 16px; margin: 26px 0 22px; align-items: stretch; }
@media (min-width: 1000px) { .lp-pillars { grid-template-columns: 1fr 34px 1fr 34px 1fr; align-items: center; } }
.lp-half { padding: 24px; border-radius: var(--r-lg); background: linear-gradient(180deg, var(--edge) 0, transparent 1px), var(--hull); border: 1px solid var(--rim); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.lp-half h3 { font-family: var(--f-display); font-weight: 700; font-size: 20px; }
.lp-half p { font-size: 13.5px; line-height: 1.65; color: var(--ink-2); }
.lp-joint { display: none; color: var(--copper); justify-self: center; }
.lp-joint svg { width: 30px; height: 30px; display: block; }
@media (min-width: 860px) { .lp-joint { display: block; } }
.lp-pillars .lp-joint { display: none; }
@media (min-width: 1000px) { .lp-pillars .lp-joint { display: block; } }

/* --------------------------------------------------------------- foot -- */
.lp-foot { border-top: 1px solid var(--rim); padding: 32px 18px calc(32px + env(safe-area-inset-bottom)); text-align: center; color: var(--ink-3); font-size: 12.5px; }
.lp-footmark { display: inline-block; width: 26px; height: 26px; margin-bottom: 10px; }
.lp-footmark svg { width: 26px; height: 26px; }
.lp-legal { font-size: 11.5px; color: var(--ink-4); max-width: 66ch; margin: 0 auto; line-height: 1.55; }
.lp-copy { font-size: 11.5px; color: var(--ink-4); margin-top: 12px; }
.lp-footnav { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 0; margin: 0 0 16px; }
.lp-footlink { background: none; border: 0; cursor: pointer; font: inherit; font-size: 12.5px; color: var(--ink-3); padding: 6px 14px; border-radius: 6px; position: relative; }
.lp-footlink + .lp-footlink::before { content: ''; position: absolute; left: 0; top: 50%; width: 1px; height: 12px; margin-top: -6px; background: var(--rim); }
.lp-footlink:hover { color: var(--ink); }
.lp-footlink:focus-visible { outline: 2px solid var(--copper); outline-offset: 2px; }
@media (pointer: coarse) { .lp-footlink { min-height: 44px; } }

/* ------------------------------------------------------- legal page -- */
.lp-doc .lp-docHead { padding-bottom: 8px; }
.lp-docSection { padding: 22px 0; border-bottom: 1px solid var(--rim); }
.lp-docSection:last-child { border-bottom: 0; }
.lp-docScope { color: var(--ink-3); max-width: 70ch; line-height: 1.6; }
.lp-clause { margin-top: 20px; }
.lp-clause p { max-width: 74ch; line-height: 1.62; }
.lp-doc .lp-h3 { margin-bottom: 6px; }

/* ============================================================
   RESPONSIVE — the app itself, from a 320px phone up.
   ============================================================ */

/* Touch targets never drop below 44px on a touch device. */
@media (pointer: coarse) {
  .btn { min-height: 44px; }
  .btn.sm { min-height: 38px; }
  .row.tap { min-height: 52px; }
  .tabs button { min-height: 44px; }
  .nav a { min-height: 40px; display: flex; align-items: center; }
}

/* Phones: the sections become a bottom bar, thumb-reachable; the top bar
   keeps identity and account controls. */
@media (max-width: 767px) {
  /*
   * The phone header carries no backdrop-filter. The tab bar below is
   * `position: fixed`, and although it no longer lives inside the header, a
   * blur here is still real GPU work on a handset that has none to spare —
   * and forms.test.ts keeps this rule honest, because a filter, transform,
   * perspective, will-change or contain on this element would make it the
   * containing block for anything fixed that ever moves back inside it.
   */
  .topbar {
    height: calc(52px + env(safe-area-inset-top, 0px));
    padding-top: env(safe-area-inset-top, 0px);
    padding-left: max(12px, env(safe-area-inset-left, 0px));
    padding-right: max(12px, env(safe-area-inset-right, 0px));
    gap: 8px;
    backdrop-filter: none;
    background: var(--deep);
  }
  .topbar .brand b { font-size: 13px; }
  .tb-org { display: none; }
  .shell > main { padding: 16px 12px calc(var(--tabbar, 62px) + 22px); }

  .nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
    height: 62px; padding-bottom: env(safe-area-inset-bottom);
    display: flex; gap: 0; justify-content: space-around; align-items: stretch;
    background: color-mix(in srgb, var(--deep) 94%, transparent);
    backdrop-filter: blur(18px);
    border-top: 1px solid var(--rim);
    /*
     * The bar scrolls, rather than the page. An owner sees up to twelve
     * sections and a folded Galaxy is 280px wide; letting the bar itself
     * scroll keeps the document still.
     */
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav a {
    /* Seven sections fit a 375px iPhone SE at 46px each; below that the bar scrolls. */
    flex: 1 0 auto; min-width: 46px; height: auto;
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; gap: 3px; border-radius: 0; padding: 0 3px;
    font-size: 10px; font-weight: 500; letter-spacing: -0.01em;
    text-align: center; background: none !important; box-shadow: none;
  }
  .nav-ico, .nav-ico svg { width: 18px; height: 18px; }
  .nav a[aria-current='page'] { background: none; color: var(--copper); position: relative; }
  .nav a[aria-current='page']::before {
    content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
    width: 24px; height: 2px; border-radius: 2px; background: var(--copper);
    box-shadow: 0 0 10px -1px var(--copper);
  }

  .vhead h1 { font-size: 24px; }
  .panel { padding: 14px; border-radius: var(--r-md); backdrop-filter: none; background: var(--hull); }
  .filters { grid-template-columns: 1fr; gap: 8px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .drawer { width: 100vw; border-left: 0; border-top: 1px solid var(--rim-hot); backdrop-filter: none; background: var(--hull); }
  .drawer .body { padding: 14px 14px calc(14px + env(safe-area-inset-bottom)); }
  .center { margin: 3vh auto; }
  .center::before, .center::after { width: 92vw; height: 92vw; }
  .toast { backdrop-filter: none; background: var(--hull); }

  /* A row's trailing content wraps under the label instead of squeezing it. */
  .row { flex-wrap: wrap; row-gap: 8px; }
  .row .r { width: 100%; text-align: left; }
  .row .r > div[style*='display:flex'] { justify-content: flex-start; }
}

/* Very small phones: 320px is still a real device. */
@media (max-width: 359px) {
  .tiles { grid-template-columns: 1fr; }
  .topbar .brand b { display: none; }
  .nav a { font-size: 10px; }
}

/* Large screens: stop the reading column growing without limit. */
@media (min-width: 1600px) {
  .shell > main { max-width: 1480px; }
}

/* Landscape phones — the drawer must not become a letterbox. */
@media (max-height: 460px) and (orientation: landscape) {
  .drawer { width: min(560px, 100vw); }
  .center { margin: 2vh auto; }
  .lp-enter { padding-block: 28px 22px; }
}

/* Printing a lead or an audit page should produce a document, not a screenshot. */
@media print {
  /* With the header and rail gone, a grid would put the page in the rail's column. */
  .shell { display: block; }
  .topbar, .nav, .tabs, #toasts, .btn { display: none !important; }
  body { background: #fff; color: #000; }
  body::before, body::after { display: none; }
  .panel { break-inside: avoid; border: 1px solid #ccc; box-shadow: none; background: #fff; }
}

/* The role explainer under the sign-in form. */
.auth-roles { margin-top: 18px; padding: 14px 16px; border-radius: var(--r-md); background: color-mix(in srgb, var(--hull-2) 80%, transparent); border: 1px solid var(--rim); }
.auth-roles p { font-size: 12.5px; line-height: 1.55; color: var(--ink-3); margin-bottom: 10px; }
.auth-roles ul { display: flex; flex-direction: column; gap: 5px; }
.auth-roles li { font-size: 12.5px; color: var(--ink-2); padding-left: 13px; position: relative; }
.auth-roles li::before { content: '·'; position: absolute; left: 3px; color: var(--copper); font-weight: 700; }
.auth-roles b { color: var(--ink); font-weight: 600; }

/* ============================================================
   SECOND FACTOR — the code stage of signing in.
   ============================================================ */
.mfa-stage { display: flex; flex-direction: column; gap: 12px; }
.mfa-help { font-size: 12.5px; line-height: 1.55; color: var(--ink-3); }
.mfa-stage input { font-family: var(--f-mono); font-size: 22px; letter-spacing: 0.36em; text-align: center; padding-inline: 12px; height: 52px; }
/* The letter-spacing pushes the caret off-centre on an empty field; the
   placeholder carries the same spacing so the two line up. */
.mfa-stage input::placeholder { letter-spacing: 0.36em; opacity: 0.35; }
.mfa-stage .btn.ghost:disabled { opacity: 0.55; cursor: default; }

@media (max-width: 359px) {
  .mfa-stage input { font-size: 18px; letter-spacing: 0.24em; }
  .mfa-stage input::placeholder { letter-spacing: 0.24em; }
  .lp-install { max-width: 100%; padding-inline: 14px; font-size: 14.5px; }
  .lp-word { font-size: 12.5px; letter-spacing: 0.12em; }
}

/* ============================================================
   The dialling queue. A row is a button: an agent works this list
   with a keyboard for hours, so hover and focus are one state.
   ============================================================ */
.qlist { display: flex; flex-direction: column; gap: 1px; background: var(--rim); border: 1px solid var(--rim); border-radius: var(--r-md); overflow: hidden; }
.qlist > .qrow {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 12px 16px;
  background: var(--hull);
  border: 0;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: background 120ms var(--e-out), box-shadow 120ms var(--e-out);
}
.qlist > .qrow:hover, .qlist > .qrow:focus-visible { background: var(--hull-2); box-shadow: inset 2px 0 0 var(--aqua); outline: none; }
.qscore {
  font-family: var(--f-mono); font-size: 16px; font-weight: 500;
  font-variant-numeric: tabular-nums; color: var(--aqua); text-align: right;
  text-shadow: 0 0 14px color-mix(in srgb, var(--aqua) 35%, transparent);
}
.qmain { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.qname { font-size: 14.5px; font-weight: 500; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qsub { font-family: var(--f-mono); font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.qmeta { display: flex; align-items: center; gap: 8px; flex: none; }
.qhour { font-family: var(--f-mono); font-size: 11px; color: var(--ink-4); white-space: nowrap; font-variant-numeric: tabular-nums; }
/* Below a phone's width the local-hour and attempt notes are the first to go. */
@media (max-width: 560px) {
  .qlist > .qrow { grid-template-columns: 40px minmax(0, 1fr) auto; gap: 10px; padding: 11px 12px; }
  .qhour { display: none; }
}

/* ============================================================
   One person, while somebody is on the phone to them.

   The one screen read at arm's length mid-sentence. The name and
   the number carry from across a desk; everything else is a
   control. The scope is always dark: a live call looks like an
   instrument reading in both themes, so this re-declares its
   colours locally rather than following the day theme.
   ============================================================ */
.callcard {
  --hull-2: #121926; --hull-3: #182130; --well: #090d14;
  --rim: rgba(120, 220, 210, 0.14); --rim-hot: rgba(120, 220, 210, 0.3);
  --ink: #e8eef8; --ink-1: #e8eef8; --ink-2: #b8c5d9; --ink-3: #93a1b6; --ink-4: #7f8ca1;
  --copper: #ff8a3d; --copper-deep: #b23b00; --on-fill: #0a0f17;
  --aqua: #3fe0d0; --iris: #8c7bff; --good: #39d98a; --warn: #ffc64d; --crit: #ff5e7a;
  --edge: rgba(255, 255, 255, 0.06); --well-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4);
  color: var(--ink);
  padding: 22px 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0, transparent 1px), #0f1622;
  border: 1px solid var(--rim);
  border-radius: var(--r-md);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.3), 0 20px 50px -30px rgba(0, 0, 0, 0.9);
}
@media (max-width: 560px) { .callcard { padding: 16px; } }
/* What the vendor already told us about this household, read in the half
   second between the ring and the hello. */
.filestrip { display: flex; flex-wrap: wrap; gap: 6px 8px; margin-top: 12px; }
.filebit { display: inline-flex; align-items: baseline; gap: 5px; padding: 3px 9px; border: 1px solid var(--rim); border-radius: 999px; background: var(--hull-2); font-size: 12.5px; white-space: nowrap; }
.filebit .fk { color: var(--ink-4); }
.filebit .fv { color: var(--ink-1); font-weight: 600; }
.filenote { margin-top: 8px; font-size: 12.5px; color: var(--ink-3); line-height: 1.5; }

/* ============================================================
   A price, on the call, under the card. The premium is the
   biggest thing on it, and everything that produced it is
   visible above it.
   ============================================================ */
.quotehere { margin-top: 14px; }
.quotehere .qlab { font-family: var(--f-mono); font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.18em; color: var(--ink-4); margin-bottom: 6px; }
.quotehere .qsub { font-size: 12.5px; color: var(--ink-3); line-height: 1.5; }
.quoteline { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 14px; border: 1px solid var(--rim); border-radius: var(--r-sm); background: var(--hull-3); }
.quoteline .qbig { font-family: var(--f-mono); font-size: 30px; font-weight: 500; color: var(--good); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.quoteline .qname { font-weight: 600; font-size: 14px; }
.quoteline > div:last-child { margin-left: auto; }
.qcaveat { margin-top: 8px; font-size: 12.5px; color: var(--copper); line-height: 1.5; }
.qalts { margin-top: 12px; }

/* ============================================================
   The agency onboarding form. Filled in once, by somebody who has
   never seen this system. Wide fields, generous spacing.
   ============================================================ */
.intake-wrap { max-width: 720px; margin: 0 auto; padding: 0 16px; }
.intake-wrap .lede { color: var(--ink-2); font-size: 15px; max-width: 56ch; margin: 10px 0 0; }
.intake-wrap .panel { margin-bottom: 18px; }
.intake-wrap .note-p { font-size: 13.5px; color: var(--ink-3); margin: 0 0 16px; max-width: 62ch; line-height: 1.6; }
.intake-wrap .note-p b { color: var(--ink-2); }

.row2, .row3 { display: grid; gap: 12px; }
.row2 { grid-template-columns: 1fr 1fr; }
.row3 { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 620px) { .row2, .row3 { grid-template-columns: 1fr; } }

.rep { display: flex; flex-direction: column; gap: 14px; }
.rep-row { padding: 14px; border: 1px solid var(--rim); border-radius: var(--r-sm); background: var(--hull-2); }
.rep-row .btn { margin-top: 4px; }

.fieldish { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.fieldish .flabel { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.fieldish small { font-size: 12.5px; color: var(--ink-3); line-height: 1.55; }

/* Every state at once: whole names, sorted by name, rows wide enough to read,
   with a filter box for anyone who would rather type two letters. */
.state-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.state-tools .inp { flex: 1 1 200px; min-width: 0; max-width: 300px; }
.state-count { font-family: var(--f-mono); font-size: 11.5px; color: var(--ink-3); margin-left: auto; white-space: nowrap; font-variant-numeric: tabular-nums; }
.state-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 2px; margin-top: 8px; }
.state-pick { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 6px; cursor: pointer; font-size: 14px; color: var(--ink-2); border: 1px solid transparent; transition: background 0.12s var(--e-out); }
.state-pick:hover { background: var(--hull-3); }
.state-pick input { width: 15px; height: 15px; margin: 0; flex: none; accent-color: var(--aqua); }
.state-pick:has(input:checked) { background: color-mix(in srgb, var(--aqua) 12%, transparent); border-color: color-mix(in srgb, var(--aqua) 38%, transparent); color: var(--ink); font-weight: 500; }
.state-pick:has(input:focus-visible) { outline: 2px solid var(--aqua); outline-offset: 1px; }
.state-pick[hidden] { display: none; }
.state-empty { font-size: 13px; color: var(--ink-3); padding: 12px 2px; }

/* ============================================================
   ON A PHONE, AS AN INSTALLED APP
   ============================================================ */

/*
 * Sixteen pixels, on anything with a finger. iOS Safari zooms the page in
 * whenever a focused input has text smaller than 16px, and does not zoom
 * back out. `pointer: coarse` rather than a width breakpoint, because an
 * iPad in landscape is wider than most laptops and zooms exactly the same.
 */
@media (pointer: coarse) {
  .inp,
  input, select, textarea {
    font-size: 16px;
  }
  .inp { padding: 10px 12px; }
  .btn, .nav a, .tabs button, .row.tap { min-height: 44px; }
}

/* Full height that means the screen, not the screen plus the address bar. */
body { min-height: 100vh; min-height: 100dvh; }

/*
 * `.btn` and `.inp` set a fixed `height`, which beats a `min-height` however
 * politely it asks. So these override the height itself. 44px is the size at
 * which a thumb hits what it aimed at.
 */
@media (pointer: coarse) {
  .btn { height: auto; min-height: 44px; }
  .btn.sm { height: auto; min-height: 40px; }
  .inp { height: auto; min-height: 44px; }
  textarea.inp { min-height: 80px; }
}

/* The top bar's controls on a phone: icons only, labels kept for readers. */
@media (max-width: 767px) {
  .tb-ico { display: inline-flex; align-items: center; }
  .tb-txt { display: none; }
  .tb-btn { padding: 0 10px; min-width: 40px; }
}

/* The small things that separate an app from a page. */
@media (pointer: coarse) {
  * { -webkit-tap-highlight-color: transparent; }
  .btn, .nav a, .tabs button, .row.tap, table.data tbody tr.tap { touch-action: manipulation; }
  body { overscroll-behavior-y: contain; }
}

/* Landscape on a notched phone puts the notch down one side. */
@media (max-width: 767px) {
  .shell > main {
    padding-left: max(12px, env(safe-area-inset-left, 0px));
    padding-right: max(12px, env(safe-area-inset-right, 0px));
  }
  .nav {
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
  }
}

/* ============================================================
   THE CARRIER BAND — directly under the hero. Names, not logos:
   every one is a registered trademark.
   ============================================================ */
.lp-carriers {
  padding: 24px 0 32px;
  border-top: 1px solid var(--rim);
  border-bottom: 1px solid var(--rim);
  background: radial-gradient(80% 140% at 50% 0%, color-mix(in srgb, var(--copper) 5%, transparent), transparent 70%), color-mix(in srgb, var(--hull) 60%, transparent);
  overflow: hidden;
}
.lp-careyebrow { text-align: center; margin-bottom: 14px; }
/* The track holds the carriers twice and slides exactly half its own width,
   so the loop has no seam. */
.lp-carmarquee {
  position: relative; overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.lp-cartrack { display: flex; align-items: center; gap: 14px; width: max-content; animation: carslide 42s linear infinite; }
.lp-carmarquee:hover .lp-cartrack,
.lp-carmarquee:focus-within .lp-cartrack { animation-play-state: paused; }
@keyframes carslide { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.lp-carrier {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 14px 26px; border-radius: var(--r-md);
  border: 1px solid var(--rim); background: linear-gradient(180deg, var(--edge) 0, transparent 1px), var(--hull-2);
  font-family: var(--f-display); font-weight: 600;
  font-size: clamp(15px, 1.5vw, 18px); letter-spacing: 0.01em;
  color: var(--ink-2); white-space: nowrap;
  transition: 0.2s var(--e-out);
}
.lp-carmarquee:hover .lp-carrier { border-color: var(--rim-hot); }
.lp-carlogo { height: 26px; width: auto; display: block; }
.lp-carline { max-width: 74ch; margin: 24px auto 0; padding: 0 18px; text-align: center; font-size: 13.5px; line-height: 1.65; color: var(--ink-3); }
@media (max-width: 767px) {
  .lp-carriers { padding: 26px 0 30px; }
  .lp-carrier { padding: 11px 18px; }
  .lp-cartrack { gap: 10px; animation-duration: 32s; }
  .lp-carline { font-size: 12.5px; margin-top: 18px; }
}
/* Somebody who asked their system for less motion gets none: the names stop
   sliding and wrap into a centred block, the second copy hidden. */
@media (prefers-reduced-motion: reduce) {
  .lp-cartrack { animation: none; width: auto; flex-wrap: wrap; justify-content: center; }
  .lp-cartrack .lp-carrier[aria-hidden='true'] { display: none; }
  .lp-carmarquee { -webkit-mask-image: none; mask-image: none; }
}

/* ============================================================
   The quoter's own surface. Every ornament carries information an
   agent needs mid-call: the scan says WHICH carrier is being
   checked, the rank badge says where a carrier landed, the bar
   says how far behind, the recommendation's frame says "this is
   the answer" from across a desk. The "no rate card" rows are
   deliberately the plainest thing on the screen: a row that must
   never be mistaken for a premium.
   ============================================================ */
.rec-why { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.rec-why li { position: relative; padding-left: 16px; font-size: 13px; color: var(--ink-2); line-height: 1.5; }
.rec-why li::before { content: ''; position: absolute; left: 0; top: 8px; width: 5px; height: 5px; border-radius: 50%; background: var(--good); box-shadow: 0 0 6px -1px var(--good); }
/* Old quotes for other people, not an answer for the one in front of you. */
.seen { font-size: 11.5px; color: var(--ink-3); padding: 8px 0 2px; line-height: 1.6; }
.seen b { color: var(--ink-3); font-weight: 500; }
.seen-one { display: inline-block; margin-right: 12px; font-family: var(--f-mono); }

/* The folded half of the quote form. */
.quo-more { margin-top: 14px; border-top: 1px solid var(--rim); padding-top: 12px; }
.quo-more > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-3); padding: 6px 0; min-height: 34px; }
.quo-more > summary::-webkit-details-marker { display: none; }
.quo-more > summary::before { content: '+'; font-family: var(--f-mono); font-size: 14px; line-height: 1; color: var(--copper); width: 14px; text-align: center; }
.quo-more[open] > summary::before { content: '−'; }
.quo-more > summary:hover { color: var(--ink); }
.quo-more-note { margin-left: auto; font-family: var(--f-mono); font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-4); }

/* -- the scan ------------------------------------------------------- */
.qscan {
  position: relative; overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--aqua) 30%, var(--rim)); border-radius: var(--r-md);
  background: linear-gradient(180deg, color-mix(in srgb, var(--aqua) 6%, transparent), transparent 40%), var(--hull-2);
  padding: 14px 14px 12px;
}
.qscan::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--aqua) 14%, transparent), transparent);
  transform: translateX(-100%);
  animation: qsweep 1.35s var(--e-out) infinite;
}
@keyframes qsweep { to { transform: translateX(100%); } }
.qscan-head { display: flex; align-items: center; gap: 9px; font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--aqua); margin-bottom: 11px; }
.qscan-head::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--aqua); flex: none; box-shadow: 0 0 0 0 color-mix(in srgb, var(--aqua) 60%, transparent); animation: qpulse 1.35s var(--e-out) infinite; }
@keyframes qpulse { to { box-shadow: 0 0 0 7px color-mix(in srgb, var(--aqua) 0%, transparent); } }
.qscan-list { display: flex; flex-direction: column; gap: 7px; }
.qscan-one { display: flex; align-items: center; gap: 9px; font-size: 12.5px; color: var(--ink-3); opacity: 0; animation: qfade 0.4s var(--e-out) forwards; }
@keyframes qfade { to { opacity: 1; } }
.qscan-one::before { content: ''; flex: none; width: 5px; height: 5px; background: var(--ink-4); transform: rotate(45deg); }
.qscan-one b { color: var(--ink-2); font-weight: 500; }

/* -- the recommendation, as a heads-up display ---------------------- */
.rec {
  position: relative; overflow: hidden; border-radius: var(--r-lg); padding-top: 18px;
  border-color: color-mix(in srgb, var(--good) 40%, transparent);
  background:
    radial-gradient(90% 160% at 0% 0%, color-mix(in srgb, var(--good) 10%, transparent), transparent 62%),
    var(--glass);
}
.rec::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: linear-gradient(180deg, var(--good), color-mix(in srgb, var(--good) 25%, transparent)); box-shadow: 0 0 14px -1px var(--good); }
/* Corner brackets: four of them, one element, one gradient set. */
.rec::after {
  content: ''; position: absolute; inset: 9px; pointer-events: none; border-radius: 8px;
  --b: color-mix(in srgb, var(--good) 50%, transparent);
  background:
    linear-gradient(var(--b), var(--b)) 0 0 / 14px 1px no-repeat,
    linear-gradient(var(--b), var(--b)) 0 0 / 1px 14px no-repeat,
    linear-gradient(var(--b), var(--b)) 100% 0 / 14px 1px no-repeat,
    linear-gradient(var(--b), var(--b)) 100% 0 / 1px 14px no-repeat,
    linear-gradient(var(--b), var(--b)) 0 100% / 14px 1px no-repeat,
    linear-gradient(var(--b), var(--b)) 0 100% / 1px 14px no-repeat,
    linear-gradient(var(--b), var(--b)) 100% 100% / 14px 1px no-repeat,
    linear-gradient(var(--b), var(--b)) 100% 100% / 1px 14px no-repeat;
}
.rec > * { position: relative; z-index: 1; }
/* The name of what to lead with: the line the agent reads first, in the reading colour. */
.rec > h2 { color: var(--ink); }
.rec-price {
  font-family: var(--f-mono); font-weight: 500;
  font-size: clamp(36px, 9vw, 52px); line-height: 1;
  font-variant-numeric: tabular-nums; letter-spacing: -0.02em;
  margin: 10px 0 2px; text-shadow: 0 0 24px color-mix(in srgb, var(--good) 25%, transparent);
}
.rec-per { font-size: 12px; color: var(--ink-3); margin-bottom: 13px; }
.rec-per b { color: var(--ink-2); font-weight: 500; }

/* -- carrier sections, ranked --------------------------------------- */
.qsec > h2 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.qsec > h2::after { display: none; }
.qrank { flex: none; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; font-family: var(--f-mono); font-size: 11px; font-weight: 500; color: var(--ink-3); background: var(--hull-3); border: 1px solid var(--rim); }
.qsec-1 .qrank { color: var(--on-fill); background: var(--good); border-color: transparent; box-shadow: 0 0 10px -2px var(--good); }
.qsec-1 { border-color: color-mix(in srgb, var(--good) 30%, transparent); }
.qprice { margin-left: auto; font-family: var(--f-mono); font-size: 13px; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.qsec-1 .qprice { color: var(--good); }
/* How far behind the cheapest this carrier came in. The width IS the number. */
.qbar { height: 2px; border-radius: 2px; margin: 0 0 12px; background: var(--hull-3); overflow: hidden; }
.qbar > i { display: block; height: 100%; border-radius: 2px; background: linear-gradient(90deg, var(--aqua-dim), var(--aqua)); transform-origin: left; transform: scaleX(var(--w, 1)); transition: transform 0.7s var(--e-out); }
.qsec-1 .qbar > i { background: linear-gradient(90deg, var(--good), var(--aqua)); }
.qdelta { font-family: var(--f-mono); font-size: 10.5px; color: var(--ink-3); letter-spacing: 0.04em; }

@media (prefers-reduced-motion: reduce) {
  .qscan::after, .qscan-head::before { animation: none; }
  .qscan-one { opacity: 1; animation: none; }
  .qbar > i { transition: none; }
}

/* -- a priced row --------------------------------------------------- */
/*
 * Three parts — what it is, what it costs, what you can do — side by side
 * when there is room and stacked when there is not. Scoped to `.qrows`
 * because the dialling queue's rows share the class name and used to lose
 * their grid to this rule.
 */
.qrows { display: flex; flex-direction: column; }
.qrows > .qrow { display: grid; gap: 6px 14px; align-items: center; grid-template-columns: minmax(0, 1fr) auto auto; padding: 12px 0; border-bottom: 1px solid var(--rim); }
.qrows > .qrow:last-child { border-bottom: 0; padding-bottom: 2px; }
.qrow-what { min-width: 0; }
.qrow-what b { font-weight: 600; }
.qrow-uw { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
.qrow-cost { text-align: right; }
.qrow-mo { font-family: var(--f-mono); font-weight: 500; font-size: 22px; line-height: 1.15; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.qrow-yr { font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.qrow-do { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
@media (max-width: 620px) {
  .qrows > .qrow { grid-template-columns: minmax(0, 1fr) auto; align-items: start; }
  .qrow-what { grid-column: 1; }
  .qrow-cost { grid-column: 2; }
  .qrow-do { grid-column: 1 / -1; align-items: stretch; margin-top: 2px; }
  .qrow-do .btn { width: 100%; justify-content: center; }
  .qrow-do .chip { align-self: flex-start; }
}

/* -- the five questions, on a phone --------------------------------- */
/* Age, sex and tobacco are short answers: they pair up, and only the money
   gets a line of its own, so "Quote it" stays above the fold. */
@media (max-width: 767px) {
  .quo-who { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .quo-who > .quo-cover { grid-column: 1 / -1; }
}
@media (max-width: 359px) {
  .quo-who { grid-template-columns: 1fr; }
}
