/* Forewarned web app (forewarned.co.uk/check): the iPhone app's screens, for Android and any browser.
   Same layout, words and colours as the SwiftUI app (iOS system colours, the plate, the score ring),
   light and dark. No framework, no build step, no web fonts: the type is the system font. */

:root {
  color-scheme: light dark;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", Roboto, "Segoe UI Variable Text", "Segoe UI", system-ui, "Helvetica Neue", Arial, sans-serif;
  --rounded: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, Roboto, "Segoe UI", system-ui, sans-serif;
  --plate-font: "Roboto Condensed", "Arial Narrow", sans-serif-condensed, -apple-system, BlinkMacSystemFont, system-ui, sans-serif;

  --accent: #2456f5;
  --accent-soft: rgba(36, 86, 245, .12);
  --green: #34c759;
  --orange: #ff9500;
  --red: #ff3b30;
  --yellow: #ffcc00;
  --watch: #b88500;          /* "keep an eye on": deep gold, because yellow vanishes on white */
  --teal: #30b0c7;
  --purple: #af52de;
  --blue: #007aff;
  --grey: #8e8e93;

  --bg: #f2f2f7;             /* systemGroupedBackground */
  --card: #fff;              /* secondarySystemGroupedBackground */
  --fill: rgba(118, 118, 128, .12);   /* tertiarySystemFill */
  --fill-2: rgba(118, 118, 128, .2);
  --sep: rgba(60, 60, 67, .18);
  --label: #000;
  --label-2: rgba(60, 60, 67, .6);
  --label-3: rgba(60, 60, 67, .3);
  --bar: rgba(249, 249, 249, .82);
  --bar-line: rgba(0, 0, 0, .12);
  --shadow: 0 1px 2px rgba(0, 0, 0, .04);

  --plate: #fed31b;
  --plate-band: #00389e;

  --r-card: 22px;
  --r-tile: 18px;
  --gutter: 16px;
  --maxw: 640px;
  --ease: cubic-bezier(.28, .11, .32, 1);
  --spring: cubic-bezier(.2, .9, .25, 1.06);
}
@media (prefers-color-scheme: dark) {
  :root {
    --accent: #4c7dff;
    --accent-soft: rgba(76, 125, 255, .18);
    --green: #30d158;
    --orange: #ff9f0a;
    --red: #ff453a;
    --yellow: #ffd60a;
    --watch: #ffd60a;
    --teal: #40cbe0;
    --purple: #bf5af2;
    --blue: #0a84ff;
    --grey: #98989d;

    --bg: #000;
    --card: #1c1c1e;
    --fill: rgba(118, 118, 128, .24);
    --fill-2: rgba(118, 118, 128, .32);
    --sep: rgba(84, 84, 88, .55);
    --label: #fff;
    --label-2: rgba(235, 235, 245, .6);
    --label-3: rgba(235, 235, 245, .3);
    --bar: rgba(22, 22, 24, .8);
    --bar-line: rgba(255, 255, 255, .12);
    --shadow: none;
  }
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--bg);
  -webkit-tap-highlight-color: transparent;
}
body {
  margin: 0;
  min-height: 100svh;
  color: var(--label);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.29;
  letter-spacing: -.01em;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  touch-action: manipulation;
}
h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: var(--accent); text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; }
button:disabled { cursor: default; }
svg.i { width: 1em; height: 1em; flex: none; display: inline-block; vertical-align: -.125em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
svg.i--fill { fill: currentColor; stroke: none; }
:focus-visible { outline: 3px solid rgba(76, 125, 255, .6); outline: 3px solid color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: 2px; border-radius: 8px; }
.vh {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.num { font-variant-numeric: tabular-nums; }
.secondary { color: var(--label-2); }

/* ---------- frame: top bar, content, tab bar ---------- */
.app { min-height: 100svh; display: flex; flex-direction: column; }
.bar {
  position: sticky; top: 0; z-index: 20;
  padding-top: env(safe-area-inset-top);
  background: var(--bar);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: .5px solid transparent;
  transition: border-color .2s;
  view-transition-name: bar;
}
.bar.is-scrolled { border-bottom-color: var(--bar-line); }
.bar__in {
  position: relative; height: 44px; max-width: var(--maxw); margin: 0 auto;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 8px;
}
.bar__title {
  grid-column: 2; font-size: 17px; font-weight: 600; letter-spacing: -.02em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60vw; text-align: center;
}
.bar__left { grid-column: 1; justify-self: start; display: flex; }
.bar__right { grid-column: 3; justify-self: end; display: flex; gap: 2px; }
.bar__btn {
  display: inline-flex; align-items: center; gap: 2px; min-height: 44px; min-width: 44px; justify-content: center;
  padding: 0 8px; color: var(--accent); font-size: 17px; border-radius: 12px;
}
.bar__btn svg.i { font-size: 22px; }
.bar__btn--back { padding-left: 2px; }
.bar__btn--back svg.i { font-size: 26px; stroke-width: 2.2; margin-right: -2px; }
.bar__btn--text { font-weight: 400; }
.bar__btn--done { font-weight: 600; }
.bar__btn.is-on { color: var(--yellow); }
.bar__btn:active { opacity: .45; }

.view { flex: 1; width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter) calc(96px + env(safe-area-inset-bottom)); }
.view:focus { outline: none; }

.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--bar);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-top: .5px solid var(--bar-line);
  view-transition-name: tabs;
}
.tabs__in { max-width: var(--maxw); margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; }
.tab {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 0 5px;
  color: var(--grey); font-size: 10.5px; font-weight: 500; letter-spacing: .01em;
}
.tab svg.i { font-size: 25px; }
.tab[aria-current="page"] { color: var(--accent); }
.tab[aria-current="page"] svg.i--tab-off { display: none; }
.tab:not([aria-current="page"]) svg.i--tab-on { display: none; }

/* ---------- common pieces ---------- */
.card {
  background: var(--card); border-radius: var(--r-card); box-shadow: var(--shadow);
  overflow: hidden;
}
.card--pad { padding: 16px; }
.section-title {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 0 4px; margin: 26px 0 12px;
}
.section-title h2 { font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.section-title p, .section-title a { font-size: 15px; color: var(--label-2); }
.section-title a { color: var(--accent); }
.divider { height: .5px; background: var(--sep); border: 0; margin: 0; }
.row-divider { height: .5px; background: var(--sep); margin-left: var(--inset, 16px); }
.pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 999px;
  font-size: 13px; font-weight: 600; color: var(--c, var(--label-2));
  background: var(--fill);
  background: color-mix(in srgb, var(--c, var(--grey)) 14%, transparent);
}
.pill svg.i { font-size: 14px; }
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  min-height: 52px; padding: 12px 20px; border-radius: 999px;
  font-size: 17px; font-weight: 600; letter-spacing: -.01em;
  transition: transform .2s var(--ease), opacity .2s, background-color .2s;
}
.btn:active:not(:disabled) { transform: scale(.97); }
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:disabled { opacity: .38; }
.btn--tinted { background: var(--accent-soft); color: var(--accent); }
.btn--small { width: auto; min-height: 40px; padding: 8px 18px; font-size: 15px; }
.chev { color: var(--label-3); font-size: 14px; flex: none; }
.chev svg.i { stroke-width: 2.6; }
.banner {
  display: flex; align-items: flex-start; gap: 10px; padding: 14px; border-radius: 16px;
  background: var(--fill);
  background: color-mix(in srgb, var(--c, var(--accent)) 12%, transparent); font-size: 15px;
}
.banner > svg.i { color: var(--c, var(--accent)); font-size: 19px; margin-top: 1px; }
.banner p { flex: 1; }
.banner .banner__x { color: var(--label-2); font-size: 18px; margin: -4px -4px 0 0; padding: 4px; }

/* ---------- the UK number plate ---------- */
.plate {
  display: inline-flex; align-items: stretch; height: var(--h, 26px); border-radius: var(--pr, 5px);
  background: var(--plate); color: #000; overflow: hidden; flex: none;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .18);
}
.plate__band {
  width: var(--band, 11px); background: var(--plate-band); color: #fff;
  display: flex; align-items: flex-end; justify-content: center; padding-bottom: calc(var(--h, 26px) * .12);
  font: 700 max(6px, calc(var(--band, 11px) * .4)) / 1 var(--font); letter-spacing: 0;
}
.plate__txt {
  display: flex; align-items: center; padding: 0 calc(var(--fs, 15px) * .5);
  font: 800 var(--fs, 15px) / 1 var(--plate-font); font-stretch: condensed;
  letter-spacing: .05em; white-space: nowrap; text-transform: uppercase;
}
.plate--m { --h: 38px; --band: 15px; --fs: 22px; --pr: 7px; }
.plate--l { --h: 62px; --band: 24px; --fs: 36px; --pr: 11px; }

.plate-field {
  position: relative; display: flex; align-items: stretch; height: 78px; border-radius: 14px;
  background: var(--plate); color: #000; overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15), 0 8px 18px rgba(254, 211, 27, .35);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15), 0 8px 18px color-mix(in srgb, var(--plate) 35%, transparent);
  transition: box-shadow .2s;
}
.plate-field:focus-within { box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .5), 0 8px 18px rgba(254, 211, 27, .35); box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .5), 0 8px 18px color-mix(in srgb, var(--plate) 35%, transparent); }
.plate-field .plate__band { --band: 30px; --h: 78px; font-size: 12px; }
.plate-field input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: #000; caret-color: #000;
  text-align: center; padding: 0 10px; margin: 0;
  font: 800 40px / 1 var(--plate-font); font-stretch: condensed; letter-spacing: .05em; text-transform: uppercase;
  -webkit-appearance: none; appearance: none;
}
.plate-field input::placeholder { color: rgba(0, 0, 0, .22); opacity: 1; }
.plate-field .clear {
  display: flex; align-items: center; padding: 0 14px 0 4px; color: rgba(0, 0, 0, .32); font-size: 22px;
}
.plate-field .clear[hidden] { display: none; }

/* ---------- score ring ---------- */
.ring { position: relative; width: var(--d, 108px); height: var(--d, 108px); flex: none; color: var(--c); }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); display: block; overflow: visible; }
.ring circle { fill: none; stroke-width: var(--lw, 12); }
.ring .ring__track { stroke: var(--fill-2); stroke: color-mix(in srgb, var(--c) 16%, transparent); }
.ring .ring__fill {
  stroke: var(--c); stroke-linecap: round; stroke-dasharray: 1 1; stroke-dashoffset: var(--off, 1);
}
.ring.is-animating .ring__fill { transition: stroke-dashoffset 1.1s var(--spring) .2s; }
.ring.is-pending .ring__fill { opacity: 0; }
.ring__num {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-family: var(--rounded); color: var(--label);
}
.ring__num b { font-size: calc(var(--d, 108px) * .34); line-height: 1; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.ring__num small { font-size: max(9px, calc(var(--d, 108px) * .1)); font-weight: 600; color: var(--label-2); margin-top: 1px; }
.ring__num--q { font-size: calc(var(--d, 108px) * .3); font-weight: 700; color: var(--label-2); }

/* level and severity colours */
.lv-green { --c: var(--green); }
.lv-amber { --c: var(--orange); }
.lv-red { --c: var(--red); }
.lv-unknown { --c: var(--grey); }
.sv-critical { --c: var(--red); }
.sv-warning { --c: var(--orange); }
.sv-watch { --c: var(--watch); }
.sv-good { --c: var(--green); }

.score-badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 999px;
  background: var(--fill);
  background: color-mix(in srgb, var(--c) 14%, transparent);
  font: 700 15px / 1.1 var(--font); font-variant-numeric: tabular-nums;
}
.score-badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }

/* ---------- Check (home) ---------- */
.home { padding-top: 12px; display: grid; gap: 30px; }
.home__slot { display: grid; gap: 12px; margin-bottom: -12px; }
.home__slot[hidden] { display: none; }
.recents .section-title { margin-top: 0; }
.home::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 420px; z-index: -1; pointer-events: none;
  background: linear-gradient(to bottom, var(--accent-soft), transparent);
  background: linear-gradient(to bottom, color-mix(in srgb, var(--accent) 14%, transparent), transparent);
}
.home__hero h1 {
  font-size: 38px; line-height: 1.08; font-weight: 700; letter-spacing: -.025em; margin-top: 8px;
}
.home__hero p { margin-top: 10px; color: var(--label-2); font-size: 17px; line-height: 1.35; }
.entry { display: grid; gap: 14px; }
.entry .plate-field { margin-bottom: 6px; }
.check-row {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px; color: inherit;
}
.check-row:active, .link-row:active, .finding-row:active, .history-row:active, .settings-row:active { background: var(--fill); }
.check-row__main { flex: 1; min-width: 0; display: grid; gap: 6px; }
.check-row__top { display: flex; align-items: center; gap: 6px; }
.check-row__star { color: var(--yellow); font-size: 12px; }
.check-row__car { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.check-row__when { font-size: 12px; color: var(--label-2); }
.link-row {
  display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: var(--r-card);
  background: var(--card); color: inherit; box-shadow: var(--shadow);
}
.link-row__icon { width: 34px; display: flex; justify-content: center; color: var(--accent); font-size: 26px; }
.link-row__text { flex: 1; min-width: 0; }
.link-row__text b { display: block; font-size: 15px; font-weight: 600; }
.link-row__text span { display: block; font-size: 13px; color: var(--label-2); margin-top: 2px; }
.trust { text-align: center; font-size: 13px; color: var(--label-2); padding: 0 12px; }
.install {
  display: flex; gap: 14px; align-items: flex-start; padding: 16px; border-radius: var(--r-card);
  background: var(--card); box-shadow: var(--shadow);
}
.install img { width: 52px; height: 52px; border-radius: 12px; flex: none; }
.install__text { flex: 1; min-width: 0; }
.install__text b { display: block; font-size: 16px; font-weight: 600; }
.install__text p { font-size: 14px; color: var(--label-2); margin-top: 3px; }
.install__actions { display: flex; gap: 10px; margin-top: 12px; align-items: center; flex-wrap: wrap; }
.install__actions .later { font-size: 15px; color: var(--label-2); padding: 8px 6px; }

/* ---------- checking and errors ---------- */
.state {
  min-height: calc(100svh - 44px - 120px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  gap: 30px; padding: 20px 8px 80px;
}
.spinner {
  width: 46px; height: 46px; border-radius: 50%;
  background: conic-gradient(from 20deg, transparent 5%, var(--accent) 80%, transparent 80%);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 5px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 5px));
  animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.state__step { font-size: 17px; font-weight: 600; color: var(--label-2); min-height: 1.3em; }
.state__step span { display: inline-block; animation: stepIn .45s var(--ease) both; }
@keyframes stepIn { from { opacity: 0; transform: translateY(10px); } }
.state--error { gap: 14px; }
.state--error > svg.i { font-size: 52px; color: var(--label-2); stroke-width: 1.5; margin-bottom: 4px; }
.state--error h1 { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.state--error p { color: var(--label-2); max-width: 340px; font-size: 16px; line-height: 1.38; }
.state--error .btn { margin-top: 10px; }

/* ---------- the report ---------- */
.report { padding-top: 8px; display: grid; gap: 18px; }
.report > .section-title { margin-bottom: -6px; margin-top: 8px; }
.note {
  display: flex; gap: 10px; align-items: flex-start; padding: 14px; border-radius: 16px;
  background: var(--accent-soft); font-size: 13px; margin-top: 8px;
}
.note svg.i { color: var(--accent); font-size: 17px; }
.vehicle { display: grid; justify-items: center; gap: 10px; text-align: center; padding-top: 12px; }
.vehicle .plate { margin-bottom: 4px; }
.vehicle h1 { font-size: 22px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
.vehicle__sub { font-size: 15px; color: var(--label-2); }
.vehicle__pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 2px; }
.pill--ok { --c: var(--green); }
.pill--bad { --c: var(--red); }

.verdict {
  position: relative; padding: 18px; border-radius: var(--r-card);
  background: var(--card);
  background: linear-gradient(to bottom, color-mix(in srgb, var(--c) 16%, transparent), transparent 50%), var(--card);
  box-shadow: var(--shadow); display: grid; gap: 16px;
}
.verdict__top { display: flex; align-items: center; gap: 18px; }
.verdict__label { display: flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 600; color: var(--c); }
.verdict__label svg.i { font-size: 17px; }
.verdict__headline { font-size: 20px; font-weight: 700; letter-spacing: -.02em; line-height: 1.22; margin-top: 6px; }
.verdict__summary { font-size: 17px; line-height: 1.35; }
.verdict__meta { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--label-2); padding-top: 12px; border-top: .5px solid var(--sep); }
.verdict__meta span:first-child { display: inline-flex; align-items: center; gap: 6px; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { padding: 12px; border-radius: var(--r-tile); background: var(--card); box-shadow: var(--shadow); min-width: 0; }
.stat__k { display: flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--c); white-space: nowrap; }
.stat__v { font: 700 22px / 1.2 var(--rounded); font-variant-numeric: tabular-nums; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat__s { font-size: 11px; line-height: 1.25; color: var(--label-2); margin-top: 2px; }

.recall {
  display: flex; gap: 12px; align-items: flex-start; padding: 16px; border-radius: var(--r-card);
  background: rgba(255, 149, 0, .12);
  background: color-mix(in srgb, var(--orange) 12%, transparent);
}
.recall > svg.i { color: var(--orange); font-size: 22px; }
.recall b { display: block; font-size: 15px; font-weight: 600; }
.recall p { font-size: 13px; color: var(--label-2); margin-top: 4px; }

.group__head {
  display: flex; align-items: center; gap: 7px; padding: 14px 16px 2px;
  font-size: 12px; font-weight: 600; color: var(--label-2); letter-spacing: .02em; text-transform: uppercase;
}
.group__head::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.finding-row {
  display: flex; align-items: flex-start; gap: 12px; width: 100%; padding: 12px 16px; text-align: left;
}
.badge {
  width: var(--s, 34px); height: var(--s, 34px); border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--fill);
  background: color-mix(in srgb, var(--c) 15%, transparent); color: var(--c);
}
.badge svg.i { font-size: calc(var(--s, 34px) * .5); stroke-width: 2; }
.finding-row__text { flex: 1; min-width: 0; display: grid; gap: 5px; }
.finding-row__title { font-size: 15px; font-weight: 600; line-height: 1.25; }
.finding-row__detail {
  font-size: 13px; color: var(--label-2); line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.cost-pill {
  justify-self: start; margin-top: 3px; padding: 5px 8px; border-radius: 8px; background: var(--fill);
  font-size: 12px; font-variant-numeric: tabular-nums;
}
.cost-pill b { font-weight: 600; }
.cost-pill span { color: var(--label-2); margin-left: 6px; }
.quote-note { margin-top: 3px; font-size: 12px; font-weight: 500; color: var(--label-2); }
.finding-row .chev { margin-top: 3px; }
.empty-line { display: flex; align-items: center; gap: 8px; font-size: 15px; color: var(--label-2); }

.mileage { display: grid; gap: 14px; }
.mileage__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.mileage__head h3 { display: flex; align-items: center; gap: 7px; font-size: 17px; font-weight: 600; }
.mileage__head h3 svg.i { color: var(--accent); }
.mileage__head p { font-size: 15px; color: var(--label-2); }
.mileage__warn { display: flex; align-items: center; gap: 7px; font-size: 15px; font-weight: 600; color: var(--red); }
.chart-slot { min-height: 170px; }
.chart { width: 100%; height: 170px; display: block; overflow: visible; font-family: var(--font); }
.chart .grid line { stroke: var(--sep); stroke-width: 1; }
.chart .axis text { font-size: 11px; fill: var(--label-2); }
.chart .area { fill: url(#fw-area); }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.chart .pt { fill: var(--accent); }
.chart .pt--drop { fill: var(--red); }

.history-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 16px; text-align: left; }
.result {
  width: 42px; height: 22px; border-radius: 999px; flex: none; display: flex; align-items: center; justify-content: center;
  font: 800 11px / 1 var(--rounded); letter-spacing: .02em; color: #fff; background: var(--c);
}
.result--pass { --c: var(--green); }
.result--fail { --c: var(--red); }
.result--unknown { --c: var(--grey); }
.history-row__text { flex: 1; min-width: 0; }
.history-row__text b { display: block; font-size: 15px; font-weight: 600; }
.history-row__text span { display: block; font-size: 12px; color: var(--label-2); margin-top: 2px; }
.history-row__miles { font-size: 15px; color: var(--label-2); font-variant-numeric: tabular-nums; white-space: nowrap; }

.small-print { display: grid; gap: 10px; padding: 10px 6px 0; font-size: 13px; line-height: 1.38; color: var(--label-2); }
.small-print h3 { font-size: 13px; font-weight: 600; color: var(--label); }
.small-print a { color: var(--accent); }
.small-print .tiny { font-size: 11px; }

/* ---------- sheets (finding, MOT test, welcome) and dialogs ---------- */
dialog {
  color: var(--label); background: transparent; border: 0; padding: 0; margin: 0;
  max-width: none; max-height: none; width: 100%; height: 100%; overflow: hidden;
}
dialog::backdrop { background: rgba(0, 0, 0, .32); }
dialog[open].is-open::backdrop { animation: fade .3s var(--ease) both; }
.sheet__panel {
  position: absolute; left: 0; right: 0; bottom: 0; margin: 0 auto; max-width: var(--maxw);
  max-height: calc(100% - 44px - env(safe-area-inset-top)); display: flex; flex-direction: column;
  background: var(--bg); border-radius: 14px 14px 0 0; overflow: hidden;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, .18);
  transform: translateY(100%); transition: transform .38s var(--spring);
}
dialog.is-open .sheet__panel { transform: translateY(0); }
.sheet__panel:focus { outline: none; }
.sheet__grab { width: 36px; height: 5px; border-radius: 3px; background: var(--label-3); margin: 6px auto 0; flex: none; }
.sheet__bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; height: 44px; padding: 0 8px; flex: none; }
.sheet__bar .bar__title { font-size: 17px; }
.sheet__body { overflow-y: auto; overscroll-behavior: contain; padding: 4px 20px calc(28px + env(safe-area-inset-bottom)); flex: 1; }
@media (min-width: 700px) {
  .sheet__panel { bottom: auto; top: 50%; border-radius: 16px; max-height: min(760px, 88vh); transform: translate(0, -44%) scale(.96); opacity: 0; transition: transform .3s var(--spring), opacity .2s; }
  dialog.is-open .sheet__panel { transform: translate(0, -50%); opacity: 1; }
  .sheet__grab { display: none; }
}
@keyframes fade { from { opacity: 0; } }

.detail { display: grid; gap: 20px; padding-top: 4px; }
.detail__top { display: flex; align-items: center; gap: 12px; }
.detail h2 { font-size: 22px; font-weight: 700; letter-spacing: -.02em; line-height: 1.22; }
.detail__text { font-size: 17px; line-height: 1.38; }
.panel { padding: 16px; border-radius: 18px; background: var(--fill); display: grid; gap: 8px; }
.panel__label { display: flex; align-items: center; gap: 7px; font-size: 15px; font-weight: 600; color: var(--label-2); }
.panel__label svg.i { font-size: 18px; }
.panel__price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; }
.panel__price b { font: 700 28px / 1.15 var(--rounded); font-variant-numeric: tabular-nums; }
.panel__price span { font-size: 15px; color: var(--label-2); }
.panel__note { font-size: 13px; line-height: 1.38; }
.panel__attr { font-size: 12px; line-height: 1.35; color: var(--label-2); }
.panel__quote { font-size: 13px; color: var(--label-2); line-height: 1.38; }
.panel--quote .panel__label { color: var(--label); }
.evidence { display: grid; gap: 12px; }
.evidence li b { display: block; font-size: 12px; font-weight: 600; }
.evidence li span { display: block; font-size: 13px; line-height: 1.35; color: var(--label-2); margin-top: 2px; }
.evidence li.plain span { color: var(--label); margin: 0; }

.list-group { margin-top: 20px; }
.list-group__head { padding: 0 16px 7px; font-size: 13px; color: var(--label-2); text-transform: uppercase; letter-spacing: .02em; }
.list-group__foot { padding: 7px 16px 0; font-size: 13px; color: var(--label-2); line-height: 1.35; }
.list-group .card > * + * { border-top: .5px solid var(--sep); }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; font-size: 16px; min-height: 44px; }
.defect { display: flex; align-items: baseline; gap: 10px; padding: 11px 16px; font-size: 15px; line-height: 1.35; }
.defect::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: none; transform: translateY(-1px); }

.welcome { display: grid; gap: 34px; padding: 40px 12px 8px; }
.welcome__head { display: grid; justify-items: center; gap: 18px; text-align: center; }
.welcome__head img { width: 92px; height: 92px; border-radius: 22px; box-shadow: 0 6px 12px rgba(0, 0, 0, .15); }
.welcome__head h2 { font-size: 34px; font-weight: 700; letter-spacing: -.025em; line-height: 1.1; }
.welcome__list { display: grid; gap: 26px; padding: 0 8px; }
.welcome__list li { display: flex; gap: 16px; align-items: flex-start; }
.welcome__list svg.i { font-size: 32px; width: 40px; color: var(--c); flex: none; }
.welcome__list b { display: block; font-size: 17px; font-weight: 600; }
.welcome__list span { display: block; font-size: 15px; color: var(--label-2); margin-top: 3px; line-height: 1.33; }
.welcome__foot { display: grid; gap: 14px; text-align: center; font-size: 13px; color: var(--label-2); padding: 8px 0 4px; }

.confirm__panel {
  position: absolute; left: 50%; top: 50%; width: min(300px, calc(100% - 48px));
  transform: translate(-50%, -50%) scale(1.08); opacity: 0; transition: transform .25s var(--spring), opacity .2s;
  background: var(--card); border-radius: 16px; overflow: hidden; text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
}
dialog.is-open .confirm__panel { transform: translate(-50%, -50%); opacity: 1; }
.confirm__text { padding: 20px 18px 16px; }
.confirm__text b { display: block; font-size: 17px; font-weight: 600; }
.confirm__text p { font-size: 13px; color: var(--label-2); margin-top: 6px; line-height: 1.35; }
.confirm__buttons { display: grid; grid-template-columns: 1fr 1fr; border-top: .5px solid var(--sep); }
.confirm__buttons button { min-height: 46px; font-size: 17px; color: var(--accent); }
.confirm__buttons button + button { border-left: .5px solid var(--sep); }
.confirm__buttons .is-destructive { color: var(--red); font-weight: 600; }

/* ---------- shortlist, compare, history ---------- */
.page-title { font-size: 34px; font-weight: 700; letter-spacing: -.025em; padding: 10px 4px 14px; }
.empty {
  min-height: 55svh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 10px; padding: 0 24px;
}
.empty > svg.i { font-size: 46px; color: var(--label-2); margin-bottom: 6px; stroke-width: 1.5; }
.empty h2 { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.empty p { color: var(--label-2); max-width: 320px; line-height: 1.38; }
.short-row { display: flex; align-items: center; gap: 14px; padding: 12px 8px 12px 16px; }
.short-row > a { flex: 1; min-width: 0; display: flex; align-items: center; gap: 14px; color: inherit; }
.short-row__text { min-width: 0; display: grid; gap: 5px; }
.short-row__car { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.short-row__label { font-size: 12px; font-weight: 500; color: var(--c); }
.icon-btn {
  width: 44px; height: 44px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-size: 20px; color: var(--label-2); flex: none;
}
.icon-btn:active { background: var(--fill); }
.deletable { display: flex; align-items: center; padding-right: 6px; }
.deletable > .check-row { flex: 1; min-width: 0; }
.icon-btn--star { color: var(--yellow); }
.icon-btn--delete { color: var(--red); }
.foot-note { padding: 8px 16px 0; font-size: 13px; color: var(--label-2); }

.compare { margin: 8px calc(-1 * var(--gutter)) 0; overflow-x: auto; scroll-snap-type: x proximity; scroll-padding-inline: var(--gutter); -webkit-overflow-scrolling: touch; }
.compare__cols { display: flex; gap: 12px; padding: 8px var(--gutter) 16px; width: max-content; }
.col {
  width: 176px; padding: 16px; border-radius: var(--r-card); background: var(--card); box-shadow: var(--shadow);
  display: grid; gap: 14px; align-content: start; scroll-snap-align: start;
}
.col__car { font-size: 15px; font-weight: 600; line-height: 1.25; min-height: 2.5em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 8px; }
.col .ring { justify-self: center; }
.col__label { text-align: center; font-size: 12px; font-weight: 600; color: var(--c); }
.col__best { text-align: center; font-size: 12px; font-weight: 600; color: var(--green); display: flex; align-items: center; justify-content: center; gap: 5px; }
.col__best[aria-hidden="true"] { visibility: hidden; }
.fact span { display: block; font-size: 11px; color: var(--label-2); }
.fact b { display: block; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; margin-top: 2px; color: var(--fc, var(--label)); }

/* ---------- settings ---------- */
.about { display: flex; align-items: center; gap: 14px; padding: 16px; }
.about img { width: 60px; height: 60px; border-radius: 14px; }
.about b { display: block; font-size: 17px; font-weight: 600; }
.about span { display: block; font-size: 15px; color: var(--label-2); margin-top: 3px; }
.about small { display: block; font-size: 12px; color: var(--label-3); margin-top: 3px; }
.settings-text { padding: 14px 16px; font-size: 15px; line-height: 1.4; }
.settings-row { display: flex; align-items: center; gap: 12px; padding: 0 16px; min-height: 48px; color: var(--label); font-size: 16px; width: 100%; text-align: left; }
.settings-row > svg.i:first-child { color: var(--accent); font-size: 20px; }
.settings-row > span:not(.chev):not(.value) { flex: 1; }
.settings-row .value { flex: none; color: var(--label-2); }
.settings-row--link { color: var(--accent); }
.settings-row--danger { color: var(--red); }
.settings-row:disabled { opacity: .4; }
.settings-small { padding: 12px 16px; font-size: 13px; color: var(--label-2); line-height: 1.4; }
.how-item { display: flex; gap: 14px; align-items: flex-start; padding: 12px 16px; }
.how-item svg.i { font-size: 24px; color: var(--accent); width: 30px; flex: none; }
.how-item b { display: block; font-size: 15px; font-weight: 600; }
.how-item span { display: block; font-size: 13px; color: var(--label-2); margin-top: 3px; line-height: 1.35; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 40;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  display: flex; align-items: center; gap: 14px; max-width: calc(100% - 32px);
  padding: 12px 16px; border-radius: 14px; background: rgba(28, 28, 30, .94); color: #fff; font-size: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25); transition: transform .3s var(--spring), opacity .25s;
}
.toast.is-shown { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.toast button { color: #6f9bff; font-weight: 600; }

/* ---------- motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: .32s; animation-timing-function: var(--ease); }
  html[data-nav="forward"]::view-transition-old(root) { animation-name: vtOutLeft; }
  html[data-nav="forward"]::view-transition-new(root) { animation-name: vtInRight; }
  html[data-nav="back"]::view-transition-old(root) { animation-name: vtOutRight; }
  html[data-nav="back"]::view-transition-new(root) { animation-name: vtInLeft; }
}
@keyframes vtOutLeft { to { opacity: 0; transform: translateX(-12%); } }
@keyframes vtInRight { from { opacity: 0; transform: translateX(18%); } }
@keyframes vtOutRight { to { opacity: 0; transform: translateX(18%); } }
@keyframes vtInLeft { from { opacity: 0; transform: translateX(-12%); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .spinner { animation: spin 2.4s linear infinite !important; }
}

/* ---------- wider screens ---------- */
@media (min-width: 700px) {
  .home__hero h1 { font-size: 44px; }
  .view { padding-top: 12px; }
}
