/* ==========================================================================================
   MapClip „Aurora Glass“ — Design für Smartphone-App und Webseite
   Die Karte ist der Star: sie füllt den Bildschirm, die Bedienung schwebt als Glas darüber.
   Liegt über app.css (Grundlayout); Breitbild (≥ 900 px) behält die Seitenleiste.
   ========================================================================================== */

:root {
  --bg: #090c1a;
  --panel: #12162b;
  --panel-2: #1b2142;
  --line: rgba(255, 255, 255, .09);
  --text: #f5f6ff;
  --muted: #a2a8d0;
  --accent: #ff3d6e;
  --accent-2: #7b5cff;
  --accent-3: #ffb547;
  --ok: #2ee6b8;
  --glass: rgba(13, 16, 33, .78);
  --glass-strong: rgba(11, 14, 29, .88);
  --glass-line: rgba(255, 255, 255, .10);
  --glass-hi: rgba(255, 255, 255, .06);
  --grad: linear-gradient(135deg, #ff5a5f 0%, #ff3d6e 45%, #7b5cff 100%);
  --grad-soft: linear-gradient(135deg, rgba(255, 61, 110, .22), rgba(123, 92, 255, .22));
  --glow: 0 8px 28px rgba(255, 61, 110, .35), 0 2px 10px rgba(123, 92, 255, .35);
  --shadow: 0 18px 50px rgba(0, 0, 0, .45);
  --spring: cubic-bezier(.2, 1.15, .3, 1);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --radius: 18px;
  /* Sichere Ränder: iOS liefert env(), Android meldet sie über die App-Brücke (--native-*) */
  --safe-t: max(env(safe-area-inset-top, 0px), var(--native-t, 0px));
  --safe-b: max(env(safe-area-inset-bottom, 0px), var(--native-b, 0px));
  --sheet-h: 46dvh;
}

html, body { background: var(--bg); font-family: "Inter", "SF Pro Text", "Segoe UI Variable", "Segoe UI", Roboto, system-ui, sans-serif; letter-spacing: -.005em; }
::selection { background: rgba(255, 61, 110, .35); }

/* ------------------------------------------------------------------ Startanimation
   Übernimmt nahtlos das native Startbild (Symbol 160 px mittig auf #0f1324), gleitet dann in eine ruhige,
   zentrierte Anordnung: Logo · Schriftzug · Untertitel · feine Ladelinie. */
.splash { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: #0f1324; overflow: hidden; transition: opacity .5s var(--ease), transform .6s var(--ease); }
.splash.out { opacity: 0; transform: scale(1.04); pointer-events: none; }
.splash-glow { position: absolute; left: 50%; top: 50%; width: 520px; height: 520px; margin: -300px 0 0 -260px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 61, 110, .30) 0%, rgba(123, 92, 255, .18) 38%, transparent 68%); opacity: 0; animation: glow-in 1.2s .2s var(--ease) forwards; }
@keyframes glow-in { from { opacity: 0; transform: scale(.7); } to { opacity: 1; transform: none; } }
.splash-stack { position: relative; display: flex; flex-direction: column; align-items: center; }
/* Start = natives Startbild: 160 px genau in der Bildschirmmitte (Stapel ist ca. 266 px hoch, Logo-Mitte 60 px unter Oberkante) */
.splash-logo { width: 120px; height: 120px; filter: drop-shadow(0 18px 36px rgba(255, 61, 110, .45)); animation: logo-settle .9s .15s var(--spring) both; }
.splash-logo img { width: 100%; height: 100%; display: block; }
@keyframes logo-settle { from { transform: translateY(73px) scale(1.3333); } to { transform: none; } }
.splash-word { margin-top: 26px; font-size: 44px; line-height: 1; font-weight: 800; letter-spacing: -.035em; color: #fff; opacity: 0; animation: word-in .7s .55s var(--ease) both; }
.splash-word b { position: relative; background: linear-gradient(110deg, #ff5a5f 0%, #ff3d6e 40%, #ffd1dc 50%, #7b5cff 60%, #7b5cff 100%); background-size: 250% 100%; background-position: 100% 0;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: shine 1.6s 1s var(--ease) both; }
@keyframes shine { from { background-position: 100% 0; } to { background-position: 0 0; } }
.splash-tag { margin-top: 12px; font-size: 15px; font-weight: 600; letter-spacing: .01em; color: rgba(255, 255, 255, .62); opacity: 0; animation: word-in .7s .75s var(--ease) both; }
@keyframes word-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.splash-load { margin-top: 40px; width: 120px; height: 3px; border-radius: 99px; background: rgba(255, 255, 255, .1); overflow: hidden; opacity: 0; animation: word-in .5s 1s ease both; }
.splash-load span { display: block; width: 40%; height: 100%; border-radius: inherit; background: var(--grad); animation: load 1.1s 1s ease-in-out infinite; }
@keyframes load { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
@media (prefers-reduced-motion: reduce) { .splash *, .splash { animation: none !important; transition: opacity .2s !important; } .splash-word, .splash-tag, .splash-glow, .splash-load { opacity: 1; } }

/* ------------------------------------------------------------------ Glas-Bausteine */
.topbar, .sheet, .tabbar, .modal-card, .stage-empty > div, .toast, .legal-bar {
  -webkit-backdrop-filter: blur(22px) saturate(1.5); backdrop-filter: blur(22px) saturate(1.5);
}

.topbar { background: var(--glass); border: 1px solid var(--glass-line); }
.title-input { font-weight: 800; letter-spacing: -.02em; }
.title-input:focus { background: rgba(255, 255, 255, .07); }
.logo { box-shadow: 0 4px 14px rgba(255, 61, 110, .45); }
.icon-btn { color: var(--text); transition: transform .15s var(--ease), background .2s; }
.icon-btn:active { transform: scale(.9); background: rgba(255, 255, 255, .08); }
.busy { border-color: rgba(255, 255, 255, .2); border-top-color: var(--accent); }

/* Bühne: im Vorschau-Modus schwebt das Video wie eine Karte über Polarlicht */
.stage-wrap { background:
  radial-gradient(60% 45% at 20% 15%, rgba(255, 61, 110, .28), transparent 70%),
  radial-gradient(55% 45% at 85% 80%, rgba(123, 92, 255, .30), transparent 70%),
  linear-gradient(180deg, #0c1024, #070914); }
#app:not(.mode-route) .stage { border-radius: 22px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .12), 0 30px 80px rgba(0, 0, 0, .6), 0 0 60px rgba(123, 92, 255, .25); transition: width .35s var(--ease), height .35s var(--ease); }
.stage-empty > div { background: var(--glass-strong); border: 1px solid var(--glass-line); border-radius: 22px; box-shadow: var(--shadow); padding: 16px 20px; }
.stage-empty strong { font-size: 18px; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ------------------------------------------------------------------ Bedienfeld (Sheet) */
.sheet { background: var(--glass); border: 1px solid var(--glass-line); }
.panel { animation: panel-in .38s var(--ease) both; }
@keyframes panel-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.sheet-grip { display: none; }

/* Dock unten */
.tabbar { background: var(--glass-strong); border: 1px solid var(--glass-line); position: relative; }
.tabbar button { position: relative; z-index: 1; color: var(--muted); transition: color .25s, transform .2s var(--ease); }
.tabbar button:active { transform: scale(.92); }
.tabbar button.active { color: #fff; }
.tabbar button.active svg { stroke: #fff; }
.tabbar svg { transition: transform .4s var(--spring); }
.tabbar button.active svg { transform: translateY(-1px) scale(1.12); }
.tab-ink { display: none; }

/* ------------------------------------------------------------------ Suche, Halte, Etappen */
.search input { background: rgba(255, 255, 255, .06); border: 1px solid var(--glass-line); border-radius: 16px; padding: 14px 16px 14px 44px; font-size: 16px; transition: box-shadow .25s, border-color .25s, background .25s; }
.search input::placeholder { color: rgba(255, 255, 255, .45); }
.search input:focus { outline: none; border-color: transparent; background: rgba(255, 255, 255, .09); box-shadow: 0 0 0 2px rgba(255, 61, 110, .8), 0 0 24px rgba(255, 61, 110, .3); }
.search-ico { left: 14px; top: 14px; }
.results li { border-radius: 14px; transition: background .2s; }
.results li:active, .results li:hover { background: rgba(255, 255, 255, .07); }

.stop { padding: 9px 8px; border-radius: 16px; transition: background .2s, transform .2s var(--ease); }
.stop:active { background: rgba(255, 255, 255, .06); }
.stop .pin { width: 32px; height: 32px; border: 0; background: rgba(255, 255, 255, .1); box-shadow: inset 0 0 0 2px rgba(123, 92, 255, .9); font-size: 14px; }
.stop.start .pin { background: linear-gradient(135deg, #2ee6b8, #12b3a0); box-shadow: 0 4px 16px rgba(46, 230, 184, .45); color: #04221c; }
.stop.end .pin { background: var(--grad); box-shadow: var(--glow); color: #fff; }
.stop .name { font-size: 15.5px; }
.leg { margin-left: 15px; border-left: 2px dashed rgba(255, 255, 255, .16); padding: 5px 0 5px 22px; }
.leg button { background: rgba(255, 255, 255, .07); border: 1px solid var(--glass-line); padding: 5px 12px 5px 6px; transition: transform .15s var(--ease), border-color .2s; }
.leg button:active { transform: scale(.96); border-color: var(--accent); }

/* ------------------------------------------------------------------ Knöpfe, Segmente, Karten */
.btn { border-radius: 14px; padding: 11px 16px; transition: transform .15s var(--ease), box-shadow .25s, background .2s; }
.btn:active { transform: scale(.96); }
.btn.primary { background: var(--grad); box-shadow: var(--glow); }
.btn.ghost { background: rgba(255, 255, 255, .05); border: 1px solid var(--glass-line); }
.btn.ghost:active { background: rgba(255, 255, 255, .1); }
.card { background: rgba(255, 255, 255, .05); border: 1px solid var(--glass-line); border-radius: 20px; padding: 14px; }
.badge { background: rgba(255, 255, 255, .1); font-weight: 700; }
.field { background: rgba(255, 255, 255, .06); border: 1px solid var(--glass-line); border-radius: 14px; padding: 12px 14px; }
.field:focus { outline: none; box-shadow: 0 0 0 2px rgba(123, 92, 255, .8); }
.lbl { color: rgba(255, 255, 255, .55); letter-spacing: .08em; font-size: 11.5px; margin-top: 18px; }

.seg { background: rgba(255, 255, 255, .06); border: 1px solid var(--glass-line); border-radius: 15px; padding: 4px; }
.seg button { border-radius: 11px; padding: 9px 4px; transition: color .2s, background .25s, box-shadow .25s, transform .15s var(--ease); }
.seg button:active { transform: scale(.95); }
.seg button.on { background: var(--grad); color: #fff; box-shadow: 0 4px 16px rgba(255, 61, 110, .35); }

.swatches button { width: 36px; height: 36px; border: 0; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .15); transition: transform .25s var(--spring), box-shadow .2s; }
.swatches button.on { transform: scale(1.12); box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px #fff, 0 6px 18px rgba(0, 0, 0, .4); }

/* Schalter statt Häkchen */
.toggles { gap: 4px; }
.toggles label { justify-content: space-between; padding: 10px 4px; border-bottom: 1px solid rgba(255, 255, 255, .05); font-weight: 600; }
.toggles label:last-child { border-bottom: 0; }
.toggles input[type=checkbox] { order: 2; appearance: none; -webkit-appearance: none; flex: none; width: 50px; height: 30px; margin: 0; border-radius: 99px; background: rgba(255, 255, 255, .16); position: relative; cursor: pointer; transition: background .3s var(--ease), box-shadow .3s; }
.toggles input[type=checkbox]::before { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .35); transition: transform .35s var(--spring); }
.toggles input[type=checkbox]:checked { background: var(--grad); box-shadow: 0 0 16px rgba(255, 61, 110, .35); }
.toggles input[type=checkbox]:checked::before { transform: translateX(20px); }

/* Schieberegler */
input[type=range] { -webkit-appearance: none; appearance: none; height: 28px; background: transparent; }
input[type=range]::-webkit-slider-runnable-track { height: 6px; border-radius: 99px; background: linear-gradient(90deg, rgba(255, 61, 110, .85), rgba(123, 92, 255, .85)); }
input[type=range]::-moz-range-track { height: 6px; border-radius: 99px; background: linear-gradient(90deg, rgba(255, 61, 110, .85), rgba(123, 92, 255, .85)); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; margin-top: -9px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 0 0 4px rgba(255, 61, 110, .35), 0 4px 12px rgba(0, 0, 0, .4); transition: transform .2s var(--spring); }
input[type=range]::-moz-range-thumb { width: 24px; height: 24px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 0 0 4px rgba(255, 61, 110, .35), 0 4px 12px rgba(0, 0, 0, .4); }
input[type=range]:active::-webkit-slider-thumb { transform: scale(1.18); }

/* ------------------------------------------------------------------ Vorschau / Abspielen */
.player { gap: 14px; }
.play-btn { width: 60px; height: 60px; background: var(--grad); box-shadow: var(--glow); position: relative; transition: transform .2s var(--spring); }
.play-btn:active { transform: scale(.9); }
.play-btn::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid rgba(255, 61, 110, .5); animation: ring 2.4s ease-out infinite; pointer-events: none; }
.play-btn svg { width: 28px; height: 28px; }
.time { color: rgba(255, 255, 255, .7); font-weight: 600; }

/* ------------------------------------------------------------------ Musik */
.track-row { background: rgba(255, 255, 255, .05); border-radius: 14px; padding: 7px 12px 7px 7px; transition: background .2s, border-color .2s, transform .15s var(--ease); }
.track-row:active { transform: scale(.98); }
.track-row.sel { border-color: transparent; background: var(--grad-soft); box-shadow: inset 0 0 0 1.5px rgba(255, 61, 110, .8); }
.listen-btn { width: 38px; height: 38px; transition: transform .2s var(--spring); }
.listen-btn:active { transform: scale(.88); }
.listen-btn.on { box-shadow: var(--glow); animation: beat 1s ease-in-out infinite; }
@keyframes beat { 50% { transform: scale(1.08); } }

/* ------------------------------------------------------------------ Export */
.choice { background: rgba(255, 255, 255, .05); border: 1px solid var(--glass-line); border-radius: 20px; padding: 16px; position: relative; transition: transform .15s var(--ease), border-color .25s, box-shadow .25s; }
.choice strong { font-size: 16px; }
.choice .badge { display: none; position: absolute; top: 12px; right: 12px; font-style: normal; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.choice.primary { border-color: rgba(255, 61, 110, .55); background: linear-gradient(135deg, rgba(255, 61, 110, .14), rgba(123, 92, 255, .1)); box-shadow: 0 0 24px rgba(255, 61, 110, .14); }
.choice.primary .badge { display: inline-block; }
.choice.primary strong { padding-right: 96px; }
.choice:active { transform: scale(.98); border-color: rgba(255, 61, 110, .7); box-shadow: 0 0 24px rgba(255, 61, 110, .25); }
.bar { height: 12px; background: rgba(255, 255, 255, .08); }
.bar > div { background: var(--grad); position: relative; overflow: hidden; box-shadow: 0 0 18px rgba(255, 61, 110, .5); }
.bar > div::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .45), transparent); transform: translateX(-100%); animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }
.export-result video { border-radius: 20px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .12), 0 24px 60px rgba(0, 0, 0, .55), 0 0 40px rgba(123, 92, 255, .3); animation: pop-in .5s var(--spring) both; }
@keyframes pop-in { from { opacity: 0; transform: scale(.92) translateY(10px); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------------ Dialoge, Meldungen */
.modal { background: rgba(4, 6, 14, .55); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: fade-in .25s ease both; }
@keyframes fade-in { from { opacity: 0; } }
.modal-card { background: var(--glass-strong); border: 1px solid var(--glass-line); border-radius: 28px 28px 0 0; padding-top: 22px; position: relative; animation: sheet-up .45s var(--spring) both; box-shadow: 0 -20px 60px rgba(0, 0, 0, .45); }
.modal-card::before { content: ""; position: absolute; top: 8px; left: 50%; width: 40px; height: 5px; margin-left: -20px; border-radius: 99px; background: rgba(255, 255, 255, .25); }
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-card h3 { font-size: 20px; letter-spacing: -.02em; }
.grid-modes button { background: rgba(255, 255, 255, .06); border-radius: 18px; transition: transform .2s var(--spring), border-color .2s; }
.grid-modes button:active { transform: scale(.94); }
.grid-modes button.on { border-color: transparent; background: var(--grad-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.proj { background: rgba(255, 255, 255, .06); border-radius: 16px; }
.toast { background: rgba(255, 255, 255, .92); color: #10132a; border-radius: 16px; font-weight: 700; animation: toast-in .4s var(--spring) both; }
.toast.err { background: rgba(255, 196, 208, .95); }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 16px) scale(.96); } to { opacity: 1; transform: translate(-50%, 0); } }

/* Karten-Marker mit Leuchten */
.mc-stop { border-width: 3px; box-shadow: 0 4px 14px rgba(0, 0, 0, .5), 0 0 0 6px rgba(255, 255, 255, .12); }
.mc-stop.end { background: #ff3d6e; box-shadow: 0 4px 14px rgba(0, 0, 0, .5), 0 0 22px rgba(255, 61, 110, .7); }
.mc-stop.start { box-shadow: 0 4px 14px rgba(0, 0, 0, .5), 0 0 22px rgba(46, 230, 184, .6); }

/* ------------------------------------------------------------------ Info/Impressum als Ebene */
.legal { position: fixed; inset: 0; z-index: 70; background: #0f1324; display: flex; flex-direction: column; animation: sheet-up .45s var(--spring) both; }
.legal-bar { position: absolute; top: calc(var(--safe-t) + 8px); right: 10px; z-index: 2; border-radius: 16px; background: var(--glass); border: 1px solid var(--glass-line); }
.legal iframe { flex: 1; width: 100%; border: 0; background: #0f1324; padding-top: var(--safe-t); }

/* ==========================================================================================
   Smartphone & schmale Fenster: Karte randlos, Glas schwebt darüber
   ========================================================================================== */
@media (max-width: 899px) {
  #app { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto auto; grid-template-areas: "top" "stage" "sheet" "tabs"; overflow: hidden; }
  .topbar { grid-area: top; z-index: 6; height: 54px; margin: calc(var(--safe-t) + 8px) 12px 0; padding: 0 8px; border-radius: 20px; box-shadow: var(--shadow); }
  .stage-wrap { grid-area: stage; }
  /* Route: Karte unter allem (auch unter Statusleiste und Dock) */
  #app.mode-route .stage-wrap { grid-area: auto; grid-row: 1 / -1; grid-column: 1; z-index: 0; }
  /* Handy: kein Hinweis-Kasten über der Karte — das Bedienfeld unten erklärt alles, die Karte bleibt frei */
  .stage-empty { display: none !important; }

  .sheet { grid-area: sheet; z-index: 5; margin: 8px 10px 10px; max-height: var(--sheet-h); border-radius: 28px; padding: 0 16px 16px; box-shadow: var(--shadow); transition: max-height .45s var(--spring); overscroll-behavior: contain; }
  .sheet.dragging { transition: none; }
  .sheet-grip { display: flex; justify-content: center; position: sticky; top: 0; z-index: 3; margin: 0 -16px 6px; padding: 10px 0 10px; cursor: grab; touch-action: none; }
  .sheet-grip span { width: 44px; height: 5px; border-radius: 99px; background: rgba(255, 255, 255, .3); transition: width .25s var(--ease), background .25s; }
  .sheet-grip:active span, .sheet.dragging .sheet-grip span { width: 64px; background: var(--grad); }

  .tabbar { grid-area: tabs; z-index: 6; height: 66px; margin: 0 14px calc(var(--safe-b) + 10px); padding: 0; border-radius: 24px; border-top: 1px solid var(--glass-line); box-shadow: var(--shadow); overflow: hidden; }
  .tabbar button { font-size: 11.5px; gap: 3px; }
  .tab-ink { display: block; position: absolute; z-index: 0; top: 6px; bottom: 6px; left: calc(var(--tab-i, 0) * 25% + 6px); width: calc(25% - 12px); border-radius: 18px; background: var(--grad); box-shadow: var(--glow); transition: left .5s var(--spring); }
  .tab-ink::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(180deg, rgba(255, 255, 255, .28), transparent 60%); }

  .toast { bottom: calc(66px + var(--safe-b) + 24px); }
  .modal-card { padding-bottom: calc(18px + var(--safe-b)); }
}

/* Breitbild: Seitenleiste mit denselben Glas-Bausteinen */
@media (min-width: 900px) {
  .topbar { border-radius: 0; border-width: 0 0 1px; }
  .sheet { border-radius: 0; border-width: 0 1px 0 0; }
  .tabbar { border-radius: 0; border-width: 0 1px 1px 0; }
  .tab-ink { display: block; position: absolute; bottom: 0; height: 3px; left: calc(var(--tab-i, 0) * 25% + 6%); width: 13%; background: var(--grad); border-radius: 3px; transition: left .5s var(--spring); }
}

/* ==========================================================================================
   Kartenbedienung: Glasknöpfe, Kompass, Standort, Langdrücken-Welle, Rückgängig
   ========================================================================================== */
.map-tools { display: none; }
#app.mode-route .map-tools { display: block; position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.map-stack, .map-undo { position: absolute; pointer-events: auto; display: flex; gap: 6px; padding: 6px; border-radius: 20px; background: var(--glass); border: 1px solid var(--glass-line); box-shadow: var(--shadow); -webkit-backdrop-filter: blur(22px) saturate(1.5); backdrop-filter: blur(22px) saturate(1.5); }
.map-stack { right: 12px; top: 12px; flex-direction: column; }
.map-undo { left: 12px; top: 12px; transition: opacity .3s, transform .35s var(--spring); }
.map-undo:has(button:disabled + button:disabled) { opacity: 0; transform: translateY(-8px) scale(.9); pointer-events: none; }
.map-btn { width: 42px; height: 42px; border: 0; border-radius: 14px; background: transparent; color: var(--text); display: grid; place-items: center; transition: background .2s, transform .2s var(--spring), opacity .2s; }
.map-btn:active { transform: scale(.88); background: rgba(255, 255, 255, .1); }
.map-btn:disabled { opacity: .3; }
.map-btn .txt { font-weight: 800; font-size: 13px; letter-spacing: .02em; }
.map-btn.on { background: var(--grad); box-shadow: var(--glow); }
.map-sep { height: 1px; margin: 2px 6px; background: rgba(255, 255, 255, .12); }
.compass { animation: pop-in .35s var(--spring) both; }
.compass svg { transition: transform .08s linear; }
.compass .n { fill: var(--accent); stroke: none; }
.compass .s { fill: rgba(255, 255, 255, .85); stroke: none; }
#btn-locate.busy svg { animation: spin 1s linear infinite; }

/* Eigener Standort: blauer Punkt mit Pulsring */
.mc-me { width: 18px; height: 18px; border-radius: 50%; background: #3d8bff; border: 3px solid #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .4); position: relative; }
.mc-me::after { content: ""; position: absolute; inset: -14px; border-radius: 50%; background: rgba(61, 139, 255, .35); animation: me-pulse 2s ease-out infinite; }
@keyframes me-pulse { from { transform: scale(.4); opacity: 1; } to { transform: scale(1.4); opacity: 0; } }

/* Langdrücken: Ring füllt sich, beim Auslösen kurze Welle */
.mc-press { position: absolute; width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%; pointer-events: none; z-index: 4;
  background: conic-gradient(from -90deg, #ff3d6e 0%, #7b5cff var(--p, 0%), rgba(255, 255, 255, .15) 0); -webkit-mask: radial-gradient(circle, transparent 24px, #000 25px); mask: radial-gradient(circle, transparent 24px, #000 25px);
  animation: press-fill .55s linear forwards; }
@property --p { syntax: '<percentage>'; inherits: false; initial-value: 0%; }
@keyframes press-fill { from { --p: 0%; opacity: .2; transform: scale(.7); } 25% { opacity: 1; transform: scale(1); } to { --p: 100%; opacity: 1; } }
.mc-press.done { animation: press-burst .45s var(--ease) forwards; background: rgba(255, 61, 110, .5); -webkit-mask: radial-gradient(circle, transparent 28px, #000 29px); mask: radial-gradient(circle, transparent 28px, #000 29px); }
@keyframes press-burst { to { transform: scale(2.2); opacity: 0; } }

/* Halte und Formpunkte: große Griffflächen (Finger), sichtbares Anheben beim Ziehen */
.mc-stop { position: relative; transition: transform .2s var(--spring); }
.mc-stop::before, .mc-via::before { content: ""; position: absolute; inset: -12px; border-radius: 50%; }
.mc-via { position: relative; }
.maplibregl-marker:active .mc-stop, .mc-stop:active { transform: scale(1.25); }
.mc-via.dragging { width: 26px; height: 26px; box-shadow: 0 0 0 8px rgba(123, 92, 255, .25), 0 6px 16px rgba(0, 0, 0, .45); }

/* Rückgängig-Leiste (Snackbar) */
.undo-bar { position: absolute; left: 50%; z-index: 4; display: flex; align-items: center; gap: 14px; padding: 8px 8px 8px 16px; border-radius: 16px; background: var(--glass-strong); border: 1px solid var(--glass-line); box-shadow: var(--shadow); -webkit-backdrop-filter: blur(22px); backdrop-filter: blur(22px); font-weight: 600; font-size: 14px; white-space: nowrap; transform: translateX(-50%); animation: toast-in .4s var(--spring) both; bottom: 16px; max-width: calc(100% - 24px); }
.undo-bar span { overflow: hidden; text-overflow: ellipsis; }
.undo-bar button { border: 0; border-radius: 11px; padding: 8px 12px; font-weight: 800; color: #fff; background: var(--grad); box-shadow: var(--glow); }

@media (max-width: 899px) {
  .map-stack { top: calc(var(--safe-t) + 74px); right: 12px; }
  .map-undo { top: calc(var(--safe-t) + 74px); left: 12px; }
  .undo-bar { position: fixed; bottom: calc(var(--sheet-h) + 66px + var(--safe-b) + 30px); }
}

/* Bedienfeld einklappen: nur Griff + Kurzinfo, Karte komplett frei */
.sheet-peek { display: none; }
@media (max-width: 899px) {
  #app.mode-route .sheet.collapsed { overflow: hidden; padding-bottom: 0; }
  #app.mode-route .sheet.collapsed .panel { display: none !important; }
  #app.mode-route .sheet.collapsed .sheet-grip { margin-bottom: 0; padding-bottom: 4px; }
  #app.mode-route .sheet.collapsed .sheet-peek { display: block; text-align: center; font-weight: 700; font-size: 14px; color: var(--text); padding: 0 8px 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; animation: fade-in .3s ease both; }
}

.choice:disabled { opacity: .45; pointer-events: none; }

/* Gestaltung, Vorschau, Export: feste Aufteilung halbe/halbe — oben Video/Karte, unten das Panel (scrollt) */
@media (max-width: 899px) {
  #app:not(.mode-route) { grid-template-rows: auto minmax(0, 1fr) minmax(0, 1fr) auto; }
  #app:not(.mode-route) .sheet { max-height: none; min-height: 0; padding-top: 16px; transition: none; }
  #app:not(.mode-route) .sheet-grip, #app:not(.mode-route) .sheet-peek { display: none !important; }
  /* Unten leicht ausblenden: zeigt, dass es weiter nach unten geht */
  #app:not(.mode-route) .sheet { -webkit-mask-image: linear-gradient(#000 calc(100% - 26px), transparent); mask-image: linear-gradient(#000 calc(100% - 26px), transparent); padding-bottom: 30px; }
}

/* Update-Hinweis */
.update-card { text-align: center; padding: 6px 4px 2px; }
.update-card .row { justify-content: center; margin-top: 14px; }
.update-badge { width: 64px; height: 64px; margin: 4px auto 12px; border-radius: 22px; display: grid; place-items: center; font-size: 30px; background: var(--grad); box-shadow: var(--glow); animation: pop-in .5s var(--spring) both; }
.menu-version { margin: 10px 0 0; font-size: 12px; opacity: .45; text-align: center; }
