:root {
  color-scheme: dark;
  --bg: #090a0f;
  --surface: #14151d;
  --surface-2: #1a1b24;
  --text: #f6f2ea;
  --muted: #969aa7;
  --line: #292b35;
  --coral: #ff5a3c;
  --violet: #7657ff;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--bg); scroll-behavior: smooth; }
html.auth-checking body { opacity: 0; pointer-events: none; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI Variable", "Aptos", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  transition: opacity .16s ease;
}
button, textarea, input, select { font: inherit; }
button { display: inline-flex; align-items: center; justify-content: center; border: 0; color: inherit; cursor: pointer; }
.logout-button { display: inline-flex; align-items: center; justify-content: center; height: 34px; border: 1px solid #30323b; border-radius: 9px; background: transparent; padding: 0 11px; color: #9295a1; font-size: 11px; font-weight: 700; text-decoration: none; }
.logout-button:hover { border-color: #4a4c58; color: #fff; }
button:focus-visible, textarea:focus-visible, select:focus-visible, input:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.app-shell { min-height: 100vh; background: radial-gradient(circle at 83% 8%, rgba(118,87,255,.09), transparent 27%), var(--bg); }

.desktop-sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 30;
  display: flex; width: 230px; flex-direction: column;
  border-right: 1px solid #20212a; background: rgba(12,13,19,.96);
  padding: 28px 18px 20px; backdrop-filter: blur(20px);
}
.brand-lockup { display: flex; align-items: center; gap: 10px; color: inherit; padding: 0 8px 34px; font-size: 22px; font-weight: 760; letter-spacing: -.035em; text-decoration: none; }
.brand-lockup small { margin-left: auto; border: 1px solid #393b47; border-radius: 999px; color: #979aa7; font-size: 10px; font-weight: 700; letter-spacing: .08em; padding: 4px 7px; text-transform: uppercase; }
.brand-mark { position: relative; display: inline-flex; flex: 0 0 auto; width: 34px; height: 34px; overflow: hidden; border-radius: 11px; background: linear-gradient(145deg,#ff7358,#f2482d); box-shadow: 0 8px 26px rgba(255,90,60,.25); }
.brand-mark i { position: absolute; left: 8px; width: 18px; height: 8px; border: 2.4px solid #fff; border-left-color: transparent; border-radius: 999px; transform: rotate(-12deg); }
.brand-mark i:first-child { top: 8px; }
.brand-mark i:last-child { bottom: 8px; transform: rotate(168deg); }
.brand-mark.small { width: 30px; height: 30px; border-radius: 9px; }
.brand-mark.small i { left: 7px; width: 16px; }

.sidebar-nav { display: flex; flex-direction: column; gap: 5px; }
.sidebar-nav > p { margin: 0 12px 10px; color: #656875; font-size: 10px; font-weight: 800; letter-spacing: .16em; }
.nav-button { position: relative; display:flex; align-items:center; width: 100%; height: 44px; justify-content: flex-start; gap: 10px; border:0; border-radius: 11px; background: transparent; color: #8e919f; font-size: 14px; font-weight: 600; padding: 0 12px; text-decoration:none; transition: .18s ease; }
.nav-button:hover { background: #171820; color: #f6f2ea; }
.nav-button.active { background: linear-gradient(90deg,rgba(255,90,60,.13),rgba(255,90,60,.03)); color: #fff4ee; box-shadow: inset 2px 0 var(--coral); }
.nav-button.active > i { position: absolute; right: 14px; width: 6px; height: 6px; border-radius: 50%; background: var(--coral); box-shadow: 0 0 12px var(--coral); }
.sidebar-bottom { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.credit-card { margin-bottom: 8px; border: 1px solid #262833; border-radius: 15px; background: var(--surface); padding: 14px; }
.credit-card > div:first-child { display: flex; align-items: center; gap: 8px; color: #a6a8b4; font-size: 12px; }
.credit-card strong { margin-left: auto; color: #f8f2e9; font-size: 13px; }
.credit-icon { display: grid; width: 24px; height: 24px; place-items: center; border-radius: 8px; background: rgba(118,87,255,.16); color: #9a86ff; }
.credit-icon svg { width: 13px; }
.credit-track { height: 4px; margin: 12px 0; overflow: hidden; border-radius: 999px; background: #2a2b35; }
.credit-track span { display: block; width: 68%; height: 100%; border-radius: inherit; background: linear-gradient(90deg,var(--violet),var(--coral)); }
.credit-card > button { gap: 5px; background: transparent; color: #ddd9d3; font-size: 12px; font-weight: 700; padding: 0; }

.main-column { min-height: 100vh; padding-left: 230px; }
.topbar {
  position: sticky; top: 0; z-index: 25; display: flex; height: 68px; align-items: center; gap: 10px;
  border-bottom: 1px solid rgba(38,39,48,.82); background: rgba(9,10,15,.77);
  padding: 0 34px; backdrop-filter: blur(18px);
}
.topbar-spacer { flex: 1; }
.mobile-brand, .mobile-menu-button { display: none; }
.credit-pill { gap: 6px; height: 34px; border: 1px solid #30313c; border-radius: 999px; background: #15161d; color: #cac7c1; padding: 0 12px; font-size: 12px; }
.credit-pill svg { width: 14px; color: #ff7a61; }
.credit-pill span { color: #7e818e; }
.icon-button { position: relative; width: 36px; height: 36px; border-radius: 50%; background: transparent; color: #a6a8b3; }
.icon-button i { position: absolute; top: 7px; right: 8px; width: 5px; height: 5px; border: 1px solid var(--bg); border-radius: 50%; background: var(--coral); }
.avatar-button { width: 34px; height: 34px; border: 1px solid #49414b; border-radius: 50%; background: linear-gradient(135deg,var(--violet),var(--coral)); color: white; font-size: 11px; font-weight: 800; }
.studio-main { width: min(1320px, calc(100% - 56px)); margin: 0 auto; padding: 46px 0 70px; }
.welcome-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 30px; }
.eyebrow { display: flex; align-items: center; gap: 9px; margin: 0 0 13px; color: #8d909d; font-size: 10px; font-weight: 800; letter-spacing: .18em; }
.eyebrow span { width: 20px; height: 1px; background: var(--coral); }
.welcome-row h1 { margin: 0; color: #f7f2ea; font-size: clamp(34px,4vw,54px); font-weight: 720; letter-spacing: -.05em; line-height: 1.02; }
.welcome-row h1 em { color: #ff7054; font-family: Georgia,serif; font-weight: 400; }
.welcome-copy { margin: 12px 0 0; color: #8f929f; font-size: 15px; }
.projects-button { height: 42px; gap: 9px; border: 1px solid #2c2e38; border-radius: 12px; background: #12131a; color: #cacbd3; padding: 0 14px; }
.projects-button svg:last-child { margin-left: 8px; width: 15px; }

.creation-grid { display: grid; grid-template-columns: minmax(0,1fr) 350px; align-items: start; gap: 20px; }
.composer-panel { overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: linear-gradient(145deg,rgba(22,23,31,.98),rgba(16,17,24,.98)); box-shadow: 0 28px 90px rgba(0,0,0,.28); }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; padding: 26px 28px 18px; }
.step-kicker { color: #777a87; font-size: 10px; font-weight: 800; letter-spacing: .16em; }
.panel-heading h2 { margin: 7px 0 0; font-size: 21px; font-weight: 690; letter-spacing: -.02em; }
.autosave { display: flex; align-items: center; gap: 6px; color: #6f7280; font-size: 11px; }
.autosave i { width: 6px; height: 6px; border-radius: 50%; background: #55c8a8; box-shadow: 0 0 8px rgba(85,200,168,.6); }
.mode-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 9px; padding: 0 28px 24px; }
.mode-card {
  position: relative; display: flex; min-height: 108px; flex-direction: column; align-items: flex-start;
  justify-content: space-between; border: 1px solid #292b36; border-radius: 14px;
  background: #111218; color: #d8d8de; padding: 14px; text-align: left; transition: .2s ease;
}
.mode-card:hover { transform: translateY(-2px); border-color: #3a3b48; background: #181921; }
.mode-card.active { border-color: rgba(255,90,60,.72); background: linear-gradient(145deg,rgba(255,90,60,.13),rgba(118,87,255,.06)); box-shadow: inset 0 0 0 1px rgba(255,90,60,.08),0 10px 30px rgba(0,0,0,.15); }
.mode-icon { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 9px; background: #22232c; color: #aaaeb9; }
.mode-icon svg { width: 15px; }
.mode-card.active .mode-icon { background: rgba(255,90,60,.18); color: #ff7258; }
.mode-card strong, .mode-card small { display: block; }
.mode-card strong { font-size: 12px; line-height: 1.25; }
.mode-card small { margin-top: 4px; color: #737682; font-size: 10px; }
.mode-card > i { display: none; }
.mode-card.active > i { position: absolute; top: 10px; right: 10px; display: grid; width: 17px; height: 17px; place-items: center; border-radius: 50%; background: var(--coral); color: #fff; font-size: 10px; font-style: normal; font-weight: 800; }
.briefing-block { border-top: 1px solid #272933; padding: 22px 28px 20px; }
.briefing-label { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 10px; }
.briefing-label > span:last-child { color: #70737f; font-size: 11px; }
.prompt-box { overflow: hidden; border: 1px solid #343641; border-radius: 14px; background: #0e0f15; transition: .2s ease; }
.prompt-box:focus-within { border-color: #6650ce; box-shadow: 0 0 0 3px rgba(118,87,255,.1); }
.prompt-box textarea { display: block; width: 100%; min-height: 110px; resize: none; border: 0; outline: 0; background: transparent; color: #eeebe6; padding: 16px 17px 8px; font-size: 14px; line-height: 1.6; }
.prompt-box textarea::placeholder { color: #626572; }
.prompt-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px 10px; }
.upload-button { display: flex; max-width: 70%; height: 32px; align-items: center; gap: 7px; overflow: hidden; border: 1px solid #2c2e39; border-radius: 9px; color: #9b9eaa; padding: 0 10px; font-size: 11px; font-weight: 650; white-space: nowrap; cursor: pointer; }
.upload-button input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload-button svg { width: 14px; color: #ff7054; }
.upload-button span { overflow: hidden; text-overflow: ellipsis; }
.prompt-toolbar > span { color: #5f626e; font-size: 10px; }
.quick-settings { display: grid; grid-template-columns: 150px minmax(180px,1fr) auto; align-items: end; gap: 20px; border-top: 1px solid #272933; padding: 18px 28px; }
.setting-group > span { display: flex; justify-content: space-between; margin-bottom: 7px; color: #777a87; font-size: 10px; font-weight: 700; letter-spacing: .04em; }
.setting-group strong { color: #f0ece7; font-size: 11px; }
.setting-group select { width: 100%; height: 38px; border: 1px solid #323440; border-radius: 10px; background: #111219; color: #dedde1; padding: 0 10px; font-size: 12px; }
.duration-setting input { width: 100%; accent-color: var(--coral); }
.advanced-button { height: 38px; gap: 7px; border: 1px solid #2d2f3a; border-radius: 10px; background: transparent; color: #989ba7; padding: 0 12px; font-size: 11px; }
.advanced-settings { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; border-top: 1px solid #272933; background: rgba(9,10,15,.28); padding: 16px 28px; }
.advanced-settings[hidden] { display: none; }
.advanced-settings label > span { display: block; margin-bottom: 7px; color: #777a87; font-size: 10px; font-weight: 700; }
.advanced-settings select { width: 100%; height: 38px; border: 1px solid #323440; border-radius: 10px; background: #111219; color: #dedde1; padding: 0 10px; font-size: 11px; }
.composer-footer { display: flex; align-items: center; justify-content: space-between; gap: 18px; border-top: 1px solid var(--line); background: rgba(9,10,15,.45); padding: 16px 28px; }
.composer-footer p { display: flex; align-items: center; gap: 6px; margin: 0; color: #737682; font-size: 10px; }
.composer-footer p svg { width: 13px; }
.composer-footer p span { color: #3f414c; }
.generate-button { height: 44px; gap: 8px; border-radius: 12px; background: linear-gradient(110deg,var(--coral),#ff7659); padding: 0 10px 0 17px; box-shadow: 0 9px 28px rgba(255,90,60,.2); font-size: 12px; font-weight: 750; transition: .2s ease; }
.generate-button:hover { transform: translateY(-1px); background: linear-gradient(110deg,#ff684d,#ff8066); }
.generate-button > span { margin-left: 4px; border-radius: 8px; background: rgba(80,18,8,.22); padding: 6px 9px; font-size: 9px; letter-spacing: .03em; }

.preview-panel { overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: #13141b; padding: 14px; box-shadow: 0 28px 90px rgba(0,0,0,.22); }
.preview-topline { display: flex; align-items: center; justify-content: space-between; padding: 5px 4px 13px; color: #696c78; font-size: 10px; }
.preview-topline > div { display: flex; align-items: center; gap: 7px; }
.preview-topline strong { color: #c9c7c3; font-size: 11px; }
.preview-topline i { width: 6px; height: 6px; border-radius: 50%; background: var(--coral); box-shadow: 0 0 10px rgba(255,90,60,.8); }
.video-frame { position: relative; aspect-ratio: 9/13.4; overflow: hidden; border-radius: 15px; background: #20212b; }
.video-frame > img { width: 100%; height: 100%; object-fit: cover; transition: opacity .25s ease, transform .5s ease; animation: imageReveal .45s ease both; }
.video-frame:hover > img { transform: scale(1.025); }
.video-vignette { position: absolute; inset: 0; background: linear-gradient(180deg,transparent 45%,rgba(6,6,10,.78) 100%); }
.play-button { position: absolute; inset: 0; width: 48px; height: 48px; margin: auto; border: 1px solid rgba(255,255,255,.38); border-radius: 50%; background: rgba(12,12,17,.45); color: white; backdrop-filter: blur(10px); transition: .2s ease; }
.play-button:hover { transform: scale(1.07); background: rgba(255,90,60,.88); }
.play-button svg { width: 17px; margin-left: 2px; fill: currentColor; }
.preview-caption { position: absolute; right: 0; bottom: 0; left: 0; padding: 24px 20px 18px; }
.preview-caption > span { display: inline-flex; border: 1px solid rgba(255,255,255,.22); border-radius: 999px; background: rgba(10,10,15,.28); color: rgba(255,255,255,.72); padding: 5px 8px; font-size: 8px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; backdrop-filter: blur(8px); }
.preview-caption strong, .preview-caption small { display: block; }
.preview-caption strong { margin-top: 9px; color: #fff; font-size: 18px; letter-spacing: -.03em; }
.preview-caption small { color: rgba(255,255,255,.65); font-size: 10px; }
.preview-note { display: flex; gap: 10px; margin-top: 11px; border: 1px solid #2b2d37; border-radius: 12px; background: #181921; padding: 12px; }
.preview-note > svg { flex: 0 0 auto; width: 15px; color: #9b84ff; }
.preview-note p { margin: 0; }
.preview-note strong, .preview-note span { display: block; }
.preview-note strong { color: #cfccd0; font-size: 10px; }
.preview-note span { margin-top: 3px; color: #6f7280; font-size: 9px; line-height: 1.45; }
.mobile-bottom-nav, .mobile-create-fab { display: none; }

.recent-section { margin-top: 58px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.section-heading .eyebrow { margin-bottom: 8px; }
.section-heading h2 { margin: 0; color: #eeeae4; font-size: 24px; letter-spacing: -.035em; }
.section-heading > button { gap: 7px; background: transparent; color: #878a97; font-size: 12px; }
.section-heading > button svg { width: 14px; }
.project-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }
.project-card { overflow: hidden; border: 1px solid #252731; border-radius: 16px; background: #111218; transition: .22s ease; }
.project-card:hover { transform: translateY(-3px); border-color: #393b46; background: #15161e; }
.project-image { position: relative; height: 180px; overflow: hidden; background: #20212a; }
.project-image::after { position: absolute; inset: 0; content: ""; background: linear-gradient(180deg,transparent 45%,rgba(7,7,10,.55)); }
.project-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s ease; }
.project-card:hover img { transform: scale(1.035); }
.project-image > span { position: absolute; z-index: 2; top: 10px; left: 10px; border: 1px solid rgba(255,255,255,.2); border-radius: 999px; background: rgba(8,8,12,.45); color: rgba(255,255,255,.78); padding: 4px 7px; font-size: 9px; font-weight: 700; backdrop-filter: blur(8px); }
.project-image > button { position: absolute; z-index: 2; right: 12px; bottom: 12px; width: 34px; height: 34px; border: 1px solid rgba(255,255,255,.3); border-radius: 50%; background: rgba(10,10,14,.5); color: #fff; backdrop-filter: blur(8px); }
.project-image > button svg { width: 13px; fill: currentColor; }
.project-card > div:last-child { padding: 14px 15px 16px; }
.project-card p { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 5px; }
.project-card p strong { font-size: 13px; }
.project-card p span, .project-card small { color: #696c78; font-size: 10px; }
.section-heading h2 small { display: inline-grid; min-width: 25px; height: 25px; margin-left: 7px; place-items: center; border: 1px solid #30323d; border-radius: 999px; color: #8e919d; font-size: 11px; vertical-align: 3px; }
.project-image video { width: 100%; height: 100%; object-fit: cover; background: #08090d; transition: transform .45s ease; }
.project-card:hover .project-image video { transform: scale(1.025); }
.project-image .project-ratio { top: 10px; right: auto; bottom: auto; left: 10px; }
.project-image .project-status { top: 10px; right: 10px; bottom: auto; left: auto; border-color: rgba(255,255,255,.14); }
.project-image .status-succeeded { color: #8aebbe; }
.project-image .status-failed, .project-image .status-timed_out { color: #ff9caa; }
.project-image .status-processing, .project-image .status-queued, .project-image .status-submitting { color: #ffc0e3; }
.history-audio{display:grid;place-items:center;align-content:center;gap:18px;width:100%;height:100%;padding:30px;background:radial-gradient(circle at 50% 20%,rgba(255,39,167,.22),transparent 55%),#15151b}.history-audio>svg{width:42px;height:42px;color:#ff50b5;fill:currentColor}.history-audio>audio{position:relative;z-index:3;width:100%;height:34px}
.project-body { min-width: 0; }
.project-body > p:first-child strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-body > p:first-child span { flex: none; }
.project-prompt { display: -webkit-box !important; overflow: hidden; min-height: 40px; margin: 11px 0 12px !important; color: #8d909d; font-size: 12px; line-height: 1.55; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.project-actions { display: flex; align-items: center; gap: 7px; border-top: 1px solid #262832; padding-top: 11px; }
.history-action { display: inline-flex; min-height: 34px; align-items: center; justify-content: center; gap: 6px; border: 1px solid #30323d; border-radius: 9px; background: #181921; padding: 0 10px; color: #b4b2b7; font-size: 11px; font-weight: 700; text-decoration: none; }
.history-action svg { width: 14px; }
.history-action:hover { border-color: #4a4c58; color: #fff; }
.history-action.danger { margin-left: auto; background: transparent; color: #9c7d86; }
.history-action.danger:hover { border-color: rgba(255,93,125,.5); color: #ff8aa3; }
.history-action:disabled { cursor: not-allowed; opacity: .35; }
.history-empty { grid-column: 1 / -1; display: grid; min-height: 280px; place-items: center; align-content: center; border: 1px dashed #30323d; border-radius: 18px; background: rgba(17,18,24,.55); padding: 32px; text-align: center; }
.history-empty > span { display: grid; width: 48px; height: 48px; place-items: center; border-radius: 14px; background: rgba(255,50,160,.1); color: #ff55b4; font-size: 19px; }
.history-empty > span svg { width: 21px; }
.history-empty h3 { margin: 15px 0 6px; font-size: 18px; }
.history-empty p { max-width: 430px; margin: 0; color: #818490; font-size: 14px; line-height: 1.55; }
.history-empty button { min-height: 40px; margin-top: 18px; border-radius: 10px; background: linear-gradient(110deg,#ff2ca8,#ff63be); padding: 0 15px; color: #fff; font-size: 13px; font-weight: 750; }
.history-empty.error > span { background: rgba(255,92,116,.1); color: #ff7f96; }
.history-loading { overflow: hidden; border: 1px solid #252731; border-radius: 16px; background: #111218; }
.history-loading > span { display: block; height: 180px; background: linear-gradient(100deg,#171820 25%,#22232d 45%,#171820 65%); background-size: 220% 100%; animation: historyShimmer 1.4s linear infinite; }
.history-loading > div { display: grid; gap: 9px; padding: 16px; }
.history-loading i { display: block; height: 10px; border-radius: 999px; background: #22232c; }
.history-loading i:nth-child(2) { width: 64%; }.history-loading i:nth-child(3) { width: 82%; }
@keyframes historyShimmer { to { background-position: -220% 0; } }

.delete-dialog { width: min(430px,calc(100% - 32px)); border: 1px solid #343640; border-radius: 20px; background: #12131a; color: var(--text); padding: 0; box-shadow: 0 32px 110px rgba(0,0,0,.68); }
.delete-dialog::backdrop { background: rgba(4,5,8,.78); backdrop-filter: blur(8px); }
.delete-dialog form { display: grid; padding: 28px; }
.delete-icon { display: grid; width: 44px; height: 44px; place-items: center; border-radius: 13px; background: rgba(255,79,112,.1); color: #ff8097; }
.delete-dialog h2 { margin: 18px 0 8px; font-size: 24px; letter-spacing: -.035em; }
.delete-dialog p { margin: 0; color: #8e919d; font-size: 14px; line-height: 1.55; }
.delete-dialog form > div { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; }
.danger-action { min-height: 40px; border-radius: 11px; background: #d94361; padding: 0 15px; color: #fff; font-size: 12px; font-weight: 750; }
.danger-action:disabled { cursor: wait; opacity: .65; }

.creation-dialog {
  width: min(880px,calc(100% - 32px)); max-height: min(780px,calc(100vh - 40px)); overflow: auto;
  border: 1px solid #30323d; border-radius: 24px; background: #111218; color: var(--text);
  padding: 0; box-shadow: 0 35px 120px rgba(0,0,0,.65);
}
.creation-dialog::backdrop { background: rgba(3,4,8,.76); backdrop-filter: blur(10px); }
.dialog-shell { min-height: 100%; }
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; border-bottom: 1px solid #292b35; padding: 27px 30px 22px; }
.dialog-kicker { color: #ff7055; font-size: 10px; font-weight: 800; letter-spacing: .16em; }
.dialog-header h2 { margin: 7px 0 5px; font-size: 26px; letter-spacing: -.04em; }
.dialog-header p { margin: 0; color: #7f828f; font-size: 13px; }
.dialog-close { width: 34px; height: 34px; border: 1px solid #2e303b; border-radius: 10px; background: #181921; color: #8e919d; font-size: 22px; line-height: 1; }
.plan-state { padding: 22px 30px 24px; }
.plan-summary { display: flex; gap: 7px; margin-bottom: 17px; }
.plan-summary span { border: 1px solid #30323e; border-radius: 999px; background: #181921; color: #aaaab3; padding: 6px 9px; font-size: 10px; font-weight: 650; }
.storyboard { display: grid; grid-template-columns: 1fr 24px 1fr 24px 1fr; align-items: center; }
.storyboard > i { height: 1px; background: #383a46; }
.storyboard article { min-width: 0; overflow: hidden; border: 1px solid #2c2e38; border-radius: 15px; background: #16171f; }
.scene-thumb { position: relative; height: 122px; overflow: hidden; }
.scene-thumb::after { position: absolute; inset: 0; content: ""; background: linear-gradient(180deg,transparent,rgba(5,6,8,.45)); }
.scene-thumb img { width: 100%; height: 100%; object-fit: cover; }
.scene-thumb span { position: absolute; z-index: 1; top: 9px; left: 9px; display: grid; width: 23px; height: 23px; place-items: center; border-radius: 7px; background: rgba(10,10,14,.64); color: #fff; font-size: 9px; font-weight: 800; backdrop-filter: blur(6px); }
.storyboard article > div:last-child { min-height: 110px; padding: 12px; }
.storyboard article p { display: flex; justify-content: space-between; gap: 8px; margin: 0 0 7px; }
.storyboard article strong { font-size: 11px; }
.storyboard article small { color: #ff775d; font-size: 9px; }
.storyboard article > div:last-child > span { color: #777a87; font-size: 10px; line-height: 1.5; }
.plan-insight { display: flex; align-items: center; gap: 11px; margin-top: 16px; border: 1px solid rgba(118,87,255,.28); border-radius: 13px; background: rgba(118,87,255,.07); padding: 12px 13px; }
.plan-insight > svg { flex: 0 0 auto; color: #9b86ff; }
.plan-insight p { flex: 1; margin: 0; }
.plan-insight p strong, .plan-insight p span { display: block; }
.plan-insight p strong { margin-bottom: 2px; font-size: 10px; }
.plan-insight p span { color: #858895; font-size: 10px; }
.plan-insight button { background: transparent; color: #a894ff; font-size: 10px; font-weight: 700; }
.dialog-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; border-top: 1px solid #292b35; background: #0d0e14; padding: 16px 30px; }
.dialog-footer > p { display: flex; align-items: center; gap: 6px; margin: 0; color: #858895; font-size: 11px; }
.dialog-footer > p svg { width: 14px; color: #ff7258; }
.dialog-footer > p strong { color: #e7e3dc; }
.dialog-footer > div { display: flex; gap: 8px; }
.primary-action, .secondary-action { height: 40px; gap: 7px; border-radius: 11px; padding: 0 15px; font-size: 11px; font-weight: 750; }
.primary-action { background: linear-gradient(110deg,var(--coral),#ff7659); color: #fff; box-shadow: 0 8px 25px rgba(255,90,60,.18); }
.secondary-action { border: 1px solid #30323d; background: #171820; color: #aaaab4; }
.primary-action svg, .secondary-action svg { width: 14px; }

.generation-state { display: grid; min-height: 410px; place-items: center; padding: 34px; text-align: center; }
.generation-visual { position: relative; width: 220px; aspect-ratio: 9/12; overflow: hidden; border: 1px solid #3b3546; border-radius: 18px; box-shadow: 0 26px 70px rgba(118,87,255,.16); }
.generation-visual::after { position: absolute; inset: 0; content: ""; background: linear-gradient(135deg,rgba(118,87,255,.18),rgba(255,90,60,.13)); }
.generation-visual img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.8) brightness(.78); }
.generation-visual > span { position: absolute; z-index: 2; inset: 0; display: grid; width: 48px; height: 48px; place-items: center; margin: auto; border: 1px solid rgba(255,255,255,.25); border-radius: 15px; background: rgba(11,11,16,.5); color: #fff; backdrop-filter: blur(9px); }
.scan-line { position: absolute; z-index: 2; top: -5%; right: 0; left: 0; height: 2px; background: linear-gradient(90deg,transparent,#ff7559,transparent); box-shadow: 0 0 20px #ff5a3c; animation: scan 2.1s ease-in-out infinite; }
.generation-info { width: min(420px,100%); }
.generation-info p { display: flex; justify-content: space-between; margin: 22px 0 9px; color: #aaaab4; font-size: 11px; }
.generation-info p strong { color: #f2eee8; }
.progress-track { height: 7px; overflow: hidden; border-radius: 999px; background: #292b35; }
.progress-track span { display: block; width: 12%; height: 100%; border-radius: inherit; background: linear-gradient(90deg,var(--violet),var(--coral)); transition: width .35s ease; }
.generation-info small { display: block; margin-top: 12px; color: #676a76; font-size: 10px; }
.generation-retry { margin: 18px auto 0; }
@keyframes scan { 0%,100% { top: 3%; opacity: .4; } 50% { top: 94%; opacity: 1; } }

.result-state { display: grid; grid-template-columns: 280px 1fr; gap: 28px; padding: 26px 30px; }
.result-preview { position: relative; aspect-ratio: 9/12; overflow: hidden; border-radius: 17px; background: #20212a; }
.result-preview::after { position: absolute; inset: 0; content: ""; background: linear-gradient(180deg,transparent 50%,rgba(5,5,8,.55)); }
.result-preview video { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: contain; background: #05060a; }
.result-preview > span { position: absolute; z-index: 2; right: 12px; bottom: 12px; left: 12px; color: rgba(255,255,255,.8); font-size: 9px; font-weight: 800; letter-spacing: .12em; }
.result-details { align-self: center; }
.result-badge { display: inline-flex; align-items: center; gap: 6px; color: #72d9b9; font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.result-badge i { width: 6px; height: 6px; border-radius: 50%; background: #55c8a8; box-shadow: 0 0 10px rgba(85,200,168,.65); }
.result-details h3 { margin: 12px 0 8px; font-size: 29px; letter-spacing: -.045em; line-height: 1.1; }
.result-details > p { margin: 0; color: #858895; font-size: 12px; line-height: 1.6; }
.result-details dl { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin: 24px 0 0; }
.result-details dl > div { border: 1px solid #292b35; border-radius: 11px; background: #171820; padding: 10px; }
.result-details dt { color: #676a76; font-size: 9px; }
.result-details dd { margin: 4px 0 0; color: #dedbd6; font-size: 11px; font-weight: 700; }
.result-footer { justify-content: space-between; }
.toast { position: fixed; z-index: 100; right: 24px; bottom: 24px; display: flex; align-items: center; gap: 9px; max-width: min(360px,calc(100% - 32px)); border: 1px solid #373946; border-radius: 13px; background: rgba(25,26,34,.96); color: #ddd9d3; padding: 12px 14px; box-shadow: 0 18px 55px rgba(0,0,0,.4); font-size: 11px; backdrop-filter: blur(14px); }
.toast[hidden] { display: none; }
.toast svg { flex: 0 0 auto; width: 15px; color: #ff7258; }

@keyframes imageReveal { from { opacity: .35; transform: scale(1.03); } to { opacity: 1; transform: scale(1); } }

@media (max-width: 1100px) {
  .desktop-sidebar { width: 206px; }
  .main-column { padding-left: 206px; }
  .studio-main { width: min(calc(100% - 36px),900px); }
  .creation-grid { grid-template-columns: 1fr; }
  .preview-panel { display: grid; grid-template-columns: minmax(240px,320px) 1fr; gap: 14px; }
  .preview-topline { grid-column: 1/-1; }
  .video-frame { aspect-ratio: 9/12; }
  .preview-note { align-self: end; margin: 0; }
  .mode-grid { grid-template-columns: repeat(2,1fr); }
  .mode-card { min-height: 92px; }
  .project-image { height: 150px; }
}

@media (max-width: 760px) {
  .logout-button { display: none; }
  .desktop-sidebar { display: none; }
  .main-column { padding-left: 0; padding-bottom: 76px; }
  .topbar { height: 60px; padding: 0 16px; }
  .mobile-brand { display: flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; }
  .mobile-brand strong { font-size: 18px; letter-spacing: -.04em; }
  .mobile-menu-button { display: inline-flex; width: 36px; height: 36px; border-radius: 10px; background: transparent; }
  .avatar-button { display: none; }
  .credit-pill span { display: none; }
  .mobile-drawer { position: fixed; z-index: 24; top: 59px; right: 0; left: 0; display: grid; gap: 4px; border-bottom: 1px solid #292a34; background: rgba(13,14,20,.98); padding: 12px 16px 18px; backdrop-filter: blur(18px); }
  .mobile-drawer[hidden] { display: none; }
  .studio-main { width: calc(100% - 28px); padding: 30px 0 36px; }
  .welcome-row { align-items: flex-start; margin-bottom: 23px; }
  .welcome-row h1 { max-width: 340px; font-size: clamp(34px,11vw,48px); }
  .welcome-copy { max-width: 360px; font-size: 14px; line-height: 1.55; }
  .projects-button { display: none; }
  .creation-grid { gap: 14px; }
  .composer-panel { border-radius: 18px; }
  .panel-heading { padding: 22px 18px 15px; }
  .panel-heading h2 { font-size: 19px; }
  .autosave { display: none; }
  .mode-grid { display: flex; overflow-x: auto; padding: 0 18px 20px; scrollbar-width: none; scroll-snap-type: x mandatory; }
  .mode-grid::-webkit-scrollbar { display: none; }
  .mode-card { min-width: 145px; min-height: 102px; scroll-snap-align: start; }
  .briefing-block { padding: 19px 18px 18px; }
  .briefing-label > span:last-child { display: none; }
  .prompt-box textarea { min-height: 126px; font-size: 16px; }
  .quick-settings { grid-template-columns: 1fr 1.2fr; gap: 18px; padding: 16px 18px 20px; }
  .advanced-button { display: none; }
  .composer-footer { align-items: stretch; flex-direction: column; padding: 14px 18px 18px; }
  .composer-footer p { justify-content: center; }
  .generate-button { width: 100%; height: 50px; }
  .preview-panel { display: block; border-radius: 18px; padding: 12px; }
  .video-frame { aspect-ratio: 9/11; }
  .preview-note { margin-top: 10px; }
  .recent-section { margin-top: 40px; }
  .project-grid { display: flex; overflow-x: auto; margin-right: -14px; padding-right: 14px; scrollbar-width: none; scroll-snap-type: x mandatory; }
  .project-grid::-webkit-scrollbar { display: none; }
  .project-card { min-width: min(78vw,290px); scroll-snap-align: start; }
  .project-image { height: 190px; }
  .section-heading h2 { font-size: 22px; }
  .section-heading > button { display: none; }
  .section-heading > #history-more { display: inline-flex; flex: none; }
  .history-empty { min-width: 100%; }
  .history-loading { min-width: min(78vw,290px); scroll-snap-align: start; }
  .delete-dialog { width: 100%; margin: auto 0 0; border-right: 0; border-bottom: 0; border-left: 0; border-radius: 22px 22px 0 0; }
  .delete-dialog form { padding: 24px 20px max(24px,env(safe-area-inset-bottom)); }
  .creation-dialog { width: 100%; max-height: 92vh; margin: auto 0 0; border-right: 0; border-bottom: 0; border-left: 0; border-radius: 22px 22px 0 0; }
  .dialog-header { padding: 22px 18px 18px; }
  .dialog-header h2 { font-size: 22px; }
  .plan-state { padding: 18px; }
  .storyboard { display: flex; overflow-x: auto; gap: 10px; padding-bottom: 5px; scrollbar-width: none; scroll-snap-type: x mandatory; }
  .storyboard > i { display: none; }
  .storyboard article { min-width: 230px; scroll-snap-align: start; }
  .dialog-footer { align-items: stretch; flex-direction: column; padding: 14px 18px 18px; }
  .dialog-footer > p { justify-content: center; }
  .dialog-footer > div { width: 100%; }
  .dialog-footer > div > button { flex: 1; }
  .generation-state { min-height: 420px; padding: 24px 18px; }
  .generation-visual { width: 190px; }
  .result-state { grid-template-columns: 150px 1fr; gap: 17px; padding: 22px 18px; }
  .result-details h3 { font-size: 22px; }
  .result-details dl { grid-template-columns: 1fr; gap: 5px; margin-top: 15px; }
  .result-details dl > div { display: flex; justify-content: space-between; padding: 8px 10px; }
  .result-details dd { margin: 0; }
  .result-footer { flex-direction: column-reverse; }
  .result-footer > button { width: 100%; }
  .toast { right: 16px; bottom: 84px; }
  .mobile-bottom-nav { position: fixed; right: 0; bottom: 0; left: 0; z-index: 40; display: grid; height: 68px; grid-template-columns: repeat(4,1fr); border-top: 1px solid #252630; background: rgba(12,13,19,.95); padding: 8px 8px max(8px,env(safe-area-inset-bottom)); backdrop-filter: blur(18px); }
  .mobile-bottom-nav button { flex-direction: column; gap: 3px; background: transparent; color: #747784; font-size: 9px; }
  .mobile-bottom-nav svg { width: 19px; height: 19px; }
  .mobile-bottom-nav button.active { color: #ff6c51; }
  .mobile-create-fab { display: none; }
}
@media (max-width: 430px) {
  .credit-pill { padding: 0 10px; }
  .icon-button { display: none; }
  .welcome-row h1 { font-size: 38px; }
  .mode-card { min-width: 138px; }
  .quick-settings { grid-template-columns: 1fr; }
  .duration-setting { padding-top: 2px; }
  .video-frame { aspect-ratio: 9/11.3; }
  .advanced-settings { grid-template-columns: 1fr; padding: 16px 18px; }
  .result-state { grid-template-columns: 120px 1fr; }
  .result-details > p { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *,*::before,*::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

.model-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(190px, 1fr);
  gap: 9px 18px;
  align-items: center;
  border-top: 1px solid #272933;
  padding: 18px 28px;
}
.model-picker label { display: grid; gap: 5px; }
.model-picker label strong { color: #f1eee8; font-size: 15px; }
.model-picker select {
  width: 100%; min-width: 0; height: 44px;
  border: 1px solid #353743; border-radius: 10px;
  background: #111219; color: #f1eee8;
  padding: 0 12px; font-size: 14px;
}
.model-picker p {
  grid-column: 1 / -1;
  margin: 0; color: #9b9eaa;
  font-size: 12px; line-height: 1.45;
}
@media (max-width: 760px) {
  .model-picker { grid-template-columns: minmax(0, 1fr); padding: 18px; }
  .model-picker p { grid-column: 1; }
}
