/* Luxmation Studio, Entwurf 06 „Studio-Split“.
   Aufbau wie OpenArt: links eine schmale Leiste mit den Bereichen, oben eine ruhige Kopfzeile, darunter links die
   Einstellungen (Modell, Art, Start- und Endbild, Prompt, Kamera, Einstellungen, Erstellen) und rechts die Ergebnisse.
   Look: Graphit mit Electric Lime als Akzent, Violett und Blau nur ab und zu als Highlight (Verlängert, Sequenz,
   Video- und Audio-Referenzen, Verlängern-Leiste), Schrift Onest. Keine Lichtkegel, kein Glühen, keine Deko-Formen:
   der Inhalt steht im Vordergrund. Bewusst nur dunkel. */
:root {
  --bg: #0E0F12;
  --panel: #121318;
  --surface: #15171C;
  --surface-2: #191B21;
  --surface-3: #20232B;
  --line: #24272F;
  --line-2: #2E323C;
  --line-soft: #1C1E24;
  --text: #E9EAEE;
  --text-2: #C9CCD4;
  --muted: #9499A6;
  --dim: #7C818E;
  --accent: #C8FF00;
  --accent-2: #D6FF4D;
  --accent-ink: #0B0D12;
  --accent-wash: rgba(200, 255, 0, .1);
  --accent-edge: rgba(200, 255, 0, .5);
  /* Highlights, sparsam */
  --violet: #A78BFA;
  --violet-wash: rgba(167, 139, 250, .1);
  --violet-edge: rgba(167, 139, 250, .5);
  --blue: #6C93FF;
  --bad: #FF7A6B;
  --warn: #F5C451;
  --f-body: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r-lg: 16px;
  --r: 12px;
  --r-ctl: 10px;
  --top-h: 60px;
  --rail-w: 84px;
  --ease: cubic-bezier(.2, .75, .15, 1);
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--bg); overflow-x: hidden; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--f-body); font-size: 14px; line-height: 1.5; overflow-x: hidden; -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--accent); color: var(--accent-ink); }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-size: 12px; color: var(--muted); }
.mono i { font-style: normal; }
.lbl { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.lbl i { font-style: normal; font-weight: 400; color: var(--dim); margin-left: 4px; }
* { scrollbar-width: thin; scrollbar-color: #2E323C transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #2E323C; border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Marke ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; flex: none; }
.brand .mark { width: 36px; height: 36px; stroke: none; border-radius: 8px; display: block; object-fit: cover; }
.brand .mark rect { fill: var(--accent); }
.brand .mark path { fill: var(--bg); }
.brand-t { font-weight: 600; font-size: 17px; letter-spacing: -.01em; }
.brand-t span { color: var(--muted); font-weight: 400; }
.brand.big .mark { width: 44px; height: 44px; }
.brand.big .brand-t { font-size: 20px; }

/* ---------- Knöpfe ---------- */
.go { position: relative; width: 100%; height: 50px; border: 0; border-radius: var(--r); background: var(--accent); color: var(--accent-ink);
  display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 600; font-size: 15px; transition: background .2s, transform .15s; }
.go b { font-weight: 500; font-size: 13.5px; opacity: .8; }
.go b::before { content: "· "; }
.go b:empty { display: none; }
.go:hover { background: var(--accent-2); box-shadow: 0 10px 30px -10px rgba(200, 255, 0, .55); }
.go:active { transform: scale(.99); }
.go:disabled { background: #2A2D35; color: #7C818E; cursor: not-allowed; transform: none; }
.go.busy span::after { content: ""; display: inline-block; width: 13px; height: 13px; margin-left: 10px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -2px; }
.go.nudge { animation: nudge 1s var(--ease) 2; }
@keyframes nudge { 0%, 100% { box-shadow: 0 0 0 0 rgba(200, 255, 0, 0); } 50% { box-shadow: 0 0 0 5px rgba(200, 255, 0, .25); } }
.btn { height: 38px; padding: 0 14px; border-radius: var(--r-ctl); border: 1px solid var(--line); background: var(--surface-2); font-weight: 500; font-size: 13.5px; color: var(--text);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: border-color .2s, background .2s, color .2s; white-space: nowrap; text-decoration: none; }
.btn:hover { border-color: var(--line-2); background: var(--surface-3); }
.btn.small { height: 34px; padding: 0 12px; font-size: 13px; }
.btn.small svg { width: 16px; height: 16px; }
.btn.lime { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.btn.lime:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn.danger:hover { border-color: rgba(255, 122, 107, .6); color: var(--bad); }
.btn.confirm { border-color: var(--bad); color: var(--bad); background: rgba(255, 122, 107, .1); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.icon { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface-2); display: grid; place-items: center; color: var(--muted); transition: color .2s, border-color .2s; }
.icon:hover { color: var(--text); border-color: var(--line-2); }
.x { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface-2); font-size: 19px; line-height: 1; color: var(--muted); display: grid; place-items: center; flex: none; transition: color .2s, border-color .2s; }
.x:hover { color: var(--text); border-color: var(--line-2); }
.link { border: 0; background: none; padding: 0; color: var(--accent); font-size: 12.5px; font-weight: 500; }
.link:hover { color: var(--accent-2); text-decoration: underline; text-underline-offset: 3px; }
.msg { margin: 0; font-size: 13px; color: var(--bad); line-height: 1.45; }
.msg:empty { display: none; }
.msg.ok { color: var(--accent); }

/* ---------- Login ---------- */
/* Login: ruhig in der Mitte, Karte mit feiner Kante */
.gate { min-height: 100dvh; display: grid; place-items: center; padding: 24px max(16px, env(safe-area-inset-right, 0px)) 24px max(16px, env(safe-area-inset-left, 0px)); }
.gate[hidden] { display: none; }
.gate-side { width: 100%; display: grid; place-items: center; }
.gate-card { width: min(420px, 100%); display: grid; gap: 20px; padding: 32px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); box-shadow: var(--hi), 0 30px 80px -40px rgba(0, 0, 0, .9); animation: fadeIn .5s var(--ease) both; }
.gate-t { display: grid; gap: 6px; margin-top: 14px; }
.gate-kicker { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.gate-h { font-size: 30px; letter-spacing: -.02em; }
.gate-sub { margin: 0; font-size: 15px; color: var(--muted); }
.gate .field input { height: 52px; font-size: 16px; padding-right: 48px; }
.pw-wrap { position: relative; display: block; }
.pw-eye { position: absolute; right: 6px; top: 50%; width: 40px; height: 40px; margin-top: -20px; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--muted); display: grid; place-items: center; }
.pw-eye:hover, .pw-eye.on { color: var(--text); }
.gate .go { height: 52px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; font-size: 15.5px; }
.gate .go svg { width: 18px; height: 18px; transition: transform .2s var(--ease); }
.gate .go:hover svg { transform: translateX(3px); }
.gate .msg:empty { display: none; }
.gate-foot { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--dim); }
.gate-foot svg { width: 15px; height: 15px; }
.gate-models { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 16px; border-top: 1px solid var(--line-soft); }
.gate-models span { font-size: 11.5px; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--text-2); }
@media (max-width: 520px) {
  .gate { place-items: start center; padding-top: max(28px, env(safe-area-inset-top, 0px)); }
  .gate-card { padding: 24px 20px; border-radius: 18px; }
  .gate-h { font-size: 26px; }
}

.field { display: grid; gap: 8px; }
.field input { width: 100%; height: 46px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); border-radius: var(--r-ctl); padding: 0 14px; font-size: 16px; transition: border-color .2s; }
.field input:focus { outline: none; border-color: var(--accent-edge); }

/* ---------- Grundgerüst: Leiste links, Kopfzeile oben ---------- */
.app { display: grid; grid-template-columns: var(--rail-w) minmax(0, 1fr); min-height: 100dvh; }
.rail { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 12px 0; border-right: 1px solid var(--line-soft); background: var(--bg); z-index: 50; }
.rail .brand { height: 36px; margin-top: 0; }
.tabs { display: flex; flex-direction: column; gap: 4px; }
.tab { width: 68px; display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 10px 0 8px; border: 0; border-radius: var(--r); background: none; color: var(--muted); font-size: 11.5px; font-weight: 500; transition: background .2s, color .2s; }
.tab svg { width: 21px; height: 21px; }
.tab:hover { color: var(--text); background: var(--surface); }
.tab[aria-pressed="true"] { color: var(--text); background: var(--surface-3); }
.main { min-width: 0; }
.top { position: sticky; top: 0; z-index: 40; height: var(--top-h); display: flex; align-items: center; gap: 14px; padding: 0 max(20px, env(safe-area-inset-right, 0px)) 0 20px; background: var(--bg); border-bottom: 1px solid var(--line-soft); }
.top-brand { display: none; }
.top-brand .mark { width: 32px; height: 32px; }
.top-t { font-size: 17px; }
.top-r { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.credits { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 13px; color: var(--muted); overflow: hidden; }
.credits .c-l { margin-right: 2px; }
.credits b { color: var(--text); font-weight: 500; }
.credits i { font-style: normal; color: var(--dim); }
.credits .bar { position: absolute; left: 14px; right: 14px; bottom: 4px; height: 2px; border-radius: 1px; background: var(--surface-3); }
.credits .bar span { display: block; height: 100%; width: 0; border-radius: 1px; background: var(--accent); transition: width .6s var(--ease); }
.credits.hot { border-color: rgba(255, 122, 107, .5); }
.credits.hot b { color: var(--bad); }
.credits.hot .bar span { background: var(--bad); }

/* ---------- Startbildschirm ---------- */
.home { max-width: 1320px; margin: 0 auto; padding: 36px max(24px, env(safe-area-inset-right, 0px)) 80px 24px; display: grid; gap: 44px; animation: fadeIn .35s var(--ease) both; }
.h-hero { display: grid; gap: 12px; justify-items: center; text-align: center; padding: 18px 0 4px; }
.h-banner { position: relative; width: 100%; aspect-ratio: 16 / 9; max-height: min(600px, 68dvh); border-radius: 20px; overflow: hidden; background: #000; margin-bottom: 10px; box-shadow: 0 0 0 1px var(--line), 0 30px 80px -40px rgba(200, 255, 0, .25); }
.h-banner-m, .h-banner-m video, .h-banner-m img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.h-sound { position: absolute; right: 14px; bottom: 14px; z-index: 2; width: 40px; height: 40px; padding: 0; border-radius: 50%; border: 1px solid var(--line-2); background: rgba(14, 15, 18, .72); color: var(--text); display: grid; place-items: center; transition: background .2s, border-color .2s; }
.h-sound[hidden] { display: none; }
.h-sound:hover { background: var(--surface-3); border-color: var(--text-2); }
.h-sound svg { width: 19px; height: 19px; }
.h-sound.on svg { color: var(--accent); }
.h-date { margin: 0; font-size: 13px; color: var(--muted); }
.h-title { font-size: clamp(28px, 3.6vw, 40px); line-height: 1.15; letter-spacing: -.02em; text-wrap: balance; }
.h-prompt { width: min(820px, 100%); margin-top: 10px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); text-align: left; transition: border-color .2s; }
.h-prompt:focus-within { border-color: var(--accent-edge); }
.h-prompt textarea { display: block; width: 100%; border: 0; background: none; color: var(--text); font-size: 16px; line-height: 1.5; padding: 16px 16px 6px; resize: none; outline: none; min-height: 84px; max-height: 220px; field-sizing: content; }
.h-prompt textarea::placeholder { color: var(--dim); }
.h-bar { display: flex; align-items: center; gap: 10px; padding: 8px 10px 10px; }
.h-kind button svg { width: 15px; height: 15px; }
.h-go { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px 0 18px; border: 0; border-radius: var(--r-ctl); background: var(--accent); color: var(--accent-ink); font-weight: 600; font-size: 14px; transition: background .2s; }
.h-go:hover { background: var(--accent-2); }
.h-go svg { width: 18px; height: 18px; stroke-width: 2; }
.h-ideas { justify-content: center; margin-top: 4px; }
.h-sec { display: grid; gap: 16px; min-width: 0; }
.h-sec-h { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.h-sec-h h2 { font-size: 20px; }
.h-sec-h p { margin: 0; color: var(--muted); font-size: 13.5px; }
.tools { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.tool { display: flex; flex-direction: column; gap: 4px; padding: 0 0 14px; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); color: var(--text); text-align: left; transition: border-color .2s, background .2s; }
.tool > span:not(.t-media) { margin: 0 14px; }
.t-media { position: relative; display: block; aspect-ratio: 16 / 9; margin-bottom: 8px; background: #000; overflow: hidden; }
.t-media video, .t-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.tool:hover { border-color: var(--line-2); background: var(--surface-2); }
.t-ic { grid-row: 1 / 4; width: 44px; height: 44px; border-radius: var(--r); display: grid; place-items: center; background: var(--surface-3); color: var(--text); }
.t-ic svg { width: 21px; height: 21px; }
.t-name { font-weight: 600; font-size: 15px; }
.t-desc { font-size: 13px; color: var(--muted); line-height: 1.45; }
.t-tag { align-self: flex-start; margin-top: 6px; padding: 3px 8px; font-size: 11.5px; color: var(--text-2); background: var(--surface-3); border-radius: 6px; }
.h-row { display: flex; gap: 12px; overflow-x: auto; padding: 2px 2px 10px; scroll-snap-type: x proximity; }
.h-row > * { scroll-snap-align: start; }
.h-row .m-tile { flex: none; width: 190px; }
/* Entdecken: Beispiele als Mauerwerk, Prompt und „Nachmachen“ beim Drüberfahren */
.gallery { column-width: 240px; column-gap: 10px; }
.gallery .ex { margin-bottom: 10px; break-inside: avoid; }
.ex { position: relative; border-radius: var(--r); overflow: hidden; background: #000; cursor: pointer; }
.gallery .ex video, .gallery .ex img { display: block; width: 100%; height: auto; aspect-ratio: var(--ar); object-fit: cover; }
.ex-kind { position: absolute; left: 8px; top: 8px; z-index: 2; font-size: 11px; font-weight: 500; padding: 3px 7px; border-radius: 6px; background: var(--bg); color: var(--text-2); }
.ex-cap { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; display: flex; align-items: flex-end; gap: 10px; padding: 10px; background: rgba(14, 15, 18, .92); opacity: 0; transition: opacity .2s; }
.ex-cap p { margin: 0; flex: 1; min-width: 0; font-size: 12.5px; line-height: 1.4; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ex-go { flex: none; height: 30px; padding: 0 12px; border: 0; border-radius: 7px; background: var(--accent); color: var(--accent-ink); font-size: 12.5px; font-weight: 600; }
.ex-go:hover { background: var(--accent-2); }
.ex:hover .ex-cap, .ex:focus-within .ex-cap { opacity: 1; }
.examples { margin-top: 36px; }
.examples .feed-h .mono { flex: 1 1 260px; }
.credit { margin: 0; font-size: 12px; color: var(--dim); text-align: center; }
.credit code { font-size: 11.5px; }
.h-recent .card { flex: none; height: 180px; width: calc(180px * var(--ar, 1)); max-width: 320px; aspect-ratio: auto; }
.models { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.check { display: grid; gap: 8px; }
.check-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--surface); }
.check-row small { grid-column: 1 / -1; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.check-st { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 6px; background: var(--surface-3); color: var(--text-2); }
.check-row.ok .check-st { background: var(--accent-wash); color: var(--accent); }
.check-row.bad .check-st, .check-row.error .check-st { background: rgba(255, 122, 107, .12); color: var(--bad); }
.mcard { display: flex; gap: 14px; padding: 18px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.mcard b { font-weight: 600; font-size: 16px; }
.mcard p { margin: 4px 0 10px; color: var(--muted); font-size: 13.5px; }
.specs { display: flex; flex-wrap: wrap; gap: 6px; }
.specs span { font-size: 12px; padding: 3px 8px; border-radius: 6px; background: var(--surface-3); color: var(--text-2); }
/* Im Video- und Bild-Bereich nur noch die Ideen, die Begrüßung steht auf dem Startbildschirm */
.feed .hello-date, .feed .hello-h, .feed .hello-sub { display: none; }
.feed .hello { margin-bottom: 16px; }
.feed .ideas { margin-top: 0; }

/* ---------- Werkzeuge ---------- */
.v-up .seg { justify-self: start; }

/* ---------- Bühne: Einstellungen links, Ergebnisse rechts ---------- */
.stage { display: grid; grid-template-columns: 392px minmax(0, 1fr); align-items: start; }
.stage.lib { grid-template-columns: minmax(0, 1fr); }
.stage.lib .composer { display: none; }
.composer { position: sticky; top: var(--top-h); height: calc(100dvh - var(--top-h)); overflow-y: auto; overscroll-behavior: contain; border-right: 1px solid var(--line-soft); background: var(--panel); display: flex; flex-direction: column; }
.pane { flex: 1 0 auto; padding: 14px 16px 0; display: flex; flex-direction: column; gap: 18px; animation: fadeIn .3s var(--ease) both; }
.pane[hidden] { display: none; }
/* Umschalter oben: bleibt beim Scrollen der Spalte stehen */
.kinds { position: sticky; top: 0; z-index: 3; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 14px 16px 12px; background: var(--panel); border-bottom: 1px solid var(--line-soft); }
.kind { height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--surface-2); color: var(--muted); font-size: 13.5px; font-weight: 600; transition: background .2s, color .2s, border-color .2s; }
.kind:hover { color: var(--text); border-color: var(--line-2); }
.kind[aria-selected="true"] { color: var(--text); background: var(--surface-3); border-color: var(--text-2); }
.kind[aria-selected="true"] svg { color: var(--accent); }
/* Upscale in der linken Spalte */
.up-src { display: grid; gap: 8px; }
.up-media { position: relative; display: grid; place-items: center; min-height: 180px; border: 1px solid var(--line); border-radius: var(--r); background: #000; overflow: hidden; }
.up-media img, .up-media video { display: block; max-width: 100%; max-height: 300px; }
.up-media .rm { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1; display: grid; place-items: center; z-index: 1; }
.up-media .rm:hover { background: var(--bad); color: #fff; }
.up-info { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 12.5px; color: var(--muted); }
.up-info span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-info .link { flex: none; }
.up-note { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.up-note:empty { display: none; }
.group { display: grid; gap: 8px; min-width: 0; }
.g-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }

/* Modell-Karte */
.model-card { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); }
.model-ic { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; background: var(--text); color: var(--bg); flex: none; }
.model-ic svg { width: 19px; height: 19px; }
.model-t { display: grid; gap: 0; flex: 1; min-width: 0; line-height: 1.3; }
.model-t .lbl { font-size: 11.5px; font-weight: 400; color: var(--muted); }
.model-t b { font-weight: 600; font-size: 15px; }
.model-card .seg { flex: none; }
.model-card .seg button { padding: 0 9px; }
.model-tag { font-size: 12px; color: var(--text-2); background: var(--surface-3); padding: 4px 9px; border-radius: 7px; white-space: nowrap; }

/* Art: Text, Bild, Omni, Verlängern */
.modes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.mode { display: grid; justify-items: center; align-content: center; gap: 5px; height: 60px; padding: 0 4px; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 500; transition: background .2s, color .2s, border-color .2s; }
.mode svg { width: 19px; height: 19px; }
.mode:hover { color: var(--text); border-color: var(--line-2); }
.mode[aria-pressed="true"] { color: var(--text); background: var(--surface-3); border-color: var(--text-2); }

/* Zuschneiden vor dem Verlängern */
.trim-open { align-self: flex-start; }
.trim-open svg { width: 16px; height: 16px; }
.trim[hidden], .trim-open[hidden] { display: none; }
.trim { display: grid; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.trim-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.trim-h .mono { font-size: 12px; color: var(--text-2); }
.trim-h .mono.warn { color: var(--warn); }
.trim-v { position: relative; border-radius: var(--r-ctl); overflow: hidden; background: #000; display: grid; place-items: center; }
.trim-v video { display: block; width: 100%; max-height: 220px; object-fit: contain; }
.trim-play { position: absolute; left: 10px; bottom: 10px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--bg); color: var(--text); display: grid; place-items: center; padding: 0; }
.trim-play svg { width: 13px; height: 13px; fill: currentColor; stroke: none; margin-left: 2px; }
.trim-play.on svg { margin-left: 0; }
.trim-range { position: relative; height: 46px; border-radius: 8px; overflow: hidden; --a: 0; --b: 1; touch-action: none; cursor: pointer; user-select: none; }
.trim-strip { position: absolute; inset: 0; display: flex; background: var(--surface-3); }
.trim-strip img { flex: 1; min-width: 0; height: 100%; object-fit: cover; }
/* Ausgewählter Teil hell mit Lime-Rahmen, der Rest abgedunkelt (6 px = halbe Griffbreite) */
.trim-sel { position: absolute; top: 0; bottom: 0; left: calc(6px + (100% - 12px) * var(--a)); right: calc(6px + (100% - 12px) * (1 - var(--b))); border-top: 2px solid var(--accent); border-bottom: 2px solid var(--accent); box-shadow: 0 0 0 999px rgba(14, 15, 18, .62); pointer-events: none; }
/* Griffe: Lime-Balken mit kleiner Rille, per Maus, Finger oder Pfeiltasten */
.trim-k { position: absolute; top: 0; bottom: 0; width: 12px; margin-left: -6px; left: calc(6px + (100% - 12px) * var(--a)); border-radius: 4px; background: var(--accent); cursor: ew-resize; touch-action: none; }
.trim-k.b { left: calc(6px + (100% - 12px) * var(--b)); }
.trim-k::after { content: ""; position: absolute; left: 50%; top: 50%; width: 2px; height: 14px; margin: -7px 0 0 -1px; border-radius: 1px; background: var(--accent-ink); opacity: .55; }
.trim-k:focus-visible { outline: 2px solid var(--text); outline-offset: 1px; }
.trim-note { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.45; }
.trim-btns { display: flex; gap: 8px; justify-content: flex-end; }
.trim .msg:empty { display: none; }

/* Verlängern: Video wählen */
.pick-big { display: grid; justify-items: center; gap: 6px; width: 100%; padding: 24px 16px; border: 1px dashed var(--line-2); border-radius: var(--r); background: var(--surface); color: var(--text); text-align: center; transition: border-color .2s, background .2s; }
.pick-big svg { width: 26px; height: 26px; color: var(--accent); }
.pick-big b { font-weight: 600; font-size: 15px; }
.pick-big span { font-size: 12.5px; color: var(--muted); }
.pick-big:hover { border-color: var(--accent-edge); background: var(--surface-2); }

/* Omni-Referenz */
.omni { display: grid; gap: 10px; }
.omni-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.omni-h .mono { font-size: 11.5px; }
.omni-tray { display: grid; grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); gap: 8px; }
.ochip { position: relative; }
.ochip-main { position: relative; display: block; width: 100%; aspect-ratio: 1; padding: 0; border: 1px solid var(--line); border-radius: var(--r-ctl); overflow: hidden; background: #000; transition: border-color .2s; }
.ochip-main:hover { border-color: var(--accent-edge); }
.ochip-main img, .ochip-main video { width: 100%; height: 100%; object-fit: cover; display: block; }
.ochip-main .aud { display: grid; place-items: center; width: 100%; height: 100%; color: var(--violet); background: var(--surface-2); }
.ochip-main .aud svg { width: 28px; height: 28px; }
.ochip .tok { position: absolute; left: 4px; bottom: 4px; font-size: 10.5px; font-weight: 600; padding: 2px 6px; border-radius: 5px; background: var(--bg); color: var(--accent); }
.ochip.video .tok { color: var(--blue); }
.ochip.audio .tok { color: var(--violet); }
.ochip .rm { position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: var(--bg); color: var(--text); font-size: 12px; line-height: 1; display: grid; place-items: center; padding: 0; }
.ochip .rm:hover { background: var(--bad); color: #fff; }
.oadd { display: grid; place-items: center; align-content: center; gap: 4px; aspect-ratio: 1; padding: 6px; border: 1px dashed var(--line-2); border-radius: var(--r-ctl); background: none; color: var(--muted); font-size: 10.5px; line-height: 1.25; transition: border-color .2s, color .2s; }
.oadd svg { width: 20px; height: 20px; }
.oadd:hover { border-color: var(--accent-edge); color: var(--text); }
/* Liste beim Tippen von @ */
.mention { display: grid; gap: 2px; margin: 0 8px 4px; padding: 6px; max-height: 300px; overflow-y: auto; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--surface); box-shadow: 0 16px 36px -18px rgba(0, 0, 0, .8); animation: fadeIn .15s var(--ease) both; }
.mention .mh { padding: 6px 8px 4px; font-size: 11.5px; font-weight: 500; color: var(--dim); }
.mention .mi { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 8px; border: 0; border-radius: 8px; background: none; color: var(--text); text-align: left; }
.mention .mi[aria-selected="true"], .mention .mi:hover { background: var(--surface-3); }
.mention .mt { position: relative; width: 40px; height: 40px; flex: none; border-radius: 7px; overflow: hidden; background: #000; display: grid; place-items: center; color: var(--violet); }
.mention .mt img, .mention .mt video { width: 100%; height: 100%; object-fit: cover; }
.mention .mt svg { width: 20px; height: 20px; }
.mention .mx { display: grid; gap: 1px; min-width: 0; flex: 1; }
.mention .mx b { font-size: 13px; font-weight: 600; color: var(--accent); }
.mention .mx b.new { color: var(--text); font-weight: 500; }
.mention .mx span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mention .mk { font-size: 11px; padding: 2px 7px; border-radius: 6px; background: var(--surface-3); color: var(--text-2); flex: none; }
.mention .mempty { padding: 10px 8px; font-size: 13px; color: var(--muted); }
.omni-unused { margin: 0; font-size: 12.5px; color: var(--warn); line-height: 1.45; }
.omni-unused b { font-weight: 600; }
.omni-hint { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.omni-hint b { font-weight: 600; color: var(--text-2); }

/* Start- und Endbild */
.frames { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.arrow { display: none; }
.slot { display: grid; gap: 6px; cursor: pointer; min-width: 0; }
.slot-body { position: relative; height: 140px; border: 1px dashed var(--line-2); border-radius: var(--r); background: var(--surface); display: grid; place-items: center; align-content: center; gap: 6px; color: var(--muted); overflow: hidden; transition: border-color .2s, color .2s; text-align: center; padding: 8px; }
.slot-body svg { width: 20px; height: 20px; }
.slot-body em { font-style: normal; font-size: 12px; line-height: 1.35; }
.slot-body small { font-size: 11px; color: var(--dim); }
.slot:hover .slot-body { border-color: var(--accent-edge); color: var(--text); }
.slot.filled .slot-body { border-style: solid; border-color: var(--line); padding: 0; }
.slot.filled .slot-body img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.slot .rm { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1; display: grid; place-items: center; z-index: 1; }
.slot .rm:hover { background: var(--bad); color: #fff; }
.slot .tag { position: absolute; left: 6px; bottom: 6px; z-index: 1; font-size: 11px; font-weight: 500; background: var(--bg); color: var(--text); padding: 3px 8px; border-radius: 6px; }
.frames.one { grid-template-columns: 1fr; }
.frames.one #slotEnd { display: none; }
.frames.one .slot-body { height: 170px; }

/* Startbild generieren */
.paint { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 38px; margin-top: -8px; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--surface); color: var(--text-2); font-size: 13px; transition: border-color .2s, color .2s; }
.paint svg { width: 16px; height: 16px; color: var(--accent); }
.paint b { color: var(--text); font-weight: 600; }
.paint:hover { border-color: var(--line-2); color: var(--text); }
.paint-dlg { width: min(560px, calc(100vw - 32px)); }
.paint-body { display: grid; gap: 14px; padding: 0 20px 20px; overflow-y: auto; }
.paint-body .p-sub { margin: 0; }
.paint-body .prompt-box textarea { min-height: 104px; padding-bottom: 14px; }

/* Verlängern-Leiste */
.extend-bar { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 12px 12px 12px 14px; border-radius: var(--r); border: 1px solid var(--violet-edge); background: var(--violet-wash); animation: fadeIn .3s var(--ease) both; }
.extend-bar .ext-t { display: grid; gap: 2px; flex: 1; min-width: 0; }
.extend-bar b { font-weight: 600; font-size: 18px; color: var(--violet); }
.extend-bar small { color: var(--text-2); font-size: 12.5px; line-height: 1.4; }
.extend-bar .seg { margin-top: 8px; justify-self: start; display: inline-flex; }

/* Prompt */
.prompt-box { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); transition: border-color .2s; overflow: hidden; }
.prompt-box:focus-within { border-color: var(--accent-edge); }
.prompt-box textarea { display: block; width: 100%; border: 0; background: none; padding: 12px 12px 4px; font-size: 14.5px; line-height: 1.55; resize: none; min-height: 112px; max-height: 46vh; outline: none; color: var(--text); field-sizing: content; }
.prompt-box textarea::placeholder { color: var(--dim); }
/* Markierte @-Referenzen: der Text liegt farbig hinter dem durchsichtigen Textfeld (gleiche Schrift, gleiche Abstände) */
.hl-wrap { position: relative; }
.hl { position: absolute; inset: 0; padding: 12px 12px 4px; font-size: 14.5px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: break-word; color: var(--text); overflow: hidden; scrollbar-gutter: stable; pointer-events: none; }
.hl-wrap textarea { position: relative; z-index: 1; color: transparent; caret-color: var(--text); scrollbar-gutter: stable; }
.hl-wrap textarea::selection { color: transparent; background: rgba(200, 255, 0, .28); }
.hl mark { color: var(--accent); background: rgba(200, 255, 0, .14); border-radius: 4px; box-shadow: 0 0 0 2px rgba(200, 255, 0, .14); }
.hl mark.miss { color: var(--warn); background: none; box-shadow: none; text-decoration: underline wavy rgba(245, 196, 81, .7); text-underline-offset: 3px; }
.prompt-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 10px 10px; min-height: 40px; }
.enh { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border: 1px solid var(--accent-edge); border-radius: 999px; background: var(--accent-wash); color: var(--accent); font-size: 12px; font-weight: 600; white-space: nowrap; }
.enh svg { width: 14px; height: 14px; }
.enh:hover { background: rgba(200, 255, 0, .18); }
.enh.busy svg { animation: spin 1s linear infinite; }
.enh:disabled { opacity: .6; }
.xset { align-self: stretch; width: 100%; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); margin-top: -8px; }
.xset > summary { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; cursor: pointer; list-style: none; font-size: 13px; color: var(--text-2); }
.xset > summary::-webkit-details-marker { display: none; }
.xset > summary::after { content: ""; margin-left: 8px; width: 7px; height: 7px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(45deg); transition: transform .2s; }
.xset[open] > summary::after { transform: rotate(-135deg); }
.more-sum { color: var(--muted); font-size: 12px; }
.xset > summary > span:first-child { margin-right: auto; }
.xset .settings { border: 0; border-top: 1px solid var(--line-soft); border-radius: 0; background: none; }
.count { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; font-size: 11.5px; color: var(--dim); white-space: nowrap; }
.cbar { position: relative; display: block; width: 40px; height: 3px; border-radius: 2px; background: var(--surface-3); overflow: hidden; }
.cbar i { position: absolute; left: 0; top: 0; bottom: 0; width: var(--fill, 0%); background: var(--accent); border-radius: 2px; transition: width .3s var(--ease), background .3s; }
.count.long { color: var(--warn); }
.count.long .cbar i { background: var(--warn); }
.count.max { color: var(--bad); }
.count.max .cbar i { background: var(--bad); }

/* Schalter */
.toggle { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: 13px; color: var(--muted); user-select: none; }
.toggle input { appearance: none; width: 34px; height: 20px; border-radius: 999px; background: var(--surface-3); position: relative; margin: 0; flex: none; transition: background .2s; cursor: pointer; }
.toggle input::after { content: ""; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: transform .2s var(--ease), background .2s; }
.toggle input:checked { background: var(--accent); }
.toggle input:checked::after { transform: translateX(14px); background: var(--accent-ink); }
.toggle input:checked + span { color: var(--text); }

/* Kamera: Auswahl als kleine Kacheln mit bewegter Vorschau */
.cams { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.cam { display: flex; flex-direction: column; padding: 0; border: 1px solid var(--line); border-radius: var(--r-ctl); overflow: hidden; background: var(--surface-2); text-align: left; transition: border-color .2s; }
.cam .mp { display: block; width: 100%; aspect-ratio: 16 / 10; }
.cam-n { font-size: 11.5px; padding: 5px 8px 6px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cam:hover { border-color: var(--line-2); }
.cam[aria-pressed="true"] { border-color: var(--accent); }
.cam[aria-pressed="true"] .cam-n { color: var(--text); }

/* Bewegte Mini-Szene für jede Kamerabewegung */
.mp { position: relative; overflow: hidden; background: #0B0C10; perspective: 220px; isolation: isolate; }
.mp .scene { position: absolute; inset: -30%; transform-origin: 50% 55%; }
.mp .floor { position: absolute; left: -20%; right: -20%; top: 56%; bottom: -40%; transform: rotateX(68deg); transform-origin: top;
  background: repeating-linear-gradient(90deg, rgba(148, 153, 166, .32) 0 1px, transparent 1px 22px), repeating-linear-gradient(0deg, rgba(148, 153, 166, .32) 0 1px, transparent 1px 22px); }
.mp .sky { position: absolute; inset: 0 0 44%; background: #12151D; }
.mp .sky::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: rgba(148, 153, 166, .5); }
.mp .pillar { position: absolute; bottom: 44%; width: 6%; background: #252935; }
.mp .pillar:nth-child(3) { left: 14%; height: 22%; } .mp .pillar:nth-child(4) { left: 74%; height: 30%; } .mp .pillar:nth-child(5) { left: 86%; height: 16%; }
.mp .subj { position: absolute; left: 50%; bottom: 40%; width: 8%; height: 20%; transform: translateX(-50%); }
.mp .subj::before { content: ""; position: absolute; left: 22%; right: 22%; top: 0; aspect-ratio: 1; border-radius: 50%; background: var(--text-2); }
.mp .subj::after { content: ""; position: absolute; left: 0; right: 0; top: 38%; bottom: 0; border-radius: 40% 40% 8% 8%; background: var(--blue); opacity: .75; }
.mp.clip video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.mp .none { position: absolute; inset: 0; display: grid; place-items: center; font-size: 11.5px; color: var(--muted); z-index: 2; background: #0B0C10; }
.mp .scene { animation: 3.2s var(--ease) infinite alternate both; }
.mp[data-m="dolly-in"] .scene { animation-name: m-in; }
.mp[data-m="dolly-out"] .scene { animation-name: m-out; }
.mp[data-m="orbit"] .scene { animation: m-orbit 4.5s linear infinite; }
.mp[data-m="crane-up"] .scene { animation-name: m-crane; }
.mp[data-m="fpv"] .scene { animation: m-fpv 2.4s cubic-bezier(.6, 0, .3, 1) infinite; }
.mp[data-m="handheld"] .scene { animation: m-shake 1.6s ease-in-out infinite; }
.mp[data-m="crash-zoom"] .scene { animation: m-crash 2.2s cubic-bezier(.9, 0, .1, 1) infinite; }
.mp[data-m="whip-pan"] .scene { animation: m-whip 2.2s cubic-bezier(.85, 0, .15, 1) infinite; }
.mp[data-m="tracking"] .floor { animation: m-track 1.4s linear infinite; }
.mp[data-m="tracking"] .pillar { animation: m-track-p 1.4s linear infinite; }
.mp[data-m="bullet"] .scene { animation: m-bullet 5s ease-in-out infinite alternate; }
.mp[data-m="bullet"] .subj { animation: m-freeze 5s ease-in-out infinite alternate; }
.mp[data-m="slowmo"] .scene { animation: m-in 7s ease-in-out infinite alternate; }
.mp[data-m="slowmo"] .subj { animation: m-bob 3.5s ease-in-out infinite alternate; }
.mp[data-m="static"] .scene { animation: none; }
@keyframes m-in { from { transform: scale(1); } to { transform: scale(1.65); } }
@keyframes m-out { from { transform: scale(1.65); } to { transform: scale(1); } }
@keyframes m-orbit { 0% { transform: rotateY(-35deg) translateX(10%); } 50% { transform: rotateY(35deg) translateX(-10%); } 100% { transform: rotateY(-35deg) translateX(10%); } }
@keyframes m-crane { from { transform: translateY(14%) rotateX(0); } to { transform: translateY(-10%) rotateX(22deg) scale(.9); } }
@keyframes m-fpv { 0% { transform: scale(1) rotate(-6deg) translateY(4%); } 60% { transform: scale(2.1) rotate(8deg) translateY(-6%); } 100% { transform: scale(1) rotate(-6deg) translateY(4%); } }
@keyframes m-shake { 0%, 100% { transform: translate(0, 0) rotate(0); } 20% { transform: translate(1.5%, -1%) rotate(.6deg); } 45% { transform: translate(-1%, 1.2%) rotate(-.5deg); } 70% { transform: translate(1%, .6%) rotate(.4deg); } }
@keyframes m-crash { 0%, 35% { transform: scale(1); } 45%, 85% { transform: scale(2.4); } 100% { transform: scale(1); } }
@keyframes m-whip { 0%, 30% { transform: translateX(0); filter: blur(0); } 40% { filter: blur(3px); } 50%, 80% { transform: translateX(-35%); filter: blur(0); } 90% { filter: blur(3px); } 100% { transform: translateX(0); } }
@keyframes m-track { from { transform: translateX(0) rotateX(68deg); } to { transform: translateX(-22px) rotateX(68deg); } }
@keyframes m-track-p { from { transform: translateX(0); } to { transform: translateX(-200%); } }
@keyframes m-bullet { from { transform: rotateY(-50deg); } to { transform: rotateY(50deg); } }
@keyframes m-freeze { from { transform: translateX(-50%) rotateY(50deg); } to { transform: translateX(-50%) rotateY(-50deg); } }
@keyframes m-bob { from { transform: translateX(-50%) translateY(0); } to { transform: translateX(-50%) translateY(-12%); } }

/* Einstellungen als ruhige Zeilen */
.settings { display: grid; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); padding: 0 12px; }
.set { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 50px; padding: 7px 0; border-bottom: 1px solid var(--line-soft); flex-wrap: wrap; }
.set:last-child { border-bottom: 0; }
.set > .lbl { flex: none; color: var(--text-2); font-size: 13px; font-weight: 400; }
.dur { display: flex; align-items: center; gap: 12px; flex: 1; justify-content: flex-end; min-width: 150px; }
.dur input { max-width: 170px; }
.dur b { font-size: 13px; font-weight: 600; color: var(--text); min-width: 34px; text-align: right; }
.seg { display: inline-flex; gap: 2px; padding: 3px; background: var(--surface-2); border-radius: 9px; border: 1px solid var(--line); }
.seg.wrap { flex-wrap: wrap; justify-content: flex-end; }
.seg button { height: 28px; padding: 0 10px; border: 0; border-radius: 6px; background: none; color: var(--muted); font-size: 12.5px; font-weight: 500; transition: background .2s, color .2s; display: inline-flex; align-items: center; gap: 6px; }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--surface-3); color: var(--text); }
.seg .shape { display: inline-block; border: 1.5px solid currentColor; border-radius: 2px; opacity: .85; }
.set .seg.wrap { max-width: 250px; }

/* Erstellen unten fest */
.gen { position: sticky; bottom: 0; margin: auto -16px 0; padding: 12px 16px max(16px, env(safe-area-inset-bottom, 0px)); display: grid; gap: 8px; background: var(--panel); border-top: 1px solid var(--line-soft); z-index: 2; }

/* Bildstile */
.styles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.style { position: relative; height: 54px; border-radius: var(--r-ctl); border: 1px solid var(--line); overflow: hidden; padding: 0; text-align: left; transition: border-color .2s; }
.style span { position: absolute; left: 8px; bottom: 6px; font-weight: 600; font-size: 12.5px; color: #fff; text-shadow: 0 1px 6px rgba(0, 0, 0, .8); }
.style:hover { border-color: var(--line-2); }
.style[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.style[data-s="cinema"] { background: linear-gradient(160deg, #1B2A3A, #3B2414 70%, #0E0F12); }
.style[data-s="product"] { background: linear-gradient(160deg, #D9DBE0, #6E7280 55%, #20232B); }
.style[data-s="neon"] { background: linear-gradient(160deg, #0E0F12, #2A1F55 55%, #C8FF00 150%); }
.style[data-s="editorial"] { background: linear-gradient(160deg, #E9E2D8, #9C7E64 60%, #2B2018); }
.style[data-s="anime"] { background: linear-gradient(160deg, #7EC8FF, #FFB3D9 60%, #FFE9A8); }
.style[data-s="3d"] { background: linear-gradient(160deg, #C9B8FF, #6A4FC8 55%, #1A1530); }

/* Referenzbilder in der Prompt-Leiste */
.refs { display: flex; flex-wrap: wrap; gap: 6px; }
.ref, .ref-add { position: relative; width: 40px; height: 40px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: var(--surface); }
.ref img { width: 100%; height: 100%; object-fit: cover; }
.ref .rm { position: absolute; top: 2px; right: 2px; width: 16px; height: 16px; border-radius: 50%; border: 0; background: var(--bg); color: var(--text); font-size: 11px; line-height: 1; display: grid; place-items: center; padding: 0; }
.ref-add { border-style: dashed; display: grid; place-items: center; color: var(--muted); transition: border-color .2s, color .2s; }
.ref-add:hover { border-color: var(--accent-edge); color: var(--text); }

input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 24px; background: none; margin: 0; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--accent) var(--p, 10%), var(--surface-3) var(--p, 10%)); }
input[type="range"]::-moz-range-track { height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--accent) var(--p, 10%), var(--surface-3) var(--p, 10%)); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; margin-top: -6px; border-radius: 50%; background: var(--text); border: 0; }
input[type="range"]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--text); border: 0; }

/* ---------- Ergebnisse ---------- */
.feed { padding: 18px max(20px, env(safe-area-inset-right, 0px)) 60px 20px; min-width: 0; }
.stage.lib .feed { max-width: 1680px; margin: 0 auto; width: 100%; }
.hello { display: grid; gap: 6px; margin-bottom: 20px; }
.hello-date { margin: 0; }
.hello-h { font-size: 26px; }
.hello-sub { margin: 0; font-size: 15px; color: var(--muted); }
.ideas { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; }
.ideas .mono { margin-right: 4px; }
.idea { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px 0 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text-2); font-size: 13px; transition: border-color .2s, color .2s; }
.idea svg { width: 14px; height: 14px; color: var(--muted); }
.idea:hover { border-color: var(--line-2); color: var(--text); }
.stage.lib .hello { display: none; }
.setup { margin: 0 0 18px; padding: 10px 14px; border: 1px solid var(--line); background: var(--surface); color: var(--text-2); border-radius: var(--r-ctl); font-size: 13px; }
.setup b { color: var(--text); }
.setup code { font-size: 12px; color: var(--accent); }
.feed-h { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.feed-h h2 { font-size: 17px; }
.filters { display: inline-flex; gap: 2px; padding: 3px; background: var(--surface); border-radius: 9px; border: 1px solid var(--line); }
.filters button { height: 28px; padding: 0 12px; border: 0; border-radius: 6px; background: none; color: var(--muted); font-size: 12.5px; font-weight: 500; transition: background .2s, color .2s; }
.filters button:hover { color: var(--text); }
.filters button[aria-pressed="true"] { background: var(--surface-3); color: var(--text); }
#uploadBtn { margin-left: auto; }
/* Galerie mit gleich hohen Reihen: Breite je Kachel nach Seitenverhältnis, die letzte Reihe wird nicht gestreckt */
.grid { display: flex; flex-wrap: wrap; gap: 10px; }
.grid::after { content: ""; flex: 999 1 0; }
.grid > .card { flex: var(--ar, 1) 1 calc(var(--ar, 1) * 230px); min-width: 0; }
.card { position: relative; border-radius: var(--r); overflow: hidden; background: var(--surface); cursor: pointer; aspect-ratio: var(--ar, 1); max-width: 100%; animation: fadeIn .35s var(--ease) both; }
.card:focus-visible { outline-offset: 2px; }
.card img, .card video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; background: #000; transition: transform .6s var(--ease); }
.card:not(.running):hover img, .card:not(.running):hover video, .ex:hover video, .ex:hover img, .tool:hover .t-media video, .tool:hover .t-media img { transform: scale(1.04); }
.ex video, .ex img, .t-media video, .t-media img { transition: transform .6s var(--ease); }
.card { transition: box-shadow .3s; }
.card:not(.running):hover, .ex:hover { box-shadow: 0 0 0 1px var(--accent-edge), 0 18px 40px -24px rgba(200, 255, 0, .35); }
.card .badges { position: absolute; left: 8px; right: 60px; bottom: 8px; display: flex; gap: 4px; flex-wrap: wrap; z-index: 2; transition: opacity .2s; }
.badge { font-size: 11px; font-weight: 500; padding: 3px 7px; border-radius: 6px; background: var(--bg); color: var(--text-2); }
.badge.lime { background: var(--accent); color: var(--accent-ink); }
.badge.violet { background: var(--violet); color: var(--accent-ink); }
.badge.blue { background: var(--blue); color: var(--accent-ink); }
.card .cap { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; padding: 10px 12px; background: rgba(14, 15, 18, .92); font-size: 12.5px; line-height: 1.4; color: var(--text-2);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; opacity: 0; transition: opacity .2s; }
.card:hover .cap, .card:focus-visible .cap { opacity: 1; }
.card .quick { position: absolute; right: 8px; top: 8px; z-index: 3; display: flex; gap: 4px; opacity: 0; transition: opacity .2s; }
.card:hover .quick, .card:focus-within .quick { opacity: 1; }
.card .quick button { height: 30px; padding: 0 10px; border: 0; border-radius: 7px; background: var(--bg); color: var(--text); font-size: 12px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }
.card .quick button:hover { background: var(--surface-3); }
.card .quick .qdl { width: 30px; height: 30px; border-radius: 7px; background: var(--bg); color: var(--text); display: inline-grid; place-items: center; }
.card .quick .qdl:hover { background: var(--surface-3); color: var(--accent); }
.card .quick .qdl svg { width: 15px; height: 15px; }
.v-dl { text-decoration: none; margin-right: 8px; }
.v-dl svg { width: 16px; height: 16px; }
.v-dl[hidden] { display: none; }
.card .quick button svg { width: 14px; height: 14px; }
/* Audio-Karte: Wellenform statt Bild */
.card.audio { background: var(--surface-2); }
.card .wave { position: absolute; left: 16px; right: 16px; top: 26%; bottom: 36%; display: flex; align-items: center; gap: 3px; }
.card .wave i { flex: 1; height: var(--h); border-radius: 2px; background: var(--violet); opacity: .8; }
.card .aname { position: absolute; left: 16px; right: 16px; bottom: 36px; font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .play { position: absolute; right: 8px; bottom: 8px; z-index: 2; width: 30px; height: 30px; border-radius: 50%; background: var(--bg); display: grid; place-items: center; color: var(--text); transition: opacity .2s; }
.card:hover .play { opacity: 0; }
.card .play svg { width: 12px; height: 12px; fill: currentColor; stroke: none; margin-left: 2px; }
/* Läuft noch: Fortschritt und kurzer Text, das Startbild schwach dahinter */
.card.running { cursor: default; background: var(--surface); border: 1px solid var(--line); }
.card.running .thumb { opacity: .35; filter: blur(10px) saturate(.6); transform: scale(1.08); animation: breathe 3s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { opacity: .25; } 50% { opacity: .45; } }
.card .state { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; align-content: center; gap: 8px; text-align: center; padding: 16px; }
.orb { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--surface-3); border-top-color: var(--accent); animation: spin 1s linear infinite; }
.card .state b { font-size: 14px; font-weight: 600; color: var(--text); }
.card .state small { font-size: 12px; color: var(--muted); }
.card .line { position: absolute; left: 14px; right: 14px; bottom: 14px; height: 3px; border-radius: 2px; background: var(--surface-3); overflow: hidden; z-index: 2; }
.card .line i { position: absolute; left: 0; top: 0; bottom: 0; width: var(--pct, 0%); border-radius: 2px; background: var(--accent); transition: width 1s linear; }
.card.running .badges { top: 8px; bottom: auto; }
.card.failed { background: var(--surface); border: 1px solid rgba(255, 122, 107, .35); }
.card.failed .state b { color: var(--bad); }
.card .refund { font-size: 11.5px; font-weight: 600; padding: 3px 8px; border-radius: 6px; background: var(--accent-wash); color: var(--accent); }
.card.failed .state small { color: #D9A39E; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.empty { display: grid; justify-items: center; gap: 6px; color: var(--muted); text-align: center; padding: 56px 22px; border: 1px dashed var(--line-2); border-radius: var(--r-lg); }
.empty b { display: block; font-weight: 600; font-size: 17px; color: var(--text); }
.more { display: flex; margin: 22px auto 0; }

/* ---------- Ansicht ---------- */
dialog { color: var(--text); }
dialog::backdrop { background: rgba(6, 7, 9, .82); }
.viewer { width: min(1440px, calc(100vw - 32px)); height: min(880px, calc(100dvh - 32px)); max-width: none; max-height: none; padding: 0; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); overflow: hidden; }
.viewer[open] { display: grid; grid-template-columns: minmax(0, 1fr) 380px; animation: fadeIn .25s var(--ease); }
.v-media { position: relative; background: #000; display: grid; place-items: center; min-height: 0; min-width: 0; overflow: hidden; }
.v-stage { position: absolute; inset: 0; display: grid; place-items: center; }
.v-nav { position: absolute; top: 50%; z-index: 4; width: 42px; height: 42px; margin-top: -21px; padding: 0; border-radius: 50%; border: 1px solid var(--line-2); background: rgba(14, 15, 18, .72); color: var(--text); display: grid; place-items: center; transition: background .2s, border-color .2s, opacity .2s; }
.v-nav svg { width: 20px; height: 20px; }
.v-nav.prev { left: 14px; }
.v-nav.next { right: 14px; }
.v-nav:hover { background: var(--surface-3); border-color: var(--text-2); }
.v-nav[hidden] { display: none; }
.v-pos { margin-left: auto; margin-right: 12px; font-size: 12px; color: var(--muted); }
.v-media img { max-width: 100%; max-height: 100%; display: block; }
.v-media video { width: 100%; height: 100%; object-fit: contain; }
.v-media .hint { position: absolute; left: 16px; top: 16px; }
.v-audio { display: grid; justify-items: center; gap: 16px; padding: 24px; width: min(520px, 100%); }
.v-aud-ic { width: 88px; height: 88px; border-radius: 50%; display: grid; place-items: center; color: var(--violet); background: var(--surface-2); }
.v-aud-ic svg { width: 42px; height: 42px; }
.v-audio b { font-size: 16px; color: var(--text); text-align: center; word-break: break-word; }
.v-audio audio { width: 100%; }
.v-side { display: flex; flex-direction: column; gap: 16px; padding: 18px; overflow-y: auto; border-left: 1px solid var(--line-soft); min-height: 0; }
.v-side > * { flex-shrink: 0; }
.v-head { display: flex; align-items: center; justify-content: space-between; }
.v-head .mono { font-size: 13px; color: var(--text-2); font-weight: 500; }
/* Zwei Knöpfe pro Reihe; bleibt einer allein, nimmt er die ganze Breite */
.v-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.v-actions > * { flex: 1 1 calc(50% - 4px); min-width: 0; }
.v-actions > .wide { flex-basis: 100%; }
.v-actions .btn.lime.wide { height: 46px; border-radius: var(--r); font-size: 14.5px; }
.v-up { display: grid; gap: 8px; padding: 10px 12px 12px; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--surface); }
.v-up-b { display: flex; gap: 6px; flex-wrap: wrap; }
.v-up-b .btn { flex: 1 1 120px; }
.v-up-c { color: var(--muted); font-weight: 400; font-size: 12px; }
.v-up-note { font-size: 12.5px; color: var(--muted); }
.v-prompt { margin: 0; font-size: 14px; line-height: 1.6; color: var(--text-2); white-space: pre-wrap; padding: 12px 14px; background: var(--surface); border-radius: var(--r-ctl); border: 1px solid var(--line); max-height: 240px; overflow-y: auto; }
.v-prompt:empty { display: none; }
.v-meta { display: grid; grid-template-columns: auto 1fr; gap: 7px 16px; margin: 0; font-size: 13px; }
.v-meta dt { color: var(--muted); }
.v-meta dd { margin: 0; color: var(--text); }
.seq { display: grid; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.seq-h { display: flex; justify-content: space-between; align-items: baseline; }
.seq-h .mono { color: var(--text); font-weight: 600; font-size: 13px; }
.seq-h b { font-size: 12px; color: var(--muted); font-weight: 400; }
.seq-strip { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.seq-clip { position: relative; flex: none; width: 80px; height: 50px; border-radius: 7px; overflow: hidden; border: 2px solid var(--line); background: #000; cursor: pointer; padding: 0; transition: border-color .2s; }
.seq-clip video { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.seq-clip span { position: absolute; left: 3px; bottom: 3px; font-size: 10px; font-weight: 600; background: var(--bg); color: var(--text); padding: 1px 5px; border-radius: 4px; }
.seq-clip[aria-current="true"] { border-color: var(--blue); }
.seq-clip.pending { opacity: .45; }
.seq-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.progress { height: 4px; border-radius: 2px; background: var(--surface-3); overflow: hidden; margin-top: 6px; }
.progress span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .3s; }

/* ---------- Auswahl, Kamera-Galerie, Startbild ---------- */
.picker { width: min(940px, calc(100vw - 32px)); max-height: min(800px, calc(100dvh - 32px)); padding: 0; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); }
.picker[open] { display: flex; flex-direction: column; animation: fadeIn .25s var(--ease); }
.p-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 8px; }
.p-head h3 { font-size: 18px; }
.p-sub { margin: 0 20px 6px; }
.p-tools { display: flex; align-items: center; gap: 12px; padding: 0 20px; flex-wrap: wrap; }
.p-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); grid-auto-rows: max-content; gap: 8px; padding: 14px 20px 20px; overflow-y: auto; }
.p-grid button { position: relative; aspect-ratio: 1; border: 1px solid var(--line); border-radius: var(--r-ctl); overflow: hidden; padding: 0; background: #000; transition: border-color .2s; }
.p-grid button:hover { border-color: var(--accent-edge); }
.p-grid img, .p-grid video { width: 100%; height: 100%; object-fit: cover; display: block; }
.p-grid .p-aud { display: grid; place-items: center; align-content: center; gap: 6px; width: 100%; height: 100%; padding: 10px; color: var(--violet); background: var(--surface-2); }
.p-grid .p-aud svg { width: 28px; height: 28px; }
.p-grid .p-aud em { font-style: normal; font-size: 11.5px; color: var(--text-2); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-grid .p-kind { position: absolute; left: 6px; top: 6px; font-size: 10.5px; font-weight: 500; padding: 2px 6px; border-radius: 5px; background: var(--bg); color: var(--text-2); }
.p-grid p { grid-column: 1 / -1; color: var(--muted); margin: 20px 0; text-align: center; }
.m-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); grid-auto-rows: max-content; gap: 10px; padding: 12px 20px 20px; overflow-y: auto; }
.m-tile { display: grid; padding: 0; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--surface); text-align: left; transition: border-color .2s; }
.m-tile .mp { display: block; width: 100%; aspect-ratio: 16 / 10; }
.m-tile .m-name { display: flex; align-items: center; justify-content: space-between; padding: 9px 12px; font-weight: 500; font-size: 13.5px; }
.m-tile:hover { border-color: var(--line-2); }
.m-tile[aria-pressed="true"] { border-color: var(--accent); }
.m-tile[aria-pressed="true"] .m-name::after { content: "Gewählt"; font-size: 11.5px; color: var(--accent); }

.toast { position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom, 0px)); z-index: 100; transform: translate(-50%, 12px); opacity: 0; pointer-events: none; display: flex; align-items: center; gap: 10px;
  background: var(--surface-3); border: 1px solid var(--line-2); color: var(--text); padding: 10px 18px 10px 14px; border-radius: var(--r-ctl); font-size: 13.5px;
  box-shadow: 0 14px 34px -12px rgba(0, 0, 0, .7); transition: opacity .25s, transform .3s var(--ease); max-width: calc(100vw - 32px); }
.toast::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { border-color: rgba(255, 122, 107, .6); }
.toast.bad::before { background: var(--bad); }

/* ---------- Bibliothek: Suche, Favoriten, Projekte, Auswahl ---------- */
.feed-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; flex-basis: 100%; order: 5; }
.search { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); flex: 0 1 280px; min-width: 160px; transition: border-color .2s; }
.search:focus-within { border-color: var(--accent-edge); }
.search svg { width: 16px; height: 16px; flex: none; }
.search input { flex: 1; min-width: 0; border: 0; background: none; color: var(--text); font-size: 13px; outline: none; }
.search input::-webkit-search-cancel-button { filter: invert(.6); }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text-2); font-size: 12.5px; font-weight: 500; transition: border-color .2s, color .2s, background .2s; }
.chip svg { width: 15px; height: 15px; }
.chip:hover { color: var(--text); border-color: var(--line-2); }
.chip[aria-pressed="true"], .chip.on { color: var(--text); border-color: var(--accent-edge); background: var(--accent-wash); }
.chip[aria-pressed="true"] svg, .chip.on svg { color: var(--accent); }
#favFilter[aria-pressed="true"] svg path { fill: var(--accent); }
.card .favmark { position: absolute; left: 8px; top: 8px; z-index: 3; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: rgba(14, 15, 18, .7); color: var(--accent); pointer-events: none; }
.card .favmark svg { width: 14px; height: 14px; }
.card .favmark svg path, .card .quick .qfav.on svg path, .btn.fav-on svg path { fill: var(--accent); stroke: var(--accent); }
.card .quick .qfav { width: 30px; padding: 0; justify-content: center; }
.card .quick .qfav.on { color: var(--accent); }
.card .ptag { position: absolute; left: 8px; top: 40px; z-index: 3; max-width: 70%; padding: 2px 8px; border-radius: 6px; font-size: 11px; background: rgba(14, 15, 18, .7); color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.card:not(.fav) .ptag { top: 8px; }
.selecting .card { cursor: pointer; }
.selecting .card .quick, .selecting .card .cap { display: none; }
.card .selmark { position: absolute; right: 8px; top: 8px; z-index: 4; width: 24px; height: 24px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .8); background: rgba(14, 15, 18, .45); display: none; }
.selecting .card .selmark { display: block; }
.card.sel { box-shadow: 0 0 0 2px var(--accent); }
.card.sel .selmark { border-color: var(--accent); background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 12 4 4 8-8' fill='none' stroke='%230B0D12' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 16px no-repeat; }
.selbar { position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 60; display: flex; align-items: center; gap: 6px; padding: 8px 8px 8px 16px; border: 1px solid var(--line-2); border-radius: 14px; background: rgba(21, 23, 28, .94); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: 0 20px 50px -20px rgba(0, 0, 0, .9); max-width: calc(100vw - 24px); flex-wrap: wrap; }
.selbar[hidden] { display: none; }
.selbar b { font-size: 13px; font-weight: 600; margin-right: 6px; white-space: nowrap; }
.selbar .btn svg { width: 15px; height: 15px; }
.proj-dlg { width: min(460px, calc(100vw - 32px)); }
.proj-new { display: flex; gap: 8px; padding: 0 20px 12px; }
.proj-new input { flex: 1; min-width: 0; height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--surface-2); color: var(--text); font-size: 14px; outline: none; }
.proj-new input:focus { border-color: var(--accent-edge); }
.proj-list { display: grid; gap: 4px; padding: 0 12px 16px; max-height: 50dvh; overflow-y: auto; }
.proj-list button { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 10px 12px; border: 0; border-radius: 10px; background: none; color: var(--text); font-size: 14px; text-align: left; }
.proj-list button:hover, .proj-list button[aria-current="true"] { background: var(--surface-3); }
.proj-list button small { color: var(--muted); font-size: 12px; }
.v-lib { display: flex; gap: 8px; flex-wrap: wrap; }
.v-lib .btn { flex: 1 1 calc(50% - 4px); }
/* Im Bereich Erstellen über den Ergebnissen zentriert, nicht über dem Erstellen-Knopf */
@media (min-width: 821px) { body.in-create .selbar { left: calc(var(--rail-w) + 392px + (100vw - var(--rail-w) - 392px) / 2); } }
@media (min-width: 821px) and (max-width: 1100px) { body.in-create .selbar { left: calc(var(--rail-w) + 350px + (100vw - var(--rail-w) - 350px) / 2); } }
@media (max-width: 820px) { .selbar { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); } .search { flex: 1 1 100%; } .card .favmark { display: none; } .card.fav .ptag, .card .ptag { top: auto; bottom: 30px; }
  /* Kleine Karten: nur Stern und Download, Verlängern/Animieren gibt es groß in der Ansicht */
  .card .quick button:not(.qfav) { display: none; } }

/* ---------- Kostenübersicht ---------- */
.credits[role="button"] { cursor: pointer; transition: border-color .2s; }
.credits[role="button"]:hover { border-color: var(--line-2); }
.cost-dlg { width: min(640px, calc(100vw - 32px)); }
.cost-body { display: grid; gap: 20px; padding: 0 20px 20px; }
.cost-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cost-top b { font-size: 34px; font-weight: 600; letter-spacing: -.02em; }
.cost-top span { color: var(--muted); font-size: 13px; }
.cost-sec { display: grid; gap: 8px; }
.cost-sec h4 { margin: 0; font-size: 12.5px; font-weight: 500; color: var(--muted); }
.cost-days { display: flex; align-items: flex-end; gap: 3px; height: 96px; padding: 8px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.cost-days i { flex: 1; min-width: 3px; border-radius: 3px 3px 0 0; background: var(--surface-3); position: relative; }
.cost-days i.on { background: var(--accent); }
.cost-days i.today { outline: 1px solid var(--text-2); outline-offset: 1px; }
.cost-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--dim); padding: 0 8px; }
.cost-row { display: grid; grid-template-columns: minmax(120px, 1fr) 2fr auto; align-items: center; gap: 10px; font-size: 13px; }
.cost-row .bar { height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.cost-row .bar span { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.cost-row b { font-weight: 600; font-variant-numeric: tabular-nums; }
.cost-row small { color: var(--muted); }
.cost-note { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.5; }
.cost-prices { display: grid; gap: 4px; font-size: 12.5px; }
.cost-prices div { display: flex; justify-content: space-between; gap: 10px; color: var(--text-2); }
.cost-prices code { color: var(--muted); font-size: 11.5px; }

/* ---------- Sprechen lassen ---------- */
.speak-open { justify-self: start; height: auto; min-height: 34px; padding: 6px 12px; flex-wrap: wrap; }
.speak-open svg { color: var(--accent); }
.speak-open .mono { font-size: 11.5px; }
.speak-dlg { width: min(560px, calc(100vw - 32px)); }
.speak-dlg .p-sub b { color: var(--accent); font-weight: 600; }
.speak-form { display: grid; gap: 12px; padding: 4px 20px 20px; }
.speak-form textarea { width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); color: var(--text); font-size: 15px; line-height: 1.5; resize: vertical; outline: none; }
.speak-form textarea:focus { border-color: var(--accent-edge); }
.speak-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.speak-row select { flex: 1 1 200px; height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--surface-2); color: var(--text); font-size: 14px; }
.speak-form .msg:empty { display: none; }

/* ---------- Stelle bearbeiten (Maske) ---------- */
.mask-dlg { width: min(980px, calc(100vw - 32px)); }
.mask-stage { position: relative; margin: 0 20px; border-radius: var(--r); overflow: hidden; background: #000; display: grid; place-items: center; touch-action: none; }
.mask-stage img { display: block; max-width: 100%; max-height: 58dvh; user-select: none; -webkit-user-drag: none; }
.mask-stage canvas { position: absolute; cursor: crosshair; touch-action: none; }
.mask-tools { display: flex; align-items: center; gap: 10px; padding: 12px 20px 0; flex-wrap: wrap; }
.mask-size { display: flex; align-items: center; gap: 10px; flex: 1 1 220px; }
.mask-size input { max-width: 220px; }
.mask-form { display: flex; gap: 10px; padding: 12px 20px 0; }
.mask-form input { flex: 1; min-width: 0; height: 50px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); color: var(--text); font-size: 15px; outline: none; }
.mask-form input:focus { border-color: var(--accent-edge); }
.mask-form .go { width: auto; padding: 0 22px; flex: none; }
.mask-dlg > .msg { padding: 0 20px 16px; margin: 8px 0 0; }
@media (max-width: 640px) { .mask-form { flex-direction: column; } .mask-form .go { width: 100%; } }

/* ---------- Figuren ---------- */
.figbtn { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text-2); font-size: 12px; font-weight: 500; }
.figbtn svg { width: 14px; height: 14px; }
.figbtn:hover { color: var(--text); border-color: var(--line-2); }
.fig-dlg { width: min(620px, calc(100vw - 32px)); }
.fig-dlg .p-sub b { color: var(--accent); font-weight: 600; }
.fig-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; padding: 4px 20px 16px; }
.fig-card { display: grid; gap: 6px; padding: 8px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); box-shadow: var(--hi); }
.fig-card .fig-ph { position: relative; aspect-ratio: 1; border-radius: 9px; overflow: hidden; background: #000; }
.fig-card .fig-ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fig-card .fig-ph small { position: absolute; right: 6px; bottom: 6px; padding: 1px 6px; border-radius: 5px; background: rgba(14, 15, 18, .72); font-size: 11px; color: var(--text-2); }
.fig-card b { font-size: 14px; color: var(--accent); }
.fig-card .fig-act { display: flex; gap: 4px; }
.fig-card .fig-act .btn { flex: 1; height: 30px; padding: 0 8px; font-size: 12px; }
.fig-new { display: grid; place-items: center; align-content: center; gap: 6px; min-height: 150px; border: 1px dashed var(--line-2); border-radius: var(--r); background: none; color: var(--muted); font-size: 13px; }
.fig-new svg { width: 24px; height: 24px; color: var(--accent); }
.fig-new:hover { border-color: var(--accent-edge); color: var(--text); }
.fig-form { display: grid; gap: 12px; padding: 4px 20px 18px; }
.fig-form[hidden], .fig-list[hidden] { display: none; }
.fig-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fig-row input { flex: 1 1 200px; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--surface-2); color: var(--text); font-size: 15px; outline: none; }
.fig-row input:focus { border-color: var(--accent-edge); }
.fig-imgs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.fig-img { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: #000; border: 1px solid var(--line); }
.fig-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fig-img .rm { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: var(--bg); color: var(--text); display: grid; place-items: center; padding: 0; font-size: 13px; }
.fig-add { aspect-ratio: 1; border: 1px dashed var(--line-2); border-radius: 10px; background: none; color: var(--muted); display: grid; place-items: center; align-content: center; gap: 4px; font-size: 11.5px; }
.fig-add:hover { border-color: var(--accent-edge); color: var(--text); }
.fig-btns { display: flex; gap: 8px; justify-content: flex-end; }
.fig-btns .danger { margin-right: auto; }
.hl mark.fig { background: rgba(200, 255, 0, .16); color: var(--accent); border-radius: 4px; }

/* ---------- Dateien hineinziehen ---------- */
.drop { position: fixed; inset: 0; z-index: 90; display: none; pointer-events: none; box-shadow: inset 0 0 0 2px var(--accent-edge); background: rgba(14, 15, 18, .25); }
.drop.on { display: block; }
.drop-card { position: absolute; left: 50%; bottom: max(28px, env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); display: flex; align-items: center; gap: 12px; padding: 14px 20px; border: 1px solid var(--accent-edge); border-radius: 14px; background: var(--surface); box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .8); white-space: nowrap; }
.drop-card svg { width: 22px; height: 22px; color: var(--accent); }
.drop-card b { font-size: 14.5px; font-weight: 600; }
.drop-card span { font-size: 13px; color: var(--muted); }
.drop-on { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: var(--r); }

/* ---------- Tablet und Handy ---------- */
@media (max-width: 1100px) {
  .stage { grid-template-columns: 350px minmax(0, 1fr); }
  .viewer[open] { grid-template-columns: minmax(0, 1fr) 330px; }
  .tools { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  :root { --top-h: 56px; }
  .app { display: block; }
  /* Die Leiste wird unten zur Tab-Leiste */
  .rail { position: fixed; top: auto; left: 0; right: 0; bottom: 0; height: auto; flex-direction: row; padding: 4px max(8px, env(safe-area-inset-right, 0px)) max(4px, env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px)); border-right: 0; border-top: 1px solid var(--line-soft); }
  .rail .brand { display: none; }
  .tabs { flex-direction: row; flex: 1; justify-content: space-around; }
  .tab { flex: 1; width: auto; padding: 8px 0 6px; }
  .top { padding: 0 max(14px, env(safe-area-inset-right, 0px)) 0 max(14px, env(safe-area-inset-left, 0px)); gap: 10px; }
  .top-brand { display: inline-flex; }
  .top-t { font-size: 16px; }
  .credits { height: 34px; padding: 0 12px; font-size: 12.5px; }
  .stage { grid-template-columns: minmax(0, 1fr); }
  .composer { position: static; height: auto; overflow: visible; border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .pane { padding: 14px 14px 0; }
  .kinds { position: static; padding: 12px 14px 10px; }
  .v-nav { width: 38px; height: 38px; margin-top: -19px; }
  .v-nav.prev { left: 10px; }
  .v-nav.next { right: 10px; }
  .drop-card { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); white-space: normal; }
  .gen { position: static; margin: 0 -14px; padding: 12px 14px 16px; }
  .feed { padding: 18px max(14px, env(safe-area-inset-right, 0px)) 100px max(14px, env(safe-area-inset-left, 0px)); }
  .home { padding: 20px max(14px, env(safe-area-inset-right, 0px)) 100px max(14px, env(safe-area-inset-left, 0px)); gap: 34px; }
  .h-hero { padding-top: 6px; }
  .h-title { font-size: 26px; }
  .grid { gap: 8px; }
  .grid > .card { flex-basis: calc(var(--ar, 1) * 80px); }
  /* Kleine Karten am Handy: Play-Symbol weg (Antippen öffnet), Schilder und Knöpfe kompakter */
  .card .play { display: none; }
  .card .badges { right: 8px; gap: 3px; bottom: 6px; left: 6px; }
  .card .badge { font-size: 10px; padding: 2px 5px; }
  .card .badge:nth-child(n+3) { display: none; }
  .card .quick { top: 6px; right: 6px; gap: 3px; }
  .card .quick button, .card .quick .qdl { width: 28px; height: 28px; }
  .card .quick { opacity: 1; }
  .card .quick button { width: 32px; padding: 0; justify-content: center; }
  .card .quick button span { display: none; }
  /* Am Handy: Antippen übernimmt den Prompt, keine Leiste über dem Bild */
  .ex-cap { display: none; }
  .gallery { column-width: 150px; column-gap: 8px; }
  .gallery .ex { margin-bottom: 8px; }
  .viewer { width: 100vw; height: 100dvh; border-radius: 0; border: 0; }
  .viewer[open] { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(200px, 46dvh) minmax(0, 1fr); }
  .v-side { border-left: 0; border-top: 1px solid var(--line-soft); padding-bottom: max(20px, env(safe-area-inset-bottom, 0px)); }
  .v-head .x { position: absolute; top: max(12px, env(safe-area-inset-top, 0px)); right: max(12px, env(safe-area-inset-right, 0px)); z-index: 5; }
  .v-head .v-dl { right: calc(max(12px, env(safe-area-inset-right, 0px)) + 44px); margin: 0; }
  .m-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toast { bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 640px) {
  .tools { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .tool { padding-bottom: 10px; }
  .tool > span:not(.t-media) { margin: 0 10px; }
  .t-media { margin-bottom: 4px; }
  .t-name { font-size: 13.5px; }
  .t-desc { display: none; }
  .t-tag { font-size: 10.5px; }
  .h-ideas { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; width: calc(100% + 14px); margin-right: -14px; padding-right: 14px; padding-bottom: 4px; scrollbar-width: none; }
  .h-ideas .idea { flex: none; }
  .h-row .m-tile { width: 150px; }
  .h-recent .card { height: 140px; width: calc(140px * var(--ar, 1)); }
}
@media (max-width: 420px) {
  .credits .c-l, .credits i, .credits #limit { display: none; }
  .set .seg.wrap { max-width: none; justify-content: flex-start; }
  .styles { grid-template-columns: repeat(2, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Ein Hauch Lime-Licht: Erstellen-Knopf, gewählte Art, gewählte Kamera, aktiver Bereich (dezent, kein Neon) */
.go:not(:disabled), .h-go { box-shadow: 0 10px 30px -16px rgba(200, 255, 0, .5); }
.mode[aria-pressed="true"] { border-color: var(--accent-edge); box-shadow: 0 8px 22px -14px rgba(200, 255, 0, .45); }
.mode[aria-pressed="true"] svg { color: var(--accent); }
.cam[aria-pressed="true"], .m-tile[aria-pressed="true"] { box-shadow: 0 0 0 1px var(--accent), 0 10px 26px -14px rgba(200, 255, 0, .5); }
.tab[aria-pressed="true"] svg { color: var(--accent); }
.prompt-box:focus-within, .h-prompt:focus-within { box-shadow: 0 0 0 3px rgba(200, 255, 0, .08); }
@media (prefers-reduced-motion: no-preference) {
  .go:not(:disabled):hover { transform: translateY(-1px); }
}

/* ---------- Motion: ruhig, aber lebendig (bei „weniger Bewegung“ aus) ---------- */
@media (prefers-reduced-motion: no-preference) {
  /* Überschrift baut sich Wort für Wort auf */
  .h-title .w { display: inline-block; opacity: 0; transform: translateY(14px); filter: blur(6px); animation: wordIn .7s var(--ease) forwards; }
  @keyframes wordIn { to { opacity: 1; transform: none; filter: none; } }
  /* Abschnitte und Kacheln gleiten beim Scrollen herein */
  .rv { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); transition-delay: var(--d, 0s); }
  .rv.in { opacity: 1; transform: none; }
  /* Werkzeug-Kacheln kippen leicht zur Maus */
  .tool.rv.in, .tool:not(.rv) { transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .25s ease-out, opacity .7s var(--ease), border-color .2s, background .2s; }
  /* Knöpfe geben beim Drücken nach */
  .mode, .cam, .idea, .h-go { transition: transform .15s, border-color .2s, background .2s, color .2s, box-shadow .2s; }
  .btn:active, .seg button:active, .mode:active, .cam:active, .idea:active, .h-go:active { transform: scale(.96); }
  /* Welle beim Erstellen */
  .go { overflow: hidden; }
  .go .ripple { position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .55); transform: scale(0); animation: ripple .7s ease-out forwards; pointer-events: none; }
  @keyframes ripple { to { transform: scale(4); opacity: 0; } }
  /* Lichtstreifen über wartende Karten */
  .card.running::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(105deg, transparent 35%, rgba(200, 255, 0, .08) 50%, transparent 65%); background-size: 250% 100%; animation: sweep 2.2s linear infinite; }
  @keyframes sweep { from { background-position: 150% 0; } to { background-position: -100% 0; } }
  /* Bereichswechsel blendet weich über */
  .home, .stage { animation: pageIn .45s var(--ease) both; }
  @keyframes pageIn { from { opacity: 0; transform: translateY(8px); } }
  /* Aktiver Bereich in der Leiste: Lime-Strich gleitet herein */
  .tab { position: relative; }
  .tab::before { content: ""; position: absolute; left: -8px; top: 50%; width: 3px; height: 0; border-radius: 2px; background: var(--accent); transform: translateY(-50%); transition: height .3s var(--ease); }
  .tab[aria-pressed="true"]::before { height: 26px; }
}
@media (max-width: 820px) { .tab::before { display: none; } }

/* =====================================================================================================
   Design 2.0: ruhiger und professioneller. Feine Lichtkanten statt harter Rahmen, Glas für Kopf- und
   Filterleiste, dichteres Ergebnis-Raster wie in Profi-Tools, Chips aus Glas. Kein Glühen, keine Deko.
   ===================================================================================================== */
:root { --hair: rgba(255, 255, 255, .06); --hi: inset 0 1px 0 rgba(255, 255, 255, .045); }

/* Oberflächen: oben eine feine Lichtkante, das gibt Tiefe ohne dicke Rahmen */
.model-card, .prompt-box, .settings, .xset, .mode, .kind, .cam, .tool, .mcard, .h-prompt, .trim, .credits, .btn, .seg, .idea, .setup, .pick-big, .up-media, .slot-body { box-shadow: var(--hi); }
.settings, .xset { background: var(--surface-2); }

/* Kopfzeile: leicht durchsichtig mit Unschärfe, dazu Brotkrumen „Erstellen / Video“ */
.top { background: rgba(14, 15, 18, .78); -webkit-backdrop-filter: saturate(140%) blur(14px); backdrop-filter: saturate(140%) blur(14px); }
.top-t { font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.top-t .crumb { color: var(--muted); font-weight: 400; }
.top-t .crumb::before { content: "/"; margin: 0 8px; color: var(--line-2); }

/* Leiste links: aktiver Bereich als ruhige Fläche mit Kante */
.tab { border-radius: 12px; }
.tab[aria-pressed="true"] { background: var(--surface-2); box-shadow: var(--hi), 0 0 0 1px var(--line); }

/* Umschalter Video | Bild | Upscale: gewählt mit Lime-Unterkante statt hellem Rahmen */
.kind[aria-selected="true"] { border-color: var(--line-2); box-shadow: var(--hi), inset 0 -2px 0 var(--accent); }

/* Segment-Knöpfe: gewählter Wert hebt sich leicht ab */
.seg button[aria-pressed="true"] { box-shadow: 0 1px 2px rgba(0, 0, 0, .45), var(--hi); }

/* Erstellen-Knopf: Lime mit feinem Verlauf und Lichtkante, wie gepresst */
.go { background: linear-gradient(180deg, #D7FF3F 0%, var(--accent) 55%, #B9EE00 100%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), inset 0 -1px 0 rgba(0, 0, 0, .12), 0 10px 28px -16px rgba(200, 255, 0, .55); }
.go:hover { background: linear-gradient(180deg, #E0FF66 0%, var(--accent-2) 60%, #C4F51A 100%); }

/* Ergebnisse: Filterleiste bleibt beim Scrollen oben stehen */
.feed > .feed-h { position: sticky; top: var(--top-h); z-index: 6; margin: 0 -20px 12px; padding: 10px 20px; background: rgba(14, 15, 18, .82); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.filters { box-shadow: var(--hi); }
.feed .ideas .idea { height: 30px; font-size: 12.5px; padding: 0 11px 0 9px; }
.setup { padding: 8px 12px; font-size: 12.5px; }

/* Karten: runder, feine Innenkante, heben sich beim Drüberfahren leicht an */
.card { border-radius: 14px; box-shadow: inset 0 0 0 1px var(--hair); transition: transform .35s var(--ease), box-shadow .3s; }
.card::before { content: ""; position: absolute; inset: 0; z-index: 2; border-radius: inherit; box-shadow: inset 0 0 0 1px var(--hair); pointer-events: none; }
.card:not(.running):hover { transform: translateY(-2px); }
.badge { background: rgba(14, 15, 18, .62); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border: 1px solid rgba(255, 255, 255, .08); color: var(--text); }
.card .cap { background: linear-gradient(180deg, rgba(10, 11, 14, 0), rgba(10, 11, 14, .92) 42%); padding-top: 30px; }
.card .quick button, .card .quick .qdl, .card .play { background: rgba(14, 15, 18, .7); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); }
@media (min-width: 821px) {
  .grid { gap: 8px; }
  .grid > .card { flex-basis: calc(var(--ar, 1) * 170px); }
}

/* Startseite: Überschriften klarer, Kacheln heben sich an */
.h-sec-h h2 { font-size: 22px; letter-spacing: -.02em; }
.tool, .mcard { transition: border-color .2s, background .2s, transform .35s var(--ease); }
.tool:hover { transform: translateY(-2px); }
.ex { box-shadow: inset 0 0 0 1px var(--hair); }

/* Fenster (Ansicht, Auswahl, Kamera): Hintergrund abgedunkelt und weich */
dialog::backdrop { background: rgba(6, 7, 9, .7); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.viewer, .picker { box-shadow: 0 40px 120px -30px rgba(0, 0, 0, .9), var(--hi); }
.v-side { background: linear-gradient(180deg, var(--surface) 0%, var(--panel) 160px); }

/* =====================================================================================================
   Farbrollen: Lime = Hauptfarbe und Video, Lila = Bild, Figuren, Stimmen, Rot = Upscale. Flach, ohne Glühen.
   ===================================================================================================== */
:root { --violet: #A66BFF; --red: #FF4F6D; --violet-wash: rgba(166, 107, 255, .14); --red-wash: rgba(255, 79, 109, .13); }

/* Umschalter oben: Unterkante und Symbol in der Farbe der Art */
.kind[data-pane="image"][aria-selected="true"] { box-shadow: var(--hi), inset 0 -2px 0 var(--violet); }
.kind[data-pane="image"][aria-selected="true"] svg { color: var(--violet); }
.kind[data-pane="upscale"][aria-selected="true"] { box-shadow: var(--hi), inset 0 -2px 0 var(--red); }
.kind[data-pane="upscale"][aria-selected="true"] svg { color: var(--red); }

/* Modell-Karte: Symbol farbig je Art */
#videoForm .model-ic { background: var(--accent); color: var(--accent-ink); }
#imageForm .model-ic { background: var(--violet); color: #fff; }
#upForm .model-ic { background: var(--red); color: #fff; }

/* Bild-Spalte: gewählte Art und Stil in Lila */
#imageForm .seg button[aria-pressed="true"] { box-shadow: 0 1px 2px rgba(0, 0, 0, .45), inset 0 -2px 0 var(--violet); }
#imageForm .style[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--violet); }
#upForm .seg button[aria-pressed="true"] { box-shadow: 0 1px 2px rgba(0, 0, 0, .45), inset 0 -2px 0 var(--red); }

/* Laufende Aufträge: Fortschritt von Lime nach Lila */
.card .line i { background: linear-gradient(90deg, var(--accent), var(--violet)); }

/* Schilder auf den Karten */
.badge.violet { background: var(--violet); color: #fff; }
.badge.blue { background: var(--red); color: #fff; }

/* Figuren und Stimmen: Lila */
.figbtn svg, .speak-open svg { color: var(--violet); }
.fig-card b { color: var(--violet); }
.hl mark.fig { background: var(--violet-wash); color: var(--violet); }
.fig-dlg .p-sub b, .speak-dlg .p-sub b { color: var(--violet); }
.fig-new svg { color: var(--violet); }
.fig-new:hover { border-color: var(--violet); }
.card .wave i { background: var(--violet); }

/* Startseite: Werkzeug-Schilder in der Farbe ihrer Art */
.tool[data-go^="video"] .t-tag { color: var(--accent); background: var(--accent-wash); }
.tool[data-go="image"] .t-tag, .tool[data-go="paint"] .t-tag { color: #CDB2FF; background: var(--violet-wash); }

/* Upscale-Spalte: Ziel/Hinweis rot betont */
#upForm .pick-big svg { color: var(--red); }
#upForm .pick-big:hover { border-color: var(--red); }

/* Kostenübersicht: Balken je Modell in eigener Farbe */
.cost-row .bar span.c1 { background: var(--violet); }
.cost-row .bar span.c2 { background: var(--red); }
.cost-row .bar span.c3 { background: var(--blue); }
.cost-row .bar span.c4 { background: var(--text-2); }

/* =====================================================================================================
   Aufbau nach OpenArt-Vorbild: breite Leiste mit Werkzeugen, Einstellungen als Zeilen, Galerie nach Datum.
   ===================================================================================================== */
.rail-name, .rail-sec { display: none; }

/* Leiste ab 1280 px: Name, Bereiche als Zeilen, Werkzeuge als Kacheln, Sammlung */
@media (min-width: 1280px) {
  :root { --rail-w: 232px; }
  .rail { align-items: stretch; gap: 18px; padding: 14px 12px 18px; overflow-y: auto; }
  .rail .brand { display: flex; align-items: center; gap: 10px; padding: 0 6px; height: 40px; text-decoration: none; color: var(--text); }
  .rail-name { display: inline; font-size: 15px; font-weight: 600; letter-spacing: -.01em; white-space: nowrap; }
  .rail-name span { color: var(--muted); font-weight: 500; }
  .tabs { gap: 2px; }
  .tab { width: auto; height: 40px; flex-direction: row; justify-content: flex-start; gap: 11px; padding: 0 12px; font-size: 13.5px; }
  .tab svg { width: 18px; height: 18px; }
  .tab::before { left: -12px; }
  .rail-sec { display: grid; gap: 6px; }
  .rail-h { padding: 0 8px; font-size: 10.5px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--dim); }
  .rail-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
  .rt { display: flex; align-items: center; gap: 7px; height: 36px; padding: 0 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text-2); font-size: 12.5px; font-weight: 500; white-space: nowrap; overflow: hidden; transition: background .2s, border-color .2s, color .2s; }
  .rt svg { width: 16px; height: 16px; flex: none; color: var(--muted); }
  .rt:hover { background: var(--surface-2); color: var(--text); }
  .rt[aria-pressed="true"] { border-color: rgba(200, 255, 0, .45); color: var(--text); background: var(--surface-2); }
  .rt[aria-pressed="true"] svg { color: var(--accent); }
  .rt[data-go="image"][aria-pressed="true"] { border-color: rgba(166, 107, 255, .55); }
  .rt[data-go="image"][aria-pressed="true"] svg, .rt[data-go="image"]:hover svg { color: var(--violet); }
  .rt[data-go="upscale"][aria-pressed="true"] { border-color: rgba(255, 79, 109, .55); }
  .rt[data-go="upscale"][aria-pressed="true"] svg, .rt[data-go="upscale"]:hover svg { color: var(--red); }
  .rl { display: flex; align-items: center; gap: 11px; height: 36px; padding: 0 12px; border: 0; border-radius: 10px; background: none; color: var(--muted); font-size: 13px; text-align: left; transition: background .2s, color .2s; }
  .rl svg { width: 17px; height: 17px; flex: none; }
  .rl:hover { background: var(--surface); color: var(--text); }
  .rl[data-act="fig"] svg { color: var(--violet); }
}

/* Arten (Text, Bild, Omni, Verlängern): flacher, eine Zeile */
.mode { display: flex; align-items: center; justify-content: center; gap: 6px; height: 40px; padding: 0 4px; font-size: 12px; }
.mode svg { width: 16px; height: 16px; flex: none; }

/* Einstellungen als Zeilen */
.rows { display: grid; gap: 8px; }
.rowpick { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); color: var(--text); text-align: left; cursor: pointer; font: inherit; transition: border-color .2s, background .2s; }
.rowpick:hover { border-color: rgba(255, 255, 255, .16); }
.rp-t { display: grid; gap: 1px; flex: 1; min-width: 0; line-height: 1.3; }
.rp-t .lbl { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rp-t b { font-size: 14px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rp-chev { width: 16px; height: 16px; flex: none; color: var(--muted); }
.rp-ic { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 9px; background: var(--surface-3); color: var(--text-2); }
.rp-ic svg { width: 18px; height: 18px; }
.rp-m { width: 64px; height: 40px; flex: none; border-radius: 8px; overflow: hidden; background: var(--surface-3); display: grid; place-items: center; }
.rp-m .mp { width: 100%; height: 100%; aspect-ratio: auto; display: block; }
.rp-m video, .rp-m img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rp-none svg { width: 20px; height: 20px; color: var(--muted); display: block; }
.rowpick.toggle { font-size: inherit; color: var(--text); }
.rowpick.toggle input { margin-left: auto; }
.xset.out { margin-top: 0; background: var(--surface-2); }
.xset.out > summary { min-height: 56px; gap: 12px; padding: 8px 12px; }
.xset.out > summary > span:first-child { margin-right: 0; }
.xset.out > summary .rp-t { flex: 1; }
.xset.out > summary .more-sum { margin: 0; font-size: 14px; }
.xset.out[open] { border-color: rgba(255, 255, 255, .14); }

/* Erstellen-Knopf mit Zähler davor */
.gen-row { display: flex; gap: 8px; align-items: stretch; }
.gen-row .go { flex: 1; min-width: 0; }
.stepper { display: flex; align-items: center; flex: none; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--surface-2); overflow: hidden; }
.stepper .st-b { width: 30px; align-self: stretch; border: 0; background: none; color: var(--text-2); font-size: 17px; line-height: 1; padding: 0; }
.stepper .st-b:hover:not(:disabled) { color: var(--text); background: var(--surface-3); }
.stepper .st-b:disabled { opacity: .3; cursor: default; }
.stepper .st-v { min-width: 28px; text-align: center; font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* Galerie: Gruppen nach Datum, Kachelgröße per Regler */
.grid > .g-day { flex: 0 0 100%; display: flex; align-items: center; gap: 12px; margin: 16px 0 2px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.grid > .g-day:first-child { margin-top: 2px; }
.grid > .g-day::after { content: ""; flex: 1; height: 1px; background: var(--line-soft); }
.grid > .g-fill { flex: 999 1 0; height: 0; }
@media (min-width: 821px) { .grid > .card { flex-basis: calc(var(--ar, 1) * var(--tile, 170px)); } }
.gsize { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px; margin-left: auto; color: var(--muted); }
.gsize svg { width: 14px; height: 14px; flex: none; }
.gsize input { width: 110px; accent-color: var(--accent); }
@media (max-width: 1180px) { .gsize { display: none; } }

/* Startseite: Banner etwas flacher, damit Überschrift und Eingabe gleich zu sehen sind */
.h-banner { max-height: min(470px, 52dvh); }
