:root {
  --bg: #07080b;
  --bg2: #0d0f14;
  --panel: rgba(18, 20, 27, .86);
  --panel2: #151820;
  --line: #262a35;
  --line2: #343a48;
  --text: #e8e6e3;
  --muted: #8d919c;
  --dim: #5c616d;
  --red: #ff2350;
  --red2: #ff5c7a;
  --redDeep: #8a0020;
  --copper: #c77a45;
  --brass: #d9a64a;
  --ok: #3ee08f;
  --warn: #ffb340;
  --font: "Bahnschrift", "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
  --mono: "Cascadia Code", "Cascadia Mono", Consolas, monospace;
  --r: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); overflow: hidden; }
button, input, textarea, select { font: inherit; color: inherit; }
::selection { background: rgba(255, 35, 80, .35); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #2a2e39; border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: #3a404e; }
[hidden] { display: none !important; }

/* ====================== HUB ====================== */
#embers { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }
#hub {
  position: fixed; inset: 0;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 35, 80, .13), transparent 38%),
    radial-gradient(ellipse at 50% 115%, rgba(120, 20, 40, .18), transparent 60%),
    linear-gradient(#07080b, #050608);
  transition: filter .5s, transform .5s, opacity .5s;
}
#hub::before { /* Platinen-Raster */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image:
    linear-gradient(rgba(255,255,255,.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.022) 1px, transparent 1px),
    radial-gradient(rgba(255,60,90,.10) 1px, transparent 1.5px);
  background-size: 40px 40px, 40px 40px, 40px 40px;
  background-position: 0 0, 0 0, 20px 20px;
  mask-image: radial-gradient(ellipse at center, #000 25%, transparent 72%);
}
#hub::after { /* Vignette */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,.65));
}
body.in-module #hub { filter: blur(8px) brightness(.28) saturate(.8); transform: scale(1.05); }
body.in-module #embers { opacity: .35; }

#circuit { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; }
.trace-side { fill: none; stroke: #16181f; stroke-width: 2; stroke-linejoin: round; }
.trace-base { fill: none; stroke: #15171d; stroke-width: 8; stroke-linejoin: round; stroke-linecap: round; }
.trace-copper { fill: none; stroke: #3a1820; stroke-width: 3.2; stroke-linejoin: round; stroke-linecap: round; }
.trace-live { fill: none; stroke: var(--red); stroke-width: 1.3; stroke-linejoin: round; opacity: .55; }
.trace.hot .trace-live { stroke: #ffb3c1; opacity: 1; stroke-width: 2.4; }
.trace.hot .trace-copper { stroke: #7a1a30; }
.via { fill: #0d0e12; stroke: #7a1a30; stroke-width: 2; }
.pulse { fill: none; stroke: #ffe3e9; stroke-width: 3.4; stroke-linecap: round; }
.spark { fill: none; stroke: #ffe1e8; stroke-width: 1.4; }

#brand { position: absolute; top: 26px; left: 34px; user-select: none; z-index: 5; }
.brand-title { font-size: 30px; letter-spacing: .38em; font-weight: 700; color: #f2efe9; }
.brand-title span { color: var(--red); text-shadow: 0 0 18px rgba(255,35,80,.7); }
.brand-sub { color: var(--muted); letter-spacing: .3em; font-size: 11px; text-transform: uppercase; margin-top: 4px; }

#vitals { position: absolute; top: 28px; right: 34px; display: flex; gap: 10px; align-items: center; z-index: 5; }
.vital { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 30px;
  background: rgba(13,15,20,.75); font-size: 13px; color: var(--muted); }
.gfx-good .vital { backdrop-filter: blur(6px); }
.vital b { color: var(--text); font-weight: 500; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--dim); box-shadow: 0 0 0 3px rgba(255,255,255,.04); }
.dot.on { background: var(--ok); box-shadow: 0 0 10px var(--ok); }
.dot.off { background: var(--red); box-shadow: 0 0 10px var(--red); }

/* Grafik-Umschalter */
.gfx-switch { display: inline-flex; padding: 3px; border: 1px solid var(--line2); border-radius: 30px; background: rgba(10,11,15,.85); gap: 2px; }
.gfx-switch button { border: none; background: none; color: var(--muted); font-size: 12px; padding: 5px 11px; border-radius: 30px; cursor: pointer; white-space: nowrap; }
.gfx-switch button:hover { color: var(--text); }
.gfx-switch button.on { background: linear-gradient(180deg, #ff3a62, #b8002b); color: #fff; box-shadow: 0 0 12px rgba(255,35,80,.35); }

/* Energiekern */
#core-wrap { position: absolute; left: 50%; top: 50%; width: min(400px, 46vh); aspect-ratio: 1; transform: translate(-50%, -50%);
  cursor: pointer; z-index: 3; }
.core-svg { width: 100%; height: 100%; overflow: visible; display: block; }
.gfx-good #core-wrap .core-svg { filter: drop-shadow(0 20px 40px rgba(0,0,0,.85)); }
.core-aura { transform-origin: 0 0; opacity: .6; }
.core-plasma { transform-origin: 0 0; }
.spin-slow { animation: spin 60s linear infinite; transform-origin: 0 0; }
.spin-rev { animation: spin 16s linear infinite reverse; transform-origin: 0 0; }
.orbit { animation: orbit 3.2s linear infinite; }
.orbit.o2 { animation-duration: 4.1s; animation-direction: reverse; }
.orbit.o3 { animation-duration: 5.3s; }
@keyframes orbit { to { stroke-dashoffset: -180; } }
.blob { transform-origin: 0 0; animation: blob1 5s ease-in-out infinite; }
.blob.b2 { animation: blob2 6.5s ease-in-out infinite; }
@keyframes blob1 { 0%,100% { transform: translate(0,0); } 33% { transform: translate(22px, 14px); } 66% { transform: translate(6px, 26px); } }
@keyframes blob2 { 0%,100% { transform: translate(0,0); } 40% { transform: translate(-24px, -10px); } 75% { transform: translate(-6px, -24px); } }
.plasma-heart { animation: flicker 2.2s ease-in-out infinite; }
@keyframes flicker { 0%,100% { opacity: .95; } 50% { opacity: .7; } }
.port-led { fill: #3a0a14; transition: fill .2s; }
.port-led.on { fill: #ff8aa0; }
.gfx-good .port-led { fill: #ff2350; }
body.busy .spin-rev { animation-duration: 4s; }
body.busy .orbit { animation-duration: 1.1s; }
body.busy .spin-slow { animation-duration: 18s; }
@keyframes spin { to { transform: rotate(360deg); } }

#bpm { position: absolute; left: 50%; top: calc(50% + min(200px, 23vh) + 8px); transform: translateX(-50%); text-align: center; user-select: none;
  font-variant-numeric: tabular-nums; z-index: 3; }
#bpm b { font-size: 26px; color: var(--red2); text-shadow: 0 0 14px rgba(255,35,80,.6); }
#bpm span { display: block; font-size: 10px; letter-spacing: .35em; color: var(--muted); margin-top: 2px; }

/* Modul-Platten */
#nodes { position: absolute; inset: 0; pointer-events: none; z-index: 4; }
.node { position: absolute; transform: translate(-50%, -50%); pointer-events: auto; cursor: pointer; width: 184px;
  padding: 14px 16px 13px; user-select: none; transition: transform .2s, filter .2s;
  --cut: 14px;
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
  background:
    linear-gradient(90deg, rgba(255,35,80,.85), rgba(255,35,80,0) 60%) top left / 100% 2px no-repeat,
    linear-gradient(160deg, #1b1e26, #0b0c10);
  outline: 1px solid #2c313b; outline-offset: -1px; }
.gfx-good .node { filter: drop-shadow(0 10px 24px rgba(0,0,0,.6)); }
.node:hover { transform: translate(-50%, -50%) scale(1.06); }
.gfx-good .node:hover, .gfx-good .node.zap { filter: drop-shadow(0 0 16px rgba(255,35,80,.45)) drop-shadow(0 10px 24px rgba(0,0,0,.6)); }
.node:hover { outline-color: #a0233f; }
.node .n-top { display: flex; align-items: center; gap: 10px; }
.node .n-ico { width: 34px; height: 34px; display: grid; place-items: center; flex: none;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  background: radial-gradient(circle at 35% 30%, #4a1a26, #14070b); color: var(--red2); }
.node .n-ico svg { width: 19px; height: 19px; }
.node .n-name { font-weight: 600; font-size: 15px; letter-spacing: .02em; }
.node .n-tag { font-size: 10px; letter-spacing: .2em; color: #ff8aa0; text-transform: uppercase; font-family: var(--mono); opacity: .8; }
.node .n-desc { color: var(--muted); font-size: 12px; margin-top: 8px; line-height: 1.35; }
.node .n-led { position: absolute; top: 10px; right: 12px; width: 6px; height: 6px; border-radius: 50%; background: var(--dim); }
.node .n-led.on { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.node .n-led.off { background: var(--warn); box-shadow: 0 0 8px var(--warn); }

#ecg { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 90px; pointer-events: none; opacity: .8; z-index: 2; }
#hub-hint { position: absolute; bottom: 22px; right: 34px; color: var(--dim); font-size: 12px; letter-spacing: .2em; text-transform: uppercase; z-index: 5; }

/* ====================== INTRO ====================== */
#intro { position: fixed; inset: 0; z-index: 200; background: #000; overflow: hidden; transition: opacity .6s ease; touch-action: none;
  -webkit-user-select: none; user-select: none; }
#intro::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: linear-gradient(rgba(255,40,80,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,40,80,.05) 1px, transparent 1px);
  background-size: 48px 48px; background-position: center center;
  -webkit-mask-image: radial-gradient(ellipse at center, #000 10%, transparent 65%); mask-image: radial-gradient(ellipse at center, #000 10%, transparent 65%); }
#intro::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at center, transparent 45%, #000 100%); }
#intro.out { opacity: 0; pointer-events: none; }
.intro-cv { position: absolute; inset: 0; width: 100%; height: 100%; }
.intro-word { position: absolute; left: 50%; top: 72%; transform: translate(-50%, -50%); display: flex; gap: .55em; z-index: 2;
  font-size: clamp(22px, 5.2vw, 54px); font-weight: 700; color: #f4f1ec; letter-spacing: .05em; transition: transform .9s cubic-bezier(.2,.9,.3,1), opacity .6s; }
.intro-word span { opacity: 0; transform: translateY(14px) scale(.8); filter: blur(8px); transition: opacity .45s, transform .45s, filter .45s, color .3s; }
.intro-word span.on { opacity: 1; transform: none; filter: none; }
.intro-word span:nth-child(n+6) { color: #ff2350; }
.intro-word span.glitch { text-shadow: -3px 0 rgba(255,35,80,.9), 3px 0 rgba(80,220,255,.6); transform: translateX(2px) skewX(-8deg); }
.intro-word.big span { animation: wordHit .5s ease-out; }
@keyframes wordHit { 0% { color: #fff; text-shadow: 0 0 30px #fff, 0 0 60px #ff2350; transform: scale(1.25); } 100% { } }
.intro-word.down { top: 50%; transform: translate(-50%, -50%) translateY(calc(min(220px, 32vmin) + 34px)) scale(.62); }
.intro-sub { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) translateY(calc(min(220px, 32vmin) + 70px)); letter-spacing: .3em; font-size: 11px; z-index: 2;
  color: #8d919c; font-size: 12px; letter-spacing: .45em; opacity: 0; transition: opacity .6s .3s; white-space: nowrap; }
.intro-sub.on { opacity: 1; }
.intro-core { position: absolute; left: 50%; top: 50%; width: min(440px, 64vmin); aspect-ratio: 1; z-index: 1;
  transform: translate(-50%, -50%) scale(.15) rotate(-120deg); opacity: 0; transition: transform 1s cubic-bezier(.2,1.35,.4,1), opacity .5s;
  will-change: transform, opacity; }
.intro-core.on { transform: translate(-50%, -50%) scale(1) rotate(0); opacity: 1; }
#intro.zoom .intro-core { transform: translate(-50%, -50%) scale(14); opacity: 0; transition: transform .95s cubic-bezier(.6,0,.9,.4), opacity .9s ease-in .1s; }
#intro.zoom .intro-word, #intro.zoom .intro-sub { opacity: 0; transition: opacity .3s; }
#intro.zoom::before { opacity: 0; transition: opacity .5s; }
.intro-flash { position: absolute; inset: 0; z-index: 3; pointer-events: none; opacity: 0;
  background: radial-gradient(circle at center, #fff 0%, #ffd0da 35%, rgba(255,35,80,.6) 70%, transparent 100%); }
.intro-flash.go { animation: introFlash .55s ease-out; }
@keyframes introFlash { 0% { opacity: .95; } 100% { opacity: 0; } }
#intro.shake .intro-cv, #intro.shake .intro-word { animation: introShake .5s linear; }
@keyframes introShake { 10% { transform: translate(-6px, 3px); } 25% { transform: translate(5px, -4px); } 40% { transform: translate(-4px, -2px); }
  55% { transform: translate(3px, 3px); } 70% { transform: translate(-2px, 1px); } 85% { transform: translate(1px, -1px); } }
#intro.shake .intro-word { animation: none; }
.intro-skip { position: absolute; right: 18px; bottom: max(18px, env(safe-area-inset-bottom)); z-index: 5; background: rgba(0,0,0,.4); border: 1px solid #2a2d36; color: #8b909b;
  padding: 8px 14px; border-radius: 20px; font-size: 13px; cursor: pointer; }
.intro-skip:hover { color: #fff; border-color: #555; }
.intro-gate { position: absolute; inset: 0; z-index: 4; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  cursor: pointer; background: #000; transition: opacity .4s; }
.intro-gate.out { opacity: 0; pointer-events: none; }
.gate-core { width: 18px; height: 18px; border-radius: 50%; background: radial-gradient(#fff, #ff2350 60%, transparent 70%);
  box-shadow: 0 0 30px #ff2350; animation: gatePulse 1s ease-in-out infinite; }
@keyframes gatePulse { 0%,100% { transform: scale(1); opacity: .8; } 15% { transform: scale(1.6); opacity: 1; } 30% { transform: scale(1); } 45% { transform: scale(1.3); } }
.gate-t { letter-spacing: .6em; font-size: 22px; color: #eee; margin-right: -.6em; }
.gate-s { color: #7b808b; font-size: 13px; letter-spacing: .1em; }
.gfx-potato .intro-word span { filter: none; }
@media (prefers-reduced-motion: reduce) { #intro.shake .intro-cv { animation: none; } }

/* ====================== PULSCODE ====================== */
#lock { position: fixed; inset: 0; z-index: 150; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: radial-gradient(circle at 50% 38%, rgba(60,10,20,.55), rgba(3,4,6,.97) 55%); transition: opacity .8s, transform .8s; }
.gfx-good #lock { backdrop-filter: blur(14px); }
#lock .lock-core { width: min(260px, 32vh); aspect-ratio: 1; filter: grayscale(1) brightness(.55); transition: filter 1s, transform 1s; }
#lock .lock-core .core-plasma { opacity: .25; transition: opacity 1s; }
#lock .lock-core .spin-rev, #lock .lock-core .orbit { animation-play-state: paused; }
#lock.ok .lock-core { filter: none; transform: scale(1.08); }
#lock.ok .lock-core .core-plasma { opacity: 1; }
#lock.ok .lock-core .spin-rev, #lock.ok .lock-core .orbit { animation-play-state: running; }
#lock.out { opacity: 0; transform: scale(1.6); pointer-events: none; }
.lock-box { width: min(560px, 92vw); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.lock-title { letter-spacing: .7em; font-size: 15px; color: #d8d6d2; margin-right: -.7em; }
.lock-monitor { position: relative; width: 100%; height: 110px; border: 1px solid #262a33; border-radius: 12px; overflow: hidden;
  background: linear-gradient(rgba(255,255,255,.02) 1px, transparent 1px) 0 0 / 100% 22px, linear-gradient(90deg, rgba(255,255,255,.02) 1px, transparent 1px) 0 0 / 22px 100%, #050608; }
.lock-ecg { position: absolute; inset: 0; width: 100%; height: 100%; }
.lock-bpm { position: absolute; right: 12px; top: 8px; text-align: right; font-variant-numeric: tabular-nums; }
.lock-bpm b { font-size: 22px; color: #ff5c7a; display: block; line-height: 1; }
.lock-bpm span { font-size: 9px; color: #6b707b; letter-spacing: .3em; }
.lock-dots { display: flex; gap: 7px; min-height: 12px; flex-wrap: wrap; justify-content: center; }
.lock-dots i { width: 9px; height: 9px; border-radius: 50%; background: #ff2350; box-shadow: 0 0 8px #ff2350; }
.lock-dots i.new { animation: dotIn .35s ease; }
@keyframes dotIn { from { transform: scale(2.2); background: #fff; } }
.lock-msg { color: #a7abb4; font-size: 14px; min-height: 20px; text-align: center; }
.lock-hint { color: #555a65; font-size: 11.5px; letter-spacing: .12em; }
.lock-input { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
#lock.wrong .lock-box { animation: shake .45s; }
#lock.wrong .lock-msg { color: #ff5c7a; }
#lock.ok .lock-msg { color: var(--ok); }
@keyframes shake { 20%,60% { transform: translateX(-10px); } 40%,80% { transform: translateX(10px); } }
body.locked #view, body.locked #hub { visibility: hidden; }

/* ====================== KARTOFFELGRAFIK ====================== */
.gfx-potato svg *, .pre-potato svg * { filter: none !important; }
.gfx-potato #embers { display: none; }
.gfx-potato .blob, .gfx-potato .orbit, .gfx-potato .spin-slow, .gfx-potato .plasma-heart, .gfx-potato .mini-core svg { animation: none !important; }
.gfx-potato .spin-rev { animation-duration: 30s; }
.gfx-potato #hub::before, .gfx-potato #hub::after { display: none; }
.gfx-potato.in-module #hub { filter: none; transform: none; visibility: hidden; }
.gfx-potato #view { background: #0a0b0f; animation: none; }
.gfx-potato * { backdrop-filter: none !important; text-shadow: none !important; }
.gfx-potato .btn.primary, .gfx-potato .composer-inner:focus-within, .gfx-potato .progress > div { box-shadow: none; }
.gfx-potato .trace-side { display: none; }

/* ====================== MODUL-ANSICHT ====================== */
#view { position: fixed; inset: 0; display: flex; flex-direction: column; z-index: 10; animation: viewIn .35s ease; }
@keyframes viewIn { from { opacity: 0; transform: scale(.985); } }
#topbar { display: flex; align-items: center; gap: 16px; padding: 10px 18px; border-bottom: 1px solid var(--line);
  background: rgba(8,9,12,.75); backdrop-filter: blur(10px); }
.mini-core { width: 42px; height: 42px; padding: 0; border: 1px solid var(--line2); background: #0a0b0f; border-radius: 10px;
  cursor: pointer; display: grid; place-items: center; transition: border-color .2s; overflow: hidden; }
.mini-core:hover { border-color: var(--red); }
.mini-core svg { width: 40px; height: 40px; animation: miniBeat 0.83s infinite; }
@keyframes miniBeat { 0%, 100% { transform: scale(1); } 12% { transform: scale(1.13); } 24% { transform: scale(.98); } 36% { transform: scale(1.08); } 50% { transform: scale(1); } }
#crumb { font-size: 14px; letter-spacing: .2em; white-space: nowrap; }
.crumb-root { color: var(--muted); }
.crumb-sep { color: var(--red); margin: 0 10px; }
#crumb-mod { color: var(--text); font-weight: 600; }
#modnav { margin-left: auto; display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
#modnav button { background: none; border: 1px solid transparent; color: var(--muted); padding: 7px 12px; border-radius: 8px;
  cursor: pointer; font-size: 13px; display: flex; align-items: center; gap: 7px; }
#modnav button svg { width: 15px; height: 15px; }
#modnav button:hover { color: var(--text); background: #141720; }
#modnav button.active { color: var(--text); border-color: #4a1f28; background: rgba(255,35,80,.08); }
#modnav button.active svg { color: var(--red2); }
#modules { flex: 1; min-height: 0; position: relative; }
.module { position: absolute; inset: 0; display: flex; min-height: 0; }

/* ---------- Bausteine ---------- */
.btn { border: 1px solid var(--line2); background: #151821; padding: 8px 14px; border-radius: 9px; cursor: pointer;
  font-size: 13px; display: inline-flex; align-items: center; gap: 7px; transition: background .15s, border-color .15s; white-space: nowrap; }
.btn:hover { background: #1c2030; border-color: #4a5164; }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: linear-gradient(180deg, #ff3a62, #c8002f); border-color: #ff5c7a; color: #fff;
  box-shadow: 0 0 18px rgba(255,35,80,.25); }
.btn.primary:hover { background: linear-gradient(180deg, #ff5577, #d80035); }
.btn.ghost { background: none; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); background: #151821; }
.btn.danger:hover { border-color: var(--red); color: var(--red2); }
.btn.small { padding: 5px 9px; font-size: 12px; }
.btn svg { width: 15px; height: 15px; }
.input, .select, .textarea { background: #0b0d12; border: 1px solid var(--line2); border-radius: 9px; padding: 9px 11px;
  outline: none; font-size: 14px; width: 100%; transition: border-color .15s, box-shadow .15s; }
.input:focus, .select:focus, .textarea:focus { border-color: #a0233f; box-shadow: 0 0 0 3px rgba(255,35,80,.12); }
.select { appearance: none; padding-right: 30px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.select option { background: #0f1117; }
.textarea { resize: vertical; line-height: 1.5; }
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); letter-spacing: .04em; }
.row { display: flex; gap: 10px; align-items: center; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.side { width: 270px; flex: none; border-right: 1px solid var(--line); background: rgba(10,11,15,.7); display: flex; flex-direction: column; min-height: 0; }
.side-head { padding: 14px; display: flex; gap: 8px; border-bottom: 1px solid var(--line); }
.side-list { flex: 1; overflow: auto; padding: 8px; }
.side-item { padding: 9px 11px; border-radius: 9px; cursor: pointer; font-size: 13px; display: flex; align-items: center; gap: 8px;
  color: #c9c7c3; border: 1px solid transparent; }
.side-item:hover { background: #141720; }
.side-item.active { background: rgba(255,35,80,.08); border-color: #4a1f28; color: #fff; }
.side-item .t { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-item .x { opacity: 0; border: none; background: none; cursor: pointer; color: var(--muted); padding: 2px 4px; border-radius: 5px; }
.side-item:hover .x { opacity: 1; }
.side-item .x:hover { color: var(--red2); background: #24151a; }
.side-sec { font-size: 10px; letter-spacing: .22em; text-transform: uppercase; color: var(--dim); padding: 12px 11px 6px; }
.empty { color: var(--dim); text-align: center; padding: 30px 14px; font-size: 13px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); }
.tag { font-size: 11px; color: var(--muted); border: 1px solid var(--line2); border-radius: 20px; padding: 2px 8px; }
kbd { font-family: var(--mono); font-size: 11px; border: 1px solid var(--line2); border-bottom-width: 2px; border-radius: 5px; padding: 1px 5px; color: var(--muted); }

/* ---------- Chat / Nachrichten ---------- */
.chat-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 12px 22px; border-bottom: 1px solid var(--line); }
.chat-head .title { font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msgs { flex: 1; overflow: auto; padding: 24px 0 10px; scroll-behavior: auto; }
.msgs-inner { max-width: 860px; margin: 0 auto; padding: 0 24px; display: flex; flex-direction: column; gap: 18px; }
.msg { display: flex; gap: 12px; }
.msg .av { width: 30px; height: 30px; border-radius: 9px; flex: none; display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.msg.user .av { background: #1d2230; color: #9fb0d0; }
.msg.ai .av { background: radial-gradient(circle at 35% 30%, #ff5c7a, #7a0020); color: #fff; box-shadow: 0 0 14px rgba(255,35,80,.35); }
.msg .bubble { min-width: 0; flex: 1; line-height: 1.6; font-size: 14.5px; }
.msg.user .bubble { background: #141822; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; flex: 0 1 auto; margin-left: auto; max-width: 80%; white-space: pre-wrap; }
.msg.user { flex-direction: row-reverse; }
.msg .meta { font-size: 11px; color: var(--dim); margin-top: 6px; display: flex; gap: 10px; align-items: center; }
.msg .meta button { background: none; border: none; color: var(--dim); cursor: pointer; padding: 0; font-size: 11px; }
.msg .meta button:hover { color: var(--red2); }
.msg .imgs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.msg .imgs img { max-height: 160px; border-radius: 8px; border: 1px solid var(--line2); }
.think { border-left: 2px solid #4a1f28; padding: 4px 12px; color: var(--muted); font-size: 13px; margin-bottom: 8px; white-space: pre-wrap; }
details.thinkbox summary { cursor: pointer; color: var(--dim); font-size: 12px; margin-bottom: 6px; }
.md p { margin: 0 0 .7em; } .md p:last-child { margin-bottom: 0; }
.md h1, .md h2, .md h3 { margin: .8em 0 .4em; line-height: 1.25; } .md h1 { font-size: 1.35em; } .md h2 { font-size: 1.2em; } .md h3 { font-size: 1.05em; }
.md ul, .md ol { margin: .2em 0 .7em; padding-left: 1.4em; }
.md li { margin: .15em 0; }
.md a { color: var(--red2); }
.md blockquote { border-left: 3px solid #4a1f28; margin: .5em 0; padding: .1em 1em; color: var(--muted); }
.md code { font-family: var(--mono); font-size: .88em; background: #1a1d27; border: 1px solid var(--line); padding: .1em .35em; border-radius: 5px; }
.md table { border-collapse: collapse; margin: .5em 0; font-size: .92em; }
.md th, .md td { border: 1px solid var(--line2); padding: 5px 9px; }
.md hr { border: none; border-top: 1px solid var(--line2); }
.codeblock { margin: .6em 0; border: 1px solid var(--line2); border-radius: 10px; overflow: hidden; background: #0a0b0f; }
.codeblock .cb-head { display: flex; align-items: center; justify-content: space-between; padding: 5px 10px; background: #12141b;
  font-size: 11px; color: var(--muted); font-family: var(--mono); border-bottom: 1px solid var(--line); }
.codeblock .cb-head button { background: none; border: 1px solid var(--line2); color: var(--muted); border-radius: 6px; padding: 2px 8px; cursor: pointer; font-size: 11px; margin-left: 6px; }
.codeblock .cb-head button:hover { color: var(--text); border-color: #555; }
.codeblock pre { margin: 0; padding: 12px 14px; overflow: auto; font-family: var(--mono); font-size: 13px; line-height: 1.55; }
.codeblock pre code { background: none; border: none; padding: 0; font-size: inherit; }
.tk-k { color: #ff7b93; } .tk-s { color: #e6c07b; } .tk-c { color: #5d6474; font-style: italic; } .tk-n { color: #d19a66; } .tk-f { color: #7fc8ff; }
.cursor::after { content: "▍"; color: var(--red); animation: blink 1s steps(1) infinite; margin-left: 1px; }
@keyframes blink { 50% { opacity: 0; } }

.composer { padding: 12px 24px 18px; }
.composer-inner { max-width: 860px; margin: 0 auto; border: 1px solid var(--line2); background: #0c0e13; border-radius: 14px; padding: 10px;
  transition: border-color .2s, box-shadow .2s; }
.composer-inner:focus-within { border-color: #7a1a30; box-shadow: 0 0 0 3px rgba(255,35,80,.1), 0 0 30px rgba(255,35,80,.08); }
.composer textarea { width: 100%; border: none; background: none; outline: none; resize: none; font-size: 14.5px; line-height: 1.5;
  max-height: 260px; min-height: 24px; padding: 4px 6px; }
.composer .bar { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.composer .bar .select { width: auto; padding: 6px 30px 6px 10px; font-size: 12px; }
.composer .attach-prev { display: flex; gap: 6px; flex-wrap: wrap; }
.composer .attach-prev img { height: 54px; border-radius: 7px; border: 1px solid var(--line2); cursor: pointer; }
.hello { text-align: center; margin: 8vh auto 0; max-width: 520px; }
.hello h2 { font-weight: 600; letter-spacing: .05em; margin: 14px 0 6px; }
.hello p { color: var(--muted); margin: 0 0 18px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.chip { border: 1px solid var(--line2); background: #10131a; border-radius: 20px; padding: 7px 13px; font-size: 13px; cursor: pointer; color: #cfcdc9; }
.chip:hover { border-color: #7a1a30; color: #fff; }

/* ---------- Code-Modul ---------- */
.code-wrap { flex: 1; display: grid; grid-template-columns: 1fr 420px; min-width: 0; min-height: 0; }
.editor-col { display: flex; flex-direction: column; min-width: 0; min-height: 0; border-right: 1px solid var(--line); }
.editor-bar { display: flex; gap: 8px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.editor-bar .input { width: 200px; padding: 6px 10px; font-size: 13px; }
.editor-bar .select { width: 140px; padding: 6px 30px 6px 10px; font-size: 13px; }
.editor { flex: 1; display: flex; min-height: 0; background: #08090c; position: relative; }
.gutter { padding: 12px 10px 12px 14px; text-align: right; color: #3b404c; font-family: var(--mono); font-size: 13.5px; line-height: 1.55;
  user-select: none; overflow: hidden; white-space: pre; min-width: 48px; }
.editor-stack { position: relative; flex: 1; min-width: 0; }
.editor-stack textarea, .editor-stack pre { position: absolute; inset: 0; margin: 0; padding: 12px 14px; font-family: var(--mono); font-size: 13.5px;
  line-height: 1.55; white-space: pre; overflow: auto; tab-size: 4; border: none; outline: none; }
.editor-stack textarea { background: transparent; color: transparent; caret-color: #ff8aa0; resize: none; z-index: 2; }
.editor-stack pre { pointer-events: none; z-index: 1; color: #d6d4cf; }
.output { height: 32%; min-height: 110px; border-top: 1px solid var(--line); display: flex; flex-direction: column; background: #07080b; }
.output-head { display: flex; align-items: center; gap: 8px; padding: 6px 14px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--line); }
.output pre { flex: 1; margin: 0; padding: 10px 14px; overflow: auto; font-family: var(--mono); font-size: 12.5px; white-space: pre-wrap; }
.output .err { color: #ff8aa0; }
.assist-col { display: flex; flex-direction: column; min-height: 0; background: rgba(10,11,15,.7); }
.assist-actions { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px; border-bottom: 1px solid var(--line); }
.assist-log { flex: 1; overflow: auto; padding: 14px; display: flex; flex-direction: column; gap: 14px; font-size: 13.5px; }
.assist-log .q { color: var(--muted); font-size: 12px; border-left: 2px solid #4a1f28; padding-left: 8px; }
.assist-in { padding: 12px; border-top: 1px solid var(--line); display: flex; gap: 8px; align-items: flex-end; }
.assist-in textarea { min-height: 40px; max-height: 160px; }

/* ---------- ComfyUI ---------- */
.comfy-wrap { flex: 1; display: grid; grid-template-columns: 380px 1fr; min-height: 0; }
.comfy-form { border-right: 1px solid var(--line); padding: 16px; overflow: auto; display: flex; flex-direction: column; gap: 12px; background: rgba(10,11,15,.7); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.comfy-stage { display: flex; flex-direction: column; min-height: 0; }
.stage-top { padding: 16px; display: flex; gap: 16px; align-items: stretch; border-bottom: 1px solid var(--line); min-height: 0; }
.stage-preview { flex: 1; min-height: 300px; max-height: 52vh; border: 1px dashed var(--line2); border-radius: 12px; display: grid; place-items: center;
  overflow: hidden; background: repeating-conic-gradient(#0b0c10 0% 25%, #0e1015 0% 50%) 50% / 22px 22px; position: relative; }
.stage-preview img { max-width: 100%; max-height: 52vh; object-fit: contain; display: block; }
.progress { height: 4px; border-radius: 4px; background: #191c25; overflow: hidden; }
.progress > div { height: 100%; width: 0; background: linear-gradient(90deg, var(--redDeep), var(--red), #ffb3c1); box-shadow: 0 0 12px var(--red); transition: width .3s; }
.gallery { flex: 1; overflow: auto; padding: 16px; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; align-content: start; }
.gallery .g { position: relative; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); aspect-ratio: 1; cursor: pointer; background: #0c0d12; }
.gallery .g img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.gallery .g:hover img { transform: scale(1.05); }
.gallery .g:hover { border-color: #7a1a30; }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.88); z-index: 50; display: flex; align-items: center; justify-content: center; gap: 24px; padding: 30px; }
.lightbox img { max-width: 72vw; max-height: 90vh; border-radius: 10px; box-shadow: 0 0 60px rgba(255,35,80,.15); }
.lightbox .lb-info { width: 320px; display: flex; flex-direction: column; gap: 10px; font-size: 13px; }
.lightbox .lb-info .p { color: #d8d6d2; line-height: 1.5; max-height: 45vh; overflow: auto; }
.offline-box { margin: 18px; padding: 18px; border: 1px solid #5a3a12; background: rgba(255,179,64,.06); border-radius: 12px; font-size: 13.5px; line-height: 1.6; }
.offline-box b { color: var(--warn); }

/* ---------- Build-AIs ---------- */
.build-wrap { flex: 1; display: grid; grid-template-columns: 250px 420px 1fr; min-height: 0; }
.build-chat { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); }
.build-log { flex: 1; overflow: auto; padding: 14px; display: flex; flex-direction: column; gap: 14px; font-size: 13.5px; }
.build-log .u { align-self: flex-end; background: #141822; border: 1px solid var(--line); border-radius: 11px; padding: 8px 12px; max-width: 90%; white-space: pre-wrap; }
.build-log .a { line-height: 1.55; }
.build-log .files-note { font-size: 12px; color: var(--ok); }
.build-out { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.tabs { display: flex; gap: 2px; padding: 8px 10px 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button { background: none; border: 1px solid transparent; border-bottom: none; color: var(--muted); padding: 7px 12px; border-radius: 8px 8px 0 0; cursor: pointer; font-size: 12.5px; white-space: nowrap; }
.tabs button.active { background: #0b0d12; border-color: var(--line); color: var(--text); }
.build-view { flex: 1; min-height: 0; position: relative; background: #08090c; }
.build-view iframe { width: 100%; height: 100%; border: none; background: #fff; }
.build-view textarea { width: 100%; height: 100%; border: none; outline: none; resize: none; background: #08090c; padding: 14px;
  font-family: var(--mono); font-size: 13px; line-height: 1.55; tab-size: 4; white-space: pre; }
.builder-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; padding: 4px 0; }
.bcard { border: 1px solid var(--line2); border-radius: 14px; padding: 18px; background: linear-gradient(160deg, #171a22, #0d0f14); cursor: pointer; transition: border-color .2s, transform .2s; }
.bcard:hover { border-color: var(--red); transform: translateY(-2px); }
.bcard h3 { margin: 10px 0 6px; font-size: 16px; }
.bcard p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }

/* ---------- Einstellungen ---------- */
.settings { flex: 1; overflow: auto; padding: 26px 0 60px; }
.settings-inner { max-width: 880px; margin: 0 auto; padding: 0 24px; display: flex; flex-direction: column; gap: 18px; }
.set-sec { padding: 20px; }
.set-sec h3 { margin: 0 0 4px; font-size: 15px; letter-spacing: .06em; display: flex; align-items: center; gap: 9px; }
.set-sec h3 svg { width: 17px; height: 17px; color: var(--red2); }
.set-sec .hint { color: var(--muted); font-size: 12.5px; margin: 0 0 16px; }
.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; font-size: 14px; }
.switch input { display: none; }
.switch .sw { width: 40px; height: 22px; border-radius: 20px; background: #222632; position: relative; transition: background .2s; flex: none; }
.switch .sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #aaa; transition: transform .2s, background .2s; }
.switch input:checked + .sw { background: #8a0020; }
.switch input:checked + .sw::after { transform: translateX(18px); background: #fff; }
.model-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.model-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 9px; font-size: 13px; }
.model-row .nm { flex: 1; font-family: var(--mono); }

#toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px); opacity: 0; z-index: 100;
  background: #161922; border: 1px solid var(--line2); padding: 10px 18px; border-radius: 10px; font-size: 13.5px; transition: all .25s; pointer-events: none;
  box-shadow: 0 10px 30px rgba(0,0,0,.6); max-width: 70vw; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.err { border-color: #7a1a30; color: #ffb3c1; }

@media (max-height: 760px), (max-width: 1100px) {
  .node { width: 150px; padding: 10px 12px; }
  .node .n-desc { display: none; }
  .node .n-ico { width: 28px; height: 28px; }
  .brand-title { font-size: 24px; }
}
@media (max-width: 1250px) {
  .build-wrap { grid-template-columns: 200px 360px 1fr; }
  .code-wrap { grid-template-columns: 1fr 360px; }
}
.preview-err { position: absolute; left: 10px; right: 10px; bottom: 10px; display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  background: rgba(30,10,14,.95); border: 1px solid #7a1a30; border-radius: 10px; font-size: 12.5px; color: #ffb3c1; font-family: var(--mono); }
.build-view { overflow: hidden; }
.swirl { transform-origin: 0 0; animation: spin 2.4s linear infinite; }
.swirl.rev { animation: spin 3.6s linear infinite reverse; }
body.busy .swirl { animation-duration: .9s; }
.gfx-potato .swirl { animation: none; opacity: .5; }
#top-gfx { margin-left: 6px; }
.lock-bpm { pointer-events: none; }
.hello-core { width: 92px; height: 92px; margin: 0 auto; }
.hello-core svg { width: 100%; height: 100%; }

/* ====================== HANDY ====================== */
body.mobile #hub { overflow-y: auto; }
body.mobile #brand { position: relative; top: auto; left: auto; padding: 18px 18px 0; }
body.mobile .brand-title { font-size: 22px; }
body.mobile #vitals { position: relative; top: auto; right: auto; padding: 10px 18px; flex-wrap: wrap; }
body.mobile #core-wrap { position: relative; left: auto; top: auto; transform: none; width: min(70vw, 260px); margin: 6px auto 0; }
body.mobile #bpm { position: relative; top: auto; left: auto; transform: none; margin: 4px 0 10px; }
body.mobile #nodes { position: relative; inset: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 14px 120px; pointer-events: auto; }
body.mobile .node { position: relative; transform: none; width: auto; left: auto; top: auto; }
body.mobile .node:hover { transform: none; }
body.mobile .node .n-desc { display: none; }
body.mobile #hub-hint, body.mobile #circuit { display: none; }
body.mobile #ecg { position: fixed; height: 60px; }
body.mobile #topbar { flex-wrap: wrap; gap: 8px; padding: 8px 10px; }
body.mobile #crumb { font-size: 12px; }
body.mobile #modnav { width: 100%; overflow-x: auto; flex-wrap: nowrap; justify-content: flex-start; margin: 0; }
body.mobile #modnav button span { display: none; }
body.mobile #top-gfx { display: none; }
body.mobile .side { width: auto !important; max-height: 30vh; border-right: none; border-bottom: 1px solid var(--line); flex: none; }
body.mobile .side .side-head { padding: 8px 12px; }
body.mobile .module[data-mod="chat"] { flex-direction: column; }
body.mobile .module[data-mod="code"] .side { max-height: 20vh; }
body.mobile .code-wrap, body.mobile .comfy-wrap, body.mobile .build-wrap { grid-template-columns: 1fr; overflow-y: auto; }
body.mobile .assist-col, body.mobile .build-out { min-height: 60vh; }
body.mobile .comfy-form { border-right: none; }
body.mobile .msgs-inner, body.mobile .composer { padding-left: 12px; padding-right: 12px; }
body.mobile .composer .bar kbd, body.mobile .composer .bar .muted { display: none; }
body.mobile .lightbox { flex-direction: column; overflow: auto; }
body.mobile .lightbox img { max-width: 94vw; }
body.mobile .lightbox .lb-info { width: 94vw; }
body.mobile .editor-col { min-height: 75vh; border-right: none; } body.mobile .build-chat { min-height: 60vh; }
body.mobile .module:not([data-mod="chat"]) { display: block; overflow-y: auto; }
body.mobile .comfy-wrap, body.mobile .code-wrap, body.mobile .build-wrap { display: flex; flex-direction: column; height: auto; overflow: visible; }
body.mobile .comfy-form, body.mobile .gallery { overflow: visible; }
body.mobile .stage-top { flex-direction: column; }
body.mobile .stage-preview { min-height: 240px; }
body.mobile .settings { overflow: visible; }

/* ====================== TOUCH / iPad: teure Effekte sparen ====================== */
.lock-input { font-size: 16px; } /* verhindert Auto-Zoom auf iOS */
body.touch .orbit, body.touch .ring-energy, body.touch #pulses, body.touch .spark { filter: none !important; }
body.touch * { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
body.touch.in-module #hub { filter: none; transform: none; visibility: hidden; }
body.touch #view { background: #0a0b0f; }
body.touch .gfx-good .node, body.touch .node { filter: none; }
html, body { -webkit-tap-highlight-color: transparent; overscroll-behavior: none; }

/* ====================== SPEICHER ====================== */
.mem-wrap { flex: 1; display: grid; grid-template-columns: 1.25fr 1fr; min-height: 0; }
.mem-col, .store-col { display: flex; flex-direction: column; min-height: 0; padding: 18px 22px; }
.mem-col { border-right: 1px solid var(--line); }
.mem-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.mem-title { display: flex; align-items: center; gap: 9px; font-size: 17px; font-weight: 600; letter-spacing: .05em; }
.mem-title svg { width: 20px; height: 20px; color: var(--red2); }
.mem-hint { font-size: 12.5px; margin: 0 0 12px; }
.mem-cats { display: flex; gap: 6px; flex-wrap: wrap; }
.mem-cats .chip { padding: 5px 11px; font-size: 12px; }
.mem-cats .chip.on { border-color: var(--red); color: #fff; background: rgba(255,35,80,.12); }
.mem-list { flex: 1; overflow: auto; margin-top: 12px; display: flex; flex-direction: column; gap: 8px; padding-right: 4px; }
.mem-card { display: flex; align-items: flex-start; gap: 10px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 11px; background: rgba(16,18,24,.85); }
.mem-card:hover { border-color: var(--line2); }
.mem-card.pinned { border-color: #6a1a2c; background: linear-gradient(90deg, rgba(255,35,80,.08), rgba(16,18,24,.85) 40%); }
.mem-card .x { border: none; background: none; color: var(--dim); cursor: pointer; padding: 2px 5px; border-radius: 6px; opacity: .55; }
.mem-card:hover .x { opacity: 1; }
.mem-card .x:hover { color: var(--red2); background: #24151a; }
.mem-card .x.on { opacity: 1; }
.mem-text { font-size: 14px; line-height: 1.45; }
.mem-meta { font-size: 11px; color: var(--dim); margin-top: 4px; }
.mem-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex: none; background: #888; }
.mem-dot[data-cat="Person"] { background: #ff5c7a; } .mem-dot[data-cat="Vorlieben"] { background: #ffb340; }
.mem-dot[data-cat="Projekte"] { background: #3ee08f; } .mem-dot[data-cat="Wissen"] { background: #6cb6ff; }
.mem-foot { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.store-col { background: rgba(10,11,15,.6); overflow: auto; }
.disk { display: flex; align-items: center; gap: 20px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: rgba(16,18,24,.85); margin: 8px 0 14px; }
.disk-ring { position: relative; width: 120px; height: 120px; flex: none; }
.disk-ring svg { width: 100%; height: 100%; }
.dr-bg { fill: none; stroke: #1e222b; stroke-width: 12; }
.dr-fg { fill: none; stroke: var(--red); stroke-width: 12; stroke-linecap: round; }
.disk.warn .dr-fg { stroke: var(--warn); }
.dr-t { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.dr-t b { font-size: 22px; } .dr-t span { font-size: 10px; color: var(--muted); letter-spacing: .2em; text-transform: uppercase; }
.disk-name { color: var(--muted); font-size: 12px; letter-spacing: .15em; text-transform: uppercase; }
.disk-free { font-size: 24px; font-weight: 600; margin: 2px 0; }
.disk-warn { color: var(--warn); font-size: 12.5px; margin-top: 6px; }
.store-list { display: flex; flex-direction: column; gap: 10px; }
.store-row { padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; background: rgba(16,18,24,.7); }
.store-top { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.store-size { font-variant-numeric: tabular-nums; color: #fff; font-size: 13px; }
.store-bar { height: 5px; border-radius: 5px; background: #191c25; margin: 8px 0 6px; overflow: hidden; }
.store-bar > div { height: 100%; border-radius: 5px; background: linear-gradient(90deg, var(--redDeep), var(--red)); }
.store-actions { display: flex; align-items: center; gap: 6px; }
.store-path { font-size: 11px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); }
body.mobile .mem-wrap { display: flex; flex-direction: column; height: auto; }
body.mobile .mem-col { border-right: none; }
body.mobile .mem-list { overflow: visible; }
@media (max-width: 1750px) {
  #modnav button span { display: none; }
  #modnav button.active span { display: inline; }
  #modnav button { padding: 7px 9px; }
}
.chat-main { min-height: 0; }
body.mobile .module[data-mod="chat"] .side { max-height: 22vh; }
body.mobile .hello { margin-top: 2vh; }
body.mobile .hello .chips .chip:nth-child(n+3) { display: none; }
body.mobile .composer textarea::placeholder { font-size: 13px; }
.gen-imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; margin-top: 10px; }
.gen-imgs img { width: 100%; border-radius: 10px; border: 1px solid var(--line2); cursor: zoom-in; }
.gen-progress { margin-top: 8px; color: var(--muted); font-size: 13px; }
/* iPhone/iPad Notch & Home-Leiste */
#topbar { padding-top: max(10px, env(safe-area-inset-top)); padding-left: max(18px, env(safe-area-inset-left)); padding-right: max(18px, env(safe-area-inset-right)); }
body.mobile #brand { padding-top: max(18px, env(safe-area-inset-top)); }
.composer { padding-bottom: max(18px, env(safe-area-inset-bottom)); }
#lock { padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); }
/* Performance: Kern-Animationen anhalten, solange ein Modul offen ist (der Hub liegt dann nur unscharf dahinter) */
body.in-module #hub *, body.locked #hub * { animation-play-state: paused !important; }
.init-prev { display: flex; align-items: center; gap: 10px; font-size: 12px; min-height: 22px; }
.init-prev img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line2); }
.diag { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.diag-row { display: flex; align-items: center; gap: 10px; font-size: 13.5px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 9px; width: 100%; }
.diag-row b { width: 150px; font-weight: 600; }
.diag-row.bad { border-color: #5a3a12; }
div.field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); letter-spacing: .04em; }
input[type=range] { accent-color: var(--red); }
input[type=checkbox] { accent-color: var(--red); }
/* Pulscode-Feld (sichtbar, iPad/Handy-tauglich) */
.lock-form { display: flex; gap: 10px; width: 100%; }
.lock-field { flex: 1; min-width: 0; font-size: 18px; letter-spacing: .25em; padding: 13px 16px; border-radius: 12px;
  background: #07080b; color: #fff; border: 1px solid #3a1a24; outline: none; transition: border-color .2s, box-shadow .2s;
  -webkit-appearance: none; appearance: none; }
.lock-field::placeholder { letter-spacing: .08em; color: #5c616d; font-size: 15px; }
.lock-field:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(255,35,80,.18), 0 0 24px rgba(255,35,80,.15); }
.lock-go { padding: 0 18px; border-radius: 12px; font-size: 15px; }
#lock.wrong .lock-field { border-color: var(--red); }
#lock.ok .lock-field { border-color: var(--ok); }
body.mobile #lock { justify-content: flex-start; padding-top: max(24px, env(safe-area-inset-top)); overflow-y: auto; }
body.mobile #lock .lock-core { width: min(200px, 26vh); }

/* ====================== DESIGN 2.2: cooler ====================== */
/* HUD-Ring um den Kern */
#core-wrap .hud { position: absolute; left: 50%; top: 50%; width: 113%; height: 113%; transform: translate(-50%, -50%); pointer-events: none; overflow: visible; }
.hud-ticks { stroke: rgba(255,80,110,.28); stroke-width: 1.2; animation: spin 120s linear infinite; transform-origin: 0 0; }
.hud-ring { fill: none; stroke: rgba(255,35,80,.18); stroke-width: 1; stroke-dasharray: 2 6; }
.hud-arc { fill: none; stroke: rgba(255,60,100,.65); stroke-width: 2.2; stroke-linecap: round; }
.hud-arc.thin { stroke-width: 1.2; stroke: rgba(255,200,210,.45); }
.hud-arcs { transform-origin: 0 0; }
.hud-arcs.a1 { animation: spin 26s linear infinite; }
.hud-arcs.a2 { animation: spin 18s linear infinite reverse; }
.hud-text { animation: spin 80s linear infinite reverse; transform-origin: 0 0; }
.hud-text text { fill: rgba(255,120,145,.38); font-size: 8px; letter-spacing: 3.2px; font-family: var(--mono); }
.gfx-good .hud-arc { filter: drop-shadow(0 0 4px rgba(255,35,80,.8)); }
body.busy .hud-arcs.a1 { animation-duration: 6s; } body.busy .hud-arcs.a2 { animation-duration: 4s; }
body.mobile #core-wrap .hud { width: 118%; height: 118%; }
.gfx-potato .hud-ticks, .gfx-potato .hud-text, .gfx-potato .hud-arcs { animation: none; }

/* Dauerhafter Energiefluss in den Leiterbahnen (zusätzlich zu den Impulsen) */
.trace-live { stroke-dasharray: 2 12; animation: flow 1.8s linear infinite; opacity: .75; }
@keyframes flow { to { stroke-dashoffset: -28; } }
.gfx-potato .trace-live { animation: none; stroke-dasharray: none; opacity: .55; }
.pulse { stroke: #fff4f6; stroke-width: 3.6; }

/* Modul-Platten: Eck-Klammern + Lichtstreifen */
.node::after { content: ""; position: absolute; inset: 5px; pointer-events: none; opacity: .0; transition: opacity .25s, inset .25s;
  background:
    linear-gradient(var(--red), var(--red)) top left / 14px 2px no-repeat, linear-gradient(var(--red), var(--red)) top left / 2px 14px no-repeat,
    linear-gradient(var(--red), var(--red)) bottom right / 14px 2px no-repeat, linear-gradient(var(--red), var(--red)) bottom right / 2px 14px no-repeat; }
.node:hover::after, .node.zap::after { opacity: 1; inset: 3px; }
.node .n-ico { position: relative; overflow: hidden; }
.gfx-good .node .n-ico::after { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.35) 50%, transparent 70%);
  transform: translateX(-120%); }
.gfx-good .node:hover .n-ico::after { animation: sheen .7s ease; }
@keyframes sheen { to { transform: translateX(120%); } }
.node .n-name { text-shadow: 0 0 18px rgba(255,35,80,.0); transition: text-shadow .3s; }
.node:hover .n-name { text-shadow: 0 0 14px rgba(255,35,80,.6); }

/* Scanlines + langsamer Lichtstreifen über dem Hub (nur gute Grafik) */
.gfx-good #hub > #circuit::after { content: none; }
.gfx-good #hub .scan { position: absolute; inset: 0; pointer-events: none; z-index: 6; opacity: .06;
  background: repeating-linear-gradient(0deg, rgba(255,255,255,.5) 0 1px, transparent 1px 3px); mix-blend-mode: overlay; }
.gfx-good #hub .sweep { position: absolute; left: 0; right: 0; height: 30vh; top: -30vh; pointer-events: none; z-index: 1;
  background: linear-gradient(180deg, transparent, rgba(255,35,80,.05), transparent); animation: sweep 9s linear infinite; }
@keyframes sweep { to { transform: translateY(160vh); } }
body.touch #hub .scan { display: none; }

/* Topbar mit Energie-Linie */
#topbar { position: relative; }
#topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--red), transparent); background-size: 50% 100%; background-repeat: no-repeat;
  animation: topline 6s ease-in-out infinite; opacity: .8; }
@keyframes topline { 0% { background-position: -50% 0; } 100% { background-position: 150% 0; } }
.gfx-potato #topbar::after { animation: none; background-position: 50% 0; }

/* ====================== KERN-ZÜNDUNG ====================== */
#lock .lock-core { position: relative; }
#lock.igniting .lock-core { animation: ignCore 1.5s cubic-bezier(.2,.8,.3,1) forwards; }
@keyframes ignCore {
  0% { filter: grayscale(1) brightness(.55); transform: scale(1); }
  25% { filter: grayscale(.3) brightness(1.2); transform: scale(.94); }
  45% { filter: none brightness(1.6) drop-shadow(0 0 30px #ff2350); transform: scale(1.12); }
  70% { filter: none brightness(1.2) drop-shadow(0 0 50px #ff2350); transform: scale(1.04); }
  100% { filter: none drop-shadow(0 0 40px #ff2350); transform: scale(1.08); }
}
#lock.igniting .lock-core .core-plasma { opacity: 1; }
#lock.igniting .lock-core .spin-rev { animation-duration: 2.5s !important; animation-play-state: running; }
#lock.igniting .lock-core .orbit { animation-duration: .8s !important; animation-play-state: running; }
#lock.igniting .lock-box { transition: opacity .6s .5s, transform .8s .4s; opacity: 0; transform: translateY(30px); }
.ign-fx { position: fixed; width: 0; height: 0; pointer-events: none; z-index: 5; }
.ign-ring { position: absolute; left: 0; top: 0; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%;
  border: 3px solid rgba(255,80,110,.9); box-shadow: 0 0 30px rgba(255,35,80,.8), inset 0 0 20px rgba(255,35,80,.6);
  animation: ignRing 1.3s cubic-bezier(.1,.7,.3,1) forwards; }
.ign-ring.alt { border-color: rgba(255,240,244,.9); border-width: 2px; }
@keyframes ignRing { to { transform: scale(60); opacity: 0; border-width: .5px; } }
.ign-rays { position: absolute; left: -100vmax; top: -100vmax; width: 200vmax; height: 200vmax; opacity: 0;
  background: repeating-conic-gradient(from 0deg, rgba(255,60,100,.0) 0deg 6deg, rgba(255,60,100,.22) 7deg 8deg, rgba(255,60,100,0) 9deg 15deg);
  -webkit-mask-image: radial-gradient(circle, #000 0%, transparent 55%); mask-image: radial-gradient(circle, #000 0%, transparent 55%);
  animation: ignRays 1.6s ease-out .55s forwards; }
@keyframes ignRays { 0% { opacity: 0; transform: rotate(0) scale(.6); } 30% { opacity: 1; } 100% { opacity: 0; transform: rotate(40deg) scale(1.3); } }
.ign-core-flash { position: absolute; left: -60vmax; top: -60vmax; width: 120vmax; height: 120vmax; border-radius: 50%; opacity: 0;
  background: radial-gradient(circle, #fff 0%, rgba(255,210,220,.9) 8%, rgba(255,35,80,.45) 25%, transparent 55%);
  animation: ignFlash 1s ease-out .65s forwards; }
@keyframes ignFlash { 0% { opacity: 0; transform: scale(.2); } 20% { opacity: 1; } 100% { opacity: 0; transform: scale(1.2); } }
#lock.out.igniting .lock-core { animation: ignZoom .85s cubic-bezier(.6,0,.9,.4) forwards; }
@keyframes ignZoom { from { transform: scale(1.08); } to { transform: scale(9); opacity: 0; filter: brightness(2) drop-shadow(0 0 60px #ff2350); } }
#lock.out.igniting { transform: none; }
/* Hub "landet" nach der Zündung: Kern pulsiert hell auf */
body.just-ignited #core-wrap { animation: landCore 1.4s ease-out; }
@keyframes landCore { 0% { transform: translate(-50%, -50%) scale(1.5); filter: brightness(2); } 100% { transform: translate(-50%, -50%) scale(1); filter: none; } }
body.mobile.just-ignited #core-wrap { animation: none; }
.gfx-potato .ign-rays, .gfx-potato .ign-ring.alt { display: none; }
body.touch .ign-ring { box-shadow: none; }
/* Intro: Lichtstrahlen hinter dem Kern */
.intro-rays { position: absolute; left: calc(50% - 85vmax); top: calc(50% - 85vmax); width: 170vmax; height: 170vmax; transform: scale(.3); opacity: 0; z-index: 0;
  background: repeating-conic-gradient(from 0deg, rgba(255,60,100,0) 0deg 5deg, rgba(255,60,100,.16) 6deg 7deg, rgba(255,60,100,0) 8deg 12deg);
  -webkit-mask-image: radial-gradient(circle, #000 0%, transparent 50%); mask-image: radial-gradient(circle, #000 0%, transparent 50%);
  transition: opacity .8s, transform 1.4s cubic-bezier(.2,.9,.3,1); pointer-events: none; }
.intro-rays.on { opacity: 1; transform: scale(1); animation: raySpin 14s linear infinite; }
@keyframes raySpin { from { rotate: 0deg; } to { rotate: 360deg; } }
#intro.zoom .intro-rays { opacity: 0; transition: opacity .5s; }
.gfx-potato .intro-rays { display: none; }

/* ---- Modul-Ansichten cooler ---- */
#modules { background:
  radial-gradient(ellipse at 50% -10%, rgba(255,35,80,.07), transparent 55%),
  linear-gradient(rgba(255,255,255,.015) 1px, transparent 1px) 0 0 / 100% 36px,
  linear-gradient(90deg, rgba(255,255,255,.015) 1px, transparent 1px) 0 0 / 36px 100%; }
/* Öffnen eines Moduls: Scan-Linie fährt einmal drüber */
#view::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; z-index: 20; pointer-events: none;
  background: linear-gradient(90deg, transparent, #ff5c7a, #fff, #ff5c7a, transparent); box-shadow: 0 0 24px #ff2350;
  animation: viewScan .7s cubic-bezier(.3,.6,.4,1) forwards; }
@keyframes viewScan { from { transform: translateY(0); opacity: 1; } to { transform: translateY(100vh); opacity: 0; } }
.gfx-potato #view::before { display: none; }
/* Panels: Glas + rote Oberkante */
.panel, .set-sec, .mem-card, .store-row, .disk, .codeblock { position: relative; }
.set-sec::before, .disk::before { content: ""; position: absolute; left: 14px; right: 14px; top: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,35,80,.7), transparent); }
.side { background: linear-gradient(180deg, rgba(14,15,20,.92), rgba(8,9,12,.92)); }
.side-item.active { box-shadow: inset 3px 0 0 var(--red); }
/* Primär-Buttons mit Lichtschimmer */
.btn.primary { position: relative; overflow: hidden; }
.gfx-good .btn.primary::after { content: ""; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.35), transparent); transform: skewX(-18deg); }
.gfx-good .btn.primary:hover::after { animation: btnShine .7s ease; }
@keyframes btnShine { to { left: 130%; } }
/* KI-Avatar im Chat = Mini-Kern */
.msg.ai .av { background: radial-gradient(circle at 50% 50%, #fff 0 12%, #ff5c7a 22%, #c8002f 45%, #2a0710 70%);
  border: 1px solid #5a1a28; color: transparent; font-size: 0; position: relative; }
.gfx-good .msg.ai .av { box-shadow: 0 0 16px rgba(255,35,80,.5); animation: avPulse 1.6s ease-in-out infinite; }
@keyframes avPulse { 0%,100% { box-shadow: 0 0 10px rgba(255,35,80,.35); } 15% { box-shadow: 0 0 22px rgba(255,35,80,.8); } }
/* Toast mit Akzent */
#toast { border-left: 3px solid var(--red); background: rgba(16,18,24,.96); }
.gfx-good #toast { backdrop-filter: blur(8px); }
/* Überschriften der Module leicht leuchtend */
.mem-title, .set-sec h3, .chat-head .title { text-shadow: 0 0 18px rgba(255,35,80,.25); }
.pulse.shot { stroke: #fff; stroke-width: 5; }
.pulse.back { stroke: #ffb3c1; stroke-width: 2.2; }
/* Titel-Glitch alle paar Sekunden (nur gute Grafik) */
.gfx-good .brand-title { animation: brandGlitch 9s infinite; }
@keyframes brandGlitch {
  0%, 92%, 100% { text-shadow: none; transform: none; }
  93% { text-shadow: -3px 0 rgba(255,35,80,.9), 3px 0 rgba(80,220,255,.5); transform: translateX(1px) skewX(-6deg); }
  94% { text-shadow: 2px 0 rgba(255,35,80,.9), -2px 0 rgba(80,220,255,.5); transform: translateX(-2px); }
  95% { text-shadow: none; transform: none; }
}
/* Login: HUD-Ringe um den schlafenden Kern */
#lock .lock-core::before, #lock .lock-core::after { content: ""; position: absolute; inset: -9%; border-radius: 50%; pointer-events: none;
  border: 1px dashed rgba(255,80,110,.35); animation: spin 40s linear infinite; }
#lock .lock-core::after { inset: -15%; border: 2px solid transparent; border-top-color: rgba(255,60,100,.6); border-bottom-color: rgba(255,60,100,.35);
  animation: spin 9s linear infinite reverse; }
#lock.igniting .lock-core::after { animation-duration: 1.2s; border-top-color: #fff; }
.lock-monitor { box-shadow: inset 0 0 30px rgba(0,0,0,.8), 0 0 0 1px rgba(255,35,80,.08); }
.lock-monitor::before { content: "EKG · KERN"; position: absolute; left: 12px; top: 8px; font: 10px var(--mono); letter-spacing: .3em; color: #4a4f5a; }
.lock-title { text-shadow: 0 0 20px rgba(255,35,80,.45); }
.gfx-potato #lock .lock-core::before, .gfx-potato #lock .lock-core::after { animation: none; }
.intro-log { position: absolute; left: max(18px, env(safe-area-inset-left)); bottom: max(18px, env(safe-area-inset-bottom)); z-index: 4;
  font: 11px/1.6 var(--mono); color: rgba(255,120,145,.55); letter-spacing: .06em; pointer-events: none; }
.intro-log .il { animation: ilIn .25s ease-out; white-space: nowrap; }
.intro-log .il.hot { color: #fff; text-shadow: 0 0 10px #ff2350; }
@keyframes ilIn { from { opacity: 0; transform: translateX(-8px); } }
#intro.zoom .intro-log { opacity: 0; transition: opacity .3s; }
body.mobile .intro-log { font-size: 9.5px; }
/* ComfyUI: Vorschau "lädt" mit Scanner */
.stage-preview.busy::after { content: ""; position: absolute; left: 0; right: 0; height: 30%; top: -30%; pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(255,35,80,.22), rgba(255,200,210,.35), transparent); animation: scanDown 1.6s linear infinite; }
.stage-preview.busy { border-color: rgba(255,35,80,.5); box-shadow: inset 0 0 40px rgba(255,35,80,.12); }
@keyframes scanDown { to { top: 100%; } }
.gfx-potato .stage-preview.busy::after { animation-duration: 3s; }

/* ====================== SPEZIALZENTREN ====================== */
/* Zahnrad-Geste */
.hud-progress { fill: none; stroke: #ffd0da; stroke-width: 4; stroke-linecap: round; opacity: .0; transition: opacity .2s; }
body.gear-turning .hud-progress { opacity: 1; filter: drop-shadow(0 0 6px #ff2350); }
.hud-progress.full { stroke: #fff; filter: drop-shadow(0 0 10px #fff) !important; }
body.gear-turning #hubcore .core-housing { filter: brightness(1.25); }
#hubcore .core-housing { transform-origin: 0 0; }
body.gear-turning #hub-hint { color: var(--red2); }
#core-wrap.warn #hubcore .core-plasma { animation: warnFlick .5s steps(2) 1; }
@keyframes warnFlick { 50% { opacity: .35; } }

/* Kern stirbt */
body.core-dying #hub { animation: hubGlitch .25s steps(2) infinite; }
body.core-dying #hubcore .core-plasma { animation: dying .18s steps(2) infinite; }
@keyframes dying { 0% { opacity: 1; } 50% { opacity: .2; transform: scale(.92); } }
@keyframes hubGlitch { 0% { transform: translate(0,0); filter: hue-rotate(0); } 50% { transform: translate(-4px,2px); filter: hue-rotate(-15deg) saturate(1.6); } }
body.core-dead #hub { animation: none; filter: grayscale(1) brightness(.35); transition: filter .6s; }
body.core-dead #hubcore .core-plasma { animation: none; opacity: .05; }
.crash-alarm { position: fixed; inset: 0; z-index: 180; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; pointer-events: none;
  background: radial-gradient(circle, rgba(255,0,40,.0), rgba(255,0,40,.35)); animation: alarmPulse .32s ease-in-out infinite alternate; }
@keyframes alarmPulse { from { background-color: rgba(255,0,40,.04); } to { background-color: rgba(255,0,40,.16); } }
.crash-text { font-size: clamp(26px, 6vw, 64px); font-weight: 800; letter-spacing: .25em; color: #fff; text-shadow: 0 0 30px #ff0030, 3px 0 #ff0030, -3px 0 rgba(80,220,255,.6); }
.crash-sub { color: #ffb3c1; letter-spacing: .3em; font-size: 12px; text-transform: uppercase; }
.crash-alarm.dead { animation: none; background: rgba(0,0,0,.75); transition: background .5s; }
.crash-alarm.dead .crash-text { color: #555; text-shadow: none; }

/* Wiederbelebung */
.revive { position: fixed; inset: 0; z-index: 185; background: #000; display: flex; align-items: center; justify-content: center; transition: opacity .6s; }
.rv-box { width: min(620px, 90vw); display: flex; flex-direction: column; gap: 14px; align-items: center; }
.rv-label { letter-spacing: .4em; font-size: 14px; color: #ff8aa0; text-shadow: 0 0 14px #ff2350; }
.rv-bar { width: 100%; height: 6px; border-radius: 6px; background: #1a0a0e; overflow: hidden; }
.rv-bar > div { width: 0; height: 100%; background: linear-gradient(90deg, #8a0020, #ff2350, #fff); transition: width 1.1s linear; box-shadow: 0 0 16px #ff2350; }
.rv-mon { width: 100%; height: 130px; border: 1px solid #2a1218; border-radius: 12px; overflow: hidden; background: #040405; }
.rv-ecg { width: 100%; height: 100%; display: block; }
.revive.shock::after { content: ""; position: absolute; inset: 0; background: #fff; animation: shockFlash .5s ease-out forwards; pointer-events: none; }
@keyframes shockFlash { from { opacity: 1; } to { opacity: 0; } }
.revive.enter { animation: enterCore .75s cubic-bezier(.6,0,.9,.4) forwards; }
@keyframes enterCore { to { transform: scale(3); opacity: 0; filter: blur(6px); } }

/* Gemeinsame Zentrums-Ansicht */
.center-view { position: fixed; inset: 0; z-index: 120; display: flex; flex-direction: column; opacity: 0; transform: scale(1.06); transition: opacity .5s, transform .6s cubic-bezier(.2,.9,.3,1);
  background: #050406; }
.center-view.in { opacity: 1; transform: none; }
.center-view.out { opacity: 0; transform: scale(.95); }
body.in-center #view { visibility: hidden; }
.center-head { display: flex; align-items: center; gap: 14px; padding: max(14px, env(safe-area-inset-top)) 22px 14px; border-bottom: 1px solid rgba(255,35,80,.25);
  background: linear-gradient(180deg, rgba(30,6,12,.9), rgba(10,4,6,.7)); position: relative; z-index: 2; }
.center-head::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: linear-gradient(90deg, transparent, #ff2350, transparent); }
.ch-core { width: 44px; height: 44px; flex: none; }
.ch-core svg { width: 100%; height: 100%; }
.ch-title { font-size: 18px; font-weight: 700; letter-spacing: .35em; color: #fff; text-shadow: 0 0 16px rgba(255,35,80,.6); }
.ch-sub { font-size: 11px; color: #c78a96; letter-spacing: .2em; text-transform: uppercase; margin-top: 2px; }
.ch-pulse { display: flex; align-items: center; gap: 6px; color: #ffb3c1; font-size: 13px; margin-right: 8px; }
.ch-pulse b { font-size: 20px; color: #fff; font-variant-numeric: tabular-nums; }

/* Kontrollzentrum: "im Herz" */
#control { background: radial-gradient(ellipse at 50% 120%, #3a0612, #0c0306 60%, #050203); }
.cc-vessels { position: absolute; inset: 0; pointer-events: none; opacity: .55;
  background:
    radial-gradient(circle at 50% 50%, transparent 0 28%, rgba(255,35,80,.07) 28.5%, transparent 29.5%),
    radial-gradient(circle at 50% 50%, transparent 0 42%, rgba(255,35,80,.06) 42.5%, transparent 43.5%),
    radial-gradient(circle at 50% 50%, transparent 0 58%, rgba(255,35,80,.05) 58.5%, transparent 59.5%);
  animation: vessel 1.25s ease-out infinite; }
@keyframes vessel { 0% { transform: scale(1); opacity: .55; } 12% { transform: scale(1.04); opacity: .85; } 40% { transform: scale(1); opacity: .55; } }
.gfx-potato .cc-vessels { animation: none; }
.cc-grid { position: relative; z-index: 1; flex: 1; overflow: auto; padding: 18px 22px max(22px, env(safe-area-inset-bottom)); display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-content: start; }
.cc-panel { border: 1px solid rgba(255,35,80,.22); border-radius: 14px; padding: 14px 16px; background: linear-gradient(160deg, rgba(40,8,16,.65), rgba(12,4,7,.8)); position: relative; }
.gfx-good .cc-panel { box-shadow: inset 0 0 30px rgba(255,35,80,.06), 0 10px 30px rgba(0,0,0,.4); }
.cc-panel::before { content: ""; position: absolute; left: 16px; right: 16px; top: -1px; height: 1px; background: linear-gradient(90deg, transparent, #ff2350, transparent); }
.cc-panel.span2 { grid-column: span 3; }
.cc-panel h4 { margin: 0 0 10px; font-size: 11px; letter-spacing: .3em; text-transform: uppercase; color: #ff8aa0; }
.cc-gauges { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.cc-gauge { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.g-ring { position: relative; width: min(120px, 100%); aspect-ratio: 1; }
.g-ring svg { width: 100%; height: 100%; }
.g-bg { fill: none; stroke: rgba(255,255,255,.06); stroke-width: 9; }
.g-fg { fill: none; stroke: #ff2350; stroke-width: 9; stroke-linecap: round; transition: stroke-dasharray .8s ease; }
.gfx-good .g-fg { filter: drop-shadow(0 0 6px rgba(255,35,80,.8)); }
.cc-gauge.hot .g-fg { stroke: #ffb340; }
.g-val { position: absolute; inset: 0; display: grid; place-items: center; font-size: clamp(16px, 2vw, 22px); font-weight: 700; font-variant-numeric: tabular-nums; }
.g-label { font-size: 12px; letter-spacing: .2em; color: #ffd0da; text-transform: uppercase; }
.g-sub { font-size: 11px; color: #9a8a8e; text-align: center; min-height: 14px; }
.cc-sparks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 12px; }
.cc-sparks > div { border: 1px solid rgba(255,35,80,.15); border-radius: 10px; padding: 6px 10px; background: rgba(0,0,0,.25); }
.cc-sparks span { font-size: 10px; letter-spacing: .25em; color: #c78a96; }
.cc-sparks canvas { width: 100%; height: 56px; display: block; }
.cc-list { display: flex; flex-direction: column; gap: 6px; }
.cc-row { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 9px; background: rgba(0,0,0,.25); border: 1px solid rgba(255,255,255,.04); font-size: 13px; }
.cc-row .muted { font-size: 11px; }
.cc-row.on { border-color: rgba(62,224,143,.15); }
.cc-kv { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cc-kv > div { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 9px; background: rgba(0,0,0,.25); font-size: 13px; }
.cc-kv .muted { font-size: 10px; letter-spacing: .15em; text-transform: uppercase; }
@media (max-width: 1000px) { .cc-grid { grid-template-columns: 1fr; } .cc-panel.span2 { grid-column: span 1; } .cc-gauges { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .cc-sparks { grid-template-columns: 1fr; } .ch-title { font-size: 14px; letter-spacing: .2em; } .ch-pulse { display: none; } .center-head .btn { padding: 7px 10px; } }

/* Speicherzentrum */
#vault { background: radial-gradient(ellipse at 30% -10%, rgba(255,35,80,.12), transparent 50%), #060508; }
.vault-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 300px 1fr; }
.vault-side { border-right: 1px solid rgba(255,35,80,.18); overflow: auto; padding: 12px; display: flex; flex-direction: column; gap: 6px; background: rgba(10,5,8,.7); }
.vs-item { display: flex; gap: 10px; align-items: flex-start; padding: 10px 11px; border-radius: 10px; cursor: pointer; border: 1px solid transparent; font-size: 13px; flex-wrap: wrap; }
.vs-item:hover { background: rgba(255,35,80,.06); }
.vs-item.active { background: rgba(255,35,80,.12); border-color: rgba(255,35,80,.4); box-shadow: inset 3px 0 0 #ff2350; }
.vs-item .muted { font-size: 11px; }
.vs-ico { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: radial-gradient(circle at 35% 30%, #4a1a26, #14070b); color: #ff8aa0; flex: none; }
.vs-ico svg { width: 17px; height: 17px; }
.vs-types { width: 100%; display: flex; flex-wrap: wrap; gap: 4px; padding-left: 40px; }
.vs-types span { font: 10px var(--mono); color: #c78a96; border: 1px solid rgba(255,35,80,.2); border-radius: 6px; padding: 1px 5px; }
.vault-main { position: relative; overflow: auto; padding: 18px 22px; min-height: 0; }
.vm-title { margin: 0 0 14px; display: flex; gap: 10px; align-items: center; letter-spacing: .08em; }
.vm-files { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.vm-files.img { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.vm-file { border: 1px solid rgba(255,35,80,.18); border-radius: 12px; padding: 10px; background: rgba(18,8,12,.7); cursor: pointer; transition: border-color .2s, transform .2s; font-size: 12px; }
.vm-file:hover { border-color: #ff2350; transform: translateY(-2px); }
.vm-file img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; display: block; margin-bottom: 8px; }
.vm-ext { font: 700 22px var(--mono); color: #ff5c7a; padding: 18px 0; text-align: center; background: rgba(0,0,0,.3); border-radius: 8px; margin-bottom: 8px; }
.vm-name { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vm-mem { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.vm-memcard { border: 1px solid rgba(255,179,64,.25); border-radius: 12px; padding: 12px; background: rgba(30,18,6,.35); font-size: 14px; display: flex; flex-direction: column; gap: 6px; }
.vm-memcard.pinned { border-color: rgba(255,35,80,.5); }
.vm-memcard .muted { font-size: 11px; }
.brain-wrap { position: absolute; inset: 0; }
.brain-cv { width: 100%; height: 100%; display: block; cursor: grab;
  background: radial-gradient(circle at 50% 50%, rgba(255,35,80,.08), transparent 60%); }
.brain-info { position: absolute; left: 16px; bottom: max(16px, env(safe-area-inset-bottom)); max-width: 360px; padding: 12px 14px; border-radius: 12px;
  border: 1px solid rgba(255,35,80,.3); background: rgba(12,5,8,.88); font-size: 13px; display: flex; flex-direction: column; gap: 4px; }
.vault-preview { position: absolute; inset: 0; z-index: 5; background: rgba(0,0,0,.82); display: flex; align-items: center; justify-content: center; padding: 20px; }
.vp-inner { max-width: min(1000px, 96vw); max-height: 88vh; display: flex; flex-direction: column; gap: 10px; background: #0c0609; border: 1px solid rgba(255,35,80,.35); border-radius: 14px; padding: 14px; overflow: hidden; }
.vp-head { display: flex; gap: 8px; align-items: center; }
.vp-inner img { max-width: 100%; max-height: 70vh; object-fit: contain; border-radius: 8px; }
.vp-inner pre { margin: 0; overflow: auto; max-height: 70vh; font: 12.5px/1.55 var(--mono); white-space: pre-wrap; background: #050304; padding: 12px; border-radius: 8px; min-width: min(700px, 85vw); }
.vp-prompt { font-size: 12px; max-height: 80px; overflow: auto; }
@media (max-width: 760px) {
  .vault-body { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .vault-side { flex-direction: row; overflow-x: auto; border-right: none; border-bottom: 1px solid rgba(255,35,80,.18); padding: 8px; }
  .vs-item { flex: none; width: 200px; } .vs-types, .side-sec { display: none; }
  .brain-info { right: 16px; max-width: none; }
}
/* Vorschau: Start-Bildschirm + Beenden-Leiste */
.pv-start { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; padding: 20px;
  background: radial-gradient(circle, rgba(255,35,80,.1), transparent 60%), #07080b; font-size: 15px; }
.pv-start .muted { font-size: 12px; max-width: 320px; }
.pv-play { width: 84px; height: 84px; border-radius: 50%; border: 2px solid #ff5c7a; background: radial-gradient(circle, #ff3a62, #8a0020); color: #fff; cursor: pointer;
  display: grid; place-items: center; box-shadow: 0 0 30px rgba(255,35,80,.5); transition: transform .2s; }
.pv-play:hover { transform: scale(1.08); }
.pv-play svg { width: 34px; height: 34px; margin-left: 5px; }
.pv-controls { position: absolute; top: 10px; right: 10px; display: flex; gap: 6px; z-index: 3; }
.pv-controls .btn { background: rgba(10,11,15,.88); }
.pv-stop { border-color: #a0233f; color: #ffb3c1; }
.pv-stop:hover { background: #8a0020 !important; color: #fff; }
/* 3D-Gehirn: riesig */
#vault.brain-mode .vault-body { grid-template-columns: 1fr; grid-template-rows: 1fr; }
#vault.brain-mode .vault-side { position: absolute; z-index: 4; top: 0; bottom: 0; left: 0; width: 300px; transform: translateX(-102%); transition: transform .3s; }
#vault.brain-mode.side-open .vault-side { transform: none; box-shadow: 20px 0 40px rgba(0,0,0,.6); }
#vault.brain-mode .vault-main { padding: 0; }
#vault .vault-body { position: relative; }
.brain-cv { background: radial-gradient(ellipse at 50% 50%, rgba(255,35,80,.12), rgba(10,3,6,0) 55%), radial-gradient(circle at 50% 50%, #12060a, #050306 70%); }
.brain-tools { position: absolute; top: 12px; right: 12px; display: flex; gap: 6px; z-index: 3; }
.brain-tools .btn { background: rgba(10,5,8,.85); min-width: 34px; justify-content: center; }
.brain-legend { position: absolute; top: 12px; left: 12px; display: flex; flex-wrap: wrap; gap: 6px 12px; max-width: 60%; font-size: 11px; color: #c9b7bb; z-index: 3;
  padding: 8px 10px; border-radius: 10px; background: rgba(10,5,8,.6); border: 1px solid rgba(255,35,80,.15); }
.brain-legend span { display: inline-flex; align-items: center; gap: 5px; }
.brain-legend i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.lg-core { background: #fff; } .lg-module { background: #ff2350; } .lg-model { background: #be78ff; } .lg-project { background: #ff785a; }
.lg-file { background: #ff96aa; } .lg-memory { background: #ffb340; } .lg-setting { background: #78c8ff; } .lg-vital { background: #3ee08f; }
.brain-info { z-index: 3; }
#vault:fullscreen { width: 100vw; height: 100vh; }
@media (max-width: 760px) { .brain-legend { max-width: calc(100% - 24px); top: 56px; } #vault.brain-mode .vault-body { grid-template-rows: 1fr; } }

/* ====================== ÜBERHITZUNG ====================== */
body.heating #hubcore .core-plasma { filter: hue-rotate(calc(var(--heat) * 40deg)) brightness(calc(1 + var(--heat) * 1.6)) saturate(calc(1 + var(--heat))); }
body.heating #hubcore .core-aura { opacity: calc(.6 + var(--heat) * .4); transform: scale(calc(1 + var(--heat) * .5)); }
body.heating #hub::after { background: radial-gradient(circle at 50% 50%, rgba(255,140,40,calc(var(--heat) * .35)), transparent 45%), radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,.65)); }
body.heating #core-wrap::after { content: attr(data-temp); }
body.heating #bpm b { color: hsl(calc(350 + var(--heat) * 60), 100%, calc(60% + var(--heat) * 25%)); }
body.heating #hub { filter: contrast(calc(1 + var(--heat) * .2)); }
.melt { position: fixed; inset: 0; z-index: 190; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; pointer-events: none;
  background: radial-gradient(circle, rgba(255,255,220,.95), rgba(255,140,40,.7) 30%, rgba(255,35,80,.4) 60%, rgba(0,0,0,.6)); animation: meltShake .12s linear infinite; transition: background .8s, opacity .6s; }
@keyframes meltShake { 0% { transform: translate(0,0); } 50% { transform: translate(-6px,4px); } }
.melt-text { font-size: clamp(28px, 7vw, 72px); font-weight: 900; letter-spacing: .2em; color: #fff; text-shadow: 0 0 30px #ff6a00, 0 0 60px #ff2350; }
.melt-sub { letter-spacing: .3em; font-size: 12px; color: #fff3e0; text-transform: uppercase; }
.melt.boom { background: #fff; }
.melt.frost { animation: none; background: radial-gradient(circle, rgba(200,240,255,.9), rgba(60,140,220,.6) 40%, rgba(5,10,20,.95)); }
.melt.frost .melt-text { text-shadow: 0 0 30px #6cf, 0 0 60px #39f; }
.melt.out { opacity: 0; }
/* Admin-Panel */
#admin { background: radial-gradient(ellipse at 50% -10%, rgba(80,170,255,.12), transparent 50%), radial-gradient(ellipse at 50% 120%, #2a0612, #060408 60%); }
.adm-frost { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at 0 0, rgba(160,220,255,.12), transparent 30%), radial-gradient(circle at 100% 0, rgba(160,220,255,.1), transparent 30%); animation: frostFade 3s ease-out forwards; }
@keyframes frostFade { from { opacity: 1; } to { opacity: .35; } }
.adm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.adm-btn { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 14px; border-radius: 12px; cursor: pointer; text-align: left;
  border: 1px solid rgba(255,35,80,.25); background: rgba(20,8,12,.7); color: var(--text); transition: border-color .2s, transform .15s, background .2s; }
.adm-btn:hover { border-color: #ff2350; transform: translateY(-2px); background: rgba(40,10,18,.8); }
.adm-btn .ab-ico { font-size: 22px; }
.adm-btn b { font-size: 14px; } .adm-btn .muted { font-size: 11px; }
.adm-btn.warn { border-color: rgba(255,179,64,.45); }
.adm-btn.danger { border-color: rgba(255,35,80,.6); background: rgba(60,6,18,.6); }
.adm-ips { display: flex; flex-direction: column; gap: 8px; }
.adm-ip { display: grid; grid-template-columns: auto 1fr minmax(140px, 240px) auto; gap: 10px; align-items: center; padding: 8px 12px; border-radius: 10px; background: rgba(0,0,0,.3); border: 1px solid rgba(255,255,255,.05); }
.adm-ip.banned { border-color: rgba(255,35,80,.6); background: rgba(60,6,18,.4); }
.adm-ip .muted { font-size: 11px; }
.adm-ipinfo b { font-family: var(--mono); font-size: 13px; }
.adm-name { padding: 6px 10px; font-size: 13px; }
@media (max-width: 640px) { .adm-ip { grid-template-columns: auto 1fr; } .adm-name, .adm-ip .btn { grid-column: span 2; } }
.lg-region { background: #ff50c8; } .lg-concept { background: #ffbee1; }

/* Kein Markieren am Kern / Hub */
#hub, #core-wrap, #nodes, .node, #bpm, #brand, #vitals, #hub-hint { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
#core-wrap * { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
body.heating, body.heating * { -webkit-user-select: none !important; user-select: none !important; }
/* Überhitzung 2.0 */
.heat-hud { position: fixed; z-index: 60; transform: translateX(-50%); text-align: center; pointer-events: none; min-width: 220px; }
.hh-temp { font: 800 30px/1 var(--mono); color: #ffd28a; text-shadow: 0 0 16px #ff6a00; font-variant-numeric: tabular-nums; }
.hh-bar { height: 5px; margin: 6px auto 4px; width: 200px; border-radius: 5px; background: rgba(255,255,255,.08); overflow: hidden; }
.hh-bar > div { height: 100%; width: 0; background: linear-gradient(90deg, #ff2350, #ff8a00, #fff6c8); box-shadow: 0 0 12px #ff8a00; }
.hh-lbl { font-size: 10px; letter-spacing: .3em; color: #ffb38a; }
.heat-hud.crit .hh-temp { color: #fff; animation: hhBlink .25s steps(2) infinite; }
.heat-hud.crit .hh-lbl { color: #fff; }
@keyframes hhBlink { 50% { color: #ff3a3a; } }
.heat-cracks { position: absolute; inset: 0; pointer-events: none; opacity: 0; z-index: 2; }
.heat-cracks svg { width: 100%; height: 100%; overflow: visible; }
.heat-cracks path { fill: none; stroke: #fff4d0; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 4px #ff8a00) drop-shadow(0 0 10px #ff2350); }
.heat-fx { position: fixed; pointer-events: none; z-index: 55; }
.heat-ring { width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%; border: 2px solid rgba(255,140,40,.8); box-shadow: 0 0 20px rgba(255,120,0,.6);
  animation: heatRing 1.5s ease-out forwards; }
.heat-ring.hot { border-color: rgba(255,240,200,.95); border-width: 3px; }
.heat-ring.blast { border: 6px solid #fff; box-shadow: 0 0 60px #ff8a00, inset 0 0 40px #ff2350; animation: heatBlast 1.2s cubic-bezier(.1,.7,.3,1) forwards; z-index: 195; }
@keyframes heatRing { to { transform: scale(14); opacity: 0; } }
@keyframes heatBlast { to { transform: scale(70); opacity: 0; border-width: 1px; } }
.heat-spark { width: 4px; height: 4px; border-radius: 50%; background: #fff2c8; box-shadow: 0 0 8px #ff8a00, 0 0 16px #ff2350; animation: heatSpark .9s ease-out forwards; z-index: 195; }
@keyframes heatSpark { to { transform: translate(var(--dx), var(--dy)) scale(.2); opacity: 0; } }
body.heat-crit #hub::before { animation: critFlash .4s steps(2) infinite; }
@keyframes critFlash { 50% { background: rgba(255,80,0,.12); } }
body.heating #core-wrap { filter: drop-shadow(0 0 calc(var(--heat) * 60px) rgba(255,120,0,calc(var(--heat)))); }
/* Notkühlung: Eiskristalle */
.melt-frost { position: absolute; inset: 0; opacity: 0; transition: opacity .8s; pointer-events: none;
  background:
    radial-gradient(circle at 0 0, rgba(255,255,255,.85), transparent 28%), radial-gradient(circle at 100% 0, rgba(220,245,255,.8), transparent 26%),
    radial-gradient(circle at 0 100%, rgba(220,245,255,.8), transparent 26%), radial-gradient(circle at 100% 100%, rgba(255,255,255,.85), transparent 28%),
    repeating-conic-gradient(from 0deg at 50% 50%, rgba(255,255,255,.0) 0 8deg, rgba(255,255,255,.08) 9deg 10deg); }
.melt.frost .melt-frost { opacity: 1; }
.gfx-potato .heat-spark, .gfx-potato .heat-cracks path { filter: none; }
body.heating #bpm { visibility: hidden; } .heat-hud { z-index: 3; }

/* ====================== JARVIS ====================== */
#jarvis-orb { position: fixed; right: max(18px, env(safe-area-inset-right)); bottom: max(96px, calc(env(safe-area-inset-bottom) + 80px)); z-index: 90;
  width: 64px; height: 64px; border-radius: 50%; border: none; padding: 0; cursor: pointer; background: transparent; color: #fff;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: none; }
#jarvis-orb .jo-core { position: absolute; inset: 8px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #ff8aa0, #c8002f 55%, #3a0010);
  box-shadow: 0 0 22px rgba(255,35,80,.55), inset 0 0 12px rgba(255,255,255,.25); transition: transform .2s; }
#jarvis-orb .jo-mic { position: absolute; left: 50%; top: 50%; width: 24px; height: 24px; transform: translate(-50%, -50%); z-index: 2; }
#jarvis-orb .jo-ring { position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgba(255,80,110,.6); opacity: .5; }
#jarvis-orb .r2 { inset: -8px; border-width: 1px; border-style: dashed; animation: spin 12s linear infinite; }
#jarvis-orb:hover .jo-core { transform: scale(1.06); }
#jarvis-orb.wake .r1 { border-color: #3ee08f; box-shadow: 0 0 12px rgba(62,224,143,.5); }
#jarvis-orb.js-listening .jo-core { background: radial-gradient(circle at 40% 35%, #fff, #ff5c7a 50%, #8a0020); animation: joListen 1s ease-in-out infinite; }
#jarvis-orb.js-listening .r1 { animation: joRing 1.2s ease-out infinite; opacity: 1; }
#jarvis-orb.js-thinking .r2 { animation-duration: 1s; border-color: #ffb3c1; opacity: 1; }
#jarvis-orb.js-speaking .jo-core { animation: joSpeak .35s ease-in-out infinite alternate; }
#jarvis-orb.js-speaking .r1 { animation: joRing .8s ease-out infinite; opacity: 1; }
@keyframes joListen { 50% { transform: scale(1.12); box-shadow: 0 0 40px rgba(255,35,80,.9); } }
@keyframes joSpeak { to { transform: scale(1.1); box-shadow: 0 0 36px rgba(255,120,150,.9); } }
@keyframes joRing { from { transform: scale(1); opacity: .9; } to { transform: scale(1.9); opacity: 0; } }
#jarvis-bubble { position: fixed; right: max(18px, env(safe-area-inset-right)); bottom: max(172px, calc(env(safe-area-inset-bottom) + 156px)); z-index: 90;
  width: min(360px, calc(100vw - 36px)); padding: 12px 14px; border-radius: 14px; border: 1px solid rgba(255,35,80,.45);
  background: rgba(12,5,8,.94); box-shadow: 0 10px 40px rgba(0,0,0,.6), 0 0 30px rgba(255,35,80,.15); font-size: 14px; line-height: 1.45; animation: viewIn .25s ease; }
#jarvis-bubble .jb-who { font-size: 10px; letter-spacing: .25em; color: #8d919c; text-transform: uppercase; margin-top: 6px; }
#jarvis-bubble .jb-who.hb { color: #ff8aa0; }
#jarvis-bubble .jb-you { color: #ddd; }
#jarvis-bubble .jb-say { color: #fff; }
#jarvis-bubble .jb-live { color: #fff; font-size: 16px; min-height: 22px; }
.jb-think { display: flex; gap: 5px; margin-top: 8px; }
.jb-think i { width: 7px; height: 7px; border-radius: 50%; background: #ff5c7a; animation: jbDot 1s ease-in-out infinite; }
.jb-think i:nth-child(2) { animation-delay: .15s; } .jb-think i:nth-child(3) { animation-delay: .3s; }
@keyframes jbDot { 50% { transform: translateY(-5px); opacity: .4; } }
body.jarvis-talking #hubcore .core-aura { opacity: 1; }
body.in-center #jarvis-orb, body.locked #jarvis-orb { bottom: max(18px, env(safe-area-inset-bottom)); }
body.locked #jarvis-orb, body.locked #jarvis-bubble { display: none; }
body.mobile #jarvis-orb { bottom: max(76px, calc(env(safe-area-inset-bottom) + 64px)); width: 58px; height: 58px; }
body.mobile.in-module #jarvis-orb { bottom: max(150px, calc(env(safe-area-inset-bottom) + 140px)); } body.mobile.in-module #jarvis-bubble { bottom: 220px; }
.hud-progress { display: none !important; } .heat-hud { display: none !important; }
