/* TaxTrack - mobile-first. All colour, type and spacing decisions are tokens
   here, so light and dark stay in step and nothing is styled ad hoc. */

:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --sunken: #f5f5f3;
  --ink: #14171a;
  --muted: #646b72;
  --faint: #8d949b;
  --line: #e4e4e0;
  --line-strong: #cfcfca;
  --accent: #1a6350;
  --accent-ink: #ffffff;
  --accent-soft: #eaf2ef;
  --accent-2: #8a6a2f;
  --btn: #14171a;
  --btn-ink: #ffffff;
  --warn: #8f5600;
  --warn-soft: #fbf4e4;
  --danger: #a8281f;
  --ok: #1a6350;        --ok-soft: #eaf2ef;
  --amber: #8a6300;     --amber-soft: #fbf5df;
  --orange: #9a4a09;    --orange-soft: #fcefe3;
  --red: #a8281f;       --red-soft: #fbecea;
  --gray: #565d64;      --gray-soft: #f0f0ee;
  --radius: 6px;
  --nav-h: 58px;
  --gap: 16px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #101214; --surface: #16191c; --sunken: #1b1f23; --ink: #eceeef; --muted: #9aa2a9; --faint: #757d85; --line: #272c31; --line-strong: #3a4046;
    --accent: #6cc7a8; --accent-ink: #0c1512; --accent-soft: #17251f; --accent-2: #d1a95c; --btn: #eceeef; --btn-ink: #101214;
    --warn: #e2b05a; --warn-soft: #2a2416; --danger: #f08a82;
    --ok: #6cc7a8; --ok-soft: #17251f; --amber: #e3bd5b; --amber-soft: #2a2512; --orange: #f0a468; --orange-soft: #2c1f14; --red: #f08a82; --red-soft: #2d1917; --gray: #a7afb6; --gray-soft: #1f2327;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #101214; --surface: #16191c; --sunken: #1b1f23; --ink: #eceeef; --muted: #9aa2a9; --faint: #757d85; --line: #272c31; --line-strong: #3a4046;
  --accent: #6cc7a8; --accent-ink: #0c1512; --accent-soft: #17251f; --accent-2: #d1a95c; --btn: #eceeef; --btn-ink: #101214;
  --warn: #e2b05a; --warn-soft: #2a2416; --danger: #f08a82;
  --ok: #6cc7a8; --ok-soft: #17251f; --amber: #e3bd5b; --amber-soft: #2a2512; --orange: #f0a468; --orange-soft: #2c1f14; --red: #f08a82; --red-soft: #2d1917; --gray: #a7afb6; --gray-soft: #1f2327;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
body.has-modal { overflow: hidden; }
[hidden] { display: none !important; }
a { color: var(--accent); text-underline-offset: 2px; }
h1 { font-size: 1.5rem; margin: 0; line-height: 1.2; letter-spacing: -0.02em; font-weight: 650; }
h2 { font-size: 0.75rem; margin: 0 0 12px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); font-weight: 600; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
h2 small { text-transform: none; letter-spacing: 0; font-weight: 400; font-size: 0.8rem; }
h3 { font-size: 1rem; margin: 0 0 6px; font-weight: 650; letter-spacing: -0.005em; }
p { margin: 0 0 10px; }
small { font-size: 0.8rem; color: var(--muted); }
.muted { color: var(--muted); font-size: 0.875rem; }
.warn-text { color: var(--warn); }
.link { font-size: 0.8rem; text-transform: none; letter-spacing: 0; font-weight: 500; }
em.warn-text { font-style: normal; }

/* ---- shell ---- */
.top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(8px + env(safe-area-inset-top)) var(--gap) 8px; background: var(--bg); border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 650; color: var(--ink); text-decoration: none; letter-spacing: -0.015em; }
.brand-mark { width: 18px; height: 18px; border-radius: 4px; background: var(--ink); position: relative; }
.brand-mark::after { content: ""; position: absolute; left: 4px; right: 4px; bottom: 4px; height: 2px; background: var(--bg); box-shadow: 0 -4px 0 var(--bg); }
.top-right { display: flex; align-items: center; gap: 6px; }
.top-link { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 10px; color: var(--muted); text-decoration: none; font-size: 0.875rem; font-weight: 500; border-radius: var(--radius); }
.top-link:hover { color: var(--ink); background: var(--sunken); }
.count { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--warn); color: var(--bg); font-size: 0.7rem; font-weight: 700; line-height: 18px; text-align: center; font-variant-numeric: tabular-nums; }
#year { width: auto; min-height: 36px; padding: 4px 28px 4px 10px; font-weight: 600; font-size: 0.875rem; }
main { padding: 20px var(--gap) calc(var(--nav-h) + 36px + env(safe-area-inset-bottom)); max-width: 880px; margin: 0 auto; }
.side { display: none; }
.bottom {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: 1fr 1fr 64px 1fr 1fr; align-items: center;
  background: var(--bg); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
}
.bottom a { display: flex; align-items: center; justify-content: center; height: var(--nav-h); color: var(--muted); text-decoration: none; font-size: 0.8rem; font-weight: 550; }
.bottom a.on { color: var(--ink); font-weight: 650; box-shadow: inset 0 2px 0 var(--ink); }
.fab { justify-self: center; width: 46px; height: 46px; border: 0; border-radius: 50%; background: var(--btn); color: var(--btn-ink); font-size: 1.6rem; font-weight: 300; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0 0 3px; }
.fab:active { opacity: 0.8; }

@media (min-width: 900px) {
  .bottom { display: none; }
  .top { padding-left: 24px; padding-right: 24px; }
  .side {
    display: flex; flex-direction: column; position: fixed; top: 53px; bottom: 0; left: 0; width: 232px;
    padding: 16px 12px 24px; border-right: 1px solid var(--line); overflow-y: auto; background: var(--bg);
  }
  .side a { padding: 7px 12px; color: var(--muted); text-decoration: none; border-radius: var(--radius); font-size: 0.9rem; }
  .side a:hover { color: var(--ink); background: var(--sunken); }
  .side a.on { background: var(--sunken); color: var(--ink); font-weight: 600; }
  .side h3 { margin: 18px 12px 4px; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--faint); font-weight: 600; }
  .side hr { border: 0; border-top: 1px solid var(--line); margin: 14px 12px 8px; width: auto; }
  main { margin-left: 232px; padding: 32px 40px 64px; max-width: 980px; }
}

/* ---- page pieces ---- */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head p { margin: 6px 0 0; max-width: 60ch; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.section-title { margin-top: 28px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.panel.notice { border-left: 3px solid var(--warn); }
.callout { background: var(--warn-soft); border-left: 3px solid var(--warn); padding: 10px 12px; font-size: 0.875rem; border-radius: 0 var(--radius) var(--radius) 0; }
.note { border-top: 1px solid var(--line); margin-top: 24px; padding-top: 16px; font-size: 0.9rem; color: var(--muted); }
.note strong { color: var(--ink); }
.disclaimer { font-size: 0.8rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: 12px; margin-top: 20px; }
.where, .foot { margin-top: 28px; font-size: 0.8rem; }
.empty { color: var(--muted); padding: 14px 0; margin: 0; font-size: 0.9rem; }
.link-back { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font: inherit; font-size: 0.9rem; text-decoration: underline; text-underline-offset: 2px; }

/* ---- buttons ---- */
button, input, select, textarea { font: inherit; color: inherit; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 8px 14px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); color: var(--ink);
  font-weight: 550; font-size: 0.9rem; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--btn); border-color: var(--btn); color: var(--btn-ink); }
.btn.primary:hover { opacity: 0.88; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger-text { color: var(--danger); }
.btn.small { min-height: 34px; padding: 4px 10px; font-size: 0.82rem; }
.btn small { font-weight: 400; }
.btn:disabled { opacity: 0.5; }
.btn-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }
.icon-btn { background: none; border: 0; width: 44px; height: 44px; font-size: 1.1rem; cursor: pointer; color: var(--muted); }
.link-btn { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; padding: 12px; font-size: 0.85rem; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.quick-btn { min-height: 60px; background: var(--btn); color: var(--btn-ink); border: 0; border-radius: var(--radius); font-size: 1rem; font-weight: 600; cursor: pointer; }
.quick-btn:active { opacity: 0.85; }
.quick > .quick-btn:last-child:nth-child(odd) { grid-column: 1 / -1; }
@media (min-width: 700px) { .quick { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); } .quick > .quick-btn:last-child:nth-child(odd) { grid-column: auto; } }
.reasons { margin-top: 10px; color: var(--muted); }

/* ---- numbers ---- */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 12px; }
.stat { display: flex; flex-direction: column; min-width: 0; }
.stat-label { font-size: 0.78rem; color: var(--muted); }
.stat-value { font-size: 1.3rem; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -0.015em; line-height: 1.25; overflow-wrap: anywhere; }
.stat.big .stat-value { font-size: 1.8rem; }
.stat.accent .stat-value { color: var(--accent); }
.stat-sub { font-size: 0.76rem; color: var(--muted); }
.stats.strip { grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 14px 0; margin-bottom: 16px; gap: 8px; }
.stats.strip .stat-value { font-size: 1.05rem; }
@media (min-width: 700px) { .stats { grid-template-columns: repeat(3, 1fr); } .stats.strip .stat-value { font-size: 1.3rem; } }
.hero { display: flex; flex-direction: column; gap: 2px; }
.hero-value { font-size: 2.3rem; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -0.03em; line-height: 1.15; }

.line { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 0.92rem; }
.line:last-of-type { border-bottom: 0; }
.line span:last-child { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.line.total { font-weight: 650; border-top: 1px solid var(--line-strong); }
.line.strong { font-size: 1.02rem; }
.line small { font-weight: 400; display: block; }

/* ---- rows ---- */
.row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 12px 2px; min-height: 52px;
  background: none; border: 0; border-bottom: 1px solid var(--line); text-align: left; cursor: pointer; text-decoration: none; color: var(--ink);
}
.row.static { cursor: default; }
.row:last-child { border-bottom: 0; }
.row-main { min-width: 0; display: flex; flex-direction: column; }
.row-title { font-weight: 550; overflow-wrap: anywhere; }
.row-sub { font-size: 0.8rem; color: var(--muted); }
.row-amt { display: flex; flex-direction: column; align-items: flex-end; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.row-amt strong { font-weight: 600; }
.row-amt small { white-space: nowrap; }
.row-btns { display: flex; gap: 6px; margin-top: 6px; }
.group { margin-bottom: 20px; }
.group h3 { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); font-weight: 600; margin: 0; padding: 8px 2px; border-bottom: 1px solid var(--line-strong); }
.group h3 a { color: inherit; text-decoration: none; }
.group h3 span { text-transform: none; letter-spacing: 0; font-variant-numeric: tabular-nums; font-weight: 500; }
.menu, .list { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.menu .row-amt { color: var(--faint); font-size: 1.2rem; }
.panel .menu { border: 0; }
.tag { display: inline-block; font-size: 0.68rem; font-weight: 600; padding: 1px 6px; border: 1px solid var(--line-strong); border-radius: 3px; color: var(--muted); vertical-align: 1px; margin-left: 4px; white-space: nowrap; }
.tag.warn { color: var(--warn); border-color: var(--warn); }
.tag.ok { color: var(--accent); border-color: var(--accent); }
.tag.link-tag { color: var(--accent); text-decoration: underline; }

/* ---- tables ---- */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 14px; }
.panel .table-wrap { border: 0; margin: 0 -4px; }
.table { width: 100%; border-collapse: collapse; font-size: 0.86rem; font-variant-numeric: tabular-nums; }
.table th, .table td { padding: 10px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table th:first-child, .table td:first-child { text-align: left; white-space: normal; min-width: 130px; }
.table th { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tfoot td { font-weight: 650; border-bottom: 0; border-top: 1px solid var(--line-strong); }
.table tfoot tr + tr td { border-top: 0; }
.table tbody tr[data-act], .table tbody tr[data-href] { cursor: pointer; }
.table tr.dim td { color: var(--faint); }
.table.sources td, .table.sources th { text-align: left; white-space: normal; }

/* ---- forms ---- */
input[type=text], input[type=search], input[type=date], input[type=month], input[type=tel], input[type=email], input[type=password], input[type=time], select, textarea {
  width: 100%; min-height: 46px; padding: 9px 11px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius);
  font-size: 16px; /* 16px stops iOS zooming on focus */
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
select { appearance: none; -webkit-appearance: none; padding-right: 30px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
input:disabled { opacity: 0.6; }
textarea { resize: vertical; }
textarea.code { font: 12px/1.4 ui-monospace, Menlo, Consolas, monospace; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 10px; }
.f { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.f.half { grid-column: auto; }
.f > label, .f > span { font-size: 0.8rem; font-weight: 550; color: var(--muted); }
.f label i { color: var(--danger); font-style: normal; }
.seg { display: flex; border: 1px solid var(--line-strong); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.seg label { flex: 1; text-align: center; cursor: pointer; border-right: 1px solid var(--line-strong); }
.seg label:last-child { border-right: 0; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 4px 6px; font-size: 0.85rem; font-weight: 550; color: var(--muted); line-height: 1.15; }
.seg input:checked + span { background: var(--btn); color: var(--btn-ink); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: -2px; }
.check { flex-direction: row !important; align-items: center; gap: 10px !important; min-height: 44px; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--accent); flex-shrink: 0; }
.check span { font-size: 0.95rem !important; color: var(--ink) !important; font-weight: 450 !important; }
.info { font-size: 0.85rem; background: var(--sunken); padding: 10px 12px; border-radius: var(--radius); }
.info p { margin: 0 0 6px; }
.info p:last-child { margin: 0; }
.receipt-field { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
details.more { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 4px; }
details.more > summary, .filters summary { cursor: pointer; padding: 10px 0; font-weight: 550; font-size: 0.88rem; color: var(--accent); }
.form-error { color: var(--danger); font-weight: 600; margin: 12px 0 0; }
.form-intro { margin-bottom: 12px; }

.filters { margin-bottom: 14px; }
.filter-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: end; }
.filter-grid label { font-size: 0.78rem; color: var(--muted); }
.search { margin-bottom: 12px; }
.search.big { min-height: 54px; font-size: 1.05rem; padding: 12px 14px; }
.tabs { display: flex; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.tabs button { flex: 1; background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 4px; min-height: 44px; font-weight: 550; color: var(--muted); cursor: pointer; margin-bottom: -1px; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--ink); }
@media (min-width: 700px) { .filter-grid { grid-template-columns: repeat(4, 1fr); } .tabs button { flex: 0 0 auto; padding: 10px 18px; } }

/* ---- modal ---- */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, 0.42); display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--bg); width: 100%; max-width: 560px; max-height: 100%; height: 100%; display: flex; flex-direction: column; }
.sheet.wide { max-width: 760px; }
.sheet form { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: calc(6px + env(safe-area-inset-top)) 6px 6px var(--gap); border-bottom: 1px solid var(--line); }
.sheet-head h2 { margin: 0; font-size: 1.05rem; text-transform: none; letter-spacing: -0.01em; color: var(--ink); font-weight: 650; }
.sheet-body { padding: var(--gap); overflow-y: auto; flex: 1; -webkit-overflow-scrolling: touch; }
.sheet-foot { display: flex; gap: 8px; padding: 10px var(--gap) calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--bg); }
.grow { flex: 1; }
.modal.small { align-items: flex-end; z-index: 70; }
.modal.small .sheet { height: auto; max-height: 88%; border-radius: 14px 14px 0 0; padding-bottom: env(safe-area-inset-bottom); }
.modal.small .sheet-head { padding-top: 6px; }
.confirm-msg { font-weight: 650; font-size: 1.05rem; }
.receipt-view img { max-width: 100%; display: block; margin-bottom: 12px; border: 1px solid var(--line); }
@media (min-width: 700px) {
  .modal, .modal.small { align-items: center; padding: 24px; }
  .sheet { height: auto; max-height: 92vh; border-radius: 10px; border: 1px solid var(--line); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18); }
  .modal.small .sheet { border-radius: 10px; max-width: 440px; padding-bottom: 0; }
}
.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 20px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 80; white-space: pre-line; cursor: pointer;
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: var(--radius); font-size: 0.88rem; font-weight: 550; max-width: calc(100% - 32px); text-align: center; }

/* ---- charts ---- */
.chart-grid { display: grid; gap: 0 14px; }
@media (min-width: 700px) { .chart-grid { grid-template-columns: 1fr 1fr; } }
.chart { width: 100%; height: auto; display: block; }
.c-axis { stroke: var(--line); stroke-width: 1; }
.c-lab { font-size: 10px; fill: var(--muted); text-anchor: middle; }
.c-val { font-size: 9px; fill: var(--ink); text-anchor: middle; font-variant-numeric: tabular-nums; }
.rank-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; margin-bottom: 9px; font-size: 0.88rem; }
.rank-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-val { font-variant-numeric: tabular-nums; font-weight: 600; }
.rank-track { grid-column: 1 / -1; height: 4px; background: var(--sunken); }
.rank-track span { display: block; height: 100%; }
.split-track { height: 10px; background: var(--line); margin-bottom: 8px; }
.split-track span { display: block; height: 100%; background: var(--accent); border-right: 2px solid var(--surface); }
.split-legend { display: flex; flex-direction: column; gap: 2px; font-size: 0.88rem; font-variant-numeric: tabular-nums; }
.dot { display: inline-block; width: 9px; height: 9px; margin-right: 6px; }
.dot.a { background: var(--accent); }
.dot.b { background: var(--line); }

/* ---- review / reference ---- */
.review-group { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: -1px; }
.panel .review-group { border-bottom: 0; }
.review-group summary { display: flex; justify-content: space-between; gap: 8px; padding: 14px 2px; font-weight: 550; cursor: pointer; }
.review-group summary span { color: var(--muted); font-weight: 400; font-variant-numeric: tabular-nums; }
.review-group[open] { padding-bottom: 12px; }
.ref-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 12px; margin-bottom: 10px; }
.ref-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 0; }
.dl { display: grid; grid-template-columns: 1fr; gap: 0; margin: 0 0 10px; font-size: 0.9rem; }
.dl dt { color: var(--muted); font-size: 0.75rem; margin-top: 12px; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.dl dt:first-child { margin-top: 0; }
.dl dd { margin: 3px 0 0; overflow-wrap: anywhere; }
@media (min-width: 700px) { .dl { grid-template-columns: 170px 1fr; gap: 12px 16px; } .dl dt { margin-top: 3px; } .dl dd { margin: 0; } }
ul.plain { margin: 0 0 10px; padding-left: 18px; font-size: 0.9rem; }
ul.plain li { margin-bottom: 6px; }
.dl ul.plain { margin: 0; }

/* ---- sources and status ---- */
.badge { display: inline-block; font-size: 0.66rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; padding: 2px 7px; border-radius: 3px; white-space: nowrap; vertical-align: 1px; }
.badge.law, .badge.changed { color: var(--ok); background: var(--ok-soft); }
.badge.guidance, .badge.new { color: var(--gray); background: var(--gray-soft); }
.badge.proposed { color: var(--orange); background: var(--orange-soft); }
.badge.historical, .badge.expired { color: var(--red); background: var(--red-soft); }
.cite { font-size: 0.78rem; color: var(--muted); margin: 8px 0 0; line-height: 1.7; }
.cite a { color: var(--muted); }
.verdict { border-left: 4px solid var(--gray); background: var(--gray-soft); padding: 14px 16px; border-radius: 0 var(--radius) var(--radius) 0; margin: 0 0 14px; }
.verdict p:last-child { margin-bottom: 0; }
.verdict-label { display: block; font-size: 1.05rem; font-weight: 650; letter-spacing: -0.01em; margin-bottom: 6px; color: var(--gray); }
.verdict.green { border-color: var(--ok); background: var(--ok-soft); } .verdict.green .verdict-label { color: var(--ok); }
.verdict.yellow { border-color: var(--amber); background: var(--amber-soft); } .verdict.yellow .verdict-label { color: var(--amber); }
.verdict.orange { border-color: var(--orange); background: var(--orange-soft); } .verdict.orange .verdict-label { color: var(--orange); }
.verdict.red { border-color: var(--red); background: var(--red-soft); } .verdict.red .verdict-label { color: var(--red); }
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.pill { min-height: 40px; padding: 6px 14px; border: 1px solid var(--line-strong); border-radius: 20px; background: var(--surface); font-size: 0.9rem; cursor: pointer; }
.pill:hover { border-color: var(--ink); }
.q { padding: 14px 0; border-bottom: 1px solid var(--line); }
.q:first-child { padding-top: 0; } .q:last-child { border-bottom: 0; padding-bottom: 0; }
.q-text { font-weight: 550; margin-bottom: 8px; }
.q-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.q-opt { min-height: 44px; padding: 8px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); cursor: pointer; text-align: left; font-size: 0.92rem; }
.q-opt.on { background: var(--btn); color: var(--btn-ink); border-color: var(--btn); }
.q-input { display: flex; align-items: center; gap: 8px; }
.q-input input { max-width: 150px; }
.q-input span { color: var(--muted); }
.rule { border-top: 1px solid var(--line); padding: 16px 0; }
.article > p { font-size: 1rem; max-width: 66ch; }
.update h3 { margin-top: 8px; }
.update-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }

/* ---- reminders, checklist ---- */
.rem { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.rem:last-child { border-bottom: 0; padding-bottom: 0; }
.rem-main { display: flex; flex-direction: column; gap: 2px; flex: 1 1 260px; min-width: 0; }
.rem-main strong { font-weight: 600; }
.rem-date { font-size: 0.78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.rem-date.soon { color: var(--warn); font-weight: 600; } .rem-date.late { color: var(--danger); font-weight: 600; }
.rem-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.checks { margin: 8px 0 12px; }
.chk { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 6px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.chk input { width: 22px; height: 22px; accent-color: var(--accent); flex-shrink: 0; }
.chk span { flex: 1; display: flex; flex-direction: column; }
.chk.done span { color: var(--muted); }
.chk a { padding: 8px 4px 8px 12px; color: var(--faint); font-size: 1.2rem; text-decoration: none; }
ul.checklist { list-style: none; padding-left: 0; }
ul.checklist li.ok strong { color: var(--accent); }
ul.checklist li.todo strong { color: var(--warn); }
.progress { height: 4px; background: var(--line); margin: 4px 0 8px; border-radius: 2px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--accent); }

/* ---- dashboard ---- */
.dash-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.eyebrow { margin: 0 0 2px; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 600; }
.kpis { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); border-left: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 16px; }
.kpi { display: flex; flex-direction: column; gap: 2px; padding: 14px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); min-width: 0; }
.kpi:hover { background: var(--sunken); }
.kpi-label { font-size: 0.75rem; color: var(--muted); line-height: 1.3; min-height: 2.6em; }
.kpi-value { font-size: clamp(1.15rem, 5.2vw, 1.55rem); font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.2; overflow-wrap: anywhere; }
.kpi-sub { font-size: 0.72rem; color: var(--faint); }
@media (min-width: 760px) { .kpis { grid-template-columns: repeat(4, 1fr); } .kpi { padding: 18px; } .kpi-label { min-height: 0; } }
.quick-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 10px; }
.qa { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 64px; padding: 8px 4px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); font-size: 0.8rem; font-weight: 550; cursor: pointer; }
.qa.primary { background: var(--btn); color: var(--btn-ink); border-color: var(--btn); }
.qa:active { opacity: 0.8; }
.ico { width: 20px; height: 20px; flex-shrink: 0; }
@media (min-width: 760px) { .qa { flex-direction: row; gap: 8px; min-height: 48px; font-size: 0.9rem; } }
.ask { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); margin-bottom: 28px; }
.ask:hover { border-color: var(--line-strong); background: var(--sunken); }
.ask > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; }
.ask strong { font-weight: 600; }
.chev { color: var(--faint); font-size: 1.2rem; flex-shrink: 0; }
.block { margin-bottom: 28px; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; }
.block-head a { font-size: 0.85rem; text-decoration: none; }
.attn-list { border-top: 1px solid var(--line); }
.attn { display: flex; align-items: center; gap: 14px; min-height: 52px; padding: 8px 2px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.attn-n { min-width: 44px; font-size: 1.1rem; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.attn.warn .attn-n { color: var(--warn); }
.attn.zero .attn-n { color: var(--faint); font-weight: 500; }
.attn-label { flex: 1; font-size: 0.95rem; }
.attn-label small { display: block; }
.d-details { margin-top: 8px; border-top: 1px solid var(--line); }
.d-details > summary { cursor: pointer; padding: 14px 2px; font-weight: 550; font-size: 0.9rem; color: var(--accent); }
.d-details[open] > summary { margin-bottom: 8px; }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 14px; }
@media (min-width: 700px) { .dash-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.add-list { display: flex; flex-direction: column; }
.add-item { display: flex; align-items: center; gap: 14px; min-height: 56px; padding: 8px 2px; background: none; border: 0; border-bottom: 1px solid var(--line); text-align: left; cursor: pointer; }
.add-item:last-child { border-bottom: 0; }
.add-item span { display: flex; flex-direction: column; }
.add-item strong { font-weight: 550; }
.empty-state { padding: 10px 0 4px; }
.datebox { flex: 0 0 42px; display: flex; flex-direction: column; align-items: center; padding: 4px 0; background: var(--sunken); border-radius: var(--radius); font-size: 1rem; font-weight: 650; line-height: 1.1; font-variant-numeric: tabular-nums; }
.datebox b { font-size: 0.62rem; letter-spacing: 0.06em; color: var(--muted); }
.row-title.alert { font-weight: 500; font-size: 0.93rem; }

/* ---- mileage ---- */
.quick-btn.start { min-height: 68px; font-size: 1.08rem; }
.quick-btn.alt { background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); min-height: 52px; font-size: 0.9rem; font-weight: 550; }
.quick.three { grid-template-columns: 1fr 1fr; }
.quick.three .start { grid-column: 1 / -1; }
.quick.three > .quick-btn:last-child { grid-column: auto; }
@media (min-width: 700px) { .quick.three { grid-template-columns: 2fr 1fr 1fr; } .quick.three .start { grid-column: auto; } }
.quick-btn.wide { width: 100%; margin-bottom: 14px; }
.live { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 8px 8px 12px; margin-bottom: 14px; background: var(--ink); color: var(--bg); border-radius: var(--radius); font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.live .btn { background: var(--danger); border-color: var(--danger); color: #fff; }
.th-sort { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; }
.table.history td { white-space: normal; }
.table.history td:nth-child(5), .table.history th:nth-child(5) { text-align: right; white-space: nowrap; }
.table.history td:nth-child(1) { white-space: nowrap; }
.table.history th, .table.history td { text-align: left; }
.vehicle { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 14px; }
.vehicle:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }
.scan-preview { display: block; max-width: 100%; max-height: 240px; margin: 0 auto 12px; border: 1px solid var(--line); }

/* ---- assessments on asset screens ---- */
.answer { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; margin-bottom: 12px; border-left: 4px solid var(--amber); background: var(--amber-soft); border-radius: 0 var(--radius) var(--radius) 0; }
.answer.likely { border-left-color: var(--ok); background: var(--ok-soft); }
.answer.not { border-left-color: var(--red); background: var(--red-soft); }
.answer-title { font-size: 1.05rem; letter-spacing: -0.005em; }
.sheet-body h3 { margin-top: 16px; }

/* ---- lock screen ---- */
.lock { position: fixed; inset: 0; z-index: 60; background: var(--bg); display: flex; align-items: center; justify-content: center; outline: none; }
.lock-box { text-align: center; width: 280px; }
.lock-box h1 { margin-bottom: 8px; }
.pin-dots { display: flex; justify-content: center; gap: 14px; margin: 18px 0 6px; }
.pin-dots i { width: 14px; height: 14px; border: 2px solid var(--muted); border-radius: 50%; }
.pin-dots i.on { background: var(--ink); border-color: var(--ink); }
.lock-err { color: var(--danger); min-height: 1.4em; font-size: 0.9rem; margin: 0; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 8px; }
.keypad button { height: 62px; font-size: 1.4rem; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); cursor: pointer; }
.keypad button:active { background: var(--sunken); }

@media (prefers-reduced-motion: no-preference) { .btn, .quick-btn, .qa, .kpi, .side a { transition: opacity 0.1s, background-color 0.1s, border-color 0.1s; } }
@media print { .top, .bottom, .side { display: none; } main { margin: 0; } }
