:root{color-scheme:dark;--bg:#101619;--panel:#192226;--edge:#344247;--text:#eef4ef;--muted:#adbbb8;--accent:#c8f67b}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text);font:16px/1.5 system-ui,sans-serif}header{border-bottom:1px solid var(--edge);display:flex;justify-content:space-between;gap:12px;align-items:center;padding:16px max(16px,calc((100vw - 900px)/2));background:#151d20}.brand{display:flex;align-items:center;gap:10px;font-weight:800;letter-spacing:.08em;font-size:.8rem}.brand span{background:var(--accent);color:#15220b;padding:5px 7px;border-radius:5px}small,.tag{font-size:.69rem;letter-spacing:.13em;font-weight:800;color:var(--accent)}main{max-width:932px;margin:auto;padding:28px 16px 48px}.intro{margin-bottom:24px}h1{font-size:clamp(2rem,6vw,3.6rem);letter-spacing:-.05em;margin:0;line-height:1.05}h2{font-size:1.23rem;margin:0 0 10px}p{margin:8px 0;color:var(--muted)}section{background:var(--panel);padding:clamp(14px,3vw,24px);border:1px solid var(--edge);border-radius:12px}label{display:block;font-weight:650;margin:10px 0}select,input,textarea,button{font:inherit}select,textarea,input[type=text],input[type=number]{display:block;width:100%;margin:5px 0;padding:9px;border:1px solid var(--edge);border-radius:6px;background:#10181b;color:var(--text);min-height:44px}input[type=file]{display:block;width:100%;font-size:.87rem;margin-top:8px}input::file-selector-button,button{cursor:pointer;border:0;border-radius:6px;background:var(--accent);color:#18240f;font-weight:750;padding:10px 14px;min-height:44px}button:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible{outline:2px solid #fff;outline-offset:2px}.hint{font-size:.86rem}.race{margin:24px 0 10px}nav{display:flex;gap:6px;margin-bottom:8px}nav button{background:#243135;color:var(--text);flex:1}nav button[aria-pressed=true]{background:var(--accent);color:#18240f}.pair{display:grid;grid-template-columns:1fr 1fr;gap:10px}.pair>*{min-width:0}table{width:100%;border-collapse:collapse;font-size:.87rem;table-layout:fixed;font-variant-numeric:tabular-nums}td,th{text-align:left;overflow-wrap:anywhere;padding:8px 5px;border-bottom:1px solid var(--edge)}th{color:var(--accent)}.result th:first-child{width:12%}.result th:nth-child(2){width:47%}.result th:nth-child(3){width:16%}.stop{padding:8px 0;border-bottom:1px solid var(--edge)}.stop select{margin-bottom:2px}.error{color:#ffb3a9}[hidden]{display:none!important}@media(max-width:420px){td,th{font-size:.78rem}header small{font-size:.58rem}}

nav{flex-wrap:wrap}nav button{flex:1 1 95px}.kart-link{background:transparent;color:var(--accent);padding:4px 0;text-align:left;text-decoration:underline;overflow-wrap:anywhere;max-width:100%}#panel h3{margin:22px 0 8px}#panel p+table{margin-bottom:12px}

.saved{margin-bottom:12px}.saved-row,.race-actions{display:flex;align-items:center;flex-wrap:wrap;gap:8px}.saved-row{padding:8px 0;border-bottom:1px solid var(--edge)}.saved-row span{flex:1 1 240px;overflow-wrap:anywhere}

.comparison-summary th:first-child{width:34%}

.gap-chart{display:block;width:100%;max-width:650px;cursor:crosshair;background:var(--bg);border-radius:8px}
.gap-chart text{fill:var(--muted);font:11px system-ui,sans-serif}
.gap-axis,.gap-cursor{fill:none;stroke:var(--muted);stroke-width:1}
.gap-cursor{stroke-dasharray:3 3}
.gap-line{fill:none;stroke:var(--accent);stroke-width:2}
.gap-stop-first{fill:#ffb978}
.gap-stop-second{fill:none;stroke:#80ddff;stroke-width:2}
.gap-key-first,.gap-key-second{display:inline-block;margin-right:12px}
.gap-key-first{color:#ffb978}.gap-key-second{color:#80ddff}
input[type=range]{display:block;width:100%;max-width:650px;min-height:44px;accent-color:var(--accent)}

.remove-confirm{flex-basis:100%;padding:8px 0}.remove-confirm button+button{margin-left:8px}

#season{margin-top:12px;padding:12px;border:1px solid var(--edge);border-radius:8px}
#season summary{cursor:pointer;color:var(--accent);font-weight:700}
.season-assignment{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px;padding-bottom:6px;border-bottom:1px solid var(--edge)}
.season-assignment select{width:auto;max-width:100%;min-width:130px}
.season-ranking th:first-child{width:38%}
.season-ranking ul{padding-left:16px}

.season-chart{margin-top:12px}
.season-line{stroke-width:2}
.season-series-0{fill:var(--accent);stroke:var(--accent)}
.season-series-1{fill:#80ddff;stroke:#80ddff}
.season-key-0,.season-key-1{display:inline-block;margin-right:12px}
.season-key-0{color:var(--accent)}.season-key-1{color:#80ddff}

.tyre-badge{display:inline-block;background:#59377c;color:#fff;border:1px solid #c9a1f3;border-radius:5px;padding:3px 6px;font-weight:750}
.tyre-cell{background:#342442}
.tyre-stop{display:block;border:2px solid #c9a1f3;border-radius:8px;background:#342442;padding:12px;margin:12px 0}

.fuel-settings{margin:18px 0 10px;border:2px solid var(--accent);border-radius:10px;padding:14px;background:#202e27}
.fuel-settings>summary{cursor:pointer;color:var(--accent);font-size:1.1rem;font-weight:800;min-height:44px;padding:8px 0}

.qualifying-import{margin:16px 0;padding:14px;border:1px solid var(--accent);border-radius:8px;background:#202e27}

.mechanical-badge{display:inline-block;background:#802c35;color:#fff;border:1px solid #ffb3a9;border-radius:5px;padding:3px 6px;font-weight:750}
.mechanical-cell{background:#442126}
.mechanical-stop{display:block;border:2px solid #ffb3a9;border-radius:8px;background:#442126;padding:12px;margin:12px 0}

.fuel-warning{padding:10px;border-left:3px solid #ffbf77;background:#3b2c20;color:#ffe0b7;border-radius:4px}

.result-fuel th:first-child{width:8%}
.result-fuel th:nth-child(2){width:34%}
.result-fuel th:nth-child(3){width:10%}

.starting-fuel{margin:12px 0;padding:12px;border:1px solid var(--accent);border-radius:8px;background:#202e27}
.starting-fuel>span{display:block;color:var(--accent);font-size:1.35rem;font-weight:800}
.starting-fuel>p{margin:5px 0 0}

.season-pit-table th:first-child{width:36%}
.season-pit-table ul{padding-left:16px}

.season-pit-overview th:first-child{width:28%}

.four-hour-pit-table th:first-child{width:8%}
.four-hour-pit-table th:nth-child(2){width:44%}

.fuel-round-gap{color:#ffbf77;font-weight:750}

.export-download{display:inline-block;margin:8px 8px 8px 0;padding:10px 12px;border:1px solid var(--accent);border-radius:7px;color:var(--accent);overflow-wrap:anywhere}
.report-export button,#season-export button{margin:4px 8px 4px 0}

.pilot-welcome{
 display:grid;
 grid-template-columns:minmax(0,1.3fr) minmax(0,1fr);
 gap:clamp(20px,4vw,40px);
 padding:clamp(20px,5vw,42px);
 margin-bottom:16px;
 background:linear-gradient(135deg,#233428,#192226 68%);
 border-color:#52664d;
}
.pilot-lead h1{font-size:clamp(2.1rem,5.6vw,3.4rem);max-width:13ch;line-height:1.03}
.pilot-lead>p:not(.tag){max-width:38ch}
.pilot-actions{display:flex;gap:10px;flex-wrap:wrap;margin:18px 0 6px}
.pilot-actions>a{display:inline-flex;align-items:center;min-height:44px;padding:8px 12px;border:1px solid var(--accent);border-radius:6px;color:var(--accent);font-weight:750;text-decoration:none}
.pilot-actions>a:hover{background:#263b28}
.pilot-actions>a:focus-visible{outline:2px solid #fff;outline-offset:2px}
.pilot-walkthrough{align-self:center;margin:0;padding:0 0 0 1.5rem}
.pilot-walkthrough li{padding:8px 0 8px 4px;border-bottom:1px solid var(--edge)}
.pilot-walkthrough li:last-child{border-bottom:0}
.pilot-walkthrough li::marker{color:var(--accent);font-weight:800}
.pilot-walkthrough span{display:block;color:var(--muted);font-size:.9rem}
#race-setup{scroll-margin-top:16px;margin-bottom:16px}
@media(max-width:640px){.pilot-welcome{grid-template-columns:1fr;gap:12px}.pilot-actions>*{flex:1 1 auto;justify-content:center}}

.pilot-actions .pilot-secondary{border:1px solid var(--accent);background:#263b28;color:var(--accent)}
