:root { --paper:#f3f6f7; --sheet:#fff; --ink:#12262f; --soft:#4d626c; --line:#b9c6cc; --stripe:#ffc61a; --done:#0a7a55; --stop:#b3261e; --night:#0c1418; --glass:#17242b;
  --body:"Avenir Next",Avenir,"Segoe UI",system-ui,sans-serif; --tight:"Avenir Next Condensed","DIN Condensed",Bahnschrift,"Arial Narrow",sans-serif;
  --st:env(safe-area-inset-top); --sr:env(safe-area-inset-right); --sb:env(safe-area-inset-bottom); --sl:env(safe-area-inset-left); }
* { box-sizing:border-box; }
[hidden] { display:none !important; }
html, body { margin:0; height:100%; }
body { background:var(--paper); color:var(--ink); font:17px/1.4 var(--body); -webkit-text-size-adjust:100%; }
h1, h2, p, ul { margin:0; }
h1 { font:700 34px/1.1 var(--tight); }
h2 { font:700 22px/1.2 var(--tight); }
p { max-width:65ch; }
.soft { color:var(--soft); }
.err { color:var(--stop); font-weight:600; }
button { font:600 17px/1.2 var(--body); min-height:48px; padding:10px 18px; border:2px solid var(--ink); border-radius:8px; background:transparent; color:inherit; cursor:pointer; touch-action:manipulation; }
button.go { background:var(--stripe); border-color:var(--stripe); color:#1d1600; }
button.danger { border-color:var(--stop); color:var(--stop); }
button:disabled { opacity:.4; cursor:default; }
:focus-visible { outline:3px solid #1877c9; outline-offset:2px; }
.proto { background:var(--ink); color:#fff; font-size:14px; padding:calc(6px + var(--st)) calc(22px + var(--sr)) 6px calc(22px + var(--sl)); }
.page { max-width:1100px; margin:0 auto; padding:22px calc(22px + var(--sr)) calc(32px + var(--sb)) calc(22px + var(--sl)); display:grid; gap:20px; grid-template-columns:minmax(0,1fr); }
.bar { display:flex; flex-wrap:wrap; gap:12px; align-items:center; }
.bar h1 { flex:1 1 280px; overflow-wrap:anywhere; }
.rows { border-top:2px solid var(--ink); }
.vrow { display:flex; gap:16px; align-items:center; width:100%; text-align:left; border:0; border-bottom:1px solid var(--line); border-radius:0; padding:14px 4px; font-weight:400; }
.vrow .grow { flex:1; min-width:0; }
.vrow b { font:700 24px/1.1 var(--tight); display:block; }
.vrow .soft { overflow-wrap:anywhere; }
.count { font:700 26px/1 var(--tight); white-space:nowrap; }
.count.ok { color:var(--done); }
form { display:grid; gap:18px; max-width:640px; }
label, fieldset { display:grid; gap:6px; border:0; padding:0; margin:0; min-width:0; }
legend, label span { font-weight:600; padding:0; }
legend { margin-bottom:6px; }
input[type=text] { font:600 22px/1.2 var(--body); min-height:52px; padding:8px 12px; border:2px solid var(--ink); border-radius:8px; background:var(--sheet); color:var(--ink); width:100%; }
.chips { display:flex; flex-wrap:wrap; gap:10px; }
.chips button[aria-pressed=true] { background:var(--ink); color:#fff; }
section { display:grid; gap:10px; }
.two { display:flex; gap:10px; }
.two input { flex:1; min-width:0; }
.grid { display:grid; gap:14px; grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); }
.cell { padding:0; border:2px solid var(--line); border-radius:6px; overflow:hidden; text-align:left; background:var(--sheet); display:flex; flex-direction:column; font-weight:500; font-size:15px; }
.cell .pic { aspect-ratio:4/3; display:grid; place-items:center; background:#dfe7ea; font:700 40px/1 var(--tight); color:#667a84; width:100%; overflow:hidden; }
.cell img { width:100%; height:100%; object-fit:cover; display:block; }
.cell .cap { padding:8px 10px; }
.cell .state { display:block; font-weight:700; color:var(--stop); }
.cell.has { border-color:var(--done); }
.cell.has .state { color:var(--done); }
ul.plain { padding-left:20px; }
li { overflow-wrap:anywhere; }

/* Capture */
.cap-screen { position:fixed; inset:0; background:var(--night); color:#fff; display:grid; grid-template-columns:minmax(0,1fr) clamp(220px,26vw,320px); grid-template-rows:minmax(0,1fr); padding:var(--st) var(--sr) var(--sb) var(--sl); }
.cap-screen button { border-color:#71868f; }
.cap-screen button.go { border-color:var(--stripe); }
.stagewrap { position:relative; display:grid; place-items:center; min-width:0; min-height:0; overflow:hidden; }
.stage { position:relative; background:#000; overflow:hidden; }
.stage video, .stage img, .stage svg { position:absolute; inset:0; width:100%; height:100%; object-fit:contain; }
.stage svg { pointer-events:none; }
.guide path, .guide ellipse, .guide rect { fill:none; stroke:#ffe08a; stroke-width:5; stroke-dasharray:18 12; }
.guide { filter:drop-shadow(0 0 2px #000) drop-shadow(0 0 1px #000); }
.rail { background:var(--glass); padding:14px; display:flex; flex-direction:column; gap:10px; min-height:0; }
.rail .info { flex:1 1 0; overflow:auto; display:flex; flex-direction:column; gap:8px; min-height:0; }
.rail .soft { color:#b7c6cd; }
.rail .big { font:700 30px/1 var(--tight); }
.rail h2 { font-size:24px; }
.rail .act { display:grid; gap:8px; }
.rail .act .go { min-height:72px; font-size:22px; }
.rail .pair { display:grid; grid-auto-flow:column; grid-auto-columns:1fr; gap:8px; }
.rail .pair button { padding:8px 6px; font-size:16px; }
.rail label { grid-template-columns:auto minmax(0,1fr); align-items:center; gap:10px; font-size:15px; }
.rail label span { font-weight:500; }
.rail input { width:100%; min-height:32px; accent-color:var(--stripe); }
.map { width:100%; height:210px; flex:0 0 auto; }
.map .body { fill:#24363f; stroke:#8fa3ac; stroke-width:2; }
.map .cab { fill:#33474f; }
.map .dot { fill:#70868f; }
.map .dot.done { fill:#2fc08d; }
.map .cone { fill:var(--stripe); opacity:.35; }
.map .me { fill:var(--stripe); }
.msg { position:absolute; inset:auto 12px 12px; padding:12px 14px; background:rgba(12,20,24,.9); border-radius:8px; text-align:center; }
.msg:empty { display:none; }
.turn { display:none; }
@media (orientation:portrait) {
  .turn { display:grid; place-content:center; justify-items:center; gap:16px; position:fixed; inset:0; background:var(--night); color:#fff; text-align:center; padding:24px; z-index:5; }
  .turn button { border-color:#71868f; }
}
@media (max-height:480px) {
  .map { height:104px; }
  .rail { padding:8px; gap:6px; }
  .rail h2 { font-size:18px; }
  .rail .big { font-size:22px; }
  .rail .act .go { min-height:52px; font-size:19px; }
  .rail .info { font-size:14px; gap:4px; }
  .rail button { min-height:44px; }
}

/* VIN scan */
.scan { position:fixed; inset:0; z-index:8; background:var(--night); color:#fff; display:flex; flex-direction:column; padding:var(--st) var(--sr) var(--sb) var(--sl); }
.scan .view { position:relative; flex:1; min-height:0; overflow:hidden; }
.scan video { position:absolute; inset:0; width:100%; height:100%; object-fit:contain; }
.scan .aim { position:absolute; border:4px solid var(--stripe); border-radius:8px; pointer-events:none; box-shadow:0 0 0 2px #000; }
.scan .bar { padding:14px 18px; background:var(--glass); }
.scan .bar p { flex:1 1 260px; }
.scan button { border-color:#71868f; }

/* Review */
.strip { display:flex; overflow-x:auto; scroll-snap-type:x mandatory; background:var(--night); border-radius:8px; -webkit-overflow-scrolling:touch; }
.slide { flex:0 0 100%; min-width:0; scroll-snap-align:center; scroll-snap-stop:always; height:min(62vh,640px); display:flex; flex-direction:column; color:#fff; }
.slide .pic { flex:1; min-height:0; }
.slide img { width:100%; height:100%; object-fit:contain; display:block; }
.slide p { padding:10px 14px; max-width:none; }
#toast { position:fixed; left:50%; bottom:calc(20px + var(--sb)); transform:translateX(-50%); background:var(--ink); color:#fff; border:1px solid #71868f; padding:12px 18px; border-radius:8px; max-width:90vw; z-index:9; }
#toast:empty { display:none; }
