:root {
  --bg: #000; --fg: #fff; --accent: #9b5de5; --muted: #8e8e93;
  --font: "Nunito", ui-rounded, -apple-system, BlinkMacSystemFont, "SF Pro Rounded", "Segoe UI", Roboto, sans-serif;
  --line: rgba(255, 255, 255, .12);
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
/* Wie eine normale Seite aufgebaut (nicht „overflow:hidden“ auf dem ganzen Dokument): iOS stellt solche Seiten bildschirmfüllend
   dar, auch unter Status- und Navigationsleiste. Ein versehentliches Wischen der Seite fängt app.js ab. */
html { margin: 0; background: #1b1b1b; overflow: auto; overscroll-behavior: none; }
body { margin: 0; position: relative; height: 100vh; overflow: hidden; background: #1b1b1b; color: var(--fg); font-family: var(--font); font-weight: 700; overscroll-behavior: none; -webkit-user-select: none; user-select: none; }
[hidden] { display: none !important; }
/* Kartenflächen bewusst NICHT position:fixed – Safari (iOS 26) legt fixierte Flächen zwischen die Leisten,
   normal positionierte Flächen laufen dagegen unter Status- und Navigationsleiste weiter (Vollbild) */
#map { position: absolute; top: 0; left: 0; width: 100%; height: 100vh; z-index: 1; }
#stars { position: absolute; top: 0; left: 0; width: 100%; height: 100vh; background:
  radial-gradient(1.2px 1.2px at 20px 30px, #fff, transparent), radial-gradient(1px 1px at 40px 90px, #fff, transparent), radial-gradient(1px 1px at 90px 20px, #dbe6ff, transparent), radial-gradient(1.3px 1.3px at 150px 60px, #fff, transparent), radial-gradient(0.9px 0.9px at 10px 140px, #fff, transparent), radial-gradient(1px 1px at 70px 170px, #cfe0ff, transparent), radial-gradient(1px 1px at 120px 80px, #cfe0ff, transparent),
  radial-gradient(1.4px 1.4px at 220px 150px, #fff, transparent), radial-gradient(1px 1px at 60px 200px, #fff, transparent),
  radial-gradient(1.2px 1.2px at 170px 240px, #bcd0ff, transparent), radial-gradient(0.9px 0.9px at 260px 40px, #fff, transparent);
  background-size: 170px 150px, 130px 190px, 160px 120px, 200px 170px, 140px 160px, 180px 140px, 300px 280px, 250px 230px, 340px 300px, 210px 260px, 280px 320px, 190px 210px; background-color: #060b1f; }
.maplibregl-ctrl-bottom-right, .maplibregl-ctrl-bottom-left { margin-bottom: calc(var(--sab) + 2px); z-index: 1; }
.maplibregl-ctrl-attrib { font-size: 10px; opacity: .8; font-family: sans-serif; font-weight: 400; }
body.pixel .maplibregl-canvas { image-rendering: pixelated; }
body.selecting .maplibregl-ctrl-bottom-right, body.selecting .maplibregl-ctrl-bottom-left { display: none; }

#fx { position: absolute; top: 0; left: 0; width: 100%; height: 100vh; pointer-events: none; z-index: 2; }
body.fx-crt #fx { background: repeating-linear-gradient(0deg, rgba(0,0,0,.28) 0 1px, transparent 1px 3px), radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,.55) 100%); mix-blend-mode: multiply; }
body.fx-paper #fx { background: radial-gradient(ellipse at center, transparent 50%, rgba(70,40,10,.4) 100%); mix-blend-mode: multiply; }

button, select { font: inherit; color: inherit; border: 0; cursor: pointer; }
.ico { width: 26px; height: 26px; fill: currentColor; flex: none; }

/* Glas-Optik */
.glass { background: rgba(34, 34, 38, .55); -webkit-backdrop-filter: blur(20px) saturate(1.5); backdrop-filter: blur(20px) saturate(1.5); border: 1px solid rgba(255,255,255,.16); box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 6px 22px rgba(0,0,0,.4); }
.round { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 18px; color: var(--fg); flex: none; }
.round:active { transform: scale(.94); }
.round.on { background: var(--accent); color: #fff; }
.round.big { width: 72px; height: 72px; }

#topbar { position: fixed; z-index: 5; top: calc(var(--sat) + 12px); left: calc(var(--sal) + 14px); right: calc(var(--sar) + 14px); display: flex; gap: 12px; align-items: center; }
.search-field { flex: 1; min-width: 0; height: 56px; border-radius: 28px; display: flex; align-items: center; gap: 12px; padding: 0 20px; color: #bdbdc4; font-size: 18px; font-weight: 800; text-align: left; }
.search-field span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.navigating #topbar, body.selecting #topbar { display: none; }

#dock { position: fixed; z-index: 5; left: 0; right: 0; bottom: calc(var(--sab) + 16px); display: flex; justify-content: center; align-items: center; gap: 22px; pointer-events: none; }
#dock > * { pointer-events: auto; }
#btn-locate { color: #3b8cff; box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 0 24px rgba(59,140,255,.45), 0 6px 22px rgba(0,0,0,.4); }
#btn-locate.on { background: rgba(34,34,38,.55); color: #3b8cff; }
body.navigating #dock, body.has-sheet #dock, body.selecting #dock { display: none; }

#fab { position: fixed; z-index: 5; right: calc(var(--sar) + 14px); bottom: calc(var(--sab) + 220px); display: flex; flex-direction: column; gap: 12px; }
#speed { position: fixed; z-index: 5; left: calc(var(--sal) + 14px); bottom: calc(var(--sab) + 220px); width: 80px; height: 80px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; }
#speed b { font-size: 28px; line-height: 1; }
#speed small { font-size: 11px; color: var(--muted); }

/* Navigationsbanner */
#nav-banner { position: fixed; z-index: 6; top: calc(var(--sat) + 10px); left: calc(var(--sal) + 14px); right: calc(var(--sar) + 14px); background: #000; border: 1px solid var(--line); border-radius: 28px; padding: 14px 20px; display: flex; flex-direction: column; box-shadow: 0 6px 24px rgba(0,0,0,.55); }
.nav-row { display: flex; align-items: center; gap: 18px; }
#nav-icon { width: 58px; height: 58px; flex: none; display: grid; place-items: center; }
#nav-icon svg { width: 58px; height: 58px; fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.nav-text { min-width: 0; flex: 1; }
#nav-dist { font-size: 36px; font-weight: 800; line-height: 1.05; }
#nav-instr { font-size: 22px; font-weight: 800; line-height: 1.2; margin-top: 2px; overflow-wrap: anywhere; }


/* Sheets */
.sheet { position: fixed; z-index: 6; left: 0; right: 0; bottom: 0; background: #000; border-radius: 32px 32px 0 0; padding: 8px calc(var(--sar) + 18px) calc(var(--sab) + 18px) calc(var(--sal) + 18px); box-shadow: 0 -8px 36px rgba(0,0,0,.6); border-top: 1px solid var(--line); }
.grab { position: relative; width: 100%; height: 40px; margin: -8px 0 4px; touch-action: none; cursor: grab; }
.grab::after { content: ""; position: absolute; left: 50%; top: 15px; width: 62px; height: 5px; margin-left: -31px; border-radius: 3px; background: #4a4a4e; }
.sheet { transition: transform .22s ease; }
.sheet.dragging { transition: none; }
/* eingeklappt: nur Griff und die wichtigste Zeile bleiben sichtbar → mehr Karte */
.sheet.collapsed > :not(.grab):not(.keep):not(.sheet-x) { display: none !important; }
.sheet.collapsed .sheet-actions, .sheet.collapsed .rs-bottom { margin-top: 4px; }
.sheet.collapsed .sheet-title { font-size: 24px; }
.sheet.collapsed .sheet-x { top: 22px; }
.sheet-title { font-size: 34px; font-weight: 800; line-height: 1.1; padding-right: 44px; overflow-wrap: anywhere; }
.sheet-sub { color: var(--muted); font-size: 19px; margin-top: 10px; font-weight: 800; }
.sheet-actions { display: flex; gap: 14px; margin-top: 26px; }
.sheet-actions .pill { flex: 1; min-width: 0; padding: 0 16px; font-size: 20px; white-space: nowrap; }
.sheet-actions .pill.white { flex: 1.25; }
.sheet-x { position: absolute; right: 18px; top: 26px; width: 36px; height: 36px; border-radius: 50%; background: #1c1c1e; color: #aaa; font-size: 15px; }
.pill { height: 62px; border-radius: 31px; font-size: 22px; font-weight: 800; padding: 0 28px; display: inline-flex; align-items: center; justify-content: center; gap: 12px; }
.pill:active { transform: scale(.98); }
.pill.white { background: linear-gradient(#fff, #d9d9de); color: #000; box-shadow: 0 4px 18px rgba(255,255,255,.12); }
.pill.dark { background: #0d0d0f; color: #fff; border: 1px solid var(--line); box-shadow: inset 0 1px 0 rgba(255,255,255,.08); }
.pill.red { background: linear-gradient(#f2625c, #dc4a46); color: #fff; width: 100%; }
.pill.wide { width: 100%; }
#btn-resume { position: fixed; z-index: 7; left: 50%; transform: translateX(-50%); bottom: calc(var(--sab) + 200px); height: 54px; font-size: 18px; box-shadow: 0 4px 20px rgba(0,0,0,.6); }

#nav-bar .nav-stats { display: flex; padding: 4px 0 18px; }
.nav-stat { flex: 1; text-align: center; }
.nav-stat b { display: block; font-size: 34px; font-weight: 800; white-space: nowrap; }
.nav-stat small { color: #d0d0d4; font-size: 20px; font-weight: 800; }

/* Routenvorschau */
.route-card { margin-top: 22px; border: 1px solid var(--line); border-radius: 30px; padding: 22px 24px; background: #070708; }
.rc-row { display: flex; align-items: center; gap: 18px; font-size: 24px; font-weight: 800; }
.rc-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-line { width: 4px; height: 26px; background: #2c2c2e; border-radius: 2px; margin: 8px 0 8px 11px; }
.pinico { color: var(--accent); }
#rs-alts { margin-top: 16px; }
.alt { display: flex; justify-content: space-between; padding: 14px 16px; border-radius: 16px; font-size: 20px; font-weight: 800; }
.alt.cur { background: #141a2e; color: #7aa7ff; }
.alt em { font-style: normal; font-size: 16px; }
.rs-bottom { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 22px; }
.rs-main { font-size: 40px; font-weight: 800; line-height: 1; }
.rs-bottom .pill { padding: 0 22px; font-size: 20px; white-space: nowrap; flex: none; }
.rs-sub { color: var(--muted); font-size: 16px; margin-top: 8px; font-weight: 800; }

/* Seiten */
.page { position: fixed; inset: 0; z-index: 10; padding: calc(var(--sat) + 12px) calc(var(--sar) + 16px) 0 calc(var(--sal) + 16px); display: flex; flex-direction: column; background: rgba(0,0,0,.92); }
.page.black { background: #000; }
.page-head { display: flex; gap: 16px; align-items: center; }
.page-head h1 { margin: 0; font-size: 34px; font-weight: 800; }
#search-input { flex: 1; min-width: 0; height: 56px; border-radius: 28px; border: 1px solid var(--line); background: #0d0d0f; color: #fff; padding: 0 22px; font: inherit; font-size: 19px; outline: none; -webkit-user-select: text; user-select: text; }
.list { flex: 1; overflow-y: auto; margin-top: 18px; padding-bottom: calc(var(--sab) + 18px); }
.item { display: flex; gap: 16px; align-items: center; padding: 14px 16px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 28px; background: #0c0c0e; cursor: pointer; }
.item:active { background: #1a1a1d; }
.item .ic { width: 34px; flex: none; text-align: center; font-size: 22px; }
.item .tx { min-width: 0; flex: 1; }
.item .t { font-size: 20px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .s { font-size: 16px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .del { flex: none; width: 34px; height: 34px; border-radius: 50%; background: #1c1c1e; color: #aaa; font-size: 14px; }
.empty { color: var(--muted); padding: 24px 6px; text-align: center; font-size: 17px; }
.panel { max-height: 78dvh; overflow-y: auto; z-index: 8; }
#saved-list { margin-top: 18px; }

.prow { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 0 24px; height: 68px; margin-bottom: 14px; border: 1px solid var(--line); border-radius: 34px; background: #0c0c0e; font-size: 20px; font-weight: 800; color: #fff; text-align: left; }
.prow input[type=checkbox] { width: 30px; height: 30px; accent-color: var(--accent); }
.prow select { background: transparent; color: var(--muted); font-size: 17px; font-weight: 800; border: 0; outline: none; }
.danger-row { background: #1a0808; border-color: #4a1a1a; color: #f2625c; }
.tiny { font-size: 12px; color: var(--muted); line-height: 1.5; font-weight: 600; padding: 6px 8px 0; }

/* Kartenwahl */
#select-ui { position: fixed; inset: 0; z-index: 7; padding: calc(var(--sat) + 12px) 16px 0; pointer-events: none; }
#select-ui > * { pointer-events: auto; }
#select-ui .page-head { pointer-events: none; } #select-ui .page-head > * { pointer-events: auto; }
.select-bottom { position: fixed; left: 16px; right: 16px; bottom: calc(var(--sab) + 18px); display: flex; flex-direction: column; gap: 18px; align-items: center; }
.select-row { display: flex; align-items: center; justify-content: space-between; width: 100%; }
#sel-name { flex: 1; font-size: 34px; line-height: 1.1; padding: 0 8px; font-weight: 800; text-shadow: 0 2px 12px rgba(0,0,0,.7); text-align: center; }
#sel-dots { display: flex; gap: 8px; }
#sel-dots i { width: 10px; height: 10px; border-radius: 5px; background: rgba(255,255,255,.4); transition: all .25s; }
#sel-dots i.on { width: 40px; background: #fff; }
body.selecting #fx { z-index: 6; }

#toast { position: fixed; z-index: 20; left: 50%; transform: translateX(-50%); top: calc(var(--sat) + 84px); max-width: 90vw; background: rgba(20,20,24,.94); color: #fff; padding: 12px 20px; border-radius: 16px; font-size: 16px; text-align: center; box-shadow: 0 4px 16px rgba(0,0,0,.5); }
body.navigating #toast { top: calc(var(--sat) + 130px); }

/* Marker */
.puck { width: 46px; height: 46px; display: grid; place-items: center; }
.puck svg { width: 40px; height: 40px; filter: drop-shadow(0 2px 4px rgba(0,0,0,.7)); }
.crosshair { width: 640px; height: 640px; pointer-events: none; position: relative; }
.crosshair::before, .crosshair::after { content: ""; position: absolute; left: 50%; top: 50%; background: rgba(255,255,255,.85); }
.crosshair::before { width: 2px; height: 100%; transform: translate(-50%, -50%); -webkit-mask: linear-gradient(transparent, #000 30%, #000 70%, transparent); mask: linear-gradient(transparent, #000 30%, #000 70%, transparent); }
.crosshair::after { height: 2px; width: 100%; transform: translate(-50%, -50%); -webkit-mask: linear-gradient(90deg, transparent, #000 30%, #000 70%, transparent); mask: linear-gradient(90deg, transparent, #000 30%, #000 70%, transparent); }
.pin { width: 40px; height: 52px; filter: drop-shadow(0 3px 4px rgba(0,0,0,.55)); }
.pin svg { width: 100%; height: 100%; }

/* Querformat / Auto-Display */
@media (min-width: 760px) {
  #nav-banner { right: auto; width: 440px; }
  .sheet { right: auto; width: 480px; left: calc(var(--sal) + 14px); border-radius: 32px; bottom: calc(var(--sab) + 14px); border: 1px solid var(--line); }
  #fab { bottom: calc(var(--sab) + 40px); }
  #speed { left: auto; right: calc(var(--sar) + 14px); bottom: calc(var(--sab) + 40px); }
  #btn-resume { left: calc(var(--sal) + 260px); transform: none; bottom: calc(var(--sab) + 230px); }
  .select-bottom { left: 50%; right: auto; width: 520px; transform: translateX(-50%); }
  .page .list, .page-head { max-width: 760px; width: 100%; margin-left: auto; margin-right: auto; }
}
@media (max-height: 520px) {
  #nav-dist { font-size: 28px; } #nav-instr { font-size: 18px; }
  .nav-stat b { font-size: 24px; } .nav-stat small { font-size: 15px; } .pill { height: 50px; font-size: 18px; }
  .round { width: 48px; height: 48px; } .round.big { width: 58px; height: 58px; }
  .sheet-title { font-size: 24px; } #nav-icon, #nav-icon svg { width: 44px; height: 44px; }
}

.badge { width: 56px; height: 56px; filter: drop-shadow(0 3px 5px rgba(0,0,0,.5)); }
.badge.px { width: 64px; height: 56px; }
.badge svg { width: 100%; height: 100%; }

/* Stilwahl während der Fahrt */
#theme-sheet { z-index: 9; }
#theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 16px; }
.tchip { border-radius: 18px; background: #0c0c0e; border: 2px solid transparent; padding: 0; overflow: hidden; text-align: left; color: #fff; }
.tchip.on { border-color: var(--accent); }
.tchip .sw { height: 44px; }
.tchip b { display: block; padding: 8px 12px 10px; font-size: 16px; font-weight: 800; }

/* Rechte Spalte: Buttons und Tempo dürfen sich nie überlappen */
@media (min-width: 760px) {
  #fab { bottom: calc(var(--sab) + 14px + 96px); }
  #speed { right: calc(var(--sar) + 14px); bottom: calc(var(--sab) + 14px); }
  #theme-sheet { max-height: 70dvh; }
}
@media (min-width: 760px) and (max-height: 520px) {
  #fab { bottom: calc(var(--sab) + 12px + 86px); gap: 8px; }
  #speed { width: 68px; height: 68px; bottom: calc(var(--sab) + 12px); }
  #speed b { font-size: 24px; }
}

/* Live-Verkehr */
#btn-traffic-idle { position: fixed; z-index: 5; right: calc(var(--sar) + 14px); top: calc(var(--sat) + 80px); color: #8e8e93; }
#btn-traffic-idle.on, .btn-traffic.on { color: #fff; background: #1f9d55; }
body.navigating #btn-traffic-idle, body.selecting #btn-traffic-idle { display: none; }
.prow input[type=text] { background: transparent; border: 0; outline: none; color: var(--muted); font: inherit; font-size: 16px; text-align: right; width: 55%; -webkit-user-select: text; user-select: text; }
.ok { color: #4cd37b; } .warn { color: #ffb020; } .bad { color: #ff5a4f; }
.alt { align-items: center; }
.alt small { display: block; color: var(--muted); font-size: 14px; font-weight: 700; margin-top: 2px; }
.alt em.ok { color: #4cd37b; }
#rs-hint { margin: 8px 0 0; }
#offer { position: fixed; z-index: 7; left: calc(var(--sal) + 14px); right: calc(var(--sar) + 14px); top: calc(var(--sat) + 124px); display: flex; flex-wrap: wrap; gap: 10px; align-items: center; background: #0a2a18; border: 1px solid #1f9d55; border-radius: 22px; padding: 14px 18px; font-size: 18px; font-weight: 800; box-shadow: 0 6px 24px rgba(0,0,0,.55); }
#offer span { flex: 1 1 100%; }
#offer .pill { height: 48px; font-size: 17px; flex: 1; }
@media (min-width: 760px) { #offer { right: auto; width: 440px; top: calc(var(--sat) + 110px); } }

/* „Danach“-Vorschau und Spurempfehlung */
#nav-next { flex: none; display: flex; flex-direction: column; align-items: center; gap: 2px; padding-left: 16px; border-left: 1px solid var(--line); min-width: 78px; }
#nav-next small { font-size: 12px; color: var(--muted); font-weight: 800; }
#nav-next b { font-size: 16px; font-weight: 800; white-space: nowrap; }
#nav-next svg { width: 36px; height: 36px; fill: none; stroke: #c9c9ce; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
#nav-next.close svg { stroke: var(--accent); }
#nav-next.close b { color: var(--accent); }
#lanes { display: flex; justify-content: center; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.lane { width: 44px; height: 54px; border-left: 2px dashed #3a3a3e; }
.lane:first-child { border-left-color: #fff; border-left-style: solid; }
.lane:last-child { border-right: 2px solid #fff; }
.lane svg { width: 100%; height: 100%; overflow: visible; fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 420px) { #nav-next { padding-left: 10px; min-width: 66px; } #nav-dist { font-size: 32px; } #nav-instr { font-size: 19px; } }

/* Profil-Code-Dialog */
#sync-dialog, #spot-dialog { position: fixed; inset: 0; z-index: 30; background: rgba(0,0,0,.72); display: grid; place-items: center; padding: 16px; }
.dcard { width: min(440px, 100%); background: #0b0b0d; border: 1px solid var(--line); border-radius: 28px; padding: 24px; display: flex; flex-direction: column; gap: 12px; max-height: 92dvh; overflow-y: auto; }
.dcard h2 { margin: 0; font-size: 28px; }
.dcard p { margin: 0; color: #cfcfd4; font-size: 16px; line-height: 1.4; font-weight: 600; }
.dcard .dsmall { font-size: 13px; color: var(--muted); }
.dcard .dmsg { color: #ffb020; font-weight: 800; }
.dcard input { height: 62px; border-radius: 20px; border: 1px solid var(--line); background: #141417; color: #fff; font: inherit; font-size: 30px; letter-spacing: 8px; text-align: center; outline: none; -webkit-user-select: text; user-select: text; }
.dcard .pill { width: 100%; }

/* Routenmodi */
#rs-modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; }
.mode { border: 2px solid transparent; border-radius: 18px; background: #0c0c0e; padding: 10px 4px 9px; text-align: center; color: #fff; min-width: 0; }
.mode.cur { border-color: var(--accent); background: #15151b; }
.mode .mi { font-size: 24px; line-height: 1.1; }
.mode b { display: block; font-size: 13px; margin-top: 2px; white-space: nowrap; }
.mode .mt { font-size: 20px; font-weight: 800; margin-top: 4px; white-space: nowrap; }
.mode small { display: block; font-size: 12px; color: var(--muted); font-weight: 700; margin-top: 1px; }
#rs-desc { margin: 8px 2px 0; font-size: 14px; color: #bdbdc4; }

body { touch-action: manipulation; }
#diag-overlay { position: fixed; z-index: 100; left: 12px; right: 12px; top: calc(var(--sat) + 60px); background: rgba(0,0,0,.92); border: 1px solid #555; border-radius: 18px; padding: 14px; color: #fff; }
#diag-overlay pre { margin: 8px 0; font: 12px/1.45 ui-monospace, Menlo, monospace; white-space: pre-wrap; }
#diag-overlay small { color: #aaa; }

/* Stopps, Suchergebnisse, Ladestationen */
.nav-stop { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: #0c0c0e; border: 1px solid var(--line); border-radius: 16px; padding: 8px 8px 8px 14px; margin-bottom: 10px; font-size: 16px; font-weight: 800; }
.nav-stop span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-stop .del { flex: none; width: 34px; height: 34px; border-radius: 50%; background: #1c1c1e; color: #aaa; }
.nav-actions { display: flex; gap: 10px; }
.nav-actions .pill.dark { flex: 0 0 64px; padding: 0; font-size: 26px; }
.nav-actions .pill.red { flex: 1; width: auto; }
.rs-tools { display: flex; gap: 10px; margin-top: 12px; }
.rs-tools .pill { flex: 1; height: 50px; font-size: 18px; padding: 0 10px; white-space: nowrap; }
.rc-row .x { margin-left: auto; flex: none; width: 32px; height: 32px; border-radius: 50%; background: #1c1c1e; color: #aaa; font-size: 13px; }
.rc-row .num { flex: none; width: 26px; height: 26px; border-radius: 50%; background: #fff; color: #000; display: grid; place-items: center; font-size: 14px; font-weight: 800; }
.extra { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; font-size: 16px; }
.extra .chip, .found-list .chip { display: inline-block; background: #17171a; border: 1px solid var(--line); border-radius: 12px; padding: 4px 10px; margin: 0 6px 4px 0; font-size: 14px; font-weight: 800; }
.chip.ok { color: #4cd37b; } .chip.warn { color: #ffb020; } .chip.bad { color: #ff5a4f; }
.extra .conn { color: #cfcfd4; font-size: 15px; }
.extra .src { color: var(--muted); font-size: 12px; }
.found-list { margin-top: 12px; max-height: 38dvh; overflow-y: auto; }
.found-list .item { margin-bottom: 8px; padding: 10px 12px; }
.found-list .t { font-size: 18px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 12px 0 2px; flex: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; padding-top: 10px; }
.chips button { flex: none; background: #141417; border: 1px solid var(--line); border-radius: 18px; padding: 9px 14px; font-size: 15px; font-weight: 800; color: #fff; white-space: nowrap; }
.chips button.on { background: var(--accent); color: #fff; border-color: transparent; }
.sec { margin: 18px 4px 8px; font-size: 18px; color: var(--muted); }
.prow-col { border: 1px solid var(--line); border-radius: 28px; background: #0c0c0e; padding: 16px 20px 12px; margin-bottom: 14px; font-size: 18px; font-weight: 800; }
.fmark { width: 46px; height: 54px; background: none; padding: 0; position: absolute; top: 0; left: 0; filter: drop-shadow(0 3px 4px rgba(0,0,0,.55)); }
.fmark i { position: absolute; left: 0; top: 0; width: 46px; height: 46px; border-radius: 50% 50% 50% 4px; transform: rotate(-45deg); background: #111; border: 3px solid #fff; }
.fmark span { position: absolute; left: 0; top: 0; width: 46px; height: 46px; display: grid; place-items: center; text-align: center; font-size: 20px; line-height: 1; }
.fmark.ev i { background: #0b5fff; }
.fmark.sel i { border-color: var(--accent); background: var(--accent); }
.fmark small { display: block; font-size: 11px; font-weight: 800; color: #fff; }
.fmark .dot { position: absolute; right: -2px; top: -2px; width: 14px; height: 14px; border-radius: 50%; border: 2px solid #111; background: #8e8e93; }
.fmark .dot.ok { background: #34c759; } .fmark .dot.warn { background: #ffb020; } .fmark .dot.bad { background: #ff453a; }
.smark { width: 34px; height: 34px; border-radius: 50%; background: #fff; color: #000; border: 4px solid var(--accent); display: grid; place-items: center; font-size: 15px; font-weight: 800; box-shadow: 0 3px 8px rgba(0,0,0,.5); }
#place-sheet, #results-sheet { z-index: 8; }
#results-title { font-size: 24px; padding-right: 44px; }
#place-sheet .sheet-actions .pill, #sheet .sheet-actions .pill { font-size: 17px; padding: 0 10px; white-space: nowrap; }
#place-sheet .sheet-actions .pill.dark { flex: 1.25; }
.nav-actions .pill.dark { flex: 0 0 56px; }
.nav-actions .pill.red { font-size: 19px; white-space: nowrap; padding: 0 8px; }

/* Ort bearbeiten */
#spot-dialog .dcard input { font-size: 22px; letter-spacing: 0; text-align: left; padding: 0 18px; }
.spot-icons { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.spot-icons button { height: 52px; border-radius: 16px; background: #141417; border: 2px solid transparent; font-size: 26px; }
.spot-icons button.on { border-color: var(--accent); background: #1f1f24; }
.item .edit { margin-left: -6px; }

.nav-stop .av { font-weight: 800; } .nav-stop .av.ok { color: #34c759; } .nav-stop .av.warn { color: #ffb020; } .nav-stop .av.bad { color: #ff453a; }

/* KI-Assistent */
.no-assist #btn-assist, .no-assist #btn-nav-assist { display: none; }
#assist-dialog { position: fixed; inset: 0; z-index: 31; display: flex; align-items: flex-end; justify-content: flex-start; padding: 0 12px calc(env(safe-area-inset-bottom, 0px) + 12px); pointer-events: none; }
.acard { pointer-events: auto; width: min(580px, 100%); max-height: 60dvh; background: rgba(11,11,13,.97); border: 1px solid var(--line); border-radius: 28px; padding: 14px; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 10px 40px rgba(0,0,0,.6); }
.as-head { display: flex; align-items: center; justify-content: space-between; font-size: 20px; padding: 0 4px; }
#as-log { overflow-y: auto; display: flex; flex-direction: column; gap: 8px; min-height: 0; flex: 1; -webkit-overflow-scrolling: touch; }
.as-msg { padding: 10px 14px; border-radius: 18px; font-size: 18px; line-height: 1.3; max-width: 94%; font-weight: 700; }
.as-msg.u { align-self: flex-end; background: #2a2a30; }
.as-msg.a { align-self: flex-start; background: #17171a; border: 1px solid var(--line); }
.as-msg.t { align-self: flex-start; font-size: 15px; color: var(--muted); padding: 4px 8px; }
.as-row { display: flex; gap: 8px; align-items: center; }
.as-row input { flex: 1; min-width: 0; height: 56px; border-radius: 20px; border: 1px solid var(--line); background: #141417; color: #fff; font: inherit; font-size: 18px; padding: 0 16px; outline: none; -webkit-user-select: text; user-select: text; }
.as-btn { flex: none; width: 56px; height: 56px; border-radius: 50%; background: #1c1c1e; font-size: 24px; color: #fff; }
.as-btn.small { width: 40px; height: 40px; font-size: 16px; }
.as-btn.rec { background: #e5484d; animation: as-pulse 1s ease-in-out infinite; }
@keyframes as-pulse { 50% { transform: scale(1.08); } }

/* Spur-Hinweis */
.lane-hint { display: flex; align-items: center; gap: 12px; margin-top: 10px; padding: 8px 4px 0; border-top: 1px solid var(--line); }
.lh-zones { flex: none; display: flex; gap: 4px; align-items: flex-end; height: 34px; }
.lh-zones i { display: block; width: 12px; height: 34px; border-radius: 3px; background: #3a3a3e; transform: perspective(40px) rotateX(18deg); }
.lh-zones i.on { background: #34c759; box-shadow: 0 0 10px rgba(52,199,89,.6); }
.lane-hint.hot .lh-zones i.on { background: #ffb020; box-shadow: 0 0 12px rgba(255,176,32,.7); }
.lane-hint.warn .lh-zones i.on { background: #ff453a; }
.lh-text { min-width: 0; display: flex; flex-direction: column; line-height: 1.15; }
.lh-text b { font-size: 20px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lh-text span { font-size: 15px; color: var(--muted); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lane-hint.warn .lh-text b { color: #ff9f0a; }

/* Spuren am aktuellen Ort: bis zu 8 Spuren passend verkleinern */
#lanes .lane { flex: 1 1 0; max-width: 44px; min-width: 24px; }
.lane-hint { margin-top: 4px; }
#lanes:not([hidden]) ~ .lane-hint { border-top: none; margin-top: 2px; }

#live-diag { position: fixed; z-index: 90; left: 12px; right: 12px; bottom: calc(var(--sab) + 200px); background: rgba(0,0,0,.9); border: 1px solid #555; border-radius: 16px; padding: 10px 14px; color: #fff; font: 600 13px/1.35 ui-monospace, Menlo, monospace; white-space: pre-wrap; word-break: break-word; max-height: 40dvh; overflow: auto; }
#live-diag[hidden] { display: none; }

#lanes .lane-dist { align-self: center; margin-left: 14px; font-size: 22px; font-weight: 800; white-space: nowrap; color: #34c759; }

/* Vorschau der nächsten Spuranordnung */
#lanes-next { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--line); }
#lanes-next .ln-dist { font-size: 20px; font-weight: 800; color: #ffb020; white-space: nowrap; }
#lanes-next .ln-tiles { display: flex; }
#lanes-next .lane { width: 32px; height: 40px; }
#lanes-next .ln-text { flex-basis: 100%; text-align: center; font-size: 15px; font-weight: 700; color: var(--muted); }
#lanes-next[hidden] { display: none; }

/* Spuren untereinander ausrichten: gleiche Kachelbreite, Entfernungen am Rand statt in der Zeile */
#lanes { position: relative; }
#lanes .lane-dist { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); margin-left: 0; }
#lanes-next { position: relative; display: block; text-align: center; }
#lanes-next .ln-tiles { display: flex; justify-content: center; }
#lanes-next .lane { width: 44px; height: 46px; }
#lanes-next .ln-dist { position: absolute; left: 4px; top: 12px; }
#lanes-next .ln-text { display: block; margin-top: 2px; }
#lanes-next[hidden] { display: none; }

/* Ruhige Spuranzeige: feste Höhe, weiche Übergänge, einzeilige Vorschau */
#nav-banner.lane-reserve #lanes[hidden], #nav-banner.lane-reserve #lanes-next[hidden], #nav-banner.lane-reserve .lane-hint[hidden] { display: flex !important; visibility: hidden; }
#nav-banner.lane-reserve #lanes { min-height: 78px; }
#nav-banner.lane-reserve #lanes-next { display: block; min-height: 78px; }
#nav-banner.lane-reserve .lane-hint { min-height: 56px; }
#lanes-next .ln-dist { display: none; }
#lanes-next .ln-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 6px; }
.lane-hint .lh-text b, .lane-hint .lh-text span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#lanes.fx .lane, #lanes-next.fx .lane { animation: laneIn .4s ease both; }
.lane-hint.fx2 .lh-text { animation: laneIn .4s ease both; }
@keyframes laneIn { from { opacity: .15; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* nur noch eine Spurzeile: keine Vorschau-Zeile */
#lanes-next, #nav-banner.lane-reserve #lanes-next, #nav-banner.lane-reserve #lanes-next[hidden] { display: none !important; }

/* Spurzeile: Verankerung, neue Spur blendet ein, vorhandene bleiben ruhig stehen */
#lanes .lt { display: flex; justify-content: center; }
#lanes .lt .lane { flex: none; width: 44px; max-width: none; min-width: 0; }
#lanes.fx .lane { animation: none; }
#lanes .lane.new { animation: laneNew .5s ease both !important; }
@keyframes laneNew { from { opacity: 0; } to { opacity: 1; } }

/* Spurpfad und Einordnen-Ring */
#lanes .lt { position: relative; }
.lane-path { position: absolute; left: 0; top: 0; height: 54px; overflow: visible; pointer-events: none; fill: none; stroke: #34c759; stroke-width: 4.5; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 4px rgba(52,199,89,.7)); }
.lane-path { width: 100%; }
.lh-ring { position: relative; flex: none; width: 58px; height: 58px; margin-left: auto; }
.lh-ring svg { width: 100%; height: 100%; }
.lh-ring circle { fill: none; stroke-width: 5; }
.lh-ring .bg { stroke: #2c2c30; }
.lh-ring .fg { stroke: #0a84ff; stroke-linecap: round; stroke-dasharray: 138.2; stroke-dashoffset: 138.2; transition: stroke-dashoffset .5s linear; }
.lane-hint.hot .lh-ring .fg { stroke: #ffb020; }
.lh-ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 14px; font-weight: 800; }
.lh-ring[hidden] { display: none; }

/* Einordnen-Grafik (zwei Spurzeilen, Pfad, Ring) */
#lane-plan { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); }

#lane-plan .lp-head { display: flex; flex-direction: column; line-height: 1.1; }
#lane-plan .lp-head b { font-size: 28px; font-weight: 800; }
#lane-plan .lp-head span { font-size: 20px; font-weight: 700; }
#lane-plan .lp-body { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 10px 0 4px; }
#lane-plan .lp-rows { position: relative; flex: none; }
#lane-plan .lp-row { position: absolute; display: flex; }
#lane-plan .lp-top { top: 0; } #lane-plan .lp-bot { top: 100px; }
#lane-plan .lp-row .lane { flex: none; width: 44px; height: 44px; }
#lane-plan .lp-path { position: absolute; left: 0; top: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; fill: none; stroke: #34c759; stroke-width: 4.5; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 4px rgba(52,199,89,.7)); }
#lane-plan .lh-ring { margin-left: 0; width: 70px; height: 70px; }
#lane-plan .lh-ring b { font-size: 15px; }
#lane-plan .lp-cap { display: flex; flex-direction: column; line-height: 1.2; }
#lane-plan .lp-cap b { font-size: 19px; font-weight: 800; }
#lane-plan .lp-cap span { font-size: 15px; color: var(--muted); font-weight: 700; }
#lane-plan.fx .lp-rows { animation: laneIn .4s ease both; }

/* Weiche Übergänge wie bei Apple: Karte fährt auf/zu, Spuren blenden um, Pfad zeichnet sich */
#lane-plan { max-height: 0; opacity: 0; overflow: hidden; margin-top: 0; padding-top: 0; border-top-color: transparent; transform: translateY(8px) scale(.98); transform-origin: top center;
  transition: max-height .6s cubic-bezier(.22,.9,.24,1), opacity .45s ease, margin .5s ease, padding .5s ease, transform .6s cubic-bezier(.22,.9,.24,1); pointer-events: none; }
#lane-plan.on { max-height: 360px; opacity: 1; margin-top: 10px; padding-top: 8px; border-top-color: var(--line); transform: none; }
#nav-banner.plan-on #lanes, #nav-banner.plan-on .lane-hint { opacity: 0; max-height: 0 !important; min-height: 0 !important; overflow: hidden; margin: 0 !important; padding: 0 !important; border: 0 !important; display: flex !important; visibility: visible !important; }
#lanes, .lane-hint { transition: opacity .4s ease, max-height .5s ease; max-height: 200px; }
.lane svg g { transition: stroke .45s ease, stroke-width .45s ease; }
.lane-path path, #lane-plan .lp-path path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: pathDraw .9s .25s cubic-bezier(.3,.7,.2,1) forwards; }
@keyframes pathDraw { to { stroke-dashoffset: 0; } }
#lane-plan .lp-head b, #lane-plan .lh-ring b, .lane-dist, .lh-text span { font-variant-numeric: tabular-nums; }
#lane-plan .lh-ring .fg { transition: stroke-dashoffset .9s linear, stroke .4s ease; }
