:root {
  color-scheme: light;
  --bg: #f5f5fb;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-solid: #ffffff;
  --surface-2: #f0eff8;
  --ink: #17182b;
  --muted: #6f7187;
  --line: rgba(77, 72, 118, 0.14);
  --line-strong: rgba(109, 74, 255, 0.3);
  --primary: #6d4aff;
  --primary-2: #a43ce8;
  --accent: #16bfe5;
  --pink: #ee4ab9;
  --success: #17a87b;
  --warning: #ef8b34;
  --danger: #e24e64;
  --shadow: 0 18px 50px rgba(56, 42, 110, 0.12);
  --shadow-soft: 0 8px 28px rgba(56, 42, 110, 0.08);
  --gradient: linear-gradient(135deg, #6d4aff 0%, #a83de5 52%, #19bfe5 100%);
  --gradient-soft: linear-gradient(135deg, rgba(109, 74, 255, 0.12), rgba(232, 68, 194, 0.09), rgba(24, 192, 229, 0.12));
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 13px;
  --topbar: 78px;
  font-family: "Manrope", system-ui, sans-serif;
  font-size: 16px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d1020;
  --surface: rgba(21, 24, 45, 0.9);
  --surface-solid: #171a30;
  --surface-2: #20243e;
  --ink: #f5f3ff;
  --muted: #a4a5bc;
  --line: rgba(207, 202, 255, 0.12);
  --line-strong: rgba(144, 112, 255, 0.42);
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.34);
  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.22);
  --gradient-soft: linear-gradient(135deg, rgba(109, 74, 255, 0.2), rgba(232, 68, 194, 0.12), rgba(24, 192, 229, 0.14));
}

* { box-sizing: border-box; }
html { height: 100%; }
body { margin: 0; min-height: 100%; overflow: hidden; background: var(--bg); color: var(--ink); }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
button, [role="button"] { -webkit-tap-highlight-color: transparent; }
.ambient { position: fixed; border-radius: 999px; filter: blur(100px); pointer-events: none; opacity: .18; }
.ambient-one { width: 500px; height: 500px; left: -230px; top: 30%; background: #a84cff; }
.ambient-two { width: 420px; height: 420px; right: -180px; bottom: -140px; background: #19c6e8; }

.app-shell { min-height: 100vh; display: grid; grid-template-rows: var(--topbar) 72px minmax(0, 1fr); position: relative; }
.topbar { display: grid; grid-template-columns: 300px minmax(220px, 1fr) auto; align-items: center; gap: 22px; padding: 0 22px; background: var(--surface); border-bottom: 1px solid var(--line); backdrop-filter: blur(18px); z-index: 20; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; width: max-content; }
.brand-mark { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; background: var(--gradient); color: #fff; box-shadow: 0 9px 22px rgba(109, 74, 255, .28); }
.brand-mark svg { width: 30px; height: 30px; }
.brand b { display: block; font-family: "Sora", sans-serif; font-size: 1.02rem; letter-spacing: .05em; }
.brand small { display: block; font-size: .63rem; letter-spacing: .18em; color: var(--muted); font-weight: 800; }
.project-heading { min-width: 0; display: grid; grid-template-columns: minmax(160px, 380px) auto; column-gap: 12px; align-items: center; }
.project-heading .eyebrow { grid-column: 1 / -1; }
.eyebrow { color: var(--muted); font-size: .67rem; font-weight: 800; letter-spacing: .14em; }
.title-input { border: 0; padding: 1px 0; min-width: 0; background: transparent; color: var(--ink); font-family: "Sora", sans-serif; font-weight: 700; font-size: .98rem; outline: none; }
.title-input:focus { color: var(--primary); }
.save-state { color: var(--muted); font-size: .72rem; white-space: nowrap; }
.save-state i { display: inline-block; width: 7px; height: 7px; margin-right: 4px; border-radius: 50%; background: var(--success); }
.save-state.saving i { background: var(--warning); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.top-actions { display: flex; align-items: center; gap: 9px; }
.btn, .icon-btn, .avatar-btn { border: 0; cursor: pointer; transition: .2s ease; }
.btn { min-height: 40px; padding: 0 16px; border-radius: 12px; font-weight: 800; font-size: .8rem; }
.btn:hover, .icon-btn:hover, .avatar-btn:hover { transform: translateY(-1px); }
.btn:active, .icon-btn:active, .avatar-btn:active { transform: translateY(0); }
.btn-gradient { color: #fff; background: var(--gradient); box-shadow: 0 9px 22px rgba(109, 74, 255, .24); }
.btn-soft { color: var(--primary); background: var(--gradient-soft); border: 1px solid var(--line-strong); }
.btn-ghost { background: var(--surface-2); border: 1px solid var(--line); }
.btn-danger { color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent); border: 1px solid color-mix(in srgb, var(--danger) 20%, transparent); }
.btn-block { width: 100%; }
.btn:disabled { opacity: .48; cursor: not-allowed; transform: none; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; display: inline-grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); }
.icon-btn.small { width: 34px; height: 34px; border-radius: 10px; }
.avatar-btn { width: 40px; height: 40px; border-radius: 50%; color: #fff; font-weight: 800; background: linear-gradient(145deg, #fa5bbd, #7450ff); box-shadow: inset 0 0 0 3px rgba(255,255,255,.35); }
.count-pill { display: inline-grid; place-items: center; min-width: 21px; height: 21px; margin-left: 5px; padding: 0 6px; border-radius: 20px; color: #fff; background: var(--primary); font-size: .68rem; }

.stepbar { display: flex; align-items: center; justify-content: center; padding: 9px 22px; background: color-mix(in srgb, var(--surface-solid) 74%, transparent); border-bottom: 1px solid var(--line); z-index: 15; }
.step { display: flex; align-items: center; gap: 9px; min-width: 155px; padding: 8px 11px; border: 0; border-radius: 14px; background: transparent; text-align: left; cursor: pointer; color: var(--muted); }
.step-icon { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; flex: none; background: var(--surface-2); border: 1px solid var(--line); font-size: 1rem; font-weight: 900; }
.step b, .step small { display: block; }
.step b { color: var(--ink); font-size: .8rem; }
.step small { margin-top: 2px; font-size: .66rem; }
.step.active { background: var(--gradient-soft); }
.step.active .step-icon, .step.complete .step-icon { background: var(--gradient); color: #fff; border-color: transparent; }
.step.active b { color: var(--primary); }
.step-line { width: clamp(20px, 3vw, 52px); height: 2px; background: var(--line); }
.step-line.complete { background: var(--gradient); }

.workspace { min-height: 0; display: grid; grid-template-columns: 336px minmax(540px, 1fr) 284px; }
.control-panel, .project-rail { min-height: 0; background: var(--surface); backdrop-filter: blur(16px); }
.control-panel { border-right: 1px solid var(--line); display: flex; flex-direction: column; transition: .25s ease; }
.control-panel.collapsed { margin-left: -336px; }
.panel-head, .rail-head { padding: 17px 18px 14px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }
.panel-head h2, .rail-head h3 { margin: 2px 0 0; font-family: "Sora", sans-serif; font-size: .95rem; }
.panel-scroll { min-height: 0; overflow: auto; padding: 15px; scrollbar-width: thin; }
.stage { min-width: 0; min-height: 0; overflow: auto; padding: 24px; scrollbar-width: thin; }
.project-rail { border-left: 1px solid var(--line); padding-bottom: 15px; overflow: auto; }
.storage-card { margin: 14px; padding: 13px; border-radius: 15px; background: var(--gradient-soft); border: 1px solid var(--line-strong); }
.storage-card > div:first-child { display: flex; justify-content: space-between; font-size: .72rem; }
.storage-card small { color: var(--muted); font-size: .66rem; line-height: 1.45; }
.meter { height: 6px; margin: 9px 0; overflow: hidden; border-radius: 99px; background: rgba(119, 111, 157, .15); }
.meter i { display: block; height: 100%; border-radius: inherit; background: var(--gradient); }
.search-box { display: flex; gap: 7px; align-items: center; margin: 0 14px 12px; padding: 0 11px; height: 39px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--line); }
.search-box input { width: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: .75rem; }
.project-list { display: grid; gap: 9px; padding: 0 14px; }
.project-item { display: grid; grid-template-columns: 50px minmax(0, 1fr); gap: 10px; padding: 9px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-solid); cursor: pointer; }
.project-item.active { border-color: var(--primary); box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 12%, transparent); }
.project-thumb { aspect-ratio: 9 / 12; border-radius: 9px; background: var(--thumb, var(--gradient)); position: relative; overflow: hidden; }
.project-thumb::after { content: ""; position: absolute; inset: 36% 20%; border-radius: 50%; background: rgba(255,255,255,.7); filter: blur(5px); }
.project-meta { min-width: 0; }
.project-meta b { display: block; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .74rem; }
.project-meta small { display: block; margin-top: 5px; color: var(--muted); font-size: .65rem; }
.project-chip { display: inline-block; padding: 2px 6px; border-radius: 20px; color: var(--primary); background: var(--gradient-soft); font-size: .58rem; font-weight: 800; }

.section-card { margin-bottom: 13px; padding: 14px; border-radius: var(--radius-lg); background: var(--surface-solid); border: 1px solid var(--line); box-shadow: var(--shadow-soft); }
.section-card h3 { margin: 0 0 12px; font-family: "Sora", sans-serif; font-size: .82rem; }
.section-card .section-note { margin: -7px 0 12px; color: var(--muted); font-size: .68rem; line-height: 1.5; }
.field { display: grid; gap: 6px; margin-bottom: 12px; }
.field:last-child { margin-bottom: 0; }
.field > span, .field-row > label > span { font-size: .69rem; font-weight: 800; }
.field small { color: var(--muted); font-size: .63rem; line-height: 1.45; }
.field input, .field textarea, .field select, .input-shell { width: 100%; border: 1px solid var(--line); border-radius: 11px; outline: none; background: var(--surface-2); color: var(--ink); font-size: .75rem; }
.field input, .field select { height: 42px; padding: 0 11px; }
.field textarea { min-height: 82px; resize: vertical; padding: 10px 11px; line-height: 1.5; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 12%, transparent); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field-row > label { display: grid; gap: 6px; }
.choice-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; }
.choice-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.choice { min-height: 40px; padding: 8px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface-2); cursor: pointer; font-size: .68rem; font-weight: 800; }
.choice.active { color: var(--primary); border-color: var(--primary); background: var(--gradient-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 30%, transparent); }
.color-choices { display: flex; gap: 8px; }
.color-choice { width: 33px; height: 33px; padding: 0; border-radius: 50%; border: 3px solid var(--surface-solid); outline: 1px solid var(--line); background: var(--swatch); cursor: pointer; }
.color-choice.active { outline: 2px solid var(--primary); transform: scale(1.08); }
.notice { padding: 11px 12px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--gradient-soft); font-size: .69rem; line-height: 1.55; }
.notice.success { border-color: color-mix(in srgb, var(--success) 35%, transparent); background: color-mix(in srgb, var(--success) 9%, transparent); }
.notice.warning { border-color: color-mix(in srgb, var(--warning) 40%, transparent); background: color-mix(in srgb, var(--warning) 9%, transparent); }
.button-stack { display: grid; gap: 8px; }

.stage-header { display: flex; justify-content: space-between; gap: 20px; align-items: center; margin: 0 auto 20px; max-width: 1060px; }
.stage-header h1 { margin: 4px 0 0; font-family: "Sora", sans-serif; font-size: clamp(1.2rem, 2vw, 1.7rem); }
.stage-header p { margin: 5px 0 0; color: var(--muted); font-size: .78rem; }
.stage-actions { display: flex; gap: 8px; }
.stage-card { max-width: 1060px; margin: 0 auto; padding: 20px; border-radius: var(--radius-xl); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
.idea-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 13px; }
.idea-card { position: relative; padding: 17px; min-height: 195px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface-solid); cursor: pointer; transition: .2s ease; }
.idea-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-soft); }
.idea-card.selected { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 11%, transparent); background: linear-gradient(145deg, var(--surface-solid), color-mix(in srgb, var(--primary) 6%, var(--surface-solid))); }
.idea-no { color: var(--primary); font-size: .66rem; font-weight: 900; letter-spacing: .1em; }
.idea-card h3 { margin: 9px 0 9px; font-family: "Sora", sans-serif; font-size: .9rem; }
.idea-hook { margin: 0 0 11px; padding: 9px 10px; border-radius: 10px; border-left: 3px solid var(--pink); background: var(--gradient-soft); font-size: .73rem; font-weight: 700; line-height: 1.45; }
.idea-card > p:last-child { margin: 0; color: var(--muted); font-size: .7rem; line-height: 1.55; }
.selected-badge { position: absolute; right: 13px; top: 13px; width: 25px; height: 25px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--gradient); }

.scene-list { display: grid; gap: 13px; }
.scene-card { border-radius: 18px; border: 1px solid var(--line); background: var(--surface-solid); overflow: hidden; }
.scene-top { display: flex; align-items: center; gap: 10px; padding: 11px 13px; background: color-mix(in srgb, var(--surface-2) 70%, transparent); border-bottom: 1px solid var(--line); }
.scene-number { width: 29px; height: 29px; flex: none; border-radius: 9px; display: grid; place-items: center; color: #fff; background: var(--gradient); font-size: .7rem; font-weight: 900; }
.scene-top b { font-size: .74rem; }
.scene-top small { margin-left: auto; color: var(--muted); font-size: .65rem; }
.scene-tools { display: flex; gap: 4px; margin-left: 4px; }
.mini-btn { width: 29px; height: 29px; padding: 0; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-solid); cursor: pointer; }
.scene-body { padding: 13px; }
.scene-body textarea { width: 100%; min-height: 66px; padding: 9px 10px; resize: vertical; border: 0; border-radius: 10px; background: var(--surface-2); color: var(--ink); font-size: .78rem; font-weight: 700; line-height: 1.5; outline: none; }
.visual-prompt { display: grid; grid-template-columns: 24px 1fr; gap: 8px; margin-top: 9px; padding: 10px; border-radius: 10px; color: var(--muted); background: color-mix(in srgb, var(--surface-2) 65%, transparent); font-size: .68rem; line-height: 1.5; }
.scene-fields { display: grid; grid-template-columns: 1.1fr .8fr .7fr; gap: 8px; margin-top: 9px; }
.scene-fields input, .scene-fields select { min-width: 0; height: 35px; padding: 0 9px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: var(--surface-2); font-size: .66rem; }
.summary-strip { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; padding: 12px 14px; border-radius: 14px; background: var(--gradient-soft); border: 1px solid var(--line-strong); }
.summary-strip span { color: var(--muted); font-size: .69rem; }
.summary-strip b { color: var(--ink); }

.voice-layout { display: grid; grid-template-columns: 300px 1fr; gap: 16px; }
.voice-side, .timeline-card { padding: 17px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface-solid); }
.voice-side h3, .timeline-card h3 { margin: 0 0 13px; font-family: "Sora"; font-size: .86rem; }
.voice-avatar { width: 58px; height: 58px; margin-bottom: 12px; display: grid; place-items: center; border-radius: 18px; color: #fff; background: var(--gradient); font-size: 1.5rem; }
.audio-drop { display: grid; place-items: center; min-height: 115px; margin-top: 12px; padding: 14px; text-align: center; border-radius: 14px; border: 1px dashed var(--line-strong); background: var(--gradient-soft); cursor: pointer; }
.audio-drop b { font-size: .74rem; }
.audio-drop small { margin-top: 5px; color: var(--muted); font-size: .64rem; }
.recording { color: var(--danger) !important; border-color: var(--danger) !important; }
.waveform { height: 130px; display: flex; align-items: center; gap: 3px; padding: 15px 10px; border-radius: 15px; background: var(--surface-2); overflow: hidden; }
.waveform i { flex: 1; min-width: 2px; max-width: 6px; height: var(--h); border-radius: 6px; background: linear-gradient(180deg, var(--pink), var(--accent)); opacity: .76; }
.waveform.playing i { animation: wave .6s ease-in-out infinite alternate; animation-delay: var(--d); }
@keyframes wave { to { transform: scaleY(.52); opacity: 1; } }
.timeline-scenes { display: grid; gap: 7px; margin-top: 13px; max-height: 360px; overflow: auto; }
.timeline-row { display: grid; grid-template-columns: 28px 1fr 52px; gap: 8px; padding: 9px 10px; border-radius: 10px; background: color-mix(in srgb, var(--surface-2) 65%, transparent); font-size: .69rem; }
.timeline-row b { color: var(--primary); }
.timeline-row small { color: var(--muted); text-align: right; }

.studio-grid { display: grid; grid-template-columns: minmax(270px, 390px) minmax(390px, 1fr); gap: 18px; align-items: start; }
.preview-wrap { position: sticky; top: 0; }
.canvas-frame { position: relative; width: min(100%, 370px); margin: auto; padding: 9px; border-radius: 28px; background: #0b0d18; box-shadow: 0 25px 70px rgba(12, 10, 33, .35); }
#motionCanvas { display: block; width: 100%; aspect-ratio: 9 / 16; border-radius: 21px; background: #111; }
.preview-badge { position: absolute; left: 21px; top: 21px; padding: 5px 9px; border-radius: 20px; color: #fff; background: rgba(8, 9, 20, .48); backdrop-filter: blur(8px); font-size: .58rem; font-weight: 800; }
.preview-controls { display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 10px; margin: 12px auto 0; max-width: 370px; }
.play-btn { width: 42px; height: 42px; border: 0; border-radius: 50%; color: #fff; background: var(--gradient); cursor: pointer; }
.scrubber { accent-color: var(--primary); width: 100%; }
.timecode { color: var(--muted); font-size: .67rem; }
.studio-settings { display: grid; gap: 13px; }
.setting-card { padding: 15px; border-radius: 17px; border: 1px solid var(--line); background: var(--surface-solid); }
.setting-card h3 { margin: 0 0 11px; font-family: "Sora"; font-size: .82rem; }
.setting-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin-bottom: 12px; }
.setting-tab { padding: 8px 3px; border: 0; border-radius: 9px; background: var(--surface-2); font-size: .63rem; font-weight: 800; cursor: pointer; }
.setting-tab.active { color: #fff; background: var(--gradient); }
.export-box { padding: 17px; border-radius: 18px; color: #fff; background: linear-gradient(135deg, #17142f, #30226e 50%, #154b68); box-shadow: var(--shadow); }
.export-box h3 { margin: 0 0 6px; font-family: "Sora"; }
.export-box p { margin: 0 0 13px; color: rgba(255,255,255,.68); font-size: .68rem; line-height: 1.5; }
.export-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.export-options select { height: 39px; padding: 0 9px; border: 1px solid rgba(255,255,255,.18); border-radius: 10px; color: #fff; background: rgba(255,255,255,.1); font-size: .68rem; }
.render-progress { display: none; margin-top: 12px; }
.render-progress.show { display: block; }
.render-progress .meter { background: rgba(255,255,255,.15); }
.render-progress small { color: rgba(255,255,255,.7); font-size: .63rem; }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 18px; background: rgba(8, 8, 22, .55); backdrop-filter: blur(9px); }
.modal { width: min(940px, 100%); max-height: min(820px, 92vh); overflow: hidden; display: flex; flex-direction: column; border-radius: 24px; background: var(--surface-solid); border: 1px solid var(--line); box-shadow: 0 30px 90px rgba(0,0,0,.3); }
.modal > header { display: flex; justify-content: space-between; align-items: center; padding: 19px 21px; border-bottom: 1px solid var(--line); }
.modal-title { margin: 3px 0 0; font-family: "Sora"; font-size: 1.12rem; }
.modal-body { padding: 20px; overflow: auto; }
.ai-provider-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-bottom: 15px; }
.provider { padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-2); cursor: pointer; text-align: center; font-weight: 800; font-size: .72rem; }
.provider.active { border-color: var(--primary); color: var(--primary); background: var(--gradient-soft); }
.prompt-box { min-height: 180px !important; font-family: ui-monospace, SFMono-Regular, Menlo, monospace !important; font-size: .68rem !important; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.project-manager-list { display: grid; gap: 9px; }
.project-manager-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; padding: 12px; border-radius: 13px; background: var(--surface-2); border: 1px solid var(--line); }
.project-manager-row b, .project-manager-row small { display: block; }
.project-manager-row small { margin-top: 4px; color: var(--muted); font-size: .66rem; }
.row-actions { display: flex; gap: 6px; }
.plan-card { padding: 16px; border-radius: 16px; border: 1px solid var(--line-strong); background: var(--gradient-soft); }
.plan-card h3 { margin: 0 0 6px; }
.plan-card p { color: var(--muted); font-size: .72rem; }
.account-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 13px 0; }
.stat { padding: 12px; border-radius: 12px; background: var(--surface-2); }
.stat small, .stat b { display: block; }
.stat small { color: var(--muted); font-size: .62rem; }
.stat b { margin-top: 4px; font-family: "Sora"; }
.toast-region { position: fixed; z-index: 200; right: 20px; bottom: 20px; display: grid; gap: 8px; pointer-events: none; }
.toast { max-width: 360px; padding: 12px 14px; border-radius: 13px; color: #fff; background: #191b31; box-shadow: 0 12px 35px rgba(0,0,0,.25); font-size: .72rem; animation: toast-in .25s ease; }
.style-gallery { display: grid; grid-template-columns: minmax(230px, .82fr) minmax(360px, 1.4fr); gap: 18px; min-height: 500px; }
.style-preview { display: grid; align-content: start; gap: 14px; }
.style-demo { position: relative; aspect-ratio: 9 / 14; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; padding: 26px 22px; border-radius: 22px; color: #fff; background: linear-gradient(155deg, var(--s1), var(--s2) 56%, var(--s3)); box-shadow: 0 20px 45px color-mix(in srgb, var(--s1) 30%, transparent); }
.style-demo::before, .style-demo::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255,255,255,.15); filter: blur(2px); }
.style-demo::before { width: 210px; height: 210px; top: 12%; right: -60px; }
.style-demo::after { width: 120px; height: 120px; top: 34%; left: -30px; }
.demo-orb { position: absolute; width: 70px; height: 70px; left: calc(50% - 35px); top: 26%; border-radius: 50%; background: rgba(255,255,255,.84); box-shadow: 0 0 55px rgba(255,255,255,.55); animation: float 2.8s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-12px) scale(1.05); } }
.style-demo span, .style-demo h3, .style-demo p, .style-demo small { position: relative; z-index: 1; }
.style-demo span { font-size: .6rem; letter-spacing: .16em; font-weight: 900; opacity: .75; }
.style-demo h3 { margin: 6px 0 10px; font: 800 1.4rem/1.1 "Sora"; }
.style-demo p { margin: 0 0 16px; font-size: .76rem; line-height: 1.5; font-weight: 700; }
.style-demo small { font-size: .58rem; opacity: .62; }
.style-detail h3 { margin: 8px 0 5px; font-family: "Sora"; }
.style-detail > p { margin: 0 0 12px; color: var(--muted); font-size: .7rem; line-height: 1.55; }
.style-browser { min-width: 0; border-left: 1px solid var(--line); padding-left: 18px; }
.style-filters { display: flex; gap: 7px; padding-bottom: 12px; overflow-x: auto; }
.style-filters button { padding: 7px 11px; white-space: nowrap; border-radius: 20px; border: 1px solid var(--line); color: var(--muted); background: var(--surface-solid); font-size: .65rem; font-weight: 800; cursor: pointer; }
.style-filters button.active { color: #fff; border-color: transparent; background: var(--gradient); }
.style-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-height: 540px; padding: 3px; overflow: auto; }
.style-tile { min-width: 0; padding: 0 0 9px; overflow: hidden; border-radius: 14px; border: 1px solid var(--line); color: var(--ink); background: var(--surface-solid); text-align: left; cursor: pointer; transition: .2s ease; }
.style-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-soft); }
.style-tile.active { border-color: var(--primary); box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 18%, transparent); }
.style-art { position: relative; aspect-ratio: 4 / 3; margin-bottom: 8px; display: grid; place-items: center; overflow: hidden; color: #fff; background: linear-gradient(145deg, var(--s1), var(--s2) 57%, var(--s3)); }
.style-art::before { content: ""; position: absolute; width: 54%; height: 54%; border-radius: 50%; background: rgba(255,255,255,.18); transform: translate(42%, -28%); }
.style-art i { position: relative; z-index: 1; font-style: normal; font-size: 1.5rem; font-weight: 900; text-shadow: 0 5px 16px rgba(0,0,0,.18); }
.style-art b { position: absolute; left: 8px; bottom: 7px; z-index: 1; font-size: .55rem; text-transform: uppercase; letter-spacing: .08em; }
.style-art em { position: absolute; width: 80%; height: 1px; bottom: 22px; background: rgba(255,255,255,.42); }
.style-teknologi { background-image: linear-gradient(rgba(255,255,255,.1) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.1) 1px, transparent 1px), linear-gradient(145deg, var(--s1), var(--s2), var(--s3)); background-size: 15px 15px, 15px 15px, auto; }
.style-tenang::before { border-radius: 45% 55% 60% 40%; transform: translate(25%, -10%) rotate(18deg); }
.style-modern::before { border-radius: 0; transform: translate(50%, -25%) rotate(35deg); }
.style-tile > strong, .style-tile > small { display: block; padding: 0 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.style-tile > strong { font-size: .64rem; }
.style-tile > small { margin-top: 3px; color: var(--muted); font-size: .57rem; }
.style-current { margin-right: auto; color: var(--muted); font-size: .7rem; }
.toast.success { background: #0f765b; }
.toast.warning { background: #9b5a21; }
@keyframes toast-in { from { transform: translateY(12px); opacity: 0; } }
.empty-state { padding: 40px 20px; text-align: center; color: var(--muted); }
.empty-state b { display: block; color: var(--ink); margin-bottom: 5px; }
.hidden { display: none !important; }

@media (max-width: 1180px) {
  .workspace { grid-template-columns: 310px minmax(520px, 1fr); }
  .project-rail { display: none; }
  .topbar { grid-template-columns: 250px minmax(180px, 1fr) auto; }
  .top-actions .btn-soft { display: none; }
}

@media (max-width: 880px) {
  body { overflow: auto; }
  .app-shell { min-height: 100vh; grid-template-rows: auto auto 1fr; }
  .topbar { grid-template-columns: 1fr auto; padding: 12px 14px; }
  .project-heading { grid-row: 2; grid-column: 1 / -1; }
  .top-actions .btn { display: none; }
  .stepbar { justify-content: flex-start; overflow-x: auto; }
  .step { min-width: 118px; }
  .step small { display: none; }
  .step-line { width: 12px; flex: none; }
  .workspace { display: block; }
  .control-panel { border: 0; max-height: none; }
  .control-panel.collapsed { margin-left: 0; display: none; }
  .stage { padding: 15px; overflow: visible; }
  .voice-layout, .studio-grid { grid-template-columns: 1fr; }
  .preview-wrap { position: static; }
}

@media (max-width: 620px) {
  .brand small { display: none; }
  .topbar { gap: 10px; }
  .top-actions { gap: 6px; }
  .stage-header { align-items: flex-start; flex-direction: column; }
  .stage-actions { width: 100%; }
  .stage-actions .btn { flex: 1; }
  .idea-grid { grid-template-columns: 1fr; }
  .stage-card { padding: 13px; }
  .field-row, .scene-fields, .export-options { grid-template-columns: 1fr; }
  .setting-tabs { grid-template-columns: 1fr 1fr; }
  .ai-provider-grid, .account-stats { grid-template-columns: 1fr; }
  .modal { max-height: 96vh; }
  .style-gallery { grid-template-columns: 1fr; }
  .style-demo { aspect-ratio: 16 / 10; }
  .style-browser { border-left: 0; border-top: 1px solid var(--line); padding: 14px 0 0; }
  .style-grid { grid-template-columns: repeat(2, 1fr); max-height: 430px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
