/* Self-hosted Geist Mono (replaces the Google Fonts @import). */
@font-face{font-family:'Geist Mono';font-style:normal;font-weight:400;font-display:swap;src:url('fonts/GeistMono-Regular.woff2') format('woff2');}
@font-face{font-family:'Geist Mono';font-style:normal;font-weight:500;font-display:swap;src:url('fonts/GeistMono-Medium.woff2') format('woff2');}

/* Dream2Screen — iPad LANDSCAPE (1180×820) */
:root {
  /* Wide-step neutral ramp — each layer ~10 lightness apart so depth reads instantly */
  --bg:         #0a0a0d;   /* L  ~3 */
  --surface:    #1f2128;   /* L ~13  — cards on canvas */
  --surface-2:  #2e313a;   /* L ~21  — inner item resting */
  --surface-3:  #3d414c;   /* L ~29  — hover */
  --surface-4:  #4f5562;   /* L ~36  — selected / pressed */

  --border:        rgba(255,255,255,0.08);
  --border-strong: rgba(255,255,255,0.16);
  --hairline:      rgba(255,255,255,0.04);

  --text:    #ffffff;
  --text-2:  rgba(255,255,255,0.72);
  --text-3:  rgba(255,255,255,0.58);  /* a11y: raised from .50 for WCAG contrast */
  --text-4:  rgba(255,255,255,0.40);  /* a11y: raised from .28 for WCAG contrast */

  --accent: #e8b86a;
  --accent-soft: rgba(232,184,106,0.16);
  --accent-dim: #8a6e3f;
  --accent-hover: #f0c47e;
  --cyan: #6fb1d6;
  --crimson: #e36a5c;
  --green: #6fae7f;

  /* Elevation shadows — go up the ladder for higher layers */
  --shadow-1: 0 1px 0 rgba(255,255,255,0.04) inset, 0 4px 12px rgba(0,0,0,0.35);
  --shadow-2: 0 1px 0 rgba(255,255,255,0.06) inset, 0 12px 32px rgba(0,0,0,0.5);
  --shadow-3: 0 1px 0 rgba(255,255,255,0.08) inset, 0 24px 60px rgba(0,0,0,0.6);

  --sf: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', system-ui, sans-serif;
  --mono: 'Geist Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; -webkit-font-smoothing: antialiased; }

html, body {
  margin: 0; padding: 0;
  background: #0a0a0c;
  min-height: 100vh;
  font-family: var(--sf);
  color: var(--text);
  overflow: hidden;
  -webkit-text-size-adjust: 100%;  /* iOS Safari 텍스트 자동확대가 고정 레이아웃을 깨는 것 방지 */
  text-size-adjust: 100%;
}

#root {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 50% 50%, #1f1f23 0%, #121215 60%, #07070a 100%);
  padding: 24px;
}

button { font-family: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; border: none; background: none; color: inherit; }

/* a11y: visible keyboard focus for all interactive elements (mouse users unaffected via :focus-visible) */
button:focus-visible,
[role="button"]:focus-visible,
[tabindex]:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* a11y: respect reduced-motion — neutralize continuous/entrance animations & transitions */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ───── iPad landscape device frame ───── */
.ipad-frame {
  width: 1212px;
  height: 852px;
  flex-shrink: 0;
  position: relative;
  background: #0a0a0c;
  border-radius: 38px;
  padding: 16px;
  box-shadow:
    0 0 0 1.5px #2a2a2e,
    0 0 0 3px #18181b,
    0 50px 100px rgba(0,0,0,0.45),
    0 20px 40px rgba(0,0,0,0.3);
}
.ipad-frame .camera {
  position: absolute;
  top: 7px; left: 50%; transform: translateX(-50%);
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #1a1a1c;
  z-index: 100;
}
.ipad-screen {
  width: 100%; height: 100%;
  background: var(--bg);
  border-radius: 24px;
  overflow: hidden;
  position: relative;
}

/* iPad status bar */
.status-bar {
  position: absolute; top: 0; left: 0; right: 0;
  height: 28px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  z-index: 50;
  pointer-events: none;
}
.status-bar .time {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.status-bar .indicators {
  display: flex; align-items: center; gap: 6px;
}

/* ───── Screen base ───── */
.screen {
  position: absolute; inset: 0;
  padding-top: 28px;
  display: flex; flex-direction: column;
}
/* 화면 루트 JSX 인라인 스타일을 CSS로 이관(2026-07-02) — 인라인은 모바일
   미디어쿼리 오버라이드를 이겨 세로 스크롤을 막았음. 아래는 데스크톱 패리티용
   overflow(원래 인라인에 있던 화면만). 모바일 블록(후순위)이 visible로 풂. */
.results-screen,
.char-preview,
.keyart-screen { overflow: hidden; }
/* 홈 히어로는 원래 인라인에 paddingTop이 없었음 — 패리티 유지 */
.home-screen { padding-top: 0; }

/* ───── Global processing overlay (state-machine driven) ───── */
.proc-overlay {
  position: absolute;
  left: 0; right: 0; top: 28px; /* below status bar */
  z-index: 50;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity .35s ease, transform .35s cubic-bezier(.2,.8,.2,1);
}
.proc-overlay.on {
  opacity: 1;
  transform: translateY(0);
}
.proc-topbar {
  position: relative;
  height: 3px;
  width: 100%;
  background: rgba(255,255,255,0.05);
  overflow: hidden;
}
.proc-topbar-fill {
  position: absolute;
  inset: 0;
  width: 0;
  background: linear-gradient(90deg, var(--accent-dim) 0%, var(--accent) 70%, #fff2c8 100%);
  box-shadow: 0 0 14px rgba(232,184,106,0.55);
  transition: width .25s cubic-bezier(.2,.8,.2,1);
}
.proc-topbar-head {
  position: absolute;
  right: -1px;
  top: 50%;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #ffe5b0;
  transform: translateY(-50%);
  box-shadow: 0 0 10px var(--accent), 0 0 22px rgba(232,184,106,0.45);
  animation: proc-head-pulse 1.1s ease-in-out infinite;
}
@keyframes proc-head-pulse {
  0%,100% { transform: translateY(-50%) scale(1); opacity: 1; }
  50%     { transform: translateY(-50%) scale(1.35); opacity: 0.85; }
}
.proc-topbar-indet {
  position: absolute;
  top: 0; bottom: 0;
  width: 32%;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: proc-indet 1.4s ease-in-out infinite;
}
@keyframes proc-indet {
  from { left: -34%; }
  to   { left: 102%; }
}
.proc-chip {
  margin: 16px auto 0;
  width: fit-content;
  min-width: 460px;
  max-width: calc(100% - 60px);
  padding: 16px 26px 18px;
  background: rgba(14,14,18,0.78);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  backdrop-filter: blur(16px) saturate(150%);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 14px 40px rgba(0,0,0,0.55), 0 0 0 1px rgba(232,184,106,0.06);
  pointer-events: auto;
}
.proc-chip-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 0.07em;
  color: var(--text-2);
  white-space: nowrap;
  justify-content: center;
}
.proc-chip-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
  animation: pulse 1.4s ease-in-out infinite;
}
.proc-chip-label {
  color: var(--accent);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.08em;
}
.proc-chip-sep { color: var(--text-3); font-size: 14px; }
.proc-chip-pct {
  font-variant-numeric: tabular-nums;
  color: var(--text);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.proc-chip-sub {
  margin-top: 9px;
  font-size: 13.5px;
  color: var(--text);
  font-family: var(--mono);
  letter-spacing: 0.03em;
  text-align: center;
  text-transform: uppercase;
  font-weight: 500;
}
.proc-chip-phases {
  margin-top: 14px;
  display: flex;
  gap: 8px;
  justify-content: center;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  color: var(--text-3);
}
.proc-phase {
  padding: 6px 12px;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
  text-transform: uppercase;
  transition-property: background-color, border-color, color, box-shadow, transform, opacity; transition-duration: .35s; transition-timing-function: cubic-bezier(.2,.8,.2,1);
  font-weight: 500;
}
.proc-phase.done {
  color: var(--accent);
  border-color: var(--accent-dim);
  background: rgba(232,184,106,0.10);
}
.proc-phase.active {
  color: var(--bg);
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 18px rgba(232,184,106,0.55), 0 0 36px rgba(232,184,106,0.25);
  font-weight: 700;
  transform: scale(1.12);
  animation: proc-phase-burst 0.65s cubic-bezier(.2,.8,.2,1);
}
@keyframes proc-phase-burst {
  0%   { transform: scale(1); box-shadow: 0 0 0 0 rgba(232,184,106,0.6); }
  50%  { transform: scale(1.25); box-shadow: 0 0 32px 6px rgba(232,184,106,0.55); }
  100% { transform: scale(1.12); box-shadow: 0 0 18px rgba(232,184,106,0.55), 0 0 36px rgba(232,184,106,0.25); }
}

/* ───── Interactive wireframe background ───── */
.wireframe-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}
.home > *:not(.wireframe-bg),
.analyze > *:not(.wireframe-bg),
.preparing-screen > *:not(.wireframe-bg) {
  position: relative;
  z-index: 1;
}

/* ───── Preparing screen ───── */
.preparing-screen {
  position: absolute;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 28px 40px 40px;
}
.preparing-screen .prep-body {
  width: 100%;
  max-width: 720px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.prep-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  background: rgba(20,20,24,0.55);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--text-2);
  margin-bottom: 26px;
}
.prep-eyebrow .prep-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  animation: pulse 1.4s ease-in-out infinite;
}
.prep-headline {
  font-size: 38px;
  font-weight: 600;
  letter-spacing: -0.025em;
  margin: 0 0 10px;
  color: var(--text);
}
.prep-sub {
  font-size: 14px;
  color: var(--text-2);
  font-family: var(--mono);
  letter-spacing: 0.02em;
  margin-bottom: 44px;
  min-height: 1.4em;
  transition: opacity .4s ease;
}
.prep-sub-line {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text-2);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-top: 8px;
}

/* ── Reference-index streaming visual ──────────────────────── */
.preparing-screen .prep-index-body {
  position: relative; z-index: 1;
  width: 100%; max-width: 880px;
  display: flex; flex-direction: column; align-items: center;
}
.prep-index-head {
  width: 100%;
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-bottom: 18px;
}
.prep-index-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.08em; color: var(--text-2);
}
.prep-index-count {
  display: flex; align-items: baseline; gap: 9px;
  font-family: var(--mono);
}
.prep-index-count .num {
  font-size: 30px; font-weight: 700;
  color: var(--accent); letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 18px rgba(232,184,106,0.3);
}
.prep-index-count .of { font-size: 11.5px; color: var(--text-3); letter-spacing: 0.04em; }

.prep-index-stage {
  position: relative;
  width: 100%; height: 372px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 15%, #000 85%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, #000 15%, #000 85%, transparent 100%);
}
.prep-index-col { position: relative; overflow: hidden; }
.prep-index-track {
  display: flex; flex-direction: column; gap: 13px;
  will-change: transform;
  animation-name: idx-scroll;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}
@keyframes idx-scroll {
  from { transform: translateY(0); }
  to   { transform: translateY(-50%); }
}
.idx-row {
  display: flex; align-items: center; gap: 9px;
  font-family: var(--mono); font-size: 12.5px;
  color: var(--text-3); letter-spacing: -0.005em;
  white-space: nowrap;
  opacity: 0.78;
}
.idx-row .ir-dot {
  width: 5px; height: 5px; border-radius: 50%; flex: none;
  background: var(--text-4); opacity: 0.7;
}
.idx-row .ir-t {
  flex: 1; overflow: hidden; text-overflow: ellipsis;
}
.idx-row .ir-y { color: var(--text-4); font-size: 11px; flex: none; }
.idx-row.match {
  color: var(--accent); opacity: 1;
}
.idx-row.match .ir-dot {
  background: var(--accent); opacity: 1;
  box-shadow: 0 0 8px rgba(232,184,106,0.7);
}
.idx-row.match .ir-y { color: var(--accent-dim); }

/* Center scan band — the "now indexing" line */
.prep-index-scan {
  position: absolute; left: -8px; right: -8px; top: 50%;
  transform: translateY(-50%);
  height: 40px;
  border-top: 1px solid var(--accent-dim);
  border-bottom: 1px solid var(--accent-dim);
  background: linear-gradient(90deg, rgba(232,184,106,0.10), rgba(232,184,106,0.04) 60%, transparent);
  pointer-events: none;
  display: flex; align-items: center;
}
.prep-index-scan .scan-tag {
  display: inline-flex; align-items: center; gap: 7px;
  margin-left: 10px;
  font-family: var(--mono); font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.12em; color: var(--accent);
}
.prep-index-scan .scan-pip {
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  animation: pulse 1.2s ease-in-out infinite;
}

.prep-index-foot { margin-top: 26px; text-align: center; }
.prep-index-foot .prep-headline { font-size: 28px; margin: 0 0 6px; }

/* ─────────────────────────────────────────────────────────────
   Reading screen — 3 models reading the script in parallel
   ───────────────────────────────────────────────────────────── */
.reading-screen { background: var(--bg); }
.read-head { padding: 150px 48px 0; text-align: center; }
.read-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 11px; font-weight: 600;
  letter-spacing: 0.1em; color: var(--accent);
}
.read-pip {
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  animation: pulse 1.3s ease-in-out infinite;
}
.read-title {
  font-size: 30px; font-weight: 700; letter-spacing: -0.025em;
  margin: 12px 0 8px; color: var(--text);
}
.read-file {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 12px; color: var(--text-3);
  letter-spacing: 0.02em;
}

.ai-grid {
  flex: 1; min-height: 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
  padding: 28px 48px 40px;
  align-content: center;
}
.ai-col {
  display: flex; flex-direction: column;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: linear-gradient(180deg, color-mix(in oklab, var(--hue) 7%, var(--surface)), var(--surface));
  position: relative;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.ai-col.done {
  border-color: color-mix(in oklab, var(--hue) 55%, transparent);
  box-shadow: 0 0 0 1px color-mix(in oklab, var(--hue) 35%, transparent), 0 14px 36px rgba(0,0,0,0.3);
}
.ai-head { display: flex; align-items: center; gap: 11px; margin-bottom: 18px; }
.ai-mark {
  width: 26px; height: 26px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  position: relative;
}
.ai-mark::before { content: ''; display: block; }
.ai-mark.ring::before {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2.5px solid var(--hue);
  box-shadow: 0 0 10px color-mix(in oklab, var(--hue) 50%, transparent);
}
.ai-mark.triangle::before {
  width: 0; height: 0;
  border-left: 11px solid transparent; border-right: 11px solid transparent;
  border-bottom: 19px solid var(--hue);
  filter: drop-shadow(0 0 8px color-mix(in oklab, var(--hue) 50%, transparent));
}
.ai-mark.diamond::before {
  width: 15px; height: 15px; background: var(--hue);
  transform: rotate(45deg); border-radius: 3px;
  box-shadow: 0 0 10px color-mix(in oklab, var(--hue) 50%, transparent);
}
.ai-name-block { flex: 1; }
.ai-name { font-size: 15px; font-weight: 700; color: var(--text); letter-spacing: -0.01em; }
.ai-ver { font-family: var(--mono); font-size: 10.5px; color: var(--text-3); letter-spacing: 0.03em; margin-top: 1px; }
.ai-status { font-family: var(--mono); font-size: 11px; }
.ai-done-pill {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--hue); font-weight: 700; letter-spacing: 0.05em;
}
.ai-think { display: inline-flex; gap: 4px; align-items: center; }
.ai-think i {
  width: 5px; height: 5px; border-radius: 50%; background: var(--hue); opacity: 0.5;
  animation: ai-think-b 1s ease-in-out infinite;
}
.ai-think i:nth-child(2) { animation-delay: 0.15s; }
.ai-think i:nth-child(3) { animation-delay: 0.3s; }
@keyframes ai-think-b { 0%,100% { opacity: 0.3; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }

.ai-metrics {
  display: flex; gap: 8px; margin-bottom: 18px;
}
.ai-metric {
  flex: 1; display: flex; flex-direction: column; gap: 3px;
  padding: 9px 10px; border-radius: 9px;
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--border);
}
.ai-metric .ml { font-family: var(--mono); font-size: 9px; letter-spacing: 0.08em; color: var(--text-4); }
.ai-metric .mv { font-size: 17px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.ai-metric .mv small { font-size: 10px; font-weight: 500; color: var(--text-4); margin-left: 1px; }

.ai-steps { display: flex; flex-direction: column; gap: 9px; margin-bottom: 16px; }
.ai-step {
  display: flex; align-items: center; gap: 9px;
  font-size: 12.5px; color: var(--text-3);
  transition: color 0.25s ease;
}
.ai-step .as-ico {
  width: 16px; height: 16px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
}
.as-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--text-4);
}
.ai-step.active { color: var(--text); }
.ai-step.active .as-dot {
  background: var(--hue);
  box-shadow: 0 0 0 0 color-mix(in oklab, var(--hue) 60%, transparent);
  animation: ai-step-pulse 1.1s ease-out infinite;
}
@keyframes ai-step-pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in oklab, var(--hue) 55%, transparent); }
  70% { box-shadow: 0 0 0 7px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.ai-step.done { color: var(--text-2); }
.ai-step.pending { opacity: 0.5; }

.ai-bar {
  margin-top: auto;
  height: 4px; border-radius: 2px; background: rgba(255,255,255,0.06);
  overflow: hidden;
}
.ai-bar-fill {
  height: 100%; border-radius: 2px;
  background: var(--hue);
  box-shadow: 0 0 10px color-mix(in oklab, var(--hue) 60%, transparent);
  transition: width 0.18s linear;
}

/* Summary */
.read-summary-wrap { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 20px 48px 40px; }
.read-summary {
  width: 100%; max-width: 760px;
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  background: var(--surface);
  padding: 26px 30px;
  box-shadow: 0 24px 70px rgba(0,0,0,0.4);
}
.rs-models {
  display: flex; align-items: center; gap: 16px;
  padding-bottom: 18px; margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  font-family: var(--mono); font-size: 11.5px; color: var(--text-2);
}
.rs-model { display: inline-flex; align-items: center; gap: 7px; }
.rs-model .ai-mark { width: 18px; height: 18px; }
.rs-model .ai-mark.ring::before { width: 13px; height: 13px; border-width: 2px; }
.rs-model .ai-mark.triangle::before { border-left-width: 8px; border-right-width: 8px; border-bottom-width: 14px; }
.rs-model .ai-mark.diamond::before { width: 11px; height: 11px; }
.rs-agree {
  margin-left: auto; display: inline-flex; align-items: center; gap: 5px;
  color: var(--green); font-weight: 600;
}
.rs-main { display: flex; gap: 30px; align-items: flex-start; }
.rs-left { flex: 1; }
.rs-label { font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; color: var(--text-4); margin-bottom: 5px; }
.rs-script { font-size: 30px; font-weight: 700; letter-spacing: -0.03em; color: var(--text); }
.rs-by { font-size: 13.5px; color: var(--text-2); margin-top: 2px; }
.rs-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 20px; }
.rs-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 11px; border-radius: 999px;
  border: 1px solid var(--border); background: rgba(255,255,255,0.03);
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.04em; color: var(--text-2);
}
.rs-chip.amber { color: var(--accent); border-color: var(--accent-dim); background: var(--accent-soft); }
.rs-cast .rs-cast-names { font-size: 14px; color: var(--text); font-weight: 500; }
.rs-stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  flex: none; width: 240px;
}
.rs-stat {
  padding: 14px; border-radius: 12px;
  border: 1px solid var(--border); background: rgba(255,255,255,0.025);
  text-align: center;
}
.rs-stat .rsv { font-size: 26px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.rs-stat .rsl { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.06em; color: var(--text-4); margin-top: 3px; }
.rs-next {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin-top: 22px; padding-top: 18px;
  border-top: 1px solid var(--border);
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.03em; color: var(--text-2);
}
.rs-next-wait {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.03em; color: var(--text-3);
}
.rs-next-spin {
  width: 13px; height: 13px; border-radius: 50%; flex: none;
  border: 2px solid var(--border-strong); border-top-color: var(--accent);
  animation: spin360 0.8s linear infinite;
}
.prep-bar-wrap {
  width: 100%;
  max-width: 640px;
}
.prep-bar-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 14px;
}
.prep-bar-phase {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.06em;
}
.prep-bar-pct {
  font-family: var(--mono);
  font-size: 28px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.prep-bar-pct .pct-mark {
  font-size: 16px;
  color: var(--text-3);
  margin-left: 2px;
}
.prep-bar-track {
  position: relative;
  height: 4px;
  background: rgba(255,255,255,0.07);
  border-radius: 100px;
  overflow: visible;
}
.prep-bar-fill {
  position: absolute;
  inset: 0;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-dim) 0%, var(--accent) 100%);
  border-radius: 100px;
  box-shadow: 0 0 18px rgba(232,184,106,0.45);
  transition: width 0.15s linear;
}
.prep-bar-head {
  position: absolute;
  right: -3px;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ffe5b0;
  box-shadow: 0 0 14px var(--accent), 0 0 28px rgba(232,184,106,0.5);
  animation: prep-head-pulse 1.2s ease-in-out infinite;
}
@keyframes prep-head-pulse {
  0%, 100% { transform: translateY(-50%) scale(1); }
  50%      { transform: translateY(-50%) scale(1.3); }
}
.prep-tick {
  position: absolute;
  top: 50%;
  width: 2px;
  height: 12px;
  margin-left: -1px;
  background: rgba(255,255,255,0.18);
  transform: translateY(-50%);
  border-radius: 1px;
  transition: background 0.3s ease;
}
.prep-tick.on { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.prep-bar-foot {
  display: flex;
  justify-content: space-between;
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-3);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ───── HOME ───── */
.home {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
  position: relative;
  padding: 24px 40px 40px;
}
.home .glow {
  position: absolute;
  left: 50%; top: 44%;
  transform: translate(-50%, -50%);
  width: 780px; height: 780px;
  background: radial-gradient(circle, rgba(232,184,106,0.16) 0%, transparent 55%);
  pointer-events: none;
  animation: glow-pulse 8s ease-in-out infinite alternate;
}
@keyframes glow-pulse {
  from { opacity: 0.55; transform: translate(-50%, -50%) scale(0.92); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1.08); }
}

/* ─── Home top bar (only Recent toggle in corner) ─── */
.home-top {
  width: 100%;
  display: flex; justify-content: space-between; align-items: center;
  z-index: 5;
  position: relative;
}
.home-brand-mini {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}
.home-brand-mini .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}
.recent-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 9px 14px 9px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  transition-property: background-color, border-color, color, box-shadow, transform, opacity; transition-duration: .15s;
}
.recent-toggle:hover { background: var(--surface-2); color: var(--text); border-color: var(--border-strong); }
.recent-toggle .count-pill {
  font-family: var(--mono);
  font-size: 10.5px;
  background: var(--surface-2);
  padding: 2px 7px;
  border-radius: 100px;
  color: var(--accent);
}

/* ─── Center hero animation ─── */
.home-stage {
  flex: 1;
  width: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  position: relative;
  z-index: 2;
  gap: 40px;
}

/* AI wave hero — single flowing animation */
.wave-hero {
  width: 100%;
  max-width: 880px;
  height: 280px;
  position: relative;
  display: flex; align-items: center; justify-content: center;
}
.wave-hero canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.wave-hero .wave-core {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 24px var(--accent), 0 0 60px rgba(232,184,106,0.4);
  z-index: 2;
  animation: core-pulse-big 2.2s ease-in-out infinite;
}
@keyframes core-pulse-big {
  0%, 100% { transform: translate(-50%, -50%) scale(0.85); opacity: 0.9; }
  50% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
}
.wave-hero .ripple {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  z-index: 1;
  animation: ripple-out 3s ease-out infinite;
  pointer-events: none;
}
.wave-hero .ripple.r2 { animation-delay: 1s; }
.wave-hero .ripple.r3 { animation-delay: 2s; }
@keyframes ripple-out {
  0% { width: 18px; height: 18px; opacity: 0.9; }
  100% { width: 200px; height: 200px; opacity: 0; }
}

/* AI status under wave */
.wave-status {
  display: flex; align-items: center; gap: 10px;
  margin-top: 24px;
  padding: 8px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-2);
  letter-spacing: 0.04em;
}
.wave-status .status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.4s ease-in-out infinite;
}
.wave-status .status-text { color: var(--accent); font-weight: 600; }

/* Promise text under hero */
.home-promise {
  text-align: center;
  z-index: 2;
  max-width: 640px;
}
.home-promise .name {
  font-size: 52px;
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1;
  margin: 0 0 14px;
  background: linear-gradient(180deg, #fff 0%, rgba(255,255,255,0.72) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.home-promise .tagline {
  font-size: 17px;
  color: var(--text-2);
  letter-spacing: -0.01em;
  line-height: 1.5;
  margin: 0;
  max-width: 540px;
  margin: 0 auto;
}
.home-promise .tagline strong { color: var(--accent); font-weight: 500; }

/* Bottom CTAs */
.home-actions {
  display: flex; gap: 12px;
  align-items: center;
  z-index: 2;
}
.home-actions .btn-pri { width: auto; min-width: 240px; padding: 16px 28px; }
.home-actions .btn-sec { width: auto; padding: 14px 22px; }

/* ─── Recent panel (slide-out drawer) ─── */
.recent-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 40;
  animation: fadeIn 0.2s ease;
}
.recent-drawer {
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 400px;
  background: var(--surface);
  border-left: 1px solid var(--border);
  z-index: 41;
  display: flex; flex-direction: column;
  animation: drawer-in 0.32s cubic-bezier(0.32, 0.72, 0, 1);
  box-shadow: -20px 0 40px rgba(0,0,0,0.4);
}
@keyframes drawer-in {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}
.recent-drawer .drawer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 24px 24px 16px;
}
.recent-drawer .drawer-header h2 {
  font-size: 22px; font-weight: 700; letter-spacing: -0.025em;
  margin: 0;
}
.recent-drawer .close-x {
  width: 32px; height: 32px;
  background: var(--surface-2);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-2);
}
.recent-drawer .close-x:hover { color: var(--text); background: var(--surface-3); }
.recent-drawer .recent-list { padding: 0 16px 24px; gap: 8px; }

.recent-list { display: flex; flex-direction: column; gap: 10px; }
.recent-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  transition-property: background-color, border-color, color, box-shadow, transform, opacity; transition-duration: .15s;
}
.recent-item:hover { background: var(--surface-2); border-color: var(--border-strong); }
.recent-item .thumb {
  width: 44px; height: 44px;
  border-radius: 10px;
  flex-shrink: 0;
  background-size: cover;
  display: flex; align-items: center; justify-content: center;
  position: relative;
  overflow: hidden;
}
.recent-item .thumb-grad {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,0.4));
}
.recent-item .info { flex: 1; min-width: 0; }
.recent-item .name {
  font-size: 15.5px; font-weight: 600;
  letter-spacing: -0.015em;
}
.recent-item .meta {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 2px;
}
.recent-item .progress-pill {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-2);
  padding: 4px 8px;
  background: var(--surface-2);
  border-radius: 100px;
  border: 1px solid var(--border);
}
.recent-item .progress-pill.done { color: var(--green); border-color: rgba(111,174,127,0.3); background: rgba(111,174,127,0.1); }

/* ───── Buttons (iPad-friendly) ───── */
.btn-pri {
  background: var(--accent);
  color: #1a1108;
  font-size: 17px;
  font-weight: 600;
  padding: 16px 24px;
  border-radius: 14px;
  letter-spacing: -0.015em;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform 0.1s, opacity 0.15s, background 0.15s;
  width: 100%;
}
.btn-pri:hover { background: var(--accent-hover); }
.btn-pri:active { transform: scale(0.98); }
.btn-pri:disabled { opacity: 0.35; cursor: not-allowed; }

.btn-sec {
  background: var(--surface-2);
  color: var(--text);
  font-size: 16px;
  font-weight: 500;
  padding: 14px 22px;
  border-radius: 14px;
  letter-spacing: -0.01em;
  border: 1px solid var(--border);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%;
}
.btn-sec:hover { background: var(--surface-3); }
.btn-sec:active { transform: scale(0.98); }

.btn-ghost {
  background: transparent;
  color: var(--accent);
  font-size: 16px;
  font-weight: 500;
  padding: 12px 18px;
}
.btn-ghost:hover { color: var(--accent-hover); }

/* ───── Navbar ───── */
.navbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px;
  height: 64px;
  flex-shrink: 0;
}
.nav-back {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--accent);
  font-size: 16px; font-weight: 500;
  padding: 8px 0;
}
.nav-title {
  font-size: 18px; font-weight: 600;
  letter-spacing: -0.015em;
  position: absolute; left: 50%; transform: translateX(-50%);
}
/* Compose navbar: format + path inline with the back button row */
.compose-nav-meta {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 11.5px; font-weight: 400;
  color: var(--text-3); letter-spacing: 0.03em; white-space: nowrap;
}
.compose-nav-meta .fmt-badge {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--accent); font-weight: 600;
  padding: 4px 10px; background: var(--accent-soft);
  border: 1px solid var(--accent-dim); border-radius: 100px;
}
.compose-nav-meta .fmt-dot { color: var(--text-4); }
.compose-nav-meta .fmt-path { color: var(--text-3); text-transform: uppercase; }
.nav-right {
  color: var(--accent);
  font-size: 16px; font-weight: 600;
}
.nav-right:disabled { color: var(--text-4); cursor: not-allowed; }

/* ───── Sheet/modal ───── */
.sheet-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 30;
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn 0.2s ease;
  padding: 40px;
}
.sheet-card {
  width: 720px;
  background: var(--surface);
  border-radius: 24px;
  border: 1px solid var(--border);
  padding: 32px 36px 36px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
  animation: scaleIn 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.sheet-card .sheet-title {
  font-size: 28px; font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 6px;
}
.sheet-card .sheet-sub {
  font-size: 15px;
  color: var(--text-2);
  line-height: 1.45;
  margin-bottom: 24px;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.94); }
  to { opacity: 1; transform: scale(1); }
}

/* ───── Choice cards (3 across in landscape) ───── */
.choice-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.choice-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px 20px;
  cursor: pointer;
  transition-property: background-color, border-color, color, box-shadow, transform, opacity; transition-duration: .15s;
  display: flex; flex-direction: column; gap: 14px;
  text-align: left;
}
.choice-card:hover { background: var(--surface-3); border-color: var(--border-strong); transform: translateY(-2px); }
.choice-card:active { transform: scale(0.98); }
.choice-card.featured { background: var(--accent-soft); border-color: var(--accent-dim); }
.choice-card .icon-wrap {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
}
.choice-card.featured .icon-wrap {
  background: var(--accent);
  color: #1a1108;
}
.choice-card .title {
  font-size: 17px; font-weight: 600;
  letter-spacing: -0.015em;
}
.choice-card .sub {
  font-size: 13.5px;
  color: var(--text-2);
  line-height: 1.45;
}

/* ───── Paste text screen ───── */
.paste-layout {
  flex: 1;
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 20px;
  padding: 0 32px 24px;
  min-height: 0;
}
.paste-textarea-wrap {
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
}
.paste-textarea-wrap textarea {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 15.5px;
  line-height: 1.65;
  padding: 20px 22px;
  font-family: var(--sf);
  resize: none;
  outline: none;
  letter-spacing: -0.005em;
}
.paste-textarea-wrap textarea::placeholder { color: var(--text-4); }
.paste-textarea-wrap .toolbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-3);
}

.paste-side {
  display: flex; flex-direction: column; gap: 12px;
}
.paste-side .info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 20px;
}
.paste-side .info-card h4 {
  margin: 0 0 8px;
  font-size: 11.5px;
  color: var(--text-3);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 600;
  display: flex; align-items: center; gap: 6px;
}
.paste-side .info-card p {
  margin: 0;
  font-size: 14px;
  color: var(--text);
  line-height: 1.5;
}
.paste-side .info-card .small {
  font-size: 12.5px;
  color: var(--text-2);
}

.paste-footer {
  padding: 0 32px 24px;
  display: flex; gap: 12px; align-items: center;
}
.paste-footer .btn-pri { width: auto; min-width: 220px; }

/* ═══════════════════════════════════════════════════════════ */
/* ANALYSIS SHOW — landscape stage */
/* ═══════════════════════════════════════════════════════════ */
.analyze {
  background: var(--bg);
  overflow: hidden;
  position: relative;
}
.ana-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 25% 50%, rgba(232,184,106,0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 75% 50%, rgba(111,177,214,0.06) 0%, transparent 55%);
  pointer-events: none;
}
.orbit-bg {
  position: absolute;
  left: 22%; top: 50%;
  transform: translate(-50%, -50%);
  width: 720px; height: 720px;
  pointer-events: none;
  z-index: 0;
}
.orbit-bg .ring {
  position: absolute; inset: 0;
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 50%;
}
.orbit-bg .ring-a { animation: orbit-rot 60s linear infinite; }
.orbit-bg .ring-b { inset: 80px; animation: orbit-rot 90s linear infinite reverse; }
.orbit-bg .ring-c { inset: 160px; animation: orbit-rot 120s linear infinite; }
.orbit-bg .ring-d { inset: 240px; border-color: rgba(232,184,106,0.1); animation: orbit-rot 50s linear infinite reverse; }
.orbit-bg .ring::before {
  content: ''; position: absolute;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  top: 50%; left: -3px;
  box-shadow: 0 0 14px var(--accent);
}
.orbit-bg .ring-b::before { background: var(--cyan); box-shadow: 0 0 14px var(--cyan); }
.orbit-bg .ring-c::before { background: var(--crimson); box-shadow: 0 0 14px var(--crimson); }
.orbit-bg .ring-d::before { background: var(--accent); box-shadow: 0 0 14px var(--accent); }

/* Single-column analyze layout (clean — wireframe behind + global progress on top) */
.analyze-single {
  position: relative;
  z-index: 2;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 130px 56px 32px;  /* top padding leaves room for the progress chip */
}
.analyze-single .ana-stage-card {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 30px 36px 22px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  box-shadow: var(--shadow-3);
}
.analyze-single .stage-status {
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 20px;
  line-height: 1.5;
}
.analyze-single .stage-clock {
  margin-top: auto;
  padding-top: 16px;
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-3);
  letter-spacing: 0.04em;
  border-top: 1px solid var(--border);
}

.analyze-grid {
  position: relative;
  z-index: 2;
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 0;
  min-height: 0;
}

/* Left — AI core panel */
.ana-left {
  padding: 40px 40px 40px 56px;
  display: flex; flex-direction: column; justify-content: space-between;
  position: relative;
}
.ana-pill-top {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--text-2);
  font-family: var(--mono);
  width: fit-content;
}
.ana-pill-top .pulse-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity:1; transform: scale(1); } 50% { opacity:0.4; transform: scale(0.8); } }

.ana-core {
  display: flex; flex-direction: column; align-items: center;
  margin: 24px 0;
}
.ana-core-mark {
  width: 220px; height: 220px;
  position: relative;
}
.ana-core-mark svg { width: 100%; height: 100%; }
.ana-core-mark .ring {
  stroke: var(--accent); stroke-width: 1.3; fill: none;
  transform-origin: center;
}
.ana-core-mark .ring-1 { animation: ring-spin 16s linear infinite; opacity: 0.9; }
.ana-core-mark .ring-2 { animation: ring-spin 22s linear infinite reverse; opacity: 0.6; }
.ana-core-mark .ring-3 { animation: ring-spin 32s linear infinite; opacity: 0.4; }

.ana-headline {
  font-size: 36px; font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.1;
  margin: 28px 0 10px;
  max-width: 440px;
}
.ana-headline em {
  font-style: normal;
  color: var(--accent);
}
.ana-status {
  font-size: 15px;
  color: var(--text-2);
  line-height: 1.5;
  max-width: 420px;
  min-height: 48px;
}

.ana-progress {
  margin-top: 32px;
  max-width: 440px;
}
.ana-progress .segs {
  display: flex; gap: 5px;
  margin-bottom: 10px;
}
.ana-progress .seg {
  flex: 1; height: 3px;
  background: var(--surface-2);
  border-radius: 2px;
  overflow: hidden;
}
.ana-progress .seg .fill {
  height: 100%;
  background: var(--accent);
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 5.5s linear;
}
.ana-progress .seg.done .fill { transform: scaleX(1); transition: none; }
.ana-progress .seg.active .fill { transform: scaleX(1); }
.ana-progress .seg-labels {
  display: flex; justify-content: space-between;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-3);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.ana-progress .seg-labels span { flex: 1; text-align: center; }
.ana-progress .seg-labels span.active { color: var(--accent); }

/* Right — stage diagram */
.ana-right {
  padding: 32px 56px 40px 0;
  display: flex; flex-direction: column;
  min-height: 0;
}
.ana-stage-card {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 28px 32px;
  position: relative;
  overflow: hidden;
  display: flex; flex-direction: column;
}
.ana-stage-card .stage-eyebrow {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.05em;
}
.ana-stage-card .stage-headline {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 6px 0 24px;
}

/* Stage A — reading */
.stage-reading-grid {
  flex: 1;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 32px;
  align-items: stretch;
  min-height: 0;
}
.reading-counter {
  display: flex; flex-direction: column; align-items: flex-start;
  padding-top: 20px;
}
.reading-counter .label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-3);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 600;
}
.reading-counter .num {
  font-size: 84px;
  font-weight: 700;
  letter-spacing: -0.05em;
  color: var(--accent);
  line-height: 0.95;
  margin: 12px 0;
  font-variant-numeric: tabular-nums;
}
.reading-counter .of {
  font-size: 14px;
  color: var(--text-2);
}
.reading-counter .stat-row {
  margin-top: 24px;
  display: flex; flex-direction: column; gap: 12px;
  font-size: 13px;
  color: var(--text-2);
}
.reading-counter .stat-row .stat-item {
  display: flex; justify-content: space-between;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}
.reading-counter .stat-row .stat-item .v {
  color: var(--text);
  font-family: var(--mono);
  font-size: 12.5px;
}
.line-stream {
  display: flex; flex-direction: column; gap: 6px;
  overflow: hidden;
  padding: 8px 0;
  mask-image: linear-gradient(180deg, transparent 0%, #000 18%, #000 82%, transparent 100%);
}
.line-stream .line {
  height: 7px; border-radius: 3.5px;
  background: var(--surface-3);
  animation: line-in 0.5s ease both;
  opacity: 0.7;
  flex-shrink: 0;
}
.line-stream .line.amber { background: var(--accent-dim); opacity: 0.9; }
.line-stream .line.head { background: rgba(255,255,255,0.15); height: 10px; opacity: 1; }
@keyframes line-in {
  from { transform: translateX(-20%); opacity: 0; }
  to { opacity: 0.7; }
}

/* Stage B — bars */
.stage-bars-grid {
  flex: 1;
  display: flex; flex-direction: column;
  justify-content: center;
  gap: 18px;
}
.bar-row {
  display: grid;
  grid-template-columns: 130px 1fr 48px;
  align-items: center;
  gap: 16px;
  font-size: 14px;
  padding: 8px 12px;
  border-radius: 10px;
  background: transparent;
  opacity: 0.55;
  color: var(--text-3);
  transition-property: background-color, border-color, color, box-shadow, transform, opacity; transition-duration: .35s; transition-timing-function: cubic-bezier(.2,.8,.2,1);
}
.bar-row.done {
  opacity: 1;
  color: var(--text-2);
}
.bar-row.active {
  opacity: 1;
  color: var(--text);
  background: var(--surface-3);
  box-shadow: 0 0 0 1px var(--accent), 0 12px 26px rgba(232,184,106,0.18), var(--shadow-1);
  transform: translateX(4px);
}
.bar-row .name { font-weight: 600; letter-spacing: -0.01em; }
.bar-row .bar-track {
  height: 12px;
  background: var(--surface-2);
  border-radius: 6px;
  overflow: hidden;
}
.bar-row .bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent));
  border-radius: 6px;
  transform-origin: left;
  width: 0%;
  transition: width 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.bar-row .bar-fill.cyan { background: linear-gradient(90deg, #3f6e8a, var(--cyan)); }
.bar-row.active .bar-fill {
  box-shadow: 0 0 14px rgba(232,184,106,0.45);
}
.bar-row .pct {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-3);
  text-align: right;
  font-weight: 500;
  transition: color .35s ease, font-size .35s ease;
}
.bar-row.done .pct { color: var(--text); }
.bar-row.active .pct { color: var(--accent); font-size: 14px; }
@keyframes bar-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* Stage C — radar */
.stage-radar {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 24px;
  align-items: center;
}
.stage-radar .radar-svg-wrap {
  display: flex; align-items: center; justify-content: center;
}
.stage-radar svg { width: 320px; height: 320px; overflow: visible; }  /* 축 라벨이 viewBox를 살짝 넘어도 잘리지 않게 */
.radar-axis { stroke: var(--border); stroke-width: 1; fill: none; }
.radar-shape {
  fill: var(--accent);
  fill-opacity: 0.22;
  stroke: var(--accent);
  stroke-width: 1.8;
  stroke-linejoin: round;
  animation: radar-draw 1.4s ease-out both;
}
@keyframes radar-draw {
  from { stroke-dasharray: 0 1200; opacity: 0; }
  to { stroke-dasharray: 1200 0; opacity: 1; }
}
.radar-label {
  font-family: var(--sf);
  font-size: 12px;
  fill: var(--text-3);
  font-weight: 500;
  transition: fill .35s ease, font-size .35s ease;
}
.radar-label.active {
  fill: var(--accent);
  font-weight: 700;
  font-size: 14px;
}
.radar-vertex {
  fill: var(--accent);
  r: 4;
  animation: vertex-pop 0.5s ease both;
}
.radar-vertex.active {
  r: 6;
  filter: drop-shadow(0 0 8px var(--accent));
  animation: vertex-pop 0.4s ease both, radar-vertex-pulse 1.1s ease-in-out infinite 0.4s;
}
@keyframes radar-vertex-pulse {
  0%,100% { r: 6; }
  50%     { r: 8; }
}
@keyframes vertex-pop { from { r: 0; } to { r: 4; } }

.tone-list {
  display: flex; flex-direction: column; gap: 8px;
}
.tone-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 13px;
  color: var(--text-3);
  opacity: 0.55;
  transition-property: background-color, border-color, color, box-shadow, transform, opacity; transition-duration: .35s; transition-timing-function: cubic-bezier(.2,.8,.2,1);
  animation: char-in 0.4s ease both;
}
.tone-item.done {
  opacity: 1;
  color: var(--text-2);
  background: var(--surface-2);
}
.tone-item.active {
  opacity: 1;
  color: var(--text);
  background: var(--surface-4);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 12px 26px rgba(232,184,106,0.22), var(--shadow-1);
  transform: translateX(4px);
}
.tone-item .v {
  font-family: var(--mono);
  color: var(--text-3);
  font-size: 13.5px;
  font-weight: 600;
  transition: color .35s ease;
}
.tone-item.done .v { color: var(--accent); }
.tone-item.active .v {
  color: var(--accent);
  font-size: 15px;
  text-shadow: 0 0 12px rgba(232,184,106,0.5);
}

/* Stage D — characters */
.stage-chars-grid {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-content: start;
}
.char-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  opacity: 0.55;
  color: var(--text-3);
  transition-property: background-color, border-color, color, box-shadow, transform, opacity; transition-duration: .35s; transition-timing-function: cubic-bezier(.2,.8,.2,1);
  animation: char-in 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.char-row.done {
  opacity: 1;
  color: var(--text-2);
  background: var(--surface-2);
}
.char-row.active {
  opacity: 1;
  color: var(--text);
  background: var(--surface-4);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 14px 30px rgba(232,184,106,0.22), var(--shadow-2);
  transform: translateX(4px) scale(1.02);
}
.char-row .silhouette {
  width: 44px; height: 44px;
  background: var(--surface-3);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  color: var(--accent);
  font-weight: 700;
  flex-shrink: 0;
}
.char-row .nm-block { flex: 1; min-width: 0; }
.char-row .nm { font-size: 14.5px; font-weight: 600; letter-spacing: -0.01em; }
.char-row .role { font-size: 12px; color: var(--text-2); margin-top: 1px; }
.char-row .mention {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-3);
}
@keyframes char-in {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Stage E — references */
.stage-refs-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  align-content: start;
}
.ref-thumb {
  aspect-ratio: 2/3;
  border-radius: 10px;
  position: relative;
  overflow: hidden;
  opacity: 0.35;
  filter: saturate(0.5);
  transition-property: background-color, border-color, color, box-shadow, transform, opacity, filter; transition-duration: .4s; transition-timing-function: cubic-bezier(.2,.8,.2,1);
  animation: ref-drop 0.55s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.ref-thumb.done {
  opacity: 0.85;
  filter: saturate(1);
}
.ref-thumb.active {
  opacity: 1;
  filter: saturate(1.15);
  transform: translateY(-4px) scale(1.04);
  box-shadow: 0 0 0 1.5px var(--accent), 0 18px 36px rgba(232,184,106,0.25), 0 0 60px rgba(232,184,106,0.18);
  z-index: 2;
}
.ref-thumb .grad-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,0.85));
}
.ref-thumb .match-pill {
  position: absolute;
  top: 6px; right: 6px;
  background: rgba(0,0,0,0.55);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 10px;
  padding: 3px 7px;
  border-radius: 100px;
  backdrop-filter: blur(8px);
  font-weight: 600;
}
.ref-thumb .title-mini {
  position: absolute;
  bottom: 8px; left: 10px; right: 10px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: -0.015em;
  z-index: 2;
  color: #fff;
}
@keyframes ref-drop {
  from { opacity: 0; transform: translateY(-14px) scale(0.92); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ═══════════════════════════════════════════════════════════ */
/* RESULTS / PICKER */
/* ═══════════════════════════════════════════════════════════ */
.results-screen {
  overflow-y: auto;
}
.results-hero {
  padding: 4px 40px 24px;
}
.results-hero .eyebrow {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--accent);
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}
.results-hero h1 {
  font-size: 38px; font-weight: 700;
  letter-spacing: -0.035em;
  margin: 0 0 10px;
}
.results-hero .sub {
  font-size: 16px;
  color: var(--text-2);
  letter-spacing: -0.005em;
  line-height: 1.45;
  max-width: 720px;
}
.tag-pill {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--surface-2);
  color: var(--text);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  margin-right: 6px;
  margin-top: 12px;
  border: 1px solid var(--border);
}
.tag-pill.amber { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-dim); }
.tag-pill.cyan { background: rgba(111,177,214,0.12); color: var(--cyan); border-color: rgba(111,177,214,0.3); }

.section-bar {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 16px 40px 12px;
}
.section-bar h2 {
  font-size: 22px; font-weight: 700;
  letter-spacing: -0.025em;
  margin: 0;
}
.section-bar .count {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-3);
}

.pick-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  padding: 0 40px 24px;
}
.movie-card-ipad {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  transform-origin: center;
  transition: transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1),
              border-color 0.15s ease, box-shadow 0.22s ease, opacity 0.22s ease;
}
/* Idle hover lift (only when nothing is in a selected/receded state) */
.movie-card-ipad:not(.selected):not(.recede):hover { border-color: var(--border-strong); transform: translateY(-2px); }
/* Selected — grow ~4% */
.movie-card-ipad.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); transform: scale(1.02); }
.movie-card-ipad.selected:hover { transform: scale(1.02) translateY(-2px); }
/* Unselected while a selection exists — shrink ~10% */
.movie-card-ipad.recede { transform: scale(0.90); }
.movie-card-ipad.recede:hover { border-color: var(--border-strong); transform: scale(0.92) translateY(-2px); }
.movie-card-ipad.disabled { opacity: 0.32; cursor: not-allowed; pointer-events: none; }
.movie-card-ipad .poster {
  aspect-ratio: 2/3;
  position: relative;
}
.movie-card-ipad .poster .grad {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 38%, rgba(0,0,0,0.85));
}
.movie-card-ipad .poster .palette-row {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  display: flex; gap: 4px;
}
.movie-card-ipad .poster .swatch {
  width: 16px; height: 16px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.15);
}
.movie-card-ipad .poster .year-pill {
  position: absolute; top: 8px; right: 8px;
  font-family: var(--mono);
  font-size: 10px;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(6px);
  padding: 2px 7px;
  border-radius: 4px;
}
.movie-card-ipad .poster .title-mini {
  position: absolute; bottom: 10px; left: 12px; right: 12px;
  font-size: 13px; font-weight: 600;
  letter-spacing: -0.015em;
  z-index: 2;
}
.movie-card-ipad .info {
  padding: 10px 12px;
  display: flex; align-items: center; justify-content: space-between;
}
.movie-card-ipad .info .genres {
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--text-3);
}
.movie-card-ipad .info .match {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--accent);
  font-weight: 600;
}
.movie-card-ipad .selected-num {
  position: absolute;
  top: 10px; left: 10px;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: #1a1108;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
  z-index: 3;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

/* sticky footer cta */
.cta-bar {
  display: flex; gap: 12px;
  padding: 14px 40px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg);
  flex-shrink: 0;
}
.cta-bar .info {
  flex: 1;
  display: flex; flex-direction: column;
}
.cta-bar .info .lbl {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-3);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.cta-bar .info .v {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin-top: 2px;
}
.cta-bar .btn-pri { width: auto; }
.cta-bar .btn-sec { width: auto; }

/* Stat cards row (results screen) */
.stat-cards-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 0 40px;
}
.stat-card-ipad {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
}
.stat-card-ipad .lbl {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-3);
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  display: flex; align-items: center; gap: 6px;
}
.stat-card-ipad .v {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--accent);
}
.stat-card-ipad .sub {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 4px;
}

/* Movie horizontal row */
.movie-row {
  display: flex;
  gap: 12px;
  padding: 0 40px 24px;
  overflow-x: auto;
  scrollbar-width: thin;
}
.movie-row .movie-card-ipad {
  flex: 0 0 158px;
  width: 158px;
}
.movie-card-ipad .mv-why {
  padding: 0 12px 12px;
  font-size: 11px;
  color: var(--text-2);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* M3 — Results match list (mixed reference types + reasoning) */
.match-list { padding: 0 40px 24px; display: flex; flex-direction: column; gap: 6px; }
.match-row {
  display: grid;
  grid-template-columns: 30px 34px 1fr 120px 46px;
  align-items: center; gap: 14px;
  padding: 12px 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  transition-property: background-color, border-color, color, box-shadow, transform, opacity; transition-duration: .15s;
}
.match-row:hover { background: var(--surface-2); border-color: var(--border-strong); }
.match-row .mr-rank { font-family: var(--mono); font-size: 12px; color: var(--text-3); }
.match-row .mr-type {
  width: 34px; height: 34px; border-radius: 9px; background: var(--accent-soft);
  display: flex; align-items: center; justify-content: center;
}
/* 포스터 썸네일 변형 — 아이콘(15px)의 2배 크기, 포스터 비율(2:3) 유지 */
.match-row .mr-type-poster { width: 34px; height: 51px; background: none; }
.match-row .mr-thumb {
  width: 34px; height: 51px; object-fit: cover; display: block;
  border-radius: 6px; border: 1px solid var(--border-strong);
}
.match-row .mr-title { font-size: 15px; font-weight: 600; letter-spacing: -0.015em; display: flex; align-items: center; gap: 8px; }
.match-row .mr-tpill {
  font-family: var(--mono); font-size: 9px; font-weight: 600; color: var(--accent);
  background: var(--accent-soft); border: 1px solid var(--accent-dim);
  padding: 2px 6px; border-radius: 4px; letter-spacing: 0.05em;
}
.match-row .mr-year { font-family: var(--mono); font-size: 11px; color: var(--text-3); }
.match-row .mr-why { font-size: 12.5px; color: var(--text-2); margin-top: 3px; line-height: 1.35; }
.match-row .mr-bar { height: 5px; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.match-row .mr-bar-fill { height: 100%; background: linear-gradient(90deg, var(--accent-dim), var(--accent)); border-radius: 3px; }
.match-row .mr-pct { font-family: var(--mono); font-size: 13px; font-weight: 600; color: var(--accent); text-align: right; }

/* Filter chips */
.filter-chip {
  font-size: 12.5px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 100px;
  color: var(--text-2);
  background: transparent;
  border: 1px solid transparent;
}
.filter-chip:hover { color: var(--text); background: var(--surface-2); }
.filter-chip[data-active="true"] {
  background: var(--text);
  color: var(--bg);
  font-weight: 600;
}

/* ───── Donut influence screen ───── */
.donut-screen {
  overflow: hidden;
  display: flex; flex-direction: column;
}

/* Centered donut + radial labels (no right-side legend) */
.donut-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 24px 0;
  min-height: 0;
}
.donut-wrapper-wide {
  width: 100%;
  max-width: 880px;
  aspect-ratio: 760 / 520;
}
.donut-wrapper-wide svg { width: 100%; height: 100%; display: block; }

.lead-title {
  font-family: var(--sf);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.lead-meta {
  font-family: var(--mono);
  font-size: 11px;
  fill: rgba(255,255,255,0.55);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.donut-center-eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  fill: rgba(255,255,255,0.4);
  letter-spacing: 0.1em;
}
.donut-center-value {
  font-family: var(--sf);
  font-size: 32px;
  font-weight: 700;
  fill: #fff;
  letter-spacing: -0.025em;
}
.donut-center-pcts {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.donut-grid {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 40px;
  padding: 8px 40px 24px;
  align-items: center;
}
.donut-wrapper {
  position: relative;
  width: 340px; height: 340px;
  margin: 0 auto;
}
.donut-wrapper svg { width: 100%; height: 100%; }
.donut-wrapper .center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  pointer-events: none;
  gap: 2px;
}
.donut-wrapper .center .label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--text-3);
  text-transform: uppercase;
}
.donut-wrapper .center .value {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text);
}
.donut-wrapper .center .sub-pcts {
  display: flex;
  gap: 10px;
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.handle { cursor: grab; }
.handle:active { cursor: grabbing; }

.legend-list { display: flex; flex-direction: column; gap: 10px; }
.legend-pill {
  display: grid;
  grid-template-columns: 36px 1fr auto auto;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
}
.legend-pill .sw {
  width: 32px; height: 32px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #1a1108;
}
.legend-pill .nm { font-size: 16px; font-weight: 600; letter-spacing: -0.015em; }
.legend-pill .nm small { display: block; font-size: 12px; font-weight: 400; color: var(--text-2); margin-top: 1px; }
.legend-pill .pct {
  font-size: 24px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.02em;
  min-width: 60px; text-align: right;
}
.legend-pill .nudge {
  display: flex; flex-direction: column; gap: 3px;
}
.legend-pill .nudge button {
  width: 26px; height: 18px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-2);
  border-radius: 4px;
  font-size: 10px;
}
.legend-pill .nudge button:hover { color: var(--accent); }

/* ───── Character preview ───── */
.char-preview {
  overflow-y: auto;
  padding: 8px 40px 24px;
}
.char-tabs-row {
  display: flex; gap: 6px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 20px;
  width: fit-content;
}
.char-tab {
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  display: inline-flex; align-items: center; gap: 8px;
}
.char-tab:hover { color: var(--text); border-color: var(--accent-dim); }
.char-tab.active { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.char-tab.active .pip { background: var(--accent); }
/* 미방문 탭 유도 — pip 깜빡임 + 테두리 글로 펄스. 선택하는 순간 unseen이 풀려 멈춘다 */
.char-tab.unseen .pip {
  background: var(--accent);
  animation: tab-pip-blink 0.55s ease-in-out infinite;
}
.char-tab.unseen { animation: tab-glow-pulse 1.1s ease-in-out infinite; }
.sample-file.unseen { animation: tab-glow-pulse 1.1s ease-in-out infinite; }
@keyframes tab-pip-blink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.3; transform: scale(1.6); }
}
@keyframes tab-glow-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(232,184,106,0); }
  50%      { box-shadow: 0 0 10px 1px rgba(232,184,106,0.35); border-color: var(--accent-dim); }
}
.char-tab .pip { width: 6px; height: 6px; border-radius: 50%; background: var(--text-4); }
.char-tab.has-avatar { position: relative; overflow: visible; padding-left: 74px; min-height: 58px; }
.char-tab-avatar-frame {
  position: absolute; left: 5px; bottom: 3px; width: 62px; height: 72px;
  overflow: hidden; pointer-events: none;
}
.char-tab-avatar {
  width: 100%; height: 100%; display: block;
  object-fit: cover; object-position: 50% 12%;
  transform: scale(1.2); transform-origin: 50% 32%;
  filter: drop-shadow(0 5px 8px rgba(0,0,0,.48));
}
.char-tab.active .char-tab-avatar { filter: drop-shadow(0 5px 9px rgba(232,184,106,.28)); }

.char-layout {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 16px;
}
.char-left, .char-right {
  display: flex; flex-direction: column; gap: 12px;
}
.char-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
}
.char-card h3 {
  margin: 0 0 14px;
  font-size: 11px;
  color: var(--text-3);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
  display: flex; align-items: center; gap: 6px;
}
.char-hero-row {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 16px;
}
.char-hero-row .nm {
  font-size: 30px; font-weight: 700;
  letter-spacing: -0.03em;
}
.char-hero-row .role { font-size: 14px; color: var(--text-2); }

.ortho-row-ipad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.ortho-frame {
  aspect-ratio: 2/3;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.ortho-frame .sil {
  position: absolute; left: 50%; bottom: 0;
  transform: translateX(-50%);
  width: 50%; height: 85%;
  background: rgba(0,0,0,0.4);
}
.ortho-frame .lbl {
  position: absolute; top: 8px; left: 10px;
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--text-3);
  letter-spacing: 0.05em;
  display: inline-flex; align-items: center; gap: 4px;
}
.ortho-frame .ph {
  position: absolute; bottom: 8px; left: 10px; right: 10px;
  font-family: var(--mono);
  font-size: 9px;
  color: var(--text-4);
}

/* ── Reference images (user adds → analyze → apply) ───────────── */
.ref-img-section { margin-bottom: 18px; }
.ref-img-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.ref-img-head h4 {
  margin: 0; font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em;
  color: var(--text-2); display: inline-flex; align-items: center; gap: 6px;
}
.ref-img-sub {
  font-family: var(--mono); font-size: 10.5px; color: var(--text-3);
  display: inline-flex; align-items: center; gap: 5px; text-align: right;
}
.ref-img-sub.applied { color: var(--green); }
.ref-img-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-img-tile {
  position: relative; width: 66px; height: 66px; border-radius: 9px;
  overflow: hidden; border: 1px solid var(--border); background: var(--surface-2);
}
.ref-img-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ref-img-x {
  position: absolute; top: 3px; right: 3px; width: 16px; height: 16px;
  border-radius: 5px; border: none; background: rgba(0,0,0,0.55);
  display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0;
}
.ref-img-x:hover { background: rgba(0,0,0,0.8); }
.ref-img-analyzing {
  position: absolute; inset: 0; background: rgba(10,10,13,0.66);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  font-family: var(--mono); font-size: 8.5px; color: var(--accent); letter-spacing: 0.03em;
}
.ria-spin {
  width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid rgba(232,184,106,0.3); border-top-color: var(--accent);
  animation: spin360 0.8s linear infinite;
}
.ref-img-colors { position: absolute; left: 0; right: 0; bottom: 0; height: 11px; display: flex; }
.ref-img-colors span { flex: 1; }
/* ── 3-model generated sheets ─────────────────────────────────── */
.ai-sheet-label {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; color: var(--text-3);
  display: inline-flex; align-items: center; gap: 6px; margin-bottom: 10px;
}
.ai-sheet-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.ai-sheet-card {
  border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface-2); overflow: hidden; transition: border-color 0.2s;
}
.ai-sheet-card.gen { border-color: var(--accent-dim); }
.ai-sheet-head {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 10px; border-bottom: 1px solid var(--border);
}
.ai-sheet-mark { width: 13px; height: 13px; flex: none; }
.ai-sheet-mark.ring { border-radius: 50%; }
.ai-sheet-mark.diamond { border-radius: 2px; transform: rotate(45deg); width: 11px; height: 11px; }
.ai-sheet-mark.triangle { clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.ai-sheet-id { flex: 1; min-width: 0; }
.ai-sheet-name {
  font-size: 12.5px; font-weight: 700; color: var(--text); letter-spacing: -0.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ai-sheet-tag { font-family: var(--mono); font-size: 8.5px; color: var(--text-3); letter-spacing: 0.04em; }
.ai-reroll {
  flex: none; width: 24px; height: 24px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
  display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0;
  transition: color 0.15s, border-color 0.15s;
}
.ai-reroll:hover { color: var(--accent); border-color: var(--accent-dim); }
.ai-reroll:disabled { opacity: 0.4; cursor: default; }
.ai-sheet-frame {
  position: relative; aspect-ratio: 1/1; background: var(--surface);
  padding: 10px; display: flex; flex-direction: column;
}
.sheet-grid {
  flex: 1; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 5px;
}
.sheet-pose {
  position: relative; background: rgba(0,0,0,0.18); border-radius: 7px;
  display: flex; align-items: flex-end; justify-content: center; overflow: hidden;
}
.sheet-pose .sil { width: 46%; height: 80%; opacity: 0.62; }
.pose-lbl {
  position: absolute; top: 4px; left: 6px;
  font-family: var(--mono); font-size: 7.5px; color: var(--text-4); letter-spacing: 0.04em;
}
.sheet-cap {
  margin-top: 8px; font-family: var(--mono); font-size: 8px; color: var(--text-4);
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.ref-guided { display: inline-flex; align-items: center; gap: 3px; color: var(--accent); }

.palette-strip {
  display: flex; gap: 6px;
}
.palette-strip .chip {
  flex: 1; height: 44px;
  border-radius: 10px;
  position: relative;
}
.palette-strip .chip .hex {
  position: absolute; bottom: 4px; left: 0; right: 0;
  text-align: center;
  font-family: var(--mono);
  font-size: 9px;
  color: rgba(0,0,0,0.7);
  font-weight: 600;
}

.influence-bars { display: flex; flex-direction: column; gap: 12px; }
.inf-bar {
  display: grid;
  grid-template-columns: 1fr 36px;
  gap: 8px;
  align-items: center;
}
.inf-bar .nm-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 13.5px; font-weight: 500;
}
.inf-bar .pct-sm {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  text-align: right;
  font-weight: 600;
}
.inf-bar .bar-track {
  grid-column: 1/3;
  height: 5px; background: var(--surface-2); border-radius: 3px; overflow: hidden;
}
.inf-bar .bar-fill { height: 100%; background: var(--accent); border-radius: 3px; }

.bio-text { font-size: 13.5px; color: var(--text); line-height: 1.6; }
.bio-text strong { color: var(--accent); font-weight: 600; }

/* ═══════════════════════════════════════════════════════════ */
/* M1 — Development path / structure stage                      */
/* ═══════════════════════════════════════════════════════════ */
.acts-wrap { padding: 0 40px 24px; }
.acts-ruler { display: flex; gap: 4px; margin-bottom: 14px; }
.act-seg {
  height: 30px; border-radius: 7px; position: relative;
  background: var(--surface-2); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
}
.act-seg:nth-child(1) { background: rgba(232,184,106,0.16); border-color: var(--accent-dim); }
.act-seg:nth-child(2) { background: rgba(111,177,214,0.12); border-color: rgba(111,177,214,0.3); }
.act-seg:nth-child(3) { background: rgba(227,106,92,0.12); border-color: rgba(227,106,92,0.3); }
.act-seg span { font-family: var(--mono); font-size: 11px; color: var(--text-2); }
.acts-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.act-col { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 18px 18px 16px; }
.act-head { padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px solid var(--border); }
.act-name { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.act-sub { font-size: 13px; color: var(--accent); font-weight: 500; margin-top: 1px; }
.act-pages { font-family: var(--mono); font-size: 11px; color: var(--text-3); margin-top: 6px; }
.act-beats { display: flex; flex-direction: column; gap: 11px; }
.beat-row { display: flex; align-items: flex-start; gap: 10px; font-size: 13.5px; color: var(--text); line-height: 1.4; }
.beat-row .beat-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-top: 6px; flex-shrink: 0; }

.season-wrap { padding: 0 40px 24px; }
.season-arc {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  padding: 18px 20px; margin-bottom: 14px;
}
.season-arc .sa-label {
  font-family: var(--mono); font-size: 11px; color: var(--text-3); letter-spacing: 0.05em;
  display: flex; align-items: center; gap: 6px; margin-bottom: 8px; text-transform: uppercase; font-weight: 600;
}
.season-arc p { margin: 0; font-size: 15px; color: var(--text); line-height: 1.5; max-width: 760px; }
.ep-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.ep-card {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px 14px;
  transition-property: background-color, border-color, color, box-shadow, transform, opacity; transition-duration: .15s;
}
.ep-card:hover { background: var(--surface-2); border-color: var(--border-strong); transform: translateY(-2px); }
.ep-card .ep-num {
  font-family: var(--mono); font-size: 12px; font-weight: 600; color: #1a1108;
  background: var(--accent); width: 30px; height: 30px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.ep-card .ep-name { font-size: 14.5px; font-weight: 600; letter-spacing: -0.01em; }
.ep-card .ep-log { font-size: 12px; color: var(--text-2); line-height: 1.4; margin-top: 3px; }

.single-wrap { padding: 0 40px 24px; }
.single-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
.single-meta .sm-item { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; }
.single-meta .smi-lbl { font-family: var(--mono); font-size: 10.5px; color: var(--text-3); letter-spacing: 0.05em; margin-bottom: 6px; }
.single-meta .smi-v { font-size: 16px; font-weight: 600; letter-spacing: -0.015em; }
.beat-timeline {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 22px 24px;
}
.tl-row { display: grid; grid-template-columns: 56px 22px 1fr; align-items: start; }
.tl-time { font-family: var(--mono); font-size: 12px; color: var(--accent); padding-top: 1px; }
.tl-line { display: flex; flex-direction: column; align-items: center; height: 100%; }
.tl-line .tl-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--accent); border: 2px solid var(--bg); box-shadow: 0 0 0 1px var(--accent); flex-shrink: 0; }
.tl-line .tl-bar { width: 2px; flex: 1; min-height: 22px; background: var(--border-strong); margin: 2px 0; }
.tl-beat { font-size: 14.5px; color: var(--text); line-height: 1.4; padding-bottom: 18px; }

/* Icon helper */
.ic { display: inline-block; vertical-align: middle; flex-shrink: 0; }

/* Fade in */
.fade-in { animation: fadeIn 0.35s ease both; }
.fade-up { animation: fadeUp 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* scrollbars */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 4px; }

/* ═══════════════════════════════════════════════════════════ */
/* START SCREEN — format + entry path (#1)                      */
/* ═══════════════════════════════════════════════════════════ */
.start-body {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: 4px 40px 16px;
}
.start-head { margin-bottom: 24px; }
.start-head h1 { font-size: 34px; font-weight: 700; letter-spacing: -0.035em; margin: 0; }

.start-section-label {
  font-family: var(--mono); font-size: 11px; color: var(--text-3);
  letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600;
  margin: 8px 0 12px;
}

.format-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 28px;
}
.format-card {
  position: relative;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  padding: 22px 20px; text-align: left;
  display: flex; flex-direction: column; gap: 14px;
  transform-origin: center;
  transition: transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1),
              background 0.15s ease, border-color 0.15s ease, box-shadow 0.22s ease;
  cursor: pointer;
}
.format-card:not(.sel):not(.recede):hover { background: var(--surface-2); border-color: var(--border-strong); transform: translateY(-2px); }
.format-card.sel { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 12px 30px rgba(232,184,106,0.14); background: var(--accent-soft); transform: scale(1.10); }
.format-card.sel:hover { transform: scale(1.10) translateY(-2px); }
.format-card.recede { transform: scale(0.90); }
.format-card.recede:hover { background: var(--surface-2); border-color: var(--border-strong); transform: scale(0.92) translateY(-2px); }
.format-card .fc-icon {
  width: 48px; height: 48px; border-radius: 12px;
  background: var(--surface-3); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
}
.format-card.sel .fc-icon { background: var(--accent); color: #1a1108; }
.format-card .fc-name { font-size: 18px; font-weight: 700; letter-spacing: -0.02em; }
.format-card .fc-len {
  font-family: var(--mono); font-size: 12px; color: var(--text-3); letter-spacing: 0.02em;
  margin-top: -8px;
}
.format-card.sel .fc-len { color: var(--accent-dim); }
.format-card .fc-check {
  position: absolute; top: 16px; right: 16px;
  width: 22px; height: 22px; border-radius: 50%; background: var(--accent);
  display: flex; align-items: center; justify-content: center;
}

.path-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.path-card {
  position: relative;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  padding: 20px 22px; text-align: left;
  display: flex; align-items: flex-start; gap: 16px;
  transition-property: background-color, border-color, color, box-shadow, transform, opacity; transition-duration: .15s; cursor: pointer;
}
.path-card:hover { background: var(--surface-2); border-color: var(--border-strong); }
.path-card.sel { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.path-card .pc-icon {
  width: 46px; height: 46px; border-radius: 12px; flex-shrink: 0;
  background: var(--surface-3); color: var(--text);
  display: flex; align-items: center; justify-content: center;
}
.path-card .pc-icon.accent { background: var(--accent-soft); color: var(--accent); }
.path-card .pc-title { font-size: 16.5px; font-weight: 600; letter-spacing: -0.015em; }
.path-card .pc-sub { font-size: 13px; color: var(--text-2); line-height: 1.45; margin-top: 3px; }
.path-card .pc-radio {
  position: absolute; top: 20px; right: 20px;
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid var(--border-strong); flex-shrink: 0;
}
.path-card .pc-radio.on {
  border-color: var(--accent); background: var(--accent);
  box-shadow: inset 0 0 0 4px var(--bg);
}

/* ═══════════════════════════════════════════════════════════ */
/* COMPOSE SCREEN — enriched input + media + demo (#2)          */
/* ═══════════════════════════════════════════════════════════ */
.compose-meta {
  display: flex; align-items: center; gap: 8px;
  padding: 0 40px 12px;
  font-family: var(--mono); font-size: 11.5px; color: var(--text-3); letter-spacing: 0.03em;
}
.compose-meta .fmt-badge {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--accent); font-weight: 600;
  padding: 4px 10px; background: var(--accent-soft); border: 1px solid var(--accent-dim); border-radius: 100px;
}
.compose-meta .fmt-dot { color: var(--text-4); }
.compose-meta .fmt-path { color: var(--text-3); text-transform: uppercase; }
.demo-btn {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--sf); font-size: 13px; font-weight: 500; color: var(--text);
  padding: 8px 14px; border-radius: 100px;
  background: var(--surface-2); border: 1px solid var(--border-strong);
  transition-property: background-color, border-color, color, box-shadow, transform, opacity; transition-duration: .15s;
}
.demo-btn:hover { background: var(--surface-3); }
.demo-btn.on { background: var(--accent); color: #1a1108; border-color: var(--accent); }

.type-tabs {
  display: flex; gap: 6px; padding: 0 40px 14px;
}
.type-tab {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13.5px; font-weight: 500; color: var(--text-2);
  padding: 9px 15px; border-radius: 100px;
  background: var(--surface); border: 1px solid var(--border);
  transition-property: background-color, border-color, color, box-shadow, transform, opacity; transition-duration: .15s;
}
.type-tab:hover { background: var(--surface-2); color: var(--text); }
.type-tab.active { background: var(--surface-3); color: var(--text); border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }

.compose-layout {
  flex: 1; min-height: 0;
  display: grid; grid-template-columns: 1.5fr 1fr; gap: 18px;
  padding: 0 40px 16px;
}
.compose-input {
  position: relative;
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px; overflow: hidden;
  transition: box-shadow 0.3s;
}
.compose-input.demoing { box-shadow: 0 0 0 1px var(--accent), 0 0 40px rgba(232,184,106,0.12); }
.doc-upload {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  background: rgba(232,184,106,0.04);
}
.doc-upload .du-left { display: flex; align-items: center; gap: 12px; }
.doc-upload .du-icon {
  width: 36px; height: 36px; border-radius: 9px; flex-shrink: 0;
  background: var(--accent-soft); display: flex; align-items: center; justify-content: center;
}
.doc-upload .du-title { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
.doc-upload .du-sub { font-family: var(--mono); font-size: 11px; color: var(--text-3); letter-spacing: 0.02em; margin-top: 2px; }
.doc-upload .du-btn {
  display: inline-flex; align-items: center; gap: 7px; flex-shrink: 0;
  font-size: 13px; font-weight: 600; color: #1a1108;
  padding: 9px 16px; border-radius: 10px; background: var(--accent); cursor: pointer;
  transition: background 0.15s;
}
.doc-upload .du-btn:hover { background: var(--accent-hover); }

.doc-file {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
}
.doc-file .df-icon {
  width: 36px; height: 36px; border-radius: 9px; flex-shrink: 0;
  background: var(--accent-soft); display: flex; align-items: center; justify-content: center;
}
.doc-file .df-info { flex: 1; min-width: 0; }
.doc-file .df-name { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
.doc-file .df-meta { font-family: var(--mono); font-size: 11px; color: var(--green); letter-spacing: 0.02em; margin-top: 2px; }
.doc-file .df-x {
  width: 28px; height: 28px; border-radius: 8px; flex-shrink: 0;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2);
  display: flex; align-items: center; justify-content: center;
}
.doc-file .df-x:hover { background: var(--surface-3); color: var(--text); }
.doc-cover { display: block; width: calc(100% - 36px); max-height: 330px; object-fit: cover; margin: 14px 18px 2px; border-radius: 10px; border: 1px solid var(--border-strong); }
.compose-input textarea {
  flex: 1; background: transparent; border: none; color: var(--text);
  font-size: 15.5px; line-height: 1.65; padding: 22px 24px; font-family: var(--sf);
  resize: none; outline: none; letter-spacing: -0.005em;
}
.compose-input textarea::placeholder { color: var(--text-4); }
.compose-input .type-caret-hint {
  position: absolute; top: 16px; right: 18px;
  font-family: var(--mono); font-size: 11px; color: var(--accent); letter-spacing: 0.04em;
}
.compose-input .blink { animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }
.compose-input .compose-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; border-top: 1px solid var(--border);
  font-family: var(--mono); font-size: 11.5px; color: var(--text-3);
}

.compose-side { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.ref-tray {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  padding: 16px 18px; flex: 1; min-height: 0;
}
.ref-tray-head { display: flex; align-items: center; justify-content: space-between; }
.ref-tray-head h4 {
  margin: 0; font-size: 11.5px; color: var(--text-3); letter-spacing: 0.05em; text-transform: uppercase;
  font-weight: 600; display: flex; align-items: center; gap: 6px;
}
.ref-tray-head .ref-count {
  font-family: var(--mono); font-size: 11px; color: var(--accent);
  background: var(--accent-soft); padding: 2px 8px; border-radius: 100px;
}
.ref-help { font-size: 12.5px; color: var(--text-2); line-height: 1.4; margin: 8px 0 12px; }
.ref-dropzone {
  flex: 1; min-height: 120px;
  border: 1.5px dashed var(--border-strong); border-radius: 12px;
  padding: 12px; overflow-y: auto;
  transition-property: background-color, border-color, color, box-shadow, transform, opacity; transition-duration: .25s;
}
.ref-dropzone.active { border-color: var(--accent); background: rgba(232,184,106,0.05); }
.ref-empty {
  height: 100%; min-height: 96px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  color: var(--text-4); font-size: 12.5px;
}
.ref-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ref-tile {
  position: relative; aspect-ratio: 16/10; border-radius: 9px; overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
}
.ref-tile.drop-in { animation: ref-drop-in 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
@keyframes ref-drop-in {
  from { opacity: 0; transform: translateY(-10px) scale(0.92); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.ref-tile .ref-kind {
  position: absolute; top: 6px; left: 6px;
  width: 20px; height: 20px; border-radius: 6px;
  background: rgba(0,0,0,0.5); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
}
.ref-tile .ref-x {
  position: absolute; top: 6px; right: 6px;
  width: 20px; height: 20px; border-radius: 6px;
  background: rgba(0,0,0,0.5); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.15s;
}
.ref-tile:hover .ref-x { opacity: 1; }
.ref-tile .ref-label {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 14px 8px 6px;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,0.8));
  font-size: 10.5px; font-weight: 500; color: #fff; line-height: 1.2;
}
.ref-add-row { display: flex; gap: 6px; margin-top: 12px; }
.ref-add {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 12px; font-weight: 500; color: var(--text-2);
  padding: 9px 8px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--border); transition-property: background-color, border-color, color, box-shadow, transform, opacity; transition-duration: .15s;
}
.ref-add:hover { background: var(--surface-3); color: var(--text); }
.compose-side .info-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 16px 18px;
}
.compose-side .info-card h4 {
  margin: 0 0 8px; font-size: 11.5px; color: var(--text-3); letter-spacing: 0.05em; text-transform: uppercase;
  font-weight: 600; display: flex; align-items: center; gap: 6px;
}
.compose-side .info-card p { margin: 0; line-height: 1.5; }

.compose-footer {
  padding: 0 40px 24px; display: flex; gap: 12px; align-items: center;
}

/* ── MATERIAL MODE — single-column upload menu ── */
.compose-material {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: 0 40px 16px;
  width: 100%; max-width: 720px; margin: 0 auto;
  display: flex; flex-direction: column; justify-content: center; gap: 14px;
}

/* Material stage holds the centered cards + a draggable sample file at left */
.material-stage {
  position: relative; flex: 1; min-height: 0; display: flex;
}
.sample-file {
  position: absolute; left: 56px; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  cursor: grab; user-select: none; z-index: 3;
  transition: transform 0.18s ease, opacity 0.18s ease;
}
.sample-file:hover { transform: translateY(-50%) scale(1.05); }
.sample-file:active { cursor: grabbing; }
/* 시나리오별 샘플 파일 2종 스택 — 카드 자체 스타일은 .sample-file 재사용 */
.sample-stack {
  position: absolute; left: 56px; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 30px; z-index: 3;
}
.sample-stack .sample-file { position: static; transform: none; }
.sample-stack .sample-file:hover { transform: scale(1.05); }
.sample-file .sample-file-ico {
  width: 150px; height: 116px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 28px rgba(0,0,0,0.4);
  position: relative;
}
.sample-file .sample-file-ico::after {
  content: ''; position: absolute; top: 0; right: 0;
  border-width: 0 16px 16px 0; border-style: solid;
  border-color: var(--bg) var(--bg) transparent transparent;
}
.sample-file .sample-file-label {
  font-family: var(--mono); font-size: 11.5px; color: var(--text-2);
  letter-spacing: 0.04em;
}
/* 샘플 카드 타이틀 아트 — PDF 글리프 대체. 카드 폭에 맞춰 축소, 비율 유지 */
.sample-file .sample-file-title {
  max-width: 88%; max-height: 76%; object-fit: contain; pointer-events: none;
}
/* LUNARCY 타이틀은 검정 배경 JPG — screen 블렌드로 검정을 카드 표면에 녹인다 */
.sample-file[data-scenario="lunarcy"] .sample-file-title { mix-blend-mode: screen; }
.compose-material .ref-tray { flex: none; }
.compose-material .info-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 16px 18px;
}
.compose-material .info-card h4 {
  margin: 0 0 8px; font-size: 11.5px; color: var(--text-3);
  letter-spacing: 0.05em; text-transform: uppercase;
  font-weight: 600; display: flex; align-items: center; gap: 6px;
}
.compose-material .info-card p { margin: 0; line-height: 1.5; }

/* Large PDF dropzone */
.pdf-drop {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 9px; min-height: 220px; padding: 32px 20px;
  cursor: pointer; text-align: center;
}
.pdf-drop:hover { border-color: var(--accent); background: rgba(232,184,106,0.04); }
.pdf-drop .pdf-ico {
  width: 88px; height: 88px; border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); margin-bottom: 4px;
}
.pdf-drop .pdf-drop-title { font-size: 16px; font-weight: 600; color: var(--text); letter-spacing: -0.01em; }
.pdf-drop .pdf-drop-sub { font-size: 12px; color: var(--text-3); font-family: var(--mono); letter-spacing: 0.02em; }

/* macOS-installer-style drag hint (sample PDF → dropzone) */
.material-stage .drag-arrow {
  position: absolute; left: 216px; top: 50%; z-index: 4; pointer-events: none;
  transform: translateY(-50%); opacity: 0.85;
  animation: drag-arrow-nudge 1.6s ease-in-out infinite;
}
@keyframes drag-arrow-nudge {
  0%, 100% { transform: translateY(-50%) translateX(0); opacity: 0.6; }
  50% { transform: translateY(-50%) translateX(9px); opacity: 1; }
}
.drag-ghost {
  position: absolute; z-index: 6; pointer-events: none;
  width: 46px; height: 46px; margin: -23px 0 0 -23px;
  border-radius: 11px; background: var(--surface); border: 1px solid var(--accent-dim);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 12px 30px rgba(0,0,0,0.55);
  animation: drag-ghost-move 2.8s cubic-bezier(.45,0,.25,1) infinite;
}
@keyframes drag-ghost-move {
  0% { transform: translate(0,0) scale(0.5); opacity: 0; }
  9% { transform: translate(0,0) scale(1); opacity: 1; }
  18% { transform: translate(-4px,-7px) scale(1.07); opacity: 1; }
  66% { transform: translate(var(--dx), var(--dy)) scale(1); opacity: 1; }
  80% { transform: translate(var(--dx), var(--dy)) scale(0.64); opacity: 0.32; }
  100% { transform: translate(var(--dx), var(--dy)) scale(0.64); opacity: 0; }
}
.material-stage .pdf-drop { animation: drop-target-pulse 2.8s ease-in-out infinite; }
@keyframes drop-target-pulse {
  0%, 56%, 100% { box-shadow: 0 0 0 0 rgba(232,184,106,0); }
  72% { box-shadow: 0 0 0 4px rgba(232,184,106,0.2); border-color: var(--accent); }
}

/* ───── Reference TYPE tabs (picker, #4) ───── */
.reftype-tabs {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 40px 16px;
}
.reftype-tab {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13.5px; font-weight: 500; color: var(--text-2);
  padding: 9px 15px; border-radius: 100px;
  background: var(--surface); border: 1px solid var(--border);
  transition-property: background-color, border-color, color, box-shadow, transform, opacity; transition-duration: .15s;
}
.reftype-tab:hover { background: var(--surface-2); color: var(--text); }
.reftype-tab.active { background: var(--surface-3); color: var(--text); border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.reftype-tab .rt-count {
  font-family: var(--mono); font-size: 10.5px; color: var(--text-3);
  background: var(--surface-2); padding: 1px 7px; border-radius: 100px;
}
.reftype-tab.active .rt-count { color: var(--accent); background: var(--accent-soft); }

/* Personality card variant — portrait reads as a person, not a poster */
.movie-card-ipad.is-person .poster .palette-row { top: 38%; }
.movie-card-ipad.is-person .poster::after {
  content: '';
  position: absolute; left: 50%; top: 60%; transform: translateX(-50%);
  width: 46px; height: 46px; border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.06);
}

/* ───── Influence: donut + aspect panel (#5) ───── */
.influence-layout {
  flex: 1; min-height: 0;
  display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 20px;
  padding: 4px 40px 8px; align-items: center;
}
.donut-col { display: flex; align-items: center; justify-content: center; min-width: 0; }
.donut-col .donut-wrapper-wide { width: 100%; max-width: 620px; aspect-ratio: 760 / 520; }
.donut-col .donut-wrapper-wide svg { width: 100%; height: 100%; display: block; }

.aspect-col {
  display: flex; flex-direction: column; gap: 10px;
  max-height: 100%; overflow-y: auto; padding-right: 2px;
}
.aspect-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 14px 16px;
}
.aspect-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.aspect-head .aspect-dot { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }
.aspect-head .at-name { font-size: 15px; font-weight: 600; letter-spacing: -0.015em; }
.aspect-head .at-meta { font-family: var(--mono); font-size: 10.5px; color: var(--text-3); letter-spacing: 0.02em; text-transform: uppercase; margin-top: 1px; }
.aspect-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.aspect-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 500; color: var(--text-3);
  padding: 6px 10px; border-radius: 100px;
  background: transparent; border: 1px solid var(--border); transition-property: background-color, border-color, color, box-shadow, transform, opacity; transition-duration: .12s;
}
.aspect-chip:hover { color: var(--text); border-color: var(--border-strong); }
.aspect-chip.on { font-weight: 600; }

/* ───── Character detail control (#6) ───── */
.detail-card {
  margin-top: 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  padding: 20px;
}
.detail-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.detail-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.detail-title > span:first-of-type { font-size: 16px; font-weight: 700; letter-spacing: -0.02em; }
.detail-title .detail-sub { font-size: 13px; color: var(--text-2); font-weight: 400; }
.mode-seg {
  display: flex; gap: 4px; padding: 4px; flex-shrink: 0;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 100px;
}
.mode-seg .seg-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 500; color: var(--text-2);
  padding: 7px 14px; border-radius: 100px; transition-property: background-color, border-color, color, box-shadow, transform, opacity; transition-duration: .15s;
}
.mode-seg .seg-btn:hover { color: var(--text); }
.mode-seg .seg-btn.on { background: var(--accent); color: #1a1108; font-weight: 600; }

.detail-body { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 22px; }
.detail-body.ai-mode { opacity: 0.92; }
.detail-block h4 {
  margin: 0 0 4px; font-size: 11px; color: var(--text-3); letter-spacing: 0.05em; text-transform: uppercase;
  font-weight: 600; display: flex; align-items: center; gap: 6px;
}
.detail-help { font-size: 11.5px; color: var(--text-3); margin-bottom: 12px; line-height: 1.4; }

.phys-grid { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.phys-row { display: grid; grid-template-columns: 64px 1fr; align-items: center; gap: 10px; }
.phys-row label { font-size: 12px; color: var(--text-3); }
.phys-row input {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); font-size: 13px; padding: 7px 10px; font-family: var(--sf); outline: none;
  transition: border-color 0.15s;
}
.phys-row input:focus { border-color: var(--accent); }
.phys-row .phys-val { font-size: 13px; color: var(--text); display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.ai-tag {
  font-family: var(--mono); font-size: 8.5px; font-weight: 600; color: var(--accent);
  background: var(--accent-soft); padding: 2px 5px; border-radius: 4px; letter-spacing: 0.04em;
}

.tag-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.d-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 500; color: var(--text);
  padding: 6px 10px; border-radius: 100px;
  background: var(--surface-2); border: 1px solid var(--border);
}
.d-chip.trait { background: rgba(111,177,214,0.1); border-color: rgba(111,177,214,0.28); color: var(--cyan); }
.d-chip button { display: inline-flex; opacity: 0.6; }
.d-chip button:hover { opacity: 1; }
.chip-add input {
  width: 110px; background: transparent; border: 1px dashed var(--border-strong); border-radius: 100px;
  color: var(--text); font-size: 12px; padding: 6px 12px; font-family: var(--sf); outline: none;
}
.chip-add input:focus { border-color: var(--accent); border-style: solid; }
.detail-foot {
  margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border);
  font-size: 12.5px; color: var(--text-2); display: flex; align-items: center; gap: 7px;
}
.detail-foot strong { color: var(--accent); font-weight: 600; }

/* ═══════════════════════════════════════════════════════════ */
/* M5 — generation loop / regenerate                            */
/* ═══════════════════════════════════════════════════════════ */
@keyframes spin360 { to { transform: rotate(360deg); } }
.icon.spin { animation: spin360 0.7s linear infinite; transform-origin: center; }

.char-card h3 { position: relative; }
.char-card h3 .h3-regen {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--sf); font-size: 11px; font-weight: 500; text-transform: none; letter-spacing: 0;
  color: var(--text-2); padding: 4px 9px; border-radius: 7px;
  background: var(--surface-2); border: 1px solid var(--border); transition-property: background-color, border-color, color, box-shadow, transform, opacity; transition-duration: .15s;
}
.char-card h3 .h3-regen:hover { color: var(--accent); border-color: var(--accent-dim); }
.char-card h3 .h3-regen:disabled { opacity: 0.4; cursor: default; }

.field-regen {
  margin-top: 10px;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 500; color: var(--text-2);
  padding: 7px 12px; border-radius: 9px;
  background: var(--surface-2); border: 1px solid var(--border); transition-property: background-color, border-color, color, box-shadow, transform, opacity; transition-duration: .15s;
}
.field-regen:hover { color: var(--accent); border-color: var(--accent-dim); }
.field-regen:disabled { opacity: 0.4; cursor: default; }

.ortho-row-ipad.regen, .palette-strip.regen, .bio-text.regen { animation: regen-pulse 0.62s ease; }
@keyframes regen-pulse { 0% { opacity: 1; } 45% { opacity: 0.35; } 100% { opacity: 1; } }

.regen-shimmer {
  position: absolute; inset: 0; pointer-events: none; overflow: hidden; border-radius: 12px;
}
.regen-shimmer::after {
  content: ''; position: absolute; top: 0; bottom: 0; width: 40%;
  background: linear-gradient(90deg, transparent, rgba(232,184,106,0.28), transparent);
  animation: shimmer-sweep 0.62s ease;
}
@keyframes shimmer-sweep { from { left: -45%; } to { left: 110%; } }

/* M4 — aspect sourcing */
.aspect-source { display: flex; flex-direction: column; gap: 8px; }
.as-row { display: grid; grid-template-columns: auto 16px 1fr; align-items: center; gap: 10px; }
.as-row .as-name { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; color: var(--text); min-width: 130px; }
.as-row .as-arrow { color: var(--text-4); font-size: 13px; text-align: center; }
.as-row .as-refs { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12.5px; font-weight: 600; }
.as-row .as-ref { white-space: nowrap; }

/* ═══════════ Global selection scale — selected +10%, unselected −10% ═══════════ */
/* Applies the card/button pop to every selectable group across the app. */
.path-grid > .path-card,
.type-tabs > .type-tab,
.reftype-tabs > .reftype-tab,
.char-tabs-row > .char-tab,
.mode-seg > .seg-btn,
.aspect-chips > .aspect-chip {
  transform-origin: center;
  transition: transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1),
              background 0.15s ease, border-color 0.15s ease,
              box-shadow 0.22s ease, color 0.15s ease;
}

/* Starting-point cards (single select) */
.path-grid:has(.path-card.sel) .path-card:not(.sel) { transform: scale(0.90); }
.path-grid .path-card.sel { transform: scale(1.10); }

/* Input-type tabs */
.type-tabs:has(.type-tab.active) .type-tab:not(.active) { transform: scale(0.90); }
.type-tabs .type-tab.active { transform: scale(1.10); }

/* Reference-type tabs */
.reftype-tabs:has(.reftype-tab.active) .reftype-tab:not(.active) { transform: scale(0.90); }
.reftype-tabs .reftype-tab.active { transform: scale(1.10); }

/* Character tabs */
.char-tabs-row:has(.char-tab.active) .char-tab:not(.active) { transform: scale(0.90); }
.char-tabs-row .char-tab.active { transform: scale(1.10); }

/* Mode segment (AI / manual) */
.mode-seg:has(.seg-btn.on) .seg-btn:not(.on) { transform: scale(0.90); }
.mode-seg .seg-btn.on { transform: scale(1.10); }

/* Influence aspect chips (multi select) */
.aspect-chips:has(.aspect-chip.on) .aspect-chip:not(.on) { transform: scale(0.90); }
.aspect-chips .aspect-chip.on { transform: scale(1.10); }

/* ─────────────────────────────────────────────────────────────
   "How it works" guided walkthrough
   ───────────────────────────────────────────────────────────── */
.tour-layer {
  position: absolute; inset: 0;
  z-index: 60;
  pointer-events: none;
}

/* Animated cursor */
.tour-cursor {
  position: absolute; top: 0; left: 0;
  width: 0; height: 0;
  z-index: 62;
  pointer-events: none;
  opacity: 0;
  transition-property: transform, opacity;
  transition-timing-function: cubic-bezier(.45,.05,.25,1);
  transition-duration: 0ms, 240ms;
  will-change: transform;
}
.tour-cursor.in { opacity: 1; }
.tour-arrow {
  position: absolute; top: -2px; left: -2px;
  filter: drop-shadow(0 3px 6px rgba(0,0,0,0.5));
  transform-origin: 4px 4px;
  transition: transform 0.13s ease;
}
.tour-cursor.press .tour-arrow { transform: scale(0.82); }
.tour-cursor.grab  .tour-arrow { transform: scale(0.9); }

/* Click ripple */
.tour-click-ring {
  position: absolute; top: 2px; left: 2px;
  width: 12px; height: 12px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.4);
  pointer-events: none;
}
.tour-cursor.press .tour-click-ring {
  animation: tour-ring 0.5s ease-out;
}
@keyframes tour-ring {
  0%   { opacity: 0.9; transform: translate(-50%, -50%) scale(0.4); }
  100% { opacity: 0;   transform: translate(-50%, -50%) scale(3.2); }
}

/* Ghost PDF held during the drag */
.tour-ghost {
  position: absolute; top: 14px; left: 12px;
  width: 56px; height: 70px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--accent-dim);
  box-shadow: 0 18px 36px rgba(0,0,0,0.55), 0 0 0 1px rgba(232,184,106,0.18);
  display: flex; align-items: center; justify-content: center;
  transform: rotate(-7deg);
  animation: tour-ghost-pop 0.18s ease-out;
}
@keyframes tour-ghost-pop {
  from { transform: rotate(-7deg) scale(0.7); opacity: 0; }
  to   { transform: rotate(-7deg) scale(1);   opacity: 1; }
}

/* Caption pill */
.tour-caption {
  position: absolute; left: 50%; bottom: 30px;
  transform: translate(-50%, 14px);
  display: flex; align-items: center; gap: 12px;
  padding: 11px 11px 11px 18px;
  background: rgba(16,16,20,0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.45);
  z-index: 63;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.tour-caption.in { opacity: 1; transform: translate(-50%, 0); }
.tour-cap-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(232,184,106,0.5);
  animation: tour-cap-pulse 1.6s ease-out infinite;
  flex: none;
}
@keyframes tour-cap-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(232,184,106,0.45); }
  70%  { box-shadow: 0 0 0 7px rgba(232,184,106,0); }
  100% { box-shadow: 0 0 0 0 rgba(232,184,106,0); }
}
.tour-cap-text {
  font-size: 13.5px; color: var(--text);
  letter-spacing: -0.005em; white-space: nowrap;
}

/* ─────────────────────────────────────────────────────────────
   Demo pause layer — covers the whole demo (walkthrough → analysis)
   ───────────────────────────────────────────────────────────── */
.demo-pause-layer {
  position: absolute; inset: 0;
  z-index: 70;
}
.demo-pause-shield {
  position: absolute; inset: 0;
  pointer-events: auto;
  touch-action: none;
  cursor: pointer;
  background: transparent;
}
.demo-pause-layer.paused .demo-pause-shield {
  background: rgba(10,10,13,0.42);
  backdrop-filter: blur(0.75px);
  -webkit-backdrop-filter: blur(0.75px);
  transition: background 0.2s ease;
}

/* Resting hint — bottom-right, unobtrusive */
.demo-pause-hint {
  position: absolute; left: 18px; bottom: 16px;
  display: flex; align-items: center; gap: 8px;
  padding: 8px 13px;
  background: rgba(16,16,20,0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 11.5px; font-family: var(--mono);
  letter-spacing: 0.02em; color: var(--text-3);
  pointer-events: none;
}
.demo-pause-hint .dph-bars { display: inline-flex; gap: 3px; }
.demo-pause-hint .dph-bars span {
  width: 3px; height: 11px; border-radius: 1.5px; background: var(--text-3);
}

/* Paused badge — anchored to the bottom so the screen stays readable */
.demo-pause-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: flex-end;
  gap: 16px;
  padding-bottom: 64px;
  pointer-events: auto; cursor: pointer;
}
.demo-pause-badge {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 24px;
  background: rgba(16,16,20,0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--accent-dim);
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(0,0,0,0.6);
  animation: demo-pause-pop 0.22s cubic-bezier(.2,.8,.2,1);
}
@keyframes demo-pause-pop {
  from { opacity: 0; transform: scale(0.9) translateY(6px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.dpb-bars { display: inline-flex; gap: 5px; }
.dpb-bars span {
  width: 6px; height: 26px; border-radius: 3px; background: var(--accent);
}
.dpb-text .dpb-title {
  font-size: 16px; font-weight: 700; color: var(--text);
  letter-spacing: -0.01em; line-height: 1.1;
}
.dpb-text .dpb-sub {
  font-size: 12.5px; color: var(--text-3); margin-top: 2px;
}
.demo-pause-exit {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 12.5px; font-weight: 600;
  cursor: pointer;
  animation: demo-pause-pop 0.3s cubic-bezier(.2,.8,.2,1);
  transition: background 0.15s ease, color 0.15s ease;
}
.demo-pause-exit:hover { background: var(--surface-3); color: var(--text); }

/* While paused, freeze all keyframe animation on the demo screens */
.screen.d2s-demo-paused *,
.screen.d2s-demo-paused *::before,
.screen.d2s-demo-paused *::after {
  animation-play-state: paused !important;
}

/* ─────────────────────────────────────────────────────────────
   "Next" button — auto-advance countdown at screen handoffs
   ───────────────────────────────────────────────────────────── */
.d2s-next-dock {
  /* 모든 단계에서 advance 알약을 화면 우하단 동일 위치로 고정(투어 전용).
     좌하단 pause hint와 겹치지 않음. z-index 60 = pause shield(70) 아래라 기존 클릭/일시정지 동작 유지. */
  position: fixed; right: 24px; bottom: 24px;
  z-index: 60;
  display: flex; justify-content: flex-end;
  margin-top: 0;
}
.d2s-next-btn {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 11px 16px 11px 22px;
  border-radius: 999px;
  border: 1px solid #f2d79a;
  background: linear-gradient(180deg, #f1c87c 0%, var(--accent) 100%);
  color: #1a1408;
  font-family: var(--sf);
  font-size: 14.5px; font-weight: 700;
  letter-spacing: -0.005em;
  cursor: pointer;
  box-shadow: 0 14px 40px rgba(0,0,0,0.5), 0 0 0 4px rgba(232,184,106,0.10);
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
  animation: demo-pause-pop 0.26s cubic-bezier(.2,.8,.2,1);
}
.d2s-next-btn:hover { filter: brightness(1.05); transform: translateY(-1px); box-shadow: 0 18px 48px rgba(0,0,0,0.55), 0 0 0 4px rgba(232,184,106,0.16); }
.d2s-next-btn:active { transform: translateY(0); }
.d2s-next-body { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.05; }
.d2s-next-label { font-size: 14.5px; font-weight: 700; }
.d2s-next-sub {
  font-family: var(--mono); font-size: 9.5px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: rgba(26,20,8,0.6); margin-top: 2px;
}
.d2s-next-count {
  position: relative;
  width: 26px; height: 26px;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.d2s-next-ring { position: absolute; inset: 0; width: 26px; height: 26px; transform: rotate(-90deg); }
.d2s-next-ring-bg { fill: none; stroke: rgba(26,20,8,0.18); stroke-width: 3; }
.d2s-next-ring-fg {
  fill: none; stroke: #1a1408; stroke-width: 3; stroke-linecap: round;
  transition: stroke-dashoffset 1s linear;
}
.d2s-next-num {
  position: relative; z-index: 1;
  font-family: var(--mono); font-size: 12px; font-weight: 700;
  font-variant-numeric: tabular-nums; color: #1a1408;
}
.d2s-next-arrow { font-size: 17px; line-height: 1; margin-left: -1px; }

/* ═══════════════════════════════════════════════════════════════
   Prop & Vehicle bits
   ═══════════════════════════════════════════════════════════════ */
.char-hero-row .role .pv-kind {
  font-family: var(--mono); font-size: 10px; font-weight: 600;
  letter-spacing: 0.07em; color: var(--accent);
}
.sheet-pose .pv-sil { width: 64%; height: 56%; opacity: 0.6; }

/* Prop & Vehicle — 단일 생성 시트(실제 렌더 이미지 한 장) */
.pv-single-sheet {
  border: 1px solid var(--border-strong); border-radius: 12px;
  background: var(--surface-2); overflow: hidden;
}
.pv-single-sheet img { display: block; width: 100%; height: auto; }
.pv-single-cap {
  font-family: var(--mono); font-size: 10px; color: var(--text-3);
  letter-spacing: 0.05em; padding: 8px 12px;
  border-top: 1px solid var(--border);
}

/* ═══════════════════════════════════════════════════════════════
   Character 3D view
   ═══════════════════════════════════════════════════════════════ */
.view3d-layout {
  margin-top: 14px;
  display: grid; grid-template-columns: 1fr 280px; gap: 16px;
  flex: 1; min-height: 0;
}
.viewport3d {
  position: relative; overflow: hidden;
  min-height: 440px;
  border: 1px solid var(--border); border-radius: 16px;
  background: radial-gradient(120% 90% at 50% 18%, #1a1c22 0%, #101116 55%, #0a0a0d 100%);
  perspective: 1000px; perspective-origin: 50% 42%;
}
/* 실제 Tripo3D GLB 뷰어(model-viewer) — 뷰포트 전체 채움 */
model-viewer.v3d-mv {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  background: transparent;
  --poster-color: transparent;
  --progress-bar-color: var(--accent);
}
.v3d-grid {
  position: absolute; left: -25%; right: -25%; bottom: -4%; height: 55%;
  background-image:
    repeating-linear-gradient(0deg, rgba(232,184,106,0.10) 0 1px, transparent 1px 44px),
    repeating-linear-gradient(90deg, rgba(232,184,106,0.10) 0 1px, transparent 1px 44px);
  transform: rotateX(72deg); transform-origin: bottom center;
  mask-image: linear-gradient(to top, #000 0%, transparent 80%);
  -webkit-mask-image: linear-gradient(to top, #000 0%, transparent 80%);
  pointer-events: none;
}

/* Empty / pick-a-service state */
.v3d-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px; text-align: center; }
.v3d-empty-ico { width: 64px; height: 64px; border-radius: 16px; border: 1px dashed var(--border-strong); display: flex; align-items: center; justify-content: center; }
.v3d-empty-t { font-size: 14px; color: var(--text-2); max-width: 320px; }
.v3d-svc-btns { display: flex; flex-direction: column; gap: 10px; width: 320px; max-width: 90%; }
.v3d-svc-btn {
  display: flex; align-items: center; gap: 12px; text-align: left;
  padding: 13px 16px; border-radius: 12px;
  border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text);
  cursor: pointer; transition: border-color 0.15s, background 0.15s, transform 0.1s;
}
.v3d-svc-btn:hover { border-color: var(--accent-dim); background: var(--surface-3); transform: translateY(-1px); }
/* 3D 화면 생성 버튼 클릭 유도 — 시나리오 드롭존(drop-target-pulse)과 동일한 골드 링 펄스 */
.v3d-svc-btns .v3d-svc-btn { animation: drop-target-pulse 2.8s ease-in-out infinite; }
.v3d-svc-mark { width: 22px; height: 22px; border-radius: 7px; flex: none; }
.v3d-svc-mark[data-svc="tripo"] { background: linear-gradient(140deg, #6fb1d6, #3a6f9c); }
.v3d-svc-mark[data-svc="meshy"] { background: linear-gradient(140deg, #e8b86a, #b07a3a); }
.v3d-svc-txt { flex: 1; display: flex; flex-direction: column; }
.v3d-svc-name { font-size: 13.5px; font-weight: 600; }
.v3d-svc-tag { font-family: var(--mono); font-size: 9.5px; color: var(--text-3); letter-spacing: 0.03em; }

/* Generating */
.v3d-gen { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; }
.v3d-gen-orb { display: flex; gap: 8px; }
.v3d-gen-orb span { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); animation: v3d-bounce 1s ease-in-out infinite; }
.v3d-gen-orb span:nth-child(2) { animation-delay: 0.15s; }
.v3d-gen-orb span:nth-child(3) { animation-delay: 0.3s; }
@keyframes v3d-bounce { 0%, 100% { transform: translateY(0); opacity: 0.5; } 50% { transform: translateY(-10px); opacity: 1; } }
.v3d-gen-svc { font-family: var(--mono); font-size: 11px; color: var(--accent); letter-spacing: 0.05em; text-transform: uppercase; }
.v3d-gen-step { font-size: 13.5px; color: var(--text-2); }
.v3d-gen-bar { width: 220px; height: 4px; border-radius: 4px; background: rgba(255,255,255,0.08); overflow: hidden; }
.v3d-gen-bar > div { height: 100%; background: linear-gradient(90deg, var(--accent-dim), var(--accent)); border-radius: 4px; transition: width 0.4s ease; }

/* Model stage */
.v3d-stage { position: absolute; inset: 0; transform-style: preserve-3d; }
.model3d {
  position: absolute; left: 50%; top: 56%; width: 0; height: 0;
  transform-style: preserve-3d;
  animation: v3d-pop 0.5s cubic-bezier(.2,.9,.3,1);
}
@keyframes v3d-pop { from { opacity: 0; } to { opacity: 1; } }
.cube3d { position: absolute; left: 50%; top: 50%; width: 0; height: 0; transform-style: preserve-3d; }
.cube3d-face {
  position: absolute; left: 50%; top: 50%;
  backface-visibility: hidden;
  box-shadow: inset 0 0 0 0.5px rgba(0,0,0,0.25);
}
.viewport3d.wire .cube3d-face {
  background: transparent !important; filter: none !important;
  border: 1px solid rgba(232,184,106,0.85); box-shadow: none;
}
.model3d-base {
  position: absolute; left: 50%; top: 50%;
  width: 200px; height: 200px; transform: translate(-50%, -50%) rotateX(90deg) translateZ(82px);
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(232,184,106,0.18), transparent 72%);
  border: 1px solid rgba(232,184,106,0.2);
}
.v3d-overlay-tag {
  position: absolute; left: 14px; bottom: 12px;
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 10.5px; color: var(--text-2); letter-spacing: 0.03em;
  padding: 6px 11px; border-radius: 100px;
  background: rgba(10,10,13,0.55); border: 1px solid var(--border);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.v3d-live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }

/* Side panel */
.view3d-side { display: flex; flex-direction: column; gap: 12px; }
.v3d-stat { display: flex; align-items: center; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 13px; color: var(--text-2); }
.v3d-stat:last-child { border-bottom: none; }
.v3d-stat .v { color: var(--text); font-family: var(--mono); font-size: 12px; }
.v3d-controls { display: flex; gap: 8px; }
.v3d-ctl {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px; border-radius: 9px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text-2); font-size: 12px; cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.v3d-ctl:hover { color: var(--accent); border-color: var(--accent-dim); }
.v3d-ctl.on { color: var(--accent); border-color: var(--accent-dim); background: var(--accent-soft); }
.v3d-svc-switch { display: flex; gap: 8px; margin-top: 12px; }
.v3d-switch-btn {
  flex: 1; padding: 8px; border-radius: 9px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text-2); font-size: 12px; cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.v3d-switch-btn.on { color: #1a1108; background: var(--accent); border-color: var(--accent); font-weight: 600; }

/* ═══════════════════════════════════════════════════════════════
   Audio — voice casting + music
   ═══════════════════════════════════════════════════════════════ */
.vc-tab-count {
  margin-left: 6px; font-family: var(--mono); font-size: 9.5px; font-weight: 700;
  color: #1a1108; background: var(--accent); border-radius: 100px; padding: 1px 6px;
}
.vc-line-card {
  margin: 6px 40px 16px; padding: 14px 18px;
  border: 1px solid var(--border); border-radius: 12px;
  background: linear-gradient(120deg, var(--accent-soft), transparent 70%);
}
.vc-line-lbl { font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; color: var(--text-3); display: inline-flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.vc-line { font-size: 18px; font-weight: 600; color: var(--text); letter-spacing: -0.01em; }

.vc-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(186px, 1fr));
  gap: 12px; padding: 0 40px 12px;
}
.voice-card {
  text-align: left;
  position: relative; padding: 14px; border-radius: 13px;
  background: var(--surface-2); border: 1px solid var(--border);
  text-align: left;
  cursor: pointer; transition: border-color 0.15s, transform 0.1s, background 0.15s;
}

.v3d-model-loading{position:absolute;inset:0;z-index:3;display:flex;align-items:center;justify-content:center;overflow:hidden;background:#101014}
.v3d-model-poster{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;filter:blur(14px) saturate(.72);transform:scale(1.08);opacity:.72}
.v3d-model-loading-shade{position:absolute;inset:0;background:linear-gradient(180deg,rgba(8,8,12,.12),rgba(8,8,12,.88))}
.v3d-model-loading-card{position:relative;width:min(280px,70%);padding:16px;border:1px solid rgba(232,184,106,.3);background:rgba(10,10,13,.78);backdrop-filter:blur(8px);font-family:var(--mono);font-size:11px;color:var(--accent);letter-spacing:.04em}
.v3d-model-loading-bar{height:3px;margin-top:10px;background:rgba(255,255,255,.16);overflow:hidden}.v3d-model-loading-bar span{display:block;height:100%;background:var(--accent);transition:width .2s ease}
.v3d-model-loading-card.is-error,.v3d-model-loading.is-error .v3d-model-loading-card{color:#f28b82;border-color:rgba(242,139,130,.45)}
.read-source-note { margin-top: 6px; font: 11px var(--mono); color: var(--accent); opacity: .85; }
.voice-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.voice-card.sel { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent-dim); }
.voice-card.disabled { opacity: 0.4; cursor: default; }
.voice-card.disabled:hover { transform: none; }
/* 성별 잠금(캐릭터와 성별이 다른 후보) — 더 흐리게 + 채도 제거 */
.voice-card.locked { opacity: 0.28; filter: saturate(0.2); }
.vc-locked-tag {
  font-family: var(--mono); font-size: 9.5px; color: var(--text-4);
  letter-spacing: 0.05em; border: 1px solid var(--border); border-radius: 6px;
  padding: 4px 8px;
}
.vc-pip {
  position: absolute; top: 10px; right: 10px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--accent); color: #1a1108; font-family: var(--mono); font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; z-index: 2;
}
.vc-rank { font-family: var(--mono); font-size: 10px; color: var(--text-4); letter-spacing: 0.05em; }
.vc-wave, .vc-eq { display: flex; align-items: flex-end; gap: 3px; height: 34px; margin: 10px 0 12px; }
.vc-wave span { flex: 1; height: 30%; border-radius: 2px; background: var(--accent-dim); opacity: 0.55; }
.vc-wave.playing span { animation: vc-bar 0.7s ease-in-out infinite alternate; background: var(--accent); opacity: 1; }
@keyframes vc-bar { from { height: 14%; } to { height: 100%; } }
.vc-eq span { flex: 1; border-radius: 2px; background: var(--accent-dim); opacity: 0.5; animation: vc-eqpulse 1.6s ease-in-out infinite alternate; }
@keyframes vc-eqpulse { from { transform: scaleY(0.5); } to { transform: scaleY(1); } }
.vc-eq span { transform-origin: bottom; }
.vc-name { font-size: 14px; font-weight: 700; color: var(--text); letter-spacing: -0.01em; }
.vc-desc { font-size: 12px; color: var(--text-2); margin-top: 2px; line-height: 1.35; }
.vc-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
.vc-match { font-family: var(--mono); font-size: 12px; color: var(--accent); font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.vc-bpm { font-family: var(--mono); font-size: 10.5px; color: var(--text-3); }
.vc-audition {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 11px; border-radius: 100px; cursor: pointer;
  border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--text-2); font-size: 11.5px; font-weight: 600; transition-property: background-color, border-color, color, box-shadow, transform, opacity; transition-duration: .15s;
}
.vc-audition:hover { color: var(--accent); border-color: var(--accent-dim); }
.vc-audition.on { background: var(--accent); color: #1a1108; border-color: var(--accent); }
.vc-eleven { margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--border); font-family: var(--mono); font-size: 9px; color: var(--text-4); letter-spacing: 0.04em; display: inline-flex; align-items: center; gap: 5px; }
.el-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 6px var(--cyan); }

/* ═══════════════════════════════════════════════════════════════
   Reading screen — protagonist/villain + "Analysis complete" popup
   ═══════════════════════════════════════════════════════════════ */
.rs-role-row { display: flex; gap: 26px; }
.rs-role { display: flex; flex-direction: column; gap: 5px; }
.rs-role-name { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 600; color: var(--text); }
.rs-role-name.villain { color: var(--crimson); }

.reading-done-pop {
  position: absolute; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center;
  background: rgba(8,8,11,0.55);
  -webkit-backdrop-filter: blur(1.5px); backdrop-filter: blur(1.5px);
  animation: rdp-fade 0.25s ease;
}
@keyframes rdp-fade { from { opacity: 0; } to { opacity: 1; } }
.rdp-card {
  width: 340px; max-width: 84%; padding: 30px 28px 24px;
  border-radius: 18px; text-align: center;
  background: var(--surface); border: 1px solid var(--accent-dim);
  box-shadow: 0 30px 80px rgba(0,0,0,0.6);
  animation: demo-pause-pop 0.3s cubic-bezier(.2,.8,.2,1);
}
.rdp-check {
  width: 52px; height: 52px; border-radius: 50%; margin: 0 auto 16px;
  background: var(--accent); display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(232,184,106,0.4);
}
.rdp-title { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; color: var(--text); }
.rdp-sub { font-family: var(--mono); font-size: 11px; color: var(--text-3); letter-spacing: 0.04em; margin-top: 8px; }
.rdp-next {
  margin-top: 22px; display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 24px; border-radius: 100px; border: none; cursor: pointer;
  background: linear-gradient(180deg, #f1c87c, var(--accent)); color: #1a1408;
  font-size: 14.5px; font-weight: 700;
  box-shadow: 0 12px 32px rgba(0,0,0,0.4);
  transition: filter 0.12s, transform 0.12s;
}
.rdp-next:hover { filter: brightness(1.05); transform: translateY(-1px); }
.rdp-dismiss {
  display: block; margin: 12px auto 0; padding: 4px 8px;
  background: none; border: none; cursor: pointer;
  font-family: var(--mono); font-size: 11px; color: var(--text-3); letter-spacing: 0.03em;
}
.rdp-dismiss:hover { color: var(--text); }

/* Animated count-up stats (summary) */
.rsv .countup { display: inline-block; transform-origin: center; }
.countup.pop { animation: countpop 0.38s cubic-bezier(.2,.9,.3,1); }
@keyframes countpop {
  0% { transform: scale(1); }
  35% { transform: scale(1.55); color: #fff; text-shadow: 0 0 20px rgba(232,184,106,0.6); }
  100% { transform: scale(1); }
}

/* Indexing screen — movie-database sources */
.prep-sources {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 7px;
  margin-top: 13px;
}
.prep-sources .ps-lbl {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.1em; color: var(--text-4); margin-right: 2px;
}
.prep-sources .src {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.02em; color: var(--text-2);
  padding: 3px 9px; border: 1px solid var(--border); border-radius: 100px;
  background: rgba(255,255,255,0.02);
}

/* Indexing screen — CONNECT step (database handshake) */
.prep-connect {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 22px; min-height: 300px;
}
.prep-connect-orb { position: relative; width: 130px; height: 130px; display: flex; align-items: center; justify-content: center; }
.pco-ring { position: absolute; inset: 0; border-radius: 50%; border: 1px solid var(--accent); opacity: 0; animation: pco-pulse 2.4s ease-out infinite; }
.pco-ring:nth-child(2) { animation-delay: 0.8s; }
.pco-ring:nth-child(3) { animation-delay: 1.6s; }
@keyframes pco-pulse {
  0% { transform: scale(0.42); opacity: 0; }
  18% { opacity: 0.65; }
  100% { transform: scale(1.1); opacity: 0; }
}
.pco-core {
  width: 56px; height: 56px; border-radius: 50%; z-index: 1;
  background: var(--accent); display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 30px rgba(232,184,106,0.5);
}
.prep-connect-title { font-size: 18px; font-weight: 600; color: var(--text); letter-spacing: -0.01em; }
.prep-connect-srcs { display: flex; flex-direction: column; gap: 9px; min-width: 220px; }
.pc-src {
  display: flex; align-items: center; gap: 9px;
  font-family: var(--mono); font-size: 12.5px; color: var(--text-3);
  opacity: 0.45; transition: opacity 0.3s ease, color 0.3s ease;
}
.pc-src.on { opacity: 1; color: var(--text); }
.pc-src-spin {
  width: 11px; height: 11px; border-radius: 50%;
  border: 2px solid var(--border-strong); border-top-color: var(--accent);
  animation: spin360 0.8s linear infinite;
}

/* ───────────────────────────────────────────────────────────────
   STORYBOARD — final image-generation stage
   ─────────────────────────────────────────────────────────────── */
.sb-studio {
  margin-top: 18px; border: 1px solid var(--border); border-radius: 16px;
  background: linear-gradient(180deg, var(--surface) 0%, rgba(31,33,40,0.6) 100%);
  padding: 18px 20px;
}
.sb-studio-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.sb-studio-head h4 { margin: 0; font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; color: var(--text); display: inline-flex; align-items: center; gap: 7px; }
.sb-studio-sub { font-size: 12.5px; color: var(--text-3); }
.sb-svc-row { display: flex; gap: 12px; flex-wrap: wrap; }
.sb-svc-row .v3d-svc-btn { flex: 1; min-width: 240px; width: auto; }

.sb-svc-mark { width: 22px; height: 22px; border-radius: 7px; flex: none; position: relative; }
.sb-svc-mark.sm { width: 16px; height: 16px; border-radius: 5px; }
.sb-svc-mark[data-svc="gptimg"] { background: linear-gradient(140deg, #6fae7f, #2f6f4a); }
.sb-svc-mark[data-svc="nbpro"]  { background: linear-gradient(140deg, #e8b86a, #b07a3a); }
.sb-svc-mark[data-svc="imagen"] { background: linear-gradient(140deg, #6fb1d6, #3a6f9c); }
.sb-svc-mark.ring::after { content: ''; position: absolute; inset: 5px; border-radius: 50%; border: 2px solid rgba(0,0,0,0.55); }
.sb-svc-mark.sm.ring::after { inset: 3.5px; border-width: 1.6px; }
.sb-svc-mark.diamond::after { content: ''; position: absolute; inset: 5px; background: rgba(0,0,0,0.5); transform: rotate(45deg); }
.sb-svc-mark.sm.diamond::after { inset: 3.5px; }
.sb-svc-mark.triangle::after { content: ''; position: absolute; inset: 5px; background: rgba(0,0,0,0.5); clip-path: polygon(50% 8%, 92% 88%, 8% 88%); }
.sb-svc-mark.sm.triangle::after { inset: 3px; }

/* generation banner */
.sb-genbar {
  margin-top: 16px; display: flex; align-items: center; gap: 16px;
  border: 1px solid var(--border); border-radius: 14px; padding: 12px 16px;
  background: var(--surface);
}
.sb-genbar-left { display: flex; align-items: center; gap: 11px; min-width: 280px; }
.sb-genbar-t { font-size: 14px; font-weight: 600; color: var(--text); }
.sb-genbar-s { font-family: var(--mono); font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.sb-genbar-bar { flex: 1; height: 5px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.sb-genbar-bar > div { height: 100%; background: linear-gradient(90deg, var(--accent-dim), var(--accent)); border-radius: 3px; transition: width 0.3s ease; }
.sb-regen-all {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  font-family: var(--mono); font-size: 12px; color: var(--text-2);
  border: 1px solid var(--border-strong); border-radius: 9px; padding: 7px 12px;
}
.sb-regen-all:hover { color: var(--accent); border-color: var(--accent-dim); }

.sb-tabs .sb-tab-count {
  margin-left: 7px; font-family: var(--mono); font-size: 10.5px;
  background: rgba(232,184,106,0.16); color: var(--accent);
  padding: 1px 6px; border-radius: 6px;
}
.sb-seq-loc { font-family: var(--mono); font-size: 11.5px; color: var(--text-3); margin: 14px 0 10px; display: inline-flex; align-items: center; gap: 7px; letter-spacing: 0.04em; }

/* frame grid */
.sb-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding-bottom: 6px; }
.sb-card { display: flex; flex-direction: column; gap: 8px; }
.sb-frame-wrap {
  position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--border); background: #050608;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.sb-card.ready .sb-frame-wrap { border-color: var(--border-strong); }
.sb-action { font-size: 12.5px; color: var(--text-2); line-height: 1.45; padding: 0 2px; text-wrap: pretty; }

/* the composed frame */
.sb-canvas { position: absolute; inset: 0; overflow: hidden; }
.sb-glow { position: absolute; width: 70%; height: 90%; transform: translate(-50%, -50%); filter: blur(2px); opacity: 0.9; pointer-events: none; }
.sb-stars {
  position: absolute; inset: 0; opacity: 0.5;
  background-image:
    radial-gradient(1px 1px at 20% 30%, rgba(255,255,255,0.8), transparent),
    radial-gradient(1px 1px at 70% 20%, rgba(255,255,255,0.6), transparent),
    radial-gradient(1px 1px at 45% 65%, rgba(255,255,255,0.5), transparent),
    radial-gradient(1px 1px at 85% 55%, rgba(255,255,255,0.7), transparent),
    radial-gradient(1px 1px at 30% 80%, rgba(255,255,255,0.45), transparent);
}
.sb-fog { position: absolute; left: 0; right: 0; bottom: 0; height: 34%; background: linear-gradient(0deg, rgba(232,184,106,0.14), transparent); }
.sb-beam { position: absolute; top: -10%; left: 18%; width: 36%; height: 130%; transform: rotate(16deg); background: linear-gradient(90deg, transparent, rgba(111,177,214,0.16), transparent); filter: blur(3px); }
.sb-shaft { position: absolute; top: -10%; width: 9%; height: 130%; transform: rotate(8deg); background: linear-gradient(90deg, transparent, rgba(200,210,220,0.12), transparent); filter: blur(2px); }
.sb-signal { position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; transform: translate(-50%,-50%); border-radius: 50%; background: var(--accent); box-shadow: 0 0 18px 4px rgba(232,184,106,0.7); animation: sb-blink 1.4s ease-in-out infinite; }
@keyframes sb-blink { 0%,100% { opacity: 0.5; } 50% { opacity: 1; } }

.sb-sil { position: absolute; }
.sb-sil-fill { position: absolute; inset: 0; }
.sb-lens { position: absolute; left: 50%; top: 50%; width: 14%; height: 26%; transform: translate(-50%,-50%); border-radius: 50%; box-shadow: 0 0 12px 2px rgba(232,184,106,0.7); }

.sb-grain { position: absolute; inset: 0; pointer-events: none; opacity: 0.5; mix-blend-mode: overlay;
  background-image: radial-gradient(rgba(255,255,255,0.07) 0.5px, transparent 0.5px); background-size: 3px 3px; }
.sb-vig { position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 70px 18px rgba(0,0,0,0.6); }
.sb-canvas::before, .sb-canvas::after { content: ''; position: absolute; left: 0; right: 0; height: 7%; background: #000; z-index: 3; }
.sb-canvas::before { top: 0; } .sb-canvas::after { bottom: 0; }
.sb-scan { position: absolute; inset: 0; z-index: 4; pointer-events: none; background: linear-gradient(180deg, transparent 0%, rgba(232,184,106,0.18) 48%, rgba(232,184,106,0.28) 50%, transparent 100%); animation: sb-scan-move 1.1s linear infinite; }
@keyframes sb-scan-move { 0% { transform: translateY(-100%); } 100% { transform: translateY(100%); } }
.sb-idle { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 5; }

/* HUD */
.sb-hud-tl, .sb-hud-tr, .sb-hud-bl, .sb-hud-br { position: absolute; z-index: 6; font-family: var(--mono); font-size: 10px; letter-spacing: 0.04em; }
.sb-hud-tl { top: 12%; left: 8px; color: rgba(255,255,255,0.78); background: rgba(0,0,0,0.4); padding: 2px 6px; border-radius: 5px; }
.sb-hud-tr { top: 12%; right: 8px; }
.sb-hud-bl { bottom: 12%; left: 8px; display: flex; align-items: center; gap: 6px; }
.sb-hud-br { bottom: 12%; right: 8px; color: rgba(255,255,255,0.62); background: rgba(0,0,0,0.4); padding: 2px 6px; border-radius: 5px; }
.sb-shotnum { color: #1a1108; background: var(--accent); padding: 2px 6px; border-radius: 5px; font-weight: 600; }
.sb-shottype { color: rgba(255,255,255,0.85); background: rgba(0,0,0,0.45); padding: 2px 6px; border-radius: 5px; }
.sb-reroll { display: inline-flex; width: 24px; height: 24px; align-items: center; justify-content: center; border-radius: 6px; background: rgba(0,0,0,0.5); color: rgba(255,255,255,0.8); border: 1px solid rgba(255,255,255,0.14); }
.sb-reroll:hover { color: var(--accent); border-color: var(--accent-dim); }
.sb-rendering-tag, .sb-pending-tag { position: absolute; z-index: 6; left: 50%; bottom: 12%; transform: translateX(-50%); font-family: var(--mono); font-size: 11px; color: var(--accent); display: inline-flex; align-items: center; gap: 7px; background: rgba(0,0,0,0.5); padding: 4px 10px; border-radius: 8px; }
.sb-pending-tag { color: var(--text-3); }

.sb-card.ready .sb-frame-wrap { animation: sb-pop 0.4s ease; }
@keyframes sb-pop { 0% { opacity: 0; transform: scale(0.97); } 100% { opacity: 1; transform: scale(1); } }

.sb-demo-wait { display: inline-flex; align-items: center; gap: 9px; font-family: var(--mono); font-size: 13px; color: var(--text-2); padding: 10px 16px; }

/* ============================================================
   RESPONSIVE OVERRIDE — 아이패드 목업(외곽 프레임·카메라·배터리 status bar)을
   제거하고 각 플랫폼 뷰포트(데스크톱/iOS)에 맞춘다.
   롤백: 이 블록 전체를 삭제하고 index.html의 viewport를
   content="width=1280" 으로 되돌리면 원래 아이패드 목업으로 복귀한다.
   ============================================================ */
#root {
  padding: 0;
  background: var(--bg);
  align-items: stretch;
}
.ipad-frame {
  width: 100%;
  height: 100vh;
  height: 100dvh;          /* iOS 주소창 변동 대응 */
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  background: var(--bg);
}
.ipad-frame .camera { display: none; }   /* 카메라 노치 제거 */
/* 풀블리드 웹앱이라도 콘텐츠는 iPad 원본 설계폭(1280px)으로 중앙 정렬 상한을 둔다.
   넓은 데스크톱에서 그리드가 과도하게 늘어나 선택 카드의 scale(1.10) 팝이
   좌측 패딩을 넘어 잘리던 좌우 불균형을 근본적으로 해소한다. 1280px 미만에선
   max-width가 개입하지 않아 iPad·폰 레이아웃은 기존 그대로 유지된다. */
.ipad-screen { border-radius: 0; max-width: 1280px; margin-inline: auto; }
.status-bar { display: none; }           /* 시계·배터리·wifi 상태바 제거 */
.ipad-screen > .screen { padding-top: env(safe-area-inset-top, 0px); }  /* iOS 노치 안전영역 — App 바깥 래퍼에만.
   내부 화면 루트는 base .screen의 28px 유지(구 인라인 paddingTop:28과 동일 동작) */
.proc-overlay { top: env(safe-area-inset-top, 0px); }

/* ── 샘플 레일 반응형: 좌측 레일(56px 여백+150px 카드+화살표)과 중앙 720px
   카드가 겹치지 않으려면 스테이지 최소 1220px 필요. 그보다 좁으면(태블릿·
   좁은 데스크톱 창·폰 공통) 스택을 상단 가로 row 흐름 배치로 강등 —
   절대좌표가 없으니 어떤 폭에서도 겹침이 구조적으로 불가능 ── */
@media (max-width: 1219px) {
  .ipad-screen .material-stage { flex-direction: column; }
  .ipad-screen .sample-stack {
    position: static; transform: none;
    flex-direction: row; justify-content: center; align-items: flex-start;
    gap: 20px; padding: 12px 16px 0;
  }
  .ipad-screen .sample-stack .sample-file-label { max-width: 150px; overflow-wrap: anywhere; text-align: center; }
  /* justify center는 내용이 영역보다 크면 위로 균등 오버플로해 상단 스택을
     침범한다(스크롤 불가 영역 생성) → 스택 모드에선 위에서부터 흐르게 */
  .ipad-screen .compose-material { justify-content: flex-start; }
  .ipad-screen .material-stage .drag-arrow {
    position: static; align-self: center; margin: 4px 0;
    transform: rotate(90deg);
    animation: drag-arrow-nudge-down 1.6s ease-in-out infinite;
  }
  @keyframes drag-arrow-nudge-down {
    0%, 100% { transform: rotate(90deg) translateX(0); opacity: 0.6; }
    50%      { transform: rotate(90deg) translateX(9px); opacity: 1; }
  }
}

/* ============================================================
   MOBILE RESPONSIVE — 아이폰 세로(좁은 폭)·가로(낮은 높이) 대응.
   1180×820 가로 고정 레이아웃을 폰에서 세로 스택 + 스크롤로 전환.
   아이패드(>700px,>500h)는 기존 레이아웃 유지. 롤백: 이 블록 삭제.
   ============================================================ */

/* ── 폰 세로/가로 공통: 고정 높이 해제 + 스크롤 허용 ── */
@media (max-width: 700px), (max-height: 500px) {
  html {
    overflow-x: hidden;
    overflow-y: auto;
    height: auto;
    min-height: 100dvh;
  }
  /* body에 overflow를 주면 body가 sticky의 기준 스크롤 컨테이너가 되어
     (실제 스크롤은 html) 하단 sticky CTA가 전부 죽는다 — overflow-x는
     스크롤 컨테이너를 만들지 않는 clip으로만 가드 */
  body {
    overflow: visible;
    overflow-x: clip;
    height: auto;
    min-height: 100dvh;
  }
  #root {
    align-items: stretch;
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }
  .ipad-frame {
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }
  .ipad-screen {
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }
  .screen {
    position: relative;
    inset: auto;
    min-height: 100dvh;
    overflow: visible;
  }
}

/* ── 폰 세로(좁은 폭): 가로 다열 grid → 1열 세로 스택 ── */
@media (max-width: 700px) {
  .ipad-screen [class*="grid"],
  .ipad-screen [class*="-layout"],
  .ipad-screen [class*="-body"],
  .ipad-screen [class*="metric"],
  .ipad-screen [class*="stats"],
  .ipad-screen .stage-radar,        /* TONE RADAR: 1fr 240px 고정 2열 → 세로에서 우측 리스트 잘림 */
  .ipad-screen .single-meta,
  .ipad-screen .ai-sheet-row {
    /* minmax(0,1fr) 필수 — 1fr(=minmax(auto,1fr))은 자식 min-content가 트랙을
       뷰포트 밖으로 밀어내 카드 우측 잘림을 만든다 (stage-radar에서 실측된 근본 원인의 전역화) */
    grid-template-columns: minmax(0, 1fr) !important;
    grid-auto-rows: min-content !important;  /* 행 높이를 내용 기준으로 → 빈 공간/과대 카드 방지 */
    align-items: start !important;
  }
  /* 폴드된 컨테이너·카드 자식의 min-width:auto 바닥 전역 해제 + 이미지 클램프
     — 어떤 카드든 내용물이 뷰포트보다 넓어질 수 없게 하는 전역 가드 */
  .ipad-screen [class*="grid"] > *, .ipad-screen [class*="-layout"] > *,
  .ipad-screen [class*="-body"] > *, .ipad-screen [class*="card"] > * { min-width: 0; }
  .ipad-screen img { max-width: 100%; }
  /* 카드 헤더(제목 + 우측 컨트롤) 행: 좁은 폭에선 줄바꿈 허용 — 컨트롤이 카드 밖으로 밀리지 않게 */
  .ipad-screen .detail-head, .ipad-screen .char-hero-row,
  .ipad-screen [class*="-head"] { flex-wrap: wrap; row-gap: 8px; }
  .ipad-screen .char-preview { padding-inline: 16px !important; }
  /* radar SVG 고정 320px → 화면폭에 맞춰 축소(viewBox 0 0 320 320이라 비율 유지).
     100% 상한: svg가 그리드 컬럼(=카드 내부폭)을 넘지 않게 */
  .ipad-screen .stage-radar svg { width: min(320px, 72vw, 100%) !important; height: auto !important; }
  .ipad-screen .stage-radar .radar-svg-wrap { justify-content: center; }
  .ipad-screen .analyze-single { padding-inline: 20px !important; }
  .ipad-screen .ana-stage-card { padding-inline: 22px !important; }
  .ipad-screen .tone-item > span:first-child { min-width: 0; overflow-wrap: anywhere; }
  /* 결과 요약 4열 stat 카드 → 세로에선 2×2(1열은 너무 길어짐). 좌우 패딩도 축소 */
  .ipad-screen .stat-cards-row { grid-template-columns: 1fr 1fr !important; padding: 0 16px !important; }
  /* 드래그 고스트는 wide 레이아웃 기준 JS 좌표라 모바일에선 숨김(정적 화살표로 방향 전달) */
  .drag-ghost { display: none !important; }
  /* 고정폭 720px 모달 → 화면 폭에 맞춤 */
  /* 진행/완료 팝업: 중앙 dim 오버레이 → 화면 하단 시트로 통일(뒤 카드 안 가림) */
  .sheet-overlay {
    align-items: flex-end;
    background: transparent;
    padding: 12px;
    pointer-events: none;
  }
  .sheet-card {
    width: 100%;
    max-width: 480px;
    pointer-events: auto;
  }
  /* ── 상단 내비 바 전역: 고정 64px + absolute 중앙 제목이 좁은 폭에서 2줄로
     겹치며 좌우 버튼과 세로 정렬이 깨짐 → 흐름 배치 + 제목 1줄 말줄임 + 버튼 줄바꿈 금지 */
  .ipad-screen .navbar { height: auto; min-height: 56px; padding: 10px 16px; gap: 10px; }
  .nav-title {
    position: static; transform: none;
    flex: 1; min-width: 0; text-align: center;
    font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .ipad-screen .nav-back, .ipad-screen .nav-right {
    display: inline-flex; align-items: center; gap: 6px;
    white-space: nowrap; flex-shrink: 0;
    font-size: 14px;  /* 제목 말줄임 공간 확보 — 긴 back 라벨이 제목을 다 먹지 않게 */
  }
  /* 우선순위: 현재 화면 제목 > back 라벨 — 긴 back 라벨 쪽을 말줄임 */
  .ipad-screen .nav-back-label {
    max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  /* ── 선택 스케일 팝(±10%) 전역 해제: 좁은 세로 레이아웃에선 스케일 차이가
     "정렬이 어긋난" 것으로 보인다. 선택 상태는 색·테두리·체크로 이미 전달됨 */
  .ipad-screen .path-card, .ipad-screen .type-tab, .ipad-screen .reftype-tab,
  .ipad-screen .char-tab, .ipad-screen .seg-btn, .ipad-screen .aspect-chip { transform: none !important; }
  /* ── 캐릭터/보이스 등 대형 탭(TabRow): wrap 스택 대신 풀폭 세로 리스트로 정렬 통일 */
  .ipad-screen .char-tabs-row { flex-direction: column; align-items: stretch; width: 100%; }
  .ipad-screen .char-tabs-row .char-tab { justify-content: flex-start; }
  /* 상단 nav 브레드크럼(FEATURE · LOGLINE › THREE-ACT SPINE › …)이 nowrap이라 세로에서
     오른쪽으로 넘쳐 nav-right(Analyze/Next)를 화면 밖으로 밀어냄 → 긴 경로/구분점만 숨기고 FEATURE 배지·좌우 버튼은 유지 */
  .ipad-screen .compose-nav-meta .fmt-path,
  .ipad-screen .compose-nav-meta .fmt-dot { display: none !important; }
  .ipad-screen .compose-nav-meta { min-width: 0; overflow: hidden; }
  /* 분석 상태칩(reading·tone radar 등 모든 pass 상단): min-width 460px 고정이라 세로에서 넘침
     → 화면폭에 맞추고 진행 row/phase 칩은 wrap 허용 */
  .ipad-screen .proc-chip { min-width: 0 !important; max-width: calc(100% - 20px) !important; padding: 12px 14px 14px !important; }
  .ipad-screen .proc-chip-row { white-space: normal; flex-wrap: wrap; }
  .ipad-screen .proc-chip-phases { flex-wrap: wrap; }
  /* 결과 요약(Here's what we found): rs-main flex 2열(좌 flex:1 + 우 stats 고정 240px) → 세로 스택 */
  .ipad-screen .rs-main { flex-direction: column; }
  .ipad-screen .rs-stats { width: 100% !important; flex: none; }
  /* 결과 추천 reference 매치 행(30 34 1fr 120 46 5열): mr-main 1fr이 안 줄어 넘침
     → 세로에선 3열(순위|내용|%)로 접고 타입아이콘·진행바 숨김, 내용 줄바꿈 허용 */
  .ipad-screen .match-list { padding: 0 16px 20px !important; }
  .ipad-screen .match-row { grid-template-columns: 24px 1fr auto !important; gap: 10px !important; padding: 10px 12px !important; }
  .ipad-screen .match-row .mr-type, .ipad-screen .match-row .mr-bar { display: none !important; }
  .ipad-screen .match-row .mr-main { min-width: 0; }
  .ipad-screen .match-row .mr-title { flex-wrap: wrap; }
  /* 하단 액션 푸터(cta-bar, 다수 화면 공유): info(flex:1)+버튼이 세로폭 초과 → wrap 허용 + 패딩 축소
     (투어 모드에선 advance 알약이 이미 우하단 고정이라 더 여유) */
  .ipad-screen .cta-bar { flex-wrap: wrap; padding: 12px 16px 16px !important; gap: 8px; }
  .ipad-screen .cta-bar .info { flex-basis: 100%; }
  /* ★ 하단 advance 푸터 고정 통일: 세로 전체스크롤 시 같이 밀려 내려가던 것 → 화면 하단 sticky 고정.
     (일부 화면 고정/일부 따라옴 불일치 해소. 투어 알약은 별도 우하단 fixed) */
  .ipad-screen .cta-bar,
  .ipad-screen .compose-footer,
  .ipad-screen .paste-footer {
    position: sticky; bottom: 0; z-index: 20;
    background: var(--bg);
    box-shadow: 0 -8px 20px rgba(0,0,0,0.35);
  }
  /* 가로 탭/카테고리 행(reference picker·character·voice 등): nowrap flex라 탭이 화면 밖으로 넘침
     → 세로에선 wrap 허용(모든 탭 보이게) + 좌우 패딩 축소 */
  .ipad-screen .reftype-tabs,
  .ipad-screen .type-tabs,
  .ipad-screen .char-tabs-row,
  .ipad-screen .tab-row { flex-wrap: wrap !important; padding-left: 16px !important; padding-right: 16px !important; row-gap: 8px; }
  /* 세그먼트 컨트롤(character 등): flex-shrink:0이라 세로에서 소폭 넘침 → 줄어들게 허용 */
  .ipad-screen .mode-seg { flex-shrink: 1; min-width: 0; }
  /* 홈 액션 3버튼(Demo·Start·Current): 가로 고정배치가 좁은 폭에서 우측 잘림 → 줄바꿈+중앙 */
  .ipad-screen .home-actions { flex-wrap: wrap; justify-content: center; row-gap: 10px; }
  /* 설정 화면 포맷 카드: 세로 스택에선 아이콘 좌·텍스트 우 가로형으로 압축 —
     카드 3장 세로 높이를 최소화해 하단 CTA가 스크롤 없이 보이게 */
  .ipad-screen .format-card { flex-direction: row; align-items: center; gap: 14px; padding: 14px 16px; }
  .ipad-screen .format-card .fc-name { font-size: 16px; }
  .ipad-screen .format-card.sel,
  .ipad-screen .format-card.sel:hover { transform: none; }  /* 풀폭 카드 scale(1.1)은 뷰포트 넘침 */
  /* compose 푸터: 데스크톱 우측정렬 CTA → 모바일 풀폭 버튼(다른 화면 cta-bar 패턴과 일관) */
  .ipad-screen .compose-footer { padding: 12px 16px 16px; }
  .ipad-screen .compose-footer .btn-pri { flex: 1; justify-content: center; }
  /* compose 업로드 본문 좌우 패딩 40→16 대칭(전 화면 16px 기준선과 일관) */
  .ipad-screen .compose-material { padding: 0 16px 16px; }
  /* 3D 로딩 카드가 sticky 하단 CTA 뒤에 가려지지 않도록 뷰포트 상단에 둔다. */
  .ipad-screen .v3d-model-loading { align-items: flex-start; justify-content: center; padding-top: 64px; }
}

/* ── wireframe 3D 메쉬: 정사각 격자(28×28) + cover(긴 변 정렬)로 모든 뷰포트 전체 커버.
   cover는 app.js의 Math.max(cellW,cellH)로 처리하고, canvas 컨테이너는 화면 크기를 유지한다.
   (가로 고정 28×18 + Math.min(contain) 조합이 상하 여백의 원인이었음) */

/* ═══════════════════════════════════════════════════════════ */
/* KEY ART reveal — 캐릭터 디자인 확정 → 티저 원시트(one-sheet)      */
/* ═══════════════════════════════════════════════════════════ */
.keyart-body {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: 4px 40px 20px;
  display: flex; flex-direction: column;
}
.keyart-head { margin-bottom: 16px; flex-shrink: 0; }
.keyart-eyebrow {
  font-family: var(--mono); font-size: 11.5px; color: var(--accent);
  letter-spacing: 0.05em; margin-bottom: 6px;
}
.keyart-title { font-size: 26px; font-weight: 700; letter-spacing: -0.03em; margin: 4px 0 6px; }
.keyart-sub { font-size: 13.5px; color: var(--text-2); margin: 0; max-width: 720px; line-height: 1.5; }

.keyart-layout {
  flex: 1; min-height: 0;
  display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px;
  align-items: center;
}
.keyart-frame {
  height: 100%; min-height: 0;
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.keyart-frame::before {
  content: ''; position: absolute;
  width: 62%; height: 74%;
  background: radial-gradient(circle, rgba(111,177,214,0.30) 0%, transparent 68%);
  filter: blur(46px); z-index: 0;
  animation: keyartGlow 4.5s ease-in-out infinite;
}
.keyart-img {
  position: relative; z-index: 1;
  max-height: min(540px, 100%); max-width: 100%;
  width: auto; height: auto;
  border-radius: 10px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.62), 0 0 0 1px rgba(255,255,255,0.06);
  animation: keyartReveal 1.15s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
@keyframes keyartReveal {
  0%   { opacity: 0; transform: scale(0.94) translateY(14px); filter: brightness(0.35); }
  100% { opacity: 1; transform: scale(1) translateY(0); filter: brightness(1); }
}
@keyframes keyartGlow {
  0%, 100% { opacity: 0.65; }
  50%      { opacity: 1; }
}
.keyart-side { display: flex; flex-direction: column; gap: 12px; }
.keyart-src { display: flex; flex-wrap: wrap; gap: 6px; }
.keyart-chip {
  font-family: var(--mono); font-size: 10.5px; color: var(--text-2);
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 6px; padding: 4px 8px; letter-spacing: 0.02em;
}

/* ═══════════════════════════════════════════════════════════ */
/* Character AI sheets — full-sheet thumbnail + 1K lightbox      */
/* ═══════════════════════════════════════════════════════════ */
.sheet-full {
  flex: 1; position: relative; display: block; width: 100%; padding: 0;
  border: 1px solid var(--border); border-radius: 8px;
  background: rgba(0,0,0,0.28); overflow: hidden; cursor: pointer;
  transition: border-color .15s ease;
}
.sheet-full img { width: 100%; height: 100%; object-fit: contain; display: block; }
.sheet-full:hover { border-color: var(--accent); }
.sheet-full:hover .sheet-full-zoom { background: var(--accent); color: #1a1108; border-color: var(--accent); }
.sheet-full-zoom {
  position: absolute; right: 7px; bottom: 7px; pointer-events: none;
  font-family: var(--mono); font-size: 8.5px; letter-spacing: 0.06em; color: var(--text-2);
  background: rgba(0,0,0,0.6); border: 1px solid var(--border-strong); border-radius: 5px;
  padding: 3px 6px; transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.sheet-lightbox {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(4,5,8,0.82); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; padding: 32px;
  animation: sheetFadeIn .18s ease;
}
@keyframes sheetFadeIn { from { opacity: 0; } to { opacity: 1; } }
.sheet-lightbox-inner {
  position: relative; max-width: min(1100px, 96vw); max-height: 92vh;
  display: flex; flex-direction: column; gap: 10px;
}
.sheet-lightbox-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sheet-lightbox-title {
  font-family: var(--mono); font-size: 12px; color: var(--text-2); letter-spacing: 0.03em;
  display: inline-flex; align-items: center; gap: 7px;
}
.sheet-lightbox-close {
  width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); border: 1px solid var(--border-strong); color: var(--text); cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.sheet-lightbox-close:hover { background: var(--surface-3); border-color: var(--accent); }
.sheet-lightbox-img {
  max-width: 100%; max-height: calc(92vh - 50px); object-fit: contain; display: block; margin: 0 auto;
  border-radius: 10px; box-shadow: 0 30px 80px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,255,255,0.06);
}
