/* The bike-computer look: flat, near-black, thin lines, one orange accent,
   numbers in a monospace font, and a faint topo map behind everything. */
:root {
  --bg: #0b0d0e;
  --card: rgba(19, 22, 25, 0.94);     /* a touch see-through so the topo map shows faintly */
  --card-solid: #131619;
  --card-2: #1b2024;
  --line: #23292d;
  --line-2: #2e353a;
  --text: #e9edef;
  --muted: #8b969c;
  --accent: #ff6a13;
  --on-accent: #0b0d0e;               /* dark text on orange */
  --ok: #3ddc84;
  --soon: #ffb020;
  --due: #ff5a4e;
  /* Older names, kept so every page still works. All flat now, no gradients. */
  --orange: var(--accent);
  --green: var(--ok);
  --yellow: var(--soon);
  --red: var(--due);
  --gloss: none;
  /* Fonts: Russo One for headings, Rubik for text, a monospace for numbers. */
  --font-head: "Russo One", system-ui, sans-serif;
  --font-body: "Rubik", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --head-weight: 400;          /* Russo One comes in one weight only */
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }   /* hidden always wins over .card, .row, etc. */
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
}
/* The topo map: fixed behind the page, very faint (the lines are drawn at 5-9% in topo.svg). */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: url("topo.svg") center / cover no-repeat;
}
a { color: inherit; text-decoration: none; }
.page { max-width: 480px; margin: 0 auto; padding: 16px 20px 104px; }

h1, h2 { font-family: var(--font-head); font-weight: var(--head-weight, 700); line-height: 1.1; margin: 0; }
h1 { font-size: 27px; letter-spacing: 0; }
/* h2 is a small HUD-style label, like a bike computer's field names. */
h2 { font-family: var(--font-body); font-size: 11px; font-weight: 600; letter-spacing: 1.4px; text-transform: uppercase; color: var(--muted); margin: 24px 0 8px; }
.cap { font-size: 10px; font-weight: 600; letter-spacing: 1.4px; text-transform: uppercase; color: var(--muted); }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.back { display: inline-flex; align-items: center; min-height: 44px; color: var(--accent); font-weight: 600; font-size: 14px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stack { display: flex; flex-direction: column; gap: 8px; }

.card {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
}
.card.big { padding: 14px; }
.card.row { display: flex; }
a.card:hover { border-color: var(--line-2); }
.chip {
  border: 1px solid var(--line-2);
  border-radius: 4px;
  padding: 1px 7px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.badge {
  color: var(--on-accent);
  border-radius: 3px;
  padding: 1px 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.badge.due { background: var(--due); }
.badge.soon { background: var(--soon); }
.badge.ok { background: var(--ok); }
.badge.check { background: var(--line-2); color: var(--text); }
.big-num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 26px; font-weight: 700; line-height: 1; letter-spacing: -0.5px; }

/* Segmented bars: little blocks, like a battery gauge. */
.bar { display: flex; gap: 2px; height: 6px; margin-top: 14px; }
.bar > *, .side-bar > *, .seg {
  display: block; height: 6px;
  background: repeating-linear-gradient(90deg, currentColor 0 6px, transparent 6px 8px);
}
.bar .due, .side-bar .due, .seg.due { color: var(--due); }
.bar .soon, .side-bar .soon, .seg.soon { color: var(--soon); }
.bar .ok, .side-bar .ok, .seg.ok { color: var(--ok); }
.seg { min-width: 6px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 16px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: var(--accent);
  color: var(--on-accent);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.btn:hover { filter: brightness(1.08); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn.full { width: 100%; }
.btn.quiet { background: transparent; border-color: var(--line-2); color: var(--text); font-weight: 600; }
.btn.quiet:hover { background: var(--card-2); filter: none; }
.btn.pill { min-height: 44px; }

label { display: block; margin: 0 0 6px; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: 0.3px; }
input, select, textarea {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border-radius: 6px;
  border: 1px solid var(--line-2);
  background: var(--card-solid);
  color: var(--text);
  font: inherit;
  font-size: 16px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
textarea { padding: 12px 14px; min-height: 72px; resize: vertical; }
.field { margin-bottom: 14px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }

/* Segmented choices (radio buttons that look like buttons). */
.choices { display: flex; gap: 6px; flex-wrap: wrap; }
.choices input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choices label {
  flex: 1;
  margin: 0;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border-radius: 6px;
  border: 1px solid var(--line-2);
  background: var(--card-solid);
  color: var(--text);
  font-size: 14px;
  letter-spacing: 0;
  cursor: pointer;
}
.choices input:checked + label { background: var(--card-2); border-color: var(--accent); color: var(--text); font-weight: 700; box-shadow: inset 0 -2px 0 var(--accent); }
.choices input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }

/* On/off switch built from a checkbox. */
.switch { display: inline-flex; align-items: center; gap: 8px; margin: 0; color: var(--text); cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 52px; height: 32px; border-radius: 16px; background: var(--card-2); border: 1px solid var(--line-2); padding: 2px; display: flex; }
.switch .knob { width: 26px; height: 26px; border-radius: 13px; background: var(--muted); }
.switch input:checked + .track { background: var(--accent); border-color: transparent; justify-content: flex-end; }
.switch input:checked + .track .knob { background: var(--on-accent); }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }

.notice { background: var(--card); border: 1px solid var(--line-2); border-left: 3px solid var(--accent); border-radius: 8px; padding: 12px 14px; }
.flash { background: var(--card-solid); border: 1px solid var(--line-2); border-left: 3px solid var(--due); border-radius: 8px; padding: 10px 14px; margin-bottom: 12px; }
.inline-form { display: inline; margin: 0; }

/* The bike drawing and its wear pins. */
.bike-view { position: relative; width: 100%; aspect-ratio: 1000 / 556; }
.bike-img { display: block; width: 100%; height: 100%; transition: transform 0.25s; user-select: none; -webkit-user-drag: none; opacity: 0.45; filter: grayscale(1); }
.bike-view[data-side="brake"] .bike-img { transform: scaleX(-1); }
/* Pins are small tags: dark fill, status-colored outline and number. */
.pin {
  position: absolute;
  transform: translate(-50%, -50%);
  min-width: 36px; height: 22px;
  padding: 0 5px;
  border-radius: 4px;
  border: 1.5px solid currentColor;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.pin::before { content: ""; position: absolute; inset: -11px -4px; }   /* a bigger area to tap */
.pin[hidden] { display: none; }   /* pins for the other side of the bike */
.pin.ok { color: var(--ok); }
.pin.soon { color: var(--soon); }
.pin.due { color: var(--due); background: #2a0f0d; }
.pin.check { color: var(--muted); }
.pin:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pin.new { animation: pin-pulse 1.2s ease-in-out 4; outline: 2px solid var(--accent); outline-offset: 3px; }
@keyframes pin-pulse { 50% { transform: translate(-50%, -50%) scale(1.2); } }
@media (prefers-reduced-motion: reduce) { .pin.new { animation: none; } }
.bike-view.editing .pin { cursor: grab; touch-action: none; outline: 1.5px dashed var(--accent); outline-offset: 2px; }
.bike-view.editing .pin.dragging { cursor: grabbing; z-index: 2; transform: translate(-50%, -50%) scale(1.15); }

/* Fold-open sections on the bike page. */
details.section { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 2px; }
details.section > summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  cursor: pointer;
}
details.section > summary::-webkit-details-marker { display: none; }
details.section > summary::after {
  content: "";
  width: 7px; height: 7px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg);
  margin: -4px 4px 0 0;
  transition: transform 0.15s;
}
details.section[open] > summary::after { transform: rotate(225deg); margin-top: 4px; }
details.section > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.section-title {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--muted);
}
.section-peek { margin-left: auto; color: var(--muted); font-family: var(--font-mono); font-size: 11px; font-weight: 500; }
details.section[open] { padding-bottom: 6px; }

nav.tabs {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  display: flex;
  height: 72px;
  padding-bottom: env(safe-area-inset-bottom);
  border-top: 1px solid var(--line);
  background: rgba(11, 13, 14, 0.96);
}
nav.tabs a { flex: 1; display: flex; flex-direction: column; gap: 4px; align-items: center; justify-content: center; color: var(--muted); font-weight: 600; font-size: 11px; }
nav.tabs a svg { width: 22px; height: 22px; }
nav.tabs a.active { color: var(--accent); }

/* Tick-box rows on the suggested parts page. */
label.pick, label.card.pick { display: flex; align-items: center; gap: 12px; margin: 0; color: var(--text); font-size: 15px; font-weight: 400; letter-spacing: 0; cursor: pointer; min-height: 60px; }
.pick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pick > span:last-child { display: flex; flex-direction: column; gap: 2px; }
.pick-box { flex: none; width: 24px; height: 24px; border-radius: 4px; border: 1.5px solid var(--line-2); background: var(--card-solid); }
.pick input:checked + .pick-box { background: var(--accent); border-color: transparent; position: relative; }
.pick input:checked + .pick-box::after { content: ""; position: absolute; left: 7px; top: 2px; width: 6px; height: 12px; border-right: 2.5px solid var(--on-accent); border-bottom: 2.5px solid var(--on-accent); transform: rotate(45deg); }
.pick input:focus-visible + .pick-box { outline: 2px solid var(--accent); outline-offset: 2px; }
.pick:has(input:not(:checked)) .pick-name { color: var(--muted); }

/* Compact buttons, like + Ride and + Bike beside the garage title. */
.title-fit { white-space: nowrap; font-size: clamp(24px, 7vw, 28px); }
.btn.small-btn { min-height: 36px; padding: 0 12px; font-size: 14px; white-space: nowrap; }

/* The bike drawing section: always open, no fold arrow. */
.section.always-open { margin-top: 16px; }
.section-head { display: flex; align-items: center; gap: 10px; min-height: 36px; }
.section-head .section-title { margin: 0; line-height: 1; }

/* Color key under the bike drawing. */
.legend { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; margin-top: 8px; color: var(--muted); font-family: var(--font-mono); font-size: 11px; }
.legend span { display: flex; align-items: center; gap: 6px; }
.legend .dot { width: 8px; height: 8px; border-radius: 1px; }
.legend .dot.ok { background: var(--ok); }
.legend .dot.soon { background: var(--soon); }
.legend .dot.due { background: var(--due); }

/* Drive side / Non-drive side: one segmented control, a gauge in each half. */
.side-row { gap: 0 !important; border: 1px solid var(--line-2); border-radius: 6px; overflow: hidden; }
.side-row .btn.side-btn { border: 0; border-radius: 0; }
.side-row .side-col + .side-col .side-btn { border-left: 1px solid var(--line-2); }
.btn.side-btn {
  flex-direction: column; align-items: flex-start; gap: 6px; min-height: 52px; padding: 8px 12px;
  background: transparent; color: var(--muted); font-size: 13px; font-weight: 600;
}
.btn.side-btn:not(.quiet) { background: var(--card-2); color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }
.btn.side-btn:hover { filter: none; }
.side-bar { display: flex; gap: 2px; width: 100%; height: 6px; }


/* Garage. */
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); }
.metrics > div { padding: 10px 12px; min-width: 0; }
.metrics > div + div { border-left: 1px solid var(--line); }
.metric-num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 22px; font-weight: 700; line-height: 1.2; white-space: nowrap; }
.metric-num small { font-size: 11px; color: var(--muted); font-weight: 500; }
.metric-num.due { color: var(--due); }
.metric-num.soon { color: var(--soon); }
.list { border: 1px solid var(--line); border-radius: 8px; background: var(--card); overflow: hidden; }
.list > a, .list > .list-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.list > * + * { border-top: 1px solid var(--line); }
.list > a:hover { background: var(--card-2); }
.stripe { width: 3px; align-self: stretch; border-radius: 2px; background: var(--line-2); flex: none; }
.stripe.due { background: var(--due); }
.stripe.soon { background: var(--soon); }
.list-main { flex: 1; min-width: 0; }
.list-main strong { display: block; font-size: 15px; font-weight: 600; }
.list-sub { display: block; font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.list-end { width: 72px; text-align: right; flex: none; }
.list-end .big-num { font-size: 20px; }
.pct-due { color: var(--due); }
.pct-soon { color: var(--soon); }
.pct-ok { color: var(--ok); }
.bike-row-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.bike-row-head strong { font-size: 16px; font-weight: 700; }
.counts { margin-top: 6px; font-family: var(--font-mono); font-size: 11px; color: var(--muted); letter-spacing: 0.3px; }
.more-link { display: inline-block; margin-top: 8px; color: var(--accent); font-size: 13px; font-weight: 600; }

/* Older garage pieces (drawings with dots), kept flat in case they come back. */
.attn { border-left: 3px solid var(--line-2); }
.attn.due { border-left-color: var(--due); }
.attn.soon { border-left-color: var(--soon); }
.garage-bike { position: relative; aspect-ratio: 1000 / 556; margin-top: 10px; }
.garage-bike img { display: block; width: 100%; height: 100%; opacity: 0.45; filter: grayscale(1); }
.dot-pin { position: absolute; width: 10px; height: 10px; border-radius: 2px; transform: translate(-50%, -50%); }
.dot-pin.ok { background: var(--ok); }
.dot-pin.soon { background: var(--soon); }
.dot-pin.due { background: var(--due); }

/* Fold-open card, like "Still has life left?" on a job page. */
details.fold > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; min-height: 32px; cursor: pointer; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::after { content: "+"; color: var(--accent); font-family: var(--font-mono); font-size: 20px; font-weight: 700; }
details.fold[open] > summary::after { content: "–"; }

/* Suggested parts: what shape each part is in. */
.part-card { padding: 12px 14px; }
.part-body { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.cond-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.cond-row:has(.cond-date:not([hidden])) { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.readout { margin: 6px 0 0; color: var(--accent); font-family: var(--font-mono); font-size: 12px; }
.readout:empty { display: none; }
details.each-job { margin-top: 8px; }
details.each-job > summary { cursor: pointer; color: var(--accent); font-size: 13px; font-weight: 600; min-height: 32px; display: flex; align-items: center; }
.job-row { margin-top: 10px; padding-left: 10px; border-left: 1px solid var(--line-2); }
.job-name { display: block; font-weight: 700; margin-bottom: 4px; }
.sealant-warning { margin-top: 8px; }

/* Service parts groups (Suspension, Brakes, ...): one list, a row per system. */
details.group { margin: 0; border: 1px solid var(--line); border-radius: 0; background: var(--card); }
details.group + details.group { border-top: 0; }
details.group:first-of-type { border-radius: 8px 8px 0 0; }
details.group:last-of-type { border-radius: 0 0 8px 8px; }
details.group:only-of-type { border-radius: 8px; }
details.group > summary {
  list-style: none; display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 14px; cursor: pointer;
}
details.group > summary::-webkit-details-marker { display: none; }
details.group > summary::after {
  content: ""; width: 7px; height: 7px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg); margin: -4px 2px 0 4px; transition: transform 0.15s;
}
details.group[open] > summary::after { transform: rotate(225deg); margin-top: 4px; }
details.group > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
details.group > .stack { padding: 0 8px 8px; }
details.group > .stack .card { background: var(--card-solid); }
.group-name { font-weight: 600; }
.group-worst { margin-left: auto; font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-weight: 700; font-size: 18px; }
.group-dot { flex: none; width: 3px; height: 26px; border-radius: 2px; }
.group-dot.ok { background: var(--ok); }
.group-dot.soon { background: var(--soon); }
.group-dot.due { background: var(--due); }
.group-dot.check { background: var(--line-2); }
details.group:has(.group-dot.ok) .group-worst { color: var(--ok); }
details.group:has(.group-dot.soon) .group-worst { color: var(--soon); }
details.group:has(.group-dot.due) .group-worst { color: var(--due); }

/* Guide page. */
.lead { font-size: 16px; line-height: 1.5; color: var(--text); margin: 10px 0 16px; }
.guide-quick { border-left: 3px solid var(--accent); }
.guide-kicker { font-size: 11px; font-weight: 600; letter-spacing: 1.4px; text-transform: uppercase; color: var(--accent); }
.guide-steps { margin: 10px 0 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; line-height: 1.45; }
.guide-steps li::marker { color: var(--accent); font-family: var(--font-mono); font-weight: 700; }
.kbd { display: inline-block; padding: 0 6px; border-radius: 4px; background: var(--card-2); border: 1px solid var(--line-2); font-family: var(--font-mono); font-weight: 700; font-size: 12px; }
.guide-color { justify-content: flex-start; gap: 14px; }
.dot-big { flex: none; width: 4px; height: 32px; border-radius: 2px; }
.dot-big.ok { background: var(--ok); }
.dot-big.soon { background: var(--soon); }
.dot-big.due { background: var(--due); }
.guide-body { line-height: 1.5; }
.guide-body p { margin: 0 0 8px; }
.guide-body ul { margin: 0 0 6px; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.guide-body li::marker { color: var(--accent); }

/* Delete warnings. */
.danger-box { background: var(--card); border: 1px solid #5a211c; border-left: 3px solid var(--due); border-radius: 8px; padding: 12px 14px; }
.danger-title { color: var(--due); }
.btn.danger { background: var(--due); color: var(--on-accent); }
.btn.danger:disabled { opacity: 0.4; cursor: not-allowed; }
.edit-chip { display: inline-block; margin-top: 4px; color: var(--accent); font-size: 12px; font-weight: 600; }

/* "Logging a different job on this tire?" links on Log a service. */
.other-jobs { margin: 4px 0 14px; }
.other-jobs-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.chip-link {
  display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border-radius: 6px;
  border: 1px solid var(--line-2); color: var(--accent); font-size: 13px; font-weight: 600;
}

/* Spending: three totals across, and purchase rows. */
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
/* Spending totals: shrink to fit the column on a phone, wrap rather than overlap */
.spend-grid > div { min-width: 0; }
.spend-num { font-size: clamp(15px, 4.6vw, 24px); letter-spacing: -0.8px; overflow-wrap: anywhere; line-height: 1.1; margin-top: 2px; }
.purchase-row { padding: 6px 0; border-bottom: 1px solid var(--line); }
.purchase-row:last-child { border-bottom: 0; }

/* Charts (static/charts.js). Colors: blue past/services, aqua now/parts, violet average/per mile, orange yours. */
.chart-wrap { position: relative; }
.chart-svg { display: block; width: 100%; height: auto; overflow: visible; font-family: var(--font-mono); }
.chart-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-bottom: 8px; color: var(--muted); font-size: 12px; }
.chart-legend span, .chart-subtitle { display: inline-flex; align-items: center; gap: 6px; }
.chart-subtitle { margin: 14px 0 6px; color: var(--muted); font-size: 12px; }
.swatch { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.swatch-line { width: 16px; height: 0; display: inline-block; }
.chart-tip {
  position: absolute; z-index: 5; pointer-events: none; padding: 8px 10px; border-radius: 6px;
  background: var(--card-2); border: 1px solid var(--line-2); color: var(--text); font-size: 12px; line-height: 1.4;
  white-space: nowrap;
}
.chart-range { flex-wrap: nowrap; gap: 4px; }
.chart-range .btn.small-btn { min-height: 32px; padding: 0 10px; font-size: 12px; flex: none; }

details.more-purchases > summary { cursor: pointer; color: var(--accent); font-size: 13px; font-weight: 600; min-height: 36px; display: flex; align-items: center; }

/* Suspension settings sliders. */
.susp-card { margin-bottom: 10px; }
.susp-row { padding: 10px 0; border-top: 1px solid var(--line); }
.susp-label { margin: 0; color: var(--text); font-size: 14px; font-weight: 600; flex: 1; letter-spacing: 0; }
.susp-value { font-family: var(--font-mono); font-size: 16px; font-weight: 700; white-space: nowrap; }
.susp-value .muted { font-family: var(--font-body); font-size: 12px; font-weight: 500; }
.susp-value .type-in { width: 4.6em; min-height: 36px; padding: 2px 6px; text-align: right; font-family: var(--font-mono); font-size: 16px; font-weight: 700; }
.susp-switch .track, .susp-sound .track { width: 44px; height: 26px; }
.susp-switch .knob, .susp-sound .knob { width: 20px; height: 20px; }
/* Custom slider so the handle lines up with the ticks: the handle is 22px, so ticks sit 11px in from each end. */
.susp-slide { margin-top: 8px; }
.susp-slider {
  -webkit-appearance: none; appearance: none; display: block;
  width: 100%; height: 28px; min-height: 0; margin: 0; padding: 0; border: 0; background: transparent; cursor: pointer;
}
.susp-slider::-webkit-slider-runnable-track {
  height: 4px; border-radius: 2px;
  background: linear-gradient(to right, var(--accent) var(--fill, 50%), var(--line-2) var(--fill, 50%));
}
.susp-slider::-moz-range-track { height: 4px; border-radius: 2px; background: var(--line-2); }
.susp-slider::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--accent); }
.susp-slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 22px; height: 22px; margin-top: -9px; border-radius: 50%;
  background: var(--text); border: 4px solid var(--accent);
}
.susp-slider::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--text); border: 4px solid var(--accent); }
.susp-slider:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 6px; }
.susp-ticks { position: relative; height: 22px; margin: 0 11px; }
.susp-ticks .tick { position: absolute; top: 0; width: 1px; height: 5px; margin-left: -0.5px; background: var(--line-2); }
.susp-ticks .tick.major { height: 9px; background: var(--muted); }
.susp-ticks .tick em {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%);
  font-style: normal; font-family: var(--font-mono); font-size: 10px; color: var(--muted); white-space: nowrap;
}
details.susp-log { margin-top: 8px; }
details.susp-log > summary { cursor: pointer; color: var(--accent); font-size: 13px; font-weight: 600; min-height: 36px; display: flex; align-items: center; }

/* "i" buttons beside each suspension setting, and what they open. */
.info-btn {
  flex: none; width: 22px; height: 22px; padding: 0; border-radius: 50%;
  border: 1px solid var(--line-2); background: transparent; color: var(--muted);
  font: 700 12px/1 var(--font-mono); cursor: pointer; position: relative;
}
.info-btn::before { content: ""; position: absolute; inset: -11px; }    /* a bigger area to tap */
.info-btn[aria-expanded="true"] { border-color: var(--accent); color: var(--accent); }
.info-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.susp-help { margin: 8px 0 2px; padding: 8px 10px; border-left: 2px solid var(--accent); background: var(--card-2); border-radius: 0 6px 6px 0; color: var(--text); line-height: 1.45; }

/* Past setups: one block each, a grid of values with what changed. */
.setup { padding: 12px 0; border-top: 1px solid var(--line); }
.setup:target { background: var(--card-2); }
.setup-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 6px; margin-top: 10px; }
.setup-val { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.setup-val small { font-size: 10px; color: var(--muted); font-weight: 500; }
.setup-delta { font-size: 10px; color: var(--accent); }
.feel-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.feel-row .small { flex-basis: 100%; }
.feel-btn {
  min-height: 32px; padding: 0 10px; border-radius: 6px; border: 1px solid var(--line-2);
  background: transparent; color: var(--muted); font: 600 12px var(--font-body); cursor: pointer;
}
.feel-btn.on { color: var(--on-accent); border-color: transparent; }
.feel-btn.on.good { background: var(--ok); }
.feel-btn.on.ok { background: var(--soon); }
.feel-btn.on.bad { background: var(--due); }
.feel-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* "Loaded the ... setup" message with Undo, and the save-first question. */
.load-msg { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 6px 0; padding: 8px 10px; border-left: 2px solid var(--accent); background: var(--card-2); border-radius: 0 6px 6px 0; }
.load-msg .btn { min-height: 32px; flex: none; }
.load-ask { margin-top: 10px; }
.choices.two-up { display: grid; grid-template-columns: 1fr 1fr; }

/* A part's own drawing on its job page (part_art.py), with a tag per job. */
.part-art { position: relative; margin-top: 14px; aspect-ratio: 350 / 236; border: 1px solid var(--line); border-radius: 8px; background: var(--card); overflow: hidden; }
.part-art svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.art-grid { stroke: var(--card-2); stroke-width: 1; }
.art-tag {
  position: absolute; transform: translate(-50%, -50%); padding: 2px 6px; border-radius: 4px;
  background: var(--bg); border: 1.5px solid currentColor; white-space: nowrap;
  font-family: var(--font-mono); font-size: 10px; font-weight: 700; line-height: 1.3;
}
.art-tag::before { content: ""; position: absolute; inset: -10px -4px; }    /* a bigger area to tap */
.art-tag.ok { color: var(--ok); }
.art-tag.soon { color: var(--soon); }
.art-tag.due { color: var(--due); }
.art-tag.check { color: var(--muted); }
.art-tag.current { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px currentColor; }
.art-tag:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.art-fig { position: absolute; left: 8px; bottom: 6px; font-family: var(--font-mono); font-size: 9px; letter-spacing: 1px; color: var(--muted); opacity: .8; pointer-events: none; }

/* "Measure it" gauge on pad, rotor and chain jobs. */
.measure-pic { display: block; width: 100%; height: auto; margin-top: 8px; }
.measure-ruler { display: block; width: 100%; height: auto; margin-top: 6px; overflow: visible; }
.measure-value { font-size: 30px; }
.measure-verdict { font-weight: 700; text-align: right; }

/* New-bike setup: which step you're on. */
.steps { margin: 12px 0 14px; }
.steps-bar { display: flex; gap: 4px; margin-top: 6px; }
.steps-bar span { flex: 1; padding-top: 6px; border-top: 3px solid var(--line-2); font-size: 11px; font-weight: 600; color: var(--muted); }
.steps-bar span.done { border-color: var(--accent); }
.steps-bar span.now { border-color: var(--accent); color: var(--text); }
.measure-job { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }

/* Cockpit setup page. */
.cockpit-art { aspect-ratio: 350 / 130; margin-top: 12px; }
.tire-art { aspect-ratio: 350 / 120; margin-top: 12px; }
.cockpit-group { margin: 16px 0 2px; padding-top: 10px; border-top: 1px solid var(--line-2); color: var(--accent); }
.susp-number { margin-top: 6px; font-family: var(--font-mono); }
.measure-extend { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.measure-replace { margin: 12px 0 0; padding-top: 12px; border-top: 1px solid var(--line); }

/* Log in and sign up. */
.auth { max-width: 380px; margin: 0 auto; }
/* The WearHouse name and mark (templates/_logo.html) on the login pages and the Garage title. */
.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; font-family: var(--font-head); font-weight: var(--head-weight); font-size: 22px; color: var(--text); }
.brand-title { display: flex; align-items: center; gap: 8px; }
.logo-mark { flex: none; display: block; }
/* Help and ideas (templates/_help.html): mail buttons that wrap to one per line on narrow phones. */
.help-buttons { gap: 8px; }
.help-buttons .btn { white-space: normal; text-align: center; line-height: 1.2; min-height: 44px; }
@media (max-width: 360px) { .help-buttons { grid-template-columns: 1fr; } }

/* "+ 18 more due or soon" on the garage: tap to show the rest. */
/* Garage "Needs attention": the extra rows open inside the same list, so it stays one list. */
.list > .more-row { display: block; padding: 0; }
.list > .more-row[hidden] { display: none; }
.list > .more-row > a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.list > .more-row > a:hover { background: var(--card-2); }
button.more-attention { margin-top: 8px; background: none; border: 0; padding: 0; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; color: var(--accent); font: inherit; font-size: 13px; font-weight: 600; }
button.more-attention::after { content: ""; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); margin-top: -3px; }
button.more-attention[aria-expanded="true"]::after { transform: rotate(225deg); margin-top: 3px; }
button.more-attention:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.measure-ticks { height: 12px; }
.susp-ticks .tick.limit { height: 11px; width: 2px; margin-left: -1px; background: var(--due); }

/* Rim tape: the question on a tire replacement, and the history on tire and wheel pages */
.rim-tape-choices { flex-wrap: wrap; }
.rim-tape-list { list-style: none; margin: 10px 0 0; padding: 10px 0 0; border-top: 1px solid var(--line); display: grid; gap: 6px; font-size: 13px; }
.rim-tape-list li { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.rt-dot { width: 8px; height: 8px; border-radius: 1px; flex: none; background: var(--ok); }
.rt-dot.soon { background: var(--soon); }
.rt-dot.due { background: var(--due); }
.rt-link { margin-top: 10px; display: inline-block; }

/* Setup plaque on the bike page: tire pressure, suspension and cockpit at a glance */
.setup-plaque { padding-top: 4px; padding-bottom: 4px; }
.plaque-block { padding: 12px 0; }
.plaque-block + .plaque-block { border-top: 1px solid var(--line); }
.plaque-head { align-items: center; gap: 8px; }
.plaque-head .cap { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plaque-head .chip-link { flex: none; }
.setup-plaque .setup-grid { margin-top: 8px; }
.setup-saved { margin-top: 8px; }

/* "What does it have?" switches on the new-bike parts step */
.feature-switches { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.part-card[hidden] { display: none; }

/* A form that's being saved: its buttons grey out and ignore more taps (see sounds.js). */
form.sending button { opacity: 0.55; pointer-events: none; }
