/* ==========================================================================
   Garage — instrument-panel stylesheet
   Near-white paper ground, deep-green chrome, one green accent, hairlines
   instead of shadows. Inter is self-hosted — no third-party font requests.
   Everything below is driven by the token block; components never hard-code
   a colour, a radius, or a spacing value.
   ========================================================================== */

/* Inter (variable) — self-hosted under static/fonts, SIL Open Font License 1.1.
   Two faces only: upright + italic. Nothing is fetched from a third party. */
@font-face {
  font-family: "InterVariable";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/InterVariable.woff2") format("woff2");
}
@font-face {
  font-family: "InterVariable";
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/InterVariable-Italic.woff2") format("woff2");
}

:root {
  /* surfaces — near-white paper, a trace of warmth so it isn't clinical */
  --bg:        #F7F7F4;
  --surface:   #FFFFFF;
  --surface-2: #F4F4F0;
  --ink:       #1E211E;
  --ink-2:     #5B615B;
  --ink-3:     #8A8F89;
  --line:      #E3E3DC;

  /* chrome — the top bar. The same deep green for every vehicle; identity
     lives in the accent, so the bar stays quiet and the accent talks. */
  --chrome:     #0B3A28;
  --chrome-ink: #FFFFFF;

  /* accent — per-vehicle, Jaguar default */
  --accent:      #0D7D4D;
  --accent-ink:  #FFFFFF;
  --accent-soft: #0D7D4D14;
  --danger:      #7B2D26;
  --danger-soft: #7B2D2614;

  /* status — Okabe-Ito derived, CVD-safe, always paired with a label */
  --st-progress: #0D7D4D;   /* the live job wears the accent green */
  --st-queue:    #B26B00;
  --st-done:     #14532D;   /* pine — darker than the accent, never a fill */
  --st-cold:     #6B7570;

  /* geometry */
  /* the hairline defines the edge; the radius only softens it. Small. */
  --radius: 4px;
  --radius-s: 3px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;

  /* type */
  --font-ui: "InterVariable", Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "InterVariable", Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "IBM Plex Mono", "Cascadia Mono", SFMono-Regular, Menlo, monospace;

  --tap: 44px;              /* greasy-thumb floor */
  --ease: 170ms cubic-bezier(.2, .6, .3, 1);
}

/* --- per-vehicle identity: one token block swap ------------------------- */
:root[data-vehicle="camper"] {
  --bg: #F8F7F3;
  --surface: #FFFFFF;
  --surface-2: #F5F3EE;
  --line: #E6E4DB;
  --accent: #A8410F;          /* Hymer-stripe orange, darkened for contrast */
  --accent-soft: #A8410F14;
}
/* any vehicle without its own block gets a neutral slate accent */
:root[data-vehicle]:not([data-vehicle="xj40"]):not([data-vehicle="camper"]):not([data-vehicle=""]) {
  --accent: #4B5563;
  --accent-soft: #4B556314;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 24px;
  background: var(--bg);
  color: var(--ink);
}

a { color: var(--accent); }
h1, h2, h3 { line-height: 1.25; }

/* one focus style, app-wide */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-radius: var(--radius-s);
}

/* utilities */
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--font-mono); font-size: 13.5px; }
.ico {
  width: 18px; height: 18px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.75;
  stroke-linecap: round; stroke-linejoin: round;
}
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ==========================================================================
   Top bar — sticky graphite
   ========================================================================== */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-2) var(--space-4);
  background: var(--chrome);
  color: var(--chrome-ink);
}
.brand {
  display: inline-flex; align-items: center; gap: var(--space-2);
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -.02em;
  color: var(--chrome-ink);
  text-decoration: none;
  white-space: nowrap;
  padding: var(--space-1) var(--space-1);
}
.brand-mark { width: 24px; height: 24px; stroke-width: 1.6; }
.credit-mark { width: 15px; height: 15px; stroke-width: 1.7; vertical-align: -3px; margin-right: 5px; }
.login-card h1 .brand-mark { width: 30px; height: 30px; vertical-align: -5px; margin-right: var(--space-2); }

.veh-switch {
  width: auto; max-width: 40vw;
  min-height: 32px;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-s);
  background: rgba(255,255,255,.10);
  color: var(--chrome-ink);
  border: 1px solid rgba(255,255,255,.28);
  font: inherit; font-size: 13.5px; font-weight: 600;
}
.veh-switch option { color: var(--ink); background: var(--surface); }

.topbar nav { margin-left: auto; display: flex; align-items: center; gap: var(--space-1); }
.topbar nav > a {
  display: inline-flex; align-items: center;
  min-height: 36px; padding: 0 var(--space-3);
  color: rgba(255,255,255,.72);
  text-decoration: none;
  font-size: 15px; font-weight: 500;
  border-radius: var(--radius-s);
}
.topbar nav > a:hover { background: rgba(255,255,255,.08); color: var(--chrome-ink); }
/* the active tab is the one place the vehicle's accent shows in the chrome */
.topbar nav > a.active { background: var(--accent); color: var(--accent-ink); font-weight: 600; }

/* overflow menu (no framework — a <details> popover) */
.menu { position: relative; }
.menu > summary {
  list-style: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 40px; min-height: 36px;
  border-radius: var(--radius-s);
}
.menu > summary::-webkit-details-marker { display: none; }
.nav-more > summary { color: rgba(255,255,255,.72); }
.nav-more > summary:hover, .nav-more[open] > summary { background: rgba(255,255,255,.12); color: var(--chrome-ink); }
.menu-panel {
  position: absolute; right: 0; top: calc(100% + var(--space-2)); z-index: 40;
  min-width: 208px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(32,38,31,.16);   /* shadows survive on floating UI only */
  padding: var(--space-1);
  display: flex; flex-direction: column;
}
.menu-panel a,
.menu-panel button {
  display: flex; align-items: center; gap: var(--space-2);
  min-height: 40px; padding: 0 var(--space-3);
  background: none; border: 0; border-radius: var(--radius-s);
  font: inherit; font-size: 15px; color: var(--ink);
  text-decoration: none; text-align: left; cursor: pointer; width: 100%;
}
.menu-panel a:hover, .menu-panel button:hover { background: var(--accent-soft); }
.menu-panel .is-danger { color: var(--danger); }
.menu-panel .is-danger:hover { background: var(--danger-soft); }
.menu-panel hr { border: 0; border-top: 1px solid var(--line); margin: var(--space-1) var(--space-2); }
.menu-panel form { display: block; }

main { max-width: 880px; margin: 0 auto; padding: var(--space-5) var(--space-4) var(--space-7); }

/* ==========================================================================
   Type scale
   ========================================================================== */
.page-title {
  font-family: var(--font-display);
  font-size: 27px; line-height: 32px; font-weight: 650;
  letter-spacing: -.021em;
  margin: 0 0 var(--space-4);
}
.section-label {
  font-size: 12px; line-height: 16px;
  text-transform: uppercase; letter-spacing: .06em; font-weight: 600;
  color: var(--ink-2);
}
.meta { font-size: 13.5px; line-height: 20px; color: var(--ink-2); }
.muted-note { color: var(--ink-2); font-size: 13.5px; line-height: 20px; }
.hint {
  font-size: 13.5px; color: var(--ink-2);
  margin: 0 0 var(--space-3);
  padding: var(--space-2) var(--space-3);
  background: var(--surface-2); border-radius: var(--radius-s);
}

/* ==========================================================================
   Controls
   ========================================================================== */
select, input, textarea {
  font: inherit; font-size: 15px;
  min-height: var(--tap);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--surface);
  color: var(--ink);
  width: 100%;
}
textarea { resize: vertical; line-height: 24px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: var(--tap); padding: 0 var(--space-4);
  border: 1px solid var(--line); border-radius: var(--radius-s);
  background: var(--surface); color: var(--ink);
  font: inherit; font-size: 15px; font-weight: 500;
  text-decoration: none; cursor: pointer; text-align: center;
  transition: background var(--ease), border-color var(--ease);
}
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { background: var(--accent); filter: brightness(1.18); }
.btn.danger { color: var(--danger); border-color: var(--line); background: none; }
.btn.danger:hover { background: var(--danger); border-color: var(--danger); color: var(--surface); }
.btn.small { min-height: 36px; padding: 0 var(--space-3); font-size: 13.5px; }

/* icon buttons: 44px hit area, 18px glyph */
.iconbtn {
  display: inline-flex; align-items: center; justify-content: center;
  width: var(--tap); height: var(--tap);
  padding: 0;
  border: 1px solid var(--line); border-radius: var(--radius-s);
  background: var(--surface); color: var(--ink-2);
  cursor: pointer; text-decoration: none;
  transition: background var(--ease), color var(--ease), border-color var(--ease);
}
.iconbtn:hover { background: var(--surface-2); color: var(--ink); }
.iconbtn[disabled] { opacity: .4; cursor: default; }
.iconbtn.is-danger:hover { border-color: var(--danger); color: var(--danger); background: var(--danger-soft); }

/* ==========================================================================
   Badges — one component for job status, part status and review verdicts
   ========================================================================== */
.badge {
  display: inline-flex; align-items: center; gap: var(--space-1);
  font-size: 12px; line-height: 16px; font-weight: 600;
  padding: 2px var(--space-2); border-radius: 999px;
  white-space: nowrap;
  background: color-mix(in srgb, var(--tone) 12%, transparent);
  color: var(--tone);
  --tone: var(--ink-2);
}
.badge.tone-progress { --tone: var(--st-progress); }
.badge.tone-queue    { --tone: var(--st-queue); }
.badge.tone-done     { --tone: var(--st-done); }
.badge.tone-cold     { --tone: var(--st-cold); }
.badge.tone-ok       { --tone: var(--st-done); }
.badge.tone-wrong    { --tone: var(--danger); }
.badge.tone-have     { --tone: var(--st-progress); }
.badge.tone-check    { --tone: var(--st-queue); }
.badge.tone-note     { --tone: var(--ink-2); }
.badge.tone-to-order { --tone: var(--st-queue); }
.badge.tone-ordered  { --tone: var(--st-progress); }
.badge.tone-arrived  { --tone: var(--st-done); }

.chip {
  display: inline-block;
  font-size: 12px; line-height: 16px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .04em;
  /* neutral on purpose — the accent means "interactive", so the area label
     must not compete with the status badge beside it */
  background: var(--surface-2); color: var(--ink-2);
  border: 1px solid var(--line);
  padding: 1px var(--space-2); border-radius: var(--radius-s);
  white-space: nowrap;
}

/* ==========================================================================
   Stat tiles — flat, hairline, and clickable filters
   ========================================================================== */
.stats {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: var(--space-2); margin: 0 0 var(--space-4);
}
.stat {
  display: block;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: var(--space-3);
  text-decoration: none; color: inherit;
  transition: background var(--ease), border-color var(--ease);
}
a.stat:hover { border-color: var(--accent); background: var(--accent-soft); }
.stat.is-active { background: var(--accent-soft); border-color: var(--accent); }
.stat .num {
  display: block;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 21px; line-height: 28px; font-weight: 600;
  color: var(--accent);
  letter-spacing: -.01em;
}
.stat .lbl {
  display: block;
  font-size: 12px; line-height: 16px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--ink-2);
}

/* ==========================================================================
   Toolbar
   ========================================================================== */
.toolbar { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-4); }
.toolbar select { flex: 1 1 46%; }
.toolbar .btn { flex: 1 1 100%; }

/* ==========================================================================
   Job sections
   ========================================================================== */
.jobsec { margin-bottom: var(--space-6); }
.jobsec-h {
  display: flex; align-items: center; gap: var(--space-2);
  margin: 0 0 var(--space-3);
  font-size: 12px; line-height: 16px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--ink-2);
}
.jobsec-h .count { font-variant-numeric: tabular-nums; color: var(--ink-3); }
.jobsec-h .money { margin-left: auto; font-family: var(--font-mono); color: var(--accent); letter-spacing: 0; }

details.jobsec > summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; gap: var(--space-2);
  min-height: var(--tap);
  padding: 0 var(--space-3);
  margin-bottom: var(--space-3);
  background: var(--surface-2);
  border-radius: var(--radius);
  font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--ink-2);
}
details.jobsec > summary::-webkit-details-marker { display: none; }
details.jobsec > summary:hover { color: var(--ink); }
details.jobsec > summary .count { font-variant-numeric: tabular-nums; color: var(--ink-3); }
details.jobsec > summary .money { margin-left: auto; font-family: var(--font-mono); letter-spacing: 0; }
.disc { transition: transform var(--ease); }
details.jobsec[open] > summary .disc { transform: rotate(90deg); }

.tasks { display: flex; flex-direction: column; gap: var(--space-2); }

/* ==========================================================================
   Job cards — flat faces, crisp bezels
   ========================================================================== */
.task {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--st-cold);
  border-radius: var(--radius);
  display: flex; flex-direction: column;
  overflow: visible;
}
.task.st-starting    { border-left-color: var(--st-queue); }
.task.st-in-progress { border-left-color: var(--st-progress); }
.task.st-done        { border-left-color: var(--st-done); }
.task.st-cold-storage{ border-left-color: var(--st-cold); }
/* hierarchy: active work full strength, parked work receded (hover restores) */
.task.st-cold-storage { opacity: .78; }
.task.st-done { opacity: .62; }
.task.st-done:hover, .task.st-cold-storage:hover { opacity: 1; }
.task { transition: opacity var(--ease); }

.task-body { padding: var(--space-4); flex: 1 1 auto; min-width: 0; }
.task-top {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2);
  margin: calc(var(--space-2) * -1) calc(var(--space-2) * -1) 0;
  padding: var(--space-2);
  border-radius: var(--radius-s);
  text-decoration: none; color: inherit;
}
a.task-top:hover { background: var(--surface-2); }
.task-top .title {
  flex: 1 1 100%;
  font-size: 17px; line-height: 24px; font-weight: 600;
  letter-spacing: -.01em;
  color: var(--ink);
}
.task.st-done .task-top .title { color: var(--ink-2); }
.details { font-size: 15px; line-height: 24px; color: var(--ink-2); margin-top: var(--space-2); }
.details p { margin: var(--space-1) 0; }
.details > :first-child { margin-top: 0; }

.cc-flag {
  display: inline-flex; align-items: center; gap: var(--space-1);
  font-size: 12px; font-weight: 600;
  color: var(--danger); background: var(--danger-soft);
  border-radius: 999px; padding: 2px var(--space-2);
}
.cc-flag .ico { width: 14px; height: 14px; }

/* side rail — hairline divider, no tint */
.task-side {
  display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap;
  padding: var(--space-2) var(--space-4) var(--space-3);
  border-top: 1px solid var(--line);
}
.status-pick select {
  width: auto; min-height: 36px; padding: var(--space-1) var(--space-2);
  font-size: 13.5px; font-weight: 600;
  border-radius: 999px;
  background: color-mix(in srgb, var(--tone) 12%, var(--surface));
  border-color: color-mix(in srgb, var(--tone) 35%, var(--line));
  color: var(--tone);
  --tone: var(--ink-2);
}
.status-pick.tone-progress select { --tone: var(--st-progress); }
.status-pick.tone-queue    select { --tone: var(--st-queue); }
.status-pick.tone-done     select { --tone: var(--st-done); }
.status-pick.tone-cold     select { --tone: var(--st-cold); }
.status-pick select option { color: var(--ink); background: var(--surface); }

.task-total {
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  font-size: 15px; font-weight: 600; color: var(--accent);
}
.task-actions {
  display: flex; flex-wrap: wrap; justify-content: flex-end;
  gap: var(--space-2); margin-left: auto; align-items: center;
}
.task-actions form { display: inline-flex; }

/* per-card ⋮ menu — delete lives here, a deliberate distance from the arrows */
.card-menu > summary {
  width: var(--tap); height: var(--tap);
  border: 1px solid var(--line); border-radius: var(--radius-s);
  background: var(--surface); color: var(--ink-2);
}
.card-menu > summary:hover, .card-menu[open] > summary { background: var(--surface-2); color: var(--ink); }

/* service-book stamp on done jobs */
.stamp {
  display: inline-flex; align-items: center; gap: var(--space-1);
  font-family: var(--font-mono); font-size: 12px; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--st-done);
  border: 1.5px solid var(--st-done); border-radius: var(--radius-s);
  padding: 2px var(--space-2);
  transform: rotate(-1.5deg);
  opacity: .85;
}
.stamp.is-fresh { animation: stamp-in 200ms cubic-bezier(.2,.8,.3,1.2) both; }
@keyframes stamp-in {
  from { transform: scale(1.3) rotate(5deg); opacity: 0; }
  to   { transform: scale(1) rotate(-1.5deg); opacity: .85; }
}

.empty {
  color: var(--ink-2); font-size: 15px;
  padding: var(--space-6) var(--space-4); text-align: center;
  border: 1px dashed var(--line); border-radius: var(--radius);
}

/* ==========================================================================
   Parts table — one geometry everywhere
   ========================================================================== */
.ptable {
  width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed;
  margin: var(--space-3) 0 0; font-size: 13.5px;
}
.ptable col.c-sup { width: 7.5rem; }
.ptable col.c-price { width: 5.5rem; }
.ptable col.c-status { width: 7.5rem; }
.ptable td {
  padding: var(--space-2) var(--space-2);
  border-top: 1px solid color-mix(in srgb, var(--line) 50%, transparent);
  vertical-align: top;
}
.ptable tr:first-child td { border-top: 0; }
.ptable .c-name, .ptable .c-name a { word-break: break-word; }
.ptable .c-sup { text-align: left; }
.ptable .c-price {
  text-align: right; font-family: var(--font-mono);
  font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap;
}
.ptable .c-status { text-align: right; }
.ptable .c-status select { width: 100%; min-height: 36px; padding: var(--space-1) var(--space-2); font-size: 13.5px; }
.ptable tr.p-arrived .c-name { color: var(--ink-2); }
.ptable tr.p-arrived .c-price { font-weight: 500; color: var(--ink-2); }
.psup {
  display: inline-block; font-size: 12px; color: var(--ink-2);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 0 var(--space-2); white-space: nowrap;
}
.pnote { font-size: 12px; line-height: 16px; color: var(--ink-2); margin-top: var(--space-1); }

/* on a job card the table sits in an inset panel */
.task-body .ptable {
  background: var(--surface-2);
  border: 1px solid var(--line); border-radius: var(--radius-s);
  overflow: hidden;                /* clip the cell backgrounds to the radius */
}
.task-body .ptable tr:first-child td { padding-top: var(--space-3); }
.task-body .ptable tr:last-child td { padding-bottom: var(--space-3); }

/* ==========================================================================
   Notes — one component, on the card and on the edit page
   ========================================================================== */
.notes { margin-top: var(--space-3); }
.notes > summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap;
  min-height: 36px;
  font-size: 13.5px; color: var(--ink-2);
}
.notes > summary::-webkit-details-marker { display: none; }
.notes > summary:hover { color: var(--ink); }
.notes-add {
  margin-left: auto;
  border: 1px solid var(--line); border-radius: var(--radius-s);
  padding: var(--space-1) var(--space-2); background: var(--surface);
  font-size: 13.5px;
}
.notes > summary:hover .notes-add { border-color: var(--accent); color: var(--accent); }

.notes-list {
  list-style: none; margin: var(--space-3) 0; padding: var(--space-3);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-s);
  font-size: 15px;
}
.notes-list li + li { margin-top: var(--space-3); border-top: 1px solid var(--line); padding-top: var(--space-3); }
.notes-meta { display: flex; align-items: center; gap: var(--space-2); font-size: 12px; color: var(--ink-2); }
.notes-meta form { margin-left: auto; display: inline-flex; }
.notes-text { margin-top: var(--space-1); }
.notes-text p { margin: var(--space-1) 0; }
.notes-del {
  background: none; border: 0; color: var(--ink-3); cursor: pointer;
  width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-s);
}
.notes-del:hover { color: var(--danger); background: var(--danger-soft); }
.notes-del .ico { width: 14px; height: 14px; }
.notes-add-form { display: flex; gap: var(--space-2); align-items: flex-start; }
.notes-add-form textarea { flex: 1 1 auto; min-height: var(--tap); }

/* ==========================================================================
   Cards & forms
   ========================================================================== */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: var(--space-4);
}
.page-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-4); margin-bottom: var(--space-4);
}
.page-head .page-title { margin: 0; }
.page-head.end { justify-content: flex-end; }
.back { text-decoration: none; color: var(--ink-2); font-size: 13.5px; display: inline-flex; align-items: center; gap: var(--space-1); }
.back:hover { color: var(--accent); }

.form label { display: block; margin-bottom: var(--space-4); font-weight: 600; font-size: 13.5px; }
.form label small { font-weight: 400; color: var(--ink-2); }
.form label input, .form label select, .form label textarea { margin-top: var(--space-1); font-weight: 400; }
.row2 { display: grid; grid-template-columns: 1fr; gap: var(--space-4); }
.form-actions { display: flex; justify-content: flex-end; gap: var(--space-2); margin-top: var(--space-4); }

.field { margin-bottom: var(--space-4); }
.field-label { display: block; font-weight: 600; font-size: 13.5px; }

/* segmented status control */
.segmented { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-1); }
.segmented input { position: absolute; opacity: 0; width: 0; height: 0; }
.segmented span {
  display: inline-flex; align-items: center;
  min-height: var(--tap); padding: 0 var(--space-4);
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); cursor: pointer;
  font-size: 13.5px; font-weight: 600; color: var(--ink-2);
  transition: background var(--ease), border-color var(--ease), color var(--ease);
}
.segmented label:hover span { border-color: var(--ink-3); }
.segmented input:checked + span {
  background: color-mix(in srgb, var(--tone) 14%, var(--surface));
  border-color: var(--tone); color: var(--tone);
}
.segmented input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
.segmented .tone-progress { --tone: var(--st-progress); }
.segmented .tone-queue { --tone: var(--st-queue); }
.segmented .tone-done { --tone: var(--st-done); }
.segmented .tone-cold { --tone: var(--st-cold); }

/* part row editor */
.parts-edit { border: 1px solid var(--line); border-radius: var(--radius-s); padding: var(--space-3); margin: 0 0 var(--space-4); }
.parts-edit legend { font-weight: 600; font-size: 13.5px; padding: 0 var(--space-1); }
.part-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 90px 120px var(--tap);
  gap: var(--space-2); margin-bottom: var(--space-2); align-items: center;
}
.part-row input, .part-row select { min-height: var(--tap); }

/* ==========================================================================
   Prose (wiki / about)
   ========================================================================== */
.prose { line-height: 1.65; max-width: 68ch; }
.prose > :first-child { margin-top: 0; }
.prose h1 { font-family: var(--font-display); font-size: 27px; line-height: 32px; font-weight: 650; letter-spacing: -.021em; }
.prose h2 {
  font-family: var(--font-display); font-size: 20px; line-height: 28px; font-weight: 650; letter-spacing: -.017em;
  margin-top: var(--space-6); border-bottom: 1px solid var(--line); padding-bottom: var(--space-1);
}
.prose h3 { font-size: 17px; margin-top: var(--space-5); }
.prose code { background: var(--surface-2); padding: 1px var(--space-1); border-radius: var(--radius-s); font-family: var(--font-mono); font-size: .9em; }
.prose pre { background: var(--surface-2); padding: var(--space-3); border-radius: var(--radius-s); overflow-x: auto; }
.prose table { border-collapse: collapse; width: 100%; display: block; overflow-x: auto; font-size: 13.5px; }
.prose th, .prose td { border: 1px solid var(--line); padding: var(--space-2) var(--space-3); text-align: left; }
.prose blockquote {
  border-left: 3px solid var(--accent); margin: var(--space-4) 0;
  padding: var(--space-1) var(--space-4); color: var(--ink-2);
}
.about-prose > p:first-of-type { font-size: 17px; }
.about-prose blockquote { font-style: italic; }

/* spec plate — riveted VIN plate, once per vehicle */
.plate {
  position: relative;
  border: 1px solid var(--ink-3); border-radius: var(--radius-s);
  background-color: var(--surface-2);
  padding: var(--space-4) var(--space-5);
  margin-bottom: var(--space-4);
  max-width: 68ch;
}
/* four corner rivets */
.plate {
  background-image:
    radial-gradient(circle 2.5px at 10px 10px, var(--ink-3) 98%, transparent),
    radial-gradient(circle 2.5px at calc(100% - 10px) 10px, var(--ink-3) 98%, transparent),
    radial-gradient(circle 2.5px at 10px calc(100% - 10px), var(--ink-3) 98%, transparent),
    radial-gradient(circle 2.5px at calc(100% - 10px) calc(100% - 10px), var(--ink-3) 98%, transparent);
  background-repeat: no-repeat;
}
.plate-name {
  font-family: var(--font-display);
  font-size: 20px; line-height: 28px; font-weight: 650; letter-spacing: -.017em;
  margin: 0 0 var(--space-3);
}
.plate-rows { display: grid; gap: var(--space-1); margin: 0; }
.plate-row {
  display: flex; gap: var(--space-3); align-items: baseline;
  font-family: var(--font-mono); font-size: 12px; line-height: 16px;
  border-top: 1px solid var(--line); padding-top: var(--space-1);
}
.plate-row:first-child { border-top: 0; padding-top: 0; }
.plate-k { text-transform: uppercase; letter-spacing: .08em; color: var(--ink-2); min-width: 8.5rem; flex: none; }
.plate-v { color: var(--ink); font-weight: 600; word-break: break-word; }

/* ==========================================================================
   Wiki index
   ========================================================================== */
.wiki-index { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.wiki-index li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.wiki-index a {
  display: flex; align-items: center; gap: var(--space-3);
  min-height: var(--tap); padding: var(--space-2) var(--space-4);
  text-decoration: none; font-weight: 600; color: var(--ink);
}
.wiki-index a:hover { background: var(--surface-2); }
.wiki-num { font-family: var(--font-mono); font-size: 12px; color: var(--ink-3); flex: none; }
.wiki-index li.empty { border-style: dashed; }

/* ==========================================================================
   Parts page
   ========================================================================== */
.bucket { margin-bottom: var(--space-6); }
.bucket-h {
  display: flex; align-items: baseline; gap: var(--space-2); flex-wrap: wrap;
  margin: 0 0 var(--space-4);
  font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
  color: var(--ink-2);
}
.bucket-h .count { margin-left: auto; font-family: var(--font-mono); color: var(--accent); letter-spacing: 0; text-transform: none; }
.bucket.b-postponed, .bucket.b-done { opacity: .68; }
.bucket.b-postponed:hover, .bucket.b-done:hover { opacity: 1; }
.bucket { transition: opacity var(--ease); }
.job-parts { margin-bottom: var(--space-5); }
.job-parts-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.job-parts-head .title { font-size: 17px; font-weight: 600; letter-spacing: -.01em; text-decoration: none; color: var(--ink); }
.job-parts-head .title:hover { text-decoration: underline; }
.job-parts-head .job-sub {
  margin-left: auto; font-family: var(--font-mono); font-size: 12px;
  font-variant-numeric: tabular-nums; color: var(--ink-2);
}

/* ==========================================================================
   Comments card (job edit page) — shares the notes component
   ========================================================================== */
.comments { margin-top: var(--space-4); }
.comments-h { font-size: 17px; margin: 0 0 var(--space-3); }
.comment-add textarea { margin-bottom: var(--space-2); }

/* ==========================================================================
   Vehicles page
   ========================================================================== */
.veh-manage { list-style: none; margin: 0 0 var(--space-5); padding: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.veh-manage li { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.veh-current { border-left: 4px solid var(--accent); }
.veh-rename { display: flex; gap: var(--space-2); align-items: center; flex: 1 1 260px; }
.veh-actions { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; margin-left: auto; }
.veh-id { font-family: var(--font-mono); font-size: 12px; color: var(--ink-2); }
.veh-cats { flex: 1 1 100%; }
.veh-cats > summary, .veh-spec > summary {
  cursor: pointer; font-size: 13.5px; color: var(--ink-2);
  min-height: 36px; display: flex; align-items: center; gap: var(--space-2);
}
.veh-cats > summary:hover, .veh-spec > summary:hover { color: var(--accent); }
.veh-cats form, .veh-spec form { padding-top: var(--space-2); }
.veh-cats .btn, .veh-spec .btn { margin-top: var(--space-2); }
.veh-spec { flex: 1 1 100%; }
.veh-add { margin-top: var(--space-4); }

/* ==========================================================================
   Activity log
   ========================================================================== */
.log-day { margin-bottom: var(--space-5); }
.log-day-h { margin: 0 0 var(--space-2); }
.logfeed { list-style: none; margin: 0; padding: 0; }
.logfeed li {
  display: flex; gap: var(--space-3); align-items: baseline;
  padding: var(--space-2) 0;
  border-top: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
  font-size: 13.5px; line-height: 20px;
}
.logfeed li:first-child { border-top: 0; }
.log-ts {
  color: var(--ink-3); font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  white-space: nowrap; font-size: 12px; min-width: 3.2rem; flex: none;
}

/* ==========================================================================
   Share page
   ========================================================================== */
.share-box { display: flex; gap: var(--space-2); margin: var(--space-3) 0; flex-wrap: wrap; }
.share-box input { flex: 1 1 16rem; font-family: var(--font-mono); font-size: 13.5px; background: var(--surface-2); }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-credit { text-align: center; color: var(--ink-2); font-size: 12px; padding: var(--space-6) var(--space-4); }
.site-credit a { color: var(--accent); text-decoration: none; font-weight: 600; }
.site-credit a:hover { text-decoration: underline; }
.site-credit.promo { border-top: 1px solid var(--line); margin-top: var(--space-5); }
.site-credit.promo p { margin: var(--space-1) 0; }
.promo-line { font-size: 15px; font-weight: 600; color: var(--ink); }
.promo-cta {
  display: inline-flex; align-items: center; min-height: 32px; padding: 0 var(--space-3);
  background: var(--accent); color: var(--accent-ink) !important; border-radius: var(--radius-s);
}
.promo-cta:hover { text-decoration: none !important; filter: brightness(1.18); }

/* ==========================================================================
   Login
   ========================================================================== */
.login-wrap { max-width: 380px; margin: 12vh auto 0; padding: var(--space-4); }
.login-card { text-align: center; }
.login-card h1 {
  font-family: var(--font-display); font-weight: 650; letter-spacing: -.021em;
  color: var(--ink); margin: 0 0 var(--space-5); font-size: 28px; line-height: 32px;
}
.login-card label { display: block; text-align: left; font-weight: 600; font-size: 13.5px; margin-bottom: var(--space-4); }
.login-card label input { margin-top: var(--space-1); font-weight: 400; }
.login-card .btn { width: 100%; }
.login-error { color: var(--danger); font-size: 13.5px; margin: 0 0 var(--space-3); }
.login-card .site-credit { padding: var(--space-4) 0 0; }

/* ==========================================================================
   Mechanic review link (standalone page, same tokens)
   ========================================================================== */
.rv-top { max-width: 860px; margin: 0 auto; padding: var(--space-6) var(--space-4) 0; }
.rv-top h1 { font-family: var(--font-display); font-size: 27px; line-height: 32px; font-weight: 650; letter-spacing: -.021em; margin: 0 0 var(--space-2); }
.rv-intro { color: var(--ink-2); margin: 0 0 var(--space-4); max-width: 68ch; }
.rv-stats {
  display: flex; gap: var(--space-5); flex-wrap: wrap; font-size: 13.5px; color: var(--ink-2);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: var(--space-3) 0;
}
.rv-stats strong { font-family: var(--font-mono); font-variant-numeric: tabular-nums; color: var(--accent); }
.rv-main { max-width: 860px; margin: 0 auto; padding: 0 var(--space-4) var(--space-7); }
.rv-sec {
  font-size: 12px; text-transform: uppercase; letter-spacing: .06em; font-weight: 600;
  color: var(--ink-2); margin: var(--space-6) 0 var(--space-3);
}
.rv-sec span { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--ink-3); }
.rv-job {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: var(--space-4); margin-bottom: var(--space-2);
}
.rv-job-h { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.rv-job-h h3 { margin: 0; font-size: 17px; line-height: 24px; font-weight: 600; letter-spacing: -.01em; flex: 1 1 auto; }
.rv-details { color: var(--ink-2); margin: var(--space-2) 0 0; }
.rv-details p { margin: var(--space-1) 0; }
.rv-feedback {
  list-style: none; margin: var(--space-3) 0 0; padding: var(--space-3);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-s);
  font-size: 13.5px;
}
.rv-feedback li + li { margin-top: var(--space-3); border-top: 1px solid var(--line); padding-top: var(--space-3); }
.rv-ts { color: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.rv-fb-text { margin-top: var(--space-1); white-space: pre-wrap; }
.rv-add { margin-top: var(--space-3); }
.rv-add > summary {
  cursor: pointer; font-size: 13.5px; color: var(--ink-2);
  min-height: 36px; display: flex; align-items: center;
}
.rv-add > summary:hover { color: var(--accent); }
.rv-add form { margin-top: var(--space-3); }
.rv-verdicts { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-3); }
.rv-v input { position: absolute; opacity: 0; width: 0; height: 0; }
.rv-v span {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 var(--space-3);
  border: 1px solid var(--line); border-radius: 999px;
  font-size: 13.5px; font-weight: 600; cursor: pointer; background: var(--surface); color: var(--ink-2);
  transition: background var(--ease), border-color var(--ease), color var(--ease);
}
.rv-v input:checked + span {
  background: color-mix(in srgb, var(--tone) 14%, var(--surface));
  border-color: var(--tone); color: var(--tone);
}
.rv-v input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
.rv-v .tone-ok { --tone: var(--st-done); }
.rv-v .tone-wrong { --tone: var(--danger); }
.rv-v .tone-have { --tone: var(--st-progress); }
.rv-v .tone-check { --tone: var(--st-queue); }
.rv-v .tone-note { --tone: var(--ink-2); }
.rv-submit { display: flex; gap: var(--space-2); margin-top: var(--space-2); flex-wrap: wrap; }
.rv-submit input { flex: 1 1 12rem; }
.rv-submit .btn { flex: 0 0 auto; }
.rv-done { margin-top: var(--space-6); }
.rv-done > summary {
  cursor: pointer; color: var(--ink-2); font-size: 13.5px; margin-bottom: var(--space-3);
  min-height: 36px; display: flex; align-items: center;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 620px) {
  .ptable col.c-sup { width: 0; }
  .ptable .c-sup { display: none; }
  .ptable col.c-price { width: 4.6rem; }
  .ptable col.c-status { width: 6.2rem; }
  .ptable td { padding: var(--space-3) var(--space-2); }

  /* the fixed 6-column part editor is unusable at this width — stack it */
  .part-row {
    grid-template-columns: 1fr 1fr var(--tap);
    padding-bottom: var(--space-3);
    margin-bottom: var(--space-3);
    border-bottom: 1px solid var(--line);
  }
  .part-row .pr-name, .part-row .pr-url, .part-row .pr-note { grid-column: 1 / -1; }

  .topbar { padding: var(--space-2) var(--space-3); gap: var(--space-2); }
  .brand { font-size: 19px; }
  .veh-switch { max-width: 32vw; }
  .topbar nav > a { padding: 0 var(--space-2); font-size: 14px; }
  main { padding: var(--space-4) var(--space-3) var(--space-7); }
}

@media (min-width: 620px) {
  .stats { grid-template-columns: repeat(4, 1fr); }
  .toolbar select { flex: 1 1 0; width: auto; min-width: 0; }
  .toolbar .btn { flex: 0 0 auto; margin-left: auto; }
  .row2 { grid-template-columns: 1fr 1fr; }
  .task { flex-direction: row; }
  .task-side {
    flex-direction: column; align-items: flex-end;
    border-top: none; border-left: 1px solid var(--line);
    min-width: 196px; justify-content: flex-start;
    padding: var(--space-4);
  }
  .task-actions { margin-left: 0; }
  .log-ts { min-width: 7.5rem; }
}

/* the leaper alone carries the wordmark once space runs out */
@media (max-width: 520px) {
  .brand-word { display: none; }
  .topbar nav > a { padding: 0 var(--space-2); }
}

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