:root{
  --bg:#f4f8fc;--surface:#fff;--text:#123047;--muted:#637789;--line:#d9e5ee;
  --blue:#0b6fb8;--blue2:#0c82d3;--soft:#eaf5fd;--green:#16845b;--orange:#d97706;
  --shadow:0 10px 30px rgba(27,73,105,.09);--radius:20px;
}
*{box-sizing:border-box} html{background:var(--bg)} body{margin:0;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:var(--text);background:var(--bg);line-height:1.45}
button,input,select{font:inherit} button{cursor:pointer} a{color:inherit;text-decoration:none}
.topbar{position:sticky;top:0;z-index:20;display:flex;align-items:center;justify-content:space-between;gap:16px;padding:12px clamp(14px,3vw,32px);background:rgba(255,255,255,.94);backdrop-filter:blur(14px);border-bottom:1px solid var(--line)}
.brand{display:flex;align-items:center;gap:10px}.brandMark{display:grid;place-items:center;width:42px;height:42px;border-radius:13px;background:var(--blue);color:#fff;font-weight:900}.brand strong{display:block}.brand small{display:block;color:var(--muted);font-size:.76rem}.topActions{display:flex;gap:8px}
.tabs{position:sticky;top:67px;z-index:15;display:flex;gap:6px;justify-content:center;padding:9px 12px;background:rgba(244,248,252,.95);backdrop-filter:blur(10px);border-bottom:1px solid var(--line)}
.tab{border:0;background:transparent;color:var(--muted);padding:10px 18px;border-radius:999px;font-weight:750}.tab.is-active{background:var(--surface);color:var(--blue);box-shadow:0 3px 12px rgba(15,83,126,.10)}
main{width:min(1120px,calc(100% - 28px));margin:0 auto 48px}.view{display:none;padding:28px 0}.view.is-active{display:block}.pageHead{max-width:760px;margin:0 0 22px}.eyebrow{margin:0;color:var(--blue);font-weight:850;text-transform:uppercase;letter-spacing:.08em;font-size:.72rem}.pageHead h1{font-size:clamp(1.8rem,4vw,3rem);margin:.2rem 0 .45rem;line-height:1.08}.pageHead p{margin:0;color:var(--muted);font-size:1.02rem}
.cards{display:grid;gap:18px}.twoCols{grid-template-columns:repeat(2,minmax(0,1fr))}.card{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);padding:22px}.card h2{margin:0 0 12px;font-size:1.15rem}.cardIcon{width:42px;height:42px;display:grid;place-items:center;border-radius:12px;background:var(--soft);color:var(--blue);font-weight:900;margin-bottom:12px}.checklist{padding-left:20px;margin:0}.checklist li{margin:.55rem 0}.muted{color:var(--muted)}
.terrainCard,.safetyCard,.offlineCard,.sources{margin-top:18px}.terrainDiagram{display:flex;align-items:center;justify-content:center;gap:18px;min-height:130px;background:linear-gradient(180deg,#f8fbfd,#eef6fb);border-radius:16px;padding:20px}.terrainDiagram .line{height:78px;width:7px;background:var(--blue);border-radius:8px}.distance{width:min(65%,520px);text-align:center;color:var(--blue);font-weight:850}.distance i{display:block;height:3px;background:var(--blue);position:relative;margin-top:10px}.distance i:before,.distance i:after{content:"";position:absolute;top:-5px;width:0;height:0;border-top:6px solid transparent;border-bottom:6px solid transparent}.distance i:before{left:-1px;border-right:10px solid var(--blue)}.distance i:after{right:-1px;border-left:10px solid var(--blue)}
.offlineCard{display:flex;align-items:center;justify-content:space-between;gap:20px}.offlineCard p{margin:0;color:var(--muted)}.status{font-size:.85rem;color:var(--green)}.sources summary{font-weight:800;cursor:pointer}.sources p{color:var(--muted)}
.primary,.secondary,.ghost,.iconBtn,.percentButtons button{border-radius:12px;font-weight:800;padding:11px 16px;border:1px solid transparent}.primary{background:var(--blue);color:#fff}.primary:hover{background:#095f9e}.secondary{background:var(--soft);color:var(--blue);border-color:#c8e4f6}.ghost,.iconBtn{background:#fff;color:var(--text);border-color:var(--line)}
.testShell{min-height:calc(100vh - 180px);display:flex;flex-direction:column;gap:16px}.testMeta{display:flex;justify-content:space-between;gap:10px}.pill{display:inline-flex;align-items:center;padding:7px 11px;border-radius:999px;background:#e9f7f1;color:var(--green);font-size:.82rem;font-weight:800}.pill.soft{background:var(--soft);color:var(--blue)}
.stageDisplay{flex:1;min-height:440px;background:var(--surface);border:1px solid var(--line);border-radius:28px;box-shadow:var(--shadow);display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center;padding:28px;overflow:hidden;position:relative}.stageLabel{margin:0;color:var(--blue);font-size:clamp(1rem,3vw,1.8rem);font-weight:900;letter-spacing:.16em}.stageNumber{font-size:clamp(7rem,26vw,17rem);font-weight:950;line-height:.83;letter-spacing:-.07em;color:var(--text)}.quarterLabel{margin-top:18px;font-size:clamp(2rem,7vw,4.7rem);font-weight:900;color:var(--blue);min-height:1.2em}.speedLine{margin-top:8px}.speedLine strong{font-size:clamp(2rem,7vw,4.5rem)}.speedLine span{font-size:clamp(1rem,3vw,1.8rem);font-weight:800;color:var(--muted)}
.stageProgress{width:min(760px,90%);height:16px;background:#e5edf3;border-radius:999px;overflow:hidden;margin:28px 0 8px}.stageProgress i{display:block;height:100%;width:0;background:linear-gradient(90deg,var(--blue),#35a7e8);border-radius:inherit;transition:width .08s linear}.quarterTicks{display:flex;justify-content:space-between;width:min(760px,90%);font-size:.72rem;color:var(--muted)}
.controls{display:flex;justify-content:center;align-items:center;gap:10px;flex-wrap:wrap}.huge{font-size:1.05rem;padding:14px 22px}.transport{display:grid;grid-template-columns:auto 1fr auto;gap:10px;align-items:center}.transport input{width:100%;accent-color:var(--blue)}.volume{display:flex;gap:8px;align-items:center;color:var(--muted);font-size:.85rem}.volume input{width:100px}.syncNote{padding:11px 14px;border-radius:12px;background:#eef6fb;color:var(--muted);font-size:.82rem;text-align:center}.syncNote code{color:var(--blue);font-weight:700}
.analysisGrid{display:grid;grid-template-columns:minmax(280px,.85fr) minmax(340px,1.15fr);gap:18px}.resultSetup label{display:block;font-size:.86rem;color:var(--muted);font-weight:700;margin:14px 0}.resultSetup select{display:block;width:100%;margin-top:6px;padding:11px 12px;border:1px solid var(--line);border-radius:12px;background:#fff;color:var(--text)}.formulaHint{font-size:.8rem;color:var(--muted);margin:12px 0 0}.headlineResult{display:flex;flex-direction:column;justify-content:center}.resultLabel{font-weight:850;color:var(--blue);font-size:1.1rem}.resultMetrics{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:16px 0}.resultMetrics div{padding:16px;border-radius:16px;background:var(--bg)}.resultMetrics span{display:block;color:var(--muted);font-size:.78rem;font-weight:800}.resultMetrics strong{font-size:clamp(2.4rem,7vw,4.6rem);line-height:1}.resultMetrics small{margin-left:5px;font-weight:700;color:var(--muted)}
.workoutCard,.compactTableCard{margin-top:18px}.workoutHead{display:flex;justify-content:space-between;align-items:center;gap:16px}.workoutHead p{margin:0;color:var(--muted)}.percentButtons{display:flex;gap:6px;flex-wrap:wrap}.percentButtons button{background:#fff;border-color:var(--line);padding:8px 11px}.percentButtons button.is-active{background:var(--blue);color:#fff;border-color:var(--blue)}.tableWrap{overflow:auto;margin-top:16px}table{width:100%;border-collapse:collapse;min-width:560px}th,td{text-align:left;padding:12px 10px;border-bottom:1px solid var(--line)}th{font-size:.75rem;text-transform:uppercase;letter-spacing:.04em;color:var(--muted)}td strong{color:var(--blue)}.terrainHint{margin:14px 0 0;padding:12px 14px;background:var(--soft);border-radius:12px;color:var(--blue);font-weight:750}.compactTableCard .tableWrap{max-height:440px}
footer{text-align:center;color:var(--muted);font-size:.78rem;padding:20px}
body.terrainMode{background:#061521;color:#fff;overflow:hidden}body.terrainMode .topbar,body.terrainMode .tabs,body.terrainMode footer{display:none}body.terrainMode main{width:100%;margin:0;max-width:none}body.terrainMode .view{padding:0}body.terrainMode #view-test{display:block}body.terrainMode .testShell{height:100vh;min-height:100vh;padding:10px;background:#061521;gap:8px}body.terrainMode .stageDisplay{min-height:0;border:0;border-radius:20px;background:#071c2b;box-shadow:none}body.terrainMode .stageNumber,body.terrainMode .speedLine strong{color:#fff}body.terrainMode .quarterLabel,body.terrainMode .stageLabel{color:#5bc0ff}body.terrainMode .testMeta,body.terrainMode .syncNote{display:none}body.terrainMode .mainControls{position:fixed;bottom:12px;left:50%;transform:translateX(-50%);z-index:30;opacity:.18;transition:opacity .2s}body.terrainMode .mainControls:hover,body.terrainMode .mainControls:focus-within{opacity:1}body.terrainMode .transport,body.terrainMode .smallControls{display:none}
@media(max-width:720px){.topbar{padding:10px 12px}.topActions .ghost:first-child{display:none}.tabs{top:63px}.twoCols,.analysisGrid{grid-template-columns:1fr}.offlineCard,.workoutHead{align-items:flex-start;flex-direction:column}.stageDisplay{min-height:400px}.stageNumber{font-size:clamp(7rem,38vw,13rem)}.quarterLabel{font-size:clamp(1.8rem,10vw,3.4rem)}.resultMetrics{grid-template-columns:1fr 1fr}.card{padding:18px}main{width:min(100% - 18px,1120px)}}
@media(max-width:430px){.brand small{display:none}.tab{padding:9px 13px}.stageDisplay{padding:16px;min-height:360px}.resultMetrics{grid-template-columns:1fr}.transport{grid-template-columns:56px 1fr 56px}.iconBtn{padding:9px 6px}.quarterTicks{font-size:.62rem}}
.shuttleInfo{margin-top:12px;font-size:clamp(.85rem,2vw,1.05rem);font-weight:700;opacity:.78;text-align:center}.terrainMode .shuttleInfo{font-size:clamp(1rem,2.3vw,1.35rem)}
.downloadAudio{display:inline-flex;align-items:center;justify-content:center;white-space:nowrap}
#testAudio{display:none}

/* Analyse v0.3.1 */
.referenceTableCard{margin-top:0}.tableTitle{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}.tableTitle h2{margin-bottom:4px}.tableTitle p{margin:0;color:var(--muted)}.referenceBadge{white-space:nowrap;padding:7px 10px;border-radius:999px;background:var(--soft);color:var(--blue);font-size:.76rem;font-weight:850}.referenceTable{min-width:760px}.referenceTable th:not(:first-child),.referenceTable td:not(:first-child){text-align:center}.referenceTable td:first-child{white-space:nowrap}.referenceTable td{font-variant-numeric:tabular-nums}.tableNote{margin:12px 0 0}.estimatedTableCard{margin-top:18px;padding:0;overflow:hidden}.estimatedTableCard>summary{list-style:none;cursor:pointer;padding:20px 22px;display:flex;align-items:center;justify-content:space-between;gap:16px}.estimatedTableCard>summary::-webkit-details-marker{display:none}.estimatedTableCard>summary span{display:flex;flex-direction:column;gap:3px}.estimatedTableCard>summary strong{font-size:1.05rem}.estimatedTableCard>summary small{color:var(--muted);font-weight:650}.estimatedTableCard>summary::after{content:'Afficher';padding:7px 10px;border-radius:999px;background:var(--soft);color:var(--blue);font-size:.76rem;font-weight:850}.estimatedTableCard[open]>summary::after{content:'Masquer'}.estimatedTableCard[open]>summary{border-bottom:1px solid var(--line)}.estimatedContent{padding:18px 22px 22px}.estimatedContent>p:first-child{margin-top:0}@media(max-width:720px){.tableTitle{flex-direction:column}.referenceBadge{align-self:flex-start}.estimatedTableCard>summary{padding:18px}.estimatedContent{padding:16px 18px 18px}}

.phaseShortcuts{margin-top:-2px}.phaseShortcuts .secondary{min-width:220px}
@media(max-width:520px){.phaseShortcuts{display:grid;grid-template-columns:1fr 1fr}.phaseShortcuts .secondary{min-width:0;padding:10px 8px;font-size:.8rem}}

/* v0.4.0 */
body.terrainMode .phaseShortcuts,
body.terrainMode .smallControls{display:none}
body.terrainMode .mainControls{opacity:.12}
body.terrainMode .mainControls:hover,
body.terrainMode .mainControls:focus-within{opacity:1}
