/* Night Orbit – zwei leuchtende Punkte auf tiefschwarzer Nacht */
:root {
  --bg: #000;
  --glass: rgba(18, 18, 20, .72);
  --glass-hi: rgba(36, 36, 40, .6);
  --card: #0d0d0f;
  --card-2: #161619;
  --card-3: #222226;
  --line: rgba(255, 255, 255, .07);
  --line-2: rgba(255, 255, 255, .12);
  --text: #f4f1ec;
  --text-2: #9b978f;
  --text-3: #5f5c57;
  --ice: #a8bccf;          /* du – gedämpftes Stahlblau */
  --rose: #c9a3ab;         /* sie – gedämpftes Altrosa */
  --amber: #f0a73a;        /* nur Tempowarnung */
  --red: #ff453a;          /* nur SOS und Löschen */
  --green: #32d74b;        /* nur Schalter und Live */
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SamsungOne", "Segoe UI Variable Text", "Segoe UI", Roboto, system-ui, sans-serif;
  --rounded: ui-rounded, "SF Pro Rounded", -apple-system, system-ui, sans-serif;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --spring: cubic-bezier(.32, .72, 0, 1);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --dock: calc(76px + var(--safe-b));
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); overflow: hidden; }
body {
  font: 400 17px/1.3 var(--sans);
  letter-spacing: -.01em;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
  -webkit-user-select: none; user-select: none;
}
input, textarea { -webkit-user-select: text; user-select: text; }
::selection { background: rgba(143, 211, 255, .35); color: #fff; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; letter-spacing: inherit; }
:focus-visible { outline: 2px solid var(--ice); outline-offset: 2px; }
button:disabled { opacity: .3; cursor: default; }
[hidden] { display: none !important; }
svg.i { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.i.s { width: 18px; height: 18px; }
.num { font-variant-numeric: tabular-nums; }
::-webkit-scrollbar { width: 0; height: 0; }

.app { position: fixed; inset: 0; max-width: 520px; margin: 0 auto; overflow: hidden; }

/* ── Karte ── */
#map { position: absolute; inset: 0; background: #000; }
.vignette { position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: linear-gradient(#000 0, rgba(0,0,0,0) 130px), radial-gradient(130% 75% at 50% 35%, transparent 55%, rgba(0,0,0,.6)); }
.maplibregl-ctrl-top-left { top: calc(var(--safe-t) + 66px); left: 4px; }
.maplibregl-ctrl-attrib { background: rgba(0,0,0,.5) !important; color: var(--text-3) !important; font-size: 10px; }
.maplibregl-ctrl-attrib a { color: var(--text-2) !important; }
.maplibregl-ctrl-attrib-button { filter: invert(1) opacity(.4); }

.topbar { position: absolute; z-index: 20; top: calc(var(--safe-t) + 10px); left: 12px; right: 12px; display: flex; align-items: center; gap: 8px; pointer-events: none; }
.topbar > * { pointer-events: auto; }
.topbar .spacer { margin-right: auto; }
.chip-btn { position: relative; height: 44px; min-width: 44px; padding: 0 12px; border-radius: 22px; flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--glass); backdrop-filter: blur(20px) saturate(160%); -webkit-backdrop-filter: blur(20px) saturate(160%); box-shadow: inset 0 0 0 .5px var(--line-2), 0 8px 24px rgba(0,0,0,.4); color: var(--text); transition: background .2s; }
.chip-btn:hover { background: var(--glass-hi); }
.sos-btn { width: 44px; padding: 0; color: #ff6b61; font-size: 11px; font-weight: 700; letter-spacing: .04em; }
.sos-btn:hover { color: #ff8a82; }
.sos-btn::after { content: ""; position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  background: conic-gradient(var(--red) calc(var(--hold, 0) * 1turn), transparent 0);
  -webkit-mask: radial-gradient(closest-side, transparent calc(100% - 2.5px), #000 calc(100% - 2px));
          mask: radial-gradient(closest-side, transparent calc(100% - 2.5px), #000 calc(100% - 2px)); }
.chip-btn:focus-visible { outline-offset: 3px; }

/* Avatare auf der Karte: leuchtende Körper */
.mk { position: relative; width: 52px; height: 52px; }
.mk .bub { position: absolute; inset: 0; border-radius: 50%; padding: 3px; background: var(--text); box-shadow: 0 6px 18px rgba(0,0,0,.65); }
.mk .bub span { width: 100%; height: 100%; border-radius: 50%; display: grid; place-items: center; font: 600 19px/1 var(--sans); color: #fff; background: linear-gradient(180deg, color-mix(in srgb, var(--c) 70%, #444), color-mix(in srgb, var(--c) 45%, #1a1a1c)); }
.mk.stale .bub { filter: grayscale(1) brightness(.55); }
.mk .spd { position: absolute; left: 50%; top: calc(100% + 6px); transform: translateX(-50%); background: rgba(0,0,0,.8); color: var(--text); font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 10px; white-space: nowrap; box-shadow: inset 0 0 0 .5px var(--line-2); font-variant-numeric: tabular-nums; }
.me-dot { position: relative; width: 20px; height: 20px; border-radius: 50%; background: var(--ice); box-shadow: 0 0 0 3px var(--text), 0 3px 10px rgba(0,0,0,.6); }
.me-dot::after { content: ""; position: absolute; inset: -16px; border-radius: 50%; background: rgba(168,188,207,.14); animation: ripple 3.2s var(--ease) infinite; z-index: -1; }
@keyframes ripple { from { transform: scale(.4); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }
.crosshair { position: absolute; z-index: 10; left: var(--cx, 50%); top: var(--cy, 40%); width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: var(--text); box-shadow: 0 0 0 4px rgba(255,255,255,.14), 0 3px 10px rgba(0,0,0,.6); pointer-events: none; }

/* ── Sheet ── */
.sheet {
  position: absolute; z-index: 30; left: 0; right: 0; bottom: 0;
  height: calc(100dvh - var(--safe-t) - 66px);
  background: linear-gradient(rgba(14,14,16,.88), rgba(4,4,6,.96));
  backdrop-filter: blur(40px) saturate(170%); -webkit-backdrop-filter: blur(40px) saturate(170%);
  border-radius: 32px 32px 0 0; display: flex; flex-direction: column;
  box-shadow: inset 0 .5px 0 rgba(255,255,255,.14), 0 -20px 60px rgba(0,0,0,.6);
  transform: translate3d(0, 100%, 0); will-change: transform;
}
.sheet::after { content: ""; position: absolute; left: 0; right: 0; top: calc(100% - 1px); height: 160px; background: rgb(4,4,6); } /* deckt den Spalt beim Nachfedern */
.grab { flex: none; padding: 8px 20px 4px; touch-action: none; cursor: grab; }
.grab::before { content: ""; display: block; width: 38px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.18); margin: 0 auto 12px; }
.sheet-head { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.sheet-head h2 { flex: 1; margin: 0; font: 700 22px/1.2 var(--sans); letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-body { flex: 1; overflow-y: hidden; padding: 12px 16px calc(var(--dock) + 24px); overscroll-behavior: contain; }
.sheet.full .sheet-body, .sheet.half .sheet-body { overflow-y: auto; }
.icon-btn { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--card-2); color: var(--text-2); flex: none; box-shadow: inset 0 0 0 .5px var(--line); transition: background .15s, color .15s, transform .15s var(--ease); }
.icon-btn:hover { background: var(--card-3); color: var(--text); }
.text-btn { color: var(--ice); font-size: 16px; font-weight: 500; padding: 6px 2px; }
.text-btn:hover:not(:disabled) { opacity: .8; }

/* ── Listen ── */
.group { background: var(--card); border-radius: 22px; overflow: hidden; margin-bottom: 22px; box-shadow: inset 0 0 0 .5px var(--line); }
.group-title { font-size: 13px; font-weight: 500; color: var(--text-2); margin: 0 0 8px 18px; }
.group-foot { font-size: 13px; color: var(--text-2); margin: -14px 18px 22px; line-height: 1.4; }
.row { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 56px; padding: 12px 18px; text-align: left; position: relative; transition: background .15s; }
.row + .row::before { content: ""; position: absolute; top: 0; left: var(--inset, 18px); right: 0; border-top: .5px solid var(--line); }
button.row:hover, label.row:hover { background: rgba(255,255,255,.03); }
button.row:active { background: rgba(255,255,255,.06); }
.row .main { flex: 1; min-width: 0; }
.row .t { font-size: 17px; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .t:has(.pill) { display: flex; align-items: center; gap: 8px; }
.row .t b { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.row .t .pill { margin-left: 0; flex: none; vertical-align: 0; }
.row .d { font-size: 15px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 3px; }
.row .end { font-size: 15px; color: var(--text-2); text-align: right; flex: none; font-variant-numeric: tabular-nums; }
.row .chev { color: var(--text-3); }
.row.danger { color: var(--red); justify-content: center; }
.row.action { color: var(--ice); }
.av { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font: 600 17px/1 var(--sans); color: #fff; flex: none; letter-spacing: 0;
  background: linear-gradient(180deg, color-mix(in srgb, var(--c, #8e8e93) 70%, #444), color-mix(in srgb, var(--c, #8e8e93) 42%, #18181a)); box-shadow: inset 0 0 0 .5px rgba(255,255,255,.14); }
.av.sm { width: 32px; height: 32px; font-size: 14px; }
.av.lg { width: 56px; height: 56px; font-size: 22px; }
.tile-ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex: none; background: var(--card-3); color: var(--text); }
.pill { display: inline-flex; align-items: center; gap: 5px; font: 600 11px/1 var(--sans); padding: 4px 8px; border-radius: 999px; background: var(--card-2); color: var(--text-2); vertical-align: 4px; margin-left: 8px; letter-spacing: 0; }
.pill.live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.pill.drive { color: var(--text); }
.batt { display: inline-flex; align-items: center; gap: 5px; }
.batt i { width: 22px; height: 11px; border: 1.5px solid currentColor; border-radius: 3.5px; position: relative; display: inline-block; opacity: .9; }
.batt i::before { content: ""; position: absolute; inset: 1.5px; right: auto; width: calc((100% - 3px) * var(--l)); background: currentColor; border-radius: 1px; }
.batt i::after { content: ""; position: absolute; right: -4px; top: 3px; width: 2px; height: 3.5px; background: currentColor; border-radius: 0 1px 1px 0; }
.batt.low { color: var(--red); }

/* ── Person ── */
.hero { display: flex; align-items: center; gap: 16px; margin: 6px 2px 18px; }
.hero .where { font: 600 20px/1.2 var(--sans); letter-spacing: -.02em; }
.hero .addr { font-size: 15px; color: var(--text-2); margin-top: 4px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--card); border-radius: 22px; margin-bottom: 12px; box-shadow: inset 0 0 0 .5px var(--line); }
.stats div { padding: 14px 6px; text-align: center; min-width: 0; }
.stats div + div { box-shadow: -.5px 0 0 var(--line); }
.stats small { display: block; font-size: 11.5px; color: var(--text-2); margin-bottom: 4px; }
.stats strong { font-size: 17px; font-weight: 600; white-space: nowrap; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 24px; }
.actions button { background: var(--card); border-radius: 20px; padding: 14px 4px 12px; display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 12px; font-weight: 500; color: var(--text); box-shadow: inset 0 0 0 .5px var(--line); transition: background .15s, transform .15s var(--ease); }
.actions button svg { color: var(--text); }
.actions button:hover { background: var(--card-2); }
.tl .row { align-items: flex-start; --inset: 60px; }
.tl .ic { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--card-2); color: var(--text-2); flex: none; margin-top: 1px; }
.tl .ic.sos { color: var(--red); }
.empty { color: var(--text-2); text-align: center; padding: 30px 20px; font-size: 14.5px; line-height: 1.45; }
.empty b { display: block; color: var(--text); font: 600 17px/1.3 var(--sans); margin-bottom: 4px; }

/* ── Formulare ── */
.field { display: block; }
.field span { display: block; font-size: 13px; font-weight: 500; color: var(--text-2); margin: 0 0 8px 18px; }
.input { width: 100%; height: 54px; border-radius: 18px; border: 0; background: var(--card); color: var(--text); font: inherit; font-size: 16px; padding: 0 18px; outline: none; caret-color: var(--ice); box-shadow: inset 0 0 0 .5px var(--line-2); transition: box-shadow .2s; }
.input::placeholder { color: var(--text-3); }
.input:focus { box-shadow: inset 0 0 0 1px var(--text-2); }
.input[aria-invalid="true"] { box-shadow: inset 0 0 0 1.5px var(--red); }
.btn { width: 100%; height: 54px; border-radius: 27px; background: var(--card-2); color: var(--text); font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 8px; box-shadow: inset 0 0 0 .5px var(--line-2); transition: background .15s, transform .15s var(--ease), opacity .15s; }
.btn:hover:not(:disabled) { background: var(--card-3); }
.btn.primary { background: var(--text); color: #000; box-shadow: none; }
.btn.primary:hover:not(:disabled) { background: #fff; }
.err { color: #ff8a80; font-size: 14px; margin: 0 18px; min-height: 1.3em; }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 30px; background: none; }
input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(var(--text), var(--text)) 0 / var(--p, 30%) 100% no-repeat, var(--card-3); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; border-radius: 50%; background: #fff; margin-top: -12px; box-shadow: 0 4px 12px rgba(0,0,0,.5); }
input[type="range"]::-moz-range-track { height: 4px; border-radius: 2px; background: var(--card-3); }
input[type="range"]::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--text); }
input[type="range"]::-moz-range-thumb { width: 28px; height: 28px; border-radius: 50%; background: #fff; border: 0; }
.switch { display: block; position: relative; width: 51px; height: 31px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.switch i { position: absolute; inset: 0; border-radius: 16px; background: var(--card-3); transition: background .25s; pointer-events: none; }
.switch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.4); transition: transform var(--sp-bounce-d, 300ms) var(--sp-bounce, ease); }
.switch input:checked + i { background: var(--green); }
.switch input:checked + i::after { transform: translateX(20px); }
.switch input:focus-visible + i { outline: 2px solid var(--ice); outline-offset: 2px; }
.seg { display: flex; background: var(--card); border-radius: 16px; padding: 3px; margin-bottom: 20px; box-shadow: inset 0 0 0 .5px var(--line); }
.seg button { flex: 1; height: 34px; border-radius: 13px; font-size: 13.5px; font-weight: 500; color: var(--text-2); transition: background var(--sp-snap-d, 250ms) var(--sp-snap, ease), color .2s; }
.seg button[aria-pressed="true"] { background: var(--card-3); color: var(--text); box-shadow: 0 2px 8px rgba(0,0,0,.4); }

/* ── Fahrten ── */
.score { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font: 600 14px/1 var(--sans); flex: none; color: var(--text); background: conic-gradient(var(--c) calc(var(--s) * 1%), var(--card-3) 0); -webkit-mask: radial-gradient(closest-side, transparent 80%, #000 82%); mask: radial-gradient(closest-side, transparent 80%, #000 82%); position: relative; }
.score-wrap { position: relative; width: 38px; height: 38px; flex: none; display: grid; place-items: center; }
.score-wrap span { position: absolute; font: 600 13px/1 var(--sans); font-variant-numeric: tabular-nums; }
.score.good { --c: var(--text); } .score.ok { --c: var(--amber); } .score.bad { --c: var(--red); }

/* ── Chat ── */
.chat { display: flex; flex-direction: column; gap: 4px; padding-bottom: 8px; }
.msg { max-width: 78%; padding: 10px 15px; border-radius: 22px; font-size: 16px; line-height: 1.32; word-wrap: break-word; white-space: pre-wrap; -webkit-user-select: text; user-select: text; }
.msg.new { animation: pop var(--sp-pop-d, 400ms) var(--sp-pop, ease-out) both; }
.msg.new.out { transform-origin: 100% 100%; } .msg.new.in { transform-origin: 0 100%; }
@keyframes pop { from { transform: translate3d(0,14px,0) scale(.6); opacity: 0; } }
.msg.in { align-self: flex-start; background: var(--card-2); border-bottom-left-radius: 8px; box-shadow: inset 0 0 0 .5px var(--line); }
.msg.out { align-self: flex-end; background: var(--text); color: #0a0a0a; border-bottom-right-radius: 8px; }
.msg.img { padding: 4px; background: var(--card-2); }
.msg.img img { display: block; width: 190px; height: 190px; border-radius: 18px; }
.msg-time { align-self: center; font-size: 12px; color: var(--text-3); margin: 14px 0 6px; }
.msg-read { align-self: flex-end; font-size: 12px; color: var(--text-3); margin: 2px 6px 0; }
.composer { display: flex; gap: 8px; align-items: flex-end; padding: 10px 14px calc(var(--dock) + 10px); }
.composer textarea { flex: 1; min-height: 42px; max-height: 120px; resize: none; border-radius: 21px; border: 0; background: var(--card-2); color: var(--text); font: inherit; font-size: 16px; padding: 10px 16px; outline: none; box-shadow: inset 0 0 0 .5px var(--line-2); }
.composer textarea:focus { box-shadow: inset 0 0 0 1px var(--text-3); }
.composer .icon-btn { width: 42px; height: 42px; }
.send { width: 42px; height: 42px; border-radius: 50%; background: var(--text); color: #000; display: grid; place-items: center; flex: none; transition: opacity .15s, transform .2s var(--spring); }
.send:disabled { opacity: .2; }

/* ── Schwebendes Dock ── */
.dock-scrim { position: absolute; z-index: 35; left: 0; right: 0; bottom: 0; height: calc(var(--dock) + 28px); pointer-events: none;
  background: linear-gradient(rgba(4,4,6,0), rgba(4,4,6,.92) 55%, rgb(4,4,6)); transition: opacity .2s; }
body.kbd .dock-scrim { opacity: 0; }
nav.tabs { position: absolute; z-index: 40; left: 50%; bottom: calc(var(--safe-b) + 12px); transform: translateX(-50%); height: 62px; padding: 6px; display: flex; gap: 2px; border-radius: 31px;
  background: rgba(30, 30, 34, .62); backdrop-filter: blur(28px) saturate(180%); -webkit-backdrop-filter: blur(28px) saturate(180%);
  box-shadow: inset 0 .5px 0 rgba(255,255,255,.22), inset 0 0 0 .5px var(--line-2), 0 16px 40px rgba(0,0,0,.7); }
nav.tabs button { position: relative; z-index: 1; width: 62px; border-radius: 25px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--text-2); transition: color .2s, background .3s var(--ease); }
nav.tabs button svg.i { width: 23px; height: 23px; }
nav.tabs button:hover { color: var(--text); }
nav.tabs button[aria-selected="true"] { color: var(--text); }
.dock-ind { position: absolute; left: 0; top: 6px; bottom: 6px; width: 62px; border-radius: 25px; background: rgba(255,255,255,.12); box-shadow: inset 0 .5px 0 rgba(255,255,255,.15); pointer-events: none; will-change: transform; }
.badge { position: absolute; top: 3px; right: 10px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; box-shadow: 0 0 0 2px #1e1e22; }

/* ── Vollbild-Ebenen ── */
.layer { position: absolute; inset: 0; z-index: 60; background: var(--bg); display: flex; flex-direction: column; transform: translate3d(0, 100%, 0); visibility: hidden; will-change: transform; }
.layer-head { touch-action: none; }
.layer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: calc(var(--safe-t) + 12px) 18px 6px; }
.layer-head h2 { margin: 0; font: 600 17px/1.3 var(--sans); }
.layer-body { flex: 1; overflow-y: auto; padding: 8px 20px calc(var(--safe-b) + 24px); display: flex; flex-direction: column; }

/* Tacho */
@media (orientation: portrait) { #cockpit .gauge { margin-top: auto; } #cockpit-foot { margin-bottom: auto !important; } }
#cockpit { background: #000; transition: background .4s; }
#cockpit.hot { background: radial-gradient(75% 45% at 50% 30%, rgba(240,167,58,.08), transparent 70%), #000; }
.gauge { position: relative; width: min(100%, 340px); margin: 16px auto 0; }
.gauge svg { width: 100%; display: block; overflow: visible; }
.gauge .track { stroke: rgba(255,255,255,.06); }
.gauge .val { stroke: var(--text); }
.gauge.over .val { stroke: var(--amber); }
.gauge .cruise { stroke: var(--text-2); }
.readout { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; padding-top: 24px; }
.readout strong { font: 200 96px/1 var(--sans); letter-spacing: -.03em; font-variant-numeric: tabular-nums; transition: color .3s; }
.gauge.over .readout strong { color: var(--amber); }
.readout small { color: var(--text-2); font-size: 15px; margin-top: 4px; }
.cruise-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cruise-row .lbl small { display: block; color: var(--text-2); font-size: 13px; }
.cruise-row .lbl strong { font: 600 20px/1.3 var(--sans); font-variant-numeric: tabular-nums; }
.cruise-row .btn { width: 54px; flex: none; }
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 4px; }
.tiles div { background: var(--card); border-radius: 20px; padding: 14px; box-shadow: inset 0 0 0 .5px var(--line); }
.tiles small { display: block; color: var(--text-2); font-size: 12px; margin-bottom: 6px; }
.tiles strong { font: 600 17px/1.3 var(--sans); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Zeichnen */
.canvas-wrap { position: relative; aspect-ratio: 1; width: 100%; border-radius: 30px; background: radial-gradient(100% 100% at 50% 0%, #101013, #050506); overflow: hidden; touch-action: none; box-shadow: inset 0 0 0 .5px var(--line-2); }
#pad { width: 100%; height: 100%; display: block; cursor: crosshair; }
.pad-hint { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-3); font-size: 15px; pointer-events: none; transition: opacity .3s; }
.tools { display: flex; align-items: center; gap: 6px; margin: 16px 0; }
.swatch { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; }
.swatch span { width: 26px; height: 26px; border-radius: 50%; background: var(--c); transition: transform .2s var(--spring); }
.swatch[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--c); }
.swatch[aria-pressed="true"] span { transform: scale(.66); }
.tools .sp { flex: 1; }

/* SOS-Alarm */
.alarm { position: absolute; inset: 0; z-index: 90; background: radial-gradient(80% 60% at 50% 35%, #3a0606, #0a0000); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 32px; gap: 12px; }
.alarm .ring { width: 104px; height: 104px; border-radius: 50%; background: var(--red); display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 22px; letter-spacing: .08em; animation: alarm 1.2s ease-out infinite; }
@keyframes alarm { 0% { box-shadow: 0 0 0 0 rgba(255,69,58,.6); } 100% { box-shadow: 0 0 0 44px rgba(255,69,58,0); } }
.alarm h2 { margin: 18px 0 0; font: 700 26px/1.2 var(--sans); letter-spacing: -.02em; }
.alarm p { margin: 0 0 12px; color: #ffb3ad; }
.alarm .btn { max-width: 320px; }

/* ── Login / Koppeln ── */
.gate { position: absolute; inset: 0; z-index: 100; background: #000; overflow-y: auto; }
.gate-inner { position: relative; min-height: 100%; display: flex; flex-direction: column; justify-content: flex-end; gap: 14px; padding: calc(var(--safe-t) + 24px) 20px calc(var(--safe-b) + 28px); max-width: 440px; margin: 0 auto; }
.gate form, .gate #pair { display: flex; flex-direction: column; gap: 14px; position: relative; }
.gate h1 { font: 700 34px/1.15 var(--sans); letter-spacing: -.025em; margin: 0; }
.gate .sub { color: var(--text-2); margin: 0 0 14px; font-size: 16px; line-height: 1.45; max-width: 30ch; }
.link { color: var(--text-2); font-size: 14.5px; padding: 10px; align-self: center; }
.link:hover { color: var(--text); }
.orbit-art { position: absolute; left: 50%; top: calc(var(--safe-t) + 40px); width: min(74vw, 320px); aspect-ratio: 1; transform: translateX(-50%); pointer-events: none; }
.orbit-art .o { position: absolute; inset: 0; border-radius: 50%; border: 1px solid rgba(255,255,255,.08); }
.orbit-art .o2 { inset: 20%; border-color: rgba(255,255,255,.06); }
.orbit-art .core { position: absolute; inset: 47%; border-radius: 50%; background: var(--text-3); }
.orbit-art .p { position: absolute; inset: 0; animation: spin 22s linear infinite; }
.orbit-art .p2 { inset: 20%; animation-duration: 13s; animation-direction: reverse; }
.orbit-art .p i { position: absolute; top: -5px; left: calc(50% - 5px); width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.codebox { display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: 22px; padding: 16px 18px; box-shadow: inset 0 0 0 .5px var(--line-2); }
.codebox div { flex: 1; }
.codebox small { display: block; color: var(--text-2); font-size: 13px; margin-bottom: 4px; }
.codebox strong { font: 600 26px/1.2 var(--rounded); letter-spacing: .14em; font-variant-numeric: tabular-nums; }
.codebox .btn { width: auto; height: 42px; padding: 0 16px; }
#in-code { text-transform: uppercase; letter-spacing: .2em; font-size: 20px; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--card-3); border-top-color: var(--text); animation: spin .8s linear infinite; align-self: center; margin-bottom: 40vh; }
@keyframes spin { to { transform: rotate(360deg); } }

.toast { position: absolute; z-index: 120; left: 50%; top: calc(var(--safe-t) + 10px); transform: translate(-50%, -16px) scale(.96); opacity: 0; background: rgba(36,36,40,.85); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); padding: 12px 18px; border-radius: 22px; font-size: 14.5px; font-weight: 500; transition: opacity .2s, transform var(--sp-bounce-d, 350ms) var(--sp-bounce, ease); pointer-events: none; max-width: calc(100% - 32px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: inset 0 0 0 .5px var(--line-2), 0 12px 32px rgba(0,0,0,.6); }
.toast.on { opacity: 1; transform: translate(-50%, 0) scale(1); }

/* Kreise */
.circle-btn { display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; font: 700 22px/1.2 var(--sans); letter-spacing: -.02em; padding: 4px 8px 4px 0; border-radius: 10px; }
.circle-btn span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.circle-btn svg { color: var(--text-2); flex: none; }
.circle-btn:hover svg { color: var(--text); }
.head-sub { color: var(--text-2); font-size: 15px; flex: none; }
.form-row { gap: 12px; }
.form-row .input { flex: 1; min-width: 0; height: auto; padding: 0; background: none; box-shadow: none; }
.form-row .input:focus { box-shadow: none; }
.code-in { text-transform: uppercase; letter-spacing: .14em; }
.code { font: 600 24px/1.2 var(--rounded); letter-spacing: .14em; }
.mini-btn.ghost { background: var(--card-3); color: var(--text); }
.mini-btn.danger { color: var(--red); }
.msg-from { font-size: 12px; font-weight: 600; color: var(--c, var(--text-2)); margin: 8px 0 0 12px; }
.or { display: flex; align-items: center; gap: 12px; color: var(--text-3); font-size: 13px; margin: 6px 0; }
.or::before, .or::after { content: ""; flex: 1; border-top: .5px solid var(--line-2); }

/* Kleine Bedienelemente */
.input.inline { background: none; height: auto; padding: 0; text-align: right; box-shadow: none; width: 55%; color: var(--text-2); }
.input.inline:focus { color: var(--text); box-shadow: none; }
.mini-btn { height: 32px; padding: 0 14px; border-radius: 16px; background: var(--text); color: #000; font-size: 15px; font-weight: 600; }
.stepper { display: flex; align-items: center; gap: 6px; color: var(--text); }
.stepper .num { min-width: 64px; text-align: center; font-size: 15px; }
.step { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--card-3); color: var(--text); }
.step:disabled { opacity: .3; }
.dot-key { width: 10px; height: 10px; border-radius: 50%; flex: none; margin: 0 6px; box-shadow: 0 0 0 2px #000; }
.dot-key.speed { background: #f0a73a; } .dot-key.brake { background: #ff6b61; } .dot-key.accel { background: #a8bccf; } .dot-key.curve { background: #f4f1ec; }
.row .end svg { color: var(--text); }
@media (max-width: 360px) { .row .d { white-space: normal; } .stepper .num { min-width: 52px; } }

/* Tastatur offen: Dock aus dem Weg */
nav.tabs { transition: transform var(--sp-soft-d, 400ms) var(--sp-soft, ease), opacity .2s; }
body.kbd nav.tabs { transform: translate(-50%, 150%); opacity: 0; pointer-events: none; }
body.kbd .composer { padding-bottom: 10px; }
body.kbd .sheet-body { padding-bottom: 24px; }
.topbar { will-change: opacity, transform; }

/* Tablet, Desktop, Handy quer: Seitenleiste wie „Wo ist?“ auf dem iPad */
@media (min-width: 760px), (orientation: landscape) and (max-height: 540px) {
  .app { max-width: none; }
  .sheet { left: 12px; right: auto; top: calc(var(--safe-t) + 12px); bottom: 12px; height: auto; width: min(400px, 44vw); border-radius: 26px; transform: none !important;
    box-shadow: inset 0 0 0 .5px var(--line-2), 0 20px 60px rgba(0,0,0,.6); }
  .sheet::after { display: none; }
  .grab { cursor: default; padding-top: 14px; }
  .grab::before { display: none; }
  nav.tabs { left: calc(12px + min(400px, 44vw) / 2); bottom: calc(var(--safe-b) + 24px); }
  .dock-scrim { left: 12px; right: auto; width: min(400px, 44vw); bottom: 12px; border-radius: 0 0 26px 26px; }
  body.kbd nav.tabs { transform: translate(-50%, 160%); }
  .topbar { left: calc(min(400px, 44vw) + 24px); }
  .maplibregl-ctrl-top-left { left: calc(min(400px, 44vw) + 16px); }
  .layer { left: auto; width: min(440px, 100%); right: 0; box-shadow: -20px 0 60px rgba(0,0,0,.6); }
}
@media (orientation: landscape) and (max-height: 540px) {
  nav.tabs { height: 54px; } nav.tabs button { width: 54px; } nav.tabs button svg.i { width: 21px; height: 21px; }
  .layer { width: 100%; }
  #cockpit .layer-body { display: grid; grid-template-columns: minmax(200px, 44%) 1fr; column-gap: 24px; align-content: center; }
  #cockpit .gauge { grid-row: 1 / span 4; width: min(100%, 300px); margin: 0 auto; }
  #cockpit .group { margin-top: 0 !important; }
  .readout strong { font-size: 76px; }
}
@media (min-width: 1100px) { .dock-scrim { width: 420px; } .sheet { width: 420px; } nav.tabs { left: calc(12px + 210px); } .topbar { left: 444px; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0s !important; }
}
