/* Maint */
:root {
  color-scheme: light;
  --ink: #1c2530; --muted: #56626d; --line: #dce2e7; --paper: #fff; --bg: #f2f4f6; --soft: #eef1f4;
  --accent: #2a5f86; --accent-ink: #fff; --accent-soft: #e3eef6; --head: #1e2b38; --head-2: #263646; --amber: #f2a93b;
  --good: #1e6b34; --good-bg: #e5f6e9; --good-line: #b9e3c4;
  --warn: #7a5200; --warn-bg: #fdf3df; --warn-line: #f0d9a8;
  --bad: #9b2c1f; --bad-bg: #fbe8e5; --bad-line: #f0bdb4;
  --info: #2b4f8a; --info-bg: #e7eefa; --info-line: #c4d4ef;
  --field: #75838e;   /* form borders: 3:1 against white */
  --focus: #b35c00;
  --radius: 12px;
  /* charts: the validated reference palette, slots 1-3, and its chrome */
  --surface: #fcfcfb; --grid: #e1e0d9; --axis: #c3c2b7; --tick: #6f6d68;
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --ink: #ecebe7; --muted: #b3b1a8; --line: #30353a; --paper: #1a1b1c; --bg: #111314; --soft: #222527;
    --accent: #78b4de; --accent-ink: #0d1b26; --accent-soft: #1c3242; --head: #141c24; --head-2: #1b2631; --amber: #f2b14e;
    --good: #7fd69a; --good-bg: #16301f; --good-line: #2c5a3a;
    --warn: #f2c66d; --warn-bg: #33270e; --warn-line: #5c4718;
    --bad: #f3a196; --bad-bg: #3a1a16; --bad-line: #6b2d25;
    --info: #9cbcf0; --info-bg: #1a2638; --info-line: #2f4566;
    --field: #7d8a92; --focus: #ffb35c;
    --surface: #1a1a19; --grid: #2c2c2a; --axis: #383835; --tick: #9a988f;
    --s1: #3987e5; --s2: #d95926; --s3: #199e70;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; color: var(--ink); background: var(--bg); line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-underline-offset: 2px; }
.btn, .brand, .menu a, .nav a, .nav-out, .tabs a, .car-card-top, .file-tile, .ev, .chip { text-decoration: none; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.site-header :focus-visible { outline-color: #fff; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 8px; top: -60px; background: #fff; color: #1e2b38; padding: 8px 14px; border-radius: 8px; z-index: 50; font-weight: 600; }
.skip:focus { top: 8px; }
img { max-width: 100%; }
[hidden] { display: none !important; }
.wrap { max-width: 1140px; margin: 0 auto; padding: 0 16px; }

/* Header and menu */
.site-header { background: var(--head); color: #fff; }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; flex-wrap: wrap; }
.brand { color: #fff; font-weight: 750; font-size: 1.15rem; letter-spacing: .01em; }
.nav { display: flex; gap: 2px; flex-wrap: wrap; align-items: center; }
.nav a, .nav-out { color: rgba(255,255,255,.92); padding: 7px 10px; border-radius: 8px; font-size: .93rem; font-weight: 500; }
.nav a:hover, .nav-out:hover { background: rgba(255,255,255,.14); }
.nav a.cta, .log-btn { background: var(--amber); color: #1b1203; font-weight: 700; border-color: transparent; }
.nav a.cta:hover, .log-btn:hover { background: #ffc25e; color: #1b1203; }
.menu { background: var(--head-2); }
.switcher select { width: auto; min-height: 34px; padding: 4px 8px; background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.45); font-size: .88rem; max-width: 190px; }
.switcher select option { color: #1c2530; background: #fff; }
.menu-row { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.menu-row::-webkit-scrollbar { display: none; }
.menu a { color: rgba(255,255,255,.86); padding: 10px 12px; font-size: .92rem; font-weight: 500; white-space: nowrap; border-bottom: 3px solid transparent; }
.menu a:hover { color: #fff; background: rgba(255,255,255,.07); }
.menu a.active { color: #fff; border-bottom-color: var(--amber); font-weight: 650; }

main.wrap { padding-top: 22px; padding-bottom: 48px; }
h1 { font-size: 1.6rem; margin: 0 0 10px; line-height: 1.2; } h2 { font-size: 1.15rem; margin: 0 0 12px; line-height: 1.3; } h3 { font-size: 1rem; margin: 14px 0 6px; }
.page-sub { margin: 4px 0 14px; font-size: 1.2rem; }
.tight { margin-top: 0; margin-bottom: 4px; } .spaced { margin-top: 22px; }
.muted { color: var(--muted); } .small { font-size: .87rem; } .tiny { font-size: .78rem; } .center { text-align: center; } .nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .02em; }
.pre { white-space: pre-line; }
.warn-text { color: var(--warn); } .error-text { color: var(--bad); }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; min-width: 0; }
.card > :last-child { margin-bottom: 0; }
.card.narrow { max-width: 560px; margin-left: auto; margin-right: auto; }
.card.flush { padding: 0; overflow: hidden; }
.card .pad, .pad { padding: 14px 20px; }
.card.danger { border-color: var(--bad-line); }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.section-head h1, .section-head h2 { margin: 0; }
.section-head.pad { margin: 0; border-bottom: 1px solid var(--line); }
.row { display: flex; align-items: center; flex-wrap: wrap; } .gap { gap: 8px; } .grow { flex: 1 1 200px; min-width: 0; }
.grid { display: grid; gap: 16px; }
.grid > * { min-width: 0; }   /* a wide table scrolls inside its card instead of widening the page */
.grid.two { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.grid.cols3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr)); gap: 12px; }
.card .grid.two, .card .grid.cols3 { gap: 0 12px; }
.grid.main-side { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
@media (max-width: 860px) { .grid.main-side { grid-template-columns: 1fr; } }
ul.plain { list-style: none; padding: 0; margin: 0; } ul.plain li { padding: 4px 0; }
ul.cols { columns: 2 200px; }

/* Buttons and forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent); padding: 9px 16px; border-radius: 9px; font: inherit; font-weight: 600; font-size: .95rem; cursor: pointer; min-height: 40px; line-height: 1.2; }
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.outline { background: transparent; color: var(--accent); }
.btn.small { padding: 5px 11px; font-size: .86rem; min-height: 32px; border-radius: 8px; }
.btn.big { padding: 12px 22px; font-size: 1.05rem; }
.btn.wide { width: 100%; }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.outline.danger { background: transparent; color: var(--bad); }
.linkish { background: none; border: 0; padding: 0 4px; color: var(--accent); font: inherit; cursor: pointer; text-decoration: underline; }
.field { margin-bottom: 12px; min-width: 0; }
fieldset.field { border: 0; padding: 0; margin: 0 0 12px; } legend { font-weight: 600; font-size: .92rem; margin-bottom: 4px; padding: 0; }
label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 4px; }
label.check, label.radio { display: flex; gap: 8px; align-items: flex-start; font-weight: 500; margin: 6px 0; }
label.check input, label.radio input { margin-top: 4px; flex: none; width: auto; min-height: 0; }
input, select, textarea { width: 100%; font: inherit; color: var(--ink); background: var(--paper); border: 1px solid var(--field); border-radius: 8px; padding: 8px 10px; min-height: 40px; }
input[type=checkbox], input[type=radio] { width: auto; min-height: 0; accent-color: var(--accent); }
input[type=file] { padding: 6px; }
textarea { resize: vertical; }
input.short { max-width: 160px; }
.hint { font-size: .82rem; color: var(--muted); margin: 4px 0 0; }
.row > input:not([type=checkbox]):not([type=radio]) { flex: 1 1 180px; width: auto; min-width: 0; }
.row > select { width: auto; }
.with-unit { display: flex; align-items: stretch; }
.with-unit input { border-top-right-radius: 0; border-bottom-right-radius: 0; min-width: 0; }
.with-unit .unit, .with-unit .unit-select { display: flex; align-items: center; padding: 0 10px; border: 1px solid var(--field); border-left: 0; border-radius: 0 8px 8px 0; background: var(--soft); color: var(--muted); font-size: .88rem; white-space: nowrap; }
.with-unit .unit-select { width: auto; min-height: 40px; padding: 0 6px; }
.hp { position: absolute; left: -9999px; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.inline-form { display: inline; }
.mini-form { margin-top: 8px; }
.passkey-row .btn { margin-bottom: 4px; }
ul.checks { list-style: none; padding: 0; margin: 0 0 12px; }
ul.checks li { padding: 3px 0; border-bottom: 1px solid var(--soft); }
ul.checks label { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; font-weight: 500; margin: 0; }
ul.checks label input { flex: none; }
.task-extra { margin: 6px 0 6px 24px; }
.task-extra input { min-height: 34px; padding: 5px 8px; font-size: .9rem; }
.item-rows { display: grid; gap: 8px; margin-bottom: 8px; }
.item-row { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.3fr) minmax(0, .8fr) minmax(0, 1.5fr); gap: 8px; }
.item-row.head { font-size: .8rem; font-weight: 600; color: var(--muted); }
@media (max-width: 640px) { .item-row { grid-template-columns: 1fr 1fr; } .item-row.head { display: none; } .item-row input:first-child { grid-column: 1 / -1; } }
.spec-rows { display: grid; gap: 8px; margin-bottom: 8px; }
.spec-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 8px; }

/* Messages */
.flash, .alert { padding: 11px 14px; border-radius: 10px; margin-bottom: 16px; border: 1px solid; }
.flash.ok, .alert.ok { background: var(--good-bg); border-color: var(--good-line); color: var(--good); }
.flash.error, .alert.error { background: var(--bad-bg); border-color: var(--bad-line); color: var(--bad); }
.alert.warn { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn); }
.alert a, .flash a { color: inherit; font-weight: 600; }

/* State chips: always a word, never color alone */
.chip { display: inline-block; font-size: .76rem; font-weight: 700; padding: 2px 9px; border-radius: 999px; border: 1px solid; white-space: nowrap; line-height: 1.5; vertical-align: middle; }
.chip.st-overdue { background: var(--bad-bg); border-color: var(--bad-line); color: var(--bad); }
.chip.st-soon { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn); }
.chip.st-appt { background: var(--info-bg); border-color: var(--info-line); color: var(--info); }
.chip.st-ok, .chip.st-done { background: var(--good-bg); border-color: var(--good-line); color: var(--good); }
.chip.st-norecord, .chip.st-paused { background: var(--soft); border-color: var(--line); color: var(--muted); }
.badges { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0; }

/* Lists of what's due */
.due-list { list-style: none; padding: 0; margin: 0; }
.due-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--soft); }
.due-row:last-child { border-bottom: 0; }
.due-list.big .due-row { padding: 14px 18px; }
.due-icon { font-size: 1.15rem; line-height: 1.4; }
.due-main a { font-weight: 600; }
.acts-row { margin-top: 8px; flex-wrap: wrap; }
.due-row.st-overdue { box-shadow: inset 3px 0 0 var(--bad); padding-left: 8px; }
.due-list.big .due-row.st-overdue { padding-left: 15px; }

/* Garage */
.cars { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); }
.car-card { display: flex; flex-direction: column; }
.car-card-top { display: flex; gap: 12px; align-items: center; color: var(--ink); }
.car-card-top:hover .car-name { color: var(--accent); text-decoration: underline; }
.car-name { font-size: 1.08rem; }
.car-thumb { width: 84px; height: 62px; object-fit: cover; border-radius: 9px; flex: none; background: var(--soft); }
.car-mini { width: 40px; height: 30px; object-fit: cover; border-radius: 6px; font-size: 1.1rem; }
.noimg { display: inline-flex; align-items: center; justify-content: center; font-size: 2rem; border: 1px solid var(--line); }
.car-mini.noimg { font-size: 1rem; }
.odo { margin: 8px 0 4px; }
.odo-quick { display: flex; gap: 6px; margin: 8px 0; }
.odo-quick .with-unit { flex: 1; } .odo-quick input { min-height: 34px; padding: 5px 8px; } .odo-quick .unit { font-size: .8rem; }
.car-links { display: flex; gap: 12px; flex-wrap: wrap; margin: auto 0 0; padding-top: 8px; border-top: 1px solid var(--soft); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; margin: 0 0 12px; }
.stats div { min-width: 0; }
.stats dt { font-size: .8rem; color: var(--muted); }
.stats dd { margin: 2px 0 0; font-size: 1.25rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.stats .total dd { color: var(--accent); }
aside .stats { grid-template-columns: 1fr 1fr; }
.facts { margin: 0 0 10px; display: grid; gap: 6px; }
.facts div { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 8px; font-size: .92rem; }
.facts dt { color: var(--muted); } .facts dd { margin: 0; overflow-wrap: anywhere; }
.facts.wide div { grid-template-columns: 140px minmax(0, 1fr); }
.facts.inline { display: flex; flex-wrap: wrap; gap: 6px 22px; } .facts.inline div { display: block; } .facts.inline dt { font-size: .78rem; }
.log-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.log-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.log-buttons .btn { justify-content: flex-start; background: var(--accent-soft); color: var(--ink); border-color: var(--line); font-weight: 600; }

/* A car's page */
.car-head { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.car-photo { width: 132px; height: 96px; object-fit: cover; border-radius: 12px; flex: none; background: var(--soft); }
.car-photo.noimg { font-size: 3rem; }
.car-title { flex: 1 1 260px; min-width: 0; } .car-title h1 { margin-bottom: 2px; }
.car-title .odo { margin: 4px 0 0; font-size: .92rem; }
.car-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.tabs { border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tabs-row { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.tabs-row::-webkit-scrollbar { display: none; }
.tabs a { padding: 9px 13px; color: var(--muted); font-weight: 550; font-size: .93rem; white-space: nowrap; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--ink); }
.tabs a.active { color: var(--ink); border-bottom-color: var(--accent); font-weight: 700; }
.history-list { list-style: none; padding: 0; margin: 0; }
.history-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 9px 0; border-bottom: 1px solid var(--soft); }
.history-list li > span.muted { grid-column: 1; } .history-list li .num { grid-row: 1 / span 2; grid-column: 2; align-self: center; }
.readings li { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; border-bottom: 1px solid var(--soft); }

/* The schedule */
.sched { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); }
.task { margin: 0; display: flex; flex-direction: column; }
.task-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.task-head h2, .task-head h3 { margin: 0 0 4px; font-size: 1.05rem; }
.task.st-overdue { border-color: var(--bad-line); box-shadow: inset 4px 0 0 var(--bad); }
.task.st-soon { border-color: var(--warn-line); box-shadow: inset 4px 0 0 var(--amber); }
.task.st-paused, .task.st-done { opacity: .8; }
.due-line { font-weight: 600; margin: 6px 0; }
.task-acts { display: flex; gap: 6px; flex-wrap: wrap; align-items: flex-start; margin-top: auto; padding-top: 8px; }
.inline-details { display: inline-block; }
.inline-details[open] { display: block; width: 100%; background: var(--soft); border-radius: 10px; padding: 8px 10px; }
.inline-details summary { list-style: none; } .inline-details summary::-webkit-details-marker { display: none; }
.recall.st-overdue { box-shadow: inset 4px 0 0 var(--bad); }
/* Warranties and equipment */
.group-head { font-size: 1.02rem; margin: 6px 0 10px; }
.warranty-list { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); margin-bottom: 16px; }
.warranty, .equip { margin: 0; display: flex; flex-direction: column; }
.warranty .task-acts, .equip .task-acts { margin-top: auto; }
.warranty.st-soon { border-color: var(--warn-line); box-shadow: inset 4px 0 0 var(--amber); }
.warranty.st-expired { opacity: .8; }
.war-mini li { border-bottom: 1px solid var(--soft); padding: 6px 0; }
.file-grid.small-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; margin: 8px 0; }
.small-grid .file-tile img, .small-grid .file-icon { height: 72px; }

/* Tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.data th, table.data td { padding: 8px 10px; border-bottom: 1px solid var(--soft); text-align: left; vertical-align: top; }
table.data thead th { font-size: .8rem; color: var(--muted); font-weight: 650; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data th.num, table.data td.num { text-align: right; }
table.data tr.hl td, table.data tr.hl th { background: var(--accent-soft); }
table.data .year-row th { background: var(--soft); font-size: .85rem; padding: 5px 10px; }
.card.flush table.data th:first-child, .card.flush table.data td:first-child { padding-left: 20px; }
.card.flush table.data th:last-child, .card.flush table.data td:last-child { padding-right: 20px; }
.search-row { display: flex; gap: 8px; margin-bottom: 14px; align-items: center; flex-wrap: wrap; } .search-row input { flex: 1 1 240px; }
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; padding: 14px; }

/* Files */
.file-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.file-tile { display: flex; flex-direction: column; gap: 6px; color: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 8px; background: var(--paper); overflow-wrap: anywhere; }
.file-tile:hover { border-color: var(--accent); }
.file-tile img { width: 100%; height: 110px; object-fit: cover; border-radius: 6px; background: var(--soft); }
.file-icon { font-size: 2.4rem; height: 110px; display: flex; align-items: center; justify-content: center; background: var(--soft); border-radius: 6px; }
.file-card details { margin-top: 4px; } .file-card summary { cursor: pointer; color: var(--accent); }
.file-card .mini-form input, .file-card .mini-form select { margin-bottom: 6px; min-height: 34px; }
.files li { display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline; }
.members li { display: flex; justify-content: space-between; gap: 10px; align-items: center; border-bottom: 1px solid var(--soft); padding: 8px 0; }

/* Charts (inline SVG, assets/app.js adds the readout) */
.chart-box { position: relative; margin: 6px 0 12px; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: var(--grid); stroke-width: 1; } .chart .grid.base { stroke: var(--axis); }
.chart .tick { fill: var(--tick); font-size: 13px; font-variant-numeric: tabular-nums; }
.chart .series { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .series.s1, .chart .end.s1 { stroke: var(--s1); } .chart .end.s1, .chart .hover-dot.s1 { fill: var(--s1); }
.chart .end, .chart .hover-dot { stroke: var(--surface); stroke-width: 2; }
.chart .hover-dot { pointer-events: none; }
.chart .crosshair { stroke: var(--tick); stroke-width: 1; stroke-dasharray: 3 3; pointer-events: none; }
.chart .hit { fill: transparent; cursor: crosshair; } .chart .hit:focus { outline: none; }
.chart .bar.s1 { fill: var(--s1); } .chart .bar.s2 { fill: var(--s2); } .chart .bar.s3 { fill: var(--s3); }
.chart .bar { transition: opacity .12s; cursor: default; } .chart .bar.dim { opacity: .45; } .chart .bar:focus { outline: none; stroke: var(--ink); stroke-width: 1.5; }
.chart-box .tip { position: absolute; pointer-events: none; background: var(--paper); border: 1px solid var(--line); box-shadow: 0 4px 14px rgba(0,0,0,.12); border-radius: 8px; padding: 6px 10px; font-size: .84rem; white-space: nowrap; z-index: 5; display: flex; flex-direction: column; }
.chart-box .tip strong { font-size: .98rem; font-variant-numeric: tabular-nums; }
.chart-box .tip span { color: var(--muted); }
.chart-box figcaption { margin-top: 4px; }
.legend { list-style: none; padding: 0; margin: 8px 0 0; display: flex; gap: 6px 16px; flex-wrap: wrap; font-size: .85rem; color: var(--muted); }
.legend li { display: flex; align-items: center; gap: 6px; }
.legend .key { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.legend .key.s1 { background: var(--s1); } .legend .key.s2 { background: var(--s2); } .legend .key.s3 { background: var(--s3); }
.hbars { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 8px; }
.hbars li { display: grid; grid-template-columns: minmax(110px, 38%) minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: .9rem; }
.hb-track { height: 12px; background: var(--soft); border-radius: 0 4px 4px 0; overflow: hidden; }
.hb-bar { display: block; height: 100%; background: var(--s1); border-radius: 0 4px 4px 0; }

/* Calendar */
.cal { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--paper); }
.cal-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-head div { font-size: .78rem; font-weight: 650; color: var(--muted); padding: 6px 8px; background: var(--soft); border-bottom: 1px solid var(--line); }
.cal-day { min-height: 96px; padding: 4px 5px 6px; border-right: 1px solid var(--soft); border-bottom: 1px solid var(--soft); display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-row .cal-day:last-child { border-right: 0; }
.cal-day.empty { background: var(--bg); }
.cal-day.today { background: var(--accent-soft); } .cal-day.today .dnum { background: var(--accent); color: var(--accent-ink); }
.dnum { font-size: .8rem; font-weight: 650; color: var(--muted); align-self: flex-start; padding: 0 6px; border-radius: 99px; }
.ev { display: block; font-size: .74rem; line-height: 1.3; padding: 2px 5px; border-radius: 5px; color: var(--ink); background: var(--soft); border-left: 3px solid var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev:hover { white-space: normal; }
.ev-due { border-left-color: var(--amber); } .ev-date { border-left-color: var(--info); } .ev-appt { border-left-color: var(--accent); background: var(--accent-soft); } .ev-done { border-left-color: var(--good); color: var(--muted); }
.ev.late { border-left-color: var(--bad); background: var(--bad-bg); color: var(--bad); }
.cal-legend .key { width: 4px; height: 14px; border-radius: 2px; }
.key.ev-due { background: var(--amber); } .key.ev-date { background: var(--info); } .key.ev-appt { background: var(--accent); } .key.ev-done { background: var(--good); }
@media (max-width: 640px) {
  .cal-head div { padding: 4px 2px; text-align: center; font-size: .7rem; }
  .cal-day { min-height: 64px; padding: 3px 2px; }
  .cal-day.none:not(.today) .dnum { opacity: .7; }
  .ev { font-size: 0; padding: 0; height: 6px; border-left-width: 0; border-radius: 3px; }
  .ev-due { background: var(--amber); } .ev-date { background: var(--info); } .ev-appt { background: var(--accent); } .ev-done { background: var(--good); } .ev.late { background: var(--bad); }
}

/* The landing page */
.hero { padding: 26px 0 18px; max-width: 760px; }
.hero h1 { font-size: clamp(1.7rem, 4.5vw, 2.4rem); }
.hero .lead { font-size: 1.12rem; color: var(--muted); }
#how .card h2 { font-size: 1.05rem; }

/* The service history report (print and share) */
.report { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.report-head { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 14px; }
.report-head > div { flex: 1 1 300px; min-width: 0; }
.report h1 { font-size: 1.4rem; }
.report h2 { margin-top: 22px; }
.report-table { font-size: .88rem; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 22px 0 36px; color: var(--muted); font-size: .92rem; }
.site-footer p { margin: 4px 0; }

@media print {
  body { background: #fff; color: #000; }
  .site-header, .site-footer, .no-print, .flash, .tabs, .car-acts { display: none !important; }
  main.wrap { padding: 0; max-width: none; }
  .report { border: 0; padding: 0; }
  .table-wrap { overflow: visible; }
  .card { break-inside: avoid; border-color: #ccc; }
  table.data th, table.data td { border-color: #ccc; }
  a { color: #000; text-decoration: none; }
}
