:root {
  --bg: #f7f8fa; --surface: #fff; --text: #1a1d23; --muted: #5b6270; --border: #d9dde4;
  --accent: #1d4ed8; --accent-text: #fff; --danger: #b42318; --ok: #067647;
  --radius-sm: 4px; --radius: 6px; /* corners: small controls, and cards or panels */
  --orange: #c2410c; --orange-bright: #f97316; --on-orange: #fff; /* the logo's orange: text-safe, decorative, text on it */
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111318; --surface: #1a1d24; --text: #e8eaee; --muted: #a2a9b6; --border: #2e333d;
    --accent: #6d9bff; --accent-text: #0b1020; --danger: #ff8a80; --ok: #6ee7a8;
    --orange: #fb923c; --on-orange: #111318;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111318; --surface: #1a1d24; --text: #e8eaee; --muted: #a2a9b6; --border: #2e333d;
  --accent: #6d9bff; --accent-text: #0b1020; --danger: #ff8a80; --ok: #6ee7a8;
  --orange: #fb923c; --on-orange: #111318;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--text); }
main { max-width: 560px; margin: 0 auto; padding: 32px 16px 64px; }
h1 { font-size: 1.6rem; margin: 0 0 4px; }
h2 { font-size: 1.15rem; margin: 28px 0 8px; }
p.lead, .muted { color: var(--muted); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-top: 16px; }
button, .button {
  display: block; width: 100%; min-height: 48px; padding: 10px 16px; margin-top: 10px;
  font: inherit; font-weight: 600; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface); color: var(--text); cursor: pointer; text-align: center; text-decoration: none;
}
button.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
button.small { display: inline-block; width: auto; min-height: 36px; padding: 4px 12px; margin: 0 0 0 8px; font-weight: 500; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
label { display: block; font-weight: 600; margin-top: 14px; }
input, select { width: 100%; min-height: 44px; margin-top: 4px; padding: 8px 10px; font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.divider { text-align: center; color: var(--muted); margin: 18px 0 4px; }
.msg { margin-top: 12px; min-height: 1.5em; }
.msg.error { color: var(--danger); }
.msg.ok { color: var(--ok); }
ul.list { list-style: none; padding: 0; margin: 0; }
ul.list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--border); }
ul.list li:last-child { border-bottom: 0; }
.badge { font-size: .8rem; padding: 2px 8px; border-radius: 99px; border: 1px solid var(--border); color: var(--muted); white-space: nowrap; }
header.top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
[hidden] { display: none !important; }

/* Legal and other long-form pages */
.doc { max-width: 760px; }
.doc h2 { font-size: 1.2rem; margin-top: 32px; }
.doc h3 { font-size: 1.02rem; margin: 20px 0 4px; }
.doc p, .doc li { max-width: 70ch; }
.doc table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: .95rem; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.doc th { font-weight: 600; }
.table-scroll { overflow-x: auto; }
.help h2 { scroll-margin-top: 88px; } /* clears the sticky header */
.help .shot { margin: 16px 0 24px; }
.help .shot img { display: block; width: 100%; height: auto; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 1px 2px rgb(15 23 42 / .06); background: #fff; }
.help .shot.phone { max-width: 240px; }
.help .shot.phone img { border-radius: 18px; border: 5px solid #111827; }
.help .shot figcaption { margin-top: 8px; font-size: .9rem; color: var(--muted); }
.help .shots-row { display: flex; flex-wrap: wrap; gap: 20px; }
.help .shots-row .shot.phone { flex: 1 1 160px; }
.draft { border: 2px dashed var(--danger); color: var(--danger); border-radius: var(--radius-sm); padding: 10px 14px; margin: 0 0 20px; font-weight: 600; }
.placeholder { background: color-mix(in srgb, var(--danger) 15%, transparent); padding: 0 3px; border-radius: 3px; }
nav.legal { margin: 0 0 24px; font-size: .95rem; }
nav.legal a, footer.site a { color: var(--accent); }
footer.site { max-width: 760px; margin: 0 auto; padding: 0 16px 40px; font-size: .9rem; color: var(--muted); }
footer.site a { margin-right: 14px; white-space: nowrap; display: inline-block; }

/* ---------- App shell ---------- */
:root { --warn: #b54708; --warn-bg: #fffaeb; --danger-bg: #fef3f2; --ok-bg: #ecfdf3; --muted-bg: #f2f4f7; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --warn: #fdb022; --warn-bg: #2a1f0a; --danger-bg: #2b1513; --ok-bg: #0e2a1c; --muted-bg: #22262e; }
}
:root[data-theme="dark"] { --warn: #fdb022; --warn-bg: #2a1f0a; --danger-bg: #2b1513; --ok-bg: #0e2a1c; --muted-bg: #22262e; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: var(--radius-sm); z-index: 10; }
.skip:focus { left: 8px; }
body.app { padding-bottom: 24px; }
.appbar { background: var(--surface); border-top: 3px solid var(--orange-bright); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5; }
.appbar-inner { max-width: 960px; margin: 0 auto; padding: 10px 16px 0; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.appbar-actions { display: flex; gap: 6px; flex-shrink: 0; }
.appbar-actions button.small { margin: 0; }
nav.tabs { max-width: 960px; margin: 0 auto; padding: 0 8px; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
nav.tabs a, nav.subtabs a { padding: 10px 12px; color: var(--muted); text-decoration: none; border-bottom: 3px solid transparent; white-space: nowrap; font-weight: 600; }
nav.tabs a.active, nav.subtabs a.active { color: var(--text); border-bottom-color: var(--orange-bright); }
nav.subtabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.appmain { max-width: 960px; margin: 0 auto; padding: 16px 16px 8px; outline: none; }
.appmain h1 { font-size: 1.4rem; margin: 8px 0 12px; }
/* A short orange rule under each page title, the brand accent from the logo. */
.appmain h1::after { content: ""; display: block; width: 36px; height: 3px; margin-top: 6px; border-radius: 2px; background: var(--orange-bright); }
.appmsg { max-width: 960px; margin: 0 auto; padding: 0 16px; position: sticky; bottom: 8px; }
.appmsg:not(:empty) { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 14px; }
.banner { background: var(--warn-bg); color: var(--warn); text-align: center; margin: 0; padding: 10px 16px; font-weight: 600; }
.notice { background: var(--warn-bg); color: var(--warn); border-radius: var(--radius-sm); padding: 10px 14px; }
.notice.ok { background: var(--ok-bg); color: var(--ok); }

/* ---------- Building blocks ---------- */
.field { margin-top: 12px; }
.field label { margin-top: 0; }
.hint { color: var(--muted); font-size: .9rem; margin: 4px 0 0; }
textarea { width: 100%; margin-top: 4px; padding: 8px 10px; font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); resize: vertical; }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 500; margin-top: 12px; }
label.check input { width: auto; min-height: 0; margin: 0; width: 20px; height: 20px; }
.row { display: flex; gap: 8px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.row button, .row .button-link { margin-top: 0; }
.title-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.title-row h1 { margin-right: auto; }
.grid2 { display: grid; grid-template-columns: 1fr; gap: 0 12px; }
@media (min-width: 560px) { .grid2 { grid-template-columns: 1fr 1fr; } }
.grid3 { display: grid; grid-template-columns: 1fr; gap: 0 12px; }
@media (min-width: 560px) { .grid3 { grid-template-columns: 1fr 1fr 1fr; } }
.button-link { display: inline-block; padding: 10px 16px; border-radius: var(--radius-sm); background: var(--accent); color: var(--accent-text); font-weight: 600; text-decoration: none; }
.button-link.secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.button-link.small { padding: 6px 12px; font-weight: 500; }
button.danger { background: var(--danger); color: #fff; border-color: var(--danger); }
button:disabled { opacity: .55; cursor: not-allowed; }
.badge.status-in_service { color: var(--ok); border-color: currentColor; }
.badge.status-out_of_service, .badge.danger { color: var(--danger); border-color: currentColor; }
.badge.status-retired { background: var(--muted-bg); }
.badge.warn { color: var(--warn); border-color: currentColor; margin-left: 6px; }
.row-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; color: var(--muted); }
ul.list li { flex-wrap: wrap; }
dialog.ask { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); max-width: min(420px, calc(100vw - 32px)); padding: 20px; }
dialog.ask::backdrop { background: rgb(0 0 0 / .45); }
dialog.ask .row { justify-content: flex-end; }
.small-print { font-size: .9rem; }

/* ---------- Home ---------- */
.big-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 4px 0 20px; }
.big-action { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 92px; padding: 12px; border-radius: var(--radius); font-size: 1.1rem; font-weight: 700; text-decoration: none; color: var(--accent-text); background: var(--accent); }
.big-action.action-problem { grid-column: 1 / -1; background: var(--surface); color: var(--danger); border: 2px solid var(--danger); }
@media (min-width: 720px) { .big-actions { grid-template-columns: repeat(3, 1fr); } .big-action.action-problem { grid-column: auto; } }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 720px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { display: flex; flex-direction: column; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); text-decoration: none; }
.stat-n { font-size: 1.8rem; font-weight: 700; }
.stat-l { color: var(--muted); }
.stat.alert { border-color: var(--danger); }
.stat.alert .stat-n { color: var(--danger); }

/* ---------- Logging ---------- */
.choices { display: grid; gap: 10px; margin: 8px 0 16px; }
.vehicle-choice { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; margin: 0; min-height: 64px; }
.vehicle-choice.disabled { opacity: .5; }
.vc-name { font-size: 1.05rem; }
.vc-meta { display: flex; gap: 8px; align-items: center; font-weight: 400; color: var(--muted); }
.vc-reason { font-weight: 400; color: var(--danger); font-size: .9rem; }
details > summary { cursor: pointer; font-weight: 600; padding: 8px 0; }
.chosen { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.entry-form { margin-top: 8px; }

/* ---------- Entries ---------- */
.entries li.entry { align-items: flex-start; }
.entry-main { flex: 1 1 260px; }
.entry-sub { font-size: .92rem; margin-top: 2px; }
.entry-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.entry-actions button.small { margin: 0; }
.kind { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.history { flex-basis: 100%; border-top: 1px dashed var(--border); padding-top: 6px; }
.filters { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.filters select { width: auto; margin: 0; }
.filters label.check { margin: 0; }

/* ---------- Requests ---------- */
.request-list { display: grid; gap: 12px; }
.request { margin-top: 0; }
.request.urgent { border-left: 4px solid var(--danger); }
.request-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.request .note { background: var(--muted-bg); border-radius: var(--radius-sm); padding: 8px 10px; }
.request-actions .row button.small { margin: 0; }
.inline-form { border-top: 1px dashed var(--border); margin-top: 12px; padding-top: 4px; }
.inline-form button.small { margin-top: 12px; }

/* ---------- Vehicles ---------- */
.vehicle-link { display: flex; flex-direction: column; gap: 2px; color: var(--text); text-decoration: none; flex: 1 1 240px; }
.vehicle-link .muted { font-size: .92rem; }
.vin-row { display: flex; align-items: flex-end; gap: 8px; }
.vin-row .field { flex: 1; }
.vin-row button.small { margin: 0 0 2px; min-height: 44px; }
.checks label.check { margin-top: 8px; }
ul.list.card { padding: 4px 16px; }
.view > :first-child { margin-top: 0; }
body.app footer.site { max-width: 960px; }
.card > h2:first-child, .card > h1:first-child, .view > section.card > h2:first-child { margin-top: 0; }
.status-buttons { margin-top: 12px; }
.status-buttons button.small, .row button.small { margin: 0; }

/* ---------- Photos ---------- */
.photo-field .label { display: block; font-weight: 600; }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; }
.thumb { position: relative; display: inline-block; }
.thumb img { width: 72px; height: 72px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--border); display: block; background: var(--muted-bg); }
.thumb-x { position: absolute; top: -8px; right: -8px; width: 28px; height: 28px; min-height: 0; margin: 0; padding: 0; border-radius: 50%; line-height: 1; font-size: 1.1rem; background: var(--surface); }
.add-photo { cursor: pointer; margin-top: 4px; }

/* ---------- Reminders ---------- */
.badge.due-overdue { color: #fff; background: var(--danger); border-color: var(--danger); }
.badge.due-due_soon { color: var(--warn); border-color: currentColor; background: var(--warn-bg); }
.reminder-list li { align-items: center; }
.reminder-main { flex: 1 1 220px; }
.estimated { font-size: .85rem; }
.rule-form { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.rule-form .field { margin-top: 0; flex: 1 1 120px; }
.rule-form button.small { margin: 0; }

@media (min-width: 720px) { .stats { grid-template-columns: repeat(3, 1fr); } }
.rule-row + .rule-row { border-top: 1px solid var(--border); margin-top: 16px; padding-top: 4px; }
.rule-row h3 { margin-top: 8px; }
.recall-list li.resolved { opacity: .65; }
.recall-summary { font-size: .92rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- Billing ---------- */
.interval-toggle { display: flex; gap: 6px; margin: 12px 0; flex-wrap: wrap; }
.interval-toggle button.small { margin: 0; }
.plan-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.plan-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.plan-card.current { border: 2px solid var(--accent); }
.plan-card h3 { margin: 0 0 4px; }
.plan-price { font-size: 1.3rem; font-weight: 700; margin: 4px 0; }
.plan-price .muted { font-size: .9rem; font-weight: 400; }
.plan-card button.small { margin: 8px 0 0; }
.banner a { color: inherit; font-weight: 700; }
.danger-zone { border-color: var(--danger); }
.danger-zone h2 { color: var(--danger); }
.date-row input[type=date] { width: auto; min-height: 36px; margin: 0; }
.date-row .row-meta button.small { margin: 0; }
.date-label { flex: 1 1 180px; }

/* ---------- Reports ---------- */
:root { --series-1: #2a78d6; --series-2: #eb6834; --grid: #e6e7ea; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --series-1: #3987e5; --series-2: #d95926; --grid: #2e333d; } }
:root[data-theme="dark"] { --series-1: #3987e5; --series-2: #d95926; --grid: #2e333d; }
.chart { position: relative; margin-top: 8px; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .bar.series-1 { fill: var(--series-1); }
.chart .bar.series-2 { fill: var(--series-2); }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .axis { stroke: var(--muted); stroke-width: 1; }
.chart .tick { fill: var(--muted); font-size: 12px; }
.chart .hit { fill: transparent; cursor: default; outline: none; }
.chart .hit:focus-visible { stroke: var(--accent); stroke-width: 2; }
.chart-tip { position: absolute; transform: translate(-50%, calc(-100% - 8px)); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; font-size: .9rem; pointer-events: none; box-shadow: 0 2px 6px rgb(0 0 0 / .10); white-space: nowrap; z-index: 2; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; color: var(--text); font-size: .92rem; margin-bottom: 4px; }
.legend > span { display: inline-flex; align-items: center; gap: 6px; }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.swatch.series-1 { background: var(--series-1); }
.swatch.series-2 { background: var(--series-2); }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data { width: 100%; border-collapse: collapse; }
table.data th, table.data td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; }
.table-view { margin-top: 8px; }
.filters input[type=date] { width: auto; margin: 0; min-height: 40px; }

/* ---------- Platform admin ---------- */
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; overflow-wrap: anywhere; }
.badge.admin-active { color: var(--ok); border-color: currentColor; }
.badge.admin-past_due, .badge.admin-lapsed { color: var(--danger); border-color: currentColor; }
code.details { font-size: .8rem; color: var(--muted); overflow-wrap: anywhere; }
.filters input[type=search] { width: auto; flex: 1 1 220px; margin: 0; }

/* Stat tiles fill the row evenly whatever their number. */
.stats { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }

/* On phones the chart keeps readable labels and scrolls inside its card. */
@media (max-width: 600px) { .chart { overflow-x: auto; } .chart svg { min-width: 560px; } }

/* ---------- Branding ---------- */
.appbar-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand, .brand-link { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); font-weight: 800; letter-spacing: -.01em; }
.brand-mark { width: 28px; height: 28px; flex-shrink: 0; }
.brand-divider { width: 1px; height: 24px; background: var(--border); flex-shrink: 0; }
/* Most logos are drawn for white paper, so in dark mode they sit on a small light tile to stay readable. */
:root { --logo-bg: transparent; --logo-pad: 0; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --logo-bg: #f4f5f7; --logo-pad: 3px 6px; } }
:root[data-theme="dark"] { --logo-bg: #f4f5f7; --logo-pad: 3px 6px; }
.company-logo { height: 28px; max-width: 120px; object-fit: contain; flex-shrink: 0; background: var(--logo-bg); padding: var(--logo-pad); border-radius: var(--radius-sm); }
.company { display: inline-block; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 480px) { .brand-word { display: none; } }
.logo-row { margin: 8px 0 12px; }
.logo-preview { max-height: 80px; max-width: 260px; object-fit: contain; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px; background: var(--logo-bg); }

/* Insurance cards: as large as the screen allows, so they can be shown to someone. */
.insurance-cards { display: grid; gap: 16px; margin: 12px 0; }
.insurance-card img { display: block; width: 100%; max-width: 720px; height: auto; border-radius: var(--radius); border: 1px solid var(--border); background: #fff; }

/* Platform admin: Business */
.chart .line { fill: none; stroke: var(--series-1); stroke-width: 2; stroke-linejoin: round; }
.chart .dot { fill: var(--series-1); stroke: var(--surface); stroke-width: 2; }
.stat-hint { color: var(--muted); font-size: .82rem; margin-top: 2px; }
.attention { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.attention-card { margin-top: 0; padding: 16px; }
.attention-card h3 { margin: 0 0 4px; font-size: 1rem; }
.attention-card.alert { border-color: var(--danger); }
.attention-sum { margin: 0 0 8px; font-weight: 700; }
.attention-card.alert .attention-sum { color: var(--danger); }
ul.plain { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.chart-grid .chart svg { min-width: 0; }
.chart-grid .chart .tick { font-size: 15px; }
.chart-grid h3 { margin: 0 0 4px; font-size: 1rem; }
.meters { display: grid; gap: 12px; }
/* Collapsible sections: the heading is the toggle. */
details.fold { margin-top: 8px; }
details.fold > summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 0; margin: 24px 0 12px; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::before { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform .15s; flex: none; }
details.fold[open] > summary::before { transform: rotate(45deg); }
details.fold > summary h2 { margin: 0; }
details.fold > summary:hover h2 { color: var(--accent); }
.meter { display: grid; grid-template-columns: 170px 1fr minmax(220px, auto); gap: 12px; align-items: center; }
.meter-bar { height: 8px; border-radius: 4px; background: var(--muted-bg); overflow: hidden; }
.meter-fill { display: block; height: 100%; background: var(--series-1); border-radius: 4px; }
.meter-fill.high { background: var(--warn); }
.meter-value { font-variant-numeric: tabular-nums; }
@media (max-width: 700px) { .meter { grid-template-columns: 1fr; gap: 4px; } }
.badge.admin-comp { color: var(--accent); border-color: currentColor; }
.comp-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-bottom: 12px; }
.comp-form label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; }
.comp-form .comp-note { flex: 1 1 260px; }

/* Vehicle import */
#import-paste { width: 100%; font-family: ui-monospace, Consolas, monospace; font-size: .9rem; }
.import-result { margin-top: 16px; }
.import-preview tr.has-problem td { background: var(--warn-bg); }
.import-preview .problem { color: var(--danger); }
.import-preview .ok-text { color: var(--ok); }
.import-preview th, .import-preview td { white-space: nowrap; vertical-align: top; }
.import-preview td.check { white-space: normal; min-width: 220px; max-width: 320px; }
.import-preview .warn-text { color: var(--warn); }
.import-columns { margin: 0 0 12px; padding-left: 20px; display: grid; gap: 4px; }
.tagline { color: var(--muted); font-size: .9rem; margin: -8px 0 16px; }

/* Parts and fluids */
dl.facts.specs { grid-template-columns: minmax(150px, max-content) 1fr; }
.specs-edit { margin-top: 12px; }
.specs-edit form { margin-top: 8px; }
.spec-extra { display: grid; gap: 8px; margin-bottom: 8px; }
.spec-extra-row { display: grid; grid-template-columns: 1fr 1.4fr auto; gap: 8px; align-items: center; }
.spec-extra-row button { margin: 0; }
@media (max-width: 560px) { .spec-extra-row { grid-template-columns: 1fr; } }

/* Vehicle inspections */
.segmented { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; margin: 4px 0 12px; }
.segmented button { margin: 0; border: 0; border-radius: 0; background: var(--surface); color: var(--text); padding: 8px 14px; min-height: 40px; }
.segmented button.on { background: var(--accent); color: var(--accent-text); }
.inspect-list li { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center; }
.inspect-label { display: flex; flex-direction: column; }
.inspect-label .muted { font-size: .85rem; }
.inspect-buttons { display: flex; gap: 6px; }
.inspect-buttons button { margin: 0; min-width: 72px; }
.inspect-buttons button.on-ok { background: var(--ok); color: #fff; border-color: var(--ok); }
.inspect-buttons button.on-bad { background: var(--danger); color: #fff; border-color: var(--danger); }
.inspect-list li input[type="text"] { grid-column: 1 / -1; }
.danger-notice { background: var(--danger-bg); color: var(--danger); }

/* Light/dark button (theme.js). Dark is the default; the sun switches to light, the moon back. */
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 42px; height: 42px; min-height: 0; min-width: 0; padding: 0; margin: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); cursor: pointer; }
.theme-toggle.small { width: 38px; height: 38px; } /* matches the app header's small buttons */
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
.theme-toggle svg { display: block; }
.theme-toggle .icon-moon, :root[data-theme="light"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: block; }

/* Mileage: a firm number with fixed-width digits and a small unit. */
.odo { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.odo-unit { color: var(--muted); font-weight: 600; font-size: .85em; }
.odo-line { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.odo-line .odo { font-size: 1.15rem; }

/* Service stickers: a vehicle's reminders, like the "next service" sticker on the windshield.
   They're a physical object, so they look the same in light and dark. */
.stickers { list-style: none; padding: 0; margin: 8px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.sticker { position: relative; overflow: hidden; padding: 0 14px 12px; color: #1f2937; background: #fffaf0; border: 1px solid #e7dcc3; border-radius: var(--radius); box-shadow: 0 1px 2px rgb(15 23 42 / .08); font-family: ui-monospace, "Courier New", Courier, monospace; }
.sticker-band { margin: 0 -14px 10px; padding: 5px 14px; color: #1c1917; background: var(--orange-bright); font: 800 .72rem system-ui, -apple-system, "Segoe UI", sans-serif; letter-spacing: .14em; text-transform: uppercase; }
.sticker-title { display: block; color: #111827; font: 800 1.05rem/1.2 system-ui, -apple-system, "Segoe UI", sans-serif; letter-spacing: .02em; text-transform: uppercase; }
.sticker-fields { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; margin: 10px 0 8px; }
.sticker-fields dt { align-self: end; color: #6b7280; font: 700 .68rem system-ui, -apple-system, "Segoe UI", sans-serif; letter-spacing: .12em; text-transform: uppercase; }
.sticker-fields dd { margin: 0; color: #111827; font-weight: 700; font-size: 1.05rem; border-bottom: 1px dotted #bfb39a; }
.sticker-note { margin: 0; color: #4b5563; font: .82rem/1.35 system-ui, -apple-system, "Segoe UI", sans-serif; }
.stamp { position: absolute; right: 8px; bottom: 10px; padding: 2px 8px; border: 2px solid currentColor; border-radius: 3px; font: 800 .8rem system-ui, -apple-system, "Segoe UI", sans-serif; letter-spacing: .12em; text-transform: uppercase; transform: rotate(-11deg); opacity: .88; background: rgb(255 250 240 / .7); }
.sticker-overdue .stamp { color: #b42318; }
.sticker-overdue .sticker-note, .sticker-due_soon .sticker-note { padding-right: 104px; } /* room for the stamp */
.sticker-due_soon .stamp { color: #b54708; }
.home-lead { margin: -4px 0 16px; }
.units-note { margin: 6px 0 0; font-size: .92rem; }
