/* ============================================
   Slides IA — Styles
   Design Direction: SPOTLIGHT STAGE  (Hard Rule #16 — NEW, unique to slides-ia)
   • Palette/type/layout: theatre-dark charcoal stage (#0b0b0e) + a single warm amber
     stage-light accent (#f5b740); a warm projection spotlight (amber→warm-white radial
     beam) washes only the focal area, darkness everywhere else; heavy treated grotesk
     display + wide-tracked UPPERCASE "marquee" labels.
   • Signature element: the live deck preview framed inside a lit stage / projection
     beam (soft conic light from above) + a projector/spotlight glyph casting a cone
     as the brand-mark on the gate.
   ============================================ */

:root {
  /* Stage surfaces */
  --bg: #0b0b0e;
  --stage: #0e0e13;
  --bg-elev: #16161d;
  --bg-elev-2: #1d1d26;
  --bg-card: rgba(255,255,255,.035);
  --panel: #121218;
  --border: rgba(255,255,255,.08);
  --border-strong: rgba(245,183,64,.28);
  --border-hover: rgba(245,183,64,.45);

  /* Text */
  --text: #f3f0e9;
  --text-muted: #a8a49a;
  --text-dim: #85806f; /* lightened from #6f6b62 for AA contrast at small sizes (was ~3.7:1, now ~4.6:1) */

  /* Spotlight accent (warm amber stage light) */
  --accent: #f5b740;
  --accent-soft: #ffd479;
  --accent-deep: #c98a18;
  --beam: rgba(245,183,64,.22);
  --beam-soft: rgba(255,212,121,.10);

  /* Legacy token aliases (kept so legal/about inline styles stay on-palette) */
  --accent-purple: #f5b740;
  --accent-pink: #ffd479;
  --accent-amber: #f5b740;
  --accent-orange: #c98a18;

  /* Status */
  --good: #51c98a;
  --mid: #eab308;
  --low: #ef6360;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  /* Radius — restrained, "screen" feel */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;

  /* Type */
  --font-display: "Helvetica Neue", "Arial Narrow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "SF Mono", "JetBrains Mono", ui-monospace, "Cascadia Code", Menlo, monospace;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

/* Keyboard focus — a thin spotlight ring, visible only for keyboard nav */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

/* The stage: pooled darkness with a single warm overhead spotlight */
.bg-gradient {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(120% 90% at 50% -25%, rgba(245,183,64,.16) 0%, rgba(245,183,64,.05) 22%, transparent 52%),
    radial-gradient(80% 60% at 50% 0%, rgba(255,212,121,.10) 0%, transparent 45%),
    linear-gradient(180deg, #101015 0%, #0b0b0e 60%, #08080b 100%);
}
/* faint floor reflection of the beam */
.bg-gradient::after {
  content: "";
  position: absolute;
  left: 50%; bottom: 0;
  width: 70vw; height: 30vh;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center bottom, rgba(245,183,64,.06), transparent 70%);
  pointer-events: none;
}

/* Screens */
.screen { display: none; min-height: 100vh; }
.screen.active { display: flex; flex-direction: column; }

/* Marquee labels — wide-tracked uppercase stage credits */
.marquee-label {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: .34em;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.marquee-label::before {
  content: "";
  width: 18px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent));
}

/* ============================================
   MEMBERSHIP GATE
   ============================================ */
#gate-screen { align-items: center; justify-content: center; padding: var(--space-lg); }

.gate-container { width: 100%; max-width: 440px; text-align: center; }

.gate-header { margin-bottom: var(--space-xl); }

/* Signature: projector/spotlight glyph casting a cone */
.stage-mark {
  width: 96px; height: 96px;
  margin: 0 auto var(--space-lg);
  position: relative;
  display: flex; align-items: flex-start; justify-content: center;
}
.stage-mark .lamp {
  width: 26px; height: 18px;
  border-radius: 5px;
  background: linear-gradient(180deg, #2a2a33, #1a1a20);
  border: 1px solid var(--border-strong);
  position: relative; z-index: 2;
  box-shadow: 0 0 14px rgba(245,183,64,.45);
}
.stage-mark .lamp::after {
  content: ""; position: absolute; left: 50%; bottom: 2px; transform: translateX(-50%);
  width: 8px; height: 8px; border-radius: 50%;
  background: radial-gradient(circle, #fff 0%, var(--accent-soft) 45%, var(--accent-deep) 100%);
  box-shadow: 0 0 10px var(--accent-soft);
}
.stage-mark .cone {
  position: absolute; top: 17px; left: 50%; transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 30px solid transparent;
  border-right: 30px solid transparent;
  border-top: 64px solid rgba(245,183,64,.16);
  filter: blur(.5px);
  z-index: 1;
}
.stage-mark .pool {
  position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%);
  width: 64px; height: 12px; border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(245,183,64,.30), transparent 70%);
}

.gate-title {
  font-family: var(--font-display);
  font-size: clamp(34px, 7vw, 52px);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: .98;
  color: var(--text);
  text-transform: uppercase;
}
.gate-title .ia { color: var(--accent); }
.gradient-text { /* legacy hook used by template — render as solid stage display */
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -.03em;
  color: var(--text);
}

.subtitle { color: var(--text-muted); font-size: 15px; line-height: 1.5; margin-bottom: var(--space-lg); }

.community-badge {
  display: inline-block;
  background: rgba(245,183,64,.10);
  color: var(--accent-soft);
  padding: 6px 16px;
  border-radius: 100px;
  font-size: 12.5px;
  font-weight: 600;
  border: 1px solid rgba(245,183,64,.22);
  margin-top: var(--space-sm);
}

.gate-form {
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.015));
  border: 1px solid var(--border);
  border-top: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  text-align: left;
  margin-bottom: var(--space-lg);
  box-shadow: 0 24px 60px -24px rgba(0,0,0,.7), inset 0 1px 0 rgba(255,255,255,.04);
}

.form-group { margin-bottom: var(--space-lg); }
.form-group label {
  display: block;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}

.form-group input,
.brief-field input,
.brief-field textarea,
.brief-field select {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.form-group input:focus,
.brief-field input:focus,
.brief-field textarea:focus,
.brief-field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(245,183,64,.18);
}
.form-group input::placeholder,
.brief-field input::placeholder,
.brief-field textarea::placeholder { color: var(--text-dim); }

/* Buttons */
.btn-primary {
  width: 100%;
  padding: 14px 24px;
  background: linear-gradient(135deg, var(--accent-soft), var(--accent) 55%, var(--accent-deep));
  color: #1a1205;
  border: none;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 800;
  font-family: var(--font-body);
  letter-spacing: .01em;
  cursor: pointer;
  transition: filter .2s, transform .1s, box-shadow .2s;
  min-height: 48px;
  box-shadow: 0 8px 24px -8px rgba(245,183,64,.5);
}
.btn-primary:hover { filter: brightness(1.07); transform: translateY(-1px); box-shadow: 0 12px 30px -8px rgba(245,183,64,.6); }
.btn-primary:active { transform: translateY(0) scale(.99); }
.btn-primary:disabled { opacity: .45; cursor: not-allowed; transform: none; filter: none; box-shadow: none; }

.btn-secondary {
  width: 100%;
  padding: 13px 24px;
  background: var(--bg-elev);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  min-height: 46px;
}
.btn-secondary:hover { border-color: var(--border-hover); background: var(--bg-elev-2); }

.btn-danger {
  width: 100%;
  padding: 12px 24px;
  background: rgba(239,99,96,.10);
  color: var(--low);
  border: 1px solid rgba(239,99,96,.22);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  min-height: 44px;
}
.btn-danger:hover { background: rgba(239,99,96,.18); }

.btn-icon {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  padding: 8px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  min-width: 44px; min-height: 44px;
  transition: border-color .2s, color .2s, background .2s;
}
.btn-icon:hover { border-color: var(--border-hover); color: var(--accent); background: rgba(245,183,64,.06); }

.btn-loading { display: inline-flex; align-items: center; gap: 8px; }

.error-message { color: var(--low); font-size: 14px; margin-top: var(--space-md); text-align: center; }

.gate-footer { color: var(--text-dim); font-size: 13px; }
.gate-footer a { color: var(--accent); text-decoration: none; }
.gate-footer a:hover { text-decoration: underline; }

/* ============================================
   API KEY SETUP SCREEN
   ============================================ */
#key-screen { align-items: center; justify-content: center; padding: var(--space-lg); }
.key-container { width: 100%; max-width: 540px; }
.key-container h2 {
  font-family: var(--font-display);
  font-size: clamp(24px, 4vw, 30px);
  font-weight: 800;
  letter-spacing: -.02em;
  margin-bottom: var(--space-sm);
}

.key-inputs { display: flex; flex-direction: column; gap: var(--space-md); margin: var(--space-xl) 0; }
.key-input-group {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
}
.key-input-group label {
  display: block;
  font-family: var(--font-mono);
  text-transform: uppercase; letter-spacing: .1em;
  font-size: 11px; font-weight: 600;
  margin-bottom: var(--space-sm); color: var(--text-muted);
}
.key-input-wrapper { position: relative; display: flex; gap: var(--space-sm); }
.key-input-wrapper input {
  flex: 1; min-width: 0;
  padding: 12px 14px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  font-size: 14px;
  font-family: var(--font-mono);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.key-input-wrapper input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(245,183,64,.18); }
.key-toggle {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  padding: 0 12px; cursor: pointer; font-size: 13px; min-width: 44px;
}
.key-status { font-size: 12px; margin-top: var(--space-xs); color: var(--text-dim); }
.key-status.saved { color: var(--good); }
.key-actions { display: flex; flex-direction: column; gap: var(--space-md); }
.key-info { margin-top: var(--space-xl); color: var(--text-muted); font-size: 14px; }
.key-info summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.key-info-content {
  margin-top: var(--space-md); padding: var(--space-lg);
  background: var(--bg-card); border-radius: var(--radius-md); border: 1px solid var(--border);
}
.key-info-content p { margin-bottom: var(--space-sm); }
.key-info-content code { background: var(--bg-elev); padding: 2px 6px; border-radius: 4px; font-size: 13px; font-family: var(--font-mono); }

/* ============================================
   APP SCREEN — the studio + the stage
   ============================================ */
#app-screen { min-height: 100vh; }

.app-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-md) var(--space-xl);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0;
  background: rgba(11,11,14,.85);
  backdrop-filter: blur(12px);
  z-index: 100;
}
.header-left { display: flex; align-items: center; gap: 12px; }
.header-mark {
  width: 26px; height: 26px; flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: 6px;
  background: radial-gradient(circle at 50% 30%, var(--accent-soft), var(--accent-deep));
  box-shadow: 0 0 14px rgba(245,183,64,.4);
  color: #1a1205;
}
.app-title {
  font-family: var(--font-display);
  font-size: 19px; font-weight: 800; letter-spacing: -.01em;
  text-transform: uppercase; color: var(--text);
}
.app-title .ia { color: var(--accent); }
.header-right { display: flex; gap: var(--space-sm); }

.app-main { flex: 1; width: 100%; }

/* Studio = brief (left) + stage (right) */
.studio {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: var(--space-lg);
  max-width: 1320px;
  margin: 0 auto;
  padding: var(--space-lg) var(--space-xl) var(--space-2xl);
  align-items: start;
}
.studio > * { min-width: 0; }   /* COR-026 — let the 1fr stage shrink, inner scroller scrolls */

/* Brief panel */
.brief-panel {
  background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.012));
  border: 1px solid var(--border);
  border-top: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  position: sticky; top: 84px;
  box-shadow: 0 20px 50px -28px rgba(0,0,0,.7);
}
.brief-panel .marquee-label { margin-bottom: var(--space-lg); }
.brief-field { margin-bottom: var(--space-lg); }
.brief-field > label {
  display: block;
  font-family: var(--font-mono);
  text-transform: uppercase; letter-spacing: .12em;
  font-size: 11px; font-weight: 600; color: var(--text-muted);
  margin-bottom: var(--space-sm);
}
.brief-field textarea { resize: vertical; min-height: 78px; line-height: 1.5; }
.brief-hint { font-size: 12px; color: var(--text-dim); margin-top: 6px; }

/* Chip / segmented selectors */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  appearance: none;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 100px;
  padding: 8px 14px;
  font-size: 13px; font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all .15s;
  min-height: 38px;
}
.chip:hover { border-color: var(--border-hover); color: var(--text); }
.chip.active {
  background: rgba(245,183,64,.14);
  border-color: var(--accent);
  color: var(--accent-soft);
  box-shadow: 0 0 0 1px rgba(245,183,64,.25) inset;
}

.byok-note {
  font-size: 12px; color: var(--text-dim);
  background: rgba(245,183,64,.05);
  border: 1px solid rgba(245,183,64,.14);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: var(--space-md);
  line-height: 1.5;
}
.byok-note strong { color: var(--accent-soft); }

/* ============================================
   STAGE PANEL — spotlit deck preview
   ============================================ */
.stage-panel { display: flex; flex-direction: column; gap: var(--space-md); }

.stage-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-md); flex-wrap: wrap;
}
.tabs { display: inline-flex; gap: 4px; background: var(--bg-elev); border: 1px solid var(--border); border-radius: 100px; padding: 4px; }
.tab {
  appearance: none; background: none; border: none;
  color: var(--text-muted);
  font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .1em;
  font-size: 11px; font-weight: 600;
  padding: 8px 16px; border-radius: 100px; cursor: pointer; transition: all .15s;
  min-height: 36px;
}
.tab.active { background: rgba(245,183,64,.16); color: var(--accent-soft); }

.theme-pick { display: inline-flex; align-items: center; gap: 8px; }
.theme-pick .marquee-label { font-size: 10px; letter-spacing: .26em; }

/* The lit stage that frames the deck (signature element) */
.stage-frame {
  position: relative;
  border-radius: var(--radius-lg);
  background: #07070a;
  border: 1px solid var(--border);
  padding: 26px 26px 18px;
  overflow: hidden;
  box-shadow: 0 30px 70px -30px rgba(0,0,0,.8);
}
/* overhead projection beam */
.stage-frame::before {
  content: "";
  position: absolute; top: -40%; left: 50%; transform: translateX(-50%);
  width: 140%; height: 120%;
  background: radial-gradient(60% 50% at 50% 0%, rgba(245,183,64,.14), rgba(245,183,64,.04) 40%, transparent 66%);
  pointer-events: none;
}
.deck-viewport {
  position: relative; z-index: 1;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-sm);
  background: #111;
  overflow: hidden;
  box-shadow: 0 18px 50px -16px rgba(0,0,0,.8), 0 0 0 1px rgba(245,183,64,.14), 0 0 40px -6px rgba(245,183,64,.22);
}
#deck-frame { width: 100%; height: 100%; border: 0; display: block; background: #fff; }

/* Empty / loading states inside the viewport */
.deck-empty, .deck-loading {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 14px; padding: var(--space-xl);
  background: radial-gradient(80% 70% at 50% 10%, rgba(245,183,64,.10), transparent 60%), #0c0c11;
  color: var(--text-muted);
}
.deck-empty .stage-mark { margin-bottom: 4px; transform: scale(1.05); }
.deck-empty h3 { font-family: var(--font-display); font-weight: 800; letter-spacing: -.01em; color: var(--text); font-size: 20px; text-transform: uppercase; }
.deck-empty p { font-size: 14px; max-width: 320px; }
.spinner {
  width: 38px; height: 38px; border-radius: 50%;
  border: 3px solid rgba(245,183,64,.2); border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Deck nav controls */
.deck-controls {
  position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: center; gap: var(--space-md);
  margin-top: var(--space-md);
}
.deck-controls .nav-btn {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--bg-elev); border: 1px solid var(--border-strong); color: var(--accent-soft);
  display: grid; place-items: center; cursor: pointer; transition: all .15s;
}
.deck-controls .nav-btn:hover:not(:disabled) { background: rgba(245,183,64,.14); transform: scale(1.06); }
.deck-controls .nav-btn:disabled { opacity: .3; cursor: not-allowed; }
.slide-counter {
  font-family: var(--font-mono); font-size: 13px; letter-spacing: .14em;
  color: var(--text-muted); min-width: 84px; text-align: center;
}
.slide-counter b { color: var(--accent); }

/* Export bar */
.export-bar {
  display: flex; flex-wrap: wrap; gap: var(--space-sm); align-items: center;
}
.export-bar .btn-export {
  flex: 1 1 auto;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 16px;
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius-md); color: var(--text);
  font-size: 14px; font-weight: 600; font-family: inherit; cursor: pointer;
  transition: all .15s; min-height: 46px;
}
.export-bar .btn-export:hover:not(:disabled) { border-color: var(--accent); color: var(--accent-soft); background: rgba(245,183,64,.06); }
.export-bar .btn-export.primary {
  background: linear-gradient(135deg, var(--accent-soft), var(--accent) 55%, var(--accent-deep));
  color: #1a1205; border: none; font-weight: 800;
  box-shadow: 0 8px 22px -10px rgba(245,183,64,.55);
}
.export-bar .btn-export.primary:hover:not(:disabled) { filter: brightness(1.07); }
.export-bar .btn-export:disabled { opacity: .4; cursor: not-allowed; }

/* Outline (Estrutura) + raw HTML tabs */
.panel-scroll {
  max-height: 70vh; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: var(--space-lg);
}
.outline-item {
  display: flex; gap: var(--space-md); padding: var(--space-md) 0;
  border-bottom: 1px solid var(--border);
}
.outline-item:last-child { border-bottom: none; }
.outline-num {
  font-family: var(--font-mono); font-size: 12px; color: var(--accent);
  min-width: 28px; padding-top: 2px; letter-spacing: .08em;
}
.outline-body h4 { font-family: var(--font-display); font-size: 16px; font-weight: 800; letter-spacing: -.01em; margin-bottom: 4px; color: var(--text); }
.outline-body .otype { font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .12em; font-size: 10px; color: var(--text-dim); }
.outline-body p { font-size: 13.5px; color: var(--text-muted); margin-top: 4px; }
.code-block {
  font-family: var(--font-mono); font-size: 12.5px; line-height: 1.6;
  white-space: pre-wrap; word-break: break-word; color: var(--text-muted);
}

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--bg-elev-2); border: 1px solid var(--border-strong);
  color: var(--text); padding: 12px 20px; border-radius: 100px;
  font-size: 14px; font-weight: 600; opacity: 0; pointer-events: none;
  transition: all .25s; z-index: 2000; box-shadow: 0 12px 30px -10px rgba(0,0,0,.6);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { border-color: rgba(239,99,96,.5); color: var(--low); }

.app-footer {
  text-align: center; padding: var(--space-xl);
  color: var(--text-dim); font-size: 13px; border-top: 1px solid var(--border);
}
.footer-links { margin-top: 8px; }
.footer-links a { color: var(--text-dim); text-decoration: none; font-size: 12px; }
.footer-links a:hover { color: var(--accent); text-decoration: underline; }
.footer-sep { margin: 0 8px; color: var(--text-dim); opacity: .4; }

/* ============================================
   MODAL
   ============================================ */
.modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; }
.modal-overlay { position: absolute; inset: 0; background: rgba(0,0,0,.72); backdrop-filter: blur(4px); }
.modal-content {
  position: relative; background: var(--bg-elev);
  border: 1px solid var(--border-strong); border-radius: var(--radius-xl);
  padding: var(--space-xl); width: 90%; max-width: 480px; max-height: 80vh; overflow-y: auto;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.8);
}
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--space-lg); }
.modal-header h3 { font-family: var(--font-display); font-size: 19px; font-weight: 800; text-transform: uppercase; letter-spacing: -.01em; }
.modal-actions { display: flex; flex-direction: column; gap: var(--space-md); margin-top: var(--space-lg); }
.modal .key-input-group { background: var(--bg-card); }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 980px) {
  .studio { grid-template-columns: 1fr; padding: var(--space-md) var(--space-md) var(--space-2xl); }
  .brief-panel { position: static; }
}
@media (max-width: 768px) {
  .app-header { padding: var(--space-md); }
  .gate-form { padding: var(--space-lg); }
  .stage-frame { padding: 16px 16px 14px; }
}
@media (max-width: 480px) {
  .app-header { gap: 8px; }
  .header-left { gap: 8px; }
  .app-title { font-size: 16px; }
  .header-right { gap: 6px; }
  .community-badge { font-size: 11.5px; padding: 6px 12px; }
  .tab { padding: 8px 12px; }
}
@media (max-width: 375px) {
  .gate-container { padding: 0 var(--space-sm); }
  .gate-form { padding: var(--space-md); }
  .key-container { padding: 0 var(--space-sm); }
  .export-bar .btn-export { flex-basis: 100%; }
  .app-title { font-size: 15px; }
}

/* ============================================
   ANIMATIONS — lights come up
   ============================================ */
@keyframes lightsUp {
  from { opacity: 0; transform: translateY(10px); filter: brightness(.6); }
  to { opacity: 1; transform: translateY(0); filter: brightness(1); }
}
.screen.active { animation: lightsUp .45s ease-out; }
.stage-frame { animation: lightsUp .6s ease-out backwards; }

/* ============================================
   PRINT (parent page never prints the deck — the iframe does)
   ============================================ */
@media print {
  .bg-gradient, .app-header, .app-footer, .btn-icon, .brief-panel, .stage-toolbar, .deck-controls, .export-bar { display: none !important; }
  body { background: #fff; color: #000; }
}
