:root{--paper:#f6efe1;--card:#fffaf0;--ink:#2b2418;--muted:#76694f;--line:#e3d6bb;--road:#3d4a52;--sign:#c4572b;--sign-l:#fbe3d6;--green:#4f7a4a;--red:#a8402c;--radius:14px}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0;background:var(--paper);color:var(--ink);font:16px/1.5 "Source Sans 3",system-ui,sans-serif}
h1,h2,.headline{font-family:Fraunces,Georgia,serif}
.top{padding:22px clamp(16px,4vw,40px) 6px;max-width:1200px;margin:0 auto}
.brand{display:flex;gap:14px;align-items:center}
.brand h1{margin:0;font-size:2rem;line-height:1.1}
.sub{margin:2px 0 0;color:var(--muted)}
.layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.1fr);gap:20px;max-width:1200px;margin:0 auto;padding:14px clamp(12px,4vw,40px)}
@media (max-width:900px){.layout{grid-template-columns:minmax(0,1fr)}}
.panel{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);padding:18px 18px 8px;box-shadow:0 1px 0 #fff inset,0 8px 24px -18px #6b5326}
fieldset{border:0;margin:0 0 18px;padding:0;min-width:0}
legend{font-weight:700;margin-bottom:8px;padding:0}
.opt{font-weight:400;color:var(--muted);font-size:.85rem;margin-left:6px}
.chips{display:flex;flex-wrap:wrap;gap:6px}
#cars{margin:4px 0 2px}
.chip{border:1.5px solid var(--line);background:#fff;border-radius:999px;padding:6px 12px;font:inherit;font-size:.95rem;color:inherit;cursor:pointer;min-height:36px}
.chip small{color:var(--muted);margin-left:5px}
.chip[aria-checked=true]{border-color:var(--sign);background:var(--sign-l);box-shadow:0 0 0 2px #c4572b33}
.chip:hover,button.ghost:hover{border-color:#cdb68a}
.units-row{display:flex;justify-content:space-between;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:8px}
button.link{border:0;background:none;color:var(--sign);font:inherit;font-weight:600;cursor:pointer;padding:6px 4px;text-decoration:underline;text-underline-offset:3px}
input[type=text]{font:inherit;color:inherit;border:1.5px solid var(--line);border-radius:10px;padding:6px 8px;background:#fff;min-height:38px;min-width:0;width:100%}
input[aria-invalid=true]{border-color:var(--red);background:#fff4f0}
.row3{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:10px}
.row3 label,label.inline{display:flex;flex-direction:column;gap:4px;font-size:.9rem;color:var(--muted)}
label.inline{max-width:16em;margin-top:8px}
.with-u{display:flex;align-items:center;gap:6px;color:var(--muted)}
.with-u input{flex:1;color:var(--ink)}
.u{white-space:nowrap;font-size:.9rem}
.gauge-box{margin-top:10px;max-width:420px}
#gauge{width:100%;accent-color:var(--sign);height:28px}
.gauge-scale{display:flex;justify-content:space-between;font-size:.8rem;color:var(--muted);padding:0 4px;font-weight:600}
.rows{display:flex;flex-direction:column;gap:6px}
.row{display:grid;grid-template-columns:minmax(0,1.4fr) minmax(0,.9fr) minmax(0,.9fr) minmax(0,.7fr) 3.2em 38px;gap:6px;align-items:center}
.row.head{font-size:.78rem;color:var(--muted);font-weight:600;margin-bottom:4px;line-height:1.2}
.row .base{display:flex;justify-content:center}
.row .base input{width:20px;height:20px;accent-color:var(--sign)}
.row.is-base{background:var(--sign-l);border-radius:10px;padding:3px;margin:-3px}
.del{width:38px;height:38px;border-radius:10px;border:1.5px solid var(--line);background:#fff;color:var(--muted);font-size:1.2rem;cursor:pointer}
.del:hover{color:var(--red);border-color:#e0b4a8}
@media (max-width:520px){.row{grid-template-columns:minmax(0,1fr) minmax(0,1fr) 2.6em 38px}.row .nm{grid-column:1/-1}.row.head{display:none}.row .mins{display:none}.row{border-bottom:1px dashed var(--line);padding-bottom:8px}}
.row-btns{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-top:8px}
button.ghost{border:1.5px solid var(--line);background:#fff;border-radius:10px;padding:6px 12px;font:inherit;cursor:pointer;color:inherit;min-height:38px}
.hint{color:var(--muted);font-size:.88rem;margin:6px 0 0;font-weight:400}
.top-hint{margin:0 0 10px}
.err{color:var(--red);font-size:.92rem;margin:6px 0 0}
.answer{position:sticky;top:12px;align-self:start}
@media (max-width:900px){.answer{position:static}}
.empty{padding:40px 10px;text-align:center;color:var(--muted)}
.empty p{max-width:40ch;margin:10px auto 0}
#ans-err-text{color:var(--red)}
.kicker{margin:0;color:var(--muted);font-weight:600;text-transform:uppercase;letter-spacing:.06em;font-size:.8rem}
.headline{font-size:clamp(1.8rem,5vw,2.5rem);line-height:1.12;margin:4px 0 8px;color:var(--ink)}
.headline b{color:var(--sign)}
.headline.stay b{color:var(--road)}
.verdict{margin:0 0 6px;font-size:1.05rem}
.notes{margin:10px 0 4px;padding-left:18px}
.notes li{margin:4px 0}
.notes li.warn{color:var(--red)}
h2{font-size:1.2rem;margin:20px 0 8px}
.table-wrap{overflow-x:auto}
.cmp{width:100%;border-collapse:collapse;font-variant-numeric:tabular-nums;font-size:.95rem}
.cmp th{text-align:left;font-size:.78rem;color:var(--muted);font-weight:600;padding:4px 6px;border-bottom:1.5px solid var(--line)}
.cmp td{padding:7px 6px;border-bottom:1px solid var(--line);vertical-align:top}
.cmp td small{display:block;color:var(--muted);font-size:.8rem}
.cmp tr.win td{background:#eef4ea}
.cmp tr.win td:first-child{box-shadow:inset 3px 0 0 var(--green)}
.cmp .pos{color:var(--green);font-weight:700}
.cmp .neg{color:var(--red);font-weight:700}
.sw{display:inline-block;width:10px;height:10px;border-radius:50%;margin-right:6px;vertical-align:1px}
#chart svg{width:100%;height:auto;display:block}
#chart .ax{font:12px "Source Sans 3",sans-serif;fill:#76694f}
#chart .lb{font:700 12px "Source Sans 3",sans-serif}
.legend{font-size:.85rem;color:var(--muted);display:flex;gap:4px 14px;flex-wrap:wrap;margin:4px 0 0}
.go{background:var(--ink);color:#fffaf0;border:0;border-radius:12px;padding:12px 18px;font:inherit;font-weight:700;cursor:pointer;min-height:46px}
.go:hover{background:#463b27}
.share-row{display:flex;gap:10px;align-items:center;margin:16px 0 10px;flex-wrap:wrap}
.how{max-width:820px;margin:10px auto 0;padding:0 clamp(16px,4vw,40px);color:#4d4331}
.foot{max-width:1200px;margin:0 auto;padding:16px clamp(16px,4vw,40px) 40px;color:var(--muted);font-size:.85rem;text-align:center}
:focus-visible{outline:3px solid #c4572b66;outline-offset:2px}
.peek{display:none}
@media (max-width:900px){.peek:not([hidden]){display:flex;position:fixed;left:10px;right:10px;bottom:calc(10px + env(safe-area-inset-bottom));z-index:5;align-items:center;gap:10px;padding:10px 14px;border-radius:14px;background:#2b2418;color:#fffaf0;text-decoration:none;box-shadow:0 10px 30px -10px #0008}
.peek b{font-family:Fraunces,Georgia,serif;font-size:1.05rem;color:#f0a27e;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}.peek span:last-child{margin-left:auto;font-size:.9rem;opacity:.85;white-space:nowrap}
.foot{padding-bottom:90px}}
