/* Template Studio — eigene Layout-Styles auf Basis der bestehenden NightKit-
   Tokens (tokens.css). Reine Addition, ändert nichts an app.css. */

.studio-body {
  margin: 0;
  min-height: 100vh;
  background: var(--color-bg, #0a0a0a);
  color: var(--color-text, #fff);
  font-family: Inter, system-ui, sans-serif;
}

/* hidden-Attribut muss gegen explizite display-Regeln (z. B. .studio-gate{display:grid})
   gewinnen — sonst bleiben „versteckte" Overlays sichtbar. */
[hidden] { display: none !important; }

/* Scrollen: die Haupt-App-CSS (app.css) setzt html,body auf overflow:hidden für
   ihr fixiertes Layout. studio.css lädt nur hier und danach → wir erlauben für
   die Studio-Seite vertikales Scrollen, damit nichts unten abgeschnitten wird. */
html, body { height: auto; min-height: 100%; overflow-x: hidden; overflow-y: auto; }

/* ── Code-Gate ─────────────────────────────────────────────── */
.studio-gate {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(204, 255, 0, 0.06), transparent 60%),
    var(--color-bg, #0a0a0a);
  z-index: 10;
}
.gate-card {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 28px 24px 24px;
  background: var(--color-surface, #111);
  border: 1px solid var(--color-border, #222);
  border-radius: var(--radius-lg, 16px);
  text-align: center;
}
.gate-brand {
  font-family: Syne, Inter, sans-serif;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--color-accent, #ccff00);
}
.gate-title {
  margin: 4px 0 0;
  font-family: Syne, Inter, sans-serif;
  font-size: 22px;
  font-weight: 800;
}
.gate-sub {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--muted, rgba(245, 245, 240, 0.42));
}
.gate-input {
  height: 44px;
  text-align: center;
  font-size: 20px;
  letter-spacing: 0.3em;
  background: var(--card-inset, #0d0d0d);
  border: 1px solid var(--color-border, #222);
  border-radius: var(--radius-md, 12px);
  color: var(--color-text, #fff);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.gate-input:focus {
  border-color: var(--color-accent, #ccff00);
  box-shadow: 0 0 0 3px rgba(204, 255, 0, 0.12);
}
.gate-btn { height: 44px; }
.gate-err {
  font-size: 13px;
  color: #ff6b6b;
}

/* ── Studio-Shell ──────────────────────────────────────────── */
.studio-top {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 56px;
  padding: 0 16px;
  border-bottom: 1px solid var(--color-border, #222);
  position: sticky;
  top: 0;
  background: var(--color-bg, #0a0a0a);
  z-index: 5;
}
.studio-brand {
  font-family: Syne, Inter, sans-serif;
  font-weight: 800;
  color: var(--color-accent, #ccff00);
  white-space: nowrap;
}
.studio-brand span {
  color: var(--color-text, #fff);
  font-weight: 700;
  opacity: 0.8;
  margin-left: 6px;
}
.studio-tabs {
  display: flex;
  gap: 4px;
  margin: 0 auto 0 8px;
}
.studio-tab {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted, rgba(245, 245, 240, 0.5));
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  padding: 8px 14px;
  border-radius: var(--radius-md, 12px);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.studio-tab:hover { color: var(--color-text, #fff); }
.studio-tab.active {
  background: var(--color-surface-2, #1a1a1a);
  color: var(--color-text, #fff);
  border-color: var(--color-border, #222);
}
.studio-lock { margin-left: auto; }

.studio-main { padding: 20px 16px 48px; }
.studio-panel { max-width: 1100px; margin: 0 auto; }
.studio-panel[hidden] { display: none; }
.studio-ph {
  display: grid;
  place-items: center;
  min-height: 50vh;
  color: var(--muted, rgba(245, 245, 240, 0.42));
  border: 1px dashed var(--color-border, #222);
  border-radius: var(--radius-lg, 16px);
}

/* ── Modus-Layout (Steuerung links · Ergebnis rechts) ──────── */
.studio-grid {
  display: grid;
  grid-template-columns: minmax(320px, 380px) 1fr;
  gap: 18px;
  align-items: start;
}
.studio-col { display: flex; flex-direction: column; gap: 14px; }

.st-card {
  background: var(--color-surface, #111);
  border: 1px solid var(--color-border, #222);
  border-radius: var(--radius-md, 12px);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.st-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted, rgba(245, 245, 240, 0.5));
}
.st-mini {
  appearance: none;
  background: transparent;
  border: 1px solid var(--color-border, #222);
  color: var(--color-text, #fff);
  font: inherit;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 8px;
  cursor: pointer;
}
.st-mini:hover { border-color: var(--color-accent, #ccff00); }

.st-drop {
  display: grid;
  place-items: center;
  text-align: center;
  min-height: 84px;
  padding: 14px;
  border: 1px dashed var(--color-border, #333);
  border-radius: var(--radius-md, 12px);
  color: var(--muted, rgba(245, 245, 240, 0.5));
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.st-drop:hover { border-color: var(--color-accent, #ccff00); color: var(--color-text, #fff); }
.st-drop.dragover {
  border-color: var(--color-accent, #ccff00);
  border-style: solid;
  background: rgba(204, 255, 0, 0.08);
  color: var(--color-text, #fff);
}
.st-thumb {
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  border-radius: var(--radius-md, 12px);
  background: var(--card-inset, #0d0d0d);
}

.st-row { display: flex; gap: 8px; align-items: center; }
.st-select {
  flex: 1;
  height: 34px;
  padding: 0 10px;
  background: var(--card-inset, #0d0d0d);
  color: var(--color-text, #fff);
  border: 1px solid var(--color-border, #222);
  border-radius: var(--radius-md, 12px);
  font: inherit;
}
.st-slider-row { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted, rgba(245,245,240,0.6)); }
.st-slider { width: 100%; accent-color: var(--color-accent, #ccff00); }
.af2-varrow #af2VarVal { color: var(--color-accent, #ccff00); font-variant-numeric: tabular-nums; }
.af2-varrow .af2-varrange { opacity: 0.6; }

.st-prompt {
  width: 100%;
  resize: vertical;
  box-sizing: border-box;
  background: var(--card-inset, #0d0d0d);
  color: var(--color-text, #fff);
  border: 1px solid var(--color-border, #222);
  border-radius: var(--radius-md, 12px);
  padding: 10px;
  font: 12.5px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
  outline: none;
}
.st-prompt:focus { border-color: var(--color-accent, #ccff00); box-shadow: 0 0 0 3px rgba(204,255,0,0.10); }
.st-go { height: 44px; font-size: 15px; }

/* Ergebnis-Bühne im 9:16-Format */
.st-stage {
  position: relative;
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
  aspect-ratio: 9 / 16;
  background: var(--card-inset, #0d0d0d);
  border: 1px solid var(--color-border, #222);
  border-radius: var(--radius-lg, 16px);
  overflow: hidden;
  display: grid;
  place-items: center;
}
.st-stage-empty { color: var(--muted, rgba(245,245,240,0.4)); font-size: 13px; }
.st-result { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.st-busy {
  position: absolute; inset: 0; z-index: 3;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: rgba(0,0,0,0.6); color: var(--color-text,#fff); font-size: 13px;
}
/* Persistente Fehleranzeige in der Bühne (Modus 2) — bleibt sichtbar bis zum nächsten Versuch */
.st-error {
  position: absolute; inset: 0; z-index: 4;
  display: flex; align-items: center; justify-content: center; text-align: center;
  padding: 18px; box-sizing: border-box;
  color: #ffb4b4; font-size: 13px; line-height: 1.5;
  background: rgba(40, 0, 0, 0.5);
}
.st-actions { display: flex; gap: 8px; justify-content: center; margin-top: 12px; flex-wrap: wrap; }

/* Vorher/Nachher-Toggle: Badge auf der Bühne, wenn das Original gezeigt wird */
.cmp-badge {
  position: absolute; top: 8px; left: 8px; z-index: 6; display: none;
  font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 6px;
  background: rgba(0, 0, 0, 0.6); color: #fff; pointer-events: none;
}
/* aktiver Vergleich-Button (zeigt gerade „Vorher") */
.rbtn.active {
  background: var(--color-accent, #ccff00); color: #000;
  border-color: var(--color-accent, #ccff00);
}

/* Engine-Umschalter (Modus 1) */
.engine-card label { flex: 0 0 56px; font-size: 12px; color: var(--muted, rgba(245,245,240,0.7)); }

/* Live-Aktualisierung des Prompt-Feldes sichtbar machen (kurzes Aufblitzen) */
.st-prompt.flash { animation: promptFlash 0.55s ease; }
@keyframes promptFlash {
  0%   { border-color: var(--color-accent, #ccff00); box-shadow: 0 0 0 2px rgba(204,255,0,0.30); }
  100% { border-color: var(--color-border, #2a2a2a); box-shadow: 0 0 0 0 rgba(204,255,0,0); }
}

/* ── Modus 1: einspaltiger PROMPT-Generator ──────────────────────── */
.studio-single {
  max-width: 880px; margin: 0 auto;
  display: flex; flex-direction: column; gap: 14px;
}

/* Inline-Busy-Zeile (kein Bühnen-Overlay mehr in Modus 1) */
.st-busy-inline {
  position: static; inset: auto; z-index: auto;
  background: transparent; justify-content: flex-start;
  color: var(--muted, rgba(245, 245, 240, 0.6)); font-size: 12.5px;
}

/* Großes, gut lesbares Prompt-Feld — das Herzstück. Wächst per JS auf den
   Inhalt, damit der ganze Prompt sichtbar ist (die Seite scrollt). */
.st-prompt-big {
  min-height: 360px;
  font-size: 14px; line-height: 1.65;
  padding: 14px 16px;
  overflow: hidden; resize: none;
}

.prompt-actions { display: flex; }
.st-copy {
  flex: 1; height: 48px;
  font-size: 15px; font-weight: 700; letter-spacing: 0.01em;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.st-copy.copied {
  background: #4ade80; border-color: #4ade80; color: #04210f;
}

/* ── Modus 2: Mehrfach-Referenzen, Stil-Anker, Varianten ─────────── */
.thumb-row { display: flex; flex-wrap: wrap; gap: 8px; }
.thumb-cell {
  position: relative; width: 72px; height: 72px;
  border-radius: 8px; overflow: hidden;
  background: var(--card-inset, #0d0d0d); border: 1px solid var(--color-border, #222);
}
.thumb-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-rm {
  position: absolute; top: 2px; right: 2px;
  width: 18px; height: 18px; padding: 0; line-height: 16px; text-align: center;
  border: none; border-radius: 50%; background: rgba(0, 0, 0, 0.65);
  color: #fff; font-size: 11px; cursor: pointer;
}
.thumb-rm:hover { background: #ff5c5c; }

/* Eingabefelder in einer ref-row (Varianten) */
.ref-row input { flex: 1; min-width: 0; }
/* Texteingaben in einer Button-Reihe füllen; Anzahl-Feld bleibt schmal */
.st-row > .zone-text { flex: 1; min-width: 0; }
.auto-count { flex: 0 0 72px !important; text-align: center; }

/* Stil-Anker */
.anchor-ok { font-size: 11px; font-weight: 600; color: #9be37a; text-transform: none; letter-spacing: 0; }
.anchor-dna { display: flex; flex-direction: column; gap: 4px; }
.anchor-row { display: flex; gap: 8px; font-size: 12px; }
.anchor-key { flex: 0 0 100px; color: var(--muted, rgba(245, 245, 240, 0.55)); }
.anchor-val { flex: 1; min-width: 0; color: var(--color-text, #fff); }

/* Varianten */
.variant-list { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.variant-card {
  border: 1px solid var(--color-border, #222); border-radius: 10px;
  padding: 10px; background: var(--card-inset, #0d0d0d);
}
.variant-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.variant-label { font-size: 12px; font-weight: 700; color: var(--color-accent, #ccff00); }
.variant-copy { height: 30px; font-size: 12px; padding: 0 12px; flex: 0 0 auto; }
.variant-copy.copied { background: #4ade80; border-color: #4ade80; color: #04210f; }
/* Kopierte Variante: ganze Karte dauerhaft grün markiert (bis zum nächsten
   Varianten-Satz), damit man bei vielen Varianten den Überblick behält. */
.variant-card.variant-copied {
  border-color: #4ade80;
  background: rgba(74, 222, 128, 0.12);
  box-shadow: inset 0 0 0 1px rgba(74, 222, 128, 0.45);
}
.variant-card.variant-copied .variant-label { color: #4ade80; }
.variant-card.variant-copied .variant-label::after { content: " ✓ kopiert"; font-weight: 700; }

/* ── Auto-Flow (Beta) ───────────────────────────────────────────────────── */
.tab-beta, .beta-badge {
  display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .04em;
  padding: 1px 6px; border-radius: 999px; margin-left: 6px; vertical-align: middle;
  background: rgba(204,255,0,0.16); color: var(--color-accent, #ccff00);
  border: 1px solid rgba(204,255,0,0.4);
}
.af-field { display: inline-flex; flex-direction: column; gap: 4px; font-size: 11px; font-weight: 600; color: var(--color-text-muted, #888); }
.af-steps { display: flex; flex-direction: column; gap: 8px; }
.af-step { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--color-text, #fff); }
.af-step .af-dot { width: 10px; height: 10px; border-radius: 50%; background: #333; flex: 0 0 auto; }
.af-step .af-label { flex: 1; }
.af-step .af-state { font-size: 12px; color: var(--color-text-muted, #888); font-weight: 600; }
.af-step.running .af-dot { background: var(--color-accent, #ccff00); animation: afpulse 1s ease-in-out infinite; }
.af-step.running .af-state { color: var(--color-accent, #ccff00); }
.af-step.done .af-dot { background: #4ade80; }
.af-step.done .af-state { color: #4ade80; }
.af-step.error .af-dot { background: #ff6b6b; }
.af-step.error .af-state { color: #ff6b6b; }
@keyframes afpulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
.af-error {
  margin-top: 10px; padding: 10px 12px; border-radius: 8px; font-size: 13px;
  background: rgba(255,107,107,0.12); border: 1px solid rgba(255,107,107,0.5); color: #ffb4b4;
}
.af-time { font-size: 12px; font-weight: 600; color: #4ade80; }
.af-result-img {
  display: block; width: 100%; max-width: 420px; margin: 0 auto 12px;
  border-radius: 10px; border: 1px solid var(--color-border, #222);
}

/* ── Auto-Flow Batch (Original + Ergebnis je Flyer, Erfolgsquote) ── */
.batch-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.batch-thumb { position: relative; width: 64px; height: 114px; border-radius: 8px; overflow: hidden; border: 1px solid var(--color-border, #222); }
.batch-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.batch-thumb-x { position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; border-radius: 50%; border: none; background: rgba(0,0,0,.65); color: #fff; font-size: 11px; line-height: 1; cursor: pointer; padding: 0; }
.batch-thumb-x:hover { background: #ff6b6b; }
.batch-list { display: flex; flex-direction: column; gap: 14px; margin-top: 14px; }
.batch-pack { border: 1px solid var(--color-border, #222); border-radius: 12px; padding: 12px; background: var(--card-inset, #0d0d0d); }
.batch-pack-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.batch-pack-num { font-size: 14px; font-weight: 700; color: var(--color-text, #fff); }
.batch-status { font-size: 12px; font-weight: 600; color: var(--color-text-muted, #888); }
.batch-pack.running .batch-status { color: var(--color-accent, #ccff00); }
.batch-pack.done .batch-status { color: #4ade80; }
.batch-pack.error .batch-status { color: #ff6b6b; }
.batch-pack.blocked .batch-status { color: #f59e0b; }
.batch-pack-body { display: flex; gap: 12px; align-items: flex-start; }
.batch-pack-img { flex: 0 0 110px; }
.batch-pack-img img { width: 110px; border-radius: 8px; border: 1px solid var(--color-border, #222); display: block; }
.batch-pack-prompt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.batch-pack-prompt .af-result-img { width: 100%; max-width: 320px; margin: 0; }
.af-res-wait { font-size: 13px; color: var(--color-text-muted, #888); padding: 8px 0; }
.af-blocked { padding: 10px 12px; border-radius: 8px; font-size: 13px; background: rgba(245,158,11,.12); border: 1px solid rgba(245,158,11,.5); color: #fcd34d; }
.af-summary { font-size: 15px; font-weight: 700; color: var(--color-text, #fff); }
.af-pack-prompt { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--color-border, #222); padding-top: 12px; }
.af-pp-label { font-size: 12px; font-weight: 700; color: var(--color-accent, #ccff00); }
.af-pp-text { width: 100%; box-sizing: border-box; resize: vertical; font-size: 12px; line-height: 1.45; }
.af-pp-copy.copied { background: #4ade80; border-color: #4ade80; color: #04210f; }
.af-result-col { display: flex; flex-direction: column; gap: 8px; }
.af-result-col .af-result-img { width: 100%; max-width: 300px; margin: 0; }
@media (max-width: 560px) { .batch-pack-body { flex-direction: column; } .batch-pack-img { flex-basis: auto; } .batch-pack-img img { width: 100%; max-width: 180px; } }

/* Auto-Flow: kompakte Zeilen-Ansicht (1 Flyer = 1 Zeile mit kleinen Kacheln) */
.af-summary-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 6px; }
.af-row { border: 1px solid var(--color-border, #222); border-radius: 12px; padding: 12px; background: var(--card-inset, #0d0d0d); }
.af-row-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.af-row-title { font-size: 14px; font-weight: 700; color: var(--color-text, #fff); flex: 0 0 auto; }
.af-row-stat { font-size: 12px; font-weight: 600; color: var(--color-text-muted, #888); flex: 1; min-width: 0; }
.af-row-zip { flex: 0 0 auto; }
.af-row-strip { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.af-tile { position: relative; flex: 0 0 auto; width: 108px; border: 1px solid var(--color-border, #222); border-radius: 10px; overflow: hidden; background: #0a0a0a; }
.af-tile.done { border-color: #2b6b3a; }
.af-tile-badge { position: absolute; top: 4px; left: 4px; z-index: 2; font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 6px; background: rgba(0,0,0,.72); color: #fff; }
.af-tile-badge.main { background: var(--color-accent, #ccff00); color: #111; }
.af-tile-img { width: 108px; height: 192px; object-fit: cover; display: block; cursor: zoom-in; }
.af-tile-ph { width: 108px; height: 192px; display: flex; align-items: center; justify-content: center; color: #555; font-size: 22px; }
.af-tile.running .af-tile-ph { color: var(--color-accent, #ccff00); animation: afpulse 1.1s ease-in-out infinite; }
@keyframes afpulse { 0%,100%{opacity:.35} 50%{opacity:1} }
.af-tile-mark { width: 108px; height: 192px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center; font-size: 12px; font-weight: 700; padding: 8px; box-sizing: border-box; }
.af-tile-mark-h { font-weight: 700; }
.af-tile-mark-r { font-size: 10px; font-weight: 400; line-height: 1.3; width: 100%; max-height: 132px; overflow: auto; word-break: break-word; opacity: .95; }
.af-tile.blocked .af-tile-mark { color: #fcd34d; background: rgba(245,158,11,.12); }
.af-tile.error .af-tile-mark { color: #ff9b9b; background: rgba(239,68,68,.1); }
.af-tile.cancelled .af-tile-mark { color: #9ca3af; background: rgba(156,163,175,.10); }
.rbtn-danger { background: #b91c1c; border-color: #b91c1c; color: #fff; }
.rbtn-danger:hover { background: #dc2626; border-color: #dc2626; }
/* Auto-Flow 2: Zwei-Knopf-Umschalter für die zwei Abstands-Pfade */
.af2-pathsel { display: flex; gap: 10px; flex-wrap: wrap; margin: 4px 0 2px; }
.af2-pathopt { flex: 1 1 230px; display: flex; flex-direction: column; gap: 3px; cursor: pointer; position: relative; padding: 12px 14px 12px 40px; border: 1.5px solid var(--color-border, #333); border-radius: 10px; background: var(--card-inset, #0d0d0d); transition: border-color .12s, background .12s; }
.af2-pathopt input { position: absolute; left: 14px; top: 14px; width: 16px; height: 16px; accent-color: var(--color-accent, #ccff00); cursor: pointer; }
.af2-pathopt:hover { border-color: #555; }
.af2-pathopt:has(input:checked) { border-color: var(--color-accent, #ccff00); background: rgba(204,255,0,.07); }
.af2-pathopt-t { font-size: 14px; font-weight: 700; color: var(--color-text, #fff); }
.af2-pathopt-d { font-size: 12px; color: var(--color-text-muted, #999); }
.af-tile-acts { position: absolute; bottom: 4px; right: 4px; display: flex; gap: 4px; }
.af-icon-btn { width: 26px; height: 26px; border-radius: 6px; border: 1px solid rgba(255,255,255,.25); background: rgba(0,0,0,.62); color: #fff; font-size: 13px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; }
.af-icon-btn:hover { background: rgba(0,0,0,.88); }
.af-icon-btn.copied { background: #4ade80; border-color: #4ade80; color: #04210f; }
.af-lightbox { position: fixed; inset: 0; z-index: 9999; background: rgba(0,0,0,.85); display: flex; align-items: center; justify-content: center; padding: 24px; }
.af-lightbox[hidden] { display: none; }
.af-lb-inner { position: relative; max-width: 92vw; max-height: 92vh; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.af-lb-img { max-width: 92vw; max-height: 80vh; border-radius: 8px; box-shadow: 0 10px 40px rgba(0,0,0,.6); }
.af-lb-close { position: absolute; top: -14px; right: -14px; width: 34px; height: 34px; border-radius: 50%; border: none; background: #fff; color: #111; font-size: 16px; font-weight: 700; cursor: pointer; }
.af-lb-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: center; }
.af-lb-label { color: #fff; font-size: 13px; font-weight: 600; margin-right: 6px; }
.variant-prompt {
  min-height: 130px; max-height: 220px; overflow: auto; resize: vertical;
  font-size: 12px; line-height: 1.5;
}

/* Toast */
.studio-toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px);
  max-width: 90vw; padding: 10px 16px;
  background: var(--color-surface-2, #1a1a1a); color: var(--color-text, #fff);
  border: 1px solid var(--color-border, #222); border-radius: 10px;
  font-size: 13px; opacity: 0; pointer-events: none;
  transition: opacity 0.2s, transform 0.2s; z-index: 50;
}
.studio-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.studio-toast.err { border-color: #ff6b6b; }
.studio-toast.ok { border-color: var(--color-accent, #ccff00); }

/* Bereinigen-Brush (LaMa) */
.studio-brush-canvas {
  position: absolute; inset: 0; z-index: 4;
  width: 100%; height: 100%;
  display: none;
  cursor: none; touch-action: none;
}
.studio-brush-cursor {
  position: absolute; z-index: 5; display: none;
  border: 1.5px solid var(--color-accent, #ccff00);
  border-radius: 50%; pointer-events: none;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.4), 0 0 8px rgba(204,255,0,0.4);
}
.st-stage.brushing { cursor: none; }
.studio-brush-bar {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center;
  margin-top: 12px;
}
.studio-brush-bar .sbb-size {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--muted, rgba(245,245,240,0.6));
}
.studio-brush-bar .sbb-size input { accent-color: var(--color-accent, #ccff00); }

/* Modus 1 · Schritt 1a: 9:16-Normalisierung */
.st-note { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--muted, rgba(245,245,240,0.5)); }
.norm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.norm-fig { margin: 0; display: flex; flex-direction: column; gap: 4px; }
.norm-fig img {
  width: 100%; aspect-ratio: 9/16; object-fit: contain;
  background: var(--card-inset, #0d0d0d);
  border: 1px solid var(--color-border, #222); border-radius: 8px;
}
.norm-fig figcaption { font-size: 11px; text-align: center; color: var(--muted, rgba(245,245,240,0.5)); }
.norm-dir { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted, rgba(245,245,240,0.7)); }
.norm-dir label { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.norm-dir input { accent-color: var(--color-accent, #ccff00); }
.st-mini-note { font-size: 11px; color: var(--muted, rgba(245,245,240,0.42)); line-height: 1.4; }

/* Modus 1: Zonen → Rollen */
.zone-list { display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow: auto; }
.zone-row { display: flex; align-items: center; gap: 8px; }
.zone-text {
  flex: 1; min-width: 0;
  height: 32px; box-sizing: border-box;
  font: inherit; font-size: 13px; color: var(--color-text, #fff);
  background: var(--card-inset, #0d0d0d);
  border: 1px solid var(--color-border, #222);
  border-radius: 8px; padding: 0 10px;
}
.zone-text:focus { outline: none; border-color: var(--color-accent, #ccff00); }
.zone-role {
  flex: 0 0 140px;
  height: 32px; padding: 0 8px;
  background: var(--color-surface-2, #1a1a1a); color: var(--color-text, #fff);
  border: 1px solid var(--color-border, #222); border-radius: 8px;
  font: inherit; font-size: 12px;
}
.zone-row.zone-remove .zone-text { opacity: 0.55; }
.zone-row.zone-remove .zone-role { border-color: #ff6b6b; color: #ff9b9b; }
/* BEHALTEN: grün markiert, Text voll sichtbar (bleibt unverändert) */
.zone-row.zone-keep .zone-role { border-color: #4ade80; color: #9be37a; }
.zone-row.zone-keep .zone-text { border-color: rgba(74, 222, 128, 0.5); }

/* Soll-Abgleich: fehlende Pflicht-Platzhalter */
.miss-box { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.miss-head { font-size: 11px; color: var(--muted, rgba(245,245,240,0.6)); }
.miss-chip {
  font-size: 11px; padding: 2px 8px; border-radius: 999px;
  background: rgba(204,255,0,0.10); color: var(--color-accent, #ccff00);
  border: 1px solid rgba(204,255,0,0.30);
}
.miss-ok { font-size: 12px; color: var(--color-accent, #ccff00); }

/* Font-Referenz */
.font-ref { display: flex; flex-direction: column; gap: 6px; padding-top: 8px; border-top: 1px solid var(--color-border, #222); }
.ref-head { font-size: 11px; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; color: var(--muted, rgba(245,245,240,0.55)); }
.ref-row { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted, rgba(245,245,240,0.7)); }
.ref-row span { flex: 0 0 96px; }
.ref-row select { flex: 1; min-width: 0; }

@media (max-width: 860px) {
  .studio-grid { grid-template-columns: 1fr; }
}

/* ── Schlagworte-Werkzeug ────────────────────────────────────────── */
.kw-count { font-size: 12px; font-weight: 600; color: var(--color-text-muted, #888); margin-left: 8px; }
.kw-force { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--color-text-muted, #aaa); white-space: nowrap; cursor: pointer; }
.kw-force input { accent-color: var(--color-accent, #ccff00); }
.kw-list { margin-top: 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; max-height: 62vh; overflow-y: auto; padding-right: 4px; }
.kw-card { display: flex; gap: 10px; border: 1px solid var(--color-border, #222); border-radius: 10px; padding: 8px; background: var(--card-inset, #0d0d0d); }
.kw-thumb { flex: 0 0 54px; width: 54px; height: 96px; object-fit: cover; border-radius: 6px; background: #111; display: block; }
.kw-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.kw-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kw-name { font-size: 12px; font-weight: 600; color: var(--color-text, #fff); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kw-retag { flex: 0 0 auto; width: 24px; height: 24px; border-radius: 6px; border: 1px solid var(--color-border, #333); background: transparent; color: var(--color-text-muted, #aaa); font-size: 13px; cursor: pointer; }
.kw-retag:hover { border-color: var(--color-accent, #ccff00); color: var(--color-accent, #ccff00); }
.kw-chips { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.kw-chip { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; padding: 2px 4px 2px 8px; border-radius: 100px; background: rgba(204,255,0,.1); border: 1px solid rgba(204,255,0,.35); color: var(--color-text, #eee); }
.kw-x { width: 15px; height: 15px; border: none; border-radius: 50%; background: rgba(255,255,255,.12); color: #fff; font-size: 11px; line-height: 1; cursor: pointer; padding: 0; }
.kw-x:hover { background: #dc2626; }
.kw-add { width: 96px; font-size: 11px; padding: 3px 8px; background: var(--color-surface-2, #1a1a1a); border: 1px dashed var(--color-border, #333); border-radius: 100px; color: var(--color-text, #fff); outline: none; }
.kw-add:focus { border-color: var(--color-accent, #ccff00); border-style: solid; }
.kw-testout { margin-top: 10px; padding: 10px 12px; border: 1px solid var(--color-border, #333); border-radius: 8px; background: #0a0a0a; color: var(--color-text, #eee); font-size: 12px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.kw-testout[hidden] { display: none; }
