/* Chesil Motor Works demo, v2 design system: "quiet precision", Lynch Lane edition.
   Calm, premium, product-grade. Warm white paper, graphite ink, Lynch Lane orange (--accent #fd7b03 for fills and
   graphics, --brand for text and links so contrast holds).
   The realistic UK number plate is the ONLY loud object and the main control on both sides.
   No hazard stripes, no shouting capitals, no cartoon art. Sentence case everywhere. */
:root {
  --bg: #f6f6f3; --surface: #ffffff; --surface-2: #efefeb; --surface-3: #e4e4de;
  --ink: #0e1116; --ink-2: #4a515c; --ink-3: #7b828d; --line: #e2e2dc; --line-strong: #cfcfc7;
  --brand: #c85a00; --brand-hover: #a94c00; --brand-ink: #ffffff; --brand-soft: #fff0e2; --accent: #fd7b03;
  --plate: #f7cf1d; --plate-ink: #0b0b0b; --plate-edge: #0b0b0b; --gb: #1a3a94;
  --good: #14804a; --good-soft: #def3e6; --warn: #a15c07; --warn-soft: #fbeed3; --crit: #c0312f; --crit-soft: #fbe1e0;
  --shadow: 0 1px 2px rgba(14,17,22,.04), 0 6px 20px rgba(14,17,22,.06);
  --shadow-lg: 0 2px 6px rgba(14,17,22,.06), 0 24px 60px rgba(14,17,22,.14);
  --r-sm: 10px; --r: 14px; --r-lg: 22px;
  --ease: cubic-bezier(.2,.7,.2,1);
  --font-display: 'Manrope', 'Helvetica Neue', Arial, sans-serif;
  --font-body: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  --font-plate: 'Barlow Condensed', 'Arial Narrow', Arial, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
  --gutter: 16px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0d11; --surface: #13161c; --surface-2: #1a1e26; --surface-3: #242a34;
    --ink: #f1f2f4; --ink-2: #a6adb8; --ink-3: #79818d; --line: #232830; --line-strong: #343b46;
    --brand: #ff9a3d; --brand-hover: #ffb46b; --brand-ink: #1a0f02; --brand-soft: #3a240c; --accent: #fd7b03;
    --good: #4fca88; --good-soft: #12301f; --warn: #f0ab45; --warn-soft: #37290f; --crit: #f47774; --crit-soft: #3b1716;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 20px rgba(0,0,0,.3);
    --shadow-lg: 0 2px 6px rgba(0,0,0,.5), 0 24px 60px rgba(0,0,0,.55);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b0d11; --surface: #13161c; --surface-2: #1a1e26; --surface-3: #242a34;
  --ink: #f1f2f4; --ink-2: #a6adb8; --ink-3: #79818d; --line: #232830; --line-strong: #343b46;
  --brand: #ff9a3d; --brand-hover: #ffb46b; --brand-ink: #1a0f02; --brand-soft: #3a240c; --accent: #fd7b03;
  --good: #4fca88; --good-soft: #12301f; --warn: #f0ab45; --warn-soft: #37290f; --crit: #f47774; --crit-soft: #3b1716;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 20px rgba(0,0,0,.3);
  --shadow-lg: 0 2px 6px rgba(0,0,0,.5), 0 24px 60px rgba(0,0,0,.55);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font-body); font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; line-height: 1.1; letter-spacing: -.025em; margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
img, svg { max-width: 100%; }
a { color: var(--brand); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-2); }
.wrap { max-width: 1160px; margin-inline: auto; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 46px; padding: 0 1.25em; border-radius: 99px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink); font-weight: 600; font-size: 1rem; cursor: pointer; text-decoration: none;
  transition: transform .12s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.btn:hover { border-color: var(--ink-3); }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn--primary:hover { border-color: var(--ink); box-shadow: 0 6px 18px rgba(14,17,22,.22); transform: translateY(-1px); }
.btn--brand { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn--brand:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn--plate { background: var(--plate); border-color: var(--plate-edge); color: var(--plate-ink); }
.btn--plate:hover { filter: brightness(1.04); border-color: var(--plate-edge); }
.btn--ghost { background: transparent; }
.btn--sm { min-height: 36px; padding: 0 .8em; font-size: .9rem; border-radius: 99px; }
.btn--lg { min-height: 54px; padding: 0 1.5em; font-size: 1.1rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* forms */
.field { display: grid; gap: 6px; min-width: 0; }
.field > label, .label { font-size: .86rem; font-weight: 600; color: var(--ink-2); }
.input, .select, .textarea {
  width: 100%; min-height: 46px; padding: 0 12px; border-radius: var(--r-sm);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
}
.textarea { padding: 10px 12px; min-height: 96px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px var(--brand-soft); }

/* cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; min-width: 0; }
.card--flat { background: var(--surface-2); border-color: transparent; }
.card--lift { box-shadow: var(--shadow); }

/* pills and status */
.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 99px;
  font-size: .8rem; font-weight: 600; white-space: nowrap; background: var(--surface-2); color: var(--ink-2);
}
.pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill--good { background: var(--good-soft); color: var(--good); }
.pill--warn { background: var(--warn-soft); color: var(--warn); }
.pill--crit { background: var(--crit-soft); color: var(--crit); }
.pill--brand { background: var(--brand-soft); color: var(--brand); }
.pill--plain::before { display: none; }

/* UK number plate. Use .plate (rear, yellow) or .plate.plate--front (white). */
.plate {
  display: inline-flex; align-items: stretch; background: var(--plate); color: var(--plate-ink);
  border: 2px solid var(--plate-edge); border-radius: 9px; overflow: hidden; box-shadow: inset 0 1px 0 rgba(255,255,255,.55), 0 1px 2px rgba(0,0,0,.2), 0 10px 30px rgba(14,17,22,.14);
  font-family: var(--font-plate); font-weight: 700; text-transform: uppercase; letter-spacing: .07em; line-height: 1;
}
.plate--front { background: #fff; }
.plate .gb {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: var(--gb); color: #fff; padding: 0 .5em; font-size: .34em; letter-spacing: .08em; min-width: 2.1em;
}
.plate .gb i { display: block; width: 1.5em; height: 1.5em; border-radius: 50%; border: 2px dotted #f6c90e; opacity: .95; }
.plate .chars { display: flex; align-items: center; padding: .12em .45em .12em .4em; font-size: 1em; }
.plate input.chars {
  background: transparent; border: 0; outline: none; color: inherit; font: inherit; letter-spacing: inherit; text-transform: uppercase;
  width: 7.2em; min-width: 0; padding: .1em .35em; caret-color: var(--plate-ink);
}
.plate input.chars::placeholder { color: rgba(17, 17, 17, .35); }

/* job tag (the card on the garage board) uses the same hanging-tag shape on the customer tracker */
.tag-ref { font-family: var(--font-mono); font-size: .82rem; font-weight: 600; letter-spacing: .02em; color: var(--ink-2); }

/* toast */
.toasts { position: fixed; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 8px; z-index: 90; max-width: min(380px, calc(100vw - 32px)); }
.toast {
  background: var(--ink); color: var(--bg); padding: 12px 16px; border-radius: var(--r); box-shadow: var(--shadow-lg);
  font-weight: 500; animation: toast-in .25s ease both; display: flex; gap: 10px; align-items: flex-start;
}
.toast b { font-weight: 700; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }

/* the demo switcher pill and ribbon, shown on both pages */
.demo-bar {
  position: sticky; top: 0; z-index: 80; display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; justify-content: space-between;
  margin-inline: calc(-1 * max(var(--gutter), env(safe-area-inset-left, 0px)));
  padding: 8px max(var(--gutter), env(safe-area-inset-right, 0px)) 8px max(var(--gutter), env(safe-area-inset-left, 0px));
  background: #0e1116; color: #f1f2f4; font-size: .85rem;
}
.demo-bar a { color: inherit; }
.demo-bar .seg { display: inline-flex; background: rgba(255, 255, 255, .14); border-radius: 99px; padding: 3px; }
.demo-bar .seg a { padding: 4px 14px; border-radius: 99px; text-decoration: none; font-weight: 600; }
.demo-bar .seg a[aria-current="page"] { background: #fff; color: #0e1116; }
.demo-bar small { opacity: .85; }

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