:root {
  --bg: #020309;
  --violet: #a78bfa;
  --cyan: #22d3ee;
  --bg2: #0b0f15;
  --panel: rgba(12, 12, 26, .62);
  --line: rgba(56, 189, 248, .22);
  --line2: rgba(255, 255, 255, .07);
  --gold: #38bdf8;   /* Akzent Blau (Name historisch) */
  --gold2: #5eead4;  /* Akzent Türkis */
  --amber: #06b6d4;
  --text: #f2ebe0;
  --muted: #8d8778;
  --danger: #ff5a4f;
  --ok: #5fe0a0;
  --chat-w: 340px;
  /* schwebender Text ohne Panel: leichter Glow + dunkler Saum, damit er vor hellen Galaxien lesbar bleibt */
  --float-glow: 0 0 10px rgba(56, 189, 248, .35), 0 1px 2px rgba(0, 0, 0, .9), 0 0 14px rgba(0, 0, 0, .55);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg);
  color: var(--text); font: 15px/1.45 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow: hidden; -webkit-tap-highlight-color: transparent;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }

.bg-grid {
  position: fixed; inset: 0; pointer-events: none; opacity: .5;
  background-image: linear-gradient(var(--line2) 1px, transparent 1px), linear-gradient(90deg, var(--line2) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at 40% 50%, #000 10%, transparent 70%);
}

/* ---------- Kopfzeile */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 5;
  display: flex; align-items: center; gap: 16px;
  padding: calc(12px + var(--safe-t)) 20px 12px;
}
.brand { font-weight: 700; letter-spacing: .32em; font-size: 14px; color: var(--gold2); display: flex; align-items: center; gap: 10px; }
.brand-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 12px var(--gold); }
.status { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; letter-spacing: .04em; }
.status-led { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.status.online .status-led { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.status.offline .status-led { background: var(--danger); }
.top-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.icon-btn {
  width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px;
  background: var(--panel); border: 1px solid var(--line2); backdrop-filter: blur(10px);
}
.icon-btn:hover { border-color: var(--line); color: var(--gold2); }
.chip {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--line2); font-size: 13px; color: var(--muted);
}
.chip-led { width: 8px; height: 8px; border-radius: 50%; background: #3a3a3a; }
.chip[aria-pressed="true"] { color: var(--gold2); border-color: var(--line); }
.chip[aria-pressed="true"] .chip-led { background: var(--gold); box-shadow: 0 0 10px var(--gold); animation: blink 2.4s infinite; }
@keyframes blink { 50% { opacity: .35; } }

/* ---------- Bühne */
.stage { position: fixed; inset: 0; pointer-events: none; display: flex; padding: calc(70px + var(--safe-t)) 20px calc(104px + var(--safe-b)); gap: 20px; }
.core-wrap { position: relative; flex: 1; min-width: 0; display: grid; place-items: center; pointer-events: none; container-type: size; }
.core-body { position: absolute; inset: 0; transition: transform 1.1s cubic-bezier(.2, .8, .2, 1), opacity .8s; transform-origin: 50% 50%; }
#core { position: absolute; inset: 0; width: 100%; height: 100%; }
/* Sprachkern (voicecore.js): eigene Ebene vor der Galaxie und dem Partikel-Kern, nur sichtbar beim Sprechen */
#voiceCore { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
/* Unterbrechen per Klick auf den Kern: nur solange JARVIS spricht/denkt – sonst gehen Klicks an die Galaxie */
.core-hit { position: absolute; left: 50%; top: 50%; width: min(34cqw, 34cqh); aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; pointer-events: auto; cursor: pointer; transition: width .3s; }
/* während JARVIS spricht/denkt: größere Fläche zum Unterbrechen */
body[data-mode="speaking"] .core-hit, body[data-mode="thinking"] .core-hit { width: min(80cqw, 80cqh); }
/* Beim Heranfliegen an ein Ziel rückt der Kern als kleines Instrument in die Ecke */
body.galaxy-focus .core-body { transform: translate(-36%, -34%) scale(.3); }
.core-label {
  position: absolute; bottom: 6%; left: 50%; transform: translateX(-50%);
  font-size: 12px; letter-spacing: .38em; text-transform: uppercase; color: var(--gold2); opacity: .85;
  text-shadow: 0 0 12px rgba(56, 189, 248, .6); white-space: nowrap;
}
.live-caption {
  position: absolute; bottom: calc(6% + 26px); left: 8%; right: 8%; text-align: center;
  color: var(--text); opacity: .8; font-size: 15px; min-height: 1.4em;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}

/* ---------- Chat */
.chat {
  pointer-events: auto;
  width: var(--chat-w); flex: none; display: flex; flex-direction: column;
  background: none; border: 0; overflow: hidden; text-shadow: var(--float-glow);
}
.chat-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; font-size: 12px; letter-spacing: .22em; text-transform: uppercase; color: var(--gold2); }
.link-btn { background: none; border: 0; color: var(--muted); font-size: 12px; letter-spacing: .05em; text-transform: none; text-shadow: inherit; }
.link-btn:hover { color: var(--gold2); }
.chat-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 12px; scroll-behavior: smooth; scrollbar-width: none;
  -webkit-mask-image: linear-gradient(transparent, #000 12%); mask-image: linear-gradient(transparent, #000 12%); }
.chat-log::-webkit-scrollbar { display: none; }
.msg { max-width: 92%; padding: 2px 4px; font-size: 14px; white-space: pre-wrap; word-wrap: break-word; background: none; border: 0; }
.msg.user { align-self: flex-end; text-align: right; color: #bfefff; text-shadow: 0 0 12px rgba(56, 189, 248, .6), 0 1px 2px rgba(0, 0, 0, .9), 0 0 14px rgba(0, 0, 0, .55); }
.msg.assistant { align-self: flex-start; color: #f4f1ff; }
.msg.system, .msg.tool { align-self: center; font-size: 12px; color: var(--muted); text-align: center; }
.msg.error { align-self: center; font-size: 12.5px; color: #ffb2ac; text-shadow: 0 0 10px rgba(255, 90, 79, .55), 0 1px 2px rgba(0, 0, 0, .9); }
.approval { align-self: stretch; padding: 4px; font-size: 13.5px; }
.approval h4 { margin: 0 0 6px; font-size: 12px; letter-spacing: .15em; text-transform: uppercase; color: var(--gold2); text-shadow: 0 0 12px var(--gold), 0 1px 2px rgba(0, 0, 0, .9); }
.approval pre { margin: 6px 0 10px; white-space: pre-wrap; font: inherit; color: var(--text); max-height: 220px; overflow: auto; }
.approval .btns { display: flex; gap: 18px; }
.approval .btns button { padding: 4px 0; border: 0; background: none; color: var(--muted); letter-spacing: .12em; text-transform: uppercase; font-size: 12px; text-shadow: inherit; }
.approval .btns .ok { color: var(--gold2); font-weight: 600; text-shadow: 0 0 12px var(--gold), 0 1px 2px rgba(0, 0, 0, .9); }
.approval .btns button:hover { color: #fff; }
.chat-input { display: flex; gap: 8px; padding: 10px 4px; }
.chat-input input { flex: 1; min-width: 0; background: none; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 8px 2px; outline: none; text-shadow: inherit; }
.chat-input input::placeholder { color: var(--muted); }
.chat-input input:focus { border-bottom-color: var(--gold2); box-shadow: 0 6px 10px -8px var(--gold2); }
.chat-input button { width: 36px; border: 0; background: none; color: var(--gold2); display: grid; place-items: center; filter: drop-shadow(0 0 6px var(--gold)); }
.chat-input button:hover { color: #fff; }
.chat-input button svg { fill: currentColor; stroke: none; }
body.chat-hidden .chat { display: none; }

/* ---------- Gesprächsknopf */
.dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; display: flex; justify-content: center; padding: 16px 16px calc(22px + var(--safe-b)); pointer-events: none; }
.talk-btn {
  pointer-events: auto; position: relative; min-width: 240px; padding: 16px 30px; border-radius: 999px;
  background: linear-gradient(180deg, #38bdf8, #14b8a6); color: #031318; border: 0;
  font-weight: 700; letter-spacing: .08em; font-size: 15px; text-transform: uppercase;
  box-shadow: 0 0 0 1px rgba(94, 234, 212, .6), 0 10px 40px rgba(20, 184, 166, .35);
  transition: transform .15s, box-shadow .2s;
}
.talk-btn:active { transform: scale(.97); }
.talk-btn.active { background: linear-gradient(180deg, #0b2230, #071720); color: var(--gold2); box-shadow: 0 0 0 1px var(--gold), 0 0 30px rgba(56, 189, 248, .35); }
.talk-ring { position: absolute; inset: -6px; border-radius: inherit; border: 1px solid rgba(56, 189, 248, .5); opacity: 0; }
.talk-btn.active .talk-ring { animation: ring 1.8s ease-out infinite; }
@keyframes ring { 0% { opacity: .8; transform: scale(1); } 100% { opacity: 0; transform: scale(1.15); } }

/* ---------- Einstellungen */
.drawer { position: fixed; inset: 0; z-index: 20; background: none; display: flex; justify-content: flex-end; }
.drawer-panel { width: min(480px, 100%); height: 100%; overflow-y: auto; background: none; border: 0; padding: calc(16px + var(--safe-t)) 20px calc(30px + var(--safe-b)); text-shadow: var(--float-glow); scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; }
.drawer-head h2 { font-size: 16px; letter-spacing: .25em; text-transform: uppercase; color: var(--gold2); margin: 0; text-shadow: 0 0 14px var(--gold), 0 1px 2px rgba(0, 0, 0, .9); }
.drawer-head .icon-btn { background: none; border: 0; backdrop-filter: none; color: var(--gold2); }
/* ohne Panel-Hintergrund würden Einstellungen und Verlauf ineinanderlaufen: Verlauf solange ausblenden */
.drawer .drawer-panel { padding-top: calc(64px + var(--safe-t)); }
body:has(#drawer:not([hidden])) .chat { visibility: hidden; }
fieldset { border: 1px solid var(--line2); border-radius: 14px; padding: 12px 14px 14px; margin: 16px 0; display: flex; flex-direction: column; gap: 10px; }
.drawer fieldset { border: 0; border-radius: 0; padding: 0; margin: 26px 0; }
.drawer legend { padding: 0 0 6px; text-shadow: 0 0 12px var(--gold), 0 1px 2px rgba(0, 0, 0, .9); }
.drawer label { color: #c9c3d8; }
.drawer label.check { color: var(--text); }
.drawer input:not([type="checkbox"]), .drawer select { background: none; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 7px 2px; text-shadow: inherit; }
.drawer input:not([type="checkbox"]):focus, .drawer select:focus { border-bottom-color: var(--gold2); box-shadow: 0 6px 10px -8px var(--gold2); }
.drawer select option { background: var(--bg); color: var(--text); text-shadow: none; }
.drawer .btn-primary, .drawer .btn-ghost { background: none; border: 0; border-radius: 0; padding: 6px 0; text-align: left; align-self: flex-start; width: auto;
  color: var(--gold2); letter-spacing: .14em; text-transform: uppercase; font-size: 12.5px; text-shadow: 0 0 12px var(--gold), 0 1px 2px rgba(0, 0, 0, .9); }
.drawer .btn-primary { font-size: 14px; font-weight: 700; padding: 10px 0; }
.drawer .btn-primary::before, .drawer .btn-ghost::before { content: "› "; opacity: .6; }
.drawer .btn-primary:hover, .drawer .btn-ghost:hover { color: #fff; }
.drawer .btn-ghost.danger { color: #ffb2ac; text-shadow: 0 0 10px rgba(255, 90, 79, .55), 0 1px 2px rgba(0, 0, 0, .9); }
.drawer .test-out { background: none; border: 0; padding: 0; }
.drawer .test-out.ok { color: var(--ok); }
.drawer .test-out.bad { color: #ffb2ac; }
legend { padding: 0 6px; color: var(--gold2); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; }
label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--muted); }
label small { color: var(--ok); font-size: 11.5px; }
label.check { flex-direction: row; align-items: flex-start; gap: 10px; color: var(--text); }
label.check input { margin-top: 3px; accent-color: var(--gold); width: auto; flex: none; }
input, select { background: rgba(0, 0, 0, .35); border: 1px solid var(--line2); border-radius: 10px; padding: 9px 11px; outline: none; color: var(--text); width: 100%; }
input:focus, select:focus { border-color: var(--gold); }
.row { display: flex; gap: 10px; }
.row label { flex: 1; min-width: 0; }
.row label.port { flex: 0 0 90px; }
.btn-primary { width: 100%; padding: 12px; border: 0; border-radius: 12px; background: linear-gradient(180deg, #38bdf8, #14b8a6); color: #031318; font-weight: 700; letter-spacing: .06em; }
.btn-ghost { padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line); background: transparent; color: var(--gold2); }
.btn-ghost.danger { border-color: rgba(255, 90, 79, .4); color: #ffb2ac; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; margin: 0; }
.test-out { white-space: pre-wrap; font-size: 13px; padding: 10px; border-radius: 10px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line2); max-height: 200px; overflow: auto; }
.test-out.ok { border-color: rgba(95, 224, 160, .4); }
.test-out.bad { border-color: rgba(255, 90, 79, .4); }

.toast { position: fixed; left: 50%; top: calc(70px + var(--safe-t)); transform: translateX(-50%); z-index: 30; background: var(--bg2); border: 1px solid var(--line); padding: 10px 16px; border-radius: 12px; font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.5); max-width: calc(100% - 32px); }

/* ---------- Login */
.login-body { display: grid; place-items: center; min-height: 100%; overflow: auto; padding: 16px; }
.login-card { width: min(360px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 28px 24px; display: flex; flex-direction: column; gap: 14px; text-align: center; box-shadow: 0 0 80px rgba(20, 184, 166, .12); }
.login-card h1 { margin: 0; letter-spacing: .35em; font-size: 20px; color: var(--gold2); }
.login-card label { text-align: left; }
.login-card p { margin: 0; }
.login-error { color: #ffb2ac; font-size: 13.5px; }
.mini-core { position: relative; width: 84px; height: 84px; margin: 0 auto 4px; }
.mini-core i { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--gold); opacity: .5; animation: spin 6s linear infinite; border-right-color: transparent; }
.mini-core i:nth-child(2) { inset: 14px; animation-duration: 3.5s; animation-direction: reverse; opacity: .8; border-left-color: transparent; }
.mini-core i:nth-child(3) { inset: 30px; background: radial-gradient(circle, #cffafe, #06b6d4 70%); border: 0; opacity: 1; box-shadow: 0 0 30px #06b6d4; animation: pulse 2.2s ease-in-out infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { transform: scale(.85); } }

/* ---------- Mobil */
@media (max-width: 820px) {
  :root { --chat-w: 100%; }
  .stage { flex-direction: column; padding: calc(62px + var(--safe-t)) 12px calc(92px + var(--safe-b)); gap: 10px; }
  .core-wrap { flex: 1 1 55%; min-height: 240px; }
  .chat { flex: 0 1 42%; min-height: 0; border-radius: 16px; }
  .topbar { padding: calc(10px + var(--safe-t)) 12px 10px; gap: 10px; }
  .status { display: none; }
  .brand { font-size: 12px; letter-spacing: .25em; }
  .chip span:last-child { font-size: 12px; }
  .talk-btn { min-width: 0; width: min(320px, 100%); padding: 15px 20px; font-size: 14px; }
  .dock { padding-bottom: calc(14px + var(--safe-b)); }
  body.chat-hidden .core-wrap { flex-basis: 100%; }
}
@media (max-width: 380px) {
  .chip span:last-child { display: none; }
}
a.btn-ghost { display: inline-block; text-decoration: none; text-align: center; }
.msg.image { align-self: center; margin: 0; padding: 0; max-width: min(92%, 520px); }
.msg.image img { display: block; width: 100%; height: auto; border-radius: 10px; }
.msg.image figcaption { font-size: 12px; color: var(--muted); padding: 5px 4px 1px; white-space: normal; }

/* ---------- Galaxie */
#galaxy { position: fixed; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; touch-action: none; cursor: grab; outline: none; }
#galaxy.grabbing { cursor: grabbing; }
#galaxy.hovering { cursor: pointer; }
body.no-webgl { background: radial-gradient(ellipse at 40% 45%, rgba(139, 92, 246, .22), transparent 55%), radial-gradient(ellipse at 70% 60%, rgba(34, 211, 238, .12), transparent 50%), var(--bg); }
body.no-webgl #galaxy { display: none; }
.hud { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.poi-marker { position: absolute; left: 0; top: 0; opacity: 0; transition: opacity .35s; will-change: transform; --c: var(--violet); }
.poi-marker i { position: absolute; left: -9px; top: -9px; width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--c); box-shadow: 0 0 10px var(--c), inset 0 0 6px var(--c); transition: transform .3s; }
.poi-marker i::after { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: var(--c); }
.poi-marker span { position: absolute; left: 18px; top: -8px; white-space: nowrap; font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: #e9e4ff; text-shadow: 0 0 8px var(--c); opacity: 0; transform: translateX(-6px); transition: opacity .3s, transform .3s; }
.poi-marker.hot i { transform: scale(1.6); animation: poiSpin 2.4s linear infinite; border-style: dashed; }
.poi-marker.hot span { opacity: 1; transform: none; }
@keyframes poiSpin { to { transform: scale(1.6) rotate(360deg); } }
.poi-tag { position: absolute; top: 4px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 18px; border-radius: 14px; background: rgba(10, 10, 24, .55); border: 1px solid color-mix(in srgb, var(--c, #a78bfa) 45%, transparent); backdrop-filter: blur(10px); box-shadow: 0 0 30px color-mix(in srgb, var(--c, #a78bfa) 25%, transparent); animation: tagIn .5s ease-out; }
.poi-tag b { font-size: 13px; letter-spacing: .3em; text-transform: uppercase; color: #f1edff; font-weight: 600; }
.poi-tag small { font-size: 11.5px; color: #a9a3c7; letter-spacing: .04em; }
@keyframes tagIn { from { opacity: 0; transform: translate(-50%, -8px); } }
.galaxy-hint { position: absolute; top: 4px; left: 50%; transform: translateX(-50%); font-size: 12px; color: #a9a3c7; letter-spacing: .06em; white-space: nowrap; padding: 6px 14px; border-radius: 999px; background: rgba(10, 10, 24, .45); border: 1px solid rgba(167, 139, 250, .18); transition: opacity .8s; }
.galaxy-hint.gone { opacity: 0; }
body.galaxy-focus .galaxy-hint { display: none; }
/* Fingerspitzen der Handerkennung – jede ist ein eigener Kraftpunkt */
.tip-dot { position: absolute; left: -9px; top: -9px; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--cyan); box-shadow: 0 0 12px var(--cyan), inset 0 0 6px rgba(34, 211, 238, .5); will-change: transform; transition: border-color .2s, box-shadow .2s; }
.tip-dot::after { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: var(--cyan); }
.tip-dot.thumb { border-style: dashed; }
.tip-dot.pinch { border-color: #d946ef; box-shadow: 0 0 16px #d946ef, inset 0 0 8px rgba(217, 70, 239, .5); }
.tip-dot.pinch::after { background: #d946ef; }
/* Öffnungsgrad der Hand: links Faust (raus), rechts offen (rein), Mitte = Ruhezone */
.hand-zoom { position: absolute; left: 8px; right: 8px; top: 7px; height: 4px; border-radius: 2px; background: linear-gradient(90deg, rgba(217, 70, 239, .5), rgba(255, 255, 255, .15) 38% 62%, rgba(34, 211, 238, .5)); --o: .5; }
.hand-zoom i { position: absolute; top: -3px; left: calc(var(--o) * 100%); width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; background: #fff; box-shadow: 0 0 8px #fff; transition: background .2s, box-shadow .2s; }
.hand-zoom[data-dir="in"] i { background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }
.hand-zoom[data-dir="out"] i { background: #d946ef; box-shadow: 0 0 10px #d946ef; }
.cam-chip svg { width: 16px; height: 16px; }
.cam-chip[aria-pressed="true"] { color: #d9ccff; border-color: rgba(167, 139, 250, .45); }
.cam-chip[aria-pressed="true"] .chip-led { background: var(--cyan); box-shadow: 0 0 10px var(--cyan); animation: blink 2.4s infinite; }
.cam-chip.loading .chip-led { background: var(--violet); animation: blink .6s infinite; }
.cam-preview { position: fixed; left: 16px; bottom: calc(22px + var(--safe-b)); z-index: 6; width: 160px; height: 120px; border-radius: 12px; overflow: hidden; border: 1px solid rgba(34, 211, 238, .4); box-shadow: 0 0 24px rgba(34, 211, 238, .18); background: #000; pointer-events: none; }
.cam-preview video, .cam-preview canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cam-preview video { transform: scaleX(-1); opacity: .55; }
.cam-preview span { position: absolute; left: 6px; bottom: 5px; font-size: 10px; letter-spacing: .08em; color: #cffafe; display: flex; align-items: center; gap: 5px; text-shadow: 0 1px 3px #000; }
.cam-preview span i { width: 6px; height: 6px; border-radius: 50%; background: #ff4d6d; box-shadow: 0 0 6px #ff4d6d; }
@media (max-width: 820px) {
  .cam-chip span:last-child { display: none; }
  .cam-preview { width: 112px; height: 84px; bottom: calc(86px + var(--safe-b)); left: 12px; }
  .galaxy-hint { font-size: 11px; white-space: normal; text-align: center; width: max-content; max-width: 92%; }
  body.galaxy-focus .core-body { transform: translate(-34%, -30%) scale(.36); }
}
@media (prefers-reduced-motion: reduce) { .core-body { transition: none; } }
.chip { white-space: nowrap; }
@media (max-width: 440px) {
  .top-actions { gap: 6px; }
  .brand { letter-spacing: .16em; font-size: 11px; gap: 7px; }
  .chip { padding: 8px 10px; }
}

/* ---------- Galaxie-Ebenen (unten Privat, Mitte Informationen, oben JARVIS-System) */
.levels { position: fixed; left: 16px; top: 50%; transform: translateY(-50%); z-index: 5; display: flex; flex-direction: column; gap: 6px; padding: 8px 8px 8px 18px; border-radius: 16px; background: rgba(10, 10, 24, .5); border: 1px solid rgba(255, 255, 255, .07); backdrop-filter: blur(10px); --c: #22d3ee; }
.levels-track { position: absolute; left: 8px; top: 12px; bottom: 12px; width: 2px; border-radius: 2px; background: rgba(255, 255, 255, .08); }
.levels-track b { position: absolute; left: 0; top: 0; width: 2px; height: 33.34%; border-radius: 2px; background: var(--c); box-shadow: 0 0 10px var(--c); transition: transform .9s cubic-bezier(.2, .8, .2, 1), background .9s; }
.levels button { display: flex; align-items: center; gap: 10px; padding: 7px 12px 7px 8px; border: 1px solid transparent; border-radius: 12px; background: none; color: #a9a3c7; text-align: left; transition: background .3s, border-color .3s, color .3s; }
.levels button i { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--c); opacity: .45; box-shadow: 0 0 0 transparent; transition: opacity .3s, box-shadow .3s, transform .3s; }
.levels button span { display: flex; flex-direction: column; line-height: 1.2; }
.levels button b { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; }
.levels button small { font-size: 10.5px; opacity: .7; }
.levels button:hover { color: #e9e4ff; background: rgba(255, 255, 255, .04); }
.levels button:hover i { opacity: .8; }
.levels button.on { color: #fff; border-color: color-mix(in srgb, var(--c) 45%, transparent); background: color-mix(in srgb, var(--c) 12%, transparent); }
.levels button.on i { opacity: 1; transform: scale(1.25); box-shadow: 0 0 12px var(--c); }
.level-title { position: absolute; left: 50%; top: 18%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 6px; opacity: 0; pointer-events: none; --c: #22d3ee; }
.level-title b { font-size: clamp(22px, 3.4vw, 40px); font-weight: 300; letter-spacing: .5em; text-transform: uppercase; color: #fff; text-shadow: 0 0 24px var(--c), 0 0 60px var(--c); white-space: nowrap; }
.level-title small { font-size: 12px; letter-spacing: .3em; text-transform: uppercase; color: color-mix(in srgb, var(--c) 60%, #fff); }
.level-title.show { animation: levelIn 2.4s ease-out forwards; }
@keyframes levelIn { 0% { opacity: 0; transform: translate(-50%, 14px); filter: blur(6px); } 18% { opacity: 1; transform: translate(-50%, 0); filter: none; } 70% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -8px); } }
.chip[aria-pressed="true"] .chip-led, .brand-dot { transition: background .9s, box-shadow .9s; }
@media (max-width: 820px) {
  .levels { left: 8px; top: calc(66px + var(--safe-t)); transform: none; padding: 6px 6px 6px 14px; gap: 2px; }
  .levels-track { left: 6px; }
  .levels button { padding: 6px; }
  .levels button span { display: none; }
  .level-title { top: 12%; }
  .level-title b { letter-spacing: .3em; }
}
@media (prefers-reduced-motion: reduce) { .level-title.show { animation-duration: 1.2s; } }

/* Großer Kern blendet beim Ebenenwechsel aus und wächst bei der Ankunft (--arrive setzt galaxy.js) */
#core { transform: scale(calc(.55 + .45 * var(--arrive, 1))); opacity: var(--arrive, 1); }
.core-mark span { left: 0; top: 0; transform: translate(-50%, -50%); padding: 4px 10px; border-radius: 999px; background: rgba(10, 10, 24, .6); border: 1px solid color-mix(in srgb, var(--c) 50%, transparent); }
.core-mark.hot span { transform: translate(-50%, -50%); }

/* Beim Drehen der Galaxie nichts markieren; Chat und Eingaben bleiben markierbar */
body { -webkit-user-select: none; user-select: none; }
.chat-log, input, textarea, select, .drawer-panel, .test-out { -webkit-user-select: text; user-select: text; }

/* ---------- Desktop-App: Home-Assistant-Knopf */
#haBtn svg { width: 16px; height: 16px; }
@media (max-width: 820px) { #haBtn span { display: none; } }
