/* App styles. Uses tokens from tokens.css only. Rules: docs/DESIGN.md. */
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: var(--fs-md); line-height: 1.5;
  font-variant-numeric: tabular-nums;
}
h1, h2, h3 { line-height: 1.2; margin: 0; font-weight: 600; }
h1 { font-size: var(--fs-xl); }
h2 { font-size: var(--fs-lg); }
h3 { font-size: var(--fs-md); }
p { margin: 0; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--ink-2); }
.small { font-size: var(--fs-sm); }
.xs { font-size: var(--fs-xs); }
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 16px; height: 16px; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 var(--gutter); }
.section-gap { margin-top: var(--sp-5); }
.section-gap-sm { margin-top: var(--sp-3); }
.section-gap-sm:empty { display: none; }
.stack > * + * { margin-top: var(--sp-4); }


/* app header */
.app-header { border-bottom: 1px solid var(--line); background: var(--surface); }
.app-header .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 60px; gap: var(--sp-4); }
.brand { font-weight: 600; font-size: var(--fs-lg); color: var(--ink); text-decoration: none; letter-spacing: -.01em; }
main { padding: var(--sp-5) 0 var(--sp-7); }

/* buttons */
.btn {
  display: inline-flex; align-items: center; gap: var(--sp-2); min-height: 44px; padding: 0 var(--sp-4);
  border-radius: 8px; font: inherit; font-weight: 500; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent); }
.btn-secondary { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn-ghost { background: transparent; color: var(--accent); border: 1px solid transparent; padding: 0 var(--sp-2); }

/* ===== licence plate component ===== */
.plate {
  display: inline-flex; align-items: stretch; background: var(--plate-yellow); color: var(--plate-ink);
  border: 2px solid var(--plate-ink); border-radius: 4px; overflow: hidden; line-height: 1;
  font-family: var(--font-cond); font-weight: 600; text-transform: uppercase; flex: none;
}
.plate .eu {
  background: var(--plate-eu); color: var(--plate-eu-ink); display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  padding: 2px 3px 3px; font-size: .45em; letter-spacing: .02em;
}
.plate .eu::before { content: ""; width: .9em; height: .9em; border-radius: 50%; border: 1.5px dotted var(--plate-yellow); margin-bottom: auto; margin-top: 1px; }
.plate .chars { padding: .18em .45em .14em; letter-spacing: .04em; }
.plate-sm { font-size: 14px; }
.plate-md { font-size: 20px; }
.plate-lg { font-size: 30px; }
.plate.sold { filter: grayscale(1); opacity: .7; }
.plate.foreign { background: var(--plate-foreign); }
.vcard.sold { color: var(--ink-2); }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.chip {
  --c: var(--ink-2);
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 999px;
  font-size: var(--fs-sm); font-weight: 500; color: var(--c);
  background: color-mix(in srgb, var(--c) 12%, transparent);
}
.chip.ok { --c: var(--ok); }
.chip.warn { --c: var(--warn); }
.chip.danger { --c: var(--danger); }
.chip.t-maintenance { --c: var(--type-maintenance); }
.chip.t-fuel { --c: var(--type-fuel); }
.chip.t-modification { --c: var(--type-modification); }
.chip.t-expense { --c: var(--type-expense); }
.chip.t-inspection { --c: var(--type-inspection); }

/* ===== garage page ===== */
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-4); margin-bottom: var(--sp-5); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: var(--sp-5); }
.vcard {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--card-shadow);
  display: flex; flex-direction: column;
}
.vcard > section { padding: var(--sp-4) var(--sp-5); }
.vcard > section + section { border-top: 1px solid var(--line); }
.vcard-head { display: flex; gap: var(--sp-4); align-items: center; }
.vcard-head { color: inherit; text-decoration: none; }
.vcard-head:hover strong { text-decoration: underline; }
.vcard-title { display: flex; flex-direction: column; min-width: 0; }
.vcard-title strong { font-size: var(--fs-lg); font-weight: 600; line-height: 1.2; }
.odo { display: flex; align-items: baseline; gap: var(--sp-2); margin: var(--sp-4) 0 var(--sp-3); }
.odo b { font-family: var(--font-cond); font-weight: 600; font-size: var(--fs-stat); line-height: 1; }
.kv-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
.kv b { display: block; font-family: var(--font-cond); font-weight: 600; font-size: var(--fs-lg); }
.kv span { font-size: var(--fs-sm); color: var(--ink-2); }
.recent { list-style: none; margin: 0; padding: 0; }
.recent li { display: grid; grid-template-columns: 10px 1fr auto; gap: var(--sp-3); align-items: center; padding: 6px 0; font-size: var(--fs-sm); }
.recent li + li { border-top: 1px solid var(--line); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--ink-2)); }
.d-maintenance { --c: var(--type-maintenance); } .d-fuel { --c: var(--type-fuel); }
.d-modification { --c: var(--type-modification); } .d-expense { --c: var(--type-expense); }
.d-inspection { --c: var(--type-inspection); }
.vcard-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; }
.add-tile {
  border: 1.5px dashed var(--line); border-radius: 12px; min-height: 200px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: var(--sp-3); color: var(--ink-2); text-align: center; padding: var(--sp-5);
  text-decoration: none;
}
.add-tile:hover { border-color: var(--accent); color: var(--accent); }
.archive { margin-top: var(--sp-6); }
.archive-grid { margin-top: var(--sp-4); }
.archive summary { cursor: pointer; color: var(--ink-2); font-weight: 500; }

/* ===== vehicle page ===== */
.v-head { display: flex; flex-wrap: wrap; gap: var(--sp-4) var(--sp-5); align-items: center; }
.v-head .meta { flex: 1 1 240px; min-width: 0; }
.v-head .actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-2); text-decoration: none; font-size: var(--fs-sm); margin-bottom: var(--sp-3); }
.tabs { display: flex; gap: var(--sp-1); border-bottom: 1px solid var(--line); margin: var(--sp-5) 0; overflow-x: auto; }
.tabs button {
  font: inherit; font-weight: 500; color: var(--ink-2); background: none; border: 0; border-bottom: 2px solid transparent;
  padding: var(--sp-3) var(--sp-3); cursor: pointer; white-space: nowrap; min-height: 44px;
}
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.tabs a {
  display: inline-flex; align-items: center; font-weight: 500; color: var(--ink-2); text-decoration: none;
  border-bottom: 2px solid transparent; padding: var(--sp-3); white-space: nowrap; min-height: 44px;
}
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
.v-head .actions form { display: contents; }

/* flash messages */
.flash { display: flex; gap: var(--sp-3); align-items: center; padding: var(--sp-3) var(--sp-4); border-radius: 8px; margin-bottom: var(--sp-4); font-size: var(--fs-sm); --c: var(--ink-2); background: color-mix(in srgb, var(--c) 10%, transparent); }
.flash .icon { color: var(--c); }
.flash.success { --c: var(--ok); } .flash.error { --c: var(--danger); } .flash.info, .flash.warning { --c: var(--warn); }
.empty { color: var(--ink-2); }
.field-label { display: block; font-weight: 500; }
.panel-intro { margin: calc(-1 * var(--sp-2)) 0 var(--sp-4); }
.field input[type="date"] { appearance: none; }
.review { list-style: none; margin: 0; padding: 0; }
.review li { display: flex; gap: var(--sp-3); align-items: flex-start; padding: var(--sp-3) 0; }
.review li + li { border-top: 1px solid var(--line); }
.review input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--accent); }
.htmx-request .btn-primary { opacity: .7; }
.cols { display: grid; gap: var(--sp-5); }
@media (min-width: 1024px) { .cols { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: var(--sp-5); }
.panel h2 { margin-bottom: var(--sp-4); }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--sp-3); margin-bottom: var(--sp-4); }
.panel-head h2 { margin: 0; }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-5) var(--sp-4); }
.stat b { font-family: var(--font-cond); font-weight: 600; font-size: var(--fs-stat); line-height: 1.1; display: block; }
.stat b small { font-family: var(--font); font-size: var(--fs-xs); color: var(--ink-2); font-weight: 400; margin-left: 2px; }
.stat span { font-size: var(--fs-sm); color: var(--ink-2); }
.stat.wide { grid-column: 1 / -1; }
.stats-3 { grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); }
.highlights { padding-bottom: var(--sp-3); }
.highlight-note { padding-bottom: var(--sp-4); }
.highlights + dl, .highlight-note + dl { border-top: 1px solid var(--line); }
.highlights .stat b { font-size: var(--fs-xl); white-space: nowrap; }

.due { list-style: none; margin: 0; padding: 0; }
.due li { display: flex; gap: var(--sp-3); align-items: flex-start; padding: var(--sp-3) 0; }
.due li + li { border-top: 1px solid var(--line); }
.due .what { flex: 1; }
.due .when { font-size: var(--fs-sm); color: var(--ink-2); }
.due .icon { margin-top: 2px; }
.ok-c { color: var(--ok); } .warn-c { color: var(--warn); } .danger-c { color: var(--danger); }

/* timeline */
.filters { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-bottom: var(--sp-4); }
.filters button { font: inherit; font-size: var(--fs-sm); border: 1px solid var(--line); background: transparent; color: var(--ink); border-radius: 999px; padding: 4px 12px; min-height: 32px; cursor: pointer; }
.filters button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 8px; bottom: 8px; width: 1px; background: var(--line); }
.timeline > li { position: relative; display: grid; grid-template-columns: 11px minmax(0, 1fr) auto; column-gap: var(--sp-4); padding: var(--sp-3) 0; }
.timeline .dot { width: 11px; height: 11px; margin-top: 6px; box-shadow: 0 0 0 3px var(--surface); }
.t-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.t-top { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
.t-title { font-weight: 500; }
.t-sub { font-size: var(--fs-sm); color: var(--ink-2); }
.t-cost { text-align: right; font-weight: 500; white-space: nowrap; }
.t-cost span { display: block; font-size: var(--fs-xs); color: var(--ink-2); font-weight: 400; }
.divider { display: flex; align-items: center; gap: var(--sp-3); color: var(--ink-2); font-size: var(--fs-sm); padding: var(--sp-4) 0 var(--sp-2); }
.divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.timeline.before > li { color: var(--ink-2); }
.timeline.before .t-title { color: var(--ink-2); }
.defects { margin: 4px 0 0; padding-left: 18px; font-size: var(--fs-sm); }
.defects li { padding: 1px 0; }

/* chart */
.chart svg { width: 100%; height: auto; display: block; }
.chart .axis { stroke: var(--line); }
.chart text { fill: var(--ink-2); font-family: var(--font); font-size: 11px; }
.f-fuel { fill: var(--chart-fuel); } .f-maintenance { fill: var(--chart-maintenance); } .f-modification { fill: var(--chart-modification); } .f-expense { fill: var(--chart-expense); }
.legend { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4); font-size: var(--fs-sm); color: var(--ink-2); margin-top: var(--sp-3); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 2px; background: var(--c); display: inline-block; }

/* specs */
.spec-groups { display: grid; gap: var(--sp-5); grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); }
.spec dl { margin: 0; display: grid; grid-template-columns: minmax(9em, 1fr) minmax(0, max-content); }
.spec dt, .spec dd { padding: 7px 0; border-top: 1px solid var(--line); font-size: var(--fs-sm); }
.spec dt { color: var(--ink-2); }
.spec dd { margin: 0; text-align: right; font-weight: 500; padding-left: var(--sp-3); overflow-wrap: anywhere; }
.spec dl > :nth-child(1), .spec dl > :nth-child(2) { border-top: 0; }
.src { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-xs); color: var(--ink-2); margin-left: var(--sp-2); font-weight: 400; }
.placeholder { color: var(--ink-2); padding: var(--sp-6) 0; }

/* ===== add vehicle ===== */
.narrow { max-width: 720px; }
.plate-input {
  display: inline-flex; align-items: stretch; background: var(--plate-yellow); border: 2px solid var(--plate-ink);
  border-radius: 6px; overflow: hidden; font-size: 34px;
}
.plate-input .eu { background: var(--plate-eu); color: var(--plate-eu-ink); font: 600 13px var(--font-cond); display: flex; align-items: flex-end; padding: 0 6px 6px; }
.plate-input input {
  border: 0; background: transparent; color: var(--plate-ink); font: 600 1em var(--font-cond); text-transform: uppercase;
  letter-spacing: .05em; width: 7.2em; padding: .15em .4em; outline: none;
}
.plate-input:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }
.lookup { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center; margin-top: var(--sp-3); }
.found { display: flex; gap: var(--sp-3); align-items: flex-start; padding: var(--sp-4); border-radius: 8px; background: color-mix(in srgb, var(--ok) 10%, transparent); }
.found .icon { color: var(--ok); margin-top: 2px; }
.prefill { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr)); gap: var(--sp-3) var(--sp-5); margin-top: var(--sp-4); }
.prefill div span { display: block; font-size: var(--fs-xs); color: var(--ink-2); }
.prefill div b { font-weight: 500; }
.form-grid { display: grid; gap: var(--sp-4); grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); }
.field label { display: block; font-weight: 500; font-size: var(--fs-sm); margin-bottom: 6px; }
.field input {
  width: 100%; min-height: 44px; padding: 0 var(--sp-3); border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--ink); font: inherit;
}
.field .help { font-size: var(--fs-xs); color: var(--ink-2); margin-top: 4px; }
.field .error { font-size: var(--fs-xs); color: var(--danger); margin-top: 4px; display: flex; gap: 4px; align-items: center; }
.field.has-error input { border-color: var(--danger); }
.form-actions { display: flex; gap: var(--sp-3); flex-wrap: wrap; }
.notfound { display: flex; gap: var(--sp-3); align-items: flex-start; padding: var(--sp-4); border-radius: 8px; background: color-mix(in srgb, var(--warn) 10%, transparent); font-size: var(--fs-sm); }
.notfound .icon { color: var(--warn); }

[hidden] { display: none !important; }
@media (prefers-reduced-motion: no-preference) {
  .view { animation: fade .15s ease-out; }
  @keyframes fade { from { opacity: 0; } to { opacity: 1; } }
}

/* ===== entries (phase 2) ===== */
a.t-title { color: inherit; text-decoration: none; }
a.t-title:hover { text-decoration: underline; color: var(--accent); }
.t-notes { font-size: var(--fs-sm); color: var(--ink-2); margin-top: 4px; }
.filters a {
  font-size: var(--fs-sm); border: 1px solid var(--line); color: var(--ink); border-radius: 999px;
  padding: 4px 12px; min-height: 32px; display: inline-flex; align-items: center; text-decoration: none;
}
.filters a[aria-current="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.field textarea, .field select {
  width: 100%; padding: var(--sp-2) var(--sp-3); border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--ink); font: inherit;
}
.field select { min-height: 44px; }
.field.has-error textarea, .field.has-error select { border-color: var(--danger); }
.span-all { grid-column: 1 / -1; }

.segmented { border: 0; margin: 0; padding: 0; min-width: 0; }
.segmented legend { font-weight: 500; font-size: var(--fs-sm); margin-bottom: 6px; padding: 0; }
.segments { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface-2); }
/* .segmented prefix: beats the generic .field label / .field input rules */
.segmented .segment {
  position: relative; flex: 1; display: flex; align-items: center; justify-content: center;
  min-height: 44px; margin: 0; cursor: pointer; font-weight: 500; color: var(--ink-2);
}
.segmented .segment + .segment { border-left: 1px solid var(--line); }
.segmented .segment input { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; margin: 0; opacity: 0; cursor: pointer; }
.segment:has(input:checked) { background: var(--accent); color: var(--accent-ink); }
.segment:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: -4px; }
.entry-form:has(input[name="done_by"][value="me"]:checked) .field-garage_name { display: none; }

.btn-danger { background: transparent; color: var(--danger); border: 1px solid var(--line); }
.btn-danger-solid { background: var(--danger); color: var(--surface); border: 1px solid var(--danger); }
.push-right { margin-left: auto; }

/* ===== costs (phase 3) ===== */
.c-fuel { --c: var(--chart-fuel); } .c-maintenance { --c: var(--chart-maintenance); }
.c-modification { --c: var(--chart-modification); } .c-expense { --c: var(--chart-expense); }
.chart .grid { stroke: var(--line); stroke-dasharray: 2 3; }
.chart .tick { fill: var(--ink-2); font-size: 11px; }
.chart .seg { stroke: var(--surface); stroke-width: 2px; paint-order: stroke; }
.chart .hit { fill: transparent; }
.chart .bar:hover .hit { fill: var(--surface-2); }
.chart .legend { margin: 0 0 var(--sp-3); }
.table-view { margin-top: var(--sp-3); font-size: var(--fs-sm); }
.table-view summary { cursor: pointer; color: var(--accent); }
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); margin-top: var(--sp-2); }
table.data th { text-align: left; font-weight: 500; color: var(--ink-2); padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data td { padding: 7px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data .num { text-align: right; }
.stats-4 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.shares { list-style: none; margin: 0; padding: 0; }
.shares li + li { margin-top: var(--sp-4); }
.share-top { display: flex; justify-content: space-between; gap: var(--sp-3); font-size: var(--fs-sm); }
.share-top b { font-weight: 500; }
.share-bar { height: 6px; border-radius: 3px; background: var(--surface-2); margin: 6px 0 2px; overflow: hidden; }
.share-bar i { display: block; height: 100%; border-radius: 3px; background: var(--c, var(--ink-2)); }
.shares.neutral .share-bar i { background: var(--ink-2); }
.kv-link { color: inherit; text-decoration: none; }
.kv-link:hover b { color: var(--accent); }

.menu { position: relative; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-list {
  position: absolute; z-index: 10; top: calc(100% + 6px); left: 0; min-width: 200px; margin: 0; padding: var(--sp-1);
  list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--menu-shadow);
}
.menu-right .menu-list, .v-head .menu-list { left: auto; right: 0; }
.menu-list a { display: flex; align-items: center; gap: var(--sp-2); min-height: 44px; padding: 0 var(--sp-3); color: var(--ink); text-decoration: none; border-radius: 6px; }
.menu-list a:hover, .menu-list a:focus-visible { background: var(--surface-2); }
.menu-title { display: none; }

/* Phones: the menu becomes a bottom sheet, so it never leaves the screen.
   The dimmed backdrop is a pseudo-element of <summary>: tapping it closes the menu without JavaScript. */
@media (max-width: 599px) {
  .menu[open] > summary::after {
    content: ""; position: fixed; inset: 0; z-index: 20; background: var(--backdrop); cursor: default;
  }
  .menu .menu-list,
  .menu-right .menu-list,
  .v-head .menu-list {
    position: fixed; z-index: 30; top: auto; left: var(--gutter); right: var(--gutter);
    bottom: calc(var(--gutter) + env(safe-area-inset-bottom, 0px));
    min-width: 0; max-height: calc(100dvh - 2 * var(--gutter)); overflow-y: auto;
    padding: var(--sp-2); border-radius: 12px;
  }
  .menu-list a { min-height: 52px; font-size: var(--fs-md); }
  .menu-title { display: block; padding: var(--sp-2) var(--sp-3) var(--sp-1); font-size: var(--fs-sm); color: var(--ink-2); }
}

.field-check .check { display: flex; align-items: center; gap: var(--sp-2); min-height: 44px; font-weight: 500; font-size: var(--fs-md); margin: 0; }
.field-check .check input { width: 20px; height: 20px; min-height: 0; accent-color: var(--accent); }

/* ===== modifications (phase 4) ===== */
.entry-form:has(input[name="status"][value="installed"]:checked) .field-removed_on { display: none; }
.entry-form:has(input[name="preexisting"]:checked) .field-done_by,
.entry-form:has(input[name="preexisting"]:checked) .field-garage_name { display: none; }
.mod-list { list-style: none; margin: 0; padding: 0; }
.mod-list > li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px var(--sp-4); padding: var(--sp-3) 0; }
.mod-list > li + li { border-top: 1px solid var(--line); }
.mod-list .t-sub { grid-column: 1 / -1; }
.mod-group + .mod-group { margin-top: var(--sp-5); }
.mod-group h3 { font-size: var(--fs-sm); color: var(--ink-2); font-weight: 500; margin-bottom: var(--sp-1); }
.tag { display: inline-block; font-size: var(--fs-xs); color: var(--ink-2); border: 1px solid var(--line); border-radius: 999px; padding: 0 8px; margin-left: var(--sp-2); vertical-align: 1px; }
.removed .t-title { text-decoration: line-through; text-decoration-color: var(--ink-2); }

/* printable list */
.print-page { max-width: 760px; margin: 0 auto; padding: var(--sp-6) var(--gutter); }
.print-page header { display: flex; gap: var(--sp-4); align-items: center; margin-bottom: var(--sp-5); }
@media print {
  body { background: none; }
  .no-print, .app-header { display: none !important; }
  .print-page { padding: 0; }
  .panel { border: 0; padding: 0; }
}

/* ===== reminders (phase 5) ===== */
.unknown-c { color: var(--ink-2); }
.chip.muted-chip { --c: var(--ink-2); }
.due li form { margin-left: auto; }
.due .due-title { color: inherit; text-decoration: none; font-weight: 500; }
.due .due-title:hover { color: var(--accent); text-decoration: underline; }
.due .due-vehicle { margin-right: var(--sp-2); text-decoration: none; }
.due-danger .what { font-weight: 500; }
.btn-sm { min-height: 36px; padding: 0 var(--sp-3); font-size: var(--fs-sm); gap: 6px; }
.due-panel { margin-bottom: var(--sp-5); }
.preset-list { list-style: none; margin: 0; padding: 0; }
.preset-list a { display: flex; align-items: center; gap: var(--sp-2); min-height: 40px; text-decoration: none; }
.explain { margin: 0; padding-left: 18px; }
.explain li + li { margin-top: var(--sp-2); }
.reminder-form:has(input[name="mode"][value="once"]:checked) :is(.field-category, .field-every_km, .field-every_months, .field-last_done_on, .field-last_done_km) { display: none; }
.reminder-form:has(input[name="mode"][value="repeat"]:checked) .field-due_on { display: none; }

/* ===== attachments (phase 6) ===== */
.field input[type="file"] { padding: var(--sp-2); min-height: 44px; }
.attachments { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-4); grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.attachments li { display: flex; flex-direction: column; gap: var(--sp-2); min-width: 0; }
.thumb { display: block; aspect-ratio: 4 / 3; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface-2); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-icon { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--ink-2); font-size: var(--fs-sm); font-weight: 500; }
.thumb-icon .icon { width: 32px; height: 32px; }
.att-meta { display: flex; flex-direction: column; min-width: 0; }
.att-name { font-size: var(--fs-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att-actions { display: flex; gap: var(--sp-3); margin-top: 2px; }
.att-actions a { display: inline-flex; align-items: center; gap: 4px; }
.danger-link { color: var(--danger); }
.clip { display: inline-flex; align-items: center; gap: 2px; font-size: var(--fs-xs); color: var(--ink-2); }

/* data page */
.header-nav { margin-left: auto; }
.header-nav a { color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: var(--fs-sm); padding: var(--sp-2); }
.header-nav a:hover, .header-nav a[aria-current="page"] { color: var(--ink); }
.export-list { list-style: none; margin: 0; padding: 0; }
.export-list li { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-2) 0; flex-wrap: wrap; }
.export-list li + li { border-top: 1px solid var(--line); }
.thumb { text-decoration: none; }
@media (max-width: 479px) {
  .wide-only { display: none; }
}

/* ===== self-host (phase 7) ===== */
.header-nav { display: flex; align-items: center; gap: var(--sp-1); }
.header-nav form { display: contents; }
.link-button { font: inherit; font-weight: 500; font-size: var(--fs-sm); color: var(--ink-2); background: none; border: 0; padding: var(--sp-2); cursor: pointer; }
.link-button:hover { color: var(--ink); }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: var(--sp-5) var(--gutter); }
.login-card { width: 100%; max-width: 380px; }
.login-brand { display: flex; flex-direction: column; align-items: flex-start; gap: var(--sp-3); margin-bottom: var(--sp-2); }
