:root{--bg: #f5f3ee;--card: #ffffff;--fg: #1d1b18;--muted: #625d55;--border: #dcd6cb;--accent: #8a5a12;--accent-fg: #ffffff;--accent-soft: rgba(138, 90, 18, .1);--good: #1d7a46;--bad: #b3261e;--s0: #b8862b;--s1: #4f7fa8;--s2: #7c9a4a;--mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace}@media(prefers-color-scheme:dark){:root{--bg: #12110f;--card: #1c1a17;--fg: #ebe6dd;--muted: #a39d92;--border: #34302a;--accent: #e7b36a;--accent-fg: #15120d;--accent-soft: rgba(231, 179, 106, .13);--good: #5cc98b;--bad: #ff6b60;--s0: #d9a54a;--s1: #78a6cf;--s2: #9dbd68}}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--fg);font:15px/1.5 system-ui,-apple-system,Segoe UI,Roboto,sans-serif}#app{max-width:1120px;margin:0 auto;padding:20px 16px 64px}h1{margin:0 0 4px;font-size:28px}h2{margin:0 0 10px;font-size:18px}h3{margin:18px 0 8px;font-size:15px}.lede{margin:0 0 16px;color:var(--muted);max-width:760px}.card{background:var(--card);border:1px solid var(--border);border-radius:10px;padding:16px;margin-bottom:16px}label{display:flex;flex-direction:column;gap:4px;font-weight:600;font-size:13px}.hint,.note{color:var(--muted);font-weight:400;font-size:13px}.inline{display:flex;gap:8px;flex-wrap:wrap;margin-top:4px}input,select,button{font:inherit;color:inherit;background:var(--bg);border:1px solid var(--border);border-radius:6px;padding:6px 10px}#target{flex:1 1 260px;font-family:var(--mono);font-size:16px}select{flex:0 1 300px;min-width:0}input[type=number]{width:100px}input[type=range]{padding:0;accent-color:var(--accent)}button{cursor:pointer}button:hover{border-color:var(--accent)}button.primary{background:var(--accent);color:var(--accent-fg);border-color:var(--accent);font-weight:600}:focus-visible{outline:2px solid var(--accent);outline-offset:2px}.limits{display:flex;gap:12px;flex-wrap:wrap;align-items:flex-end;margin-top:12px}.parsed{margin:6px 0 0;font-family:var(--mono);font-size:13px;color:var(--muted)}.note:empty,.error:empty,.parsed:empty{display:none}.error{color:var(--bad);margin:10px 0 0}.summary{color:var(--muted);margin-bottom:10px}.best-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:10px;margin-bottom:12px}.best{display:flex;flex-direction:column;gap:2px;text-align:left;padding:10px 12px;border-radius:8px;border:1px solid var(--border);background:var(--bg)}.best.active,tr.active{background:var(--accent-soft);border-color:var(--accent)}.best.empty{color:var(--muted)}.mono{font-family:var(--mono)}.table-wrap{overflow-x:auto}table{border-collapse:collapse;width:100%;font-size:14px}th,td{text-align:left;padding:6px 8px;border-bottom:1px solid var(--border);white-space:nowrap}th{font-size:12px;color:var(--muted);font-weight:600}table.trains tbody tr{cursor:pointer}table.trains tbody tr:hover{background:var(--accent-soft)}td.good{color:var(--good)}td.muted{color:var(--muted)}.view-info{color:var(--muted);margin-top:0}svg.gears{width:100%;height:auto;max-height:460px;display:block;background:var(--bg);border-radius:8px}.gear path{fill-opacity:.55;stroke:var(--fg);stroke-width:.25;stroke-opacity:.6}.gear.driven path{fill-opacity:.35}.gear.stage-0 path{fill:var(--s0)}.gear.stage-1 path{fill:var(--s1)}.gear.stage-2 path{fill:var(--s2)}.gear .pitch{fill:none;stroke:var(--fg);stroke-opacity:.25;stroke-width:.2;stroke-dasharray:1 1}.gear .spoke{stroke:var(--fg);stroke-opacity:.5;stroke-width:.6}.gear .hand{stroke:var(--bad);stroke-width:1.4;stroke-linecap:round}.axle{fill:var(--card);stroke:var(--fg);stroke-width:.4}.axle.input{stroke:var(--good);stroke-width:1.2}.axle.output{stroke:var(--bad);stroke-width:1.2}.toolbar{display:flex;gap:10px;flex-wrap:wrap;align-items:center;margin-top:10px}.speed{flex-direction:row;align-items:center;gap:8px}.status{color:var(--muted);font-size:13px}.drift{display:grid;grid-template-columns:200px 1fr;gap:16px;align-items:center}svg.dial{width:200px;height:200px}.dial .face{fill:var(--bg);stroke:var(--border);stroke-width:2}.dial .tick{stroke:var(--muted);stroke-width:2}.dial .ideal{stroke:var(--muted);stroke-width:5;stroke-linecap:round;stroke-opacity:.6}.dial .actual{stroke:var(--bad);stroke-width:3;stroke-linecap:round}.dial .hub{fill:var(--fg)}.cf p{margin:0 0 8px}table.approx{margin:8px 0}footer{color:var(--muted);font-size:13px;text-align:center}footer a{color:var(--accent)}@media(max-width:560px){.drift{grid-template-columns:1fr;justify-items:center}input[type=number]{width:84px}}
