:root{
  --sans:"Barlow","PingFang SC","Noto Sans SC","Microsoft YaHei",system-ui,sans-serif;
  --cond:"Barlow Condensed","PingFang SC","Noto Sans SC","Microsoft YaHei",system-ui,sans-serif;
  /* T2 "Telemetry" dark theme — the only theme (see #62) */
  --bg:#0B1118; --panel:#101921; --ink:#E2ECF4; --muted:#8FA2B3; --line:#22303D;
  --ground:#0C151D; --asphalt:#3C4148; --asphalt-edge:#5B616A; --center:#6E757E;
  --brake:#FF5263; --throttle:#3CC97A; --hold:#F2B544; --accent:#38D9F5; --on-accent:#04141B; --kerb-w:#E4E4E4; --grid:#172532;
  /* danger button fill: darker than --brake so #fff text clears WCAG AA (5.1:1) */
  --danger:#D3263A;
  /* telemetry glow/grid/selected-state tokens */
  --map-grid:rgb(120 200 230 / .07); --glow:rgb(56 217 245 / .35); --glow-soft:rgb(56 217 245 / .15);
  --sel-bg:rgb(56 217 245 / .14); --sel-ink:var(--accent); --sel-line:var(--accent); --dot:var(--accent); --hover-line:var(--accent);
  color-scheme:dark;
  box-sizing:border-box;
  padding-top:env(safe-area-inset-top,0px);
  padding-bottom:env(safe-area-inset-bottom,0px);
}
*,*::before,*::after{box-sizing:border-box}
html{height:100%;scroll-padding-top:env(safe-area-inset-top,0px);background:var(--bg)}
body{margin:0;height:100%;background:var(--bg);color:var(--ink);font:400 15px/1.5 var(--sans);font-variant-numeric:tabular-nums}
button,input{font:inherit;color:inherit}
.app{display:grid;grid-template-columns:minmax(0,1fr) 340px;grid-template-rows:auto minmax(0,1fr) 190px;height:100%}
.top{grid-column:1/-1;display:flex;align-items:baseline;gap:6px 18px;padding:12px 20px;border-bottom:1px solid var(--line);flex-wrap:wrap;background:var(--panel);box-shadow:inset 0 -1px 0 var(--glow-soft)}
.top h1{font-family:var(--cond);font-weight:700;font-size:26px;line-height:1.1;margin:0 auto 0 0;text-transform:uppercase;letter-spacing:.04em}
.top h1::after{content:"";display:inline-block;width:7px;height:7px;margin-left:8px;vertical-align:4px;border-radius:50%;background:var(--dot);box-shadow:0 0 8px var(--glow)}
.top p{margin:0;color:var(--muted);font-size:14px;max-width:70ch;order:3;flex-basis:100%;white-space:nowrap}
/* subtitle (issue #65): one size down, same muted token; -2px trims the 6px flex row-gap to ~4px under the title */
.top .tagline-sub{order:4;font-size:13px;margin-top:-2px}
.top .lang,#bPage{padding:4px 10px;font-size:14px}
.map{position:relative;grid-column:1;grid-row:2;overflow:hidden;background:var(--ground);min-height:320px}
.map canvas{position:absolute;inset:0;width:100%;height:100%;touch-action:none;cursor:grab;display:block}
.map canvas.drawing{cursor:crosshair}
.map canvas.moving{cursor:move}
.hud{position:absolute;left:0;right:0;bottom:0;height:48px;pointer-events:none;z-index:3}
.hud[hidden]{display:none}
.hud-ribbon{position:absolute;left:0;right:0;bottom:0;height:6px;border-radius:0}
.hud-head{position:absolute;top:-4px;width:3px;height:14px;margin-left:-1.5px;border-radius:2px;background:var(--ink);box-shadow:0 0 0 1.5px var(--panel),0 0 8px var(--glow)}
.hud-pill{position:absolute;left:50%;bottom:14px;transform:translateX(-50%);height:26px;line-height:23px;padding:0 8px;border:1.5px solid #fff;border-radius:3px;color:#fff;font-family:var(--cond);font-weight:600;font-size:14px;white-space:nowrap;letter-spacing:.03em}
.pov{position:absolute;top:60px;right:60px;width:min(48%,560px);aspect-ratio:16/9;border-radius:4px;overflow:hidden;border:2px solid var(--panel);box-shadow:0 6px 20px rgb(0 0 0 / .3);background:#bfd8ef;z-index:2}
.pov[hidden]{display:none}
.pov-wrap{position:absolute;inset:0}
.pov-wrap canvas{width:100%!important;height:100%!important;display:block}
.pov-bar{position:absolute;left:0;right:0;top:0;display:flex;align-items:center;gap:8px;padding:6px 8px;background:linear-gradient(rgb(0 0 0 / .5),transparent);color:#fff;font-family:var(--cond);font-weight:600;font-size:14px;pointer-events:none}
.pov-tag{background:rgb(255 255 255 / .22);padding:1px 6px;border-radius:4px}
.pov-x{margin-left:auto;pointer-events:auto;background:rgb(0 0 0 / .4);border:0;color:#fff;width:28px;height:28px;border-radius:50%;cursor:pointer;font-size:17px;line-height:1}
.pov-load{position:absolute;inset:0;display:grid;place-items:center;color:#1E2731;font-size:14px}
@media (max-width:860px){.pov{left:8px;right:8px;top:56px;width:auto}}
.btn{font-family:var(--cond);font-weight:600;font-size:15px;line-height:1.2;padding:7px 12px;border-radius:3px;border:1px solid var(--line);background:var(--panel);color:var(--ink);cursor:pointer}
.btn:hover{border-color:var(--hover-line,var(--muted))}
.btn:disabled{opacity:.45;cursor:not-allowed}
.btn[aria-pressed="true"]{background:var(--sel-bg);color:var(--sel-ink);border-color:var(--sel-line)}
.btn.primary{background:var(--accent);border-color:var(--accent);color:var(--on-accent);box-shadow:0 0 14px var(--glow)}
/* disabled primary: no accent fill, muted text (WCAG exempts disabled controls from the contrast minimum) */
.btn.primary:disabled{background:transparent;border-color:var(--line);color:var(--muted);opacity:.6;box-shadow:none}
/* danger: like .primary but in a dark red (--danger); no telemetry glow (it is the accent cyan, which clashes on red) */
.btn.danger{background:var(--danger);border-color:var(--danger);color:#fff}
.btn:disabled:hover{border-color:var(--line)}
.btn.quiet:not([aria-pressed="true"]){color:var(--muted)}
.btn:focus-visible,.seg button:focus-visible,tbody tr:focus-visible,input:focus-visible{outline:2px solid var(--accent);outline-offset:2px;box-shadow:0 0 0 4px var(--glow)}
#bPov{position:absolute;top:12px;left:12px;padding:5px 10px;font-size:14px}
.zoom{position:absolute;top:12px;right:12px;display:flex;flex-direction:column;gap:4px}
.zoom .btn{width:38px;height:38px;padding:0;font-size:18px}
.zoom .btn.fit{font-size:13px}
.play{position:absolute;left:12px;bottom:14px;min-height:44px;z-index:4}
@media (max-width:560px){.play{left:8px}}
.drawbar{position:absolute;left:12px;right:12px;bottom:12px;display:flex;flex-wrap:wrap;gap:8px;align-items:center;background:var(--panel);border:1px solid var(--line);border-radius:4px;padding:10px 12px;max-width:660px;box-shadow:0 2px 10px rgb(0 0 0 / .12)}
.drawbar[hidden],.calbox[hidden]{display:none}
.calbox{display:flex;align-items:center;gap:6px;font-size:14px}
.calbox input{width:90px;padding:6px 8px;border:1px solid var(--line);border-radius:3px;background:var(--bg)}
.toast{position:absolute;left:50%;bottom:60px;transform:translateX(-50%);background:var(--ink);color:var(--panel);padding:8px 14px;border-radius:2px;font-size:14px;opacity:0;transition:opacity .2s;pointer-events:none;max-width:min(90%,540px);text-align:center}
.toast.show{opacity:1}
.empty-map{position:absolute;inset:0;display:grid;place-content:center;gap:6px;padding:24px;text-align:center;pointer-events:none}
.empty-map[hidden]{display:none}
.empty-map strong{font-family:var(--cond);font-weight:700;font-size:22px}
.empty-map span{font-size:14px;color:var(--muted);max-width:28ch;margin:0 auto}
.app:not(.adv-open){grid-template-rows:auto minmax(0,1fr) 0}
.app:not(.adv-open) .chart{display:none}
.chart{grid-column:1;grid-row:3;border-top:1px solid var(--line);background:var(--panel);display:flex;flex-direction:column;min-height:0}
.chart-head{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap;padding:8px 16px 0;font-size:13px;color:var(--muted);text-transform:uppercase;letter-spacing:.06em}
.chart-head strong{font-weight:600;color:var(--ink)}
#readout{font-variant-numeric:tabular-nums;color:var(--ink)}
.chart-wrap{position:relative;flex:1;min-height:0}
.chart-wrap canvas{position:absolute;inset:0;width:100%;height:100%;touch-action:none;display:block}
.panel{grid-column:2;grid-row:2/4;overflow:auto;background:var(--panel);border-left:1px solid var(--line);padding:18px 20px 28px}
.lt-label{font-size:13px;color:var(--muted);text-transform:uppercase;letter-spacing:.06em}
.lt-value{font-family:var(--cond);font-weight:700;font-size:58px;line-height:1;font-variant-numeric:tabular-nums;margin-top:2px;text-shadow:0 0 18px var(--glow-soft)}
.lt-value small{font-size:22px;font-weight:600;margin-left:4px;color:var(--muted)}
.lt-delta{color:var(--throttle);font-weight:600;margin-top:6px;font-size:14px}
.lt-delta.off{color:var(--muted);font-weight:400}
.panel h2{font-family:var(--cond);font-weight:600;font-size:19px;margin:24px 0 10px;letter-spacing:.03em}
.row{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:10px}
.pick{flex:1;min-width:0}
.info{font-size:14px;margin:0 0 10px;line-height:1.55}
.info.warn{color:var(--hold)}
.seg{display:flex;border:1px solid var(--line);border-radius:3px;overflow:hidden;margin-bottom:14px}
.seg button{flex:1;border:0;background:transparent;padding:7px 8px;font-family:var(--cond);font-weight:600;font-size:15px;cursor:pointer;color:var(--muted)}
.seg button+button{border-left:1px solid var(--line)}
.seg button[aria-pressed="true"]{background:var(--sel-bg);color:var(--sel-ink);border-color:var(--sel-line);box-shadow:inset 0 0 0 1px var(--sel-line)}
.slider{display:grid;grid-template-columns:1fr auto;gap:2px 8px;margin-bottom:12px;font-size:14px}
.slider[hidden]{display:none}
.slider input{grid-column:1/-1;width:100%;accent-color:var(--accent);margin:2px 0 0}
.slider output{font-family:var(--cond);font-weight:600;font-size:16px;font-variant-numeric:tabular-nums}
.legend{display:flex;gap:6px 16px;flex-wrap:wrap;font-size:13px;color:var(--muted)}
.legend[hidden]{display:none}
.legend i{display:inline-block;width:20px;height:5px;border-radius:3px;vertical-align:middle;margin-right:6px}
.legend i.brake{height:9px;border-radius:5px}
.legend .grad{width:120px;background:linear-gradient(90deg,hsl(215 75% 52%),hsl(108 70% 45%),hsl(48 90% 50%),hsl(0 80% 52%))}
/* the "back to full throttle" swatch (#90): a right-pointing green triangle with a ~1.5 px white rim,
   matching the map marker. The white outer triangle is the element; the green inner triangle is ::after,
   drawn on top and inset so a thin white edge shows all round. clip-path keeps both crisp. */
.legend i.tri{position:relative;width:13px;height:13px;background:#fff;border-radius:0;clip-path:polygon(0 0,100% 50%,0 100%)}
.legend i.tri::after{content:"";position:absolute;left:1.5px;top:1.9px;width:9px;height:9.2px;background:var(--throttle);clip-path:polygon(0 0,100% 50%,0 100%)}
.tablewrap{overflow-x:auto}
table{width:100%;border-collapse:collapse;font-size:14px;font-variant-numeric:tabular-nums}
th{font-weight:500;color:var(--muted);font-size:12px;text-align:left;padding:4px;border-bottom:1px solid var(--line);white-space:nowrap;text-transform:uppercase;letter-spacing:.06em}
td{text-align:left;padding:6px 4px;border-bottom:1px solid var(--line);white-space:nowrap}
th:first-child,td:first-child{width:40px}
td:last-child{white-space:normal}
tbody tr{cursor:pointer}
tbody tr:hover,tbody tr.active{background:color-mix(in srgb,var(--brake) 11%,transparent)}
.badge.lift{background:var(--hold);color:#16191d}
.badge.flat{background:var(--throttle);color:#16191d}
td .sub{margin-top:3px;font-size:13px;color:var(--muted)}
td.empty{white-space:normal;text-align:left;color:var(--muted)}
.badge{display:inline-grid;place-items:center;width:22px;height:22px;border-radius:50%;background:var(--brake);color:#fff;font-family:var(--cond);font-weight:700;font-size:13px}
.badge.wide{width:auto;min-width:22px;padding:0 5px;border-radius:11px;font-size:11px}/* 3-char numbers (a custom setup's 15a) widen the badge to a pill */
.note{font-size:13px;color:var(--muted);margin-top:14px;line-height:1.65}
.steps{margin:0 0 10px;padding-left:20px;font-size:14px;line-height:1.6}
.info.ok{color:var(--throttle)}
:root{--edge-l:#FF8A3D;--edge-r:#A08BFF}
.editbar[hidden]{display:none}
.editseg{flex:1 1 100%;margin:0}
.editseg button{display:inline-flex;align-items:center;justify-content:center;gap:6px}
.sw{display:inline-block;width:10px;height:10px;border-radius:50%}
.calbox.brushbox input{width:120px;padding:0;border:0;background:none;accent-color:var(--accent)}
.calbox.brushbox output{font-family:var(--cond);font-weight:600;min-width:48px;font-variant-numeric:tabular-nums}
.info.err{color:var(--brake)}
@media (max-width:860px){
  html,body{height:auto}
  .app{grid-template-columns:1fr;grid-template-rows:auto 62vh 180px auto;height:auto}
  .app:not(.adv-open){grid-template-rows:auto 62vh 0 auto}
  .panel{grid-column:1;grid-row:4;border-left:0;border-top:1px solid var(--line)}
  .lt-value{font-size:50px}
}
.pfoot{display:flex;gap:6px 20px;flex-wrap:wrap;align-items:baseline;margin-top:16px}
.pfoot .feedback{font-size:14px;color:var(--muted);text-underline-offset:3px}
.btn.pro,.btn.link{border-color:transparent;background:transparent;color:var(--muted);font-weight:500;padding-left:0;padding-right:0;text-decoration:underline;text-underline-offset:3px}
.btn.pro:hover,.btn.link:hover{border-color:transparent;background:transparent;color:var(--ink)}
.dialog{width:min(440px,calc(100vw - 32px));max-height:calc(100dvh - 32px);overflow:auto;padding:22px 22px 18px;border:1px solid var(--line);border-radius:4px;background:var(--panel);color:var(--ink);box-shadow:0 12px 40px rgb(0 0 0 / .3)}
.dialog::backdrop{background:rgb(0 0 0 / .45)}
.dialog h2{font-family:var(--cond);font-weight:700;font-size:26px;margin:0 32px 12px 0;line-height:1.15}
.dialog p{margin:12px 0 0;font-size:14px}
.dialog-x{position:absolute;top:10px;right:10px;width:34px;height:34px;border:0;border-radius:50%;background:transparent;color:var(--muted);font-size:22px;line-height:1;cursor:pointer}
.dialog-x:hover{background:var(--bg);color:var(--ink)}
.pro-list{margin:0;padding:0;list-style:none;display:grid;gap:10px;font-size:14px;color:var(--muted)}
.pro-list b{display:block;color:var(--ink);font-family:var(--cond);font-weight:600;font-size:17px}
#wlForm{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}
#wlForm input[type=email]{flex:1 1 200px;min-width:0;padding:8px 10px;border:1px solid var(--line);border-radius:3px;background:var(--bg)}
.wl-status{min-height:1.5em}
.wl-status.ok{color:var(--throttle)}
.wl-status.err{color:var(--brake)}
.wl-status.busy{color:var(--muted)}
.sr,.hp{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.legal{margin-top:18px;padding-top:12px;border-top:1px solid var(--line);font-size:12px;line-height:1.55;color:var(--muted)}
@media (max-width:560px){
  /* the draw/edit dock spans the bottom of the map and stays short; its help text lives in the panel */
  .drawbar{left:0;right:0;bottom:0;max-width:none;border-radius:0;border-width:1px 0 0;padding:6px 8px;gap:6px;box-shadow:none}
  .editseg button{padding:5px 4px;font-size:14px}
  .drawbar .btn{padding:5px 9px;font-size:14px}
  .calbox.brushbox input{width:96px}
  .app{grid-template-rows:auto clamp(360px,52vh,62vh) 180px auto}
  .app:not(.adv-open){grid-template-rows:auto clamp(360px,52vh,62vh) 0 auto}
  /* the two kart labels don't fit side by side on a phone in Chinese, so stack them */
  .seg.presets{flex-direction:column}
  .seg.presets button+button{border-left:0;border-top:1px solid var(--line)}
}
.panel h2.first{margin-top:0}
.btn[hidden]{display:none}
details.howto{margin:0 0 10px;font-size:14px}
details.howto summary{cursor:pointer;color:var(--accent)}
details.howto summary:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
details.howto .steps{margin:8px 0 0}
.seg.presets{margin-bottom:12px}
.seg.presets button{line-height:1.25;padding:8px 6px}
.note.safety{margin-top:10px;color:var(--ink)}
details.adv{margin-top:24px;border-top:1px solid var(--line);padding-top:6px}
details.adv summary{font-family:var(--cond);font-weight:600;font-size:19px;cursor:pointer;padding:6px 0 10px;letter-spacing:.03em}
details.adv summary:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
details.adv[open] summary{margin-bottom:6px}
details.adv h3{font-family:var(--cond);font-weight:600;font-size:17px;margin:22px 0 10px;letter-spacing:.03em}
.dialog form[method=dialog]{margin-top:16px;display:flex;flex-wrap:wrap;gap:8px;justify-content:flex-end}
/* two page layouts (see ui/page.js); before boot picks one, neither shows */
.app:not([data-page="view"]) .v-only,.app:not([data-page="edit"]) .e-only{display:none!important}
/* phone/tablet (single column): fixed to the bottom of the viewport, over the panel, not the map.
   z-index:40 keeps toasts above the 进阶 bottom sheet (z-index:30) */
@media (max-width:860px){
  .toast,.app[data-page="edit"] .toast{position:fixed;top:auto;left:8px;right:8px;bottom:calc(12px + env(safe-area-inset-bottom,0px));
    transform:none;margin:0 auto;max-width:540px;z-index:40}
}
/* desktop: in the 56px band fitBox() keeps free at the top of the map (between 3D POV and the zoom buttons) */
@media (min-width:861px){
  .toast,.app[data-page="edit"] .toast{top:10px;bottom:auto;max-width:min(60%,540px)}
}
.pickrow{display:flex;align-items:center;gap:12px}
.panel .pickrow h2{margin:0;flex:none}
.trackrow .btn.link{font-size:14px;padding-top:4px;padding-bottom:0}
.step+.step{border-top:1px solid var(--line);margin-top:16px}
.panel .step h2{display:flex;align-items:center;gap:10px}
.stepn{display:inline-grid;place-items:center;flex:none;width:26px;height:26px;border-radius:50%;border:1.5px solid var(--muted);color:var(--muted);font-size:15px;font-family:var(--cond);font-weight:600}
.step.on .stepn{border-color:var(--accent);background:var(--accent);color:var(--on-accent);box-shadow:0 0 10px var(--glow)}
.step>:not(h2){margin-left:36px}
.help p{margin:0 0 10px;font-size:14px;line-height:1.55;color:var(--muted)}
@media (max-width:560px){
  /* tight enough that the collapsed Advanced summary sits on the first 375x812 screen in view mode */
  .top{padding:8px 16px}
  .top p{font-size:12.5px;line-height:1.4}
  /* phones: title only, so the header height and map top are unchanged (issue #65) */
  .top .tagline-sub{display:none}
  .panel{padding:10px 16px 24px}
  .panel h2{margin:10px 0 4px;font-size:18px}
  .pick{padding-top:5px;padding-bottom:5px}
  .trackrow .btn.link{padding-top:2px}
  .seg.presets{margin-bottom:8px}
  .seg.presets button{padding:5px 6px}
  .legend{gap:4px 12px}
  .legend i{width:16px;margin-right:4px}
  .note.safety{margin-top:6px;line-height:1.45}
  details.adv{margin-top:8px;padding-top:2px}
  details.adv summary{padding:4px 0 6px}
}
/* 进阶 display toggle row: 显示 label + brake/throttle↔speed segmented control, first inside 进阶 */
.disprow{display:flex;align-items:center;gap:10px;margin:2px 0 12px}
.disprow .dlab{font-size:13px;color:var(--muted);flex:none}
.disprow #colorMode{flex:1;margin:0}
.disprow #colorMode button{min-height:38px}
.sheet-legend{display:none}
/* the chevron after the 进阶 label is phone-only; on desktop the summary is a plain disclosure row */
.adv-chev{display:none}
@media (max-width:560px){
  .app,.app:not(.adv-open){grid-template-rows:auto clamp(360px,52vh,62vh) 0 auto}
  html.sheet-open,html.sheet-open body{overflow:hidden}
  html.sheet-drag,html.sheet-drag body{overflow:hidden;overscroll-behavior:none}   /* kill the page bounce mid-drag */

  /* collapsed: the 进阶 summary is a handle bar docked to the bottom of the viewport. #adv is .v-only,
     so edit mode hides the whole details and this bar with it. */
  details.adv:not([open]){margin:0;border:0;padding:0}   /* the summary lifts out, so leave no trace in the panel */
  /* #94 (QA): the drag target is the 56px bar only, sitting *above* the safe area (bottom:env(…)), so the
     bottom inset strip (the iOS Home-indicator band) is not part of the summary and receives no gesture.
     Height is a flat 56px (border-box) to match the Collapsed snap stop (stops(): vh-(56+sab)); it used to
     measure ~57.5px. The inset strip below the bar is filled by a real spacer (.app[data-page="view"]::after,
     below) — not a box-shadow: a shadow paints but never blocks the page behind, so touches on the strip fell
     through to #feedback and page scroll, and the bar's drop shadow bled onto the shadow strip as a dark seam. */
  details.adv:not([open]) summary{position:fixed;left:0;right:0;bottom:env(safe-area-inset-bottom,0px);z-index:30;
    display:flex;align-items:center;gap:8px;height:56px;padding:0 16px;
    background:var(--panel);border-top:1px solid var(--line);border-radius:14px 14px 0 0;
    box-shadow:0 -8px 28px rgb(0 0 0 / .45);
    font-family:var(--cond);font-weight:600;font-size:19px;text-transform:uppercase;letter-spacing:.06em}
  /* a blank baffle filling the bottom inset band under the collapsed bar: it blocks the page behind (so a touch
     on the Home-indicator strip hits nothing, not #feedback or page scroll) and shows no seam. z-index 29 sits
     under the bar/sheet (z-index 30), so both stay tappable; view page only, where the bar lives. Binds no
     events and starts no drag (touch-action:none, no listeners). */
  .app[data-page="view"]::after{content:"";position:fixed;left:0;right:0;bottom:0;height:env(safe-area-inset-bottom,0px);
    z-index:29;background:var(--panel);touch-action:none}
  /* leave room so the 反馈 link and the footer scroll clear of the docked bar */
  .app[data-page="view"] .panel{padding-bottom:calc(80px + env(safe-area-inset-bottom,0px))}
  /* bottom-anchored toasts clear the bar in view mode (the bar is view-mode only) */
  .app[data-page="view"] .toast{bottom:calc(68px + env(safe-area-inset-bottom,0px))}

  /* open: the bottom sheet, its top pinned to the map's bottom edge */
  details.adv[open]{position:fixed;left:0;right:0;bottom:0;z-index:30;margin:0;
    top:min(var(--sheet-top,48vh),calc(100dvh - 220px));            /* short phones: sheet stays ≥220px */
    padding:0 16px calc(24px + env(safe-area-inset-bottom,0px));
    background:var(--panel);border-top:1px solid var(--line);border-radius:14px 14px 0 0;
    box-shadow:0 -8px 28px rgb(0 0 0 / .45);overflow-y:auto;overscroll-behavior:contain}
  /* Full (issue #67): the sheet top sits at the header's bottom edge, covering the map */
  details.adv[open].sheet-full{top:var(--sheet-top-full,0)}
  details.adv[open] summary{position:sticky;top:0;z-index:2;display:flex;align-items:center;list-style:none;
    background:var(--panel);margin:0 -16px 8px;padding:16px 16px 6px 16px;min-height:48px;border-bottom:1px solid var(--line);
    font-family:var(--cond);font-weight:600;font-size:19px;text-transform:uppercase;letter-spacing:.06em}
  details.adv[open] summary::-webkit-details-marker{display:none}
  details.adv[open] .sheet-legend{display:block;margin:-4px 0 10px}
  /* phone: chart visibility follows the sheet's [open] (specificity 0,3,1 beats the global .app:not(.adv-open)
     .chart{display:none}), NOT .adv-open — so a drag up from Collapsed can size and draw it before release, when
     .adv-open isn't set yet (issue #72). Don't bind these two back together. */
  details.adv[open] .chart{display:flex;height:180px;margin:0 -16px 8px;border-top:0;border-bottom:1px solid var(--line)}

  /* dragging starts on the summary only, so the map and the page keep their own gestures */
  details.adv summary{touch-action:none}
  /* the grab line, on both the collapsed bar and the open header (both summaries are positioned) */
  details.adv summary::after{content:"";position:absolute;left:50%;top:6px;width:36px;height:4px;margin-left:-18px;border-radius:2px;background:var(--line)}
  /* the chevron (issue #69): up when collapsed and at Half (more above), down only at Full (pull down to shrink) */
  .adv-chev{display:block;margin-left:auto;width:11px;height:11px;border-right:2px solid var(--muted);border-bottom:2px solid var(--muted);transform:translateY(-2px) rotate(-135deg);transition:transform .15s}
  details.adv[open].sheet-full .adv-chev{transform:translateY(2px) rotate(45deg)}

  /* drag (issue #67): anchor the box at the Full top so it is always full-height — moving it down never bares
     a strip below the sheet. --drag-y translates down from there (0 = Full). Follow the finger 1:1 (no
     transition); settle with a short ease-out on release. */
  details.adv.sheet-dragging{top:var(--sheet-top-full,0);transform:translateY(var(--drag-y,0px));transition:none;will-change:transform}
  details.adv.sheet-settling{transition:transform .22s ease-out}

  @media (prefers-reduced-motion:reduce){
    .adv-chev{transition:none}
  }
}
/* tabular, slashed-zero figures for the live numbers (lap time, slider values, chart readout) */
.slider output,.lt-value,#readout{font-variant-numeric:tabular-nums slashed-zero}
