[hidden] { display: none !important; }
@font-face { font-family: Geist; src: url(/fonts/geist.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url(/fonts/jbm-500.woff2) format("woff2"); font-weight: 500; font-display: swap; }
:root {
  --bg: #050506; --panel: rgba(16, 17, 16, .82); --line: rgba(255, 255, 255, .10); --text: #f3f4f8; --mute: #9c9890; --accent: #E9A35B;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px); --mono: "JetBrains Mono", ui-monospace, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; background: var(--bg); color: var(--text); font: 15px/1.4 Geist, -apple-system, system-ui, sans-serif; -webkit-font-smoothing: antialiased; overflow: hidden; overscroll-behavior: none; }
#map { position: fixed; inset: 0; }
button, input, label { font: inherit; color: inherit; -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; border: 0; background: none; }
input { background: none; border: 0; outline: 0; }

.top { position: fixed; z-index: 5; top: calc(var(--safe-t) + 10px); left: 10px; right: 10px; display: flex; gap: 8px; align-items: flex-start; }
.round { flex: none; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--panel); border: 1px solid var(--line); backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4); }
.round svg { width: 20px; height: 20px; }
.search { position: relative; flex: 1; min-width: 0; height: 42px; display: flex; align-items: center; gap: 8px; padding: 0 14px; border-radius: 21px; background: var(--panel); border: 1px solid var(--line); backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4); }
.search svg { flex: none; width: 17px; height: 17px; color: var(--mute); }
.search input { flex: 1; min-width: 0; font-size: 16px; }
.search input::placeholder { color: var(--mute); }
#hits { position: absolute; left: 0; right: 0; top: 48px; list-style: none; padding: 6px; border-radius: 18px; background: rgba(14, 15, 19, .96); border: 1px solid var(--line); backdrop-filter: blur(20px); max-height: 50vh; overflow: auto; }
#hits li { padding: 10px 12px; border-radius: 12px; font-size: 14px; cursor: pointer; }
#hits li small { display: block; color: var(--mute); font-size: 12px; }
#hits li:active, #hits li:hover { background: rgba(255, 255, 255, .08); }

.menu { position: fixed; z-index: 6; right: 10px; top: calc(var(--safe-t) + 58px); display: grid; padding: 6px; border-radius: 18px; background: rgba(14, 15, 19, .96); border: 1px solid var(--line); backdrop-filter: blur(20px); min-width: 190px; }
.menu button { text-align: left; padding: 11px 14px; border-radius: 12px; font-size: 14px; color: var(--mute); display: flex; justify-content: space-between; gap: 18px; }
.menu button::after { content: ""; width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: transparent; border: 1px solid var(--mute); }
.menu button[aria-pressed="true"] { color: var(--text); }
.menu button[aria-pressed="true"]::after { background: var(--accent); border-color: var(--accent); }

.toast { position: fixed; z-index: 7; left: 50%; top: calc(var(--safe-t) + 66px); transform: translateX(-50%); max-width: min(92vw, 420px); padding: 10px 16px; border-radius: 999px; background: rgba(14, 15, 19, .96); border: 1px solid var(--line); font-size: 13px; text-align: center; }
.toast.err { border-color: rgba(255, 120, 120, .5); }

.sheet { position: fixed; z-index: 4; left: 0; right: 0; bottom: 0; max-width: 560px; margin: 0 auto; padding: 4px 14px calc(var(--safe-b) + 12px); border-radius: 24px 24px 0 0; background: var(--panel); border: 1px solid var(--line); border-bottom: 0; backdrop-filter: blur(24px) saturate(1.4); -webkit-backdrop-filter: blur(24px) saturate(1.4); max-height: 78vh; overflow-y: auto; overscroll-behavior: contain; transition: transform .28s cubic-bezier(.2, .8, .2, 1); }
.sheet[data-open="false"] { max-height: calc(172px + var(--safe-b)); overflow: hidden; }
.grip { display: block; width: 100%; height: 20px; position: sticky; top: 0; z-index: 1; }
.grip i { display: block; width: 38px; height: 4px; margin: 8px auto 0; border-radius: 2px; background: rgba(255, 255, 255, .22); }

.tabs2 { display: flex; gap: 18px; margin: 2px 0 10px; }
.tabs2 button { font: 500 12px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--mute); padding: 6px 0; border-bottom: 1.5px solid transparent; }
.tabs2 button[aria-selected="true"] { color: var(--text); border-color: var(--accent); }
.tabs2 em { font-style: normal; color: var(--mute); }

.row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.seg { display: inline-flex; padding: 3px; border-radius: 12px; background: rgba(255, 255, 255, .05); border: 1px solid var(--line); }
.seg button { padding: 6px 12px; border-radius: 9px; font-size: 13px; color: var(--mute); transition: background .2s, color .2s; }
.seg button[aria-pressed="true"] { background: rgba(255, 255, 255, .13); color: var(--text); }
.seg.off { opacity: .35; pointer-events: none; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 8px; }
.stats dt { font-size: 10px; color: var(--mute); margin-bottom: 3px; }
.stats dd { font: 500 18px/1.1 var(--mono); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }

.prof { position: relative; height: 74px; margin: 0 -2px 10px; touch-action: none; }
.prof svg { width: 100%; height: 100%; display: block; }
.prof .tip { position: absolute; top: -2px; transform: translateX(-50%); padding: 3px 8px; border-radius: 8px; background: rgba(0, 0, 0, .85); border: 1px solid var(--line); font: 500 11px/1.2 var(--mono); white-space: nowrap; pointer-events: none; }

.tools { display: flex; gap: 6px; overflow-x: auto; margin: 0 -14px 10px; padding: 0 14px; scrollbar-width: none; }
.tools::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 8px 13px; border-radius: 999px; font-size: 13px; background: rgba(255, 255, 255, .07); border: 1px solid var(--line); }
.chip:active { transform: scale(.96); }
.chip:disabled { opacity: .35; }
.chip[aria-pressed="true"] { border-color: color-mix(in srgb, var(--accent) 60%, transparent); }

.loopbox { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; margin-bottom: 10px; border-radius: 16px; background: rgba(255, 255, 255, .05); border: 1px solid var(--line); }
.loopbox label { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.loopbox input { width: 56px; text-align: right; padding: 6px 8px; border-radius: 9px; background: rgba(255, 255, 255, .08); font: 500 15px var(--mono); }
.loopbox small { flex-basis: 100%; color: var(--mute); font-size: 12px; }

.save { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.save input { flex: 1 1 140px; min-width: 0; padding: 11px 14px; border-radius: 14px; background: rgba(255, 255, 255, .07); border: 1px solid var(--line); font-size: 16px; }
.pill { display: inline-flex; align-items: center; justify-content: center; padding: 11px 16px; border-radius: 999px; font-size: 14px; font-weight: 500; background: rgba(255, 255, 255, .09); border: 1px solid var(--line); cursor: pointer; }
.pill:active { transform: scale(.96); }
.pill.primary { background: var(--text); color: #000; border-color: transparent; }
.pill:disabled { opacity: .4; }

.help { margin-top: 12px; color: var(--mute); font-size: 13px; }
.help summary { cursor: pointer; list-style: none; font: 500 11px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; padding: 4px 0; }
.help summary::-webkit-details-marker { display: none; }
.help p { margin: 8px 0; line-height: 1.5; }
.pace { display: flex; align-items: center; gap: 6px; }
.pace input { width: 56px; padding: 5px 8px; border-radius: 9px; background: rgba(255, 255, 255, .08); font: 500 14px var(--mono); text-align: center; color: var(--text); }

.list { list-style: none; padding: 0; display: grid; }
.list li { display: flex; align-items: center; gap: 12px; padding: 12px 2px; border-top: 1px solid var(--line); cursor: pointer; }
.list li:first-child { border-top: 0; }
.list .nm { flex: 1; min-width: 0; }
.list .nm b { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list .nm small { color: var(--mute); font: 500 12px var(--mono); }
.list .del { width: 34px; height: 34px; border-radius: 50%; color: var(--mute); font-size: 20px; line-height: 1; }
.list .del:hover { color: #ff8a8a; }
.empty { color: var(--mute); padding: 18px 0; text-align: center; font-size: 14px; }

/* Karte */
.wp { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 3px solid #0b0c10; box-shadow: 0 0 0 2px var(--accent); cursor: grab; }
.wp.start { background: #54e08a; box-shadow: 0 0 0 2px #54e08a; }
.wp.end { background: var(--accent); }
.wp::after { content: ""; position: absolute; inset: -12px; }
.scrub { width: 12px; height: 12px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px rgba(128, 149, 255, .4), 0 0 16px 4px rgba(128, 149, 255, .7); }
.drop { position: fixed; inset: 0; z-index: 9; display: grid; place-items: center; background: rgba(0, 0, 0, .7); font-size: 20px; border: 2px dashed var(--accent); pointer-events: none; }
.busy { position: fixed; z-index: 7; left: 50%; top: calc(var(--safe-t) + 66px); width: 26px; height: 26px; margin-left: -13px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .15); border-top-color: var(--accent); animation: sp .8s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }
.maplibregl-ctrl-attrib { background: rgba(0, 0, 0, .4) !important; color: #777 !important; font-size: 10px; }
.maplibregl-ctrl-attrib a { color: #999 !important; }
@media (max-width: 699px) { .maplibregl-ctrl-bottom-right { bottom: calc(176px + var(--safe-b)); } }
@media (min-width: 700px) { .grip { display: none; } .sheet[data-open="false"] { max-height: calc(100vh - 90px); overflow-y: auto; } .sheet { left: 14px; right: auto; width: 440px; margin: 0; bottom: 14px; border-radius: 24px; border-bottom: 1px solid var(--line); max-height: calc(100vh - 90px); } }
@media (prefers-reduced-motion: reduce) { .sheet, .busy { transition: none; animation: none; } }
@media (max-width: 520px) { .row .seg button { padding: 6px 10px; } .save input { flex: 1 1 100%; } .save .pill { flex: 1; padding: 11px 10px; } }
