/* A copy, made by scripts/build-studio.mjs for the preview in public/studio/.
   The originals are src/styles/system.css and src/styles/home.css; edit those, not this. */

/* ============================================================================
   SpecScan design system ("Instrument").

   One calm surface, numbers first, hairlines where the old design drew boxes.
   Rules of the system (DESIGN.md has the long form):
     - One surface. A container is drawn only around a discrete object (a
       listing, a dialog). Sections are separated by space and one hairline.
       Never a box inside a box.
     - One accent. Teal marks the value and the main action. Violet marks the
       second look and nothing else. Green / amber / red are verdict words.
     - One type family. Archivo, widened for display, normal for text.
       Geist Mono for VINs and codes only. Sentence case everywhere.
     - Motion moves transform and opacity only, answers the pointer, and rests
       under prefers-reduced-motion.

   Tokens live on :root so every page (the legacy .rf pages included) can read
   them. Element styling is scoped to .ss so pages that are not redesigned yet
   keep their look.
   ============================================================================ */

/* The fonts' @font-face rules are not here. They are in public/static/fonts.css,
   which each page links by itself, because a stylesheet that holds both
   @font-face rules and media queries makes the browser rebuild its fonts every
   time the window changes size (the reason is written out in that file). Do
   not add an @font-face rule to this file or to any other stylesheet in src/. */

:root {
  color-scheme: dark;

  /* surface */
  --bg: #0a0e14;
  --bg-raise: #0e141c;
  --surface: #131c28;
  --surface-2: #18222f;
  --line: #1c2733;
  --line-strong: #2a3b4d;
  --control-line: #4a5f77;
  --scrim: rgba(4, 7, 11, 0.72);

  /* ink */
  --ink: #e8eef4;
  --ink-2: #9aabbc;
  --ink-3: #7a8ca0;

  /* accent and verdict */
  --teal: #2dd4bf;
  --teal-fill: #14b8a6;
  --teal-fill-hover: #2dd4bf;
  --teal-ink: #04110f;
  --teal-wash: rgba(45, 212, 191, 0.09);
  --violet: #a78bfa;
  --violet-wash: rgba(167, 139, 250, 0.1);
  --good: #34d399;
  --warn: #fbbf24;
  --bad: #f87171;
  --bad-wash: rgba(248, 113, 113, 0.1);

  /* type */
  --font: 'Archivo Variable', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --wide: 114%;

  /* shape, space, motion */
  --r-1: 6px;
  --r-2: 10px;
  --r-3: 14px;
  --gutter: 20px;
  --wrap: 1120px;
  --wrap-narrow: 720px;
  --top-h: 52px;
  --tabs-h: 58px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --t-1: 120ms;
  --t-2: 200ms;
  --t-3: 360ms;
  --shadow-sheet: 0 24px 64px -24px rgba(0, 0, 0, 0.7);
}
@media (min-width: 768px) {
  :root { --gutter: 32px; }
}
@media (min-width: 1024px) {
  :root { --top-h: 60px; }
}

:root[data-theme='light'] {
  color-scheme: light;
  --bg: #f5f8fc;
  --bg-raise: #ffffff;
  --surface: #ffffff;
  --surface-2: #eef2f7;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --control-line: #8493a8;
  --scrim: rgba(15, 23, 42, 0.42);
  --ink: #0f172a;
  --ink-2: #475569;
  --ink-3: #5b6b80;
  --teal: #0f766e;
  --teal-fill: #0f766e;
  --teal-fill-hover: #0d9488;
  --teal-ink: #ffffff;
  --teal-wash: rgba(15, 118, 110, 0.08);
  --violet: #7c3aed;
  --violet-wash: rgba(124, 58, 237, 0.08);
  --good: #047857;
  --warn: #b45309;
  --bad: #b91c1c;
  --bad-wash: rgba(185, 28, 28, 0.07);
  --shadow-sheet: 0 24px 56px -28px rgba(15, 23, 42, 0.32);
}

/* ---------------------------------------------------------------- base --- */

.ss, .ss *, .ss *::before, .ss *::after { box-sizing: border-box; }

.ss {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-synthesis: none;
  -webkit-tap-highlight-color: transparent;
}
.ss ::selection { background: var(--teal); color: var(--teal-ink); }

/* Element defaults carry no specificity, so any class wins whatever order the
   stylesheets load in (page CSS is imported by its component, before or after
   this file depending on the bundle). */
:where(.ss) :where(h1, h2, h3, h4, p, ul, ol, dl, dd, figure) { margin: 0; }
:where(.ss) :where(ul, ol) { padding: 0; list-style: none; }
:where(.ss) :where(a) { color: inherit; text-decoration: none; }
:where(.ss) :where(button, input, select, textarea) { font: inherit; color: inherit; }
:where(.ss) :where(button, a, input, select, textarea, summary, [role='button'], [tabindex]) { touch-action: manipulation; }
:where(.ss) :where(img, svg, video) { display: block; max-width: 100%; }
:where(.ss) :where(h1, h2, h3) { text-wrap: balance; }
:where(.ss) :where(p, li, dd) { text-wrap: pretty; }
:where(.ss) :where([id]) { scroll-margin-top: calc(var(--top-h) + 20px); }

.ss :focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
  border-radius: var(--r-1);
}
.ss :focus:not(:focus-visible) { outline: none; }

.ss-skip {
  position: fixed; left: 12px; top: 12px; z-index: 200;
  padding: 10px 14px; border-radius: var(--r-2);
  background: var(--teal-fill); color: var(--teal-ink); font-weight: 600;
  transform: translateY(-200%);
}
.ss-skip:focus-visible { transform: none; }

.ss-sr {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* The pages that keep their old look (reports, admin) were built before the
   document declared a colour scheme. Inside them it stays undeclared, so their
   native controls and default colours are what they always were. */
.rf, .ss-report, .ss-user-report { color-scheme: normal; }

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

/* The gutter grows to clear a notch or a rounded corner when a phone is held
   sideways (the same on both sides, so the column stays centred). */
.ss-wrap { width: min(var(--wrap), 100% - 2 * max(var(--gutter), env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px))); margin-inline: auto; }
.ss-wrap--narrow { width: min(var(--wrap-narrow), 100% - 2 * max(var(--gutter), env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px))); }
.ss-page { padding-block: 32px 96px; }
@media (min-width: 768px) { .ss-page { padding-block: 56px 120px; } }

.ss-section { margin-top: 64px; }
.ss-section--tight { margin-top: 40px; }
@media (min-width: 768px) { .ss-section { margin-top: 88px; } }
.ss-rule { height: 1px; border: 0; margin: 0; background: var(--line); }

.ss-sectionhead {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  padding-bottom: 14px; border-bottom: 1px solid var(--line);
}
.ss-sectionhead .ss-h2 { min-width: 0; }

/* ---------------------------------------------------------------- type --- */

.ss-display {
  font-stretch: var(--wide); font-weight: 640;
  font-size: clamp(40px, 6.6vw, 88px); line-height: 0.98; letter-spacing: -0.035em;
}
.ss-h1 {
  font-stretch: var(--wide); font-weight: 620;
  font-size: clamp(28px, 3.8vw, 44px); line-height: 1.04; letter-spacing: -0.025em;
}
.ss-h2 {
  font-stretch: 108%; font-weight: 600;
  font-size: clamp(20px, 2.1vw, 26px); line-height: 1.15; letter-spacing: -0.018em;
}
.ss-h3 { font-weight: 600; font-size: 16px; line-height: 1.3; letter-spacing: -0.005em; }
.ss-lede { font-size: clamp(16px, 1.5vw, 19px); line-height: 1.5; color: var(--ink-2); max-width: 56ch; }
.ss-label { font-size: 13px; line-height: 1.3; color: var(--ink-3); font-weight: 500; }
.ss-small { font-size: 13px; line-height: 1.5; }
.ss-muted { color: var(--ink-2); }
.ss-faint { color: var(--ink-3); }
.ss-num { font-variant-numeric: tabular-nums lining-nums; }
.ss-mono { font-family: var(--font-mono); font-size: 0.92em; letter-spacing: 0.01em; }
.ss-accent { color: var(--teal); }
.ss-good { color: var(--good); }
.ss-warn { color: var(--warn); }
.ss-bad { color: var(--bad); }
.ss-violet { color: var(--violet); }
.ss-truncate { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* A link inside running text: an underline that draws on hover. */
.ss-link {
  color: var(--ink);
  background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat;
  padding-bottom: 1px;
  transition: color var(--t-1) var(--ease), background-size var(--t-2) var(--ease);
}
.ss-link:hover { color: var(--teal); }
.ss-link--quiet { color: var(--ink-2); background-size: 0 1px; }
.ss-link--quiet:hover { background-size: 100% 1px; }
/* A link-styled button ("Got it", "Hide this") is a line of text tall. Under
   a finger its target reaches 44px without moving anything around it. */
@media (pointer: coarse) {
  button.ss-link { position: relative; }
  button.ss-link::after { content: ''; position: absolute; inset: -13px -8px; }
}

/* ------------------------------------------------------------- buttons --- */

.ss-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px;
  border: 1px solid var(--line-strong); border-radius: var(--r-2);
  background: transparent; color: var(--ink);
  font-weight: 600; font-size: 15px; line-height: 1; white-space: nowrap;
  cursor: pointer; user-select: none;
  transition: background-color var(--t-1) var(--ease), border-color var(--t-1) var(--ease), color var(--t-1) var(--ease), transform var(--t-1) var(--ease);
}
.ss-btn:hover { border-color: var(--control-line); background: var(--surface); }
.ss-btn:active { transform: translateY(1px) scale(0.99); }
.ss-btn[disabled], .ss-btn[aria-disabled='true'] { opacity: 0.5; cursor: default; pointer-events: none; }
.ss-btn svg { width: 16px; height: 16px; flex: none; }

.ss-btn--primary { background: var(--teal-fill); border-color: var(--teal-fill); color: var(--teal-ink); }
.ss-btn--primary:hover { background: var(--teal-fill-hover); border-color: var(--teal-fill-hover); }
.ss-btn--quiet { border-color: transparent; color: var(--ink-2); padding-inline: 12px; }
.ss-btn--quiet:hover { border-color: transparent; background: var(--surface); color: var(--ink); }
.ss-btn--danger { color: var(--bad); }
.ss-btn--danger:hover { border-color: var(--bad); background: var(--bad-wash); }
.ss-btn--sm { min-height: 36px; padding: 0 12px; font-size: 14px; }
.ss-btn--lg { min-height: 52px; padding: 0 24px; font-size: 16px; }
.ss-btn--block { width: 100%; }
/* Phones keep a 44px target whatever the visual size. */
@media (pointer: coarse) { .ss-btn--sm { min-height: 44px; } }

.ss-iconbtn {
  display: inline-grid; place-items: center; width: 44px; height: 44px;
  border: 0; border-radius: var(--r-2); background: transparent; color: var(--ink-2); cursor: pointer;
  transition: background-color var(--t-1) var(--ease), color var(--t-1) var(--ease), transform var(--t-1) var(--ease);
}
.ss-iconbtn:hover { background: var(--surface); color: var(--ink); }
.ss-iconbtn:active { transform: scale(0.94); }
.ss-iconbtn svg { width: 18px; height: 18px; }

.ss-busy {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: ss-spin 700ms linear infinite;
}

/* -------------------------------------------------------------- fields --- */

.ss-field { display: grid; gap: 8px; }
.ss-field > label, .ss-fieldlabel { font-size: 14px; font-weight: 500; color: var(--ink); }
.ss-field .ss-help { font-size: 13px; color: var(--ink-3); }
.ss-field .ss-error { font-size: 13px; color: var(--bad); }

.ss-input, .ss-select, .ss-textarea {
  width: 100%; min-height: 48px; padding: 0 14px;
  border: 1px solid var(--control-line); border-radius: var(--r-2);
  background-color: var(--bg-raise); color: var(--ink);
  font-size: 16px; /* 16px keeps iOS from zooming the page on focus */
  transition: border-color var(--t-1) var(--ease), box-shadow var(--t-1) var(--ease);
}
.ss-textarea { padding-block: 12px; min-height: 112px; resize: vertical; line-height: 1.5; }
.ss-input::placeholder, .ss-textarea::placeholder { color: var(--ink-3); }
.ss-input:hover, .ss-select:hover, .ss-textarea:hover { border-color: var(--ink-3); }
/* Focus: the border turns teal and doubles (1px of border, 1px of ring), with
   the wash outside it. The wash alone was too faint to see on the light theme. */
.ss-input:focus-visible, .ss-select:focus-visible, .ss-textarea:focus-visible {
  outline: none; border-color: var(--teal); box-shadow: 0 0 0 1px var(--teal), 0 0 0 4px var(--teal-wash); border-radius: var(--r-2);
}
.ss-input[aria-invalid='true'] { border-color: var(--bad); }
.ss-select {
  appearance: none; padding-right: 38px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%);
  background-position: calc(100% - 19px) 21px, calc(100% - 14px) 21px;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}

.ss-check { display: flex; align-items: flex-start; gap: 12px; min-height: 44px; padding-block: 10px; cursor: pointer; }
.ss-check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--teal-fill); flex: none; }

/* A two- or three-way choice. The thumb slides under the labels. */
.ss-seg {
  display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: relative;
  padding: 3px; border: 1px solid var(--line-strong); border-radius: var(--r-2); background: var(--bg-raise);
}
.ss-seg button {
  position: relative; z-index: 1; min-height: 38px; padding: 0 16px; border: 0; background: transparent;
  color: var(--ink-2); font-weight: 600; font-size: 14px; border-radius: 7px; cursor: pointer; white-space: nowrap;
  transition: color var(--t-1) var(--ease);
}
.ss-seg button[aria-pressed='true'], .ss-seg button[aria-selected='true'] { color: var(--ink); background: var(--surface-2); }
.ss-seg button:hover { color: var(--ink); }
@media (pointer: coarse) { .ss-seg button { min-height: 44px; } }

/* ---------------------------------------------------------------- tags --- */

.ss-tag {
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 8px; border-radius: var(--r-1);
  background: var(--surface-2); color: var(--ink-2);
  font-size: 12.5px; font-weight: 500; line-height: 1; white-space: nowrap;
}
.ss-tag--teal { background: var(--teal-wash); color: var(--teal); }
.ss-tag--violet { background: var(--violet-wash); color: var(--violet); }
.ss-tag--bad { background: var(--bad-wash); color: var(--bad); }
.ss-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
/* A dot between two facts on one line. */
.ss-sep { display: inline-block; width: 3px; height: 3px; margin: 0 10px; border-radius: 50%; background: var(--ink-3); vertical-align: middle; }
/* The actions that follow a block of text: the main one first. */
.ss-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: 22px; }

/* -------------------------------------------------------------- ledger --- */
/* Rows separated by hairlines. The row is the unit, never a card. */

.ss-ledger { border-top: 1px solid var(--line); }
.ss-ledger > li, .ss-ledger > .ss-row { border-bottom: 1px solid var(--line); }
.ss-row {
  display: flex; align-items: center; gap: 16px; min-height: 56px; padding-block: 12px;
}
.ss-row > .grow { flex: 1; min-width: 0; }
a.ss-row, button.ss-row {
  width: 100%; border-inline: 0; border-top: 0; background: transparent; text-align: left; cursor: pointer;
  transition: background-color var(--t-1) var(--ease);
}
a.ss-row:hover, button.ss-row:hover { background: color-mix(in srgb, var(--ink) 3%, transparent); }
.ss-row .chev { width: 16px; height: 16px; color: var(--ink-3); flex: none; transition: transform var(--t-2) var(--ease), color var(--t-1) var(--ease); }
a.ss-row:hover .chev, button.ss-row:hover .chev { transform: translateX(3px); color: var(--ink); }

/* Label left, value right. */
.ss-kv { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: baseline; padding-block: 13px; border-bottom: 1px solid var(--line); }
.ss-kv > dt { color: var(--ink-2); }
.ss-kv > dd { text-align: right; font-weight: 500; font-variant-numeric: tabular-nums lining-nums; }

/* A note beside the text it belongs to: one rule on the left, no box. */
.ss-note { padding: 2px 0 2px 16px; border-left: 2px solid var(--line-strong); color: var(--ink-2); }
.ss-note strong { color: var(--ink); font-weight: 600; }
.ss-note--teal { border-left-color: var(--teal); }
.ss-note--warn { border-left-color: var(--warn); }
.ss-note--bad { border-left-color: var(--bad); }
.ss-note--violet { border-left-color: var(--violet); }

/* A discrete object (a dialog, an empty state, a plan) may sit on a surface. */
.ss-card { border: 1px solid var(--line); border-radius: var(--r-3); background: var(--bg-raise); }

.ss-empty { padding: 56px 0; text-align: center; color: var(--ink-2); }
.ss-empty .ss-h2 { color: var(--ink); margin-bottom: 8px; }

/* ------------------------------------------------------------- readout --- */
/* The value, large, with the line of evidence under it. */

.ss-readout .ss-figure {
  font-stretch: 110%; font-weight: 600; font-variant-numeric: tabular-nums lining-nums;
  font-size: clamp(52px, 9.4vw, 104px); line-height: 0.96; letter-spacing: -0.04em;
}
.ss-readout .ss-figure--quiet { color: var(--ink-3); }
.ss-readout .ss-evidence { margin-top: 14px; color: var(--ink-2); font-variant-numeric: tabular-nums lining-nums; }
.ss-readout .ss-evidence b { color: var(--ink); font-weight: 500; }

/* ------------------------------------------------------------ skeleton --- */

.ss-skel { display: block; border-radius: var(--r-1); background: var(--surface-2); animation: ss-breathe 1.6s ease-in-out infinite; }

/* --------------------------------------------------------------- sheet --- */

.ss-scrim { position: fixed; inset: 0; z-index: 90; background: var(--scrim); animation: ss-fade var(--t-2) var(--ease); }
.ss-sheet {
  position: fixed; z-index: 91; left: 50%; top: 50%; translate: -50% -50%;
  width: min(520px, 100% - 2 * var(--gutter)); max-height: min(86dvh, 760px); overflow: auto; overscroll-behavior: contain;
  padding: 28px; border: 1px solid var(--line-strong); border-radius: var(--r-3);
  background: var(--surface); box-shadow: var(--shadow-sheet);
  animation: ss-rise var(--t-3) var(--ease);
}

/* ---------------------------------------------------------- app chrome --- */

/* The bar covers the status-bar strip in the iOS app, so nothing scrolls
   under the clock. */
.ss-top {
  position: sticky; top: 0; z-index: 50; padding-top: env(safe-area-inset-top, 0px);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(140%) blur(14px); -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.ss-top__in { height: var(--top-h); display: flex; align-items: center; gap: 28px; }
/* The logo, as the link home. It is drawn (src/components/brand/Logo.jsx, and
   the same markup in home.html): the car and SPEC take the ink of whatever
   they sit in and SCAN takes the teal, so one drawing reads on both themes.
   Its height follows the bar; a page that shows it larger sets --logo-h. */
.ss-brand {
  display: inline-flex; align-items: center; min-height: 44px; color: var(--ink);
  transition: opacity var(--t-1) var(--ease);
}
@media (hover: hover) { .ss-brand:hover { opacity: 0.78; } }
.ss-logo { display: block; flex: none; width: auto; height: var(--logo-h, calc(var(--top-h) - 20px)); overflow: visible; }
.ss-logo__ink { fill: currentColor; }
.ss-logo__teal { fill: var(--teal); }
/* Where the system picks the colours, the whole logo takes the text colour. */
@media (forced-colors: active) { .ss-logo__teal { fill: currentColor; } }
.ss-topnav { display: none; align-items: stretch; gap: 4px; height: 100%; }
.ss-topnav a {
  position: relative; display: inline-flex; align-items: center; padding: 0 12px;
  color: var(--ink-2); font-weight: 500; font-size: 14.5px;
  transition: color var(--t-1) var(--ease);
}
.ss-topnav a:hover { color: var(--ink); }
.ss-topnav a::after {
  content: ''; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; background: var(--teal);
  transform: scaleX(0); transform-origin: left center; transition: transform var(--t-2) var(--ease);
}
.ss-topnav a[aria-current='page'] { color: var(--ink); }
.ss-topnav a[aria-current='page']::after { transform: scaleX(1); }
.ss-topnav .pip { width: 6px; height: 6px; margin-left: 6px; border-radius: 50%; background: var(--bad); }
.ss-top__end { margin-left: auto; display: flex; align-items: center; gap: 4px; }
@media (min-width: 1024px) { .ss-topnav { display: flex; } }

.ss-tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: flex; height: calc(var(--tabs-h) + env(safe-area-inset-bottom, 0px));
  padding: 0 env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: saturate(140%) blur(14px); -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-top: 1px solid var(--line);
}
.ss-tabs a {
  position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--ink-3); font-size: 11.5px; font-weight: 500;
  transition: color var(--t-1) var(--ease);
}
.ss-tabs a svg { width: 21px; height: 21px; transition: transform var(--t-2) var(--ease); }
.ss-tabs a:active svg { transform: scale(0.9); }
@media (hover: hover) { .ss-tabs a:hover { color: var(--ink-2); } }
.ss-tabs a[aria-current='page'], .ss-tabs a[aria-current='page']:hover { color: var(--ink); }
.ss-tabs a[aria-current='page']::before { content: ''; position: absolute; top: -1px; left: 28%; right: 28%; height: 2px; background: var(--teal); }
.ss-tabs .pip { position: absolute; top: 9px; left: calc(50% + 9px); width: 7px; height: 7px; border-radius: 50%; background: var(--bad); }
@media (min-width: 1024px) { .ss-tabs { display: none; } }

/* Room for the tab bar under the last content on phones and tablets. */
/* Moving between pages from the bars (pages/Layout.jsx, softNav): where the
   browser can cross-fade two states of a page, the bars are named so they
   hold still, and the page between them fades from one to the next. */
.ss-top { view-transition-name: ss-top; }
.ss-tabs { view-transition-name: ss-tabs; }
::view-transition-old(root), ::view-transition-new(root),
::view-transition-old(ss-top), ::view-transition-new(ss-top),
::view-transition-old(ss-tabs), ::view-transition-new(ss-tabs) { animation-duration: 180ms; animation-timing-function: cubic-bezier(0.2, 0, 0, 1); }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

.ss-shell { min-height: 100dvh; padding-bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom, 0px)); }
.ss-shell[data-chrome='none'] { padding-bottom: 0; }
@media (min-width: 1024px) { .ss-shell { padding-bottom: 0; } }

/* Keeping the app's top bar in view.
   The app's root rule (refresh.css: html, body { overflow-x: hidden }) turns
   <body> into a scroll container that never scrolls, so `position: sticky`
   has nothing to stick to: no "sticky" bar in this app has ever stayed put
   (measured on main as well: a bar sits at -900px after a 900px scroll).
   So the shell does not rely on it:
     - wide screens, where the top bar is the navigation: the bar is fixed and
       the shell makes room for it (bar height + its hairline + the status-bar
       inset);
     - phones and tablets: the bar scrolls away with the page, and the fixed
       tab bar is the navigation. */
.ss-shell[data-chrome='app'] .ss-top { position: relative; }
@media (min-width: 1024px) {
  .ss-shell[data-chrome='app'] .ss-top { position: fixed; top: 0; left: 0; right: 0; }
  .ss-shell[data-chrome='app'] { padding-top: calc(var(--top-h) + 1px + env(safe-area-inset-top, 0px)); }
}
/* On the redesigned pages the root clips instead of hiding. Clipping stops
   sideways scrolling just the same but makes no scroll container, so a sticky
   element (the section names beside a report, scan.css) can stick. Pages that
   keep their old look are left exactly as they were: with a .rf or .ss-report
   root on the page this rule does not apply, and their own sticky bars go on
   not sticking, as today. Without :has() or overflow: clip the old rule stands. */
html:not(:has(.rf, .ss-report)), html:not(:has(.rf, .ss-report)) body { overflow-x: clip; }

/* A control that takes the focus is scrolled into view clear of the fixed
   bars. Without this, tabbing backwards through a long form left the focused
   control under the top bar on wide screens, and tabbing forwards left it
   under the tab bar on phones. */
@media (min-width: 1024px) {
  html:has(.ss-shell[data-chrome='app']) { scroll-padding-top: calc(var(--top-h) + env(safe-area-inset-top, 0px) + 16px); }
}
@media (max-width: 1023.98px) {
  html:has(.ss-shell[data-chrome='app']) { scroll-padding-bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom, 0px) + 16px); }
}
/* The shell owns the safe areas now; the older per-page rules stand down. */
body.ios-native main.ss-main { padding-top: 0; padding-bottom: 0; }
/* The iPhone app's status bar.
   The app draws the page under the phone's status bar (viewport-fit=cover),
   and on a phone the app's top bar scrolls away with the page. With nothing
   over that strip, a scrolled page's text ran under the clock and the
   battery, and on the results page it showed in a band between the status bar
   and the row of tabs that stays put.
   The strip is one thing in this app, whatever the page and whatever the
   theme: the app's dark colour, with the phone's clock drawn light on it.
   The colour of the clock is not CSS's to set: ios/App/App/Info.plist asks
   for the light one (UIStatusBarStyleLightContent), where before the phone
   chose by its own Light or Dark Mode and drew a dark clock on this dark app.
   So the cover is the dark theme's --bg as a literal, in the light theme too,
   and it lies over the app's own bars (50) and under its dialogs (90). It
   takes the taps of that strip, so nothing hidden behind it can be pressed.
   Only the iPhone app has the class: a browser never draws this. In landscape
   the status bar is gone and the strip is 0px tall. */
body.ios-native::before {
  content: ''; position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  height: env(safe-area-inset-top, 0px); background: #0a0e14;
}
/* In the app a control is not a piece of a web page: pressing and holding one
   selects no text and brings up no menu. What a page reads out (a VIN, a
   value, a sentence, an address in a line of text) can still be selected and
   copied. Link previews are off for the whole app in capacitor.config.json. */
body.ios-native :is(button, summary, [role='tab'], a.ss-btn, .ss-tabs a, .ss-top a) {
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.ss-shell[data-chrome='none'] main.ss-main { padding-top: env(safe-area-inset-top, 0px); }

/* -------------------------------------------------------------- motion --- */

.ss-enter { animation: ss-rise var(--t-3) var(--ease) both; }
.ss-enter-2 { animation: ss-rise var(--t-3) var(--ease) 70ms both; }
.ss-enter-3 { animation: ss-rise var(--t-3) var(--ease) 140ms both; }

@keyframes ss-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes ss-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ss-spin { to { transform: rotate(360deg); } }
@keyframes ss-breathe { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .ss *, .ss *::before, .ss *::after {
    animation-duration: 1ms !important; animation-iteration-count: 1 !important; animation-delay: 0ms !important;
    transition-duration: 1ms !important; scroll-behavior: auto !important;
  }
  .ss-skel { animation: none; }
}


/* ============================================================================
   The homepage (home.html). Built on src/styles/system.css.
   Static: no script lays anything out, and nothing moves on scroll. The one
   thing a script draws is the rotating car in the first view (hp-model).

   Load order: do not rely on it. On the dev server this file comes after
   system.css (home.html links them in that order). In the production build the
   two are one file, shared with the app, and this file comes first in it. So a
   rule here that adjusts an ss-* primitive carries one more class than the
   rule it adjusts, and an element that wears an hp-* class beside an ss-* one
   gets its own rule where the two disagree. tests/ui/buildsame.cjs compares
   the build with the dev server and fails on any difference.
   ============================================================================ */

/* Smooth scrolling is for this page's own section links, so it is tied to the
   homepage's body. As a bare `html` rule it reached the whole app (the app
   bundles this file for its signed-out first screen): every change of page
   began at the last page's scroll position and slid to the top. */
html:has(body.hp) { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html:has(body.hp) { scroll-behavior: auto; } }
body.hp { margin: 0; min-height: 100dvh; }

/* ----------------------------------------------------------------- nav --- */

.hp-nav { display: none; align-items: center; gap: 4px; height: 100%; }
.hp-nav a { display: inline-flex; align-items: center; height: 44px; padding: 0 12px; color: var(--ink-2); font-size: 14.5px; font-weight: 500; transition: color var(--t-1) var(--ease); }
.hp-nav a:hover { color: var(--ink); }
@media (min-width: 860px) { .hp-nav { display: flex; } }
.hp-top .ss-top__end { gap: 4px; }
/* The filled button on this page is the one in the hero. On the narrowest
   phones the bar keeps the wordmark and "Sign in": the third item did not
   fit (it was cut off at 320px), and the hero's button is in view below. */
@media (max-width: 359px) { .hp-top .hp-top__scan { display: none; } }

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

.hp-hero { padding-block: 56px 72px; }
@media (min-width: 768px) { .hp-hero { padding-block: 96px 104px; } }
.hp-hero__say .ss-display { max-width: 13ch; }
.hp-hero__say .ss-lede { margin-top: 28px; }
.hp-hero__say .ss-actions { margin-top: 32px; }
.hp-fact { margin-top: 20px; font-size: 14px; color: var(--ink-3); }

/* The car, and under it the product: one real scan, drawn the way the results
   page draws it. Under the headline on small screens (the car, a rule, then
   the scan); beside it, in the first view, on wide ones. */
.hp-show { margin-top: 64px; }
.hp-scan { margin: 0; padding-top: 32px; border-top: 1px solid var(--line); }
@media (min-width: 1024px) {
  .hp-hero { display: grid; grid-template-columns: minmax(0, 1.06fr) minmax(0, 1fr); column-gap: 80px; align-items: end; min-height: calc(100dvh - var(--top-h)); align-content: center; }
  .hp-hero__say .ss-display { font-size: clamp(52px, 5.3vw, 76px); }
  .hp-show { margin-top: 0; }
  .hp-scan { padding: 0 0 6px; border-top: 0; }
  /* One more class than system.css's `.ss-readout .ss-figure`, which it adjusts. */
  .hp-scan .ss-readout .ss-figure { font-size: clamp(56px, 6vw, 84px); }
}
/* The in-app signed-out screen (src/pages/Landing.jsx) is the headline alone. */
@media (min-width: 1024px) { .hp-hero.hp-hero--solo { grid-template-columns: minmax(0, 760px); } }
/* The car, over the scan. A still of the logo's outline is in the markup;
   public/static/hero-model.js draws a slowly rotating model on the canvas
   where it can and marks the box `is-live`, and the two cross-fade. The box
   has its height either way, so nothing moves when the model arrives.
   Decoration: hidden from screen readers, never clickable. It stands outside
   the scan's <figure>: it is the site's emblem, not that scan's car. */
.hp-model { position: relative; height: 190px; margin: 0 0 20px; pointer-events: none; }
.hp-model__still { position: absolute; left: 50%; top: 54%; width: min(74%, 400px); height: auto; transform: translate(-50%, -50%); fill: var(--line-strong); transition: opacity 600ms var(--ease); }
.hp-model canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; opacity: 0; transition: opacity 800ms var(--ease); }
.hp-model.is-live canvas { opacity: 1; }
.hp-model.is-live .hp-model__still { opacity: 0; }
@media (min-width: 1024px) {
  /* Beside the headline, the model takes what the window's height can spare.
     The column it heads is now the taller one, so the headline sits at its
     middle instead of on its last line. */
  .hp-model { height: clamp(150px, 28vh, 340px); margin-bottom: 16px; }
  .hp-hero__say { align-self: center; }
  .hp-hero.hp-hero--solo .hp-hero__say { align-self: end; }
}
/* A short, wide window (a small laptop, a tablet on its side): less air around
   the first view, and the model gives up height first, so the car and the
   whole readout stay in it down to a window about 650px tall. The 552px is
   what the rest of the column needs: the bar, the padding and the readout. */
@media (min-width: 1024px) and (max-height: 860px) {
  .hp-hero:not(.hp-hero--solo) { padding-block: 40px 56px; }
  .hp-model { height: clamp(100px, calc(100vh - 552px), 200px); }
}
@media (prefers-reduced-motion: reduce) { .hp-model__still, .hp-model canvas { transition: none; } }
/* With the system's colours forced on the page the model is not drawn (it
   paints in the page's own colours); the still takes the system's text colour. */
@media (forced-colors: active) { .hp-model__still { fill: CanvasText; } }
/* On paper a WebGL canvas is empty: print the still. */
@media print {
  .hp-model.is-live canvas { opacity: 0; }
  .hp-model.is-live .hp-model__still { opacity: 1; }
}
.hp-scan__cap { font-size: 13px; color: var(--ink-3); }
.hp-scan__car { margin-top: 14px; font-stretch: var(--wide); font-weight: 620; font-size: clamp(24px, 3.2vw, 36px); line-height: 1.08; letter-spacing: -0.022em; }
.hp-scan__meta { display: flex; flex-wrap: wrap; align-items: center; margin-top: 10px; color: var(--ink-2); }
.hp-scan__meta .ss-mono { color: var(--ink); }
.hp-scan__readout { margin-top: 40px; }
.hp-scan__readout .ss-label { font-size: 14px; }
.hp-scan__readout .ss-figure { margin-top: 6px; }

.hp-track { display: flex; align-items: center; gap: 12px; margin-top: 30px; }
.hp-track__end { flex: none; font-size: 12.5px; color: var(--ink-3); }
.hp-track__plot { position: relative; flex: 1; min-width: 0; height: 18px; margin: 30px 0 14px; }
.hp-track__axis { position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--line-strong); }
.hp-track__band { position: absolute; top: calc(50% - 4px); height: 8px; border-radius: 4px; background: var(--teal); opacity: 0.32; transform-origin: left center; animation: hp-band 700ms var(--ease) 200ms both; }
.hp-track__value { position: absolute; top: -10px; bottom: -10px; width: 2px; margin-left: -1px; border-radius: 1px; background: var(--teal); animation: hp-mark 520ms var(--ease) 500ms both; }
.hp-track__tag { position: absolute; top: -28px; transform: translateX(-50%); font-size: 12.5px; font-weight: 600; line-height: 1; white-space: nowrap; }
.hp-track__tag::before { content: ''; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--teal); }
@keyframes hp-band { from { opacity: 0; transform: scaleX(0.2); } to { opacity: 0.32; transform: none; } }
@keyframes hp-mark { from { opacity: 0; transform: scaleY(0.2); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .hp-track__band, .hp-track__value { animation: none; } }

/* ------------------------------------------------------------ sections --- */
/* The section's name in its own column on wide screens, as in the report. */

.hp-section { padding-block: 56px; border-top: 1px solid var(--line); }
@media (min-width: 768px) { .hp-section { padding-block: 88px; } }
.hp-section__head .ss-small { margin-top: 8px; max-width: 26ch; }
.hp-section__body { margin-top: 28px; min-width: 0; }
@media (min-width: 1024px) {
  .hp-section { display: grid; grid-template-columns: 264px minmax(0, 1fr); column-gap: 56px; }
  .hp-section__head { position: sticky; top: calc(var(--top-h) + 28px); align-self: start; }
  .hp-section__body { margin-top: 0; }
}
.hp-big { font-stretch: 108%; font-weight: 600; font-size: clamp(22px, 2.9vw, 34px); line-height: 1.18; letter-spacing: -0.02em; max-width: 26ch; text-wrap: balance; }
.hp-p { margin-top: 20px; max-width: 62ch; color: var(--ink-2); font-size: 16px; line-height: 1.6; }
.hp-p .ss-num { color: var(--ink); font-weight: 500; }
/* A note under a block: the small, faint cut of the paragraph above. Written
   out here because `.hp-p` and system.css's `.ss-small` / `.ss-faint` have the
   same weight, so which one won used to depend on which file came last. */
.hp-p.ss-small { font-size: 13px; line-height: 1.5; }
.hp-p.ss-faint { color: var(--ink-3); }
.hp-sub { margin-top: 56px; }

/* How it was reached: a sentence on the left, the scan's own figure on the right. */
.hp-steps { border-top: 1px solid var(--line); counter-reset: none; }
.hp-steps li { display: grid; gap: 12px; padding: 24px 0; border-bottom: 1px solid var(--line); }
.hp-steps li p { margin-top: 6px; max-width: 52ch; color: var(--ink-2); }
.hp-steps .hp-steps__fig { margin-top: 0; color: var(--ink-2); font-size: 15px; line-height: 1.5; }
.hp-steps__fig b { color: var(--ink); font-weight: 600; }
@media (min-width: 700px) {
  .hp-steps li { grid-template-columns: minmax(0, 1fr) 280px; column-gap: 40px; align-items: start; }
  .hp-steps .hp-steps__fig { text-align: right; }
}

/* Two groups of three figures. */
.hp-two { display: grid; gap: 40px; }
@media (min-width: 700px) { .hp-two { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 56px; } }
.hp-figs { margin-top: 14px; border-top: 1px solid var(--line); }
.hp-figs > div { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.hp-figs dt { color: var(--ink-2); }
.hp-figs dd { font-stretch: 106%; font-weight: 600; font-size: 19px; letter-spacing: -0.012em; }

.hp-comps { margin-top: 14px; border-top: 1px solid var(--line); }
.hp-comps li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: baseline; gap: 8px 24px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.hp-comps li b { min-width: 92px; text-align: right; font-weight: 600; }
@media (max-width: 479px) {
  .hp-comps li { grid-template-columns: minmax(0, 1fr) auto; }
  .hp-comps li span:first-child { grid-column: 1 / -1; }
}

/* The free trial, said once above the plans. Each of its three plans says it again under its price. */
.hp-trial { display: grid; gap: 10px 32px; align-items: center; margin-bottom: 20px; padding: 20px 22px; border: 1px solid var(--teal); border-radius: var(--r-2); background: var(--teal-wash); }
.hp-trial__big { font-stretch: var(--wide); font-weight: 620; font-size: clamp(28px, 4vw, 44px); line-height: 1; letter-spacing: -0.025em; white-space: nowrap; }
.hp-trial__big .ss-num { color: var(--teal); }
.hp-trial__what { font-weight: 500; font-size: clamp(16px, 1.5vw, 19px); line-height: 1.35; }
.hp-trial__terms { margin-top: 6px; font-size: 13.5px; line-height: 1.5; color: var(--ink-2); max-width: 74ch; }
@media (min-width: 760px) { .hp-trial { grid-template-columns: auto minmax(0, 1fr); } }
.hp-plans__trial { font-size: 13.5px; font-weight: 500; color: var(--teal); }

/* Plans: a row each, the price where the eye lands. */
.hp-plans { border-top: 1px solid var(--line); }
.hp-plans li { display: grid; gap: 14px; padding: 24px 0; border-bottom: 1px solid var(--line); }
.hp-plans__name { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; }
.hp-plans__name .hp-plans__trial { flex: 1 0 100%; text-align: right; }
.hp-plans__price { font-stretch: 108%; font-weight: 600; font-size: 22px; letter-spacing: -0.02em; white-space: nowrap; }
.hp-plans__price span { font-stretch: 100%; font-weight: 400; font-size: 13px; letter-spacing: 0; color: var(--ink-3); }
.hp-plans__what { color: var(--ink-2); max-width: 58ch; }
.hp-plans .ss-btn { justify-self: start; }
@media (min-width: 860px) {
  .hp-plans li { grid-template-columns: 176px minmax(0, 1fr) 204px; column-gap: 32px; align-items: start; }
  .hp-plans__name { display: block; }
  .hp-plans__name .hp-plans__trial { margin-top: 4px; text-align: left; }
  .hp-plans__price { margin-top: 4px; }
  .hp-plans .ss-btn { justify-self: stretch; }
}

/* --------------------------------------------------------------- close --- */

.hp-close { padding-block: 72px 96px; border-top: 1px solid var(--line); }
@media (min-width: 768px) { .hp-close { padding-block: 120px 144px; } }
.hp-close .ss-h1 { max-width: 18ch; font-size: clamp(30px, 5vw, 60px); }
.hp-close .ss-actions { margin-top: 32px; }

.hp-foot { border-top: 1px solid var(--line); padding-block: 32px calc(40px + env(safe-area-inset-bottom, 0px)); }
.hp-foot__in { display: grid; gap: 20px; }
.hp-foot__links { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.hp-foot__links a { display: inline-flex; align-items: center; min-height: 36px; color: var(--ink-2); font-size: 14px; transition: color var(--t-1) var(--ease); }
.hp-foot__links a:hover { color: var(--ink); }
@media (pointer: coarse) { .hp-foot__links a { min-height: 44px; } }
