:root {
  --bg: #0E1320; --deep: #0A0E18; --panel: #141B2C; --panel-2: #1A2234; --border: #222B40; --border-2: #2A3550;
  --text: #E8ECF4; --muted: #A9B3C7; --dim: #8E99AE;
  --accent: #C6F432; --accent-2: #E2FF8A; --orange: #FF9A52; --blue: #7CC4FF; --red: #FF6B6B;
  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --r: 14px; --r-lg: 18px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); }
a:hover { color: var(--accent-2); }
h1, h2, h3 { margin: 0; }
h2 { font-size: 18px; font-weight: 600; }
h3 { font-size: 14px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; margin: 14px 0 8px; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.accent { color: var(--accent); }
.orange { color: var(--orange); }
.display { font-family: var(--display); font-weight: 700; letter-spacing: .5px; line-height: 1; }
h1.display { font-size: 44px; }
.display.xl { font-size: 72px; }
.display.md { font-size: 32px; }
h1:focus { outline: none; }

/* ---------- Layout ---------- */
#app { display: flex; min-height: 100vh; }
#sidebar { width: 248px; flex-shrink: 0; background: var(--deep); border-right: 1px solid var(--border); padding: 28px 20px; display: flex; flex-direction: column; gap: 28px; position: sticky; top: 0; height: 100vh; }
#view { flex: 1; min-width: 0; }
.page { padding: 36px 40px 48px; display: flex; flex-direction: column; gap: 24px; max-width: 1500px; }
.page.narrow { max-width: 760px; }
.page-head { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.pill-note { margin-left: auto; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 10px 16px; font-size: 14px; color: var(--muted); }

.brand { font-family: var(--display); font-weight: 700; font-size: 34px; letter-spacing: 2px; }
.brand span { color: var(--accent); }
.brand .ver { font-family: var(--sans); font-size: 12px; font-weight: 500; letter-spacing: 0; color: var(--dim); margin-left: 8px; }
.nav-links { display: flex; flex-direction: column; gap: 4px; }
.nav-links a { display: flex; align-items: center; gap: 12px; height: 48px; padding: 0 14px; border-radius: 10px; color: var(--muted); text-decoration: none; font-weight: 500; }
.nav-links a:hover { background: var(--panel); color: var(--text); }
.nav-links a.active { background: var(--panel-2); color: #fff; font-weight: 600; }
.nav-links a.active svg { color: var(--accent); }
.nav-level { display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: var(--muted); padding: 0 4px; }
.bike-card { margin-top: auto; display: flex; flex-direction: column; gap: 6px; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 16px; text-decoration: none; color: var(--text); }
.bike-card:hover { border-color: var(--border-2); color: var(--text); }
.bike-card-label { font-size: 12px; color: var(--dim); text-transform: uppercase; letter-spacing: 1px; }
.bike-card-name { font-weight: 600; font-size: 14px; }
.bike-card-hr { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.bike-card-hr svg { width: 16px; height: 16px; color: var(--red); }
[class*="status-"] { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
[class*="status-"] i { width: 8px; height: 8px; border-radius: 50%; background: #4B587A; flex-shrink: 0; }
.status-connected { color: var(--accent); }
.status-connected i { background: var(--accent); }
.status-connecting i { background: var(--orange); animation: blink 1s infinite; }
.status-lost { color: var(--orange); }
.status-lost i { background: var(--orange); }
@keyframes blink { 50% { opacity: .3; } }

/* ---------- Common ---------- */
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 22px 24px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head a { font-size: 14px; }
.bar { height: 14px; background: var(--deep); border-radius: 7px; overflow: hidden; position: relative; }
.bar > div { height: 100%; background: var(--accent); border-radius: 7px; }
.bar.thin { height: 6px; }
.bar.big { height: 20px; border-radius: 10px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid transparent; font-weight: 600; cursor: pointer; text-decoration: none; background: var(--panel-2); color: var(--text); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #0E1320; }
.btn-primary:hover:not(:disabled) { background: var(--accent-2); color: #0E1320; }
.btn-ghost { background: var(--panel-2); border-color: var(--border-2); }
.btn-ghost:hover:not(:disabled) { border-color: #3A4766; color: #fff; }
.btn-danger { background: #5A1F24; border-color: #7A2A30; color: #FFD6D6; }
.btn-danger:hover { background: #6E252B; }
.btn-danger-ghost { background: none; border: none; color: #FF9C9C; cursor: pointer; min-height: 44px; font-weight: 600; }
.btn-lg { min-height: 56px; font-size: 17px; padding: 0 24px; }
.btn-xl { min-height: 72px; padding: 0 36px; font-family: var(--display); font-size: 30px; letter-spacing: 1px; border-radius: 14px; }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; }
.btn-row.stretch > * { flex: 1; }
.icon-btn { width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--border-2); background: var(--panel-2); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text); flex-shrink: 0; }
.icon-btn:hover:not(:disabled) { border-color: #3A4766; }
.icon-btn:disabled { opacity: .35; cursor: default; }
.icon-btn.big { width: 56px; height: 56px; }
.title-tag { font-size: 14px; color: var(--orange); font-weight: 600; text-transform: uppercase; letter-spacing: 1.5px; font-family: var(--sans); }
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 24px 12px; color: var(--muted); }
.empty svg { width: 36px; height: 36px; color: var(--dim); }
.empty p { margin: 0; max-width: 320px; }
.notice { display: flex; gap: 14px; align-items: flex-start; background: #2A1E10; border: 1px solid #5A3E1C; color: #FFD9B8; border-radius: var(--r); padding: 14px 18px; }
.notice svg { flex-shrink: 0; color: var(--orange); }

/* ---------- Home ---------- */
.hero { display: flex; align-items: center; gap: 28px; padding: 28px 32px; flex-wrap: wrap; }
.avatar { width: 88px; height: 88px; border-radius: 50%; background: #1F2940; border: 3px solid var(--accent); display: flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 700; font-size: 38px; flex-shrink: 0; }
.hero-main { flex: 1; min-width: 260px; display: flex; flex-direction: column; gap: 10px; }
.hero-top { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.hero-name { color: var(--muted); font-size: 15px; }
.hero-sub { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; color: var(--muted); flex-wrap: wrap; }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.tile { background: var(--panel); border: 1px solid var(--border); border-radius: var(--r); padding: 16px 20px; }
.tile-label { font-size: 13px; color: var(--dim); }
.tile-val { font-family: var(--display); font-weight: 600; font-size: 40px; line-height: 1.1; }
.tile-val small, .goal-val small { font-size: 20px; color: var(--dim); }
.home-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.home-col { display: flex; flex-direction: column; gap: 20px; }
.goal { display: flex; align-items: center; gap: 22px; }
.goal-val { font-family: var(--display); font-weight: 600; font-size: 30px; }
.cal-nav { display: flex; align-items: center; gap: 10px; }
.cal-nav h2 { min-width: 150px; text-align: center; }
.cal-legend { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--dim); margin-bottom: 12px; flex-wrap: wrap; }
.cal-legend i { width: 14px; height: 14px; border-radius: 3px; display: inline-block; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-dow { font-size: 12px; color: var(--dim); text-align: center; margin-bottom: 6px; }
.cal-cell { border-radius: 8px; padding: 6px 8px; min-height: 58px; display: flex; flex-direction: column; justify-content: space-between; }
.cal-cell.empty { background: transparent; }
.l0 { background: #1B2336; }
.l1 { background: #3B5A1E; }
.l2 { background: #7BA62A; }
.l3 { background: var(--accent); color: #0E1320; }
.cal-cell.future { background: #111727; color: #5E6880; }
.cal-cell.today { outline: 2px solid var(--orange); outline-offset: 1px; }
.cal-d { font-size: 12px; opacity: .85; }
.cal-km { font-size: 13px; font-weight: 700; }
.ride-row { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.ride-row:last-child { border-bottom: none; }
.ride-ic { width: 42px; height: 42px; border-radius: 10px; background: #1F2940; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ride-main { flex: 1; min-width: 0; }
.ride-name { font-weight: 600; }
.ride-sub { font-size: 13px; color: var(--dim); }
.ride-right { text-align: right; }
.ride-km { font-family: var(--display); font-weight: 600; font-size: 22px; }
.ride-xp { font-size: 12px; color: var(--accent); }
.tag-demo { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; color: var(--blue); border: 1px solid #2D4A66; border-radius: 6px; padding: 1px 6px; margin-left: 4px; vertical-align: 2px; }

/* ---------- Maps ---------- */
.map-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.map-card { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.map-card.selected { border: 2px solid var(--accent); }
.map-card.soon .map-art { filter: saturate(.7); }
.map-art { height: 200px; display: flex; align-items: center; justify-content: center; position: relative; }
.map-art-svg { width: 80%; max-height: 170px; }
.badge { position: absolute; top: 12px; right: 12px; display: flex; align-items: center; gap: 6px; background: var(--deep); border-radius: 8px; padding: 6px 10px; font-size: 12px; font-weight: 600; color: var(--muted); }
.badge svg { width: 14px; height: 14px; }
.map-body { padding: 20px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.map-body h2 { font-family: var(--display); font-size: 32px; font-weight: 700; }
.map-body p { margin: 0; color: var(--muted); font-size: 15px; }
.map-body > .btn { margin-top: auto; }
.map-tag { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 1.5px; }
.map-foot { display: flex; justify-content: space-between; font-size: 14px; color: var(--muted); border-top: 1px solid var(--border); padding-top: 12px; }
.opt { border: none; padding: 0; margin: 0; }
.opt legend { font-size: 13px; color: var(--dim); margin-bottom: 8px; padding: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--border-2); background: var(--panel-2); cursor: pointer; font-size: 14px; font-weight: 500; }
.chip.on { background: var(--accent); color: #0E1320; border-color: var(--accent); font-weight: 600; }
.toggle { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; cursor: pointer; }
.toggle input { width: 20px; height: 20px; accent-color: var(--accent); grid-row: span 2; }
.toggle small { color: var(--dim); font-size: 13px; }

.connect-choices { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; }
.choice { display: flex; align-items: center; gap: 16px; text-align: left; padding: 16px; border-radius: var(--r); background: var(--panel-2); border: 1px solid var(--border-2); cursor: pointer; }
.choice:hover:not(:disabled) { border-color: var(--accent); }
.choice:disabled { opacity: .5; cursor: not-allowed; }
.choice b { display: block; font-size: 16px; }
.choice small { color: var(--muted); font-size: 13px; }
.choice-icon { width: 48px; height: 48px; border-radius: 12px; background: #24310F; color: var(--accent); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* ---------- Devices ---------- */
.dev-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; }
.dev-card { display: flex; flex-direction: column; gap: 18px; }
.dev-head { display: flex; align-items: center; gap: 16px; }
.dev-ic { width: 56px; height: 56px; border-radius: 14px; background: var(--panel-2); color: var(--dim); display: flex; align-items: center; justify-content: center; }
.dev-ic svg { width: 28px; height: 28px; }
.dev-ic.on { background: #24310F; color: var(--accent); }
.dev-ic.hr.on { background: #3A1A1F; color: var(--red); }
.dev-title { display: flex; flex-direction: column; gap: 4px; }
.live-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.live-row > div { background: var(--deep); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; }
.live-row span { font-size: 12px; color: var(--dim); }
.live-row b { font-family: var(--display); font-size: 36px; font-weight: 600; line-height: 1.1; }
.live-row small { color: var(--dim); font-size: 12px; }
.hr-big { display: flex; align-items: baseline; gap: 8px; }
.hr-big b { font-family: var(--display); font-size: 64px; font-weight: 700; line-height: 1; color: var(--red); }
.hr-big small { color: var(--dim); font-size: 18px; }
.dev-card p { margin: 0; }
.caps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; font-size: 14px; }
.caps > div { display: flex; align-items: center; gap: 8px; }
.cap { width: 22px; height: 22px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 12px; font-weight: 700; }
.cap svg { width: 14px; height: 14px; }
.cap.yes { background: #24310F; color: var(--accent); }
.cap.no { background: #3A1A1F; color: #FF9C9C; }
.cap.unknown { background: var(--panel-2); color: var(--dim); }
.lab-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.lab-block h3:first-child { margin-top: 0; }
.lab-block p { margin: 8px 0 0; }
.stepper { display: flex; align-items: center; gap: 16px; margin-bottom: 10px; }
.stepper-val { display: flex; flex-direction: column; align-items: center; min-width: 80px; }
.stepper-val b { font-family: var(--display); font-size: 52px; line-height: 1; }
.stepper-val small { color: var(--dim); font-size: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field.inline { flex-direction: row; align-items: center; gap: 10px; margin: 12px 0 0; flex-wrap: wrap; }
.field label { font-size: 14px; color: var(--muted); font-weight: 500; }
.field input, .field select { background: var(--deep); border: 1px solid var(--border-2); border-radius: 10px; min-height: 44px; padding: 0 12px; }
.field input[type=number] { width: 110px; }
.field small { font-size: 13px; }
code { display: block; background: var(--deep); border-radius: 8px; padding: 10px 12px; font-size: 13px; word-break: break-all; color: var(--blue); }
.log { list-style: none; margin: 0; padding: 0; max-height: 220px; overflow: auto; font-size: 12.5px; background: var(--deep); border-radius: 8px; }
.log li { padding: 6px 10px; border-bottom: 1px solid #141B2C; display: flex; gap: 8px; }
.log time { color: var(--dim); flex-shrink: 0; }
.log .dir { color: var(--accent); width: 12px; flex-shrink: 0; }

/* ---------- Forms (profile) ---------- */
.form-card { display: flex; flex-direction: column; gap: 6px; }
.form-card h2 { margin-bottom: 12px; }
.form-card p { margin: 0 0 14px; }
.form-card .btn-row + .btn-row { margin-top: 12px; }
.form-actions { display: flex; justify-content: flex-end; }
.list-card .ride-row .icon-btn { margin-left: 4px; }

/* ---------- Summary ---------- */
.summary { gap: 22px; }
.sum-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; }
.eyebrow { font-size: 14px; color: var(--muted); font-weight: 600; letter-spacing: 2px; text-transform: uppercase; margin-bottom: 6px; }
.xp-big { display: flex; align-items: baseline; gap: 8px; }
.xp-big b { font-family: var(--display); font-size: 96px; line-height: .9; color: var(--accent); }
.xp-big span { font-family: var(--display); font-size: 36px; color: var(--muted); font-weight: 600; }
.lvl-card { display: flex; flex-direction: column; gap: 12px; }
.lvl-card.lvlup { border-color: var(--accent); }
.lvlup-banner { display: flex; align-items: center; gap: 10px; background: #24310F; color: var(--accent); border-radius: 10px; padding: 10px 14px; font-weight: 600; }
.lvl-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.lvl-foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.bar-old { position: absolute; left: 0; top: 0; bottom: 0; background: #5E7A1C; border-radius: 10px 0 0 10px !important; }
.bar-new { position: absolute; top: 0; bottom: 0; background: var(--accent); border-radius: 0 10px 10px 0 !important; transition: width 1.2s cubic-bezier(.2,.8,.2,1) .2s; }
.sum-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.sum-col { display: flex; flex-direction: column; gap: 16px; }
.sum-col h2 { margin-bottom: 8px; }
.sum-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px 12px; }
.sum-stats span { font-size: 13px; color: var(--dim); display: block; }
.sum-stats b { font-family: var(--display); font-size: 34px; font-weight: 600; line-height: 1.15; }
.sum-stats small { font-size: 16px; color: var(--dim); }
.chart-head { display: flex; justify-content: space-between; font-size: 13px; color: var(--dim); margin: 22px 0 8px; }
.sum-chart { width: 100%; height: 200px; display: block; }
.unlock { display: flex; align-items: center; gap: 14px; padding: 10px 0; }
.unlock b { display: block; }
.unlock span { font-size: 13px; color: var(--muted); }
.unlock-ic { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: #24310F; color: var(--accent); }
.unlock-ic.ic-fire { background: #2A1E10; color: var(--orange); }
.unlock-ic.ic-check, .unlock-ic.ic-bolt { background: #10243A; color: var(--blue); }
.demo-note { margin: 0; }

/* ---------- Modal & toasts ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(5, 8, 15, .72); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.modal { position: relative; width: 100%; max-width: 480px; background: var(--panel); border: 1px solid var(--border-2); border-radius: var(--r-lg); padding: 28px; box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.modal h2 { font-size: 22px; margin-bottom: 8px; padding-right: 40px; }
.modal p { margin: 0; }
.modal-close { position: absolute; top: 14px; right: 14px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
#toast-root { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; z-index: 60; pointer-events: none; }
.toast { background: var(--panel-2); border: 1px solid var(--border-2); border-radius: 12px; padding: 12px 18px; max-width: 520px; box-shadow: 0 10px 30px rgba(0,0,0,.4); opacity: 0; transform: translateY(8px); transition: .25s; }
.toast.in { opacity: 1; transform: none; }
.toast-error { border-color: #7A2A30; background: #2A1416; color: #FFD6D6; }
.toast-ok { border-color: #3F5A16; }

/* ---------- Ride ---------- */
#ride-root { position: fixed; inset: 0; background: #05080F; }
.ride { position: absolute; inset: 0; overflow: hidden; user-select: none; }
.ride canvas#rc { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hud { position: absolute; inset: 0; pointer-events: none; color: #fff; }
.hud button, .hud input, .hud .pause-ov { pointer-events: auto; }
.hp { background: rgba(10, 14, 24, .86); border: 1px solid var(--border-2); border-radius: var(--r); backdrop-filter: blur(4px); }
.lbl { font-size: 13px; color: var(--muted); font-weight: 600; letter-spacing: 1.5px; }
.hud-tl { position: absolute; top: 24px; left: 24px; display: flex; flex-direction: column; gap: 10px; }
.lapbox { padding: 12px 20px; display: flex; align-items: baseline; gap: 10px; }
.lapbox b { font-family: var(--display); font-size: 54px; line-height: 1; }
.lapbox .of { font-family: var(--display); font-size: 28px; color: var(--dim); }
.laptimes { padding: 12px 18px; width: 220px; display: flex; flex-direction: column; gap: 4px; }
.laptimes div { display: flex; justify-content: space-between; align-items: baseline; }
.laptimes span { color: var(--muted); font-size: 14px; }
.laptimes b { font-family: var(--display); font-size: 24px; font-weight: 600; }
.hud-tc { position: absolute; top: 24px; left: 50%; transform: translateX(-50%); }
.pill { border-radius: 999px; padding: 10px 22px; display: flex; align-items: center; gap: 12px; white-space: nowrap; }
.pill span { color: var(--muted); font-size: 15px; }
.pill b { font-family: var(--display); font-size: 28px; }
.pill b.ahead { color: var(--accent); }
.pill b.behind { color: var(--orange); }
.dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.dot.ghost { background: var(--blue); }
.hud-tr { position: absolute; top: 24px; right: 24px; display: flex; gap: 10px; align-items: flex-start; }
.mini { padding: 12px; width: 264px; }
.mini canvas { width: 240px; height: 140px; display: block; }
.mini-foot { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-top: 6px; }
.hud-btns { display: flex; flex-direction: column; gap: 10px; }
.hud-btn { width: 56px; height: 56px; border-radius: 14px; background: rgba(10,14,24,.86); border: 1px solid var(--border-2); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.hud-btn:hover { border-color: #4B587A; }
.hud-btn.sm { width: 44px; height: 44px; border-radius: 10px; }
.hud-toasts { position: absolute; right: 24px; top: 260px; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.hud-toast { background: rgba(10,14,24,.9); border: 1px solid var(--border-2); border-radius: 12px; padding: 10px 16px; display: flex; flex-direction: column; align-items: flex-end; animation: tin .3s ease-out; transition: opacity .4s; }
.hud-toast b { font-size: 16px; }
.hud-toast span { font-size: 13px; color: var(--accent); }
.hud-toast.gold { border-color: var(--accent); }
.hud-toast.out { opacity: 0; }
@keyframes tin { from { transform: translateX(20px); opacity: 0; } }
.center-msg { position: absolute; left: 50%; top: 34%; transform: translate(-50%, -50%); font-family: var(--display); font-weight: 700; text-align: center; text-shadow: 0 4px 30px rgba(0,0,0,.6); }
.center-msg:empty { display: none; }
.center-msg.big { font-size: 160px; line-height: 1; }
.center-msg.go { color: var(--accent); }
.center-msg.note { font-size: 34px; background: rgba(10,14,24,.85); border: 1px solid var(--border-2); border-radius: 16px; padding: 14px 28px; }
.hud-bottom { position: absolute; left: 24px; right: 24px; bottom: 24px; display: flex; align-items: flex-end; gap: 14px; }
.grow { flex: 1; }
.hud-left { display: flex; flex-direction: column; gap: 10px; width: 300px; }
.speedbox { padding: 14px 24px; }
.speedbox div { display: flex; align-items: baseline; gap: 8px; }
.speedbox b { font-family: var(--display); font-size: 96px; line-height: .95; font-weight: 700; }
.speedbox small { font-family: var(--display); font-size: 26px; color: var(--muted); }
.cadbox { padding: 14px 20px; display: flex; flex-direction: column; gap: 8px; }
.cad-top { display: flex; justify-content: space-between; align-items: baseline; }
.cad-top b { font-family: var(--display); font-size: 44px; line-height: 1; }
.cad-top small { font-size: 18px; color: var(--muted); }
.cad-bar { position: relative; height: 14px; background: #1A2236; border-radius: 7px; overflow: hidden; }
.cad-zone { position: absolute; left: 57.1%; width: 14.3%; top: 0; bottom: 0; background: #2D4A14; }
.cad-fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--orange); border-radius: 7px; opacity: .9; transition: width .2s; }
.cad-fill.inzone { background: var(--accent); }
.cad-scale { display: flex; justify-content: space-between; font-size: 12px; color: var(--dim); }
.stat-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; width: 300px; }
.st { padding: 10px 14px; display: flex; flex-direction: column; }
.st .lbl { font-size: 11.5px; letter-spacing: 1px; }
.st b { font-family: var(--display); font-size: 34px; font-weight: 600; line-height: 1.1; }
.st small { font-size: 13px; color: var(--muted); }
.resbox { padding: 12px 14px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.resbox .lbl { font-size: 11.5px; letter-spacing: 1px; }
.res-ctl { display: flex; align-items: center; gap: 10px; }
.res-ctl b { font-family: var(--display); font-size: 40px; min-width: 40px; text-align: center; line-height: 1; }
.resbox small { color: var(--dim); font-size: 12px; }
.simpanel { position: absolute; left: 24px; bottom: 318px; padding: 12px 16px; width: 300px; pointer-events: auto; border-color: #2D4A66; }
.sim-top { display: flex; flex-direction: column; gap: 2px; font-size: 13px; margin-bottom: 8px; }
.sim-top b { color: var(--blue); }
.sim-top span { color: var(--muted); }
.simpanel input { width: 100%; accent-color: var(--blue); }
.pause-ov { position: absolute; inset: 0; background: rgba(5,8,15,.7); display: flex; align-items: center; justify-content: center; }
.pause-card { background: var(--panel); border: 1px solid var(--border-2); border-radius: 20px; padding: 32px; width: 380px; max-width: calc(100% - 32px); display: flex; flex-direction: column; gap: 12px; }
.pause-card h2 { font-size: 56px; margin-bottom: 4px; }
.pause-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 8px; }
.pause-stats span { display: block; font-size: 12px; color: var(--dim); }
.pause-stats b { font-family: var(--display); font-size: 26px; }

/* ---------- Responsive ---------- */
@media (max-width: 1280px) {
  .map-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .st b { font-size: 28px; }
}
@media (max-width: 1100px) {
  .home-grid, .sum-grid, .dev-grid { grid-template-columns: minmax(0, 1fr); }
  .lab-grid { grid-template-columns: minmax(0, 1fr); }
  .stat-tiles { width: 260px; }
  .hud-left { width: 260px; }
  .simpanel { width: 260px; bottom: 290px; }
  .speedbox b { font-size: 72px; }
}
@media (max-width: 860px) {
  #app { flex-direction: column; }
  #sidebar { width: auto; height: auto; position: static; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 12px 16px; gap: 12px; }
  .nav-links { flex-direction: row; flex-wrap: wrap; }
  .nav-links a span { display: none; }
  .nav-level, .bike-card { display: none; }
  .page { padding: 20px 16px 40px; }
  .tiles, .live-row, .sum-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .map-grid { grid-template-columns: minmax(0, 1fr); }
  .btn-xl { width: 100%; }
  .display.xl { font-size: 52px; }
  .cal-cell { min-height: 44px; padding: 4px; }
  .cal-km { font-size: 11px; }
}
