:root {
  /* ShopNav family base (cream, Inter + Instrument Serif); GarageNav accent is navy + amber */
  --bg: #FAF7F2;
  --surface: #FFFFFF;
  --ink: #1A1A1A;
  --ink-2: #4A4A4A;
  --muted: #8A8A8A;
  --line: #E8E4DC;
  --line-2: #F0EBE2;
  --brand: #14324F;
  --brand-2: #1E4A72;
  --brand-tint: #E6EDF4;
  --accent: #D9822B;
  --accent-tint: #FBEBD9;
  --win: #1F6E43;
  --win-tint: #E7F1EB;
  --warn: #B36B00;
  --danger: #C9422F;
  --r-sm: 8px; --r: 14px; --r-lg: 20px;
  --shadow: 0 1px 2px rgba(20,20,20,.04), 0 8px 24px rgba(20,20,20,.06);
  --tabbar-h: 66px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased; font-size: 15px; line-height: 1.4;
  overscroll-behavior: none;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; padding: 0; color: inherit; font-size: inherit; }
input, select { font-family: inherit; font-size: 16px; color: var(--ink); }
a { color: inherit; }
.serif { font-family: 'Instrument Serif', Georgia, serif; font-weight: 400; }

.app { max-width: 1100px; margin: 0 auto; min-height: 100%; display: flex; flex-direction: column; }
.beta {
  background: var(--brand); color: #fff; font-size: 12px; font-weight: 600;
  padding: 7px 14px; text-align: center; letter-spacing: .01em;
}
.beta b { color: #FFD49A; }
.app-header {
  position: sticky; top: 0; z-index: 30; background: rgba(250,247,242,.96);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line-2);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 16px;
}
.wm { display: flex; align-items: center; gap: 8px; font-weight: 800; letter-spacing: -.01em; font-size: 17px; }
.wm .mark { width: 30px; height: 30px; border-radius: 9px; background: var(--brand); display: grid; place-items: center; flex-shrink: 0; }
.wm .mark svg { width: 18px; height: 18px; }
.wm span em { font-style: normal; color: var(--accent); }
.car-chip {
  display: flex; align-items: center; gap: 6px; max-width: 46vw;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 12px; font-size: 13px; font-weight: 600;
}
.car-chip .t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.car-chip svg { width: 14px; height: 14px; flex-shrink: 0; color: var(--brand); }
.iconbtn {
  width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); display: grid; place-items: center; color: var(--brand); flex-shrink: 0;
}
.iconbtn.on { background: var(--brand); color: #fff; border-color: var(--brand); }

main { flex: 1; padding: 16px 16px calc(var(--tabbar-h) + 28px + env(safe-area-inset-bottom)); }
.screen { display: none; animation: fade .2s ease-out; }
.screen.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

h1.title { font-family: 'Instrument Serif', Georgia, serif; font-weight: 400; font-size: 30px; line-height: 1.1; margin: 4px 0 6px; letter-spacing: -.01em; }
h1.title em { color: var(--brand-2); }
.sub { color: var(--ink-2); font-size: 14px; margin: 0 0 14px; }
h2.sec { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 22px 0 10px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; box-shadow: var(--shadow); }
.card + .card { margin-top: 10px; }
.row { display: flex; align-items: center; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.b { font-weight: 700; }
.price { font-weight: 800; font-variant-numeric: tabular-nums; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 12px 16px; border-radius: 12px; font-weight: 700; font-size: 14px; min-height: 44px; text-decoration: none; }
.btn.primary { background: var(--brand); color: #fff; }
.btn.accent { background: var(--accent); color: #fff; }
.btn.ghost { background: var(--line-2); color: var(--ink); }
.btn.line { background: var(--surface); border: 1px solid var(--line); }
.btn.block { width: 100%; }
.btn.sm { padding: 8px 12px; min-height: 36px; font-size: 13px; border-radius: 10px; }
.btn:disabled { opacity: .45; }

.seg { display: inline-flex; background: var(--line-2); border-radius: 999px; padding: 3px; gap: 2px; }
.seg button { padding: 7px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.seg.full { display: flex; }
.seg.full button { flex: 1; }

.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.pill.online { background: var(--brand-tint); color: var(--brand-2); }
.pill.reported { background: var(--accent-tint); color: #9A5512; }
.pill.mine { background: var(--win-tint); color: var(--win); }
.pill.na { background: var(--line-2); color: var(--muted); }
.pill.sample { background: #FFF4CE; color: #7A5A00; }
.pill.best { background: var(--win); color: #fff; }
.pill.fresh { background: var(--win-tint); color: var(--win); }
.pill.recent { background: var(--brand-tint); color: var(--brand-2); }
.pill.stale { background: var(--line-2); color: var(--muted); }
.dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; display: inline-block; }

.field { display: block; margin-bottom: 12px; }
.field > span { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 5px; }
.input, .select {
  width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
  min-height: 46px;
}
.input:focus, .select:focus { outline: 2px solid var(--brand-2); outline-offset: 0; border-color: transparent; }
.input.vin { text-transform: uppercase; letter-spacing: .08em; font-variant-numeric: tabular-nums; }

.car-card { display: flex; gap: 12px; align-items: center; }
.car-card .ic { width: 46px; height: 46px; border-radius: 12px; background: var(--brand-tint); display: grid; place-items: center; flex-shrink: 0; }
.car-card .ic svg { width: 26px; height: 26px; color: var(--brand); }
.car-card.active { border-color: var(--brand-2); box-shadow: 0 0 0 2px var(--brand-tint), var(--shadow); }
.car-name { font-weight: 700; font-size: 16px; }
.empty { text-align: center; padding: 26px 16px; }
.empty .big { font-size: 40px; }

.search { position: relative; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); }
.search .input { padding-left: 38px; }
.jobs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.job { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 4px; text-align: center; font-size: 12px; font-weight: 600; }
.job .e { font-size: 22px; display: block; margin-bottom: 3px; }
.job.on { border-color: var(--brand-2); background: var(--brand-tint); color: var(--brand); }
.part-card .top { display: flex; align-items: flex-start; gap: 10px; }
.part-card .nm { font-weight: 700; }
.part-card .from { font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.part-card .from b { color: var(--win); }
.part-card .actions { display: flex; gap: 8px; margin-top: 10px; align-items: center; flex-wrap: wrap; }
.fit { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700; color: var(--win); background: var(--win-tint); padding: 3px 8px; border-radius: 999px; }
.fit.no { color: var(--muted); background: var(--line-2); }
.fit.maybe { color: #9A5512; background: var(--accent-tint); }

.mode { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.summary { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 12px; }
.sum-card { border-radius: var(--r); padding: 14px; background: var(--surface); border: 1px solid var(--line); }
.sum-card.win { background: var(--win); color: #fff; border-color: var(--win); }
.sum-card .k { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; opacity: .85; }
.sum-card .v { font-size: 26px; font-weight: 800; margin-top: 2px; font-variant-numeric: tabular-nums; }
.sum-card .d { font-size: 13px; margin-top: 2px; opacity: .92; }
.store-card { padding: 0; overflow: hidden; }
.store-card .hd { display: flex; align-items: center; gap: 10px; padding: 13px 14px; width: 100%; text-align: left; }
.store-card .tot { text-align: right; }
.store-card .tot .price { font-size: 18px; }
.store-card .bd { display: none; border-top: 1px solid var(--line-2); padding: 6px 14px 12px; }
.store-card.open .bd { display: block; }
.store-card.best { border-color: var(--win); box-shadow: 0 0 0 2px var(--win-tint), var(--shadow); }
.li { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line-2); align-items: flex-start; }
.li:last-child { border-bottom: 0; }
.li .p { text-align: right; white-space: nowrap; }
.chev { width: 16px; height: 16px; color: var(--muted); transition: transform .15s; flex-shrink: 0; }
.store-card.open .chev { transform: rotate(180deg); }
.list-item { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.list-item:last-child { border-bottom: 0; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.qty button { width: 32px; height: 32px; font-weight: 800; background: var(--line-2); }
.qty span { min-width: 26px; text-align: center; font-weight: 700; font-size: 14px; }
.x { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; color: var(--muted); }
.x svg { width: 16px; height: 16px; }

.mx { width: 100%; border-collapse: collapse; font-size: 13px; }
.mx th, .mx td { padding: 8px 6px; border-bottom: 1px solid var(--line-2); text-align: right; font-variant-numeric: tabular-nums; }
.mx th:first-child, .mx td:first-child { text-align: left; }
.mx th { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }
.mx td.low { color: var(--win); font-weight: 800; }
.mx td.na { color: var(--muted); font-size: 11.5px; }
.item-block { padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.item-block:last-child { border-bottom: 0; }
.offers { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.offer { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); border-radius: 10px; padding: 5px 8px; font-size: 12.5px; background: var(--surface); }
.offer.low { border-color: var(--win); background: var(--win-tint); color: var(--win); font-weight: 700; }
.offer.na { color: var(--muted); border-style: dashed; }
.ebay { background: #FFFDF6; border: 1px dashed #E7D9A8; }

.store-row { display: flex; align-items: center; gap: 12px; }
.store-logo { width: 40px; height: 40px; border-radius: 10px; color: #fff; font-weight: 800; font-size: 13px; display: grid; place-items: center; flex-shrink: 0; }

.scan { border: 2px dashed var(--line); border-radius: var(--r); padding: 20px; text-align: center; background: var(--surface); }
.scan .big { font-size: 34px; }
.ocr-line { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line-2); }
.ocr-line input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--win); }
.progress { height: 6px; background: var(--line-2); border-radius: 999px; overflow: hidden; margin-top: 10px; }
.progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .8s ease; }

.chart { width: 100%; height: auto; display: block; }
.chart .line { fill: none; stroke: var(--brand-2); stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.chart .live { fill: var(--accent); }
.lock-note { background: var(--accent-tint); border-radius: 12px; padding: 12px; font-size: 13.5px; color: #6B3E0B; }
.star { font-size: 20px; line-height: 1; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  background: var(--surface); border-top: 1px solid var(--line);
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  display: flex; justify-content: center;
}
.tabbar .in { display: flex; width: 100%; max-width: 720px; }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--muted); padding: 6px 2px; border-radius: 12px; position: relative; }
.tab svg { width: 22px; height: 22px; }
.tab.active { color: var(--brand); }
.tab.active svg { stroke-width: 2.4; }
.badge { position: absolute; top: 2px; right: calc(50% - 22px); background: var(--accent); color: #fff; font-size: 10.5px; font-weight: 800; border-radius: 999px; min-width: 18px; height: 18px; display: grid; place-items: center; padding: 0 5px; }

.scrim { position: fixed; inset: 0; background: rgba(15,25,35,.42); z-index: 60; display: none; }
.scrim.on { display: block; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 61; max-width: 640px; margin: 0 auto;
  background: var(--bg); border-radius: 22px 22px 0 0; max-height: 90vh; overflow-y: auto;
  padding: 10px 16px calc(20px + env(safe-area-inset-bottom));
  transform: translateY(105%); transition: transform .22s ease;
}
.sheet.on { transform: none; }
.sheet .grab { width: 40px; height: 5px; border-radius: 9px; background: var(--line); margin: 2px auto 10px; }
.sheet h3 { margin: 4px 0 12px; font-size: 19px; }
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 18px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 13.5px; font-weight: 600;
  opacity: 0; pointer-events: none; transition: all .2s; z-index: 80; max-width: 90vw; text-align: center;
}
.toast.on { opacity: 1; transform: translateX(-50%); }

@media (min-width: 700px) {
  main { padding-left: 24px; padding-right: 24px; }
  .split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
  .split > .pane-r { position: sticky; top: 70px; }
  .summary { grid-template-columns: 1fr 1fr; }
  .summary .sum-card.win { grid-column: 1 / -1; }
  .jobs { grid-template-columns: repeat(4, 1fr); }
  h1.title { font-size: 34px; }
  .only-narrow { display: none !important; }
  .car-chip { max-width: 360px; }
}
@media (max-width: 699px) { .only-wide { display: none !important; } }
@media (max-width: 360px) { .jobs { grid-template-columns: repeat(3, 1fr); } .car-chip { max-width: 42vw; } }
