/* StoryLoom Studio — STEP 2: Global-First SaaS Design System (Dark Primary & Refined Light Theme) */
:root,
[data-theme="dark"] {
  --bg: #07080B;
  --bg-elev: #0C0E13;
  --panel: #10131A;
  --panel-hi: #161A24;
  --panel-glass: rgba(12, 14, 19, 0.86);
  --input-bg: #080A0E;
  --stage-bg: #050608;
  --line: rgba(218, 148, 56, 0.30);
  --line-strong: rgba(242, 180, 90, 0.55);
  --line-soft: rgba(235, 228, 216, 0.11);
  --text-main: #F3EFE6;
  --text-dim: #B8B2A6;
  --text-mute: #858075;
  --gold: #DA9438;
  --gold-hi: #F4B860;
  --gold-ink: #08090C;
  --accent-bg: rgba(218, 148, 56, 0.12);
  --accent-bg-hi: rgba(218, 148, 56, 0.20);
  --emerald: #34D399;
  --cyan: #38BDF8;
  --shadow-card: 0 14px 36px rgba(0, 0, 0, 0.42);
  --shadow-glow: 0 0 40px rgba(218, 148, 56, 0.08);
  --checker-a: #151821;
  --checker-b: #0B0D12;
}

[data-theme="light"] {
  --bg: #F7F5F0;
  --bg-elev: #EFECE4;
  --panel: #FFFFFF;
  --panel-hi: #F3EFE6;
  --panel-glass: rgba(247, 245, 240, 0.88);
  --input-bg: #FAF8F5;
  --stage-bg: #10131A;
  --line: rgba(180, 108, 24, 0.28);
  --line-strong: rgba(180, 108, 24, 0.55);
  --line-soft: rgba(24, 24, 28, 0.10);
  --text-main: #17181C;
  --text-dim: #494B54;
  --text-mute: #767882;
  --gold: #B86E14;
  --gold-hi: #9A580A;
  --gold-ink: #FFFFFF;
  --accent-bg: rgba(184, 110, 20, 0.10);
  --accent-bg-hi: rgba(184, 110, 20, 0.18);
  --emerald: #059669;
  --cyan: #0284C7;
  --shadow-card: 0 10px 28px rgba(20, 22, 28, 0.06);
  --shadow-glow: 0 0 32px rgba(184, 110, 20, 0.07);
  --checker-a: #232733;
  --checker-b: #161922;
}

:root {
  --sans: "Inter", "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans KR", sans-serif;
  --mono: "JetBrains Mono", "SF Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --gutter: clamp(16px, 5vw, 56px);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: hidden; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text-main);
  font-family: var(--sans);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
  overflow-wrap: anywhere;
  overflow-x: hidden;
  transition: background-color 0.22s ease, color 0.22s ease;
}
a { color: inherit; text-decoration: none; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 2px; }

/* 16-Section Architecture */
.rb {
  max-width: 1160px;
  margin: 0 auto;
  padding: clamp(36px, 6vw, 80px) var(--gutter);
  border-bottom: 1px solid var(--line-soft);
}
.rb-tag {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-mute);
  margin-bottom: 16px;
}
.rb-tag span { color: var(--gold); font-weight: 600; margin-right: 8px; }

.rb-h1 {
  margin: 0 0 18px;
  font-size: clamp(30px, 4.8vw, 54px);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.025em;
  color: var(--text-main);
}
.rb-h2 {
  margin: 0 0 20px;
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.015em;
  color: var(--text-main);
}
.rb-k {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 10px;
}
.rb-note { margin-top: 16px; font-size: 13px; color: var(--text-mute); }
.rb-spec { margin-top: 14px; font-size: 14px; color: var(--text-dim); line-height: 1.6; }
.rb-spec span {
  display: inline-block;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  background: var(--accent-bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 2px 7px;
  margin-right: 8px;
  white-space: nowrap;
}
.lead { font-size: clamp(15.5px, 1.7vw, 18px); color: var(--text-dim); max-width: 54em; margin-bottom: 14px; }
.big { font-size: 26px; font-weight: 600; color: var(--text-main); margin-bottom: 10px; letter-spacing: -0.01em; }
.small { font-size: 13px; color: var(--text-mute); }

/* Top Notice Bar (#rb-1) */
.rb-notice { padding-top: 22px; padding-bottom: 22px; }
.rb-notice .rb-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 20px;
  background: linear-gradient(90deg, var(--accent-bg), transparent 85%), var(--panel);
}
.rb-notice .rb-k { margin-bottom: 2px; }

/* Sticky Global Header & UI Language / Theme Controls (#rb-2) */
.rb-nav {
  padding-top: 14px;
  padding-bottom: 14px;
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--panel-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.rb-nav .rb-tag { margin-bottom: 6px; }
.rb-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px 20px;
  flex-wrap: wrap;
}
.rb-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-main);
}
.rb-brand i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: linear-gradient(135deg, var(--gold-hi), var(--gold));
  box-shadow: 0 0 10px rgba(218, 148, 56, 0.5);
  flex: none;
}
.rb-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 18px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-dim);
}
.rb-links a {
  padding: 4px 0;
  transition: color 0.15s ease;
}
.rb-links a:hover { color: var(--gold); }

/* Global Utility Bar: UI Language Switcher (EN / KO) + Theme Toggle */
.sl-nav-utils {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.sl-ui-lang-group {
  display: inline-flex;
  align-items: center;
  background: var(--input-bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}
.sl-ui-lang-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--text-mute);
  padding: 0 7px 0 9px;
  text-transform: uppercase;
}
.sl-ui-lang-btn {
  border: 0;
  background: transparent;
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.sl-ui-lang-btn:hover { color: var(--text-main); }
.sl-ui-lang-btn.is-active {
  background: var(--gold);
  color: var(--gold-ink);
}
.sl-theme-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--input-bg);
  color: var(--text-main);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: 6px 13px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}
.sl-theme-btn:hover {
  border-color: var(--gold);
  background: var(--accent-bg);
}

/* Demo Transparency Badge */
.sl-demo-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--gold);
  background: var(--accent-bg);
  border: 1px solid var(--line);
  padding: 6px 13px;
  border-radius: 999px;
  margin-bottom: 16px;
  max-width: 100%;
}
.sl-demo-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 8px var(--emerald);
  flex: none;
}

/* Interactive Prompt Builder Panel (#rb-3) */
.sl-prompt-panel {
  margin-top: 28px;
  border: 1px solid var(--line);
  background: linear-gradient(155deg, var(--accent-bg), transparent 50%), var(--panel);
  padding: clamp(18px, 3vw, 30px);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card), var(--shadow-glow);
}
.sl-prompt-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.sl-prompt-label {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-main);
}
.sl-char-count {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-mute);
}
.sl-textarea {
  width: 100%;
  min-height: 88px;
  padding: 14px 16px;
  background: var(--input-bg);
  color: var(--text-main);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  resize: vertical;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.sl-textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--accent-bg);
  outline: none;
}

/* Preset Idea Chips */
.sl-presets {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 20px;
}
.sl-presets-title {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-mute);
  margin-right: 4px;
  text-transform: uppercase;
}
.sl-chip {
  background: var(--panel-hi);
  color: var(--text-dim);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: 6px 13px;
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}
.sl-chip:hover, .sl-chip.is-active {
  color: var(--text-main);
  border-color: var(--gold);
  background: var(--accent-bg-hi);
}

/* Controls Grid: Output Language, Visual Style, Transparent Signature, Position */
.sl-controls-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.sl-control-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}
.sl-control-label {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--gold);
  text-transform: uppercase;
}
.sl-select {
  width: 100%;
  padding: 10px 12px;
  background: var(--input-bg);
  color: var(--text-main);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s ease;
}
.sl-select:focus {
  border-color: var(--gold);
  outline: none;
}

/* Output Language Segmented Pills (Independent from UI Language!) */
.sl-lang-pills {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.sl-lang-btn {
  padding: 9px 6px;
  background: var(--input-bg);
  color: var(--text-dim);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
}
.sl-lang-btn:hover {
  border-color: var(--gold);
  color: var(--text-main);
}
.sl-lang-btn.is-active {
  background: var(--gold);
  color: var(--gold-ink);
  border-color: var(--gold);
}

.sl-prompt-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
}
.sl-hint {
  font-size: 12.5px;
  color: var(--text-mute);
}
.sl-submit-btn {
  padding: 12px 24px;
  background: var(--gold);
  color: var(--gold-ink);
  border: 0;
  border-radius: var(--radius-sm);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s ease, background-color 0.15s ease;
}
.sl-submit-btn:hover {
  background: var(--gold-hi);
  transform: translateY(-1px);
}

/* Live Studio Workspace (#rb-6) */
.sl-studio-shell {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: var(--radius-lg);
  padding: clamp(18px, 3vw, 30px);
  box-shadow: var(--shadow-card);
}
.sl-studio-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding-bottom: 18px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--line-soft);
}
.sl-studio-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.sl-meta-tag {
  font-family: var(--mono);
  font-size: 11px;
  padding: 5px 11px;
  border-radius: var(--radius-sm);
  background: var(--panel-hi);
  border: 1px solid var(--line-soft);
  color: var(--text-main);
}
.sl-meta-tag strong {
  color: var(--gold);
  margin-right: 4px;
}

.sl-studio-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

/* Canvas Stage Box (Always Dark Theater Frame for Accurate Alpha & Contrast) */
.sl-stage-box {
  background: var(--stage-bg);
  color: #F3EFE6;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  padding: 16px;
  min-width: 0;
}
.sl-stage-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.sl-toolbar-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.sl-tool-btn {
  padding: 7px 12px;
  background: var(--panel-hi);
  color: var(--text-dim);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}
.sl-stage-box .sl-tool-btn {
  background: #161A24;
  color: #C4BEB2;
  border-color: rgba(255, 255, 255, 0.12);
}
.sl-tool-btn:hover, .sl-tool-btn.is-active {
  color: var(--text-main);
  border-color: var(--gold);
  background: var(--accent-bg-hi);
}
.sl-stage-box .sl-tool-btn:hover,
.sl-stage-box .sl-tool-btn.is-active {
  color: #FFFFFF;
  border-color: #F4B860;
  background: rgba(218, 148, 56, 0.25);
}

.sl-canvas-wrap {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #080A0E;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.10);
}
.sl-canvas-wrap.is-checker {
  background-color: var(--checker-b);
  background-image:
    linear-gradient(45deg, var(--checker-a) 25%, transparent 25%),
    linear-gradient(-45deg, var(--checker-a) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--checker-a) 75%),
    linear-gradient(-45deg, transparent 75%, var(--checker-a) 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
}
#sl-preview-canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

.sl-transport {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.10);
  flex-wrap: wrap;
}
.sl-timecode {
  font-family: var(--mono);
  font-size: 12px;
  color: #F4B860;
}
.sl-ducking-meter {
  font-family: var(--mono);
  font-size: 11px;
  color: #34D399;
}

/* Dynamic 4-Scene Storyboard Column */
.sl-storyboard-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.sl-storyboard-title {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 4px;
}
.sl-scene-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sl-scene-card {
  border: 1px solid var(--line-soft);
  background: var(--input-bg);
  border-radius: var(--radius-sm);
  padding: 13px 15px;
  cursor: pointer;
  transition: all 0.16s ease;
}
.sl-scene-card:hover {
  border-color: var(--line-strong);
  transform: translateX(2px);
}
.sl-scene-card.is-active {
  border-color: var(--gold);
  background: var(--accent-bg);
  box-shadow: inset 3px 0 0 var(--gold);
}
.sl-scene-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.sl-scene-badge {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--gold);
  font-weight: 600;
}
.sl-scene-time {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-mute);
}
.sl-scene-script {
  font-size: 13.5px;
  color: var(--text-main);
  line-height: 1.52;
  margin-bottom: 6px;
}
.sl-scene-cue {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
}

/* Open Track Export Preview Bar */
.sl-tracks-bar {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.sl-track-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.sl-track-pill {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  background: var(--input-bg);
  border: 1px solid var(--line-soft);
  padding: 6px 11px;
  border-radius: var(--radius-sm);
}
.sl-export-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* STEP 3 Milestone 2: Prototype Status Banner, Placement/Safe-Zone Controls, Asset Registry & Async Render Panel */
.sl-proto-banner {
  margin-bottom: 14px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(244, 184, 96, 0.55);
  background: rgba(218, 148, 56, 0.14);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.sl-proto-banner.is-custom {
  border-color: rgba(52, 211, 153, 0.45);
  background: rgba(52, 211, 153, 0.10);
}
.sl-proto-banner.is-fallback {
  border-color: rgba(56, 189, 248, 0.45);
  background: rgba(56, 189, 248, 0.10);
}
.sl-proto-status-text {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #F4B860;
}
.sl-proto-banner.is-custom .sl-proto-status-text { color: #34D399; }
.sl-proto-banner.is-fallback .sl-proto-status-text { color: #38BDF8; }
.sl-asset-telemetry {
  font-family: var(--mono);
  font-size: 11px;
  color: #D4CFC4;
}

.sl-m2-controls-panel {
  margin-top: 14px;
  padding: 14px;
  background: #0B0E14;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: var(--radius-sm);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.sl-m2-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}
.sl-m2-label {
  font-family: var(--mono);
  font-size: 10.5px;
  color: #F4B860;
  letter-spacing: 0.05em;
  display: flex;
  justify-content: space-between;
}
.sl-m2-range {
  width: 100%;
  accent-color: #DA9438;
  cursor: pointer;
}

.sl-m2-bottom-grid {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--line-soft);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
}
.sl-m2-card {
  border: 1px solid var(--line-soft);
  background: var(--input-bg);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.sl-m2-card-title {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
}
.sl-upload-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.sl-file-input {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--text-dim);
  max-width: 100%;
}
.sl-text-input {
  flex: 1;
  min-width: 150px;
  padding: 7px 10px;
  background: var(--panel);
  color: var(--text-main);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  font-family: var(--sans);
  font-size: 12.5px;
}
.sl-feedback-box {
  font-family: var(--mono);
  font-size: 11.5px;
  padding: 8px 11px;
  border-radius: var(--radius-sm);
  background: var(--panel);
  border: 1px solid var(--line-soft);
  color: var(--text-dim);
}
.sl-feedback-box.is-error {
  border-color: #F43F5E;
  color: #FDA4AF;
  background: rgba(244, 63, 94, 0.10);
}
.sl-feedback-box.is-ok {
  border-color: var(--emerald);
  color: var(--emerald);
  background: rgba(52, 211, 153, 0.08);
}

.sl-registry-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 210px;
  overflow-y: auto;
}
.sl-registry-item {
  border: 1px solid var(--line-soft);
  background: var(--panel);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.sl-registry-item.is-selected {
  border-color: var(--gold);
  background: var(--accent-bg);
}
.sl-reg-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.sl-reg-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}
.sl-reg-meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
}
.sl-reg-status {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--gold);
}

.sl-render-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.sl-render-outputs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}
.sl-dl-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 11px;
  border-radius: var(--radius-sm);
  background: var(--accent-bg-hi);
  border: 1px solid var(--gold);
  color: var(--text-main);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
}
.sl-dl-link:hover {
  background: var(--gold);
  color: var(--gold-ink);
}

/* Standard Sections Layout & Cards */
.rb-frame {
  aspect-ratio: 16 / 3.8;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  padding: clamp(20px, 3.5vw, 36px);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: linear-gradient(160deg, var(--accent-bg), transparent 65%), var(--panel);
  box-shadow: var(--shadow-card);
}
.rb-frame-k {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}

.rb-split {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: clamp(24px, 5vw, 64px);
  align-items: start;
}
.rb-pricebox, .rb-box {
  border: 1px solid var(--line);
  background: var(--panel);
  padding: clamp(20px, 3vw, 32px);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}
.rb-btn {
  display: inline-block;
  width: 100%;
  margin: 16px 0 12px;
  padding: 14px 22px;
  font: inherit;
  font-weight: 600;
  color: var(--gold-ink);
  background: var(--gold);
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: center;
  transition: background-color 0.15s ease, transform 0.12s ease;
}
.rb-btn:hover {
  background: var(--gold-hi);
  transform: translateY(-1px);
}

.rb-cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}
.rb-card {
  border: 1px solid var(--line-soft);
  background: var(--panel);
  padding: 22px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  transition: border-color 0.18s ease, transform 0.18s ease;
}
.rb-card:hover {
  border-color: var(--line);
  transform: translateY(-2px);
}
.rb-card .rb-spec { margin: 10px 0 6px; }
.rb-no {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--gold);
}
.rb-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin: 0;
}
.rb-stats div {
  border: 1px solid var(--line-soft);
  background: var(--panel);
  padding: 22px 24px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}
.rb-stats dt {
  font-family: var(--mono);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-mute);
  margin-bottom: 8px;
}
.rb-stats dd {
  margin: 0;
  font-size: clamp(24px, 3.4vw, 36px);
  color: var(--gold);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.rb-faq details {
  border-bottom: 1px solid var(--line-soft);
  padding: 18px 0;
}
.rb-faq summary {
  cursor: pointer;
  font-size: 16px;
  color: var(--text-main);
  font-weight: 500;
}
.rb-faq summary:hover { color: var(--gold); }
.rb-faq details p {
  margin-top: 10px;
  color: var(--text-dim);
  font-size: 14.5px;
  line-height: 1.65;
}

/* Responsive Breakpoints */
@media (max-width: 960px) {
  .sl-controls-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sl-studio-grid, .sl-m2-bottom-grid { grid-template-columns: minmax(0, 1fr); }
  .sl-m2-controls-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .rb-split, .rb-stats, .sl-controls-grid, .sl-m2-controls-panel { grid-template-columns: minmax(0, 1fr); }
  .rb-bar, .sl-prompt-actions, .sl-studio-header, .sl-transport, .sl-tracks-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .sl-nav-utils { justify-content: space-between; width: 100%; }
  .sl-submit-btn { width: 100%; text-align: center; }
  .sl-toolbar-group { width: 100%; justify-content: space-between; }
  .rb-frame { aspect-ratio: auto; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}

/* Commercial SaaS polish: hide reverse-engineering layer tags & prototype dev banner */
.rb-tag { display: none !important; }
.sl-proto-banner { display: none !important; }
.sl-auth-nav { display: inline-flex; align-items: center; gap: 8px; margin-left: 8px; }
.sl-auth-link { padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; text-decoration: none; border: 1px solid rgba(255,255,255,0.18); color: inherit; transition: opacity 0.15s ease; }
.sl-auth-link:hover { opacity: 0.85; }
.sl-auth-link.is-primary { background: linear-gradient(135deg, #d6892a, #f2b45a); color: #140e07; border-color: transparent; }


/* CSP-safe utility classes (moved from inline styles in storyloom.html) */
.sl-mb-6 { margin-bottom: 6px; }
.sl-mb-0 { margin-bottom: 0; }
.sl-xy-row { display: flex; gap: 6px; }
.sl-render-dur-select { width: auto; flex: 1; min-width: 180px; }
.sl-cta-row { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.sl-btn-soft { opacity: 0.9; }

