:root{--bg:#f6f7f9;--card:#fff;--fg:#1a202c;--muted:#718096;--border:#e2e8f0;--accent:#2b6cb0;--accent-bg:#ebf4ff;--danger:#e53e3e;--race:rgba(43,108,176,.08);--sel:rgba(0,0,0,.7);--sel-halo:rgba(255,255,255,.9);--grid:#e2e8f0;--font:system-ui, -apple-system, "Segoe UI", Roboto, sans-serif}@media (prefers-color-scheme:dark){:root{--bg:#0f1419;--card:#1a202c;--fg:#e2e8f0;--muted:#a0aec0;--border:#2d3748;--accent:#63b3ed;--accent-bg:#2a4365;--race:rgba(99,179,237,.12);--sel:rgba(255,255,255,.85);--sel-halo:rgba(0,0,0,.8);--grid:#2d3748}}*{box-sizing:border-box}body{background:var(--bg);color:var(--fg);font-family:var(--font);margin:0;font-size:14px;line-height:1.4}a{color:var(--accent)}h1{margin:.6rem 0 .2rem;font-size:1.5rem}h2{margin:0 0 .6rem;font-size:1.1rem}h3{margin:0 0 .5rem;font-size:1rem}h3 .hint{font-weight:400}code{background:var(--accent-bg);border-radius:3px;padding:0 .3em}.page{max-width:1000px;margin:0 auto;padding:1rem}.page.wide{max-width:1500px}.topbar{flex-wrap:wrap;align-items:baseline;gap:1rem;margin-bottom:.5rem;display:flex}.topbar .spacer{flex:1}.card{background:var(--card);border:1px solid var(--border);border-radius:8px;margin:.75rem 0;padding:.8rem 1rem}.hint{color:var(--muted);font-size:.9em}.error{color:var(--danger);background:rgba(229,62,62,.08);border-radius:6px;padding:.5rem .8rem}button,.button{font:inherit;border:1px solid var(--accent);background:var(--accent);color:#fff;cursor:pointer;border-radius:6px;padding:.35rem .8rem;text-decoration:none;display:inline-block}button:disabled,.button:disabled{opacity:.6;cursor:default}button.secondary,.button.secondary{color:var(--fg);border-color:var(--border);background:0 0}button.active,.button.active{outline:2px solid var(--accent);outline-offset:1px}button.link,.button.link{color:var(--accent);background:0 0;border:none;padding:0}button.link.danger,.button.link.danger{color:var(--danger)}.toolbar{flex-wrap:wrap;align-items:center;gap:.5rem;margin-bottom:.5rem;display:flex}.toolbar label{align-items:center;gap:.3rem;display:inline-flex}.toolbar input[type=number]{font:inherit;border:1px solid var(--border);background:var(--card);width:5em;color:var(--fg);border-radius:4px;padding:.25rem .4rem}.scope-bar{margin:.5rem 0}.scope-bar button.active{background:var(--accent);color:#fff}.wind-arrow{color:var(--muted);align-items:center;gap:.2rem;margin-left:auto;display:inline-flex}form.inline{flex-wrap:wrap;align-items:center;gap:.6rem;display:flex}table{border-collapse:collapse;width:100%}th,td{border-bottom:1px solid var(--border);text-align:left;white-space:nowrap;padding:.3rem .5rem}th{color:var(--muted);font-size:.85em;font-weight:600}.num{text-align:right;font-variant-numeric:tabular-nums}table.data tbody tr{cursor:pointer}table.data tbody tr:hover{background:var(--accent-bg)}table.data tbody tr.selected{background:var(--accent-bg);outline:1px solid var(--accent)}table.data tbody tr.best td:first-child:after{content:" ★"}table.data tbody tr.crashed{color:var(--danger)}table.data tbody tr.cut td:first-child{color:#dd6b20;font-weight:600}td.tack{color:#2b6cb0;font-weight:600}td.jibe{color:#dd6b20;font-weight:600}td.lee{color:#38a169;font-weight:600}td.luv{color:#d53f8c;font-weight:600}input[type=text]{font:inherit;border:1px solid var(--border);background:var(--card);color:var(--fg);border-radius:4px;padding:.2rem .4rem}input[type=number]{font:inherit;border:1px solid var(--border);background:var(--card);color:var(--fg);border-radius:4px;padding:.2rem .4rem}input[type=datetime-local]{font:inherit;border:1px solid var(--border);background:var(--card);color:var(--fg);border-radius:4px;padding:.2rem .4rem}svg.map circle.mark-auto{vector-effect:non-scaling-stroke}.scroll{overflow:auto}.scroll.tall{max-height:420px}.stats{grid-template-columns:repeat(auto-fit,minmax(130px,1fr));gap:.5rem;margin:.75rem 0;display:grid}.stats .stat{background:var(--card);border:1px solid var(--border);border-radius:8px;padding:.5rem .7rem}.stats .label{color:var(--muted);text-transform:uppercase;letter-spacing:.03em;font-size:.8em}.stats .value{font-variant-numeric:tabular-nums;font-size:1.4em;font-weight:600}.stats .sub{color:var(--muted);font-size:.8em}.grid-main{grid-template-columns:minmax(0,2fr) minmax(280px,1fr);align-items:start;gap:.75rem;display:grid}.grid-tables{grid-template-columns:repeat(auto-fit,minmax(420px,1fr));gap:.75rem;display:grid}@media (width<=900px){.grid-main{grid-template-columns:1fr}}svg.map{background:var(--bg);cursor:grab;-webkit-user-select:none;user-select:none;border-radius:6px;width:100%;height:70vh;min-height:420px;display:block}svg.map.dragging{cursor:grabbing}svg.map .track.selected{stroke-width:3.5px}svg.map .sel-halo{fill:none;stroke:var(--fg);stroke-opacity:.45;stroke-width:7px;vector-effect:non-scaling-stroke;stroke-linejoin:round;stroke-linecap:round;pointer-events:none}svg.map .track{stroke-width:2px;vector-effect:non-scaling-stroke;stroke-linecap:round;stroke-linejoin:round}svg.map .dim{fill:none;stroke:var(--bg);stroke-opacity:.8;stroke-width:5px;vector-effect:non-scaling-stroke;stroke-linejoin:round;stroke-linecap:round;pointer-events:none}svg.map .marker{cursor:pointer;stroke:var(--card);stroke-width:1px;vector-effect:non-scaling-stroke}svg.map .marker:hover{stroke:var(--fg);stroke-width:2px}svg.map .rounding{stroke-width:2px}svg.map .axis{stroke:var(--muted);stroke-dasharray:4 4;stroke-width:1px;vector-effect:non-scaling-stroke}svg.map .lee-line{stroke:var(--lee,#1a7f5a);stroke-dasharray:6 3;stroke-width:1.5px;vector-effect:non-scaling-stroke}svg.map .lap-mark{fill:var(--card);stroke:var(--fg);stroke-width:1.5px;vector-effect:non-scaling-stroke}svg.map .mark text{font-weight:600}svg.map .hover{fill:none;stroke:var(--fg);stroke-width:2px;vector-effect:non-scaling-stroke}svg.map .hover-label{fill:var(--fg);paint-order:stroke;stroke:var(--card);stroke-width:3px;font-weight:600}svg.map .scale{stroke:var(--fg);stroke-width:2px;vector-effect:non-scaling-stroke}svg.map .scale-label{fill:var(--muted)}svg.speed-chart{cursor:crosshair;-webkit-user-select:none;user-select:none;width:100%;height:260px;display:block}svg.speed-chart .speed-line{fill:none;stroke:var(--accent);stroke-width:1.2px;vector-effect:non-scaling-stroke}svg.speed-chart .race-band{fill:var(--race)}svg.speed-chart .lap-line{stroke:var(--muted);stroke-width:1px;vector-effect:non-scaling-stroke}svg.speed-chart .lap-line.windward{stroke-dasharray:3 3}svg.speed-chart .lap-label{fill:var(--muted);font-size:10px}svg.speed-chart .grid{stroke:var(--grid);stroke-width:1px;vector-effect:non-scaling-stroke}svg.speed-chart .tick{fill:var(--muted);font-size:10px}svg.speed-chart .foil-line{stroke:#38a169;stroke-dasharray:2 4;stroke-width:1px;vector-effect:non-scaling-stroke}svg.speed-chart .brush{fill:var(--accent);fill-opacity:.18;stroke:var(--accent);stroke-width:1px;vector-effect:non-scaling-stroke}svg.speed-chart .marker{cursor:pointer}svg.speed-chart .hover-line{stroke:var(--fg);stroke-width:1px;vector-effect:non-scaling-stroke}svg.speed-chart .hover{fill:var(--fg)}svg.speed-chart .hover-label{fill:var(--fg);font-size:11px;font-weight:600}svg.polar{width:100%;max-width:320px;margin:0 auto;display:block}svg.polar .ring{fill:none;stroke:var(--grid);stroke-width:1px}svg.polar .ring-label,svg.polar .axis-label{fill:var(--muted);font-size:9px}svg.polar .polar-line{fill:none;stroke:var(--accent);stroke-width:2px;stroke-linejoin:round}