/* Car Service Tracker – mobile-first styles */
:root {
  --bg: #F3F4F1;
  --card: #FFFFFF;
  --text: #14171A;
  --muted: #5B636B;
  --border: #E3E5E1;
  --accent: #1D4ED8;
  --accent-soft: #EEF3FF;
  --dark: #14171A;
  --od-t: #B42318; --od-bg: #FEE4E2; --od-c: #D92D20;
  --so-t: #93370D; --so-bg: #FEF0C7; --so-c: #F79009;
  --ok-t: #05603A; --ok-bg: #D1FADF; --ok-c: #12B76A;
  --r-card: 18px;
  --tabbar-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-h: 'Space Grotesk', 'Inter', system-ui, -apple-system, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  min-height: 100vh;
}
h1, h2, h3 { font-family: var(--font-h); line-height: 1.2; margin: 0; letter-spacing: -0.01em; }
h2 { font-size: 18px; }
p { margin: 0; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--accent); color: #fff; padding: 10px 14px; border-radius: 10px; }
.skip:focus { top: 12px; }
.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* status palette */
.st-overdue { --t: var(--od-t); --bgc: var(--od-bg); --c: var(--od-c); }
.st-soon { --t: var(--so-t); --bgc: var(--so-bg); --c: var(--so-c); }
.st-ok { --t: var(--ok-t); --bgc: var(--ok-bg); --c: var(--ok-c); }

/* ---------- app bar ---------- */
.appbar {
  position: sticky; top: 0; z-index: 30;
  background: var(--dark); color: #fff;
  padding-top: env(safe-area-inset-top, 0px);
}
.appbar-in { max-width: 480px; margin: 0 auto; height: 60px; padding: 0 12px; display: flex; align-items: center; gap: 10px; }
.brand { display: grid; place-items: center; width: 44px; height: 44px; flex: none; }
.brand svg { width: 34px; height: 34px; }
.switcher { position: relative; flex: 1; min-width: 0; }
.switcher select {
  appearance: none; -webkit-appearance: none; width: 100%; height: 44px;
  padding: 0 38px 0 14px; border-radius: 12px;
  background: rgba(255,255,255,.08); color: #fff; border: 1px solid rgba(255,255,255,.16);
  font: 600 15px var(--font-h); text-overflow: ellipsis;
}
.switcher select option { color: var(--text); background: #fff; }
.switcher .ic { position: absolute; right: 12px; top: 12px; pointer-events: none; color: rgba(255,255,255,.8); }
.icon-btn {
  width: 44px; height: 44px; flex: none; display: inline-grid; place-items: center;
  border-radius: 12px; border: 1px solid var(--border); background: var(--card); color: var(--text);
  text-decoration: none; padding: 0;
}
.icon-btn.ghost { border-color: transparent; background: transparent; }
.icon-btn.on-dark { background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.16); }

/* ---------- layout ---------- */
main {
  display: block; max-width: 480px; margin: 0 auto;
  padding: 16px 16px calc(var(--tabbar-h) + 32px + var(--safe-b));
  outline: none;
}
main > * + * { margin-top: 14px; }
main.has-sheet { padding-bottom: calc(var(--tabbar-h) + 260px + var(--safe-b)); }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-card); padding: 16px; }
.card > h2 { margin-bottom: 10px; }
.card > * + * { margin-top: 10px; }
.card.dark { background: var(--dark); color: #fff; border-color: var(--dark); border-radius: 22px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; }
.gap { gap: 10px; }
.wrap { flex-wrap: wrap; }
.page-title { font-size: 26px; font-weight: 700; }
.page-sub { margin-top: 2px !important; }
.title-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.section > h2, .section-h { font-size: 16px; margin-bottom: 8px; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: rgba(255,255,255,.65); }
.eyebrow.dk { color: var(--muted); }
.backlink { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding-right: 10px; color: var(--text); text-decoration: none; font-weight: 600; margin-left: -6px; }
.foot { padding: 8px 0; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 18px; border-radius: 14px; border: 1px solid transparent;
  font-weight: 600; font-size: 15px; text-decoration: none; white-space: nowrap;
  transition: transform .12s ease, background-color .15s ease;
}
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-ghost { background: var(--card); color: var(--text); border-color: var(--border); }
.btn-light { background: #fff; color: var(--text); }
.btn-outline-light { background: transparent; color: #fff; border-color: rgba(255,255,255,.35); }
.btn-danger { background: var(--card); color: var(--od-t); border-color: #FDA29B; }
.block { display: flex; width: 100%; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.actions .btn { padding: 0 10px; white-space: normal; text-align: center; line-height: 1.2; }
.actions .wide { grid-column: 1 / -1; }

/* ---------- home ---------- */
.odo { padding: 18px; }
.odo-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.car-name { font-size: 24px; font-weight: 700; }
.sub { color: rgba(255,255,255,.68); font-size: 13px; }
.card:not(.dark) .sub { color: var(--muted); }
.plate {
  flex: none; font: 700 13px var(--font-h); letter-spacing: .06em; padding: 5px 9px; border-radius: 8px;
  background: #fff; color: var(--text); border: 2px solid #D0D5DD;
}
.odo-val { font: 700 44px/1.05 var(--font-h); letter-spacing: -0.02em; margin-top: 4px !important; }
.odo-val span { font-variant-numeric: tabular-nums; }
.odo .row { margin-top: 16px; }
.odo .row .btn { flex: 1; }
.counts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.count { background: var(--bgc); color: var(--t); border-radius: 16px; padding: 12px; display: flex; flex-direction: column; }
.count .n { font: 700 28px/1.1 var(--font-h); }
.count .l { font-size: 13px; font-weight: 600; }

.seg { display: flex; gap: 4px; background: #E7E9E4; border-radius: 14px; padding: 4px; }
.seg button {
  flex: 1; min-height: 44px; border: 0; border-radius: 10px; background: transparent;
  font-weight: 600; color: var(--muted);
}
.seg button[aria-pressed="true"] { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(20,23,26,.12); }
.seg-n { font-size: 12px; opacity: .7; }
.small-seg { flex: 1; min-width: 180px; }
.small-seg button { font-size: 14px; }

.items, .mini-list, .hist, .car-list, .tl, .legend, .tags { list-style: none; margin: 0; padding: 0; }
.items { display: grid; gap: 10px; }
.item { display: flex; gap: 12px; align-items: flex-start; color: inherit; text-decoration: none; padding: 14px; }
.item:active { background: #FAFAF8; }
.ico-tile {
  width: 44px; height: 44px; flex: none; border-radius: 12px; display: grid; place-items: center;
  background: var(--bgc, var(--accent-soft)); color: var(--t, var(--accent));
}
.ico-tile .ic { width: 22px; height: 22px; }
.item-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.item-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.item-name { font-weight: 600; font-size: 16px; }
.item-int { font-size: 13px; color: var(--muted); }
.item-note { font-size: 13px; font-weight: 600; color: var(--t); }
.pill {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--bgc); color: var(--t); white-space: nowrap;
}
.pdot { width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.bar { display: block; height: 6px; border-radius: 99px; background: #ECEEEA; overflow: hidden; margin: 4px 0 2px; }
.bar > span { display: block; height: 100%; border-radius: inherit; background: var(--c); }
.bar-big { height: 12px; }

/* ---------- item detail ---------- */
.hero-top { display: flex; gap: 12px; align-items: center; }
.hero-top h1 { font-size: 22px; }
.kmleft { margin-top: 16px !important; color: var(--t); font-weight: 600; }
.kmleft .big { font: 700 36px/1 var(--font-h); letter-spacing: -0.02em; }
.bar-labels { display: grid; grid-template-columns: 1fr 1fr 1fr; font-size: 12px; color: var(--muted); margin-top: 6px !important; }
.bar-labels span { display: flex; flex-direction: column; }
.bar-labels b { color: var(--text); font-size: 14px; font-variant-numeric: tabular-nums; }
.bl-now { text-align: center; }
.bl-r { text-align: right; }
.facts { margin: 0; }
.fact { display: flex; justify-content: space-between; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.fact:first-child { padding-top: 0; }
.fact:last-child { border-bottom: 0; padding-bottom: 0; }
.fact dt { color: var(--muted); flex: none; }
.fact dd { margin: 0; text-align: right; font-weight: 600; }
.mini-list { display: grid; gap: 8px; }
.mini { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; padding: 12px 14px; }
.mini > * + * { margin-top: 0; }
.mini-date { font-weight: 600; }
.mini-km { color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- forms ---------- */
.form { display: grid; gap: 14px; }
.form > * + * { margin-top: 0; }
.field { display: grid; gap: 6px; border: 0; padding: 0; margin: 0; min-width: 0; }
.field > span, .field legend { font-size: 13px; font-weight: 600; color: var(--muted); padding: 0; }
.field legend { margin-bottom: 8px; }
.field input, .field textarea, .field select {
  width: 100%; min-height: 48px; padding: 10px 12px; border-radius: 12px;
  border: 1px solid #CFD3CC; background: #fff; font-size: 16px; color: var(--text);
}
.field textarea { resize: vertical; min-height: 88px; }
.field input:focus, .field textarea:focus, .field select:focus { outline: 3px solid rgba(29,78,216,.25); border-color: var(--accent); }
.select { position: relative; display: block; }
.select select { appearance: none; -webkit-appearance: none; padding-right: 40px; }
.select .ic { position: absolute; right: 12px; top: 14px; pointer-events: none; color: var(--muted); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 0 14px;
  border-radius: 999px; border: 1px solid #CFD3CC; background: #fff; font-weight: 600; font-size: 14px;
}
.chip .ic { width: 18px; height: 18px; color: var(--muted); }
.chip .chip-check { display: none; }
.chip[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.chip[aria-pressed="true"] .ic { color: var(--accent); }
.chip[aria-pressed="true"] .chip-check { display: block; }
.err { display: flex; align-items: center; gap: 6px; color: var(--od-t); font-size: 13px; font-weight: 600; margin-top: 8px !important; }
.err .ic { width: 16px; height: 16px; }
.err[hidden] { display: none; }

/* ---------- schedule ---------- */
.tip { display: grid; gap: 10px; }
.tip > * + * { margin-top: 0; }
.tip-head { display: flex; align-items: center; gap: 10px; }
.tip-head .ic { color: #FDB022; width: 24px; height: 24px; }
.tip h2 { font-size: 17px; }
.tip .btn { justify-self: start; }
.timeline { display: grid; gap: 18px; }
.tl-head { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 8px; }
.tl-head.now { color: var(--od-t); }
.tl { display: grid; gap: 10px; margin-left: 8px; padding-left: 18px; border-left: 2px solid var(--border); }
.tl-item { position: relative; }
.tl-item::before {
  content: ''; position: absolute; left: -26px; top: 24px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--c); border: 2px solid var(--bg);
}
.tl-card { display: flex; gap: 12px; align-items: flex-start; color: inherit; text-decoration: none; padding: 12px 14px; }
.tl-card .grow { display: flex; flex-direction: column; gap: 3px; }

/* ---------- history ---------- */
.hist { display: grid; gap: 10px; }
.hist-item { position: relative; }
.hist-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.hist-date { font: 700 18px var(--font-h); }
.cost { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; padding-right: 44px; }
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; background: var(--bg); border: 1px solid var(--border); font-size: 13px; font-weight: 600; }
.tag .ic { width: 15px; height: 15px; color: var(--muted); }
.hist-notes { color: var(--muted); font-size: 14px; padding-right: 44px; }
.hist-del { position: absolute; right: 6px; bottom: 6px; color: var(--muted); }

/* ---------- my car ---------- */
.car-list { display: grid; gap: 8px; }
.car-row {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px; text-align: left;
  border-radius: 14px; border: 1px solid var(--border); background: #fff; min-height: 64px;
}
.car-row .grow { display: flex; flex-direction: column; }
.car-row.cur { border-color: var(--accent); background: var(--accent-soft); }
.note-box, .warn-box { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 14px; background: var(--bg); font-size: 14px; }
.note-box .ic, .warn-box .ic { margin-top: 1px; }
.note-box.ok { background: var(--ok-bg); color: var(--ok-t); }
.warn-box { background: var(--so-bg); color: var(--so-t); border: 1px solid #FEC84B; }
.ios-steps { border-top: 1px solid var(--border); padding-top: 12px; }
.ios-steps ol { margin: 6px 0 0; padding-left: 20px; display: grid; gap: 4px; }
.kbd { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; background: var(--bg); border: 1px solid var(--border); vertical-align: middle; color: var(--accent); }
.kbd .ic { width: 16px; height: 16px; }
.empty { display: grid; justify-items: center; text-align: center; gap: 10px; padding: 28px 16px; }
.empty > * + * { margin-top: 0; }

/* ---------- car photos ---------- */
.photo-card { padding: 0; overflow: hidden; }
.photo-card > * + * { margin-top: 0; }
.photo { position: relative; width: 100%; background: #E2E5DF; overflow: hidden; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.photo img { display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.photo.placing { cursor: crosshair; box-shadow: inset 0 0 0 3px var(--accent); }
.photo-ctl { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--border); align-items: center; }
.photo-ctl .btn { flex: 1; min-width: 0; padding: 0 10px; font-size: 14px; gap: 6px; }
.photo-empty { display: grid; justify-items: center; text-align: center; gap: 10px; padding: 28px 16px; }
.photo-empty .ico-tile { width: 56px; height: 56px; border-radius: 16px; }
.photo-empty .ico-tile .ic { width: 28px; height: 28px; }
.center-row { justify-content: center; }
.credit { font-size: 12px; color: var(--muted); padding: 0 12px 12px; line-height: 1.4; }
.credit a { color: var(--muted); }
.place-hint { display: flex; gap: 10px; align-items: center; padding: 12px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); font-size: 14px; border: 1px solid #C7D7FE; }
.place-hint span { flex: 1; }
.btn-sm { min-height: 44px; padding: 0 12px; font-size: 14px; }
.link-btn { background: none; border: 0; padding: 0 2px; min-height: 32px; color: var(--accent); font-weight: 600; text-decoration: underline; }
.mk {
  position: absolute; width: 44px; height: 44px; margin: -22px 0 0 -22px; padding: 0; border: 0; background: none;
  display: grid; place-items: center; cursor: pointer; border-radius: 50%; z-index: 1;
}
.mk.sel { z-index: 2; }
.mk-dot {
  position: relative; z-index: 1; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  background: var(--c); border: 2.5px solid #fff; box-shadow: 0 2px 6px rgba(20,23,26,.45);
  transition: transform .15s ease;
}
.mk-dot svg { width: 16px; height: 16px; fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.mk.st-overdue::before {
  content: ''; position: absolute; left: 10px; top: 10px; width: 24px; height: 24px; border-radius: 50%;
  border: 3px solid var(--c); animation: pulse 1.6s ease-out infinite;
}
@keyframes pulse { 0% { transform: scale(1); opacity: .9; } 100% { transform: scale(2.1); opacity: 0; } }
.mk.sel .mk-dot { transform: scale(1.3); box-shadow: 0 0 0 4px rgba(29,78,216,.55), 0 2px 8px rgba(20,23,26,.45); }
.mk-label {
  position: absolute; left: 50%; top: 100%; transform: translate(-50%, -4px); white-space: nowrap;
  background: var(--dark); color: #fff; font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 8px; pointer-events: none;
}
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; font-weight: 600; color: var(--muted); }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.ldot { width: 11px; height: 11px; border-radius: 50%; background: var(--c); flex: none; }
.chip.part { font-size: 14px; }
.chip-st { font-size: 12px; color: var(--t); font-weight: 600; }
.chip.part[aria-pressed="true"] .chip-st { color: var(--t); }
.sheet {
  position: fixed; z-index: 25; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--tabbar-h) + var(--safe-b) + 8px);
  width: calc(100% - 16px); max-width: 464px; max-height: 58vh; overflow: auto;
  background: #fff; border-radius: 22px; border: 1px solid var(--border);
  box-shadow: 0 12px 40px rgba(20,23,26,.22); animation: up .22s ease-out;
}
.sheet[hidden] { display: none; }
@keyframes up { from { transform: translate(-50%, 16px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
.sheet-in { padding: 14px; display: grid; gap: 10px; }
.sheet-head { display: flex; gap: 12px; align-items: flex-start; }
.sheet-head .item-top { flex-wrap: wrap; justify-content: flex-start; gap: 4px 10px; }
.sheet-head h2 { font-size: 18px; }
.sheet-head .icon-btn { margin: -6px -6px 0 0; }
.where { display: flex; gap: 10px; font-size: 14px; line-height: 1.4; }
.where .ic { color: var(--muted); margin-top: 1px; }
.tag-sm { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 99px; background: var(--so-bg); color: var(--so-t); vertical-align: 1px; }
.tag-sm.ok { background: var(--ok-bg); color: var(--ok-t); }
.sheet .row .btn { padding: 0 12px; }

/* ---------- guide ---------- */
.diagram svg { display: block; width: 100%; height: auto; font-family: var(--font); }
.dg-bay { fill: #FAFAF8; stroke: #9AA1A8; stroke-width: 1.5; }
.dg-part { fill: #E9EBE7; stroke: #8A9199; stroke-width: 1.5; }
.dg-line { fill: none; stroke: #A9AFB5; stroke-width: 1.2; }
.dg-hl { fill: #DCE6FB; stroke: #1D4ED8; stroke-width: 2; }
.dg-key { fill: #F79009; stroke: #93370D; stroke-width: 1.5; }
.dg-stem { stroke: #93370D; stroke-width: 3; stroke-linecap: round; }
.dg-hidden { fill: #fff; stroke: #1D4ED8; stroke-width: 2; stroke-dasharray: 3 3; }
.dg-lead { stroke: #14171A; stroke-width: 1.3; }
.dg-dash { stroke-dasharray: 4 3; }
.dg-fw { stroke: #8A9199; stroke-width: 2; stroke-dasharray: 6 4; }
.dg-tube { stroke: #1D4ED8; stroke-width: 3; stroke-dasharray: 3 2; fill: none; }
.dg-tubeend { fill: #fff; stroke: #1D4ED8; stroke-width: 1.5; }
.dg-drop { fill: #D92D20; opacity: .8; }
.dg-pipe { fill: none; stroke: #6B737B; stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; }
.dg-co circle { fill: #14171A; }
.dg-co text { fill: #fff; font: 700 14px var(--font-h); }
.dg-lab { font: 700 11px var(--font-h); letter-spacing: .06em; fill: #5B636B; }
.dg-sm { font-size: 12px; font-weight: 600; fill: #14171A; }
.dg-xs { font-size: 10px; font-weight: 600; fill: #5B636B; }
.dg-acc { fill: #1D4ED8; }
.callouts, .steps { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.callouts li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.num { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--dark); color: #fff; font: 700 13px var(--font-h); }
.steps { counter-reset: s; }
.steps li { counter-increment: s; position: relative; padding-left: 36px; font-size: 15px; }
.steps li::before {
  content: counter(s); position: absolute; left: 0; top: -1px; width: 26px; height: 26px; border-radius: 8px;
  display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font: 700 13px var(--font-h);
}
.fluid-card { display: flex; gap: 12px; align-items: center; }
.fluid-card > * + * { margin-top: 0; }

/* ---------- tab bar ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: rgba(255,255,255,.96); border-top: 1px solid var(--border);
  padding-bottom: var(--safe-b);
  -webkit-backdrop-filter: saturate(1.4) blur(12px); backdrop-filter: saturate(1.4) blur(12px);
}
.tabbar-in { max-width: 480px; margin: 0 auto; height: var(--tabbar-h); display: grid; grid-template-columns: repeat(5, 1fr); }
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--muted); text-decoration: none; font-size: 11px; font-weight: 600; min-height: 44px;
}
.tabbar a .ic { width: 22px; height: 22px; }
.tabbar a[aria-current="page"] { color: var(--accent); }
.log-btn {
  width: 44px; height: 32px; border-radius: 12px; display: grid; place-items: center;
  background: var(--accent); color: #fff;
}
.tab-log[aria-current="page"] .log-btn { background: var(--dark); }

/* ---------- toast & dialog ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + var(--safe-b) + 16px); z-index: 60;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--dark); color: #fff; padding: 12px 16px; border-radius: 14px; font-weight: 600; font-size: 14px;
  max-width: calc(100% - 32px); width: max-content; box-shadow: 0 8px 24px rgba(20,23,26,.25);
  transition: opacity .2s ease, transform .2s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
main.has-sheet ~ .toast { bottom: auto; top: calc(env(safe-area-inset-top, 0px) + 72px); }
.dlg {
  border: 0; padding: 0; border-radius: 22px; width: calc(100% - 24px); max-width: 440px;
  background: #fff; color: var(--text); box-shadow: 0 20px 60px rgba(20,23,26,.3);
}
.dlg::backdrop { background: rgba(20,23,26,.5); }
.dlg.fallback { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 80; margin: 0; }
.dlg-form { padding: 18px; display: grid; gap: 14px; }
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dlg-body { display: grid; gap: 14px; }
.dlg-actions { display: flex; gap: 10px; justify-content: flex-end; }
.dlg-actions .btn { flex: 1; }

@media (max-width: 359px) {
  .two { grid-template-columns: 1fr; }
  .odo-val { font-size: 38px; }
  .actions { grid-template-columns: 1fr; }
}
@media (min-width: 700px) {
  body { background: #E9EBE6; }
  main { background: var(--bg); min-height: calc(100vh - 60px); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- sign in ---------- */
body.auth-mode .appbar, body.auth-mode .tabbar { display: none; }
body.auth-mode main { padding-top: calc(env(safe-area-inset-top, 0px) + 20px); padding-bottom: calc(32px + var(--safe-b)); }
.auth { display: grid; gap: 18px; }
.auth > * + * { margin-top: 0; }
.auth-hero { display: grid; gap: 12px; }
.auth-brand { display: flex; align-items: center; gap: 10px; font: 700 16px var(--font-h); }
.auth-brand svg { width: 36px; height: 36px; }
.auth-hero h1 { font-size: 30px; line-height: 1.1; font-weight: 700; }
.auth-hero > p { color: var(--muted); font-size: 16px; }
.auth-photo { position: relative; border-radius: 20px; overflow: hidden; aspect-ratio: 1150 / 600; background: #E2E5DF; }
.auth-photo img { width: 100%; height: 100%; object-fit: cover; object-position: center 40%; display: block; }
.auth-pin { position: absolute; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; background: var(--c); border: 2.5px solid #fff; box-shadow: 0 2px 6px rgba(20,23,26,.45); }
.auth-feat { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-weight: 600; font-size: 14px; }
.auth-feat li { display: flex; align-items: center; gap: 10px; }
.auth-feat .ic { color: var(--accent); }
.auth-card { display: grid; gap: 14px; }
.auth-card > * + * { margin-top: 0; }
.pw { position: relative; display: block; }
.pw input { padding-right: 64px; }
.pw .link-btn { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); min-height: 40px; padding: 0 8px; text-decoration: none; }
.auth-guest { text-align: center; display: grid; gap: 4px; justify-items: center; }
.auth-guest .link-btn { min-height: 44px; font-size: 15px; }
.err span { flex: 1; }
.account .acct { display: flex; align-items: center; gap: 12px; }
.avatar { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; font: 700 18px var(--font-h); flex: none; }
.sync-line { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.sync-line::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--ok-c); flex: none; }
.sync-line.wait::before { background: var(--so-c); }
.danger-link { color: var(--od-t); min-height: 44px; }
