:root {
  --ink: #f5f7f8;
  --muted: #bac2c7;
  --muted-2: #8e989e;
  --panel: #0b0e10;
  --card: #171a1c;
  --card-2: #202326;
  --line: rgba(255,255,255,.12);
  --acid: #efff38;
  --cyan: #48e7ff;
  --red: #ff5147;
  --green: #50eb88;
  --gold: #ffc95f;
}

* { box-sizing: border-box; }
html, body { width: 100%; min-height: 100%; margin: 0; overflow: hidden; }
body {
  background: #050607; color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased; overscroll-behavior: none;
}
button, input, select { font: inherit; }
button { appearance: none; -webkit-appearance: none; border: 0; background-color: transparent; color: inherit; -webkit-tap-highlight-color: transparent; }
select { color-scheme: dark; }
button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.hidden { display: none !important; }

.lap-app { position: relative; width: 100vw; height: 100dvh; overflow: hidden; background: #050607; }
.map-stage { position: absolute; inset: 0; z-index: 0; background: #152027; }
.map-stage .leaflet-tile-pane, .detail-map .leaflet-tile-pane, .library-map .leaflet-tile-pane { filter: saturate(1.08) brightness(.86) contrast(1.12); }
.map-stage .leaflet-control-attribution { margin-bottom: 86px !important; background: rgba(0,0,0,.68) !important; color: #c9ced1 !important; font-size: 8px; }
.map-stage .leaflet-control-attribution a { color: #fff !important; }
.map-stage .leaflet-control-zoom { margin-top: 86px; margin-right: 14px; border: 0; box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.map-stage .leaflet-control-zoom a { width: 38px; height: 38px; line-height: 36px; border: 0; border-bottom: 1px solid var(--line); background: rgba(8,10,11,.94); color: #fff; }
.map-stage .leaflet-control-layers { margin-top: 7px; margin-right: 14px; border: 1px solid var(--line); border-radius: 10px; background: rgba(8,10,11,.94); color: #fff; }
.map-stage .leaflet-control-layers-toggle { filter: invert(1); }
.map-stage .leaflet-control-layers-expanded { padding: 10px 12px; }
.map-stage .leaflet-control-layers label { color: #fff; font-size: 11px; font-weight: 750; }
.map-shade { pointer-events: none; position: absolute; inset: 0; z-index: 200; background: linear-gradient(180deg,rgba(3,4,5,.65),transparent 22%,transparent 74%,rgba(3,4,5,.48)); }

.topbar {
  position: absolute; z-index: 900; top: 0; left: 0; right: 0; min-height: calc(64px + env(safe-area-inset-top));
  padding: calc(9px + env(safe-area-inset-top)) 16px 9px; display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--line); background: rgba(5,7,8,.95); backdrop-filter: blur(20px);
}
.brand-lockup { display: flex; align-items: center; gap: 10px; }
.brand-mark { display: grid; place-items: center; width: 43px; height: 43px; border-radius: 8px; background: var(--acid); color: #08090a; font-weight: 950; font-style: italic; letter-spacing: -.08em; transform: skewX(-5deg); }
.brand-copy { display: flex; flex-direction: column; line-height: 1; }
.brand-copy strong { font-size: 14px; letter-spacing: .14em; }
.brand-copy small { margin-top: 5px; color: var(--muted); font-size: 9px; letter-spacing: .18em; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.account-button { max-width: 135px; height: 34px; padding: 0 11px; overflow: hidden; border: 1px solid rgba(72,231,255,.24); border-radius: 999px; background: rgba(72,231,255,.07); color: var(--cyan); font-size: 10px; font-weight: 850; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.gps-pill { display: flex; align-items: center; gap: 7px; min-width: 66px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.055); color: var(--muted); font-size: 11px; font-weight: 850; }
.gps-dot, .record-indicator { width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: #647078; }
.gps-pill.has-fix { color: #fff; }
.gps-pill.has-fix .gps-dot { background: var(--green); box-shadow: 0 0 0 5px rgba(80,235,136,.12); }

.eyebrow { color: var(--acid); font-size: 10px; font-weight: 950; letter-spacing: .18em; }
.app-view, .control-panel.standalone-view {
  position: absolute; z-index: 650; top: calc(64px + env(safe-area-inset-top)); right: 0; bottom: 0; left: 0;
  overflow-y: auto; padding: 0 max(18px,calc((100vw - 1100px)/2)) calc(102px + env(safe-area-inset-bottom)); background: #050607; scrollbar-width: thin;
}
.home-view { display: block; }
.home-hero { min-height: 330px; padding: 62px 0 42px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; background: radial-gradient(circle at 50% 34%,rgba(72,231,255,.12),transparent 35%), radial-gradient(circle at 50% 120%,rgba(239,255,56,.1),transparent 42%); }
.home-hero::before { content: "LS"; position: absolute; top: 54px; color: rgba(255,255,255,.025); font-size: clamp(110px,22vw,260px); font-weight: 950; letter-spacing: -.1em; pointer-events: none; }
.home-hero h1 { position: relative; margin: 7px 0 8px; max-width: 700px; font-size: clamp(32px,6vw,58px); line-height: .98; letter-spacing: -.055em; }
.home-hero p { position: relative; margin: 0 0 23px; max-width: 520px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.hero-action { min-width: 230px; min-height: 54px; padding: 0 25px; border: 0; border-radius: 12px; background: var(--acid); color: #08090a; font-size: 15px; font-weight: 950; cursor: pointer; box-shadow: 0 12px 35px rgba(239,255,56,.12); }
.hero-action span { margin-right: 9px; }
.content-section { padding: 24px 0 8px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 13px; }
.section-heading h2 { margin: 3px 0 0; font-size: 23px; letter-spacing: -.035em; }
.outline-button { min-height: 38px; padding: 0 13px; border: 1px solid rgba(255,255,255,.24); border-radius: 9px; background: rgba(255,255,255,.035); color: #fff; font-size: 12px; font-weight: 850; cursor: pointer; }
.text-button { padding: 7px 9px; border: 0; background: transparent; color: var(--cyan); font-size: 12px; font-weight: 850; cursor: pointer; }
.track-carousel { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(190px,240px); gap: 11px; overflow-x: auto; padding: 2px 2px 9px; scroll-snap-type: x proximity; }
.track-card { position: relative; min-height: 220px; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: #1a2023 center/cover no-repeat; text-align: left; cursor: pointer; scroll-snap-align: start; box-shadow: inset 0 -110px 80px -45px rgba(0,0,0,.96); }
.track-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg,transparent 34%,rgba(3,4,5,.92)); }
.track-card-copy { position: absolute; z-index: 2; right: 14px; bottom: 13px; left: 14px; display: flex; flex-direction: column; }
.track-card-copy strong { font-size: 15px; line-height: 1.1; text-transform: uppercase; }
.track-card-copy small { margin-top: 6px; color: #e0e5e7; font-size: 10px; }
.track-card-badge { position: absolute; z-index: 3; top: 0; left: 12px; min-width: 34px; padding: 10px 8px 14px; background: var(--gold); color: #101214; font-size: 17px; text-align: center; clip-path: polygon(0 0,100% 0,100% 78%,50% 100%,0 78%); }
.favorite-list, .saved-list, .sessions-list { display: flex; flex-direction: column; gap: 8px; }
.favorite-track { width: 100%; min-height: 94px; padding: 0; display: grid; grid-template-columns: 116px minmax(0,1fr) 32px; align-items: stretch; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--card); text-align: left; cursor: pointer; }
.favorite-thumb { position: relative; min-height: 94px; background: #1d272b center/cover no-repeat; }
.favorite-track-copy { min-width: 0; padding: 14px; display: flex; flex-direction: column; justify-content: center; }
.favorite-track-copy strong { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.favorite-track-copy small { margin-top: 8px; color: var(--muted); font-size: 10px; }
.favorite-arrow { display: grid; place-items: center; color: var(--muted); font-size: 27px; }

.control-panel { position: absolute; z-index: 620; top: calc(80px + env(safe-area-inset-top)); left: 18px; width: min(390px,calc(100vw - 36px)); max-height: calc(100dvh - 176px - env(safe-area-inset-top)); overflow-y: auto; padding: 20px; border: 1px solid var(--line); border-radius: 17px; background: rgba(8,11,13,.96); box-shadow: 0 24px 70px rgba(0,0,0,.48); backdrop-filter: blur(20px); scrollbar-width: thin; }
.control-panel.standalone-view { width: auto; max-height: none; padding-top: 27px; border: 0; border-radius: 0; box-shadow: none; backdrop-filter: none; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 17px; }
.panel-heading h1 { margin: 3px 0 0; font-size: 25px; line-height: 1.1; letter-spacing: -.04em; }
.panel-heading h2 { margin: 3px 0 0; font-size: 21px; line-height: 1.1; letter-spacing: -.035em; }
.panel-intro { margin: -7px 0 14px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.field-label { display: block; margin: 12px 0 7px; color: #dce2e5; font-size: 11px; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.text-field { width: 100%; height: 46px; padding: 0 13px; border: 1px solid var(--line); border-radius: 10px; outline: none; background: rgba(255,255,255,.055); color: #fff; font-weight: 750; }
.text-field:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(72,231,255,.11); }
.text-field.compact { height: 40px; }
.input-help { display: block; margin-top: 7px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.inline-field { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 7px; }
.mini-button { min-width: 58px; border: 1px solid rgba(72,231,255,.3); border-radius: 9px; background: rgba(72,231,255,.08); color: var(--cyan); font-size: 10px; font-weight: 900; cursor: pointer; }
.mini-button:disabled { opacity: .45; cursor: not-allowed; }
.vehicle-add-row { margin-top: 7px; }
.account-summary { margin: 0 0 10px; color: var(--cyan); font-size: 11px; line-height: 1.4; }
.account-actions { display: flex; align-items: center; gap: 8px; margin-top: 13px; }
.account-actions .secondary-button { flex: 1; }

.build-place-search-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; }
.build-place-search-button { min-width: 74px; padding: 0 13px; border: 1px solid rgba(72,231,255,.35); border-radius: 10px; background: rgba(72,231,255,.09); color: var(--cyan); font-size: 11px; font-weight: 900; cursor: pointer; }
.build-place-search-button:hover { background: rgba(72,231,255,.15); }
.build-place-search-button:disabled { opacity: .55; cursor: wait; }
.build-place-results { margin-top: 8px; max-height: 240px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; background: #0b0e10; box-shadow: 0 12px 30px rgba(0,0,0,.28); }
.build-place-result { width: 100%; min-height: 52px; padding: 10px 12px; display: flex; flex-direction: column; justify-content: center; gap: 4px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: #fff; text-align: left; cursor: pointer; }
.build-place-result:last-child { border-bottom: 0; }
.build-place-result:hover, .build-place-result:focus-visible { outline: none; background: rgba(72,231,255,.08); }
.build-place-result strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.build-place-result small { overflow: hidden; color: var(--muted); font-size: 9px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }

.draw-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 14px; }
.action-tile { min-height: 78px; padding: 12px; display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.045); text-align: left; cursor: pointer; }
.action-tile .line-symbol { width: 5px; height: 41px; flex: 0 0 5px; border-radius: 999px; background: var(--cyan); }
.action-tile.start-line .line-symbol { background: var(--acid); }
.action-tile span:last-child { min-width: 0; display: flex; flex-direction: column; }
.action-tile strong { font-size: 11px; }
.action-tile small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.gate-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 13px; }
.gate-summary > div { padding: 10px; display: flex; justify-content: space-between; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); font-size: 10px; }
.gate-summary strong { color: #fff; }
.gate-list { margin-top: 12px; border-top: 1px solid var(--line); }
.gate-row { min-height: 39px; display: grid; grid-template-columns: 10px 1fr 26px; align-items: center; gap: 9px; border-bottom: 1px solid var(--line); font-size: 11px; }
.gate-swatch { width: 8px; height: 8px; border-radius: 2px; background: var(--cyan); }
.gate-swatch.start { background: var(--acid); }
.gate-row button { width: 26px; height: 26px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: 20px; cursor: pointer; }
.panel-footer, .drive-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 14px; }
.primary-button, .secondary-button, .stop-button { min-height: 48px; padding: 0 13px; border-radius: 10px; font-size: 12px; font-weight: 950; cursor: pointer; }
.primary-button { border: 1px solid var(--acid); background: var(--acid); color: #08090a; }
.primary-button:disabled { opacity: .55; cursor: wait; }
.secondary-button { border: 1px solid var(--line); background: rgba(255,255,255,.06); color: #fff; }
.stop-button { grid-column: 1/-1; border: 1px solid rgba(255,81,71,.52); background: rgba(255,81,71,.18); color: #ff8d85; }
.panel-message { min-height: 15px; margin: 10px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.panel-message.saved { color: #71ef9e; }
.panel-message.error { color: #ff8b82; }

.draw-banner, .install-banner, .update-banner { position: absolute; z-index: 1200; top: calc(80px + env(safe-area-inset-top)); left: 50%; width: min(390px,calc(100vw - 28px)); padding: 12px 13px; display: grid; grid-template-columns: 1fr auto; align-items: center; border: 1px solid rgba(72,231,255,.42); border-radius: 12px; background: rgba(8,11,13,.97); box-shadow: 0 18px 50px rgba(0,0,0,.45); transform: translateX(-50%); }
.draw-banner > span, .install-banner > span, .update-banner > span { display: flex; flex-direction: column; }
.draw-banner strong, .install-banner strong, .update-banner strong { font-size: 11px; }
.draw-banner small, .install-banner small, .update-banner small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.draw-banner button, .install-banner button { border: 0; background: transparent; color: var(--cyan); font-size: 10px; font-weight: 850; cursor: pointer; }
.install-banner { top: auto; bottom: calc(92px + env(safe-area-inset-bottom)); border-color: rgba(239,255,56,.4); }
.install-banner button { color: var(--acid); }
.install-banner .close-button { padding-left: 8px; color: var(--muted); font-size: 20px; }
.update-banner { top: auto; bottom: calc(92px + env(safe-area-inset-bottom)); grid-template-columns: 1fr; border-color: rgba(72,231,255,.45); }
.update-banner strong { color: var(--cyan); }
.locate-button { position: absolute; z-index: 800; top: calc(176px + env(safe-area-inset-top)); right: 14px; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 10px; background: rgba(8,10,11,.94); box-shadow: 0 10px 30px rgba(0,0,0,.3); font-size: 23px; cursor: pointer; }
.mode-home .locate-button, .mode-saved .locate-button, .mode-sessions .locate-button, .mode-leaderboard .locate-button, .mode-account .locate-button, .mode-analysis .locate-button { display: none; }

.gate-label { padding: 3px 7px !important; border: 1px solid rgba(72,231,255,.34) !important; border-radius: 999px !important; background: rgba(5,7,8,.9) !important; color: var(--cyan) !important; box-shadow: none !important; font-size: 8px !important; font-weight: 900 !important; }
.gate-label::before { display: none; }
.gate-label.start { border-color: rgba(239,255,56,.4) !important; color: var(--acid) !important; }

.gate-row-label { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.gate-row-label strong { overflow: hidden; color: #fff; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.gate-row-label small { color: var(--muted); font-size: 8px; line-height: 1.2; }
.gate-edit-help { display: block; margin-top: 8px; }
.gate-drag-icon-wrap { background: transparent !important; border: 0 !important; }
.gate-drag-icon { position: relative; display: grid; place-items: center; width: 26px; height: 26px; border: 2px solid #050607; border-radius: 50%; background: #4de8ff; box-shadow: 0 4px 15px rgba(0,0,0,.68), 0 0 0 3px rgba(77,232,255,.22); cursor: grab; touch-action: none; }
.gate-drag-icon.start { background: #f2ff45; box-shadow: 0 4px 15px rgba(0,0,0,.68), 0 0 0 3px rgba(242,255,69,.23); }
.gate-drag-icon i { width: 7px; height: 7px; border: 2px solid #050607; border-radius: 50%; background: rgba(255,255,255,.68); }
.leaflet-marker-dragging .gate-drag-icon { cursor: grabbing; transform: scale(1.13); }
.gate-handle-tooltip, .gate-length-tooltip { padding: 4px 7px !important; border: 1px solid rgba(255,255,255,.18) !important; border-radius: 7px !important; background: rgba(5,7,8,.92) !important; color: #fff !important; box-shadow: 0 5px 16px rgba(0,0,0,.45) !important; font-size: 8px !important; font-weight: 900 !important; }
.gate-length-tooltip { border-color: rgba(239,255,56,.42) !important; color: var(--acid) !important; font-size: 9px !important; }
.gate-handle-tooltip::before, .gate-length-tooltip::before { border-top-color: rgba(5,7,8,.92) !important; }
.car-dot { filter: drop-shadow(0 0 8px rgba(255,81,71,.72)); }

.drive-hud { position: absolute; z-index: 640; top: calc(64px + env(safe-area-inset-top)); right: 0; bottom: 0; left: 0; overflow-y: auto; padding: 0 max(16px,calc((100vw - 980px)/2)) calc(105px + env(safe-area-inset-bottom)); background: #020304; }
.session-toolbar { min-height: 54px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; border-bottom: 1px solid rgba(255,255,255,.07); }
.session-toolbar > div { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 10px; letter-spacing: .13em; }
.session-toolbar > strong { max-width: 44vw; overflow: hidden; font-size: 12px; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.follow-toggle { justify-self: end; padding: 6px 9px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--muted); font-size: 10px; font-weight: 850; cursor: pointer; }
.follow-toggle.active { border-color: rgba(72,231,255,.4); color: var(--cyan); }
.record-indicator.active { background: var(--red); box-shadow: 0 0 0 5px rgba(255,81,71,.14); animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .42; } }
.race-dashboard { max-width: 900px; margin: 0 auto; padding: 18px 0 20px; text-align: center; }
.run-status { min-height: 17px; margin: 0 0 3px; color: var(--cyan); font-size: 10px; font-weight: 900; letter-spacing: .11em; text-transform: uppercase; }
.main-time { color: #f5f7f8; font-family: "SFMono-Regular",Consolas,"Liberation Mono",monospace; font-size: clamp(66px,13vw,142px); font-weight: 850; line-height: .95; letter-spacing: -.09em; white-space: nowrap; }
.sector-strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(92px,1fr); gap: 6px; max-width: 760px; margin: 15px auto 0; overflow-x: auto; }
.sector-cell { padding: 9px 8px; border-bottom: 2px solid #303437; color: #fff; background: #090b0c; }
.sector-cell span { display: block; color: var(--muted); font-size: 10px; font-weight: 900; }
.sector-cell strong { display: block; margin-top: 3px; font-family: "SFMono-Regular",Consolas,monospace; font-size: clamp(19px,4vw,31px); }
.prediction-card { max-width: 760px; margin: 11px auto 0; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #050607; }
.delta-scale { position: relative; height: 34px; background: repeating-linear-gradient(90deg,#1b1e20 0,#1b1e20 9.7%,#050607 9.7%,#050607 10.4%); }
.delta-scale::after { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 3px; background: #e9edef; transform: translateX(-50%); }
.delta-scale span { position: absolute; top: 0; bottom: 0; left: 50%; width: 0; background: var(--cyan); opacity: .75; transition: width .18s,left .18s; }
.prediction-value { min-height: 85px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.prediction-value strong { font-family: "SFMono-Regular",Consolas,monospace; font-size: clamp(38px,7vw,65px); line-height: 1; }
.prediction-value span { margin-top: 5px; color: #d6dde0; font-size: 10px; font-weight: 850; letter-spacing: .14em; }
.prediction-card > small { display: block; padding: 0 0 10px; color: var(--muted); font-size: 10px; }
.prediction-card.faster { border-color: rgba(80,235,136,.5); }
.prediction-card.faster .prediction-value strong { color: var(--green); }
.prediction-card.faster .delta-scale span { left: calc(50% - var(--delta-width,0%)); width: var(--delta-width,0%); background: var(--green); }
.prediction-card.slower { border-color: rgba(255,81,71,.5); }
.prediction-card.slower .prediction-value strong { color: #ff776e; }
.prediction-card.slower .delta-scale span { width: var(--delta-width,0%); background: var(--red); }
.telemetry-grid { max-width: 760px; margin: 10px auto 0; display: grid; grid-template-columns: repeat(2,1fr); gap: 6px; }
.telemetry-grid > div { min-width: 0; padding: 8px; border: 1px solid var(--line); border-radius: 9px; background: #111416; text-align: left; }
.telemetry-grid span, .lap-comparison span { display: block; color: var(--muted); font-size: 10px; font-weight: 900; letter-spacing: .12em; }
.telemetry-grid strong { display: inline-block; margin-top: 3px; font-family: "SFMono-Regular",Consolas,monospace; font-size: 20px; line-height: 1; }
.telemetry-grid small { margin-left: 3px; color: var(--muted); font-size: 9px; }
.lap-comparison { max-width: 760px; margin: 6px auto 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; text-align: left; }
.lap-comparison > div { padding: 7px 9px; border-bottom: 2px solid #303437; background: #0d1011; }
.lap-comparison > div:last-child { border-color: var(--acid); }
.lap-comparison strong { display: block; margin-top: 3px; font-family: "SFMono-Regular",Consolas,monospace; font-size: 14px; }
.drive-actions { max-width: 760px; margin-right: auto; margin-left: auto; }
.quality-line { max-width: 760px; margin: 8px auto 0; padding-top: 7px; display: flex; justify-content: space-between; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.quality-line strong { color: #fff; }
.gps-error { max-width: 760px; min-height: 0; margin: 6px auto 0; color: #ff8e85; font-size: 10px; }
.vehicle-dock { max-width: 980px; margin: 0 auto; padding: 20px 0 4px; border-top: 1px solid var(--line); }
.vehicle-cards { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(145px,190px); gap: 9px; overflow-x: auto; padding-bottom: 8px; }
.vehicle-card { appearance: none !important; -webkit-appearance: none !important; min-height: 145px; padding: 16px 12px 13px; display: flex !important; flex-direction: column !important; align-items: center; justify-content: space-between; gap: 12px; overflow: hidden; border: 2px solid rgba(255,255,255,.18) !important; border-radius: 12px; background: #171a1c !important; color: #fff !important; text-align: center; cursor: pointer; box-shadow: none; }
.vehicle-card.active { border-color: var(--acid) !important; background: #202426 !important; box-shadow: inset 0 -4px var(--acid); }
.vehicle-icon, .vehicle-card-icon { color: #fff; font-size: 39px; line-height: 1; transform: skewX(-12deg); }
.vehicle-card strong { display: block; max-width: 100%; color: #fff !important; font-size: 14px; line-height: 1.25; overflow-wrap: anywhere; }
.vehicle-card small { display: block; color: var(--acid) !important; font-size: 10px; font-weight: 950; letter-spacing: .08em; }
.safety-note, .simulation-note, .live-privacy-note { margin: 9px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.live-privacy-note { max-width: 760px; margin-right: auto; margin-left: auto; color: #d8dde0; }
.simulation-button { border-color: rgba(72,231,255,.58); color: #fff; background: rgba(72,231,255,.12); }
.is-recording .topbar, .is-recording .bottom-nav, .is-recording .account-button { display: none; }
.is-recording .drive-hud { top: 0; bottom: auto; height: 60dvh; padding: env(safe-area-inset-top) 10px 0; overflow: hidden; border-bottom: 1px solid var(--line); background: rgba(2,3,4,.97); }
.is-recording .session-toolbar { min-height: 42px; }
.is-recording .race-dashboard { padding: 6px 0 8px; }
.is-recording .main-time { font-size: clamp(55px,11vw,115px); }
.is-recording .vehicle-dock, .is-recording .quality-line, .is-recording .safety-note, .is-recording .lap-comparison { display: none; }
.is-recording .prediction-value { min-height: 61px; }
.is-recording .prediction-value strong { font-size: clamp(31px,6vw,53px); }
.is-recording .prediction-card > small { padding-bottom: 5px; }
.is-recording .delta-scale { height: 24px; }
.is-recording .drive-actions { position: fixed; z-index: 1000; right: 14px; bottom: calc(16px + env(safe-area-inset-bottom)); left: 14px; pointer-events: none; }
.is-recording .drive-actions .stop-button { min-height: 52px; pointer-events: auto; border-radius: 999px; background: rgba(78,10,8,.91); backdrop-filter: blur(14px); }
.is-recording .map-stage .leaflet-control-attribution { margin-bottom: 0 !important; }

.library-filters, .auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.025); }
.library-filters button, .auth-tabs button { min-height: 32px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: 10px; font-weight: 850; cursor: pointer; }
.library-filters button.active, .auth-tabs button.active { background: rgba(72,231,255,.1); color: var(--cyan); }
.track-visibility { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 6px; }
.track-visibility button { min-height: 52px; padding: 9px 11px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.025); color: #fff; text-align: left; cursor: pointer; }
.track-visibility button strong { font-size: 11px; }
.track-visibility button small { color: var(--muted); font-size: 9px; line-height: 1.3; }
.track-visibility button.active { border-color: rgba(72,231,255,.7); background: rgba(72,231,255,.09); box-shadow: inset 0 0 0 1px rgba(72,231,255,.13); }
.track-visibility button.active strong { color: var(--cyan); }
.private-track-label { color: #f2ff45 !important; }
.track-search { margin: 9px 0; }
.library-map-wrap { position: relative; height: min(50dvh,520px); min-height: 310px; margin: 0 0 14px; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: #152027; }
.library-map { position: absolute; inset: 0; }
.library-map .leaflet-control-attribution { background: rgba(0,0,0,.62) !important; color: #d0d5d7 !important; font-size: 8px; }
.library-map .leaflet-control-attribution a { color: #fff !important; }
.library-map .leaflet-control-zoom { border: 0; box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.library-map .leaflet-control-zoom a { border-color: var(--line); background: rgba(8,10,11,.94); color: #fff; }
.library-map-legend { position: absolute; z-index: 500; right: 10px; bottom: 20px; padding: 7px 9px; display: flex; gap: 11px; border: 1px solid var(--line); border-radius: 999px; background: rgba(5,7,8,.88); color: #fff; font-size: 9px; font-weight: 800; backdrop-filter: blur(10px); }
.library-map-legend span { display: flex; align-items: center; gap: 5px; }
.library-map-legend i { width: 9px; height: 9px; border-radius: 50%; }
.track-key { background: var(--acid); box-shadow: 0 0 0 3px rgba(239,255,56,.14); }
.live-key { background: var(--red); box-shadow: 0 0 0 3px rgba(255,81,71,.18); }
.track-map-marker, .live-map-marker { background: transparent; border: 0; }
.track-map-marker span { position: relative; display: block; width: 22px; height: 22px; border: 4px solid #08090a; border-radius: 50% 50% 50% 0; background: var(--acid); box-shadow: 0 4px 14px rgba(0,0,0,.65); transform: rotate(-45deg); }
.track-map-marker span::after { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: #08090a; }
.live-map-marker span { position: relative; display: grid; place-items: center; width: 24px; height: 24px; border: 3px solid #fff; border-radius: 50%; background: var(--red); color: #fff; box-shadow: 0 0 0 7px rgba(255,81,71,.2),0 5px 18px rgba(0,0,0,.72); animation: livePulse 1.45s ease-out infinite; }
.live-map-marker span::after { content: ""; width: 5px; height: 5px; border-radius: 50%; background: #fff; }
@keyframes livePulse { 50% { box-shadow: 0 0 0 12px rgba(255,81,71,.03),0 5px 18px rgba(0,0,0,.72); } }
.map-driver-tooltip { border: 1px solid var(--line) !important; border-radius: 8px !important; background: rgba(5,7,8,.96) !important; color: #fff !important; box-shadow: 0 9px 26px rgba(0,0,0,.5) !important; font-size: 10px !important; font-weight: 800 !important; }
.map-driver-tooltip::before { border-top-color: rgba(5,7,8,.96) !important; }
.saved-track { width: 100%; min-height: 82px; padding: 0; display: grid; grid-template-columns: 110px minmax(0,1fr) 28px; align-items: stretch; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--card); text-align: left; cursor: pointer; }
.saved-icon { display: grid; place-items: center; min-height: 82px; background: #1d282d center/cover no-repeat; color: var(--acid); font-size: 24px; }
.saved-track > span:nth-child(2) { min-width: 0; padding: 13px; display: flex; flex-direction: column; justify-content: center; }
.saved-track strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.saved-track small { margin-top: 6px; color: var(--muted); font-size: 10px; }
.saved-arrow { display: grid; place-items: center; color: var(--muted); font-size: 24px; }
.empty-state { min-width: 190px; padding: 32px 18px; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1px dashed var(--line); border-radius: 12px; text-align: center; }
.empty-state strong { font-size: 12px; }
.empty-state span { margin-top: 5px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.compact-empty { min-height: 88px; padding: 17px; }

.track-detail-view { padding-top: 0 !important; }
.track-detail-hero { position: relative; height: min(46vw,430px); min-height: 280px; margin: 0 calc(-1 * max(18px,calc((100vw - 1100px)/2))); overflow: hidden; background: #151d21; }
.detail-map { position: absolute; inset: 0; background: #172027; }
.detail-map::after { content: ""; pointer-events: none; position: absolute; z-index: 400; inset: 0; background: linear-gradient(180deg,rgba(0,0,0,.2),transparent 45%,rgba(0,0,0,.9)); }
.detail-map .leaflet-control-attribution { background: rgba(0,0,0,.56) !important; color: #d0d5d7 !important; font-size: 8px; }
.detail-map .leaflet-control-attribution a { color: #fff !important; }
.hero-back, .favorite-button { position: absolute; z-index: 600; top: 18px; width: 45px; height: 45px; border: 1px solid rgba(255,255,255,.2); border-radius: 50%; background: rgba(4,6,7,.76); backdrop-filter: blur(12px); cursor: pointer; }
.hero-back { left: 18px; font-size: 36px; line-height: 1; }
.favorite-button { right: 18px; color: var(--gold); font-size: 27px; }
.favorite-button.active { border-color: rgba(255,204,92,.7); background: rgba(255,204,92,.13); }
.detail-gate-label { background: transparent; border: 0; }
.detail-gate-label span { display: inline-block; padding: 3px 6px; border-radius: 5px; background: rgba(3,6,7,.88); color: #fff; font-size: 8px; font-weight: 950; letter-spacing: .05em; box-shadow: 0 1px 7px rgba(0,0,0,.65); }
.track-detail-title { position: absolute; z-index: 600; right: 24px; bottom: 22px; left: 24px; }
.track-detail-title h1 { margin: 5px 0 4px; font-size: clamp(27px,5vw,46px); text-transform: uppercase; letter-spacing: -.04em; }
.track-detail-title p { margin: 0; color: #d7dcde; font-size: 11px; }
.track-detail-actions { padding: 17px 0 28px; display: flex; justify-content: center; gap: 9px; }
.track-detail-actions .hero-action { min-width: min(360px,55vw); }
.live-timing-section { margin: 0 0 29px; padding: 17px; border: 1px solid rgba(72,231,255,.22); border-radius: 14px; background: linear-gradient(145deg,rgba(72,231,255,.06),rgba(255,255,255,.025)); }
.live-timing-heading { margin-bottom: 10px; align-items: center; }
.live-count { padding: 7px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 10px; }
.live-count.active { border-color: rgba(255,81,71,.44); color: #ff8e86; background: rgba(255,81,71,.08); }
.detail-live-list { display: flex; flex-direction: column; gap: 7px; }
.live-driver-row { min-height: 69px; padding: 9px 10px; display: grid; grid-template-columns: minmax(0,1fr) minmax(110px,auto) auto; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 11px; background: #171a1c; }
.live-driver-row.following { border-color: rgba(72,231,255,.5); box-shadow: inset 3px 0 var(--cyan); }
.live-driver-identity, .live-driver-times { min-width: 0; display: flex; flex-direction: column; }
.live-driver-identity strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.live-driver-identity small, .live-driver-times small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.live-driver-times { align-items: flex-end; font-family: "SFMono-Regular",Consolas,monospace; }
.live-driver-times strong { color: #fff; font-size: 13px; }
.live-follow-button { min-height: 34px; padding: 0 10px; border: 1px solid rgba(72,231,255,.34); border-radius: 9px; color: var(--cyan); font-size: 9px; font-weight: 900; cursor: pointer; }
.live-follow-button.active { background: var(--cyan); color: #061012; }
.leaderboard-title-row { margin-top: 2px; }
.leaderboard-head, .leaderboard-row { display: grid; grid-template-columns: 42px minmax(0,1fr) 118px; align-items: center; gap: 8px; }
.leaderboard-head { padding: 9px 10px; background: #0b5e8e; color: #fff; font-size: 10px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.leaderboard-head span:last-child { text-align: right; }
.leaderboard-list { overflow: hidden; border: 1px solid var(--line); border-radius: 0 0 12px 12px; }
.leaderboard-row { min-height: 54px; padding: 7px 10px; border-bottom: 1px solid #08090a; background: #202325; }
.leaderboard-row:last-child { border-bottom: 0; }
.leaderboard-row.current { background: rgba(239,255,56,.08); }
.leaderboard-rank { color: #fff; font-family: "SFMono-Regular",Consolas,monospace; font-size: 15px; }
.leaderboard-identity, .leaderboard-result { min-width: 0; display: flex; flex-direction: column; }
.leaderboard-identity strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.leaderboard-identity small, .leaderboard-result small { margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.leaderboard-result { align-items: flex-end; }
.leaderboard-result strong { font-family: "SFMono-Regular",Consolas,monospace; font-size: 14px; }

.sessions-list { padding-bottom: 12px; }
.session-day, .session-date { margin: 18px 0 5px; color: #dce1e3; font-size: 13px; font-weight: 800; text-transform: capitalize; }
.session-row { width: 100%; min-height: 82px; margin-bottom: 4px; padding: 10px 13px; display: grid; grid-template-columns: 62px 92px minmax(0,1fr) auto; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 11px; background: var(--card); color: #fff; text-align: left; cursor: pointer; }
.session-time { font-size: 18px; font-weight: 750; }
.session-vehicle { min-width: 0; display: flex; flex-direction: column; align-items: center; color: var(--muted); }
.session-vehicle > span { font-size: 25px; line-height: 1; transform: skewX(-12deg); }
.session-vehicle small { max-width: 100%; margin-top: 4px; overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.session-track { min-width: 0; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.session-main { min-width: 0; display: flex; flex-direction: column; }
.session-main strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.session-main small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.session-result { display: flex; flex-direction: column; align-items: flex-end; }
.session-result small { color: var(--muted); font-size: 10px; }
.session-result strong { margin-top: 4px; color: var(--gold); font-family: "SFMono-Regular",Consolas,monospace; font-size: 13px; }

.lap-selectors { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lap-selectors label { min-width: 0; }
.lap-selectors label > span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 10px; font-weight: 900; letter-spacing: .14em; }
.lap-select { width: 100%; height: 42px; padding: 0 32px 0 10px; border: 1px solid var(--line); border-radius: 9px; outline: none; background: #161a1d; color: #fff; font-size: 10px; font-weight: 750; }
.lap-select:focus { border-color: var(--cyan); }
.telemetry-legend { display: flex; gap: 18px; margin: 12px 0 8px; color: var(--muted); font-size: 10px; font-weight: 800; }
.telemetry-legend span { display: flex; align-items: center; gap: 6px; }
.telemetry-legend i { width: 18px; height: 3px; border-radius: 99px; }
.legend-a { background: #ff554d; }
.legend-b { background: #ff9b32; }
.telemetry-summary { display: grid; grid-template-columns: repeat(4,1fr); gap: 7px; margin-bottom: 10px; }
.telemetry-summary > div { min-width: 0; padding: 9px 10px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,255,255,.035); }
.telemetry-summary span { display: block; color: var(--muted); font-size: 10px; font-weight: 900; letter-spacing: .1em; }
.telemetry-summary strong { display: block; margin-top: 4px; overflow: hidden; font-family: "SFMono-Regular",Consolas,monospace; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.telemetry-charts { display: flex; flex-direction: column; gap: 8px; }
.telemetry-chart { overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: #111416; }
.telemetry-chart-head { padding: 8px 10px 2px; display: flex; justify-content: space-between; color: #f4f6f7; font-size: 10px; font-weight: 900; letter-spacing: .08em; }
.telemetry-chart-head small { color: var(--muted); font-size: 8px; font-weight: 750; letter-spacing: 0; }
.telemetry-chart svg { display: block; width: 100%; height: auto; min-height: 132px; }
.chart-grid { stroke: rgba(255,255,255,.09); stroke-width: 1; }
.chart-axis-label { fill: #7e898f; font-family: ui-sans-serif,system-ui,sans-serif; font-size: 9px; }
.chart-split { stroke: rgba(239,255,56,.22); stroke-width: 1; stroke-dasharray: 3 4; }
.chart-split-label { fill: #dce65b; font-family: ui-sans-serif,system-ui,sans-serif; font-size: 8px; font-weight: 800; }
.chart-line-a, .chart-line-b { fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.chart-line-a { stroke: #ff554d; }
.chart-line-b { stroke: #ff9b32; }
.chart-zero { stroke: rgba(255,255,255,.35); stroke-width: 1; }
.telemetry-note { margin: 11px 0 0; padding-top: 9px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; line-height: 1.5; }

.bottom-nav { position: absolute; z-index: 1000; left: 50%; bottom: calc(10px + env(safe-area-inset-bottom)); width: min(560px,calc(100vw - 22px)); min-height: 67px; padding: 6px; display: grid; grid-template-columns: repeat(6,1fr); border: 1px solid var(--line); border-radius: 18px; background: rgba(5,7,8,.96); box-shadow: 0 18px 50px rgba(0,0,0,.5); transform: translateX(-50%); backdrop-filter: blur(20px); }
.bottom-nav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 0; border-radius: 12px; background: transparent; color: #aab2b7; font-size: 10px; font-weight: 850; cursor: pointer; }
.bottom-nav button.active { background: rgba(255,255,255,.07); color: #fff; }
.bottom-nav button.drive.active { background: var(--acid); color: #08090a; }
.nav-icon { font-size: 18px; line-height: 1; }

.modal-backdrop { position: fixed; z-index: 2000; inset: 0; padding: 18px; display: grid; place-items: center; background: rgba(0,0,0,.78); backdrop-filter: blur(12px); }
.auth-modal { position: relative; width: min(420px,100%); max-height: calc(100dvh - 36px); overflow-y: auto; padding: 24px; border: 1px solid var(--line); border-radius: 18px; background: #0d1012; box-shadow: 0 28px 90px rgba(0,0,0,.62); }
.auth-modal h2 { margin: 4px 0 18px; font-size: 26px; letter-spacing: -.04em; }
.modal-close { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: rgba(255,255,255,.06); color: var(--muted); font-size: 24px; cursor: pointer; }
.auth-tabs { margin-bottom: 12px; }
.auth-submit { width: 100%; margin-top: 18px; }
.auth-text-button { display: inline-flex; align-items: center; justify-content: center; width: fit-content; margin-top: 10px; padding: 3px 0; border: 0; background: transparent; color: var(--cyan); font: inherit; font-size: 11px; font-weight: 800; cursor: pointer; }
.auth-text-button:hover { text-decoration: underline; }
.auth-text-button.centered { display: flex; margin: 12px auto 0; }
.auth-explainer { margin: 0 0 14px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.honeypot { position: absolute !important; left: -10000px !important; width: 1px !important; height: 1px !important; opacity: 0 !important; }
.modal-open { overflow: hidden; }
noscript { position: fixed; z-index: 9999; inset: 0; padding: 30px; background: #050607; color: #fff; }


.racing-line-builder { margin-top: 12px; padding: 12px; border: 1px solid rgba(239,255,56,.18); border-radius: 12px; background: rgba(239,255,56,.035); }
.racing-line-builder-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.racing-line-builder-head > span { display: flex; flex-direction: column; gap: 2px; }
.racing-line-builder-head strong { font-size: 11px; }
.racing-line-builder-head small { color: var(--muted); font-size: 8px; line-height: 1.35; }
.racing-line-builder-head b { flex: 0 0 auto; padding: 5px 8px; border: 1px solid rgba(255,255,255,.12); border-radius: 999px; color: var(--muted); font-size: 8px; letter-spacing: .06em; text-transform: uppercase; }
.racing-line-builder-head b.ready { border-color: rgba(239,255,56,.38); color: var(--acid); background: rgba(239,255,56,.07); }
.racing-line-actions { display: grid; grid-template-columns: minmax(0,1fr) auto auto; gap: 8px; margin-top: 10px; }
.racing-line-actions button { min-height: 42px; }
.racing-line-actions #finish-racing-line { min-width: 132px; }
.racing-line-builder .input-help { display: block; margin-top: 8px; }
#map.racing-line-draw, #map.racing-line-draw .leaflet-container { cursor: crosshair; touch-action: none; }
.legend-racing { background: var(--acid); box-shadow: 0 0 0 1px rgba(0,0,0,.35); }
.telemetry-map-topbar button.racing-active { border-color: rgba(239,255,56,.45); color: var(--acid); background: rgba(18,20,5,.92); }


@media (max-width: 520px) {
  .racing-line-actions { grid-template-columns: 1fr 1fr; }
  .racing-line-actions #draw-racing-line { grid-column: 1 / -1; }
  .racing-line-actions #finish-racing-line { min-width: 0; }
}
@media (max-width: 700px) {
  .topbar { padding-right: 10px; padding-left: 10px; }
  .brand-copy strong { font-size: 12px; }
  .brand-copy small { font-size: 7px; }
  .account-button { max-width: 94px; padding: 0 8px; }
  .app-view, .control-panel.standalone-view { padding-right: 13px; padding-left: 13px; }
  .home-hero { min-height: 290px; padding: 45px 12px 30px; }
  .home-hero h1 { font-size: 36px; }
  .home-hero p { font-size: 11px; }
  .content-section { padding-top: 20px; }
  .section-heading h2 { font-size: 20px; }
  .track-carousel { grid-auto-columns: minmax(174px,64vw); }
  .track-card { min-height: 205px; }
  .favorite-track { grid-template-columns: 94px minmax(0,1fr) 26px; }
  .favorite-thumb { min-height: 88px; }
  .control-panel:not(.standalone-view) { top: auto; right: 8px; bottom: calc(84px + env(safe-area-inset-bottom)); left: 8px; width: auto; max-height: 58dvh; padding: 16px; border-radius: 16px; }
  .drive-hud { padding-right: 10px; padding-left: 10px; }
  .session-toolbar > strong { font-size: 10px; }
  .main-time { font-size: clamp(57px,19vw,88px); }
  .sector-strip { grid-auto-columns: minmax(88px,1fr); margin-top: 10px; }
  .sector-cell strong { font-size: 22px; }
  .prediction-value { min-height: 72px; }
  .prediction-value strong { font-size: 43px; }
  .telemetry-grid strong { font-size: 17px; }
  .vehicle-cards { grid-auto-columns: minmax(138px,46vw); }
  .track-detail-hero { height: 39dvh; min-height: 270px; margin: 0 -13px; }
  .track-detail-title { right: 17px; bottom: 17px; left: 17px; }
  .track-detail-title h1 { font-size: 29px; }
  .track-detail-actions { flex-wrap: wrap; }
  .track-detail-actions .hero-action { width: 100%; min-width: 0; }
  .track-detail-actions .outline-button { flex: 1; }
  .library-map-wrap { height: 43dvh; min-height: 280px; }
  .library-map-legend { right: 7px; bottom: 21px; }
  .live-timing-section { padding: 13px; }
  .live-driver-row { grid-template-columns: minmax(0,1fr) auto; }
  .live-driver-times { align-items: flex-start; }
  .live-follow-button { grid-column: 1/-1; width: 100%; }
  .leaderboard-head, .leaderboard-row { grid-template-columns: 32px minmax(0,1fr) 94px; }
  .leaderboard-result strong { font-size: 12px; }
  .session-row { grid-template-columns: 46px 62px minmax(0,1fr) 78px; gap: 6px; padding: 9px 8px; }
  .session-time { font-size: 15px; }
  .telemetry-summary { grid-template-columns: 1fr 1fr; }
  .telemetry-chart { overflow-x: auto; }
  .telemetry-chart svg { min-width: 620px; }
  .map-stage .leaflet-control-attribution { margin-bottom: 84px !important; }
  .draw-banner { top: calc(73px + env(safe-area-inset-top)); }
  .locate-button { top: calc(169px + env(safe-area-inset-top)); }
  .is-recording .drive-hud { height: 64dvh; }
  .is-recording .main-time { font-size: clamp(52px,16vw,73px); }
  .is-recording .sector-cell { padding: 5px; }
  .is-recording .sector-cell strong { font-size: 18px; }
  .is-recording .prediction-card { margin-top: 6px; }
  .is-recording .prediction-value { min-height: 52px; }
  .is-recording .prediction-value strong { font-size: 32px; }
  .is-recording .telemetry-grid { margin-top: 6px; }
  .is-recording .telemetry-grid > div { padding: 5px; }
}

@media (min-width: 900px) {
  .home-hero { min-height: 360px; }
  .control-panel:not(.standalone-view) { left: 22px; }
  .bottom-nav { left: auto; right: 18px; transform: none; }
  .install-banner { left: auto; right: 18px; transform: none; }
  .update-banner { left: auto; right: 18px; transform: none; }
}

@media (max-height: 690px) and (max-width: 700px) {
  .is-recording .drive-hud { height: 70dvh; }
  .is-recording .prediction-card > small, .is-recording .telemetry-grid { display: none; }
  .main-time { font-size: 55px; }
}


/* Help / GPS guide */
.help-panel { padding-bottom: calc(118px + env(safe-area-inset-bottom)) !important; }
.help-panel > .panel-heading { margin-bottom: 12px; }
.help-highlight { margin: 16px 0 18px; padding: 19px; border: 1px solid rgba(72,231,255,.24); border-radius: 16px; background: radial-gradient(circle at 90% 10%,rgba(72,231,255,.12),transparent 36%),rgba(72,231,255,.045); }
.help-highlight h2 { margin: 6px 0 9px; max-width: 760px; font-size: 23px; line-height: 1.12; letter-spacing: -.035em; }
.help-highlight p, .help-card-body p, .help-card-body li, .help-warning p { color: var(--muted); font-size: 12px; line-height: 1.62; }
.help-highlight p { margin: 0; max-width: 920px; }
.help-tech-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; margin: 15px 0; }
.help-tech-grid > div { min-height: 72px; padding: 11px; display: flex; flex-direction: column; justify-content: center; border: 1px solid var(--line); border-radius: 11px; background: rgba(0,0,0,.22); }
.help-tech-grid strong { color: var(--acid); font-size: 11px; letter-spacing: .08em; }
.help-tech-grid span { margin-top: 5px; color: var(--muted); font-size: 10px; line-height: 1.35; }
.help-fineprint { margin-top: 11px !important; padding-top: 11px; border-top: 1px solid var(--line); font-size: 10px !important; }
.help-fineprint code, .help-card code { padding: 2px 5px; border-radius: 5px; background: rgba(255,255,255,.07); color: #fff; font-family: ui-monospace,SFMono-Regular,Consolas,monospace; font-size: .95em; }
.help-section { margin: 18px 0; }
.help-section h2 { margin: 0 0 10px; font-size: 20px; letter-spacing: -.03em; }
.help-steps { margin: 0; padding: 0; list-style: none; counter-reset: helpstep; display: grid; gap: 7px; }
.help-steps li { position: relative; min-height: 58px; padding: 10px 12px 10px 48px; border: 1px solid var(--line); border-radius: 11px; background: var(--card); counter-increment: helpstep; }
.help-steps li::before { content: counter(helpstep); position: absolute; left: 11px; top: 11px; width: 25px; height: 25px; display: grid; place-items: center; border-radius: 50%; background: var(--acid); color: #08090a; font-size: 11px; font-weight: 950; }
.help-steps strong, .help-steps span { display: block; }
.help-steps strong { font-size: 12px; }
.help-steps span { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.help-card { margin: 8px 0; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.help-card summary { padding: 14px 42px 14px 14px; position: relative; cursor: pointer; list-style: none; font-size: 13px; font-weight: 900; }
.help-card summary::-webkit-details-marker { display: none; }
.help-card summary::after { content: "+"; position: absolute; top: 50%; right: 14px; color: var(--cyan); font-size: 20px; transform: translateY(-50%); }
.help-card[open] summary::after { content: "−"; }
.help-card[open] summary { border-bottom: 1px solid var(--line); }
.help-card-body { padding: 3px 14px 12px; }
.help-card-body p { margin: 10px 0; }
.help-card-body ul { margin: 8px 0 2px; padding-left: 18px; }
.help-card-body li { margin: 7px 0; }
.help-quality-list { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 7px; margin: 12px 0 4px; }
.help-quality-list > span { min-height: 58px; padding: 9px; display: grid; grid-template-columns: 10px 1fr; align-items: center; gap: 3px 7px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); font-size: 9px; }
.help-quality-list strong { color: #fff; font-size: 10px; }
.q { width: 9px; height: 9px; border-radius: 50%; background: #647078; grid-row: 1 / span 2; }
.q.excellent { background: var(--green); }
.q.good { background: var(--cyan); }
.q.weak { background: var(--gold); }
.q.poor { background: var(--red); }
.help-warning { margin: 18px 0 0; padding: 14px; border: 1px solid rgba(255,201,95,.25); border-radius: 12px; background: rgba(255,201,95,.055); }
.help-warning > strong { color: var(--gold); font-size: 12px; }
.help-warning p { margin: 6px 0 0; }

@media (max-width: 700px) {
  .bottom-nav { min-height: 64px; }
  .bottom-nav button { font-size: 9px; }
  .nav-icon { font-size: 17px; }
  .help-highlight { padding: 15px; }
  .help-highlight h2 { font-size: 20px; }
  .help-tech-grid { grid-template-columns: 1fr; }
  .help-quality-list { grid-template-columns: 1fr 1fr; }
}

/* LapSector Pro Telemetry */
.telemetry-panel { padding-bottom: calc(118px + env(safe-area-inset-bottom)) !important; }
.telemetry-heading { margin-bottom: 12px; }
.telemetry-pro-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 4px 0 12px; }
.telemetry-view-toggle { display: inline-grid; grid-template-columns: 1fr 1fr; min-width: 230px; padding: 3px; border: 1px solid var(--line); border-radius: 11px; background: #0d1012; }
.telemetry-view-toggle button { min-height: 34px; padding: 0 14px; border-radius: 8px; color: var(--muted); font-size: 10px; font-weight: 900; cursor: pointer; }
.telemetry-view-toggle button.active { background: #23272a; color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }
.telemetry-fastest-button { min-height: 40px; padding: 0 14px; border: 1px solid rgba(239,255,56,.34); border-radius: 10px; background: rgba(239,255,56,.08); color: var(--acid); font-size: 10px; font-weight: 950; cursor: pointer; }
.telemetry-fastest-button:hover { background: rgba(239,255,56,.13); }
.telemetry-lap-selectors { margin-bottom: 10px; }
.telemetry-lap-selectors .lap-select { height: 48px; font-size: 11px; }
.telemetry-driver-strip { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0 11px; }
.telemetry-driver-card { min-width: 0; min-height: 64px; padding: 10px 12px; display: grid; grid-template-columns: 34px minmax(0,1fr); align-items: center; gap: 10px; border: 1px solid var(--line); border-left: 3px solid var(--driver-color); border-radius: 11px; background: linear-gradient(90deg,rgba(255,255,255,.035),rgba(255,255,255,.015)); }
.telemetry-driver-card.empty { opacity: .58; }
.telemetry-driver-letter { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 50%; background: var(--driver-color); color: #090a0b; font-size: 12px; font-weight: 950; }
.telemetry-driver-card div { min-width: 0; }
.telemetry-driver-card strong, .telemetry-driver-card small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.telemetry-driver-card strong { font-size: 12px; }
.telemetry-driver-card small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.telemetry-map-shell { position: relative; height: clamp(330px,47dvh,560px); margin: 10px 0 8px; overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: #11191d; }
.telemetry-map { width: 100%; height: 100%; background: #172329; }
.telemetry-map .leaflet-tile-pane { filter: saturate(1.08) brightness(.82) contrast(1.13); }
.telemetry-map .leaflet-control-attribution { background: rgba(0,0,0,.65) !important; color: #b9c0c4 !important; font-size: 7px; }
.telemetry-map .leaflet-control-attribution a { color: #fff !important; }
.telemetry-map .leaflet-control-zoom { border: 0; box-shadow: 0 8px 24px rgba(0,0,0,.35); }
.telemetry-map .leaflet-control-zoom a { border: 0; border-bottom: 1px solid var(--line); background: rgba(7,9,10,.94); color: #fff; }
.telemetry-map.scrub-active { cursor: crosshair; touch-action: none; }
.telemetry-map-topbar { pointer-events: none; position: absolute; z-index: 600; top: 10px; right: 10px; left: 50px; display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.telemetry-map-topbar > span { padding: 7px 9px; border: 1px solid rgba(255,255,255,.16); border-radius: 999px; background: rgba(7,9,10,.88); color: #fff; font-size: 9px; font-weight: 950; letter-spacing: .12em; backdrop-filter: blur(12px); }
.telemetry-map-topbar button { pointer-events: auto; min-height: 31px; padding: 0 10px; border: 1px solid rgba(72,231,255,.3); border-radius: 999px; background: rgba(7,9,10,.9); color: var(--cyan); font-size: 9px; font-weight: 900; cursor: pointer; }
.telemetry-map-topbar button.active { border-color: rgba(239,255,56,.34); color: var(--acid); }
.telemetry-map-tip { pointer-events: none; position: absolute; z-index: 600; right: 12px; bottom: 12px; left: 12px; max-width: 660px; margin: auto; padding: 8px 11px; border: 1px solid rgba(255,255,255,.12); border-radius: 9px; background: rgba(5,7,8,.86); color: #d7dcdf; font-size: 9px; font-weight: 750; text-align: center; backdrop-filter: blur(12px); }
.telemetry-map-readout { pointer-events: none; position: absolute; z-index: 610; top: 52px; left: 12px; min-width: 165px; padding: 9px 11px; display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; border: 1px solid rgba(255,255,255,.15); border-radius: 10px; background: rgba(5,7,8,.9); backdrop-filter: blur(14px); }
.telemetry-map-readout strong { font-family: "SFMono-Regular",Consolas,monospace; font-size: 15px; }
.telemetry-map-readout span { grid-column: 1/-1; color: var(--muted); font-size: 9px; }
.telemetry-map-readout b { grid-row: 1; grid-column: 2; align-self: center; font-family: "SFMono-Regular",Consolas,monospace; color: #fff; font-size: 12px; }
.telemetry-map-readout b.gain, .gain { color: var(--green) !important; }
.telemetry-map-readout b.loss, .loss { color: #ff716a !important; }
.telemetry-legend-note { margin-left: auto; color: var(--muted-2); font-weight: 750 !important; }
.telemetry-summary-pro { grid-template-columns: repeat(4,minmax(0,1fr)); }
.telemetry-summary-pro > div { min-height: 81px; }
.telemetry-summary-pro strong { font-size: 16px; }
.telemetry-summary-pro small { display: block; margin-top: 5px; overflow: hidden; color: var(--muted-2); font-size: 8px; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.telemetry-insights, .telemetry-sectors { margin-top: 10px; }
.telemetry-insight-block, .telemetry-sector-block { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #0e1113; }
.telemetry-block-head { min-height: 55px; padding: 10px 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.telemetry-block-head div { display: flex; flex-direction: column; }
.telemetry-block-head span { color: var(--acid); font-size: 8px; font-weight: 950; letter-spacing: .15em; }
.telemetry-block-head strong { margin-top: 3px; font-size: 12px; }
.telemetry-block-head small { color: var(--muted-2); font-size: 8px; }
.telemetry-insight-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); }
.telemetry-insight-card { min-width: 0; padding: 12px; border-right: 1px solid var(--line); }
.telemetry-insight-card:last-child { border-right: 0; }
.telemetry-insight-card span, .telemetry-point-metric > span { display: block; color: var(--muted); font-size: 8px; font-weight: 950; letter-spacing: .1em; }
.telemetry-insight-card strong { display: block; margin-top: 7px; font-family: "SFMono-Regular",Consolas,monospace; font-size: 17px; }
.telemetry-insight-card small { display: block; margin-top: 5px; overflow: hidden; color: var(--muted-2); font-size: 8px; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.telemetry-sector-scroll { overflow-x: auto; }
.telemetry-sector-table { width: 100%; min-width: 720px; border-collapse: collapse; font-size: 9px; }
.telemetry-sector-table th { padding: 9px 10px; border-bottom: 1px solid var(--line); color: var(--muted-2); font-size: 8px; text-align: right; letter-spacing: .08em; }
.telemetry-sector-table th:first-child, .telemetry-sector-table td:first-child { text-align: left; }
.telemetry-sector-table td { padding: 10px; border-bottom: 1px solid rgba(255,255,255,.07); font-family: "SFMono-Regular",Consolas,monospace; text-align: right; white-space: nowrap; }
.telemetry-sector-table tr:last-child td { border-bottom: 0; }
.telemetry-sector-table td:first-child { font-family: inherit; }
.telemetry-sector-table td:first-child strong, .telemetry-sector-table td:first-child small { display: block; }
.telemetry-sector-table td:first-child strong { font-size: 9px; }
.telemetry-sector-table td:first-child small { margin-top: 3px; color: var(--muted-2); font-size: 8px; }
.telemetry-point-panel { margin: 10px 0; overflow: hidden; border: 1px solid rgba(72,231,255,.2); border-radius: 13px; background: radial-gradient(circle at 15% 0,rgba(72,231,255,.08),transparent 40%),#0d1012; }
.telemetry-point-head { min-height: 63px; padding: 11px 13px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.telemetry-point-head div { display: flex; flex-direction: column; }
.telemetry-point-head span { color: var(--cyan); font-size: 8px; font-weight: 950; letter-spacing: .15em; }
.telemetry-point-head strong { margin-top: 4px; font-family: "SFMono-Regular",Consolas,monospace; font-size: 19px; }
.telemetry-point-head small { color: var(--muted); font-size: 9px; font-weight: 850; }
.telemetry-point-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); }
.telemetry-point-metric { position: relative; min-width: 0; padding: 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 7px 9px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.telemetry-point-metric:nth-child(3n) { border-right: 0; }
.telemetry-point-metric > span { grid-column: 1/-1; }
.telemetry-point-metric div small { display: block; color: var(--muted-2); font-size: 7px; font-weight: 900; }
.telemetry-point-metric div strong { display: block; margin-top: 3px; overflow: hidden; font-family: "SFMono-Regular",Consolas,monospace; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.telemetry-point-metric > b { grid-column: 1/-1; color: #fff; font-family: "SFMono-Regular",Consolas,monospace; font-size: 10px; }
.telemetry-chart-pro { border-color: rgba(255,255,255,.13); }
.telemetry-chart-pro svg { touch-action: none; }
.chart-cursor { stroke: rgba(255,255,255,.8); stroke-width: 1.5; stroke-dasharray: 2 3; pointer-events: none; }
.chart-hit-area { fill: transparent; cursor: crosshair; touch-action: none; }

@media (max-width: 720px) {
  .telemetry-pro-toolbar { align-items: stretch; flex-direction: column; }
  .telemetry-view-toggle { width: 100%; min-width: 0; }
  .telemetry-fastest-button { width: 100%; }
  .telemetry-lap-selectors, .telemetry-driver-strip { grid-template-columns: 1fr; }
  .telemetry-map-shell { height: min(49dvh,470px); min-height: 330px; margin-right: -4px; margin-left: -4px; }
  .telemetry-map-topbar { left: 42px; }
  .telemetry-summary-pro { grid-template-columns: 1fr 1fr; }
  .telemetry-summary-pro > div { min-height: 76px; }
  .telemetry-insight-grid { grid-template-columns: 1fr 1fr; }
  .telemetry-insight-card { border-bottom: 1px solid var(--line); }
  .telemetry-insight-card:nth-child(2n) { border-right: 0; }
  .telemetry-point-grid { grid-template-columns: 1fr 1fr; }
  .telemetry-point-metric:nth-child(3n) { border-right: 1px solid var(--line); }
  .telemetry-point-metric:nth-child(2n) { border-right: 0; }
  .telemetry-legend { overflow-x: auto; white-space: nowrap; }
  .telemetry-legend-note { margin-left: 0; }
}


/* v0.9.12 administrator control */
.admin-tools{margin-top:28px;padding-top:26px;border-top:1px solid rgba(255,255,255,.12)}
.admin-head{display:flex;align-items:flex-start;justify-content:space-between;gap:18px}
.admin-head h2{margin:4px 0 0;font-size:clamp(24px,3vw,34px);line-height:1}
.admin-intro{max-width:880px;color:#aeb5bb;font-weight:700;line-height:1.55}
.admin-stats{margin:16px 0;padding:13px 16px;border:1px solid rgba(72,231,255,.22);background:rgba(72,231,255,.055);border-radius:14px;color:#d9fbff;font-weight:800}
.admin-actions{display:flex;flex-wrap:wrap;gap:10px;margin-bottom:18px}
.admin-columns{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.admin-list-card{min-width:0;border:1px solid rgba(255,255,255,.12);border-radius:18px;background:#0c0f10;overflow:hidden}
.admin-list-head{display:flex;align-items:flex-end;justify-content:space-between;gap:12px;padding:15px 16px;border-bottom:1px solid rgba(255,255,255,.1)}
.admin-list-head span{font-size:11px;letter-spacing:.14em;color:#e9ff21;font-weight:900}
.admin-list-head strong{font-size:15px}
.admin-list{max-height:420px;overflow:auto}
.admin-row{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:13px 15px;border-bottom:1px solid rgba(255,255,255,.075)}
.admin-row:last-child{border-bottom:0}
.admin-row>div{min-width:0}
.admin-row strong{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.admin-row small{display:block;margin-top:4px;color:#8f999f;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.admin-row.demo{background:rgba(233,255,33,.035)}
.admin-delete{flex:0 0 auto;border:1px solid rgba(255,85,77,.42);background:rgba(255,85,77,.08);color:#ff7b74;border-radius:10px;padding:8px 10px;font:inherit;font-size:12px;font-weight:900;cursor:pointer}
.admin-delete:hover{background:rgba(255,85,77,.16)}
.admin-empty{padding:20px 15px;color:#788188;font-weight:700}
@media(max-width:820px){
  .admin-columns{grid-template-columns:1fr}
  .admin-list{max-height:330px}
  .admin-row{align-items:flex-start}
}
