/* Patina: the "Service book" look. A car's service booklet on a workbench in light mode, the same booklet in a dim workshop
   in dark mode. One palette for the whole site (landing.css adds only the public pages' layout). Archivo is self-hosted
   (licence: fonts/Archivo-OFL.txt), no request to Google. Every text pair is >= 4.5:1 in both modes. */
@font-face { font-family: "Archivo"; font-style: normal; font-weight: 100 900; font-stretch: 62% 125%; font-display: swap;
  src: url("../fonts/archivo-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Archivo"; font-style: normal; font-weight: 100 900; font-stretch: 62% 125%; font-display: swap;
  src: url("../fonts/archivo-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --paper: #e9ecea; --sheet: #f7f8f6; --ink: #1c2321; --ink-2: #55605b; --rule: #c9cfcb;
  --stamp: #20409a; --stamp-text: #fff; --soft: #e2e7f3;
  --pos: #1d6a3b; --pos-bg: #dcece1; --neg: #8e2219; --neg-bg: #f6e3e1; --err-bg: var(--neg-bg); --err-ink: var(--neg);
  /* older names, used across the pages */
  --bg: var(--paper); --surface: var(--sheet); --text: var(--ink); --muted: var(--ink-2); --line: var(--rule);
  --accent: var(--stamp); --accent-strong: var(--stamp); --accent-text: var(--stamp-text); --err: var(--neg);
  --radius: 4px; --radius-sm: 4px; --shadow: none;
  --font: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif; --wide: 118%;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #151b1f; --sheet: #1d252a; --ink: #e4e9e6; --ink-2: #9aa6a1; --rule: #33403f;
    --stamp: #8fa8f0; --stamp-text: #0e1a3a; --soft: #232d44;
    --pos: #7fd3a0; --pos-bg: #1c3326; --neg: #f4a69d; --neg-bg: #3a2220;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 var(--font); font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased; }
/* Headings wide and heavy, sentence case. */
h1 { font-size: 1.9rem; line-height: 1.1; letter-spacing: -.015em; font-weight: 800; font-stretch: var(--wide); margin: 0; }
h2 { font-size: 1rem; line-height: 1.25; letter-spacing: -.01em; font-stretch: var(--wide); color: var(--text); font-weight: 750;
  margin: 0 0 .6rem; display: flex; gap: .5rem; align-items: baseline; }
a { color: var(--accent); }
.muted { color: var(--muted); }
a:focus-visible, button:focus-visible, summary:focus-visible, .btn:focus-visible { outline: 2px solid var(--stamp); outline-offset: 3px; border-radius: 2px; }

/* Top bar: a sheet with a ruled line under it; the current page is underlined in stamp blue. */
.topbar { display: flex; align-items: center; gap: .25rem 1.5rem; padding: 0 1rem; background: var(--surface);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; min-height: 3.5rem;
  padding-inline: max(1rem, calc((100% - 70rem) / 2)); }
/* The logo (templates/brand.html): outlined letters in the text colour, the bolt head over the i in stamp blue. */
.brand { display: block; text-decoration: none; color: var(--text); line-height: 0; }
.brand .logo { display: block; height: 1.6rem; width: auto; }
.brand .bolt { fill: var(--stamp); }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.topbar form { margin: 0; }
button.link { background: none; border: 0; color: var(--muted); font: inherit; font-size: .95rem; cursor: pointer; padding: .3rem; white-space: nowrap; }
button.link:hover { color: var(--text); }
.nav { display: flex; gap: 1.25rem; margin-right: auto; align-self: stretch; }
.nav a { display: flex; align-items: center; color: var(--muted); text-decoration: none; font-weight: 600; font-size: .95rem;
  border-bottom: 3px solid transparent; padding-top: 3px; white-space: nowrap; }
.nav a:hover { color: var(--text); }
.nav a[aria-current="page"] { color: var(--text); border-bottom-color: var(--stamp); }
/* Phones: brand and log out on top, the four links as a full-width row of tabs below. */
@media (max-width: 480px) {
  .topbar { flex-wrap: wrap; justify-content: space-between; padding: .5rem 1rem 0; gap: 0; }
  .nav { order: 3; flex-basis: 100%; justify-content: space-between; gap: .5rem; min-height: 2.75rem; margin: .25rem 0 0; }
  .nav a { font-size: .9rem; }
}

.page { padding: 1.5rem 1rem 3rem; max-width: 72rem; margin: 0 auto; }
.page.narrow { max-width: 36rem; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: .75rem; margin-bottom: 1.5rem; }

/* Buttons: small corners, no shadow; primary is solid stamp blue. */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; padding: .55rem 1.1rem;
  border-radius: 6px; border: 1.5px solid var(--ink); background: transparent; color: var(--text); font: inherit;
  font-weight: 650; font-size: .95rem; text-decoration: none; cursor: pointer; min-height: 44px; transition: border-color .12s, color .12s; }
.btn:hover { border-color: var(--stamp); color: var(--stamp); }
.btn.primary { background: var(--stamp); border-color: var(--stamp); color: var(--stamp-text); }
.btn.primary:hover { color: var(--stamp-text); filter: brightness(1.12); }

.empty { background: var(--surface); border: 1.5px dashed var(--line); border-radius: var(--radius);
  padding: 2rem 1.5rem; text-align: center; color: var(--muted); }
.count { color: var(--muted); font-size: .9rem; font-weight: 600; font-stretch: 100%; letter-spacing: 0; }

/* Board: three columns, each heading over a ruled line. */
.columns { display: grid; gap: 2rem; }
@media (min-width: 900px) { .columns { grid-template-columns: repeat(3, 1fr); gap: 1.5rem; } }
.column > h2 { border-bottom: 2px solid var(--ink); padding-bottom: .45rem; margin-bottom: .9rem; }

/* A car card is a small ledger page. */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: .9rem 1rem 1rem; margin-bottom: .75rem; }
.card-top { display: flex; justify-content: space-between; gap: .5rem; align-items: start; }
.title { font-size: 1.05rem; }
.card .title { font-stretch: var(--wide); font-weight: 750; line-height: 1.25; }
.card select { font: inherit; font-size: .82rem; font-weight: 600; padding: .25rem .5rem; border-radius: 6px;
  border: 1.5px solid var(--line); background: var(--surface); color: var(--text); min-height: 34px; cursor: pointer; }
.card select:hover { border-color: var(--stamp); }
.meta { margin: .3rem 0 .6rem; color: var(--muted); font-size: .85rem; display: flex; flex-wrap: wrap; gap: .25rem .75rem; align-items: center; }
.plate { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .8rem; font-weight: 600; border: 1.5px solid var(--text);
  border-radius: 3px; padding: 0 .35rem; color: var(--text); letter-spacing: .03em; }
.nums { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem .75rem; margin: 0; }
.nums dt { font-size: .75rem; color: var(--muted); font-weight: 550; }
.nums dd { margin: 0; font-weight: 600; }
.nums small { display: block; color: var(--muted); font-size: .75rem; font-weight: 450; }
.profit { font-weight: 750; }
.pos { color: var(--pos); } .neg { color: var(--neg); }

/* What the car has cost so far leads, as the ledger's total on a 2px ink rule. Profit is one of the small figures. */
.card .nums { grid-template-columns: repeat(3, 1fr); }
.nums > .hero-num { order: -1; grid-column: 1 / -1; border-bottom: 2px solid var(--ink); padding: .2rem 0 .5rem; margin-bottom: .2rem; }
.nums > .hero-num dt { font-size: .8rem; color: var(--text); font-weight: 650; }
.nums > .hero-num dd { font-size: 1.75rem; line-height: 1.1; letter-spacing: -.02em; font-weight: 800; font-stretch: 125%; }
.nums > .hero-num small { display: inline; margin-left: .35rem; font-size: .8rem; font-weight: 500; font-stretch: 100%; letter-spacing: 0; }

/* Sold cars fold away under a ruled heading with their total profit on the right. */
.sold { margin-top: 2rem; }
.sold summary { cursor: pointer; display: flex; gap: .5rem; align-items: baseline; padding: .5rem 0 .45rem; margin-bottom: .9rem;
  border-bottom: 2px solid var(--ink); font-size: 1rem; font-stretch: var(--wide); font-weight: 750; color: var(--text); }
.sold-total { margin-left: auto; font-weight: 750; font-stretch: 100%; font-size: .95rem; }
@media (min-width: 900px) { .sold[open] { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 1.5rem; }
  .sold summary { grid-column: 1 / -1; } }

/* Forms */
.form { display: grid; gap: 1rem; margin-top: 1.1rem; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.form label { display: grid; gap: .3rem; font-size: .82rem; color: var(--muted); font-weight: 550; }
.form input, .form textarea, .form select, .search input { font: inherit; font-size: 1rem; color: var(--text); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .6rem .75rem; min-height: 46px; width: 100%; }
.form input::placeholder, .form textarea::placeholder, .search input::placeholder { color: color-mix(in srgb, var(--muted) 60%, transparent); }
.form input:focus, .form textarea:focus, .form select:focus, .card select:focus, .search input:focus {
  outline: 3px solid color-mix(in srgb, var(--accent) 35%, transparent); outline-offset: 0; border-color: var(--accent); }
.form details { display: grid; gap: 1rem; }
.form details[open] > summary { margin-bottom: .9rem; }
.form summary { cursor: pointer; color: var(--accent); font-size: .92rem; font-weight: 600; }
.err { color: var(--err); font-size: .8rem; font-weight: 500; }
.err:empty { display: none; }
.actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: .5rem; }

/* Car page */
.back { display: inline-block; margin-bottom: .75rem; font-size: .9rem; text-decoration: none; font-weight: 550; color: var(--muted); }
.back:hover { color: var(--accent); }
.flash { background: var(--neg-bg); border: 1px solid color-mix(in srgb, var(--err) 40%, transparent);
  color: var(--err); border-radius: var(--radius-sm); padding: .65rem .85rem; margin: 0 0 1rem; }
.badge { background: var(--soft); color: var(--accent); border-radius: 6px; padding: .05rem .6rem; font-size: .78rem; font-weight: 600; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.notes { white-space: pre-wrap; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: .7rem .9rem; margin: .75rem 0; }
.summary { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: .9rem 1rem; margin: .9rem 0 1.5rem; grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr)); }
.summary dd { font-size: 1.1rem; }
.summary dt small { font-size: .7rem; }
.summary > .hero-num dd { font-size: 2rem; }
a.title { color: var(--text); font-weight: 700; text-decoration: none; letter-spacing: -.01em; }
a.title:hover { color: var(--accent); }

.section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .5rem; }
.section-head h2 { margin: 0; }
.exp-section { margin-bottom: 1.75rem; }
.exp-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.exp { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: .75rem .9rem; display: grid; grid-template-columns: 1fr auto; gap: .35rem .75rem; box-shadow: var(--shadow); }
.exp-main small, .exp-amt small { display: block; }
.exp-amt { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.exp-amt small { font-weight: 450; font-size: .75rem; }
.exp-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: .4rem; }
.exp-actions form { margin: 0; }
.exp-link { grid-column: 1 / -1; font-size: .8rem; overflow-wrap: anywhere; }
.qty { color: var(--muted); font-size: .9rem; margin-left: .25rem; }
.btn.small { padding: .25rem .8rem; min-height: 34px; font-size: .85rem; }
.btn.danger { color: var(--neg); }
.btn.danger:hover { border-color: var(--neg); }

.seg { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: 6px;
  overflow: hidden; background: var(--surface); padding: 3px; gap: 3px; }
.seg label { display: block; text-align: center; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: .5rem; color: var(--muted); font-size: .95rem; font-weight: 600; border-radius: 6px; }
.seg input:checked + span { background: var(--accent); color: var(--accent-text); }
.seg input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 1px; }

/* Part lookup + shops */
.search { display: flex; gap: .5rem; margin: 1rem 0; }
.search input { flex: 1; min-width: 0; width: auto; }
.term { margin: .25rem 0 .75rem; }
.shop-list { list-style: none; margin: 0 0 1.25rem; padding: 0; display: grid; gap: .5rem; }
.shop-link { display: flex; align-items: center; gap: .5rem; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: .8rem .95rem; min-height: 52px; color: var(--text); text-decoration: none;
  box-shadow: var(--shadow); transition: border-color .12s, transform .12s; }
.shop-link:hover { border-color: var(--accent); }
.shop-name { font-weight: 650; }
.shop-link .open { margin-left: auto; color: var(--accent); font-weight: 700; }
.badge.own { background: var(--accent); color: var(--accent-text); }
.found { background: var(--soft); border-radius: var(--radius); padding: .9rem 1rem; margin-bottom: 1rem; }
.found p { margin: 0 0 .6rem; font-weight: 600; }
.actions.left { justify-content: flex-start; margin-top: 0; }
.shop-row { display: flex; justify-content: space-between; align-items: center; gap: .75rem; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .7rem .95rem; }
.shop-row .url { display: block; overflow-wrap: anywhere; }
.shop-row form { margin: 0; }
.small { font-size: .85rem; }
/* Shop groups by region (own, worldwide, Europe-wide, countries); other countries start folded. */
.country-pick { margin: 1rem 0 1.25rem; gap: .4rem; }
.add-h { margin-top: 1.9rem; }
.manage { margin-top: 1.5rem; }
code { font-family: ui-monospace, "SF Mono", Menlo, monospace; background: var(--soft); border-radius: 5px; padding: 0 .35rem; }

/* Profit */
.chips { display: flex; gap: .4rem; flex-wrap: wrap; }
.chips a.on { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 650; }
.note { font-size: .85rem; margin: .25rem 0 1rem; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.narrow-table { max-width: 28rem; }
.table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.table th, .table td { padding: .65rem .85rem; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--line); }
.table th { font-size: .72rem; color: var(--muted); font-weight: 650; text-transform: uppercase; letter-spacing: .05em; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; }
.table .strong { font-weight: 700; }

/* Find your car */
.finder { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; display: grid; gap: .75rem; box-shadow: var(--shadow); }
.finder > label { display: grid; gap: .3rem; font-size: .82rem; color: var(--muted); font-weight: 550; }
.make-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.make-chips button, .pick { font: inherit; font-size: .85rem; font-weight: 550; color: var(--text); background: var(--bg); border: 1px solid var(--line);
  border-radius: 6px; padding: .35rem .85rem; min-height: 36px; cursor: pointer; }
.make-chips button:hover, .pick:hover { border-color: var(--accent); color: var(--accent); }
.picks { display: flex; flex-wrap: wrap; gap: .4rem; }
.pick-make { color: var(--muted); font-size: .8rem; margin-right: .25rem; }
.engines { display: grid; gap: .4rem; }
.engines-head { margin: 0 0 .15rem; }
.engine { display: flex; gap: .6rem; padding: .5rem .75rem; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: var(--bg); cursor: pointer; min-height: 46px; align-items: center; }
.engine:has(input:checked) { border-color: var(--accent); background: var(--soft); }
.engine input { width: auto; min-height: 0; margin: 0; accent-color: var(--accent); }
.engine-main { color: var(--text); font-size: .95rem; }
.engine small { margin-left: auto; }
.more { font-size: .9rem; }
.src { font-size: .8rem; margin: .25rem 0 0; }

/* Parts catalogue: engine buttons look like the link rows; article rows are not links. */
button.shop-link { width: 100%; font: inherit; color: inherit; text-align: left; cursor: pointer; flex-wrap: wrap; }
.art-list li { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .75rem; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .7rem .9rem; box-shadow: var(--shadow); }
.art-list .actions { margin-left: auto; }
.shop-link .badge { max-width: 100%; }

/* Car history: entries by year; services, purchase and sale get a coloured edge. */
.hist-year { margin-bottom: 1.5rem; }
.hist .exp-main { display: flex; flex-wrap: wrap; align-items: baseline; gap: .15rem .5rem; min-width: 0; }
.hist .exp-main > small:first-child { flex-basis: 100%; }
.hist-service { border-left: 3px solid var(--accent); }
.hist-bought, .hist-sold { border-left: 3px solid var(--muted); }
.danger-zone { margin: 2rem 0 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }

/* Board drag and drop: drop targets are dashed rules that turn stamp blue (sold: green) under the card. */
.card[draggable="true"] { cursor: grab; }
.card.dragging { opacity: .45; }
.column { min-height: 9rem; border-radius: var(--radius); transition: background .12s, outline-color .12s; outline: 2px dashed transparent; outline-offset: 6px; }
.column.over { background: color-mix(in srgb, var(--stamp) 6%, transparent); outline-color: var(--stamp); }
.drop-sold { display: none; margin-top: 1.25rem; padding: 1rem; text-align: center; font-weight: 650; color: var(--muted);
  border: 2px dashed var(--rule); border-radius: var(--radius); }
body.dragging .drop-sold { display: block; }
.drop-sold.over { border-color: var(--pos); color: var(--pos); background: var(--pos-bg); }

/* Cover photos */
.hero { position: relative; border-radius: var(--radius); overflow: hidden; margin-bottom: 1rem; background: var(--soft);
  aspect-ratio: 16 / 9; box-shadow: var(--shadow); }
.hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero.empty-photo { aspect-ratio: auto; min-height: 4.2rem; display: flex; align-items: center; justify-content: center;
  background: transparent; border: 2px dashed var(--line); box-shadow: none; }
.hero-actions { display: flex; gap: .4rem; position: absolute; right: .6rem; bottom: .6rem; }
.hero.empty-photo .hero-actions { position: static; }
.hero-actions form { margin: 0; }
.hero-actions .btn { background: color-mix(in srgb, var(--surface) 92%, transparent); }
.card .thumb { display: block; margin: -.9rem -1rem .75rem; aspect-ratio: 16 / 9; overflow: hidden; background: var(--soft);
  border-radius: var(--radius) var(--radius) 0 0; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.hero-credit { margin: -.5rem 0 1rem; line-height: 1.4; }
.hero-credit a { color: inherit; text-decoration: underline; }

/* Make / model dropdowns */
.is-hidden { display: none !important; }
.form .field { display: grid; gap: .3rem; align-content: start; }
.form .field > label { font-size: .82rem; color: var(--muted); font-weight: 550; }
.other-wrap { display: grid; gap: .25rem; }
.other-wrap .link { justify-self: start; color: var(--accent); }
.picks-head { flex-basis: 100%; margin: 0 0 .1rem; font-size: .8rem; }
/* The suggestions stay a small box however many models a make has. */
.picks { max-height: 12.5rem; overflow-y: auto; }
.form .field > label { display: block; }

.mileage { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: .25rem 0 .75rem; }
.mileage input { width: 8rem; }

.reminder-badge { font-size: .78rem; font-weight: 650; padding: 0 .45rem; border-radius: 3px; border: 1.5px solid var(--stamp); color: var(--stamp); }
.reminder-badge.overdue { border-color: var(--neg); color: var(--neg); background: var(--neg-bg); }
.rem .status { margin-left: .4rem; }
.rem-overdue .status { background: var(--neg-bg); color: var(--neg); }
.rem-ok .status { background: var(--pos-bg); color: var(--pos); }
.check { display: flex; align-items: center; gap: .5rem; margin-top: .5rem; }

.mark-done { display: flex; gap: .4rem; margin: 0; }
.mark-done input { width: 7rem; }

/* Saved parts on the part search: status above the shops, "Add price" fold-out under each shop link. */
.saved-status { margin: .75rem 0; }
.saved-status p { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin: 0; }
.add-price { margin: .25rem 0 .5rem; }
.add-price > summary { cursor: pointer; color: var(--accent); font-size: .85rem; font-weight: 600; }
.add-price form { display: grid; gap: .5rem; margin-top: .5rem; }
.add-price label { display: grid; gap: .2rem; font-size: .85rem; }
.save-one { display: inline; }
/* Car page: shop offers of a planned part and the "which offer did you take?" picker. */
.offers { margin-top: .25rem; font-size: .85rem; }
.offers > summary { cursor: pointer; color: var(--accent); }
.offers ul { list-style: none; padding: 0; margin: .35rem 0 0; display: grid; gap: .3rem; }
.offers li { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.buy-picker { display: inline-block; }
.buy-picker > summary { list-style: none; }
.buy-picker > summary::-webkit-details-marker { display: none; }
.buy-options { display: grid; gap: .35rem; margin-top: .4rem; }
.buy-options form { display: inline; }
/* Shopping list (/shopping): planned parts grouped by car. */
.shop-car h2 { display: flex; align-items: center; gap: .6rem; }
.shop-thumb { width: 48px; height: 36px; object-fit: cover; border-radius: 6px; }
/* Car page (Service book): head, the summary sheet, and each section as one ledger sheet ending in its total. */
.page.car { max-width: 40rem; }
.page.car h1 { font-size: clamp(1.8rem, 6vw, 2.3rem); margin-bottom: .4rem; }
.badge.stamp { background: transparent; border: 1.5px solid var(--stamp); color: var(--stamp); border-radius: 3px;
  padding: 0 .45rem; font-weight: 700; font-stretch: var(--wide); }
.car-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin: .9rem 0 0; }
.mileage input, .mark-done input { font: inherit; color: var(--text); background: var(--surface); border: 1.5px solid var(--rule);
  border-radius: 6px; padding: .35rem .6rem; min-height: 40px; }
.mark-done input { min-height: 34px; }
.mileage input:focus, .mark-done input:focus { outline: 2px solid var(--stamp); outline-offset: 1px; border-color: var(--stamp); }
.mileage input::placeholder, .mark-done input::placeholder { color: var(--muted); opacity: 1; }
.page.car .notes { border-left: 3px solid var(--rule); }
.summary { padding: 1rem 1.1rem 1.1rem; margin: 1.25rem 0 2rem; }
.exp-section { margin-bottom: 2rem; }
.section-head { border-bottom: 2px solid var(--ink); padding-bottom: .45rem; margin-bottom: .75rem; }
.section-head h2 { margin: 0; }
.exp-list.ledger { gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.exp-list.ledger:has(+ .ledger-total) { border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0; }
.ledger > .exp { background: none; border: 0; border-radius: 0; border-top: 1px solid var(--line); padding: .8rem 1rem .6rem; }
.ledger > .exp:first-child { border-top: 0; }
.ledger .exp-main strong { font-weight: 650; }
.ledger .exp-actions { gap: 0 1.1rem; align-items: center; }
.ledger-total { display: flex; align-items: baseline; gap: .6rem; margin: 0; padding: .65rem 1rem .75rem; background: var(--surface);
  border: 1px solid var(--line); border-top: 2px solid var(--ink); border-radius: 0 0 var(--radius) var(--radius); }
.ledger-total > span { margin-right: auto; font-weight: 650; }
.ledger-total strong { font-stretch: 125%; font-weight: 800; font-size: 1.35rem; letter-spacing: -.02em; line-height: 1.1; }
/* Quiet row actions: text links in stamp blue (danger in red); Bought and Mark done stay real buttons. */
.act { display: inline-flex; align-items: center; min-height: 36px; padding: 0; background: none; border: 0; font: inherit;
  font-size: .88rem; font-weight: 600; color: var(--stamp); text-decoration: none; cursor: pointer; }
.act:hover { text-decoration: underline; }
.act.danger { color: var(--neg); }
.ledger .btn.small.primary { margin-right: .2rem; }
.rem .badge.status { background: transparent; border: 1.5px solid currentColor; border-radius: 3px; padding: 0 .4rem; font-size: .75rem; }
.nums > .hero-num dd { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: .5rem; }
.nums > .hero-num dd small { margin-left: 0; white-space: nowrap; }
.page.car .summary { grid-template-columns: repeat(3, 1fr); }
/* Part search (Service book): shops and part lists as ledger sheets, regions as ruled headings, folded countries as rows. */
.search input { border: 1.5px solid var(--rule); border-radius: 6px; min-height: 48px; }
.search input:focus { outline: 2px solid var(--stamp); outline-offset: 1px; border-color: var(--stamp); }
.search .btn { min-height: 48px; }
.page.parts h2 { border-bottom: 2px solid var(--ink); padding-bottom: .45rem; margin: 1.75rem 0 .75rem; }
.chips a { display: inline-flex; align-items: center; border: 1px solid var(--line); color: var(--text); text-decoration: none; font-weight: 550; border-radius: 4px; background: var(--surface); min-height: 36px; padding: .25rem .7rem; font-size: .88rem; }
.chips a:hover { border-color: var(--stamp); color: var(--stamp); }
.region > summary { cursor: pointer; display: flex; gap: .5rem; align-items: baseline; list-style: none; text-transform: none; letter-spacing: -.01em; font-size: 1rem; font-weight: 750;
  font-stretch: var(--wide); color: var(--text); padding: .7rem 0 .55rem; border-bottom: 1px solid var(--line); margin: 0; }
.region > summary::-webkit-details-marker { display: none; }
.region > summary::after { content: "+"; margin-left: auto; color: var(--stamp); font-size: 1.35rem; line-height: 1; font-stretch: 100%; }
.region[open] > summary { border-bottom: 2px solid var(--ink); margin-bottom: .75rem; }
.region[open] > summary::after { content: "\2212"; }
.region:not([open]) { margin-bottom: 0; }
.region[open] { margin-bottom: 1.25rem; }
.shop-list.ledger { gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.shop-list.ledger > li { border-top: 1px solid var(--line); }
.shop-list.ledger > li:first-child { border-top: 0; }
.shop-list.ledger .shop-link { border: 0; border-radius: 0; background: none; padding: .8rem 1rem; }
.shop-list.ledger .shop-link:hover .shop-name { color: var(--stamp); }
.shop-list.ledger .add-price { margin: -.45rem 1rem .65rem; }
.shop-list.ledger .add-price > summary { list-style: none; display: inline-flex; min-height: 32px; align-items: center; }
.shop-list.ledger .add-price > summary::-webkit-details-marker { display: none; }
.shop-list.ledger .add-price form { padding: .25rem 0 .2rem; }
.shop-list.ledger .add-price input { font: inherit; color: var(--text); background: var(--bg); border: 1.5px solid var(--rule); border-radius: 6px; min-height: 40px; padding: .35rem .6rem; width: 100%; }
.shop-list.ledger .add-price input:focus { outline: 2px solid var(--stamp); outline-offset: 1px; border-color: var(--stamp); }
.art-list.ledger > li { background: none; border: 0; border-top: 1px solid var(--line); border-radius: 0; padding: .75rem 1rem; }
.art-list.ledger > li:first-child { border-top: 0; }
.art-list.ledger .actions { gap: .9rem; align-items: center; }
.ledger .badge:not(.stamp) { background: transparent; border: 1px solid var(--line); color: var(--muted); border-radius: 3px; padding: 0 .4rem; font-weight: 550; }
.page.parts .found { background: var(--surface); border: 1px solid var(--line); border-top: 2px solid var(--ink); border-radius: 0 0 var(--radius) var(--radius); margin-top: 1.5rem; }
.page.parts .manage { border-top: 1px solid var(--line); padding-top: 1rem; }
.chips a.on:hover { color: var(--stamp-text); }
/* Section headings on the list pages (overview, history years, shopping cars) sit over an ink rule. */
.exp-section > h2, .hist-year > h2, .shop-car > h2 { border-bottom: 2px solid var(--ink); padding-bottom: .45rem; margin: 0 0 .75rem; }
.hist-year, .shop-car { margin-bottom: 2rem; }
.shop-car > h2 a { color: var(--text); text-decoration: none; }
.shop-car > h2 a:hover { color: var(--stamp); }
.shop-thumb { border-radius: 3px; }
.shopping .ledger-total { margin-top: .5rem; border-radius: var(--radius); }
/* History: services and the purchase/sale keep a coloured edge inside the ledger. */
.ledger > .hist-service { box-shadow: inset 3px 0 var(--stamp); }
.ledger > .hist-bought, .ledger > .hist-sold { box-shadow: inset 3px 0 var(--muted); }
/* Overview: profit leads as the ledger total, the other figures in a ruled row. */
.summary.overview { grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); gap: .7rem 1rem; margin: 0 0 .75rem; }
.summary.overview dd small { display: block; }
.table th { font-size: .78rem; color: var(--muted); font-weight: 650; text-transform: none; letter-spacing: 0; }
.table td a { color: var(--text); font-weight: 600; text-decoration: none; }
.table td a:hover { color: var(--stamp); }
/* Forms: ink labels, 48px fields with a 1.5px rule and a stamp-blue focus, like the sign-in page. */
.form label, .form .field > label, .finder > label { color: var(--text); font-size: .9rem; font-weight: 650; }
.form label small, .form .field > label small { color: var(--muted); font-weight: 450; }
.form input, .form textarea, .form select { border: 1.5px solid var(--rule); border-radius: 6px; min-height: 48px; background: var(--surface); }
.form input[type="file"] { min-height: 0; padding: .55rem .6rem; }
.form input:focus, .form textarea:focus, .form select:focus, .card select:focus {
  outline: 2px solid var(--stamp); outline-offset: 1px; border-color: var(--stamp); }
.form input::placeholder, .form textarea::placeholder { color: var(--muted); opacity: 1; }
.form .actions { padding-top: 1rem; border-top: 1px solid var(--line); }
.form details > summary { list-style: none; display: flex; justify-content: space-between; gap: 1rem; color: var(--text); font-weight: 650;
  padding: .6rem 0; border-bottom: 1px solid var(--line); }
.form details > summary::-webkit-details-marker { display: none; }
.form details > summary::after { content: "+"; color: var(--stamp); font-size: 1.35rem; line-height: 1; }
.form details[open] > summary::after { content: "\2212"; }
.seg { border: 1.5px solid var(--rule); border-radius: 6px; padding: 3px; }
.seg span { border-radius: 4px; }
.seg input:checked + span { background: var(--stamp); color: var(--stamp-text); }
.seg input:focus-visible + span { outline: 2px solid var(--stamp); outline-offset: 2px; }
.finder { border-radius: var(--radius); }
.make-chips button, .pick { border-radius: 4px; background: var(--surface); }
.make-chips button:hover, .pick:hover { border-color: var(--stamp); color: var(--stamp); }
.engine { border-radius: 4px; background: var(--surface); }
.engine:has(input:checked) { border-color: var(--stamp); background: var(--surface); box-shadow: inset 3px 0 var(--stamp); }
.country-pick select { max-width: 20rem; }
.shop-list.ledger > .shop-row { border-width: 1px 0 0; border-radius: 0; background: none; padding: .75rem 1rem; }
.form input, .form textarea, .form select, .finder input { font-weight: 450; }
.ledger-total { flex-wrap: wrap; }
.ledger-total > span { white-space: nowrap; }
.ledger-total small { order: 3; flex-basis: 100%; text-align: right; }
.shop-row > .muted.small { white-space: nowrap; }
.shopping h1 { margin-bottom: 1.5rem; }
