:root {
  color-scheme: dark;
  --bg: #06101b;
  --panel: rgba(8, 25, 39, .86);
  --panel-strong: #0b2234;
  --line: rgba(125, 200, 228, .18);
  --line-strong: rgba(78, 209, 255, .42);
  --text: #eefaff;
  --muted: #8fb0bf;
  --blue: #43cfff;
  --mint: #65e6d0;
  --amber: #ffc56b;
  --danger: #ff7a88;
  --shadow: 0 20px 60px rgba(0, 0, 0, .28);
  font-family: Inter, Pretendard, "Noto Sans KR", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; color: var(--text); background: var(--bg); font-size: 15px; }
button, textarea, select, input { font: inherit; }
button { color: inherit; }
.space-glow { position: fixed; inset: 0; pointer-events: none; background: radial-gradient(circle at 62% -10%, rgba(0, 142, 220, .22), transparent 34%), radial-gradient(circle at 35% 80%, rgba(26, 93, 132, .1), transparent 32%), linear-gradient(115deg, transparent 30%, rgba(75, 201, 255, .035) 50%, transparent 70%); }
.space-glow::after { content: ""; position: absolute; inset: 0; opacity: .22; background-image: radial-gradient(#bfeeff 1px, transparent 1px); background-size: 46px 46px; mask-image: linear-gradient(to bottom, black, transparent 82%); }
.topbar { position: relative; z-index: 2; height: 72px; display: flex; align-items: center; justify-content: space-between; padding: 0 28px; border-bottom: 1px solid var(--line); background: rgba(3, 14, 24, .88); backdrop-filter: blur(16px); }
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; letter-spacing: .08em; }
.brand-mark { width: 39px; height: 39px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 50%; font-size: 12px; font-weight: 800; box-shadow: inset 0 0 18px rgba(67, 207, 255, .16); }
.brand b { display: block; font-size: 15px; }.brand small { display: block; margin-top: 3px; color: #6ba5bd; font-size: 9px; letter-spacing: .2em; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.engine-badge, .ghost-button, .language-button { height: 34px; border: 1px solid var(--line); border-radius: 7px; background: rgba(8, 29, 44, .7); }
.engine-badge { display: flex; align-items: center; gap: 8px; padding: 0 12px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .08em; }
.engine-badge i { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 12px currentColor; }.engine-badge.ready i { background: var(--mint); }.engine-badge.error i { background: var(--danger); }
.ghost-button, .language-button { cursor: pointer; padding: 0 13px; color: #b7d2de; font-size: 11px; font-weight: 800; letter-spacing: .08em; }.ghost-button:hover, .language-button:hover { border-color: var(--blue); color: white; }
.language-button { width: 44px; padding: 0; }
.shell { position: relative; z-index: 1; display: grid; grid-template-columns: 238px minmax(0, 1fr); min-height: calc(100vh - 72px); }
.rail { display: flex; flex-direction: column; padding: 28px 20px 22px; border-right: 1px solid var(--line); background: rgba(4, 16, 27, .72); }
.project-label, .eyebrow, .card-kicker { color: #62b8d8; font-size: 10px; font-weight: 800; letter-spacing: .15em; }
.rail h1 { margin: 10px 0 8px; font-size: 26px; line-height: 1.02; letter-spacing: .02em; }.rail > p { min-height: 38px; margin: 0 0 22px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.workflow-nav { display: grid; gap: 7px; }.workflow-step { display: grid; grid-template-columns: 30px 1fr; grid-template-rows: 20px 18px; align-items: center; width: 100%; padding: 10px 9px; cursor: pointer; text-align: left; border: 1px solid transparent; border-radius: 8px; background: transparent; }.workflow-step:hover:not(:disabled) { background: rgba(48, 157, 202, .07); }.workflow-step.active { border-color: var(--line-strong); background: linear-gradient(90deg, rgba(41, 156, 203, .16), rgba(28, 99, 131, .04)); }.workflow-step:disabled { opacity: .38; cursor: not-allowed; }.workflow-step > span { grid-row: 1 / 3; color: #4b8095; font-size: 10px; font-weight: 800; }.workflow-step b { font-size: 13px; }.workflow-step small { color: var(--muted); font-size: 10px; }
.rail-note { margin-top: auto; padding: 13px; border: 1px solid var(--line); border-radius: 8px; background: rgba(7, 35, 51, .5); }.rail-note span { color: var(--mint); font-size: 9px; font-weight: 900; letter-spacing: .14em; }.rail-note p { margin: 7px 0 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.workspace { padding: 30px clamp(22px, 3vw, 48px) 50px; overflow: hidden; }.workspace-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; padding-bottom: 20px; }.workspace-head h2 { margin: 7px 0; font-size: clamp(23px, 2vw, 31px); }.workspace-head p { margin: 0; color: var(--muted); font-size: 13px; }.progress-block { display: grid; grid-template-columns: auto auto; align-items: end; column-gap: 8px; color: var(--muted); }.progress-block strong { grid-row: 1 / 3; color: var(--blue); font-size: 28px; }.progress-block span { font-size: 10px; }
.notice { display: none; margin-bottom: 14px; padding: 11px 14px; border: 1px solid var(--line-strong); border-radius: 7px; color: #cdebf5; background: rgba(19, 92, 122, .22); }.notice.show { display: block; }.notice.error { border-color: rgba(255, 122, 136, .5); color: #ffd3d8; background: rgba(120, 26, 41, .22); }
.stage-panel { display: none; }.stage-panel.active { display: block; animation: stage-in .22s ease-out; }@keyframes stage-in { from { opacity: 0; transform: translateY(4px); } }
.editor-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(270px, .7fr); gap: 14px; }.production-grid { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 14px; }.continuity-layout, .prompt-layout, .render-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(290px, .7fr); gap: 14px; }
.card { border: 1px solid var(--line); border-radius: 10px; background: var(--panel); box-shadow: var(--shadow); }.card-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 17px 18px; border-bottom: 1px solid var(--line); }.card h3 { margin: 5px 0 0; font-size: 16px; }.status-chip, .count-badge { padding: 5px 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 10px; font-weight: 800; }.status-chip.approved { color: var(--mint); border-color: rgba(101, 230, 208, .28); background: rgba(34, 131, 118, .12); }.count-badge { min-width: 28px; text-align: center; }
.screenplay-card textarea { display: block; width: 100%; height: min(55vh, 520px); resize: vertical; padding: 22px; color: #dfedf2; border: 0; outline: 0; background: rgba(2, 12, 19, .4); line-height: 1.85; }.text-meta { display: flex; justify-content: space-between; padding: 10px 18px; color: var(--muted); font-size: 10px; border-top: 1px solid var(--line); }
.decision-card { padding: 20px; }.decision-card h3 { margin-bottom: 18px; font-size: 19px; }.decision-card ul { display: grid; gap: 11px; margin: 0 0 22px; padding: 0; list-style: none; color: #b8d0da; font-size: 12px; }.decision-card li::before { content: "✓"; margin-right: 8px; color: var(--mint); }.confirm-row { display: flex; gap: 9px; align-items: flex-start; margin: 18px 0; color: var(--muted); font-size: 11px; line-height: 1.45; }.confirm-row input { margin-top: 2px; accent-color: var(--blue); }
.primary-button, .next-button { cursor: pointer; border: 1px solid rgba(67, 207, 255, .5); border-radius: 7px; color: #03111a; background: linear-gradient(135deg, #61ddff, #4ca9e4); font-weight: 850; }.primary-button { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 12px 14px; }.primary-button:hover, .next-button:hover { filter: brightness(1.08); }.primary-button:disabled { opacity: .45; cursor: wait; }.request-meta { min-height: 32px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.explorer-card { min-height: 600px; overflow: hidden; }.segment-list { padding: 10px; }.segment { margin-bottom: 8px; }.segment-head { display: flex; align-items: center; justify-content: space-between; padding: 9px; color: #d9edf4; border-radius: 6px; background: rgba(35, 95, 121, .12); font-size: 11px; }.segment-head span { color: var(--mint); font-size: 9px; }.shot-link { display: block; width: calc(100% - 12px); margin: 5px 0 0 12px; padding: 9px 10px; cursor: pointer; text-align: left; border: 1px solid transparent; border-radius: 6px; color: var(--muted); background: transparent; font-size: 11px; }.shot-link:hover, .shot-link.active { color: white; border-color: var(--line); background: rgba(64, 181, 225, .1); }.shot-link b { display: block; color: inherit; font-size: 10px; }.shot-link small { display: block; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shot-card { min-height: 600px; }.shot-editor { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; padding: 18px; }.shot-editor.empty-state { display: grid; min-height: 480px; place-items: center; color: var(--muted); }.field { display: grid; gap: 6px; }.field.wide { grid-column: 1 / -1; }.field span { color: #6ca5bc; font-size: 9px; font-weight: 800; letter-spacing: .1em; }.field input, .field textarea { width: 100%; color: #dfedf2; border: 1px solid var(--line); border-radius: 6px; outline: 0; background: rgba(1, 10, 16, .55); padding: 10px; }.field textarea { min-height: 78px; resize: vertical; line-height: 1.55; }.field input:focus, .field textarea:focus { border-color: var(--blue); }
.stage-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 13px 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }.next-button { padding: 9px 12px; }.next-button.full { width: 100%; margin-top: 14px; padding: 11px; }
.continuity-card { overflow: hidden; }.continuity-rows { padding: 10px 16px 18px; }.continuity-row { display: grid; grid-template-columns: 76px minmax(110px, .8fr) minmax(160px, 1.5fr); gap: 10px; align-items: center; padding: 13px 5px; border-bottom: 1px solid var(--line); }.continuity-row > b { color: var(--blue); font-size: 10px; }.continuity-row > span { font-size: 11px; }.asset-pills { display: flex; flex-wrap: wrap; gap: 5px; }.asset-pill { padding: 5px 7px; border-radius: 999px; color: var(--mint); background: rgba(49, 152, 138, .12); border: 1px solid rgba(101, 230, 208, .18); font-size: 9px; font-weight: 750; }.library-card { padding: 18px; }.asset-library { display: grid; gap: 9px; margin-top: 14px; }.asset-item { display: grid; grid-template-columns: 42px 1fr; gap: 10px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 7px; background: rgba(2, 12, 19, .38); }.asset-thumb { width: 42px; height: 42px; object-fit: cover; border-radius: 5px; background: #102d3e; }.asset-item b { display: block; font-size: 10px; }.asset-item span { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }
.common-prompt-card, .shot-prompt-card { padding: 18px; }.common-prompt-card label { display: grid; gap: 6px; margin-top: 15px; }.common-prompt-card label span { color: #6ca5bc; font-size: 9px; font-weight: 800; }.common-prompt-card textarea, .shot-prompt-card textarea { width: 100%; resize: vertical; color: #dcecf2; border: 1px solid var(--line); border-radius: 7px; outline: 0; background: rgba(1, 10, 16, .55); padding: 12px; line-height: 1.6; }.common-prompt-card textarea { min-height: 116px; }.shot-prompt-card .card-head { margin: -18px -18px 0; }.shot-prompt-card select { max-width: 180px; color: #dcecf2; border: 1px solid var(--line); border-radius: 6px; background: #0a2233; padding: 7px; }.prompt-tabs { display: flex; gap: 6px; margin: 16px 0 10px; }.prompt-tabs button { padding: 6px 9px; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); background: transparent; font-size: 9px; }.prompt-tabs button.active { color: var(--blue); border-color: var(--line-strong); }.shot-prompt-card > textarea { min-height: 240px; }.shot-prompt-card .stage-footer { margin: 15px -18px -18px; }.layer-strip { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }.layer-strip span { padding: 5px 7px; color: #75a9bc; border: 1px solid var(--line); border-radius: 4px; font-size: 8px; }
.render-preview { overflow: hidden; }.preview-image { position: relative; aspect-ratio: 16 / 8.5; background: #02070b; }.preview-image img { width: 100%; height: 100%; object-fit: cover; opacity: .88; }.preview-image > span { position: absolute; left: 14px; bottom: 12px; padding: 5px 8px; border-radius: 4px; background: rgba(2, 12, 19, .78); color: var(--muted); font-size: 9px; }.render-summary { border-top: 1px solid var(--line); border-bottom: 0; }.cost-row { display: flex; justify-content: space-between; gap: 15px; padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 11px; }.cost-row strong { color: #dcecf2; }.cost-row.total { margin-bottom: 18px; }.cost-row.total strong { color: var(--mint); font-size: 18px; }.render-history { display: grid; gap: 7px; margin-top: 14px; }.history-item { display: flex; justify-content: space-between; padding: 9px; border: 1px solid rgba(101, 230, 208, .18); border-radius: 6px; color: var(--muted); background: rgba(28, 98, 87, .1); font-size: 10px; }.history-item b { color: var(--mint); }
dialog { width: min(580px, calc(100vw - 30px)); padding: 0; color: var(--text); border: 1px solid var(--line-strong); border-radius: 12px; background: #0a1d2b; box-shadow: 0 30px 100px #000; }dialog::backdrop { background: rgba(0, 7, 12, .8); backdrop-filter: blur(5px); }dialog form { padding: 22px; }.dialog-head { display: flex; justify-content: space-between; gap: 20px; }.dialog-head h2 { margin: 6px 0 12px; }.dialog-head > button { width: 34px; height: 34px; cursor: pointer; border: 1px solid var(--line); border-radius: 50%; background: transparent; }dialog p { color: var(--muted); line-height: 1.6; }dialog pre { padding: 14px; overflow-x: auto; color: #b9dae6; border: 1px solid var(--line); border-radius: 7px; background: #041019; font-size: 11px; line-height: 1.65; }.security-note { display: grid; gap: 5px; margin: 14px 0; padding: 12px; border-left: 2px solid var(--mint); color: var(--muted); background: rgba(44, 134, 121, .1); font-size: 11px; }.security-note b { color: var(--mint); }

@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }.rail { padding: 18px; border-right: 0; border-bottom: 1px solid var(--line); }.rail h1 { font-size: 20px; }.rail > p, .rail-note { display: none; }.workflow-nav { grid-template-columns: repeat(5, 1fr); }.workflow-step { grid-template-columns: 1fr; grid-template-rows: auto auto; text-align: center; }.workflow-step > span { grid-row: auto; }.workflow-step small { display: none; }.workspace { padding: 24px 18px 40px; }.editor-grid, .continuity-layout, .prompt-layout, .render-grid { grid-template-columns: 1fr; }.production-grid { grid-template-columns: 235px minmax(0, 1fr); }
}
@media (max-width: 680px) {
  .topbar { height: 62px; padding: 0 14px; }.brand small, .engine-badge span, .ghost-button { display: none; }.engine-badge { width: 34px; padding: 0; justify-content: center; }.shell { min-height: calc(100vh - 62px); }.rail { overflow-x: auto; }.workflow-nav { min-width: 520px; }.workspace-head { align-items: flex-start; }.progress-block { display: none; }.production-grid { grid-template-columns: 1fr; }.explorer-card { min-height: auto; }.shot-card { min-height: 480px; }.shot-editor { grid-template-columns: 1fr; }.field.wide { grid-column: auto; }.continuity-row { grid-template-columns: 65px 1fr; }.continuity-row .asset-pills { grid-column: 1 / -1; }.stage-footer { align-items: stretch; flex-direction: column; }.next-button { width: 100%; }.screenplay-card textarea { height: 410px; }
}

/* Self-hosted demo uses CSS-native previews so deployment does not depend on private media. */
.asset-thumb { display: grid; place-items: center; color: var(--blue); background: linear-gradient(135deg, #102d3e, #0b1c2a); font-size: 10px; font-weight: 900; }
.preview-image { padding: 18px; background: radial-gradient(circle at 65% 35%, rgba(55, 190, 255, .22), transparent 27%), #02070b; }
.storyboard-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: 100%; height: 100%; }
.storyboard-grid i { border: 1px solid rgba(111, 208, 242, .2); border-radius: 5px; background: linear-gradient(145deg, rgba(30, 105, 139, .36), rgba(4, 18, 28, .7)); }
.storyboard-grid i:nth-child(2), .storyboard-grid i:nth-child(5) { background: radial-gradient(circle at 60% 42%, rgba(104, 225, 255, .42), transparent 12%), linear-gradient(145deg, rgba(30, 105, 139, .36), rgba(4, 18, 28, .7)); }
