/* ==========================================================================
   HEEL & TOE — interface styles
   Design language: graphite instrument panel, warm amber signal accent,
   teal for "active / ready", condensed technical type.
   ========================================================================== */
:root {
  --ui-scale: 1;
  --bg: #0b0e12;
  --bg2: #12161c;
  --panel: rgba(16, 20, 26, 0.86);
  --panel-solid: #141920;
  --line: rgba(236, 232, 225, 0.12);
  --line2: rgba(236, 232, 225, 0.22);
  --ink: #ece8e1;
  --ink2: #b9b4aa;
  --muted: #8a8f97;
  --amber: #e8a23a;
  --amber2: #ffbf5c;
  --teal: #3fd0c9;
  --red: #ff5a43;
  --green: #4ad07a;
  --radius: 10px;
  --font: 'Barlow', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --cond: 'Barlow Condensed', 'Arial Narrow', 'Barlow', system-ui, sans-serif;
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  font-size: calc(16px * var(--ui-scale));
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
#scene { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; display: block; outline: none; }
button, input, select { font: inherit; color: inherit; }
kbd {
  display: inline-block;
  min-width: 1.6em;
  padding: 0.05em 0.45em;
  border: 1px solid var(--line2);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.06);
  font-family: var(--cond);
  font-weight: 600;
  text-align: center;
  color: var(--amber2);
}
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: 0.82rem; }
.row { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; }
.row.end { justify-content: flex-end; }
.row.center { justify-content: center; }
.grow { flex: 1; }
.hidden { display: none !important; }

/* ---------- loader ---------- */
#loader {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center;
  background: radial-gradient(1200px 700px at 50% 35%, #1a2029 0%, #0b0e12 60%, #07090c 100%);
  transition: opacity 0.8s ease, visibility 0.8s;
  cursor: progress;
}
#loader.ready { cursor: pointer; }
#loader.gone { opacity: 0; visibility: hidden; }
.ld-inner { text-align: center; padding: 2rem; max-width: 90vw; }
.ld-gauge { width: min(34vh, 220px); margin: 0 auto 0.5rem; }
.ld-gauge svg { width: 100%; overflow: visible; }
.ld-arc { fill: none; stroke: rgba(236,232,225,0.18); stroke-width: 3; }
.ld-red { fill: none; stroke: var(--red); stroke-width: 6; }
.ld-ticks line { stroke: var(--ink2); stroke-width: 3; }
.ld-needle { stroke: var(--amber); stroke-width: 4; stroke-linecap: round; transform-origin: 0 0; animation: ld-sweep 2.4s cubic-bezier(.5,0,.3,1) infinite; }
#loader.ready .ld-needle { animation: ld-idle 1.2s ease-in-out infinite; }
.ld-hub { fill: #1d2229; stroke: var(--ink2); stroke-width: 2; }
@keyframes ld-sweep { 0% { transform: rotate(-135deg); } 55% { transform: rotate(120deg); } 100% { transform: rotate(-135deg); } }
@keyframes ld-idle { 0%,100% { transform: rotate(-118deg); } 50% { transform: rotate(-112deg); } }
.ld-logo { margin: 0.2rem 0 0; font-family: var(--cond); font-weight: 700; font-size: clamp(2.6rem, 9vw, 5.2rem); letter-spacing: 0.08em; line-height: 1; }
.ld-logo em, .logo em { font-style: normal; color: var(--amber); margin: 0 0.18em; font-weight: 600; }
.ld-tag { margin: 0.4rem 0 1.4rem; color: var(--ink2); letter-spacing: 0.4em; font-size: 0.78rem; font-weight: 600; }
.ld-bar { width: min(420px, 70vw); height: 3px; margin: 0 auto; background: rgba(255,255,255,0.08); border-radius: 3px; overflow: hidden; }
.ld-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--amber), var(--amber2)); transition: width 0.3s ease; }
.ld-text { margin: 0.8rem 0 0; color: var(--muted); font-size: 0.9rem; min-height: 1.2em; }
.ld-start { margin: 1.4rem 0 0; font-family: var(--cond); letter-spacing: 0.2em; font-size: 1.05rem; color: var(--ink); opacity: 0; }
#loader.ready .ld-start { animation: pulse 1.6s ease-in-out infinite; }
#loader.ready .ld-text { opacity: 0; }
.ld-tip { margin: 2rem auto 0; max-width: 520px; color: var(--muted); font-size: 0.86rem; }
@keyframes pulse { 0%,100% { opacity: 0.35; } 50% { opacity: 1; } }

#fade { position: fixed; inset: 0; background: #000; opacity: 0; pointer-events: none; z-index: 40; transition: opacity 0.4s ease; }
#fade.on { opacity: 1; }

/* ---------- toasts ---------- */
.toasts { position: fixed; top: calc(1rem + var(--safe-t)); left: 50%; transform: translateX(-50%); z-index: 45; display: flex; flex-direction: column; gap: 0.4rem; align-items: center; pointer-events: none; width: min(560px, 92vw); }
.toast {
  padding: 0.55rem 1rem; border-radius: 999px; background: var(--panel); border: 1px solid var(--line2);
  font-size: 0.92rem; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  animation: toast-in 0.25s ease; transition: opacity 0.35s, transform 0.35s; text-align: center;
}
.toast.good { border-color: rgba(74, 208, 122, 0.6); }
.toast.warn { border-color: rgba(232, 162, 58, 0.7); color: var(--amber2); }
.toast.bad { border-color: rgba(255, 90, 67, 0.7); color: #ffb3a8; }
.toast.out { opacity: 0; transform: translateY(-6px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ---------- UI shell ---------- */
.ui { position: fixed; inset: 0; z-index: 20; display: none; pointer-events: none; }
.ui.visible { display: block; }
.ui > * { pointer-events: auto; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  min-height: 2.6rem; padding: 0.5rem 1.15rem; border-radius: var(--radius);
  border: 1px solid var(--line2); background: rgba(255, 255, 255, 0.06); cursor: pointer;
  font-family: var(--cond); font-weight: 600; letter-spacing: 0.06em; font-size: 1rem; text-transform: uppercase;
  transition: background 0.15s, border-color 0.15s, transform 0.08s;
}
.btn:hover { background: rgba(255, 255, 255, 0.12); border-color: var(--line2); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--amber); color: #15110a; border-color: var(--amber); }
.btn.primary:hover { background: var(--amber2); }
.btn.ghost { background: transparent; }
.btn.danger { color: #ffb3a8; border-color: rgba(255, 90, 67, 0.5); }
.btn.small { min-height: 2rem; padding: 0.25rem 0.75rem; font-size: 0.85rem; }
.btn.big { min-height: 3.1rem; font-size: 1.15rem; padding: 0.6rem 1.6rem; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn.back { width: 2.6rem; padding: 0; font-size: 1.6rem; line-height: 1; }

.screen {
  position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden;
  padding: calc(1.2rem + var(--safe-t)) calc(clamp(1rem, 4vw, 3rem) + var(--safe-r)) calc(2rem + var(--safe-b)) calc(clamp(1rem, 4vw, 3rem) + var(--safe-l));
  background: linear-gradient(90deg, rgba(8, 10, 13, 0.94) 0%, rgba(8, 10, 13, 0.86) 55%, rgba(8, 10, 13, 0.7) 100%);
  animation: scr-in 0.3s ease;
  touch-action: pan-y;
}
@keyframes scr-in { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
.scr-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.2rem; flex-wrap: wrap; }
.scr-head h2, .g-top h2 { margin: 0; font-family: var(--cond); font-size: 2rem; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 700; }
.sub { margin: 0.1rem 0 0; color: var(--muted); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 1.2rem 1.3rem; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.panel h3 { margin: 0 0 0.8rem; font-family: var(--cond); letter-spacing: 0.08em; text-transform: uppercase; font-size: 1.15rem; color: var(--amber2); }
.panel h4, .cust-group h4, .bind-group h4 { margin: 1rem 0 0.5rem; font-family: var(--cond); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink2); font-size: 0.95rem; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; align-items: start; }
.tabs { display: flex; gap: 0.3rem; margin-bottom: 1rem; flex-wrap: wrap; }
.tab { padding: 0.45rem 1rem; border-radius: 999px; border: 1px solid var(--line); background: transparent; cursor: pointer; font-family: var(--cond); letter-spacing: 0.06em; text-transform: uppercase; font-weight: 600; color: var(--ink2); }
.tab.on { background: var(--ink); color: #111; border-color: var(--ink); }
.spec-row { display: flex; justify-content: space-between; gap: 1rem; padding: 0.42rem 0; border-bottom: 1px solid var(--line); font-size: 0.95rem; }
.spec-row span { color: var(--muted); }
.spec-row b { font-weight: 600; text-align: right; }

/* chip */
.chip { display: flex; align-items: center; gap: 0.7rem; padding: 0.45rem 0.8rem 0.45rem 0.45rem; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); min-width: 15rem; }
.chip-avatar { width: 2.3rem; height: 2.3rem; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--amber), #b86c1c); color: #1a1208; font-family: var(--cond); font-weight: 700; font-size: 1.2rem; }
.chip-body { flex: 1; min-width: 0; }
.chip-name { font-weight: 600; font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip-meta { font-size: 0.75rem; color: var(--muted); }
.xpbar { height: 3px; border-radius: 3px; background: rgba(255,255,255,0.1); margin-top: 0.25rem; overflow: hidden; }
.xpbar i { display: block; height: 100%; background: var(--teal); }
.chip-money { font-family: var(--cond); font-weight: 700; color: var(--amber2); font-size: 1.05rem; white-space: nowrap; }

/* ---------- main menu ---------- */
.main-menu {
  position: absolute; inset: 0; display: grid; grid-template-columns: minmax(18rem, 30rem) 1fr; grid-template-rows: auto 1fr auto;
  padding: calc(2rem + var(--safe-t)) calc(2.4rem + var(--safe-r)) calc(1.6rem + var(--safe-b)) calc(2.4rem + var(--safe-l));
  background: linear-gradient(90deg, rgba(7, 9, 12, 0.95) 0%, rgba(7, 9, 12, 0.75) 28%, rgba(7, 9, 12, 0) 55%);
  animation: scr-in 0.4s ease;
}
.brand { grid-column: 1; }
.logo { font-family: var(--cond); font-weight: 700; font-size: clamp(2.4rem, 5vw, 3.6rem); letter-spacing: 0.08em; line-height: 1; }
.tag { margin-top: 0.35rem; color: var(--ink2); letter-spacing: 0.38em; font-size: 0.72rem; font-weight: 600; }
.menu-list { grid-column: 1; align-self: center; display: flex; flex-direction: column; gap: 0.15rem; margin: 1rem 0; max-height: 100%; overflow-y: auto; }
.menu-item {
  display: flex; flex-direction: column; align-items: flex-start; text-align: left; cursor: pointer;
  padding: 0.5rem 0.9rem 0.5rem 1.1rem; border: 0; border-left: 3px solid transparent; background: transparent; border-radius: 0 8px 8px 0;
  transition: background 0.15s, border-color 0.15s, padding 0.15s;
}
.menu-item .mi-label { font-family: var(--cond); font-weight: 700; font-size: 1.55rem; letter-spacing: 0.1em; line-height: 1.1; }
.menu-item .mi-sub { color: var(--muted); font-size: 0.82rem; max-height: 0; overflow: hidden; transition: max-height 0.2s; }
.menu-item:hover, .menu-item:focus-visible { background: linear-gradient(90deg, rgba(232,162,58,0.16), rgba(232,162,58,0)); border-left-color: var(--amber); padding-left: 1.4rem; outline: none; }
.menu-item:hover .mi-sub, .menu-item:focus-visible .mi-sub { max-height: 1.4rem; }
.menu-item.primary .mi-label { color: var(--amber2); }
.menu-foot { grid-column: 1 / span 2; display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; }
.car-tag { text-align: right; font-family: var(--cond); letter-spacing: 0.08em; }
.car-tag b { display: block; font-size: 1.5rem; }
.car-tag span { color: var(--muted); text-transform: capitalize; }

/* ---------- drive select ---------- */
.drive-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 1.2rem; }
.panel.free label { display: block; margin: 0.9rem 0 0.35rem; color: var(--ink2); font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 600; }
.panel.free label.check { display: flex; align-items: center; gap: 0.5rem; text-transform: none; letter-spacing: 0; font-size: 0.92rem; color: var(--ink); margin: 1rem 0; }
.panel.free .btn.big { width: 100%; margin-top: 0.4rem; }
.seg { display: flex; flex-wrap: wrap; gap: 0.25rem; padding: 0.2rem; border-radius: 10px; background: rgba(255,255,255,0.04); border: 1px solid var(--line); }
.seg.small { background: var(--panel); }
.seg-btn { flex: 1; min-width: 4.5rem; padding: 0.45rem 0.6rem; border: 0; border-radius: 8px; background: transparent; cursor: pointer; font-family: var(--cond); font-weight: 600; letter-spacing: 0.05em; color: var(--ink2); }
.seg-btn.on { background: var(--ink); color: #111; }
.seg-btn:hover:not(.on) { background: rgba(255,255,255,0.08); }
.mode-cards { display: grid; gap: 0.8rem; }
/* city picker (Drive screen): Kaveripuram + the real Tamil Nadu cities */
.city-pick { margin-top: 1.2rem; }
.city-pick h3 .ta, .city-card .ta { font-family: 'Noto Sans Tamil', 'Latha', 'Nirmala UI', var(--font); }
.city-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr)); gap: 0.6rem; margin: 0.7rem 0 0.5rem; }
.city-card { display: flex; flex-direction: column; gap: 0.15rem; padding: 0.65rem 0.8rem; min-width: 0; }
.city-card b { font-family: var(--cond); font-size: 1.1rem; letter-spacing: 0.03em; }
.city-card .ta { color: var(--amber2); font-size: 0.85rem; }
.city-card small { color: var(--muted); font-size: 0.74rem; line-height: 1.25; }
.city-card.on { border-color: var(--amber); background: rgba(232,162,58,0.12); }
.card { text-align: left; cursor: pointer; border: 1px solid var(--line); background: var(--panel); border-radius: 14px; color: inherit; transition: border-color 0.15s, transform 0.12s, background 0.15s; }
.card:hover:not(:disabled), .card:focus-visible { border-color: var(--amber); transform: translateY(-1px); }
.card.locked, .card:disabled { opacity: 0.5; cursor: not-allowed; }
.mode-card { display: grid; grid-template-columns: 6.5rem 1fr; grid-template-rows: auto 1fr; column-gap: 1rem; padding: 0.9rem; min-height: 6.5rem; }
.mc-art { grid-row: 1 / span 2; border-radius: 10px; background: linear-gradient(160deg, #2a3240, #10141a); position: relative; overflow: hidden; }
.mc-art::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 16px, rgba(255,255,255,0.05) 16px 18px); }
.art-city .mc-art { background: linear-gradient(170deg, #5d7590 0%, #2c3542 60%, #1a1f26 100%); }
.art-night .mc-art { background: radial-gradient(circle at 70% 70%, rgba(255,191,92,0.55), transparent 35%), linear-gradient(170deg, #0b1120, #05070c); }
.art-rain .mc-art { background: repeating-linear-gradient(105deg, rgba(255,255,255,0.12) 0 1px, transparent 1px 7px), linear-gradient(170deg, #3a4550, #161b21); }
.mc-title { font-family: var(--cond); font-weight: 700; letter-spacing: 0.08em; font-size: 1.4rem; text-transform: uppercase; }
.mc-desc { color: var(--muted); font-size: 0.9rem; }

/* ---------- garage overlay ---------- */
.garage-ui { position: absolute; inset: 0; pointer-events: none; }
.garage-ui > * { pointer-events: auto; }
.g-top { position: absolute; top: calc(1rem + var(--safe-t)); left: calc(1.4rem + var(--safe-l)); right: calc(1.4rem + var(--safe-r)); display: flex; align-items: center; gap: 1rem; pointer-events: none; }
.g-top > * { pointer-events: auto; }
.g-spec { position: absolute; left: calc(1.4rem + var(--safe-l)); top: 6.5rem; width: 17rem; padding: 1rem 1.1rem; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; backdrop-filter: blur(8px); }
.spec-name { font-family: var(--cond); font-size: 1.6rem; letter-spacing: 0.12em; margin-bottom: 0.4rem; }
.spec-name b { color: var(--amber2); }
.g-bar { position: absolute; left: calc(1.4rem + var(--safe-l)); right: calc(1.4rem + var(--safe-r)); bottom: calc(1.2rem + var(--safe-b)); display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }

/* ---------- vehicle / customise ---------- */
.cond-row { display: grid; grid-template-columns: 9rem 1fr 3rem auto; gap: 0.7rem; align-items: center; padding: 0.35rem 0; }
.cbar { height: 8px; border-radius: 4px; background: rgba(255,255,255,0.08); overflow: hidden; }
.cbar i { display: block; height: 100%; background: var(--green); }
.cbar.warn i { background: var(--amber); }
.cbar.bad i { background: var(--red); }
.customize { background: linear-gradient(90deg, rgba(8,10,13,0.92) 0%, rgba(8,10,13,0.84) 46%, rgba(8,10,13,0) 64%); }
.cust-body { max-width: 46rem; }
.cust-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: 0.55rem; }
.cust-item { display: flex; flex-direction: column; gap: 0.2rem; padding: 0.7rem 0.8rem; min-height: 4.4rem; position: relative; }
.cust-item.sel { border-color: var(--teal); box-shadow: inset 0 0 0 1px var(--teal); }
.cust-item .sw { width: 1.6rem; height: 1.6rem; border-radius: 50%; border: 2px solid rgba(255,255,255,0.3); margin-bottom: 0.2rem; }
.ci-name { font-weight: 600; }
.ci-desc { color: var(--muted); font-size: 0.8rem; }
.ci-price { margin-top: auto; font-family: var(--cond); letter-spacing: 0.05em; color: var(--amber2); font-size: 0.9rem; }
.cust-item.sel .ci-price { color: var(--teal); }
.cust-group input[type='range'] { width: 100%; max-width: 24rem; }

/* lists, school, challenges */
.list { display: grid; gap: 0.55rem; }
.list-item { display: flex; align-items: center; gap: 0.8rem; padding: 0.8rem 1rem; }
.li-main { flex: 1; display: flex; flex-direction: column; gap: 0.15rem; }
.li-main span { color: var(--muted); font-size: 0.85rem; }
.lic-badge { width: 2.4rem; height: 2.4rem; border: 2px solid; border-radius: 8px; display: grid; place-items: center; font-family: var(--cond); font-weight: 700; font-size: 1.3rem; flex: none; }
.list-item.done { border-color: rgba(74,208,122,0.4); }
.stars { display: flex; gap: 0.1rem; color: rgba(255,255,255,0.18); font-size: 1.1rem; }
.stars i { font-style: normal; }
.stars i.on { color: var(--amber2); }
.stars.big { justify-content: center; font-size: 2.4rem; margin: 0.3rem 0; }
.ch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 0.8rem; }
.ch-card { display: flex; flex-direction: column; gap: 0.35rem; padding: 1rem 1.1rem; min-height: 9rem; }
.ch-title { font-family: var(--cond); font-weight: 700; font-size: 1.35rem; letter-spacing: 0.06em; text-transform: uppercase; }
.ch-desc { color: var(--muted); font-size: 0.9rem; flex: 1; }
.ch-foot { display: flex; justify-content: space-between; align-items: center; font-family: var(--cond); color: var(--ink2); }

/* settings */
.set-list { max-width: 52rem; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.7rem 0; border-bottom: 1px solid var(--line); }
.set-label { display: flex; flex-direction: column; gap: 0.15rem; max-width: 60%; }
.set-label b { font-weight: 600; }
.set-label span { color: var(--muted); font-size: 0.82rem; }
select, input[type='text'] { min-height: 2.4rem; padding: 0.3rem 0.7rem; border-radius: 8px; border: 1px solid var(--line2); background: var(--panel-solid); max-width: 20rem; }
.slider { display: flex; align-items: center; gap: 0.7rem; min-width: 14rem; }
.slider output { min-width: 3.4rem; text-align: right; font-family: var(--cond); color: var(--amber2); }
input[type='range'] { -webkit-appearance: none; appearance: none; width: 12rem; height: 4px; border-radius: 4px; background: rgba(255,255,255,0.15); outline-offset: 6px; }
input[type='range']::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--amber); border: 2px solid #111; cursor: pointer; }
input[type='range']::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--amber); border: 2px solid #111; cursor: pointer; }
.toggle { width: 3.1rem; height: 1.75rem; border-radius: 999px; border: 1px solid var(--line2); background: rgba(255,255,255,0.08); position: relative; cursor: pointer; flex: none; }
.toggle i { position: absolute; top: 2px; left: 2px; width: 1.35rem; height: 1.35rem; border-radius: 50%; background: var(--ink2); transition: transform 0.15s, background 0.15s; }
.toggle.on { background: rgba(63, 208, 201, 0.25); border-color: var(--teal); }
.toggle.on i { transform: translateX(1.35rem); background: var(--teal); }
.bind-list { max-width: 50rem; }
.bind-row { display: flex; justify-content: space-between; align-items: center; padding: 0.35rem 0; border-bottom: 1px solid var(--line); gap: 1rem; }
.key-btn { min-width: 8rem; min-height: 2.1rem; padding: 0.2rem 0.7rem; border-radius: 7px; border: 1px solid var(--line2); border-bottom-width: 2px; background: rgba(255,255,255,0.05); cursor: pointer; font-family: var(--cond); font-weight: 600; letter-spacing: 0.04em; color: var(--amber2); }
.key-btn.listening { background: var(--amber); color: #111; animation: pulse 1s infinite; }
.help ol { padding-left: 1.2rem; line-height: 1.6; }
.help p { line-height: 1.55; color: var(--ink2); }

/* profile */
.license-card { margin: 1rem 0; padding: 1rem 1.2rem; border-radius: 12px; border: 2px solid; background: linear-gradient(135deg, rgba(255,255,255,0.06), rgba(255,255,255,0.01)); }
.lc-head { font-size: 0.7rem; letter-spacing: 0.3em; color: var(--muted); }
.lc-name { font-family: var(--cond); font-size: 1.6rem; font-weight: 700; margin-top: 0.3rem; }
.lc-class { font-family: var(--cond); font-weight: 700; letter-spacing: 0.2em; }
.lc-desc { color: var(--ink2); font-size: 0.85rem; margin-top: 0.3rem; }
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: 0.5rem; }
.ach { padding: 0.65rem 0.8rem; border-radius: 10px; border: 1px solid var(--line); opacity: 0.45; display: flex; flex-direction: column; gap: 0.15rem; }
.ach.got { opacity: 1; border-color: rgba(232,162,58,0.55); background: rgba(232,162,58,0.07); }
.ach span { color: var(--muted); font-size: 0.8rem; }
.ach i { font-style: normal; color: var(--amber2); font-size: 0.75rem; font-family: var(--cond); }

/* modal, pause, results */
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(0,0,0,0.55); backdrop-filter: blur(3px); }
.modal-box { width: min(26rem, 92vw); padding: 1.4rem; border-radius: 14px; background: var(--panel-solid); border: 1px solid var(--line2); }
.modal-box h3 { margin: 0 0 0.5rem; font-family: var(--cond); letter-spacing: 0.06em; font-size: 1.4rem; }
.modal-box p { color: var(--ink2); line-height: 1.45; }
.pause, .results { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; background: rgba(6, 8, 11, 0.72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: scr-in 0.25s ease; padding: 1rem; overflow-y: auto; }
.pause h2, .results h2 { font-family: var(--cond); font-size: 2.6rem; letter-spacing: 0.1em; margin: 0; text-transform: uppercase; }
.pause-list { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 1.4rem; width: min(20rem, 90vw); }
.pause-traffic { display: flex; flex-direction: column; gap: 0.35rem; padding: 0.55rem 0.6rem; border-radius: 10px; background: rgba(255,255,255,0.04); border: 1px solid var(--line); }
.pause-traffic .pt-head { display: flex; justify-content: space-between; font-family: var(--cond); letter-spacing: 0.05em; color: var(--ink2); }
.pause-traffic .pt-head b { color: var(--amber2); }
.pause-traffic .seg-btn { min-width: 0; padding: 0.35rem 0.3rem; font-size: 0.8rem; white-space: nowrap; }
.pause-traffic input[type=range] { width: 100%; }
.res-banner { font-family: var(--cond); letter-spacing: 0.4em; font-weight: 700; padding: 0.3rem 1.2rem; border-radius: 999px; margin-bottom: 0.6rem; }
.res-banner.pass { background: rgba(74, 208, 122, 0.18); color: var(--green); }
.res-banner.fail { background: rgba(255, 90, 67, 0.16); color: #ff9a8a; }
.res-score { font-family: var(--cond); font-size: 1.3rem; color: var(--ink2); }
.res-lines { width: min(30rem, 92vw); margin: 1rem 0; }
.res-rewards { display: flex; gap: 1rem; font-family: var(--cond); font-size: 1.2rem; color: var(--amber2); margin-bottom: 1.2rem; flex-wrap: wrap; justify-content: center; }
.lic-new { color: var(--teal); }

/* ---------- HUD ---------- */
.hud { position: fixed; inset: 0; z-index: 10; pointer-events: none; display: none; font-family: var(--font); }
.hud.visible { display: block; }
.hud-top-left { position: absolute; top: calc(0.9rem + var(--safe-t)); left: calc(1rem + var(--safe-l)); max-width: min(30rem, 46vw); text-shadow: 0 1px 4px rgba(0,0,0,0.7); }
.hud-mode { font-family: var(--cond); font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; font-size: 0.95rem; color: var(--amber2); }
.hud-objective { font-size: 0.92rem; line-height: 1.35; margin-top: 0.15rem; }
.hud-objective .score { color: var(--ink2); font-size: 0.82rem; }
.hud-timer { font-family: var(--cond); font-weight: 600; font-size: 1.4rem; margin-top: 0.1rem; }
.hud-toasts { position: absolute; top: calc(0.9rem + var(--safe-t)); right: calc(1rem + var(--safe-r)); display: flex; flex-direction: column; gap: 0.35rem; align-items: flex-end; max-width: min(26rem, 44vw); }
.hud-toasts .toast { border-radius: 10px; font-size: 0.88rem; text-align: right; }
.hud-center { position: absolute; top: 34%; left: 50%; transform: translate(-50%, -50%) scale(0.9); font-family: var(--cond); font-weight: 700; font-size: clamp(2.4rem, 8vw, 5rem); letter-spacing: 0.12em; opacity: 0; transition: opacity 0.2s, transform 0.2s; text-shadow: 0 2px 18px rgba(0,0,0,0.7); }
.hud-center.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.hud-center.warn { color: var(--amber2); }
.hud-center.bad { color: var(--red); }
.hud-center.good { color: var(--green); }
.hud-coach { position: absolute; left: 50%; bottom: calc(7.2rem + var(--safe-b)); transform: translateX(-50%); max-width: min(40rem, 70vw); padding: 0.55rem 1.1rem; border-radius: 999px; background: rgba(10, 13, 17, 0.72); border: 1px solid var(--line2); font-size: 0.98rem; text-align: center; opacity: 0; transition: opacity 0.3s; backdrop-filter: blur(6px); }
.hud-coach.show { opacity: 1; }
.hud-coach .step { color: var(--amber2); font-family: var(--cond); font-weight: 600; letter-spacing: 0.06em; margin-right: 0.4rem; }
.hud-captions { position: absolute; left: 50%; bottom: calc(10.5rem + var(--safe-b)); transform: translateX(-50%); padding: 0.25rem 0.8rem; background: rgba(0,0,0,0.75); border-radius: 6px; font-size: 0.95rem; opacity: 0; transition: opacity 0.2s; }
.hud-captions.show { opacity: 1; }
.hud-interact { position: absolute; left: 50%; top: 58%; transform: translateX(-50%); display: none; align-items: center; gap: 0.6rem; padding: 0.55rem 1rem; border-radius: 12px; background: rgba(10,13,17,0.82); border: 1px solid var(--amber); font-size: 0.95rem; pointer-events: auto; }
.hud-interact.show { display: flex; }
.hud-interact .key { font-family: var(--cond); font-weight: 700; color: #111; background: var(--amber); padding: 0.1rem 0.5rem; border-radius: 5px; }
.hud-interact .key:empty { display: none; }
/* a second action on the same prompt (on foot at the car: "[I] Load / unload") */
.hud-interact { max-width: 94vw; flex-wrap: wrap; justify-content: center; row-gap: 0.3rem; }
.hud-interact .txt2:empty { display: none; }
/* two actions: one row each, the keys in a column ("[E] Open the boot" over "[I] Load / unload") */
.hud-interact.two.show { display: grid; grid-template-columns: auto auto; justify-items: start; column-gap: 0.6rem; }
.hud-interact.two .key { justify-self: center; }
.hud-interact .txt2 { color: #ffd9a3; }
/* in the car on desktop the prompt sits over the windscreen, not over the centre console (it hid the parking-brake lever and swallowed clicks on it) */
body:not(.touch-device) .hud:not(.on-foot) .hud-interact { top: 22%; }
/* quick-action radial menu (RMB hold / F1 / pad View / touch ◎) */
.qm { position: fixed; inset: 0; z-index: 16; display: none; pointer-events: none; font-family: var(--cond); --qm-r: 7.4rem; }
.qm.open { display: block; animation: qm-in 0.14s ease-out; }
@keyframes qm-in { from { opacity: 0; } to { opacity: 1; } }
.qm::before { content: ''; position: absolute; left: 50%; top: 50%; width: calc(var(--qm-r) * 2 + 7rem); height: calc(var(--qm-r) * 2 + 7rem); transform: translate(-50%, -50%); border-radius: 50%; background: radial-gradient(circle, rgba(8, 10, 13, 0.8) 0 52%, rgba(8, 10, 13, 0.45) 66%, rgba(8, 10, 13, 0) 72%); }
.qm-ring { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
.qm-item { position: absolute; left: 0; top: 0; width: 3.75rem; height: 3.75rem; padding: 0; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.08rem; border: 1px solid rgba(236, 232, 225, 0.18); background: radial-gradient(circle at 50% 35%, #2a2f36, #14171b); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 3px 10px rgba(0, 0, 0, 0.5); color: #d9d5cc; cursor: pointer; pointer-events: auto; font-family: var(--cond); touch-action: manipulation; --led: transparent; transition: border-color 0.1s, box-shadow 0.1s, background 0.1s; }
.qm-item .ico { width: 1.35rem; height: 1.35rem; flex: none; }
.qm-item.grp { width: 4.3rem; height: 4.3rem; }
.qm-item.grp .ico { width: 1.6rem; height: 1.6rem; }
.qm-item.sel, .qm-item:hover { border-color: var(--amber); background: radial-gradient(circle at 50% 35%, #3a3326, #1b1812); color: #fff; box-shadow: 0 0 0 3px rgba(232, 162, 58, 0.35), 0 0 18px rgba(232, 162, 58, 0.45); }
.qm-item.on { border-color: var(--led); }
.qm-item.on .ico { filter: drop-shadow(0 0 3px var(--led)); }
.qm-item.na { opacity: 0.4; }
.qm-led { position: absolute; top: 0.32rem; width: 0.8rem; height: 0.14rem; border-radius: 1px; background: transparent; }
.qm-item.on .qm-led { background: var(--led); box-shadow: 0 0 5px var(--led); }
.qm-lbl { font-size: 0.56rem; font-weight: 700; letter-spacing: 0.05em; line-height: 1; white-space: nowrap; max-width: 92%; overflow: hidden; text-overflow: ellipsis; }
.qm-val { font-size: 0.52rem; line-height: 1; color: var(--amber2); min-height: 0.52rem; white-space: nowrap; }
.qm-num { position: absolute; top: -0.35rem; left: -0.2rem; min-width: 1.05rem; padding: 0 0.2rem; border-radius: 999px; background: var(--amber); color: #15110a; font-size: 0.62rem; font-weight: 700; line-height: 1.05rem; text-align: center; border: 0; }
.qm-key { position: absolute; bottom: -0.45rem; left: 50%; transform: translateX(-50%); padding: 0 0.25rem; border-radius: 3px; font-size: 0.55rem; line-height: 1.2; color: var(--ink2); background: rgba(0, 0, 0, 0.75); border: 1px solid var(--line2); white-space: nowrap; }
.qm-centre { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: calc(var(--qm-r) * 2 - 5.2rem); height: calc(var(--qm-r) * 2 - 5.2rem); max-width: 10rem; max-height: 10rem; border-radius: 50%; display: grid; place-content: center; gap: 0.2rem; padding: 0.6rem; text-align: center; pointer-events: auto; background: rgba(12, 15, 19, 0.9); border: 1px solid var(--line2); cursor: pointer; }
.qm-title { font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; font-size: 0.72rem; color: var(--amber2); }
.qm-name { font-family: var(--font); font-size: 0.78rem; line-height: 1.2; color: var(--ink); min-height: 1.9em; }
.qm-hint { font-family: var(--font); font-size: 0.62rem; line-height: 1.25; color: var(--muted); }
.qm.touch .qm-item { width: 3.3rem; height: 3.3rem; }
.qm.touch .qm-item.grp { width: 3.7rem; height: 3.7rem; }
.qm.touch .qm-centre { width: 7.4rem; height: 7.4rem; }
/* cockpit switch under the cursor: ring + name + shortcut */
.cp-hover { position: absolute; left: 0; top: 0; display: none; pointer-events: none; z-index: 2; }
.cp-hover.show { display: block; }
.cp-ring { position: absolute; left: 0; top: 0; width: 32px; height: 32px; transform: translate(-50%, -50%); border-radius: 50%; border: 2px solid var(--amber); box-shadow: 0 0 10px rgba(232, 162, 58, 0.65), inset 0 0 8px rgba(232, 162, 58, 0.35); }
.cp-tip { position: absolute; left: 0; top: 0; display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.2rem 0.55rem; border-radius: 7px; background: rgba(8, 10, 13, 0.88); border: 1px solid var(--line2); font-family: var(--cond); font-size: 0.85rem; letter-spacing: 0.04em; white-space: nowrap; }
.cp-tip kbd { font-family: var(--cond); font-weight: 700; font-size: 0.75rem; color: #15110a; background: var(--amber); border-radius: 4px; padding: 0 0.3rem; border: 0; }
/* FASTag wallet card (near toll plazas) */
.hud-fastag { display: none; align-items: center; flex-wrap: wrap; gap: 0.3rem 0.5rem; margin-top: 0.45rem; padding: 0.35rem 0.7rem 0.35rem 0.5rem; width: max-content; max-width: 100%; border-radius: 10px; background: rgba(10, 13, 17, 0.78); border: 1px solid rgba(30, 158, 87, 0.75); font-size: 0.9rem; text-shadow: none; }
.hud-fastag.show { display: flex; }
.hud-fastag.low { border-color: rgba(255, 90, 67, 0.8); }
.hud-fastag .ft-chip { width: 1.1rem; height: 0.8rem; border-radius: 3px; background: linear-gradient(135deg, #1e9e57 0 55%, #f2f2f2 55% 70%, #1e9e57 70%); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35); }
.hud-fastag b { font-family: var(--cond); letter-spacing: 0.08em; color: #6fe39b; }
.hud-fastag .ft-bal { font-family: var(--cond); font-weight: 700; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.hud-fastag .ft-delta { font-family: var(--cond); font-weight: 700; font-size: 1.05rem; opacity: 0; transition: opacity 0.25s; }
.hud-fastag .ft-delta.show { opacity: 1; }
.hud-fastag .ft-delta.good { color: var(--amber2); }
.hud-fastag .ft-delta.bad { color: #ff8b7a; }
.hud-fastag .ft-note { flex-basis: 100%; font-size: 0.78rem; color: var(--ink2); }
.hud-fastag .ft-note:empty { display: none; }
body.touch-device .hud-fastag { font-size: 0.75rem; padding: 0.25rem 0.5rem; margin-top: 0.3rem; }
.hud-map-wrap { position: absolute; left: calc(1rem + var(--safe-l)); bottom: calc(1rem + var(--safe-b)); width: 12.5rem; height: 12.5rem; border-radius: 50%; overflow: visible; display: none; }
.hud-map-wrap.show { display: block; }
.hud-map { width: 100%; height: 100%; border-radius: 50%; border: 2px solid var(--line2); box-shadow: 0 4px 24px rgba(0,0,0,0.5); background: #101418; }
.hud-limit { position: absolute; right: -0.4rem; top: -0.2rem; width: 3rem; height: 3rem; border-radius: 50%; background: #f6f4ee; border: 0.38rem solid #c4161c; display: none; place-items: center; color: #111; font-family: var(--cond); font-weight: 700; font-size: 1.1rem; box-shadow: 0 2px 10px rgba(0,0,0,0.5); }
.hud-limit.show { display: grid; }
.hud-limit.speeding { animation: limit-flash 0.6s ease-in-out infinite; }
@keyframes limit-flash { 50% { transform: scale(1.12); box-shadow: 0 0 0 6px rgba(255,90,67,0.35); } }
.hud-street { position: absolute; left: 50%; bottom: -1.5rem; transform: translateX(-50%); white-space: nowrap; font-family: var(--cond); letter-spacing: 0.08em; font-size: 0.85rem; color: var(--ink2); text-shadow: 0 1px 4px #000; }
.hud-dash { position: absolute; right: calc(1rem + var(--safe-r)); bottom: calc(1rem + var(--safe-b)); width: 19rem; padding: 0.7rem 0.9rem 0.6rem; border-radius: 16px; background: linear-gradient(160deg, rgba(14,18,23,0.86), rgba(8,10,13,0.86)); border: 1px solid var(--line); display: none; backdrop-filter: blur(6px); }
.hud-dash.show { display: block; }
.hud-dash.minimal { width: 13.5rem; padding: 0.5rem 0.7rem; }
.hud-dash.minimal .hud-bars, .hud-dash.minimal .hud-pedals { display: none; }
.hud-rpm { position: relative; height: 7px; border-radius: 4px; background: rgba(255,255,255,0.08); overflow: hidden; }
.hud-rpm-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--teal), var(--amber2)); transition: width 0.05s linear; }
.hud-rpm-fill.red { background: linear-gradient(90deg, var(--amber2), var(--red)); }
.hud-rpm-red { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--red); }
.hud-main { display: flex; align-items: flex-end; justify-content: space-between; margin-top: 0.35rem; }
.hud-speed .v { font-family: var(--cond); font-weight: 700; font-size: 3rem; line-height: 0.9; font-variant-numeric: tabular-nums; }
.hud-dash.minimal .hud-speed .v { font-size: 2.2rem; }
.hud-speed .u { margin-left: 0.3rem; color: var(--muted); font-size: 0.8rem; }
.hud-gear { font-family: var(--cond); font-weight: 700; font-size: 2.6rem; line-height: 0.9; min-width: 2.6rem; text-align: center; padding: 0.1rem 0.4rem; border: 2px solid var(--line2); border-radius: 10px; }
.hud-gear.grind { color: var(--red); border-color: var(--red); }
.hud-lamps { display: flex; gap: 0.3rem; margin-top: 0.45rem; flex-wrap: wrap; font-family: var(--cond); font-size: 0.72rem; letter-spacing: 0.04em; }
.hud-lamps span { padding: 0.05rem 0.35rem; border-radius: 4px; color: rgba(255,255,255,0.2); border: 1px solid rgba(255,255,255,0.08); }
.hud-lamps span.on { color: #0b0d10; background: var(--green); border-color: var(--green); }
.hud-lamps span[data-l='high'].on { background: #4b86ff; border-color: #4b86ff; }
.hud-lamps span[data-l='abs'].on, .hud-lamps span[data-l='tcs'].on, .hud-lamps span[data-l='hand'].on, .hud-lamps span[data-l='eng'].on { background: var(--amber); border-color: var(--amber); }
.hud-bars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; margin-top: 0.5rem; }
.hud-bars .bar label { display: block; font-size: 0.62rem; letter-spacing: 0.12em; color: var(--muted); }
.hud-bars .bar div { height: 4px; border-radius: 2px; background: rgba(255,255,255,0.08); overflow: hidden; }
.hud-bars .bar i { display: block; height: 100%; background: var(--ink2); }
.hud-bars .bar i.warn { background: var(--red); }
.hud-pedals { position: absolute; right: -0.9rem; top: 0.7rem; bottom: 0.7rem; width: 0.55rem; display: flex; gap: 2px; align-items: flex-end; transform: translateX(100%); }
.hud-pedals i { flex: 1; background: var(--teal); border-radius: 2px; min-height: 1px; }
.hud-pedals i.b { background: var(--red); }
.hud-pedals i.t { background: var(--green); }
.hud-guides { position: absolute; inset: 0; width: 100%; height: 100%; display: none; }
.hud-guides.show { display: block; }
.hud-fps { position: absolute; top: calc(0.4rem + var(--safe-t)); left: 50%; transform: translateX(-50%); font-family: var(--cond); color: var(--muted); font-size: 0.8rem; }
.hud.hud-off .hud-top-left, .hud.hud-off .hud-map-wrap { display: none; }

/* ---------- touch controls ---------- */
#touch { position: fixed; inset: 0; z-index: 12; pointer-events: none; display: none; --tc-opacity: 0.85; }
#touch.visible { display: block; }
#touch.editing { z-index: 55; }
.tc { position: absolute; transform: translate(-50%, -50%) scale(var(--s, 1)); pointer-events: auto; opacity: var(--tc-opacity); touch-action: none; }
.tc.hidden-ctl { display: none !important; }
#touch.editing .tc { outline: 2px dashed var(--amber); outline-offset: 6px; opacity: 1; }
#touch.editing .tc.hidden-ctl { display: block !important; opacity: 0.25; }
.tc-label { position: absolute; left: 50%; bottom: -1.3rem; transform: translateX(-50%); font-family: var(--cond); font-size: 0.7rem; letter-spacing: 0.2em; color: rgba(255,255,255,0.6); white-space: nowrap; pointer-events: none; }
.tc-wheel { width: min(36vh, 11rem); height: min(36vh, 11rem); }
.tc-wheel svg { width: 100%; height: 100%; }
.tc-wheel .rim { fill: none; stroke: rgba(236,232,225,0.85); stroke-width: 14; }
.tc-wheel .rim-inner { fill: rgba(10,13,17,0.35); stroke: none; }
.tc-wheel .spoke { fill: none; stroke: rgba(236,232,225,0.7); stroke-width: 12; stroke-linejoin: round; }
.tc-wheel .hub { fill: rgba(20,24,30,0.9); stroke: rgba(236,232,225,0.6); stroke-width: 3; }
.tc-wheel .mark { fill: var(--amber); }
.tc-slider { width: 34vw; height: 4.5rem; }
.tc-slider .track { position: absolute; inset: 0; border-radius: 999px; background: rgba(10,13,17,0.5); border: 2px solid rgba(236,232,225,0.4); }
.tc-slider .thumb { position: absolute; left: 50%; top: 50%; width: 3.6rem; height: 3.6rem; margin: -1.8rem 0 0 -1.8rem; border-radius: 50%; background: rgba(236,232,225,0.85); }
.tc-pedal { width: min(15vh, 5.2rem); height: min(42vh, 12.5rem); border-radius: 16px; background: rgba(10,13,17,0.55); border: 2px solid rgba(236,232,225,0.45); overflow: hidden; }
.tc-pedal .fill { position: absolute; left: 0; right: 0; top: 0; height: 0; background: rgba(236,232,225,0.25); }
.tc-throttle .fill { background: rgba(74, 208, 122, 0.45); }
.tc-brake .fill { background: rgba(255, 90, 67, 0.45); }
.tc-clutch .fill { background: rgba(63, 208, 201, 0.45); }
.tc-pedal .grip { position: absolute; inset: 0.6rem; border-radius: 10px; background: repeating-linear-gradient(0deg, rgba(255,255,255,0.08) 0 4px, transparent 4px 12px); pointer-events: none; }
.tc-pedal .tc-label { bottom: auto; top: 0.4rem; color: rgba(255,255,255,0.85); }
.tc-pedal .val { position: absolute; bottom: 0.4rem; left: 0; right: 0; text-align: center; font-family: var(--cond); font-size: 0.85rem; color: rgba(255,255,255,0.8); pointer-events: none; }
.tc-pedal .bite { position: absolute; left: 0; right: 0; height: 2px; background: var(--amber); pointer-events: none; }
.tc-shifter { width: min(40vh, 13rem); height: min(28vh, 9.2rem); border-radius: 14px; background: rgba(10,13,17,0.55); border: 2px solid rgba(236,232,225,0.35); }
.tc-shifter .gate { position: absolute; inset: 0; width: 100%; height: 100%; }
.tc-shifter .gate path { fill: none; stroke: rgba(236,232,225,0.35); stroke-width: 16; stroke-linecap: round; stroke-linejoin: round; }
.tc-shifter .gate text { fill: rgba(236,232,225,0.75); font-family: var(--cond); font-weight: 700; font-size: 26px; text-anchor: middle; }
.tc-shifter .knob { position: absolute; width: 2.7rem; height: 2.7rem; margin: -1.35rem 0 0 -1.35rem; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #4b525c, #15181d); border: 2px solid var(--amber); display: grid; place-items: center; font-family: var(--cond); font-weight: 700; font-size: 1.1rem; color: var(--amber2); pointer-events: none; box-shadow: 0 4px 12px rgba(0,0,0,0.6); }
.tc-simple { display: grid; grid-template-columns: repeat(4, 3rem); gap: 0.35rem; }
.tc-simple button, .tc-bar button { min-height: 2.7rem; border-radius: 10px; border: 1px solid rgba(236,232,225,0.4); background: rgba(10,13,17,0.6); font-family: var(--cond); font-weight: 700; letter-spacing: 0.05em; color: var(--ink); touch-action: none; }
.tc-simple button:active, .tc-bar button:active { background: var(--amber); color: #111; }
.tc-handbrake { width: 3.4rem; height: min(30vh, 8rem); border-radius: 12px; background: rgba(10,13,17,0.55); border: 2px solid rgba(236,232,225,0.4); --hb: 0; }
.tc-handbrake .lever { position: absolute; left: 50%; top: 0.5rem; width: 1.1rem; height: 40%; margin-left: -0.55rem; border-radius: 0.55rem; background: rgba(236,232,225,0.8); transform: translateY(calc(var(--hb) * 120%)); }
.tc-pbrake { position: absolute; left: 50%; bottom: calc(100% + 0.45rem); transform: translateX(-50%); width: 4.4rem; min-height: 2.7rem; padding: 0.2rem 0.25rem; display: flex; align-items: center; justify-content: center; gap: 0.25rem; border-radius: 10px; border: 1.5px solid rgba(236,232,225,0.5); background: rgba(10,13,17,0.65); color: var(--ink); font-family: var(--cond); font-weight: 700; font-size: 0.62rem; line-height: 1.05; letter-spacing: 0.06em; text-align: left; touch-action: none; }
.tc-pbrake b { font-size: 0.8rem; letter-spacing: 0; color: rgba(255,120,100,0.9); }
.tc-pbrake.on { background: rgba(214,40,28,0.88); border-color: #ff8a70; color: #fff; box-shadow: 0 0 12px rgba(255,60,40,0.55); }
.tc-pbrake.on b { color: #fff; }
.tc-bar { display: flex; gap: 0.3rem; transform: translate(-50%, 0) scale(var(--s, 1)); top: calc(0.5rem + var(--safe-t)) !important; }
.tc-bar button { min-width: 2.9rem; padding: 0 0.55rem; font-size: 0.85rem; }
.tc-bar button.start { color: var(--amber2); border-color: var(--amber); }
.tc-editor { position: absolute; inset: auto 0 0 0; display: grid; place-items: center; pointer-events: auto; z-index: 3; }
.tc-editor-panel { margin-bottom: 1rem; width: min(30rem, 92vw); padding: 0.9rem 1rem; border-radius: 14px; background: var(--panel-solid); border: 1px solid var(--line2); }
.tc-editor-title { font-family: var(--cond); font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.tc-editor-panel p { color: var(--muted); font-size: 0.85rem; margin: 0.3rem 0 0.6rem; }
.tc-editor-list .row { display: grid; grid-template-columns: 2.4rem 1fr 9rem; gap: 0.5rem; align-items: center; padding: 0.2rem 0; }
.tc-editor-list .eye { min-height: 2rem; border-radius: 8px; border: 1px solid var(--line2); background: transparent; }
.tc-editor-actions { display: flex; gap: 0.5rem; justify-content: flex-end; margin-top: 0.6rem; }
.tc-editor-actions button { min-height: 2.4rem; padding: 0 1rem; border-radius: 9px; border: 1px solid var(--line2); background: transparent; font-family: var(--cond); font-weight: 700; letter-spacing: 0.06em; }
.tc-editor-actions .primary { background: var(--amber); color: #111; border-color: var(--amber); }

/* graphics reset notice */
.gpu-reset { position: fixed; inset: 0; z-index: 90; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.8rem; padding: 2rem; background: var(--bg); text-align: center; }
.gpu-reset b { font-family: var(--cond); font-size: 1.6rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--amber2); }
.gpu-reset span { max-width: 34rem; color: var(--ink2); line-height: 1.5; }

/* rotate overlay (touch devices in portrait while driving) */
#rotate { position: fixed; inset: 0; z-index: 70; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 1.2rem; background: #0b0e12; text-align: center; padding: 2rem; }
#rotate p { font-family: var(--cond); letter-spacing: 0.12em; font-size: 1.2rem; }
.rot-phone { width: 3.2rem; height: 5.4rem; border: 3px solid var(--ink); border-radius: 10px; animation: rot 2s ease-in-out infinite; }
@keyframes rot { 0%, 30% { transform: rotate(0); } 60%, 100% { transform: rotate(-90deg); } }
@media (orientation: portrait) { body.touch-device #rotate { display: flex; } }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .two-col, .drive-grid { grid-template-columns: 1fr; }
  .main-menu { grid-template-columns: 1fr; background: linear-gradient(90deg, rgba(7,9,12,0.94), rgba(7,9,12,0.55)); }
  .chip { min-width: 0; }
  .g-spec { display: none; }
}
@media (max-height: 520px) {
  :root { font-size: calc(13px * var(--ui-scale)); }
  .main-menu { padding: 0.8rem 1.2rem; grid-template-rows: auto 1fr auto; }
  .menu-item .mi-label { font-size: 1.15rem; }
  .menu-item { padding: 0.25rem 0.7rem; }
  .menu-item:hover .mi-sub, .menu-item:focus-visible .mi-sub { max-height: 0; }
  .logo { font-size: 2rem; }
  .menu-foot .car-tag { display: none; }
  .hud-map-wrap { width: 8.5rem; height: 8.5rem; }
  .hud-dash { width: 15rem; }
  .hud-coach { bottom: calc(5rem + var(--safe-b)); font-size: 0.85rem; }
  .scr-head h2 { font-size: 1.5rem; }
  .screen { padding-top: 0.6rem; }
}
/* ---------- documents: RC book, driving licence, FASTag ---------- */
.rc-card { position: relative; margin: 0.6rem 0 1rem; padding: 0.9rem 1rem 0.7rem; border-radius: 14px; color: #14212e; background: radial-gradient(120% 90% at 85% 0%, rgba(255,255,255,0.9), rgba(255,255,255,0) 60%), repeating-linear-gradient(135deg, rgba(31,79,163,0.05) 0 6px, rgba(31,79,163,0) 6px 12px), linear-gradient(135deg, #e8f1fb, #cfe0f2 55%, #e7eef5); box-shadow: 0 8px 24px rgba(0,0,0,0.35), inset 0 0 0 1px rgba(255,255,255,0.6); max-width: 34rem; }
.rc-card.dl { background: radial-gradient(120% 90% at 85% 0%, rgba(255,255,255,0.9), rgba(255,255,255,0) 60%), repeating-linear-gradient(45deg, rgba(160,60,40,0.05) 0 6px, rgba(160,60,40,0) 6px 12px), linear-gradient(135deg, #fbf1e6, #f0dcc5 55%, #f6ece0); }
.rc-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.6rem; }
.rc-state { font-size: 0.72rem; letter-spacing: 0.14em; font-weight: 700; color: #1f4fa3; }
.rc-card.dl .rc-state { color: #9a3b1d; }
.rc-title { font-family: var(--cond); font-size: 1.15rem; font-weight: 700; letter-spacing: 0.06em; }
.rc-badge { width: 2.4rem; height: 2.4rem; border-radius: 50%; display: grid; place-items: center; font-family: var(--cond); font-weight: 800; color: #fff; background: linear-gradient(135deg, #1f4fa3, #0f2d66); }
.rc-card.dl .rc-badge { background: linear-gradient(135deg, #b8512a, #7a2d12); }
.rc-reg { margin: 0.5rem 0 0.4rem; display: inline-block; padding: 0.15rem 0.7rem; border: 2px solid #111; border-radius: 6px; background: #fbfbf7; font-family: var(--cond); font-size: 1.5rem; font-weight: 800; letter-spacing: 0.08em; color: #111; }
.rc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.35rem 0.9rem; }
.doc-f { display: flex; flex-direction: column; min-width: 0; }
.doc-f span { font-size: 0.62rem; letter-spacing: 0.08em; text-transform: uppercase; color: #4c5b6b; }
.doc-f b { font-size: 0.86rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-foot { margin-top: 0.55rem; font-size: 0.6rem; letter-spacing: 0.12em; color: #5d6b79; text-align: right; }
.dl-body { display: flex; gap: 0.8rem; margin-top: 0.5rem; }
.dl-photo { flex: none; width: 4.2rem; height: 5.2rem; border-radius: 8px; background: radial-gradient(circle at 50% 36%, #8a96a3 0 22%, transparent 23%), radial-gradient(ellipse at 50% 100%, #8a96a3 0 45%, transparent 46%), #d6dde4; }
.docs .ok { color: #3fbf6f; }
.docs .bad { color: #ff6b5b; }
.fastag-card { margin: 0.5rem 0; padding: 0.8rem 1rem; border-radius: 12px; background: linear-gradient(135deg, #0f3a2c, #145c43); border: 1px solid rgba(255,255,255,0.12); max-width: 26rem; }
.ft-head { display: flex; justify-content: space-between; align-items: center; letter-spacing: 0.12em; font-size: 0.8rem; }
.ft-bal { font-family: var(--cond); font-size: 2rem; font-weight: 700; margin: 0.2rem 0; }
.ft-meta { font-size: 0.75rem; color: rgba(255,255,255,0.7); }
.docs input[type=text] { min-width: 10rem; font-family: var(--cond); font-size: 1.05rem; letter-spacing: 0.06em; text-transform: uppercase; }
@media (max-width: 560px) { .rc-grid { grid-template-columns: minmax(0, 1fr); } }
/* ---------- phones & tablets (body.touch-device only; desktop layout above is unchanged) ----------
   Bottom row: the touch controls. Top centre: switch bar. Top left: mode / objective.
   Top right: compact speed + gear with the map under it. Prompts sit just under the bar. */
/* blurring the moving 3D view behind a panel is re-done every frame — very costly on phone GPUs */
body.touch-device *, body.touch-device *::before, body.touch-device *::after { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
/* keep controls out of notches / rounded corners */
body.touch-device #touch { left: var(--safe-l); right: var(--safe-r); }
/* per-frame updates inside a control or the dash must not re-lay-out the whole page */
body.touch-device .tc, body.touch-device .hud-dash { contain: layout style; }
body.touch-device .tc-bar { gap: 0.25rem; }
body.touch-device .tc-pedal .tc-label { letter-spacing: 0.08em; font-size: 0.62rem; }
body.touch-device .tc-bar button { min-width: 2.5rem; min-height: 2.4rem; padding: 0 0.45rem; font-size: 0.78rem; white-space: nowrap; }
body.touch-device .hud-top-left { top: calc(0.45rem + var(--safe-t)); left: calc(0.6rem + var(--safe-l)); max-width: 7.4rem; }
body.touch-device .hud-mode { font-size: 0.78rem; letter-spacing: 0.1em; }
body.touch-device .hud-objective { font-size: 0.78rem; line-height: 1.25; }
body.touch-device .hud-timer { font-size: 1.05rem; }
body.touch-device .hud-dash { top: calc(0.45rem + var(--safe-t)); right: calc(0.5rem + var(--safe-r)); bottom: auto; left: auto; transform: none; width: 7.2rem; padding: 0.35rem 0.5rem 0.4rem; border-radius: 12px; background: rgba(8, 10, 13, 0.78); }
body.touch-device .hud-dash .hud-bars, body.touch-device .hud-dash .hud-pedals { display: none; }
body.touch-device .hud-dash .hud-rpm { height: 4px; }
body.touch-device .hud-dash .hud-main { margin-top: 0.2rem; align-items: center; }
body.touch-device .hud-dash .hud-speed .v { font-size: 1.7rem; }
body.touch-device .hud-dash .hud-speed .u { font-size: 0.65rem; margin-left: 0.15rem; }
body.touch-device .hud-dash .hud-gear { font-size: 1.5rem; min-width: 1.9rem; padding: 0.05rem 0.25rem; border-radius: 8px; }
/* only lit warning / indicator lamps, in one short row */
/* fixed-height lamp row: blinking indicators must not make the dash (and the map under it) jump */
body.touch-device .hud-dash .hud-lamps { margin-top: 0.25rem; gap: 0.2rem; font-size: 0.6rem; height: 1rem; overflow: hidden; flex-wrap: nowrap; }
body.touch-device .hud-dash .hud-lamps span:not(.on) { display: none; }
body.touch-device .hud-map-wrap { left: auto; right: calc(0.7rem + var(--safe-r)); top: calc(5.3rem + var(--safe-t)); bottom: auto; transform: none; width: 4.6rem; height: 4.6rem; }
body.touch-device .hud-map-wrap .hud-street { display: none; }
body.touch-device .hud-map { border-width: 1px; }
body.touch-device .hud-limit { width: 1.9rem; height: 1.9rem; border-width: 0.25rem; font-size: 0.72rem; right: auto; left: -1rem; top: -0.3rem; }
body.touch-device .hud-coach { top: calc(3.4rem + var(--safe-t)); bottom: auto; max-width: min(26rem, 52vw); padding: 0.3rem 0.8rem; font-size: 0.78rem; background: rgba(8, 10, 13, 0.8); }
body.touch-device .hud-toasts { top: calc(5.6rem + var(--safe-t)); right: auto; left: 50%; transform: translateX(-50%); align-items: center; max-width: min(26rem, 52vw); }
body.touch-device .hud-toasts .toast { text-align: center; font-size: 0.78rem; padding: 0.35rem 0.8rem; }
body.touch-device .hud-captions { top: calc(7.6rem + var(--safe-t)); bottom: auto; font-size: 0.78rem; }
body.touch-device .hud-interact { top: 36%; font-size: 0.82rem; padding: 0.4rem 0.8rem; }
body.touch-device .hud-center { top: 42%; font-size: clamp(1.6rem, 6vw, 2.8rem); }
/* slider steering: keep it on screen and clear of the clutch */
body.touch-device .tc-slider { width: 22vw; height: 3.6rem; }
body.touch-device .tc-slider .thumb { width: 2.8rem; height: 2.8rem; margin: -1.4rem 0 0 -1.4rem; }
/* narrow phones: slimmer switch bar so it clears the mode text and the speed readout */
@media (max-width: 700px) {
  body.touch-device .tc-bar { gap: 0.15rem; }
  body.touch-device .tc-bar button { min-width: 2.1rem; min-height: 2.2rem; padding: 0 0.3rem; font-size: 0.68rem; }
  body.touch-device .hud-top-left { max-width: 6.2rem; }
  body.touch-device .hud-dash { width: 6.4rem; }
}

/* ---------- dashboard switch panel (src/ui/dashboard.js) ----------
   PC: optional overlay (Tab / pause menu). Phones: a sheet under the switch bar, one group per tab. */
.dash-panel { position: fixed; z-index: 15; top: calc(3.4rem + var(--safe-t)); left: 50%; transform: translateX(-50%); width: min(66rem, 94vw); max-height: calc(100vh - 14rem); max-height: calc(100dvh - 14rem); overflow-y: auto; overscroll-behavior: contain; display: none; padding: 0.55rem 0.75rem 0.7rem; border-radius: 16px; background: linear-gradient(170deg, rgba(20, 24, 30, 0.94), rgba(9, 11, 14, 0.94)); border: 1px solid var(--line2); box-shadow: 0 10px 40px rgba(0, 0, 0, 0.55); font-family: var(--cond); touch-action: manipulation; pointer-events: auto; }
.dash-panel.open { display: block; animation: dp-in 0.18s ease; }
@keyframes dp-in { from { opacity: 0; transform: translate(-50%, -6px); } to { opacity: 1; transform: translate(-50%, 0); } }
.dp-head { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.35rem; }
.dp-title { display: inline-flex; align-items: center; gap: 0.35rem; font-weight: 700; letter-spacing: 0.16em; font-size: 0.82rem; color: var(--amber2); }
.dp-title .ico { width: 1rem; height: 1rem; }
.dp-msg { flex: 1; min-width: 0; text-align: center; font-family: var(--font); font-size: 0.8rem; color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dp-msg.warn { color: var(--amber2); }
.dp-msg.bad { color: #ffb3a8; }
.dp-msg.good { color: var(--green); }
.dp-hint { font-size: 0.72rem; letter-spacing: 0.08em; color: var(--muted); white-space: nowrap; }
.dp-close { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 8px; border: 1px solid var(--line2); background: transparent; color: var(--ink2); cursor: pointer; padding: 0; }
.dp-close .ico { width: 1.1rem; height: 1.1rem; }
.dp-tabs { display: none; }
.dp-groups { display: flex; flex-wrap: wrap; gap: 0.45rem 1rem; }
.dp-group { flex: 0 0 auto; }
.dp-group h4 { margin: 0 0 0.25rem; font-size: 0.66rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.dp-grid { display: grid; grid-template-columns: repeat(var(--cols, 3), 3.85rem); gap: 0.3rem; }
.dp-btn { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 0.1rem; height: 3.7rem; padding: 0.42rem 0.15rem 0.2rem; border-radius: 10px; border: 1px solid rgba(236, 232, 225, 0.14); background: linear-gradient(180deg, #23272d, #15181c); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 2px 0 rgba(0, 0, 0, 0.45); color: #d9d5cc; cursor: pointer; font-family: var(--cond); transition: transform 0.06s, border-color 0.15s, background 0.15s; --led: transparent; }
.dp-btn:hover { border-color: rgba(236, 232, 225, 0.34); }
.dp-btn.pressed, .dp-btn:active { transform: translateY(1.5px); box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.6); }
.dp-btn .ico { width: 1.45rem; height: 1.45rem; flex: none; }
.dp-btn.on { border-color: var(--led); background: linear-gradient(180deg, #282d33, #181b20); color: #fff; }
.dp-btn.on .ico { filter: drop-shadow(0 0 3px var(--led)); }
.dp-btn.na { opacity: 0.38; }
.dp-led { position: absolute; top: 0.22rem; left: 50%; width: 0.9rem; height: 0.16rem; margin-left: -0.45rem; border-radius: 1px; background: #30343a; }
.dp-btn.on .dp-led { background: var(--led); box-shadow: 0 0 6px var(--led); }
.dp-lbl { font-size: 0.6rem; font-weight: 700; letter-spacing: 0.05em; line-height: 1; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.dp-val { font-size: 0.58rem; line-height: 1; color: var(--amber2); min-height: 0.58rem; white-space: nowrap; }
.dp-key { position: absolute; top: 0.12rem; right: 0.18rem; min-width: 0; padding: 0 0.2rem; border-width: 1px; border-radius: 3px; font-size: 0.55rem; line-height: 1.25; color: var(--muted); background: rgba(0, 0, 0, 0.25); }
.dp-key:empty { display: none; }
.dp-btn.hold .dp-lbl::after { content: ' \25CF'; font-size: 0.45rem; vertical-align: middle; color: var(--muted); }
/* hover label for the 3D cockpit switches */
.hud-prompt { position: absolute; left: 50%; top: 62%; transform: translateX(-50%); padding: 0.3rem 0.8rem; border-radius: 8px; background: rgba(8, 10, 13, 0.82); border: 1px solid var(--line2); font-family: var(--cond); letter-spacing: 0.05em; font-size: 0.92rem; opacity: 0; transition: opacity 0.15s; pointer-events: none; white-space: nowrap; }
.hud-prompt.show { opacity: 1; }
/* cruise / limiter / hold / drive-mode lamps */
.hud-lamps span[data-l='cruise'].on, .hud-lamps span[data-l='hold'].on { background: var(--green); border-color: var(--green); }
.hud-lamps span[data-l='lim'].on { background: var(--amber); border-color: var(--amber); }
.hud-lamps span[data-l='mode'].on { background: var(--teal); border-color: var(--teal); }
.hud-lamps span:empty, .hud-lamps span[data-l='cruise']:not(.on), .hud-lamps span[data-l='lim']:not(.on), .hud-lamps span[data-l='hold']:not(.on), .hud-lamps span[data-l='mode']:not(.on) { display: none; }
.tc-bar button.dash { display: inline-grid; place-items: center; color: var(--amber2); }
.tc-bar button.dash .ico { width: 1.15rem; height: 1.15rem; }
/* phones: sheet under the switch bar, clear of the pedals (bottom row) */
body.touch-device .dash-panel { top: calc(3.4rem + var(--safe-t)); width: min(40rem, 64vw); max-height: calc(49vh - 3.4rem); max-height: calc(49dvh - 3.4rem); padding: 0.35rem 0.5rem 0.45rem; border-radius: 12px; background: rgba(12, 15, 19, 0.96); }
body.touch-device .dp-head { margin-bottom: 0.25rem; }
body.touch-device .dp-title { font-size: 0.7rem; }
body.touch-device .dp-title .ico { display: none; }
body.touch-device .dp-hint { display: none; }
body.touch-device .dp-close { width: 1.9rem; height: 1.7rem; }
body.touch-device .dp-tabs { display: flex; gap: 0.2rem; margin-bottom: 0.3rem; overflow-x: auto; scrollbar-width: none; }
body.touch-device .dp-tab { flex: 1 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: 0.2rem; min-height: 1.9rem; padding: 0 0.4rem; border-radius: 8px; border: 1px solid rgba(236, 232, 225, 0.16); background: rgba(255, 255, 255, 0.04); color: var(--ink2); font-family: var(--cond); font-weight: 700; font-size: 0.62rem; letter-spacing: 0.06em; text-transform: uppercase; }
body.touch-device .dp-tab .ico { width: 1rem; height: 1rem; }
body.touch-device .dp-tab.on { background: var(--amber); border-color: var(--amber); color: #15110a; }
body.touch-device .dp-group { display: none; flex: 1 1 100%; }
body.touch-device .dp-group.cur { display: block; }
body.touch-device .dp-group h4 { display: none; }
body.touch-device .dp-grid { grid-template-columns: repeat(auto-fill, minmax(3.5rem, 1fr)); gap: 0.25rem; }
body.touch-device .dp-btn { height: 3.35rem; padding-top: 0.38rem; }
body.touch-device .dp-btn .ico { width: 1.3rem; height: 1.3rem; }
@media (max-width: 700px) {
  body.touch-device .dp-tab span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
.warn-text { color: var(--amber); margin: 0 0 0.4rem; }

/* ---------- on foot (game/onfoot.js, ui/walkhud.js, ui/shop.js) ---------- */
.hud.on-foot .hud-dash, .hud.on-foot .hud-limit, .hud.on-foot .hud-coach, .hud.on-foot .hud-guides, .hud.on-foot .cp-hover { display: none !important; }
.walk-ui { position: absolute; inset: 0; display: none; pointer-events: none; font-family: var(--cond); }
.walk-ui.show { display: block; }
.walk-look { position: absolute; inset: 0; display: none; pointer-events: none; touch-action: none; }
.walk-ui.touch .walk-look { display: block; pointer-events: auto; }
.walk-stick { position: absolute; width: 7.2rem; height: 7.2rem; margin: -3.6rem 0 0 -3.6rem; border-radius: 50%; border: 2px solid rgba(236, 232, 225, 0.35); background: radial-gradient(circle, rgba(10, 13, 17, 0.25), rgba(10, 13, 17, 0.55)); display: none; }
.walk-stick.on { display: block; }
.walk-stick i { position: absolute; left: 50%; top: 50%; width: 3rem; height: 3rem; border-radius: 50%; transform: translate(-50%, -50%); background: radial-gradient(circle at 40% 35%, #f2efe6, #b9b4aa); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5); }
.walk-top { position: absolute; top: calc(4.6rem + var(--safe-t)); left: calc(1rem + var(--safe-l)); display: flex; gap: 0.5rem; align-items: center; pointer-events: none; }
.walk-money { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.3rem 0.8rem 0.3rem 0.35rem; border-radius: 999px; background: rgba(10, 13, 17, 0.8); border: 1px solid var(--line2); font-weight: 700; font-size: 1.15rem; letter-spacing: 0.03em; }
.walk-money .ico { display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--amber); color: #15110a; font-size: 0.95rem; }
.walk-btn { pointer-events: auto; display: inline-flex; align-items: center; gap: 0.35rem; min-height: 2.4rem; padding: 0.25rem 0.8rem; border-radius: 999px; border: 1px solid var(--line2); background: rgba(10, 13, 17, 0.8); color: var(--ink); font-family: var(--cond); font-weight: 700; letter-spacing: 0.08em; font-size: 0.85rem; cursor: pointer; touch-action: manipulation; }
.walk-btn:hover { border-color: var(--amber); }
.walk-btn svg { color: var(--amber2); }
.walk-hint { position: absolute; left: 50%; bottom: calc(5.2rem + var(--safe-b)); transform: translateX(-50%); padding: 0.4rem 1rem; border-radius: 999px; background: rgba(10, 13, 17, 0.72); border: 1px solid var(--line2); font-family: var(--font); font-size: 0.9rem; display: none; white-space: nowrap; }
.walk-hint.show { display: block; }
.walk-car { position: absolute; left: 50%; top: calc(0.8rem + var(--safe-t)); transform: translateX(-50%); display: none; align-items: center; gap: 0.4rem; padding: 0.2rem 0.75rem; border-radius: 999px; background: rgba(10, 13, 17, 0.7); border: 1px solid rgba(63, 208, 201, 0.55); color: var(--teal); font-weight: 700; font-size: 0.9rem; letter-spacing: 0.05em; }
.walk-car.show { display: inline-flex; }
.walk-car .arrow { display: inline-block; font-size: 0.8rem; transition: transform 0.15s linear; }
.walk-car .d::before { content: 'CAR · '; color: var(--ink2); }
.walk-pad { position: absolute; right: calc(1rem + var(--safe-r)); bottom: calc(1rem + var(--safe-b)); display: none; gap: 0.6rem; align-items: flex-end; pointer-events: none; }
.walk-ui.touch .walk-pad { display: flex; }
.walk-ui.touch .walk-pad .walk-btn { flex-direction: column; justify-content: center; gap: 0.1rem; width: 4.1rem; height: 4.1rem; padding: 0; border-radius: 50%; font-size: 0.66rem; background: rgba(10, 13, 17, 0.62); }
.walk-ui.touch .walk-pad .walk-pause { width: 2.8rem; height: 2.8rem; font-size: 0.9rem; }
.walk-ui.touch .walk-run.on { background: rgba(232, 162, 58, 0.85); color: #15110a; border-color: var(--amber); }
.walk-ui.touch .walk-run.on svg { color: #15110a; }
.walk-act, .walk-enter { display: none !important; }
.walk-ui.touch .walk-act.show, .walk-ui.touch .walk-enter.show { display: flex !important; }
.walk-ui.touch .walk-act { width: 5rem !important; height: 5rem !important; background: rgba(232, 162, 58, 0.9) !important; color: #15110a !important; border-color: var(--amber) !important; font-size: 0.9rem !important; }
.walk-ui.touch .walk-enter { background: rgba(63, 208, 201, 0.85) !important; color: #071615 !important; border-color: var(--teal) !important; }
.walk-ui.touch .walk-enter svg { color: #071615; }
body.touch-device .walk-top { top: calc(0.45rem + var(--safe-t)); left: calc(8.2rem + var(--safe-l)); }
body.touch-device .walk-money { font-size: 0.95rem; }
body.touch-device .walk-car { top: auto; bottom: calc(0.6rem + var(--safe-b)); }
body.touch-device .hud.on-foot .hud-map-wrap { top: calc(0.5rem + var(--safe-t)); width: 6.4rem; height: 6.4rem; }
body.touch-device .hud.on-foot .hud-toasts { top: calc(3.4rem + var(--safe-t)); }
.hud.on-foot .hud-interact { top: 62%; }
body.touch-device .hud.on-foot .hud-interact { top: 30%; }
/* shop counter + bag */
.shop-panel { position: fixed; inset: 0; z-index: 18; display: none; place-items: center; background: rgba(4, 6, 8, 0.35); font-family: var(--font); touch-action: manipulation; }
.shop-panel.open { display: grid; animation: sp-fade 0.16s ease; }
@keyframes sp-fade { from { opacity: 0; } to { opacity: 1; } }
.sp-card { width: min(36rem, 94vw); max-height: min(88vh, 46rem); max-height: min(88dvh, 46rem); overflow-y: auto; overscroll-behavior: contain; padding: 0.8rem 0.9rem 0.7rem; border-radius: 16px; background: linear-gradient(170deg, rgba(22, 26, 33, 0.97), rgba(10, 12, 15, 0.97)); border: 1px solid var(--line2); box-shadow: 0 14px 50px rgba(0, 0, 0, 0.6); }
.sp-head { display: flex; align-items: center; gap: 0.6rem; }
.sp-title { flex: 1; display: flex; flex-direction: column; line-height: 1.15; }
.sp-title b { font-family: var(--cond); font-size: 1.3rem; letter-spacing: 0.04em; text-transform: uppercase; }
.sp-title .ta, .sp-name .ta { color: var(--amber2); font-family: 'Noto Sans Tamil', 'Latha', 'Nirmala UI', var(--font); font-size: 0.85rem; }
.sp-wallet { padding: 0.25rem 0.75rem; border-radius: 999px; background: rgba(232, 162, 58, 0.14); border: 1px solid rgba(232, 162, 58, 0.5); color: var(--amber2); font-family: var(--cond); font-weight: 700; font-size: 1.05rem; }
.sp-greet { margin: 0.45rem 0 0.55rem; color: var(--ink2); font-style: italic; font-size: 0.92rem; }
.sp-list { display: flex; flex-direction: column; gap: 0.35rem; }
.sp-row { display: grid; grid-template-columns: 2.6rem 1fr auto auto; align-items: center; gap: 0.6rem; padding: 0.45rem 0.55rem; border-radius: 12px; background: rgba(255, 255, 255, 0.035); border: 1px solid rgba(236, 232, 225, 0.08); }
.sp-row.sel { border-color: var(--amber); background: rgba(232, 162, 58, 0.08); }
.sp-row.fitted { border-color: rgba(74, 208, 122, 0.45); }
.sp-ico { display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 10px; background: rgba(255, 255, 255, 0.06); color: var(--amber2); }
.sp-name { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.sp-name b { font-size: 0.98rem; }
.sp-name small { color: var(--muted); font-size: 0.78rem; }
.sp-name em { color: var(--teal); font-style: normal; font-size: 0.76rem; }
.sp-price { font-family: var(--cond); font-weight: 700; font-size: 1.1rem; color: var(--ink); white-space: nowrap; }
.sp-msg { margin-top: 0.2rem; font-size: 0.8rem; color: var(--green); }
.sp-msg.no { color: #ffb3a8; }
.sp-foot { margin-top: 0.6rem; color: var(--muted); font-size: 0.8rem; text-align: center; }
.sp-sec { margin: 0.8rem 0 0.3rem; font-family: var(--cond); font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; font-size: 0.78rem; color: var(--ink2); }
.sp-car, .sp-log { margin: 0; padding-left: 1.1rem; font-size: 0.88rem; line-height: 1.5; }
.sp-car .muted { color: var(--muted); list-style: none; margin-left: -1.1rem; }
.sp-log span { color: var(--muted); margin-left: 0.4rem; }
.sp-empty { color: var(--muted); font-size: 0.88rem; padding: 0.4rem 0.2rem; }
body.touch-device .sp-card { width: min(34rem, 80vw); max-height: 92vh; max-height: 92dvh; padding: 0.55rem 0.65rem; }
body.touch-device .sp-row { padding: 0.32rem 0.45rem; grid-template-columns: 2.2rem 1fr auto auto; }
body.touch-device .sp-ico { width: 2.2rem; height: 2.2rem; }
body.touch-device .sp-name small { display: none; }
body.touch-device .sp-greet { margin: 0.25rem 0 0.35rem; font-size: 0.8rem; }
body.touch-device .sp-row .btn { min-height: 2.5rem; min-width: 4.2rem; }
/* the put in / take out picker at the car (ui/cargopanel.js) */
.sp-row.cg { cursor: pointer; }
.sp-row.cg.dis { opacity: 0.72; cursor: default; }
.sp-row.cg.dis .sp-ico { color: var(--muted); }
.sp-name em.cg-why { color: #ffb3a8; }
.sp-row.cg-slot .btn, .sp-row.cg-back .btn { min-width: 3rem; }
.sp-row.cg-info { background: transparent; border-style: dashed; }
.sp-card.cargo .sp-msg { text-align: center; }
.sp-msg.ok { color: var(--green); }
body.touch-device .sp-card.cargo .sp-name small { display: block; }
/* docked to the right, the scene not dimmed: the seat / boot / engine bay being loaded stays in view */
.shop-panel.cargo { background: transparent; place-items: center end; padding-right: max(1.2rem, env(safe-area-inset-right)); }
.shop-panel.cargo .sp-card { width: min(31rem, 44vw); transition: opacity 0.25s ease, transform 0.25s ease; }
body.touch-device .shop-panel.cargo .sp-card { width: min(30rem, 50vw); }
.sp-card.cargo.pouring { opacity: 0; transform: translateX(40%); pointer-events: none; }

/* ---------- full-screen city map (ui/bigmap.js) ---------- */
.bigmap { position: fixed; inset: 0; z-index: 30; display: none; background: #10151b; color: var(--ink); font-family: var(--font); touch-action: none; overflow: hidden; }
.bigmap.open { display: block; }
.bigmap button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.bigmap svg { display: block; flex: none; }
.bm-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
.bm-canvas.drag { cursor: grabbing; }
.bm-panel { position: absolute; left: calc(0.85rem + var(--safe-l)); top: calc(0.85rem + var(--safe-t)); bottom: calc(0.85rem + var(--safe-b)); width: 23rem; display: flex; flex-direction: column; border-radius: 18px; background: rgba(15, 19, 25, 0.96); border: 1px solid var(--line); box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55); overflow: hidden; backdrop-filter: blur(12px); touch-action: pan-y; }
.bm-grab { display: none; }
.bm-head { padding: 1rem 1.15rem 0.2rem; }
.bm-town b { display: block; font-family: var(--cond); font-weight: 700; font-size: 1.55rem; letter-spacing: 0.05em; line-height: 1.05; text-transform: uppercase; }
.bm-town span { display: block; margin-top: 0.1rem; font-family: 'Noto Sans Tamil', 'Latha', 'Nirmala UI', var(--font); color: var(--muted); font-size: 0.82rem; }
.bm-search { margin: 0.65rem 0.9rem 0.2rem; display: flex; align-items: center; gap: 0.6rem; padding: 0 0.35rem 0 0.95rem; height: 2.85rem; border-radius: 999px; background: #1c222a; border: 1px solid var(--line2); color: var(--muted); flex-shrink: 0; transition: border-color 0.15s, box-shadow 0.15s; }
.bm-search:focus-within { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(63, 208, 201, 0.16); color: var(--teal); }
.bm-search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 1rem; user-select: text; -webkit-user-select: text; }
.bm-search input::placeholder { color: var(--muted); }
.bm-search input::-webkit-search-cancel-button { display: none; }
.bm-clear { display: none; width: 2.1rem; height: 2.1rem; padding: 0; border-radius: 50%; border: 0; background: transparent; place-items: center; color: var(--ink2); }
.bm-clear:hover { background: rgba(255, 255, 255, 0.08); }
.bm-panel.typing .bm-clear { display: grid; }
.bm-chips { display: flex; gap: 0.4rem; padding: 0.6rem 0.9rem 0.75rem; overflow-x: auto; scrollbar-width: none; flex-shrink: 0; border-bottom: 1px solid var(--line); touch-action: pan-x; }
.bm-chips::-webkit-scrollbar { display: none; }
.bigmap:not(.sheet) .bm-chips { flex-wrap: wrap; overflow: visible; }
.bm-chip { flex: none; display: inline-flex; align-items: center; gap: 0.42rem; height: 2.05rem; padding: 0 0.85rem; border-radius: 999px; border: 1px solid var(--line2); background: rgba(255, 255, 255, 0.035); font-size: 0.84rem; font-weight: 600; color: var(--ink2); white-space: nowrap; }
.bm-chip i { width: 0.62rem; height: 0.62rem; border-radius: 50%; }
.bm-chip:hover { border-color: rgba(236, 232, 225, 0.4); }
.bm-chip.on { background: var(--ink); color: #11151a; border-color: var(--ink); }
.bm-panel.typing .bm-chips { display: none; }
.bm-list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0.4rem 0.45rem 0.9rem; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.15) transparent; }
.bm-row { width: 100%; display: flex; align-items: center; gap: 0.8rem; padding: 0.58rem 0.65rem; border: 0; border-radius: 12px; background: transparent; text-align: left; }
.bm-row:hover, .bm-row:focus-visible { background: rgba(255, 255, 255, 0.06); outline: none; }
.bm-row.going { background: rgba(63, 208, 201, 0.1); }
.bm-ico { flex: none; width: 2.35rem; height: 2.35rem; border-radius: 50%; display: grid; place-items: center; background: var(--c); color: #fff; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.2), 0 2px 8px rgba(0, 0, 0, 0.35); }
.bm-ico.big { width: 3.3rem; height: 3.3rem; }
.bm-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.06rem; line-height: 1.2; }
.bm-txt b { font-weight: 600; font-size: 0.98rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bm-txt i { font-style: normal; font-family: 'Noto Sans Tamil', 'Latha', 'Nirmala UI', var(--font); font-size: 0.78rem; color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bm-txt small { font-size: 0.78rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bm-dist { flex: none; display: inline-flex; gap: 0.3rem; align-items: center; font-family: var(--cond); font-weight: 600; font-size: 0.98rem; color: var(--ink2); font-variant-numeric: tabular-nums; }
.bm-row.going .bm-dist { color: var(--teal); }
.bm-empty { display: grid; justify-items: center; gap: 0.35rem; padding: 2.4rem 1rem; color: var(--muted); text-align: center; font-size: 0.9rem; }
.bm-empty b { color: var(--ink2); font-size: 1rem; }
/* place card */
.bm-card { display: none; flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0.3rem 1.15rem 1.2rem; }
.bm-panel[data-view='card'] .bm-card { display: block; }
.bm-panel[data-view='card'] .bm-list, .bm-panel[data-view='card'] .bm-chips { display: none; }
.bm-back { display: inline-flex; align-items: center; gap: 0.15rem; margin: 0.4rem 0 0.7rem -0.45rem; padding: 0.3rem 0.7rem 0.3rem 0.3rem; border: 0; border-radius: 999px; background: transparent; color: var(--teal); font-weight: 600; font-size: 0.92rem; }
.bm-back:hover { background: rgba(63, 208, 201, 0.1); }
.bm-card-head { display: flex; gap: 0.95rem; align-items: center; }
.bm-card-head h3 { margin: 0; font-size: 1.4rem; font-weight: 700; line-height: 1.15; }
.bm-card-head .ta { margin: 0.18rem 0 0; font-family: 'Noto Sans Tamil', 'Latha', 'Nirmala UI', var(--font); color: var(--ink2); font-size: 0.95rem; }
.bm-card-head .kind { margin: 0.12rem 0 0; color: var(--muted); font-size: 0.86rem; }
.bm-addr { display: flex; align-items: center; gap: 0.4rem; margin: 0.85rem 0 0; color: var(--ink2); font-size: 0.9rem; }
.bm-addr svg { color: var(--muted); }
.bm-addr i { font-style: normal; font-family: 'Noto Sans Tamil', 'Latha', 'Nirmala UI', var(--font); font-size: 0.85rem; color: var(--muted); }
.bm-addr + .bm-meta { margin-top: 0.35rem; }
.bm-meta { display: flex; align-items: center; gap: 0.32rem; flex-wrap: wrap; margin: 0.95rem 0 0; color: var(--ink2); font-size: 0.95rem; }
.bm-meta .mi { margin-left: 0.2rem; color: var(--teal); }
.bm-going { margin: 0.65rem 0 0; color: var(--teal); font-weight: 600; display: flex; gap: 0.45rem; align-items: center; font-size: 0.92rem; }
.bm-actions { display: flex; gap: 0.55rem; margin: 1.05rem 0 0.35rem; flex-wrap: wrap; }
.bm-btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; height: 3.1rem; padding: 0 1.2rem; border-radius: 999px; border: 1px solid var(--line2); background: rgba(255, 255, 255, 0.05); font-weight: 700; font-size: 1rem; letter-spacing: 0.01em; transition: filter 0.12s, background 0.12s, transform 0.08s; }
.bm-btn:active { transform: scale(0.98); }
.bm-btn.primary { flex: 1; min-width: 10rem; border: 0; background: linear-gradient(180deg, #52e3db, #27b5ae); color: #052021; box-shadow: 0 8px 22px rgba(63, 208, 201, 0.28); }
.bm-btn.primary:hover { filter: brightness(1.07); }
.bm-btn.danger { border-color: rgba(255, 90, 67, 0.55); color: #ffa497; background: rgba(255, 90, 67, 0.1); }
.bm-btn.ghost:hover { background: rgba(255, 255, 255, 0.1); }
.bm-note { flex-basis: 100%; display: flex; gap: 0.45rem; align-items: center; margin: 0 0 0.3rem; color: var(--ink2); font-size: 0.92rem; }
.bm-do { margin: 1rem 0 0; padding: 0.95rem 0 0; list-style: none; border-top: 1px solid var(--line); display: grid; gap: 0.6rem; }
.bm-do li { position: relative; padding-left: 1.15rem; color: var(--ink2); font-size: 0.92rem; line-height: 1.38; }
.bm-do li::before { content: ''; position: absolute; left: 0.1rem; top: 0.5em; width: 0.42rem; height: 0.42rem; border-radius: 50%; background: var(--teal); opacity: 0.75; }
/* active route bar */
.bm-route { position: absolute; top: calc(0.85rem + var(--safe-t)); left: calc(24.7rem + var(--safe-l)); right: calc(4.6rem + var(--safe-r)); margin: 0 auto; max-width: 34rem; display: none; align-items: center; gap: 0.7rem; padding: 0.5rem 0.5rem 0.5rem 0.6rem; border-radius: 16px; background: linear-gradient(180deg, rgba(14, 78, 73, 0.97), rgba(9, 56, 53, 0.97)); border: 1px solid rgba(63, 208, 201, 0.45); box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5); }
.bm-route.show { display: flex; }
.bm-r-ico { flex: none; width: 2.65rem; height: 2.65rem; border-radius: 12px; display: grid; place-items: center; background: rgba(63, 208, 201, 0.24); color: #c8fbf6; }
.bm-r-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.bm-r-txt b { font-size: 1.02rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bm-r-txt small { color: #b9ece7; font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bm-r-btn { flex: none; width: 2.55rem; height: 2.55rem; padding: 0; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.2); background: rgba(255, 255, 255, 0.07); display: grid; place-items: center; }
.bm-r-btn:hover { background: rgba(255, 255, 255, 0.14); }
.bm-r-end { flex: none; height: 2.55rem; padding: 0 1.1rem; border-radius: 999px; border: 0; background: #e2493a; color: #fff; font-weight: 700; }
.bm-r-end:hover { filter: brightness(1.08); }
/* close, compass, map controls, scale, hint, toast */
.bm-close { position: absolute; top: calc(0.85rem + var(--safe-t)); right: calc(0.85rem + var(--safe-r)); width: 3.1rem; height: 3.1rem; padding: 0; border-radius: 50%; border: 1px solid var(--line2); background: rgba(15, 19, 25, 0.94); display: grid; place-items: center; box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45); }
.bm-close:hover { background: #232a33; }
.bm-compass { position: absolute; top: calc(4.65rem + var(--safe-t)); right: calc(1.1rem + var(--safe-r)); width: 2.6rem; height: 2.6rem; border-radius: 50%; background: rgba(15, 19, 25, 0.94); border: 1px solid var(--line2); display: grid; place-items: center; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4); pointer-events: none; }
.bm-compass svg { width: 2.4rem; height: 2.4rem; }
.bm-compass .ring { fill: none; stroke: none; }
.bm-compass .n { fill: #ff5a43; }
.bm-compass .s { fill: #aab2bc; }
.bm-compass .t { fill: #ece8e1; font: 700 8px 'Barlow Condensed', 'Arial Narrow', sans-serif; text-anchor: middle; display: none; }
.bm-ctrls { position: absolute; right: calc(0.85rem + var(--safe-r)); bottom: calc(0.85rem + var(--safe-b)); display: flex; flex-direction: column; gap: 0.5rem; align-items: center; }
.bm-ctrls > button, .bm-zoom { width: 3.1rem; border-radius: 14px; border: 1px solid var(--line2); background: rgba(15, 19, 25, 0.94); box-shadow: 0 8px 22px rgba(0, 0, 0, 0.42); color: var(--ink); }
.bm-ctrls > button { height: 3.1rem; padding: 0; display: grid; place-items: center; }
.bm-ctrls > button[aria-pressed='true'] { color: var(--teal); border-color: rgba(63, 208, 201, 0.6); background: rgba(16, 52, 52, 0.95); }
.bm-ctrls button:hover { background: #232a33; }
.bm-ctrls [data-c='locate'] { color: #2ec7ff; }
.bm-zoom { display: flex; flex-direction: column; overflow: hidden; }
.bm-zoom button { height: 3.1rem; padding: 0; border: 0; background: transparent; display: grid; place-items: center; }
.bm-zoom button + button { border-top: 1px solid var(--line); }
.bm-scale { position: absolute; right: calc(4.75rem + var(--safe-r)); bottom: calc(1rem + var(--safe-b)); display: flex; flex-direction: column; align-items: flex-end; gap: 0.12rem; pointer-events: none; font-family: var(--cond); font-weight: 700; font-size: 0.85rem; letter-spacing: 0.03em; color: #dfe3e8; text-shadow: 0 1px 3px #000, 0 0 6px #000; }
.bm-scale i { display: block; height: 7px; border: 2px solid #dfe3e8; border-top: 0; border-radius: 0 0 2px 2px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.7); }
.bm-hint { position: absolute; left: calc(24.7rem + var(--safe-l)); bottom: calc(0.95rem + var(--safe-b)); max-width: calc(100% - 37rem); padding: 0.32rem 0.8rem; border-radius: 999px; background: rgba(10, 13, 17, 0.74); color: var(--muted); font-size: 0.78rem; pointer-events: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bm-toast { position: absolute; left: 50%; bottom: calc(4.4rem + var(--safe-b)); transform: translate(-50%, 0.5rem); padding: 0.62rem 1.1rem; border-radius: 999px; background: #eef1f4; color: #0f1418; font-weight: 600; font-size: 0.92rem; box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5); opacity: 0; transition: opacity 0.18s, transform 0.18s; pointer-events: none; white-space: nowrap; }
.bm-toast.show { opacity: 1; transform: translate(-50%, 0); }
/* phones & small windows: the panel is a bottom sheet (bottom-left in landscape, full width in portrait) */
.bigmap.sheet .bm-panel { top: auto; bottom: 0; left: calc(0.5rem + var(--safe-l)); width: min(calc(100% - 1rem), 23rem); height: 7.6rem; border-radius: 18px 18px 0 0; border-bottom: 0; padding-bottom: var(--safe-b); transition: height 0.22s ease; }
.bigmap.sheet .bm-panel[data-sheet='open'] { height: calc(100% - 0.7rem - var(--safe-t)); }
.bigmap.sheet .bm-panel[data-sheet='card'] { height: auto; max-height: calc(100% - 0.7rem - var(--safe-t)); }
.bigmap.sheet .bm-panel[data-sheet='peek'] .bm-list { display: none; }
.bigmap.sheet .bm-panel[data-sheet='peek'] .bm-chips { border-bottom: 0; }
.bigmap.sheet .bm-grab { display: block; flex-shrink: 0; padding: 0.5rem 0 0.2rem; cursor: grab; touch-action: none; }
.bigmap.sheet .bm-grab i { display: block; margin: 0 auto; width: 2.7rem; height: 0.3rem; border-radius: 999px; background: rgba(255, 255, 255, 0.3); }
.bigmap.sheet .bm-head { display: none; }
.bigmap.sheet .bm-search { margin-top: 0.2rem; height: 2.65rem; }
.bigmap.sheet .bm-chips { padding: 0.5rem 0.9rem 0.6rem; }
.bigmap.sheet .bm-card { padding-top: 0; }
.bigmap.sheet .bm-card-head h3 { font-size: 1.22rem; }
.bigmap.sheet .bm-do { margin-top: 0.75rem; padding-top: 0.7rem; }
.bigmap.sheet .bm-actions { margin-top: 0.8rem; }
.bigmap.sheet .bm-hint { display: none; }
.bigmap.sheet .bm-route { left: calc(24.2rem + var(--safe-l)); right: calc(4.3rem + var(--safe-r)); top: calc(0.55rem + var(--safe-t)); padding: 0.35rem 0.4rem 0.35rem 0.45rem; }
.bigmap.sheet .bm-r-ico { width: 2.3rem; height: 2.3rem; }
.bigmap.sheet .bm-close { top: calc(0.55rem + var(--safe-t)); right: calc(0.55rem + var(--safe-r)); width: 2.9rem; height: 2.9rem; }
.bigmap.sheet .bm-compass { top: calc(3.95rem + var(--safe-t)); right: calc(0.7rem + var(--safe-r)); width: 2.4rem; height: 2.4rem; }
.bigmap.sheet .bm-ctrls { right: calc(0.55rem + var(--safe-r)); bottom: calc(0.55rem + var(--safe-b)); gap: 0.38rem; }
.bigmap.sheet .bm-ctrls > button, .bigmap.sheet .bm-zoom { width: 2.8rem; border-radius: 12px; }
.bigmap.sheet .bm-ctrls > button, .bigmap.sheet .bm-zoom button { height: 2.8rem; }
.bigmap.sheet .bm-scale { right: calc(4rem + var(--safe-r)); bottom: calc(0.75rem + var(--safe-b)); }
.bigmap.sheet .bm-toast { bottom: auto; top: calc(4rem + var(--safe-t)); }
@media (max-width: 560px) {
  /* portrait: the sheet spans the width and slides over the map buttons; the ✕ (and the route bar) stay above it */
  .bigmap.sheet .bm-panel { left: 0; width: 100%; z-index: 2; }
  .bigmap.sheet .bm-panel[data-sheet='open'] { height: calc(100% - 4.1rem - var(--safe-t)); }
  .bigmap.sheet .bm-panel[data-sheet='card'] { max-height: calc(100% - 4.1rem - var(--safe-t)); }
  .bigmap.sheet .bm-route { left: calc(0.55rem + var(--safe-l)); right: calc(4rem + var(--safe-r)); }
  .bigmap.sheet .bm-ctrls { bottom: calc(8.3rem + var(--safe-b)); }
  .bigmap.sheet .bm-scale { bottom: calc(8.5rem + var(--safe-b)); }
}
/* the map works in portrait too: no "turn your phone" cover while it is open */
body.bigmap-open #rotate { display: none !important; }
/* ways in: the HUD map, the switch bar, the walk HUD, the quick menu, the switch panel */
.hud-map-wrap { pointer-events: auto; cursor: pointer; }
.hud-map-open { position: absolute; right: 8%; bottom: 8%; width: 1.9rem; height: 1.9rem; border-radius: 50%; display: grid; place-items: center; background: rgba(10, 13, 17, 0.86); border: 1px solid var(--line2); color: var(--ink); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5); opacity: 0.8; transition: opacity 0.15s, transform 0.15s; }
.hud-map-wrap:hover .hud-map-open { opacity: 1; transform: scale(1.08); }
.hud-map-wrap:hover .hud-map { border-color: rgba(63, 208, 201, 0.7); }
body.touch-device .hud-map-open { width: 1.15rem; height: 1.15rem; right: -2%; bottom: -2%; }
body.touch-device .hud-map-open svg { width: 0.7rem; height: 0.7rem; }
.tc-bar button.map { display: inline-flex; gap: 0.25rem; align-items: center; color: var(--teal); border-color: rgba(63, 208, 201, 0.65); }
.tc-bar button.map span { font-size: 0.72rem; letter-spacing: 0.06em; }
.qm-item.direct { width: 4.3rem; height: 4.3rem; border-color: rgba(63, 208, 201, 0.6); color: #bdf3ee; }
.qm-item.direct .ico { width: 1.6rem; height: 1.6rem; }
.qm.touch .qm-item.direct { width: 3.7rem; height: 3.7rem; }
.dp-map { display: inline-flex; align-items: center; gap: 0.3rem; height: 2rem; padding: 0 0.65rem; border-radius: 8px; border: 1px solid rgba(63, 208, 201, 0.6); background: rgba(63, 208, 201, 0.08); color: var(--teal); font-family: var(--cond); font-weight: 700; letter-spacing: 0.08em; cursor: pointer; }
.dp-map .ico { width: 1.1rem; height: 1.1rem; }
body.touch-device .dp-map { height: 1.7rem; }
.walk-btn.walk-map svg { color: var(--teal); }
/* at a door / the boot the BAG button loads the car (LOAD), at the bonnet it checks the fluids (CHECK) */
.walk-btn.walk-bag.load { border-color: var(--amber); background: rgba(232, 162, 58, 0.22); box-shadow: 0 0 0.9rem rgba(232, 162, 58, 0.55); color: #ffe2b0; }
.walk-btn.walk-bag.load svg { color: var(--amber); }
.walk-nav { position: absolute; left: 50%; top: calc(3.2rem + var(--safe-t)); transform: translateX(-50%); display: none; align-items: center; gap: 0.55rem; max-width: min(28rem, 70vw); padding: 0.3rem 0.95rem 0.3rem 0.4rem; border-radius: 999px; background: rgba(9, 56, 53, 0.9); border: 1px solid rgba(63, 208, 201, 0.6); color: #dffaf7; }
.walk-nav.show { display: inline-flex; }
.walk-nav .arrow { flex: none; display: grid; place-items: center; width: 1.9rem; height: 1.9rem; border-radius: 50%; background: var(--teal); color: #052021; font-size: 0.85rem; transition: transform 0.15s linear; }
.walk-nav .t { display: flex; gap: 0.5rem; align-items: baseline; min-width: 0; }
.walk-nav b { font-family: var(--font); font-weight: 600; font-size: 0.92rem; letter-spacing: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.walk-nav i { font-style: normal; font-weight: 700; font-size: 1rem; color: var(--teal); white-space: nowrap; }
body.touch-device .walk-nav { top: auto; bottom: calc(2.9rem + var(--safe-b)); }

/* cockpit: back to the driving view (shown only when the view is turned or zoomed) */
.hud-viewreset { position: absolute; left: 50%; top: calc(0.8rem + var(--safe-t, 0px)); transform: translateX(-50%); display: none; align-items: center; gap: 0.4rem; padding: 0.4rem 0.95rem; border-radius: 999px; border: 1px solid var(--amber); background: rgba(10, 13, 17, 0.82); color: var(--ink, #ece8e1); font-family: var(--cond); font-weight: 700; font-size: 0.95rem; letter-spacing: 0.05em; cursor: pointer; pointer-events: auto; z-index: 5; }
.hud-viewreset.show { display: inline-flex; }
/* the SEAT BELT chip (ui/challan.js) shares the top centre: the button steps down below it */
#hud:has(.hud-belt.show) .hud-viewreset { top: calc(2.35rem + var(--safe-t, 0px)); }
.hud-viewreset b { color: var(--amber2); font-size: 1.1rem; }
.hud-viewreset:hover { background: rgba(232, 162, 58, 0.9); color: #15110a; }
.hud-viewreset:hover b { color: #15110a; }
.hud-viewreset .z { color: var(--ink2, #b9b4aa); font-weight: 600; }
/* touch screens: the switch bar holds the top centre — the button sits top left, under the mode / place text */
body.touch-device .hud-viewreset, body.touch-device #hud:has(.hud-belt.show) .hud-viewreset { left: calc(0.6rem + var(--safe-l, 0px)); top: calc(4.6rem + var(--safe-t, 0px)); transform: none; padding: 0.3rem 0.7rem; font-size: 0.8rem; }

/* ---------- phone controller ---------- */
/* pairing panel (src/input/remote.js): QR + code, usable from the menu, garage and pause screens */
.remote-panel { position: fixed; inset: 0; z-index: 58; display: none; place-items: center; padding: 1rem; background: rgba(4, 6, 8, 0.6); backdrop-filter: blur(3px); font-family: var(--font); touch-action: manipulation; }
.remote-panel.open { display: grid; }
.rp-card { width: min(44rem, 96vw); max-height: 94vh; max-height: 94dvh; overflow-y: auto; padding: 0.8rem 1rem 1rem; border-radius: 16px; background: linear-gradient(170deg, rgba(20, 24, 30, 0.97), rgba(9, 11, 14, 0.97)); border: 1px solid var(--line2); box-shadow: 0 10px 40px rgba(0, 0, 0, 0.55); color: var(--ink); }
.rp-head { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; margin-bottom: 0.6rem; }
.rp-title { font-family: var(--cond); font-weight: 700; letter-spacing: 0.14em; font-size: 1.05rem; color: var(--amber2); }
.rp-close { min-width: 2.4rem; }
.rp-body { display: grid; grid-template-columns: auto 1fr; gap: 1.2rem; align-items: center; }
.rp-qr { display: grid; place-items: center; padding: 0.6rem; border-radius: 12px; background: #fff; }
.rp-qr canvas { display: block; width: 240px; height: 240px; image-rendering: pixelated; }
.rp-qr canvas.empty { opacity: 0.25; }
.rp-info { display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; }
.rp-lead { color: var(--muted); font-size: 0.9rem; }
.rp-url { font-family: var(--cond); font-weight: 600; font-size: 1.25rem; color: var(--teal); word-break: break-all; user-select: all; }
.rp-code { font-family: var(--cond); font-weight: 700; font-size: 3.6rem; line-height: 1; letter-spacing: 0.12em; color: var(--amber2); margin: 0.15rem 0 0.35rem; user-select: all; font-variant-numeric: tabular-nums; }
.rp-status { display: flex; align-items: center; gap: 0.5rem; font-family: var(--cond); font-size: 1.05rem; color: var(--ink2); }
.rp-dot { width: 0.7rem; height: 0.7rem; border-radius: 50%; background: var(--muted); box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.08); }
.rp-dot.connecting { background: var(--amber); }
.rp-dot.waiting { background: var(--amber2); animation: rp-blink 1.2s ease-in-out infinite; }
.rp-dot.paired { background: var(--green); box-shadow: 0 0 8px var(--green); }
.rp-dot.p2p { background: var(--teal); box-shadow: 0 0 8px var(--teal); }
.rp-dot.offline { background: var(--red); }
@keyframes rp-blink { 50% { opacity: 0.35; } }
.rp-hint { margin-top: 0.4rem; color: var(--muted); font-size: 0.8rem; line-height: 1.4; }
.rp-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.5rem; margin-top: 0.9rem; }
.rp-foot .btn[disabled] { opacity: 0.45; pointer-events: none; }
@media (max-width: 640px), (max-height: 420px) {
  .rp-body { grid-template-columns: 1fr; justify-items: center; text-align: center; gap: 0.6rem; }
  .rp-qr canvas { width: 180px; height: 180px; }
  .rp-code { font-size: 2.6rem; }
  .rp-card { padding: 0.6rem 0.8rem 0.8rem; }
}
/* HUD latency badge while a phone is paired */
.remote-badge { position: absolute; right: calc(0.8rem + var(--safe-r, 0px)); top: calc(3.2rem + var(--safe-t, 0px)); display: none; padding: 0.2rem 0.6rem; border-radius: 999px; border: 1px solid var(--line2); background: rgba(10, 13, 17, 0.72); color: var(--ink2); font-family: var(--cond); font-size: 0.85rem; letter-spacing: 0.04em; pointer-events: none; z-index: 4; }
.remote-badge.show { display: inline-block; }
.remote-badge.p2p { border-color: rgba(63, 208, 201, 0.5); color: var(--teal); }
.hud-off .remote-badge { display: none; }
