:root {
  --paper: #e7e1d4;
  --card: #fbf7f1;
  --ink: #1c1915;
  --soft: #5c564c;
  --line: #e0d7c8;
  --line-strong: #d2c8b6;
  --green: #08522e;
  --green-wash: #e3f5ea;
  --amber: #7a4e00;
  --amber-wash: #fff1cc;
  --red: #9f1d1d;
  --red-wash: #fdecea;
  --slate: #243044;
  --slate-wash: #e7ebf0;
  --none: #6f685e;
  --none-wash: #efeae2;
  --plate: #f5c400;
  --band: #003399;
  --focus: #0b2f8a;
  color-scheme: light;
  font-family: Inter, "Segoe UI", "Avenir Next", "Liberation Sans", "Helvetica Neue", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; }
body[data-auth="checking"] header,
body[data-auth="checking"] main,
body[data-auth="checking"] .notice,
body[data-auth="checking"] .fineprint,
body[data-auth="locked"] header,
body[data-auth="locked"] main,
body[data-auth="locked"] .notice,
body[data-auth="locked"] .fineprint { display: none !important; }
body[data-role="viewer"] .admin-only,
body[data-role="viewer"] .btn-gov,
body[data-role="viewer"] .row-actions,
body[data-role="viewer"] .hire-actions,
body[data-role="viewer"] .history-head .btn,
body[data-role="viewer"] .fines .btn,
body[data-role="viewer"] .mail-actions { display: none !important; }
.view-only {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid rgba(246, 241, 231, 0.45);
  color: #f6f1e7;
  font-size: 12px;
  font-weight: 750;
}
.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
}
.login-card {
  width: min(420px, 100%);
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  padding: 22px;
  display: grid;
  gap: 12px;
}
.login-card h1 { margin: 0; }
.login-card p { margin: 0; color: var(--soft); }
.login-card input { font-size: 16px; margin: 0; }
.login-logo { width: 72px; height: 72px; object-fit: contain; background: white; border-radius: 12px; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 28px;
  background: var(--ink);
  color: #f6f1e7;
  border-bottom: 4px solid var(--plate);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-copy { min-width: 0; }
.brand-title { display: flex; align-items: center; gap: 10px; }
.brand h1 { margin: 0; font-size: 26px; letter-spacing: -0.04em; line-height: 1; }
.brand p { margin: 3px 0 0; color: rgba(246, 241, 231, 0.72); font-size: 13px; }
.brand-plate {
  width: 46px;
  height: 28px;
  border-radius: 4px;
  background: var(--plate);
  color: #141414;
  display: flex;
  overflow: hidden;
  border: 1.5px solid #111;
  flex: none;
}
.brand-plate span {
  width: 12px;
  background: var(--band);
}
.brand-plate b {
  flex: 1;
  display: grid;
  place-items: center;
  font-size: 12px;
  letter-spacing: 0.04em;
}
.top-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.top .btn, .view-switch .btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.top .btn {
  background: transparent;
  color: #f6f1e7;
  border-color: rgba(246, 241, 231, 0.4);
}
.top .btn svg, .view-switch .btn svg { display: block; flex: none; }
.top .btn[aria-current="page"] { border-color: #f6f1e7; }
.top .btn.primary {
  background: var(--plate);
  color: var(--ink);
  border-color: var(--plate);
}

.notice {
  background: #fff6dc;
  color: #6a4b00;
  padding: 8px 28px;
  font-size: 14px;
  font-weight: 650;
  border-bottom: 1px solid #ead49a;
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 0 12px;
}

.tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.tile {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  padding: 12px;
  min-height: 84px;
  font: inherit;
  color: inherit;
}
button.tile { cursor: pointer; }
.tile[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--ink); }
.tile.is-hot { background: #fff6f5; border-color: #f0c2bd; }
.tile.is-warm { background: #fff8ea; border-color: #efd7a4; }
.tile .num {
  display: block;
  font-size: 30px;
  font-weight: 750;
  letter-spacing: -0.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.tile .label { display: block; margin-top: 4px; color: var(--soft); font-size: 13px; font-weight: 650; }
.mark {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #fbf7f1;
  background: #8a8175;
  flex: none;
}
.tile.is-live .mark.all,
.tile.is-live .mark.out { background: #0c6b3c; }
.tile.is-live .mark.free { background: #3e4a40; }
.tile.is-live .mark.month { background: var(--ink); }
.tile.is-hot .mark.overdue { background: var(--red); }
.tile.is-warm .mark.soon { background: #8a5a00; }

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 12px;
  flex-wrap: wrap;
}
.search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: white;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0 12px;
  height: 40px;
  flex: 1;
  max-width: 320px;
  color: var(--soft);
}
.search input {
  border: 0;
  height: 36px;
  padding: 0;
  width: 100%;
  background: transparent;
  color: var(--ink);
}
.search input:focus { outline: none; }
.search:focus-within { border-color: var(--focus); box-shadow: 0 0 0 3px rgba(11, 47, 138, 0.16); }

.table-wrap {
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  overflow: auto;
}
table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.car-name, .who span { overflow: hidden; text-overflow: ellipsis; }
th, td { padding: 10px 12px; text-align: left; vertical-align: middle; }
th:last-child, td:last-child { padding-right: 16px; }
th {
  font-size: 12px;
  font-weight: 750;
  color: var(--soft);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
th button {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-weight: 750;
  color: inherit;
}
th[aria-sort="ascending"] button::after { content: " ↑"; }
th[aria-sort="descending"] button::after { content: " ↓"; }
td { border-bottom: 1px solid #efe7db; background: var(--card); }
tr.car:hover td { background: #f4efe6; }
tr.flash td { animation: flash 1.2s ease; }
tr.detail td { background: #f6f1e7; padding: 4px 16px 16px 56px; }
@keyframes flash { from { background: #e3f5ea; } to { background: var(--card); } }

.chevron {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--soft);
  display: grid;
  place-items: center;
}
.chevron[aria-expanded="true"] svg { transform: rotate(90deg); }
.c-open { width: 44px; }
.c-picture { width: 112px; }
.c-plate { width: 146px; }
.c-pill { width: 112px; }
.c-client { width: 128px; }
.c-days { width: 104px; }
.c-check { width: 132px; }
.car-art svg { width: 100px; height: auto; display: block; }
.car-name { font-weight: 750; letter-spacing: -0.02em; white-space: nowrap; }
.car-meta { color: var(--soft); font-size: 13px; margin-top: 2px; }
.plate {
  display: inline-flex;
  flex: none;
  align-items: stretch;
  width: max-content;
  height: 36px;
  background: var(--plate);
  border: 1.5px solid #161616;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.18);
  white-space: nowrap;
}
.plate-band {
  width: 24px;
  background: var(--band);
  color: white;
  display: flex;
  flex: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
}
.plate-band svg { width: 14px; height: 7px; display: block; }
.plate-uk { font-size: 8px; font-weight: 800; letter-spacing: 0.06em; line-height: 1; }
.plate-text {
  display: flex;
  align-items: center;
  padding: 0 9px 0 8px;
  font-family: Inter, "Arial Narrow", "Liberation Sans", "Segoe UI", sans-serif;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.04em;
  color: #141414;
  white-space: nowrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 28px;
  padding: 0 9px 0 7px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.pill.ok { background: var(--green-wash); color: var(--green); }
.pill.soon { background: var(--amber-wash); color: var(--amber); }
.pill.overdue { background: var(--red-wash); color: var(--red); }
.pill.none { background: var(--none-wash); color: var(--none); font-weight: 650; }
.pill.sorn { background: var(--slate-wash); color: var(--slate); }

.who { display: inline-flex; align-items: center; gap: 6px; max-width: 180px; font-weight: 700; }
.who.free { color: var(--soft); font-weight: 650; }
.who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.days { display: flex; align-items: center; gap: 8px; min-width: 92px; }
.days b { font-variant-numeric: tabular-nums; min-width: 1.6em; font-size: 15px; }
.days.zero b { color: var(--soft); font-weight: 650; }
.track { width: 64px; height: 8px; border-radius: 99px; background: #e6dfd2; overflow: hidden; display: inline-block; }
.fill { display: block; height: 100%; background: #0c6b3c; border-radius: 99px; }

.btn {
  height: 38px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: white;
  font-weight: 750;
}
.btn.small { height: 32px; padding: 0 10px; font-size: 13px; }
.btn.primary { background: var(--plate); border-color: #1c1915; }
.btn.danger { background: var(--red); border-color: var(--red); color: white; }
.btn.quiet { background: transparent; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-gov { height: 32px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--line-strong); background: white; font-weight: 800; font-size: 12px; letter-spacing: 0.01em; white-space: nowrap; max-width: 100%; }
.btn-gov:hover { border-color: var(--ink); }

.expand { display: grid; grid-template-columns: minmax(240px, 320px) 1fr; gap: 22px; }
.fact { display: flex; align-items: center; gap: 8px; margin: 6px 0; }
.fact-label { width: 84px; color: var(--soft); font-size: 13px; font-weight: 700; }
.when { color: var(--soft); font-variant-numeric: tabular-nums; font-size: 14px; }
.checked { color: var(--soft); font-size: 13px; margin: 8px 0; }
.notes { margin: 8px 0 0; font-size: 14px; }
.row-actions, .hire-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.history-head { display: flex; gap: 8px; align-items: center; justify-content: space-between; margin-bottom: 8px; flex-wrap: wrap; }
.history-head h3 { margin: 0; font-size: 16px; }
.quiet { color: var(--soft); margin: 8px 0; }
#add-status { margin: 0 0 10px; font-weight: 700; }
.totals { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.total {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px 4px 4px;
  font-weight: 700;
}
.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: white;
  font-size: 13px;
}
.total b { font-variant-numeric: tabular-nums; }
.hire {
  display: grid;
  grid-template-columns: minmax(170px, 1.3fr) minmax(90px, 1fr) 42px minmax(140px, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  font-size: 14px;
}
.hire .when { color: var(--ink); }
.blank, .loading {
  text-align: center;
  color: var(--soft);
  padding: 28px 12px;
}
.blank svg { width: 120px; height: auto; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  background: var(--ink);
  color: #f6f1e7;
  padding: 12px 16px;
  border-radius: 999px;
  font-weight: 700;
  max-width: min(640px, calc(100% - 24px));
  z-index: 30;
  box-shadow: 0 12px 40px rgba(28, 25, 21, 0.28);
}
.toast.bad { background: var(--red); }

.fineprint {
  width: min(1180px, calc(100% - 32px));
  margin: 8px auto 28px;
  color: var(--soft);
  font-size: 12px;
}

dialog {
  border: 0;
  padding: 0;
  border-radius: 18px;
  width: min(560px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  box-shadow: 0 24px 80px rgba(28, 25, 21, 0.28);
  color: var(--ink);
  overflow-x: hidden;
}
dialog::backdrop { background: rgba(28, 25, 21, 0.48); }
dialog form { padding: 22px; max-width: 100%; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
h2 { margin: 0; font-size: 22px; letter-spacing: -0.03em; }
.icon-btn {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-size: 22px;
  line-height: 1;
}
label, .field { display: block; font-size: 13px; font-weight: 750; margin: 0 0 12px; }
input, select {
  display: block;
  width: 100%;
  height: 42px;
  margin-top: 6px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: white;
  padding: 0 12px;
  font-weight: 550;
}
.money { position: relative; }
.money input { padding-left: 28px; }
.money i {
  position: absolute;
  left: 12px;
  bottom: 11px;
  font-style: normal;
  color: var(--soft);
  font-weight: 700;
}
fieldset { border: 0; margin: 0 0 12px; padding: 0; }
legend { font-size: 13px; font-weight: 750; margin-bottom: 8px; }
.grid-2, .grid-3 { display: grid; gap: 12px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.form-error {
  background: var(--red-wash);
  color: var(--red);
  border-radius: 10px;
  padding: 8px 10px;
  margin: 0 0 12px;
  font-weight: 700;
}
.plate-preview { display: flex; justify-content: center; margin: 4px 0 12px; }
.plate-preview .plate { transform: scale(1.2); transform-origin: center; margin: 8px 0; }
.body-pick { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.body-pick button {
  border: 1.5px solid transparent;
  background: #f3eee6;
  border-radius: 12px;
  padding: 4px 4px 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--soft);
}
.body-pick button[aria-pressed="true"] { border-color: var(--ink); background: white; color: var(--ink); }
.body-pick svg { width: 100%; height: auto; display: block; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.25);
  padding: 0;
}
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--ink); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; align-items: center; }
.dialog-actions .spacer { flex: 1; }
.blurb { margin: 0 0 12px; font-weight: 700; }
.brand-logo { height: 36px; width: auto; max-width: 120px; object-fit: contain; background: white; border-radius: 8px; }
.btn.primary { background: var(--accent, var(--plate)); color: var(--accent-ink, var(--ink)); border-color: var(--accent, #1c1915); }
.top { border-bottom-color: var(--accent, var(--plate)); }
.settings { display: grid; gap: 14px; }
.settings > h2 { margin: 0; }
.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.85fr);
  gap: 16px;
  align-items: start;
}
.settings-side { display: grid; gap: 16px; min-width: 0; }
.settings-card {
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  padding: 16px 18px 18px;
  display: grid;
  gap: 12px;
  min-width: 0;
}
.settings-card h3 { margin: 0; display: flex; align-items: center; gap: 8px; }
.key-fields { display: grid; gap: 12px; }
.key-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  min-width: 0;
}
.key-row label { display: grid; gap: 4px; margin: 0; min-width: 0; }
.key-row input { margin: 0; min-width: 0; width: 100%; }
.key-actions { display: flex; gap: 6px; flex: none; }
.settings label.brand-row { display: grid; gap: 4px; margin: 0; min-width: 0; }
.settings label.brand-row span { font-weight: 750; }
.settings label.brand-row input,
.settings label.brand-row select { margin: 0; min-width: 0; width: 100%; }
.settings label.brand-row input[type="color"] { width: 72px; height: 40px; padding: 4px; }
.key-name { display: flex; flex-direction: column; gap: 1px; font-weight: 750; }
.saved { color: var(--green); font-weight: 750; font-size: 12px; }
.saved::before { content: "✓ "; }
input[type="color"] { width: 64px; height: 36px; padding: 3px; }
.test-ok, .test-bad { font-weight: 750; margin: 0; }
.test-ok { color: var(--green); }
.test-bad { color: var(--red); }
.tests { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.logo-preview { width: 72px; height: 72px; object-fit: contain; background: white; border-radius: 12px; border: 1px solid var(--line); }
.preset-row { display: flex; flex-wrap: wrap; gap: 6px; }
.preset-row .btn[aria-pressed="true"] { background: var(--ink); color: #f6f1e7; border-color: var(--ink); }
.mail-note { margin: 0; color: var(--soft); font-size: 13px; line-height: 1.4; }
.mail-note a { color: var(--ink); font-weight: 750; }
.viewbar { display: flex; justify-content: flex-end; margin-bottom: 12px; }
.plate-add { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.plate-add label { margin: 0; }
.plate-add input {
  width: 148px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  padding: 0 14px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: white;
}
.inbox-open { display: inline-flex; align-items: center; gap: 6px; }
.count {
  min-width: 1.35em;
  height: 1.35em;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--red);
  color: white;
  font-size: 12px;
  font-weight: 800;
  display: inline-grid;
  place-items: center;
}
#inbox-list { max-height: 60vh; overflow: auto; }
.mail-hit { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.mail-hit p { margin: 2px 0 0; }
.mail-hit span, .mail-hit b { margin-right: 8px; }
.mail-actions { display: flex; flex-direction: column; gap: 6px; }
.fine.paid { opacity: 0.55; }
@media (max-width: 1100px) {
  .settings-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .plate-add { margin-left: 0; width: 100%; }
  .plate-add input { flex: 1; width: auto; }
}
@media (max-width: 640px) {
  .key-row { grid-template-columns: 1fr; }
}
.view-switch .btn[aria-pressed="true"] { background: var(--ink); color: #f6f1e7; border-color: var(--ink); }
.photo-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.photo-frame {
  width: 120px;
  height: 72px;
  border-radius: 12px;
  background: #f3eee6;
  display: grid;
  place-items: center;
  overflow: hidden;
  flex: none;
}
.photo-frame svg { width: 110px; height: auto; }
.photo-actions { display: flex; flex-direction: column; gap: 6px; }
.car-photo { width: 112px; height: 68px; object-fit: cover; border-radius: 10px; display: block; background: #efeae2; }
.photo-frame .car-photo { width: 120px; height: 72px; border-radius: 0; }
.row-end { display: inline-flex; align-items: center; gap: 6px; }
.pin {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  color: var(--ink);
  background: white;
}
.tracker-link { font-weight: 750; }
.fines { margin-top: 14px; }
.fine, .day-line { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 6px 0; border-top: 1px solid var(--line); }
.fine-line { color: var(--red); }
.calendar { background: var(--card); border: 1px solid var(--line-strong); border-radius: 18px; padding: 14px; }
.cal-head { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; margin-bottom: 10px; }
.cal-head h2 { margin: 0; text-align: center; font-size: 22px; }
.cal-week, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-week { color: var(--soft); font-size: 12px; font-weight: 750; text-align: center; margin-bottom: 6px; }
.cal-day {
  min-height: 78px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  padding: 6px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cal-day.empty { background: transparent; border-color: transparent; }
.cal-day.today { box-shadow: inset 0 0 0 2px var(--ink); }
.cal-day.selected { background: #fff6dc; }
.cal-num { font-weight: 750; font-variant-numeric: tabular-nums; }
.cal-bar {
  display: block;
  color: white;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 750;
  padding: 2px 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cal-fine { align-self: flex-start; background: var(--red); color: white; border-radius: 999px; font-size: 11px; font-weight: 800; padding: 0 6px; }
.day-detail { margin-top: 12px; }
.day-detail h3 { margin: 0 0 6px; }
.track-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin-top: 12px; }
.track-card {
  display: flex;
  gap: 12px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  padding: 12px;
}
.track-copy { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.track-copy p { margin: 0; font-weight: 700; }
.tracker-map {
  position: relative;
  height: 360px;
  border-radius: 18px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.15), transparent 40%),
    linear-gradient(135deg, #d7e4d4 0%, #c5d7e8 45%, #d5e3c8 100%);
  border: 1px solid var(--line-strong);
}
.map-note {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  text-align: center;
}
.map-note p {
  margin: 0;
  background: rgba(251, 247, 241, 0.94);
  border-radius: 999px;
  padding: 12px 16px;
  font-weight: 750;
}
.leaflet-container { font: inherit; height: 100%; }

@media (max-width: 980px) {
  .tiles { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 1100px) {
  .table-wrap { overflow: visible; }
  table { min-width: 0; }
  thead { display: none; }
  tr.car {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) auto;
    gap: 8px 10px;
    align-items: center;
    padding: 12px;
  }
  tr.car td {
    display: block;
    padding: 0;
    border: 0;
    background: transparent;
  }
  tr.car td:nth-child(1) { grid-column: 1; grid-row: 1 / span 2; }
  tr.car td:nth-child(2) { grid-column: 2; grid-row: 1; }
  tr.car td:nth-child(3) { grid-column: 3; grid-row: 1; justify-self: end; }
  tr.car td:nth-child(4) { grid-column: 2 / -1; grid-row: 2; }
  tr.car td:nth-child(5) { grid-column: 1; grid-row: 3; }
  tr.car td:nth-child(6) { grid-column: 2; grid-row: 3; }
  tr.car td:nth-child(7) { grid-column: 3; grid-row: 3; justify-self: end; }
  tr.car td:nth-child(8) { grid-column: 1 / span 2; grid-row: 4; }
  tr.car td:nth-child(9) { grid-column: 3; grid-row: 4; justify-self: end; }
  tr.car td:nth-child(10) { grid-column: 1 / -1; grid-row: 5; }
  tr.car td:nth-child(10) .btn-gov { width: 100%; }
  tr.car:hover td { background: transparent; }
  tr.detail td { display: block; padding: 4px 12px 16px; }
  .car-art svg { width: 132px; }
  .days { min-width: 0; }
}
@media (max-width: 720px) {
  html { -webkit-text-size-adjust: 100%; }
  html, body { overflow-x: clip; max-width: 100%; }
  .top {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: max(12px, env(safe-area-inset-top)) 14px 12px;
  }
  .brand { width: 100%; }
  .brand-title { min-width: 0; }
  .brand h1 {
    font-size: 22px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  #go-home { flex: none; min-height: 40px; }
  .top, .top-actions { min-width: 0; max-width: 100%; }
  .top-actions {
    width: 100%;
    flex-wrap: wrap;
    justify-content: stretch;
    overflow: visible;
  }
  .top .btn { flex: 1 1 calc(50% - 8px); justify-content: center; min-height: 44px; padding: 0 10px; }
  .brand-logo { height: 32px; max-width: 72px; flex: none; }
  .notice { padding: 8px 14px; }
  main, .fineprint { width: min(100% - 20px, 1180px); }
  .viewbar { margin: 0 0 12px; }
  .view-switch { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; gap: 6px; }
  .view-switch .btn { justify-content: center; width: 100%; min-height: 44px; padding: 0 8px; }
  .tiles { grid-template-columns: 1fr 1fr; gap: 8px; }
  .tile { min-height: 72px; padding: 10px; gap: 8px; }
  .tile .num { font-size: 26px; }
  .mark { width: 36px; height: 36px; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .search { max-width: none; width: 100%; height: 48px; }
  .search input, .plate-add input, input, select, textarea { font-size: 16px; }
  .plate-add { margin-left: 0; width: 100%; }
  .plate-add input { flex: 1; width: auto; min-width: 0; height: 48px; }
  .plate-add .btn { min-height: 48px; }
  .table-wrap { background: transparent; border: 0; overflow: visible; border-radius: 0; }
  table, tbody { display: block; width: 100%; min-width: 0; }
  thead { display: none; }
  tr.car {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 8px 10px;
    align-items: center;
    padding: 12px;
    margin: 0;
    background: var(--card);
    border: 1px solid var(--line-strong);
    border-radius: 16px;
    min-width: 0;
  }
  tr.car + tr.car, tr.detail + tr.car { margin-top: 10px; }
  tr.car td {
    display: block;
    padding: 0;
    border: 0;
    background: transparent;
    min-width: 0;
    grid-column: auto;
    grid-row: auto;
  }
  tr.car td:nth-child(1) { grid-column: 1 / 3; grid-row: 1; }
  tr.car td:nth-child(2) { grid-column: 3 / 6; grid-row: 1; }
  tr.car td:nth-child(4) { grid-column: 6 / 13; grid-row: 1; }
  tr.car td:nth-child(3) { grid-column: 1 / 13; grid-row: 2; }
  tr.car td:nth-child(5) { grid-column: 1 / 5; grid-row: 3; }
  tr.car td:nth-child(6) { grid-column: 5 / 9; grid-row: 3; }
  tr.car td:nth-child(7) { grid-column: 9 / 13; grid-row: 3; }
  tr.car td:nth-child(8) { grid-column: 1 / 8; grid-row: 4; }
  tr.car td:nth-child(9) { grid-column: 8 / 13; grid-row: 4; justify-self: end; }
  tr.car td:nth-child(10) { grid-column: 1 / 13; grid-row: 5; }
  tr.car td:nth-child(5)::before,
  tr.car td:nth-child(6)::before,
  tr.car td:nth-child(7)::before {
    display: block;
    margin-bottom: 4px;
    color: var(--soft);
    font-size: 11px;
    font-weight: 750;
    line-height: 1.2;
  }
  tr.car td:nth-child(5)::before { content: "Insurance"; }
  tr.car td:nth-child(6)::before { content: "MOT"; }
  tr.car td:nth-child(7)::before { content: "Tax"; }
  tr.car:hover td { background: transparent; }
  .car-art svg, .car-photo { width: 76px; height: auto; }
  .car-name { white-space: normal; }
  .plate { max-width: 100%; }
  .who { max-width: 100%; }
  .days { min-width: 0; }
  .chevron { width: 44px; height: 44px; }
  tr.car td:nth-child(10) .btn-gov { width: 100%; min-height: 44px; }
  tr.detail { display: block; margin-top: 8px; }
  tr.detail td { display: block; padding: 12px; background: var(--card); border: 1px solid var(--line-strong); border-radius: 16px; }
  .expand, .grid-2, .grid-3, .hire { grid-template-columns: 1fr; }
  .hire { gap: 4px; }
  .body-pick { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cal-week, .cal-grid { gap: 3px; min-width: 0; }
  .cal-day { min-height: 44px; min-width: 0; padding: 3px; }
  .cal-bar { font-size: 0; padding: 3px; }
  .cal-head h2 { font-size: 18px; }
  .tracker-map { height: 240px; }
  .track-list { grid-template-columns: 1fr; }
  .track-card { min-width: 0; }
  .mail-hit { grid-template-columns: 1fr; }
  .mail-actions { flex-direction: row; }
  .mail-actions .btn { flex: 1; min-height: 44px; }
  .settings-card { padding: 14px; }
  .key-actions .btn, .settings .btn { min-height: 44px; }
  dialog {
    width: calc(100vw - 16px);
    max-width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
    margin: auto;
    border-radius: 16px;
  }
  dialog form { padding: 16px; }
  .dialog-actions { flex-wrap: wrap; }
  .dialog-actions .btn { flex: 1; min-height: 44px; }
  .photo-row { flex-wrap: wrap; }
  .toast { bottom: max(18px, env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
