:root {
  color-scheme: dark;
  --bg: #08060c;
  --surface: #100d15;
  --surface-2: #17121f;
  --surface-3: #21182d;
  --border: #33243f;
  --border-soft: #241a2d;
  --text: #f0eee9;
  --muted: #aaa8b0;
  --subtle: #797984;
  --accent: #a77be0;
  --accent-strong: #c8a2ff;
  --accent-deep: #63369b;
  --paper: #e4d7c3;
  --success: #a2c5ad;
  --danger: #e8a3a3;
  --radius: 16px;
  --shadow: 0 24px 80px rgba(0, 0, 0, .28);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; background: var(--bg); scroll-behavior: smooth; }
body { margin: 0; color: var(--text); background: radial-gradient(ellipse at 80% -20%, rgba(96, 42, 148, .16), transparent 44%), var(--bg); font-size: 14px; line-height: 1.5; }
button, input, textarea, select { font: inherit; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 3px; }
[hidden] { display: none !important; }
.topbar { height: 76px; display: flex; align-items: center; justify-content: space-between; padding: 0 32px; border-bottom: 1px solid var(--border-soft); background: rgba(8, 6, 12, .94); gap: 16px; position: sticky; top: 0; z-index: 10; backdrop-filter: blur(14px); }
.brand-lockup, .topbar-actions, .brand-name, .service-status, .panel-heading > div, .step-number, .button, .nav-button, .mode-tab, .model-pill, .generate-footer, .privacy-note, .result-actions, .library-toolbar, .filter-buttons { display: flex; align-items: center; }
.brand-lockup { gap: 12px; min-width: 0; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid #4b405f; border-radius: 13px; color: var(--accent-strong); background: linear-gradient(145deg, #292330, #16171c); font-size: 27px; line-height: 1; box-shadow: inset 0 0 22px rgba(183, 157, 221, .06); }
.brand-mark.large { width: 58px; height: 58px; border-radius: 18px; font-size: 34px; margin-bottom: 20px; }
.brand-name { gap: 5px; font-size: 14px; font-weight: 800; letter-spacing: .15em; white-space: nowrap; }
.brand-name span { color: var(--accent); font-weight: 500; }
.brand-subtitle { color: var(--subtle); font-size: 9px; letter-spacing: .12em; margin-top: 3px; white-space: nowrap; }
.topbar-actions { gap: 18px; }
.service-status { gap: 8px; color: #bcbac4; font-size: 10px; letter-spacing: .08em; white-space: nowrap; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 12px rgba(162, 197, 173, .3); }
.layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); min-height: calc(100vh - 115px); }
.sidebar { display: flex; flex-direction: column; min-height: 100%; padding: 28px 16px 20px; border-right: 1px solid var(--border-soft); background: rgba(18, 19, 24, .66); }
.side-label, .suggestion-label, .optional-label, .filter-label { color: var(--subtle); letter-spacing: .14em; font-size: 10px; font-weight: 750; }
.side-label { margin: 0 12px 12px; }
.nav-button { border: 1px solid transparent; background: transparent; color: var(--muted); width: 100%; text-align: left; padding: 12px 13px; gap: 12px; border-radius: 10px; cursor: pointer; font-weight: 600; transition: .18s ease; }
.nav-button + .nav-button { margin-top: 4px; }
.nav-button:hover { background: #202127; color: var(--text); }
.nav-button.active { background: linear-gradient(100deg, rgba(128, 104, 161, .2), rgba(128, 104, 161, .07)); border-color: #413750; color: var(--accent-strong); }
.nav-icon { width: 19px; text-align: center; font-size: 17px; }
.nav-count { display: grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; margin-left: auto; font-size: 10px; border-radius: 7px; background: #292a32; color: #bab6c1; }
.sidebar-bottom { margin-top: auto; padding-top: 42px; }
.sidebar-art { position: relative; overflow: hidden; height: 110px; border: 1px solid #34313f; background: linear-gradient(170deg, #282432, #121318 75%); border-radius: 12px; margin-bottom: 22px; }
.sidebar-art::after { content: ""; position: absolute; inset: 58% 0 0; background: linear-gradient(0deg, #0d0e12, transparent); }
.moon { position: absolute; right: 35px; top: 17px; width: 31px; height: 31px; border-radius: 50%; background: #c2b3d7; box-shadow: 0 0 25px rgba(193, 175, 219, .25); }
.moon::after { content: ""; position: absolute; left: 9px; top: -3px; width: 31px; height: 31px; border-radius: 50%; background: #24212d; }
.spire { position: absolute; bottom: 0; background: #101116; width: 45px; height: 75px; clip-path: polygon(50% 0, 62% 34%, 73% 34%, 73% 100%, 0 100%, 0 34%, 36% 34%); }
.spire-one { left: 25px; height: 85px; width: 53px; }
.spire-two { left: 76px; height: 57px; width: 42px; }
.mist { position: absolute; bottom: 8px; left: 4px; width: 180px; height: 20px; background: rgba(161, 147, 185, .15); filter: blur(10px); }
.side-copy { margin: 0 12px 17px; color: #cecad4; font-size: 12px; line-height: 1.65; }
.tiny { font-size: 11px; }
.muted { color: var(--muted); }
.sidebar-bottom .tiny { margin: 0 12px; line-height: 1.6; }
.main-content { min-width: 0; padding: 38px clamp(18px, 3vw, 42px) 40px; max-width: 1720px; width: 100%; margin: 0 auto; }
.view { width: 100%; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin: 0 0 28px; }
.eyebrow { color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: .18em; margin: 0 0 10px; }
h1, h2, h3, p { margin-top: 0; }
.page-heading h1 { font-size: clamp(28px, 3.3vw, 42px); letter-spacing: -.045em; line-height: 1.1; font-weight: 700; margin: 0; }
.page-heading h1 em { font-family: Georgia, "Times New Roman", serif; font-weight: 400; color: var(--accent-strong); letter-spacing: -.035em; }
.heading-copy { color: var(--muted); max-width: 670px; margin: 12px 0 0; font-size: 13px; }
.model-pill { gap: 10px; padding: 10px 13px; border: 1px solid #393442; background: #1b1921; border-radius: 11px; flex-shrink: 0; }
.model-spark { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: #30283a; color: var(--accent-strong); }
.model-pill strong, .model-pill small { display: block; }
.model-pill strong { font-size: 11px; font-weight: 700; }
.model-pill small { margin-top: 2px; font-size: 10px; color: var(--muted); }
.mode-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 6px; border: 1px solid var(--border); background: #15161b; border-radius: 14px; margin-bottom: 18px; max-width: 650px; }
.mode-tab { gap: 12px; border: 1px solid transparent; text-align: left; padding: 12px 15px; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; transition: .18s ease; min-width: 0; }
.mode-tab > span:first-child { font-size: 22px; width: 30px; text-align: center; color: #91869f; }
.mode-tab strong, .mode-tab small { display: block; }
.mode-tab strong { font-size: 12px; color: var(--text); }
.mode-tab small { font-size: 10px; color: var(--muted); margin-top: 3px; }
.mode-tab.active { background: linear-gradient(110deg, #2c2635, #211f28); border-color: #59486b; box-shadow: inset 0 0 18px rgba(186, 160, 222, .04); }
.mode-tab.active > span:first-child { color: var(--accent-strong); }
.workspace-grid { display: grid; grid-template-columns: minmax(0, 1.06fr) minmax(315px, .94fr); align-items: start; gap: 18px; }
.panel { min-width: 0; border: 1px solid var(--border); border-radius: var(--radius); background: linear-gradient(150deg, rgba(28, 29, 36, .98), rgba(21, 22, 28, .98)); box-shadow: 0 12px 40px rgba(0,0,0,.1); }
.prompt-panel { padding: clamp(17px, 2vw, 25px); }
.preview-panel { padding: clamp(17px, 2vw, 25px); position: sticky; top: 98px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 17px; margin-bottom: 20px; border-bottom: 1px solid var(--border-soft); }
.panel-heading > div { gap: 10px; min-width: 0; }
.panel-heading h2 { margin: 0; font-size: 15px; font-weight: 700; }
.step-number { justify-content: center; width: 27px; height: 27px; border-radius: 8px; background: #2a2533; border: 1px solid #42364f; color: var(--accent-strong); font-size: 10px; font-weight: 800; }
.optional-label { font-size: 9px; white-space: nowrap; }
.suggestion-label { margin-bottom: 10px; font-size: 9px; }
.suggestions { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 21px; }
.suggestion-chip { color: #c8c3d0; border: 1px solid #3b3745; background: #23212a; font-size: 11px; font-weight: 550; border-radius: 8px; padding: 7px 10px; cursor: pointer; transition: .16s ease; }
.suggestion-chip:hover { color: var(--accent-strong); border-color: #6d5b81; background: #2e2838; }
.field-label, .form-field > label, .login-card label { display: block; margin-bottom: 7px; color: #dedbe3; font-size: 11px; font-weight: 700; }
textarea, input[type="text"], input[type="password"], input[type="number"], select { width: 100%; min-width: 0; color: var(--text); background: #111217; border: 1px solid #373841; border-radius: 9px; padding: 10px 12px; outline: none; transition: border-color .15s ease, box-shadow .15s ease; }
textarea { resize: vertical; min-height: 103px; line-height: 1.6; }
textarea::placeholder, input::placeholder { color: #777681; }
textarea:focus, input:focus, select:focus { border-color: #84709e; box-shadow: 0 0 0 3px rgba(182, 158, 220, .08); }
select { appearance: auto; padding-right: 28px; }
.textarea-footer .over-limit { color: var(--danger); }
.textarea-footer { display: flex; justify-content: space-between; gap: 12px; margin-top: 7px; color: var(--subtle); font-size: 10px; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin: 21px 0 0; padding: 15px 0; border-top: 1px solid var(--border-soft); border-bottom: 1px solid var(--border-soft); cursor: pointer; }
.toggle-copy strong, .toggle-copy small { display: block; }
.toggle-copy strong { font-size: 12px; }
.toggle-copy small { font-size: 10px; color: var(--muted); margin-top: 4px; }
.toggle-row input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.toggle-ui { position: relative; flex: 0 0 37px; width: 37px; height: 21px; border-radius: 30px; background: #41414a; transition: background .15s ease; }
.toggle-ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 15px; height: 15px; border-radius: 50%; background: #d5d2d9; transition: transform .15s ease; }
.toggle-row input:checked + .toggle-ui { background: #725c91; }
.toggle-row input:checked + .toggle-ui::after { transform: translateX(16px); background: #fff; }
.builder-panel { padding-top: 18px; }
.builder-intro { display: flex; gap: 11px; align-items: flex-start; margin-bottom: 19px; }
.builder-glyph { display: grid; place-items: center; width: 29px; height: 29px; border-radius: 9px; background: #2d2736; color: var(--accent-strong); flex: 0 0 auto; }
.builder-intro strong { display: block; font-size: 12px; margin: 1px 0 3px; }
.builder-intro p { color: var(--muted); font-size: 10px; margin: 0; line-height: 1.55; }
.form-grid, .video-settings, .advanced-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px 12px; }
.form-field { min-width: 0; }
.form-field input, .form-field select { font-size: 11px; height: 39px; }
.form-field small { display: block; color: var(--subtle); font-size: 10px; line-height: 1.5; margin-top: 6px; }
.span-2 { grid-column: 1 / -1; }
.checklist-field { min-width: 0; border: 1px solid var(--border-soft); border-radius: 11px; padding: 12px; margin: 0; }
.checklist-field legend { color: #dedbe3; font-size: 11px; font-weight: 700; padding: 0 5px; }
.check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px 13px; }
.check-grid label { display: flex; align-items: flex-start; gap: 8px; min-width: 0; color: #c8c6ce; font-size: 10px; line-height: 1.4; cursor: pointer; }
.check-grid input { accent-color: #a88bc8; margin: 1px 0 0; flex: 0 0 auto; }
.video-options { margin-top: 18px; padding: 16px; border: 1px solid #4a3e59; border-radius: 12px; background: rgba(113, 89, 143, .08); }
.video-options-heading { display: flex; gap: 11px; align-items: flex-start; margin-bottom: 16px; }
.play-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: #382f46; color: var(--accent-strong); flex: 0 0 auto; }
.video-options-heading strong { display: block; font-size: 12px; margin: 2px 0 4px; }
.video-options-heading p { color: var(--muted); font-size: 10px; line-height: 1.55; margin: 0; }
.video-settings { gap: 12px; }
.video-effects { padding-top: 15px; margin-top: 14px; border-top: 1px solid rgba(113, 89, 143, .26); }
.advanced-settings { margin-top: 18px; padding: 12px 0 0; border-top: 1px solid var(--border-soft); }
.advanced-settings summary { color: #ccc8d3; font-size: 11px; font-weight: 650; cursor: pointer; }
.advanced-grid { margin-top: 15px; }
.advanced-settings > p { margin: 11px 0 0; line-height: 1.55; }
.generate-footer { justify-content: space-between; gap: 13px; margin-top: 23px; padding-top: 18px; border-top: 1px solid var(--border-soft); }
.privacy-note { gap: 9px; color: #c9c5cf; font-size: 10px; line-height: 1.45; min-width: 0; }
.privacy-note > span:first-child { color: var(--accent); font-size: 19px; }
.privacy-note small { color: var(--subtle); font-size: 9px; }
.button { justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 9px; text-decoration: none; font-size: 11px; font-weight: 750; padding: 10px 14px; cursor: pointer; white-space: nowrap; transition: transform .15s ease, background .15s ease, border-color .15s ease; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { opacity: .5; cursor: not-allowed; }
.button.primary { color: #151019; background: linear-gradient(120deg, #c8a2ff, #8250c7); border-color: #aa7de9; box-shadow: 0 6px 22px rgba(126, 64, 191, .18); }
.button.primary:hover:not(:disabled) { background: #d5baff; }
.button.secondary { color: #ded5e9; background: #292431; border-color: #51445f; }
.button.secondary:hover:not(:disabled) { background: #342a40; }
.button.quiet { color: #c3c0c9; border-color: #373740; background: transparent; }
.button.quiet:hover:not(:disabled) { background: #22232a; }
.button.small { font-size: 10px; padding: 8px 11px; }
.button.full { width: 100%; }
.generate-button { gap: 10px; min-height: 45px; padding: 0 16px; flex: 0 0 auto; }
.generate-button > span:first-child { font-size: 16px; }
.button-arrow { font-size: 15px; margin-left: 2px; }
.progress-box { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid #463a54; border-radius: 10px; background: #211d28; margin-top: 15px; }
.progress-box strong { display: block; font-size: 11px; }
.progress-box p { color: var(--muted); font-size: 10px; margin: 3px 0 0; }
.spinner { width: 24px; height: 24px; border: 2px solid #4b3d5c; border-top-color: var(--accent-strong); border-radius: 50%; animation: spin .8s linear infinite; flex: 0 0 auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.form-error { color: var(--danger); font-size: 11px; line-height: 1.5; margin: 12px 0 0; overflow-wrap: anywhere; }
.preview-badge { color: var(--subtle); font-size: 9px; font-weight: 750; letter-spacing: .1em; border: 1px solid #383942; border-radius: 6px; padding: 5px 7px; white-space: nowrap; }
.empty-preview { text-align: center; padding: 10px 0 22px; }
.empty-art { position: relative; overflow: hidden; width: min(100%, 390px); aspect-ratio: 1.15; margin: 0 auto 21px; border: 1px solid #3c3547; border-radius: 12px; background: radial-gradient(ellipse at 70% 24%, #5d536b 0, #272430 28%, transparent 62%), linear-gradient(150deg, #26232e, #101115 80%); }
.empty-art::before { content: ""; position: absolute; bottom: 0; left: -5%; width: 110%; height: 35%; background: linear-gradient(160deg, #292630, #111217 70%); clip-path: polygon(0 58%, 21% 34%, 36% 61%, 59% 25%, 77% 54%, 100% 22%, 100% 100%, 0 100%); }
.empty-moon { position: absolute; right: 22%; top: 15%; width: 42px; height: 42px; background: #b6a7ca; border-radius: 50%; opacity: .85; box-shadow: 0 0 28px rgba(193, 171, 216, .25); }
.empty-moon::after { content: ""; position: absolute; top: -5px; left: 12px; width: 42px; height: 42px; border-radius: 50%; background: #25222e; }
.empty-window { position: absolute; z-index: 1; bottom: 0; left: 37%; width: 29%; height: 64%; border: 2px solid #52485d; border-bottom: 0; background: rgba(14, 15, 20, .72); border-radius: 60% 60% 0 0 / 24% 24% 0 0; }
.empty-window::before, .empty-window::after { content: ""; position: absolute; background: #52485d; }
.empty-window::before { width: 2px; height: 100%; left: 50%; }
.empty-window::after { height: 2px; width: 100%; top: 50%; }
.empty-window i { position: absolute; bottom: 0; height: 72%; width: 1px; background: #52485d; }
.empty-window i:first-child { left: 25%; }
.empty-window i:last-child { right: 25%; }
.empty-fog { position: absolute; z-index: 2; bottom: 15%; left: 0; width: 100%; height: 22%; background: rgba(190, 177, 210, .12); filter: blur(13px); }
.empty-preview h3 { margin: 0 0 7px; font-family: Georgia, "Times New Roman", serif; font-size: 20px; font-weight: 400; }
.empty-preview p { max-width: 290px; margin: 0 auto; font-size: 11px; color: var(--muted); line-height: 1.65; }
.result-wrap { min-width: 0; }
.result-media { position: relative; overflow: hidden; display: grid; place-items: center; min-height: 250px; max-height: 610px; aspect-ratio: 1 / .96; border: 1px solid #36343e; border-radius: 11px; background: #0c0d11; }
.result-media img, .result-media video { width: 100%; height: 100%; max-height: 610px; object-fit: contain; background: #0c0d11; }
.result-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 14px 0 7px; }
.result-type { color: var(--accent-strong); font-weight: 800; font-size: 9px; letter-spacing: .13em; }
.result-prompt { color: var(--muted); font-size: 10px; line-height: 1.6; overflow-wrap: anywhere; margin: 0 0 13px; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.result-actions { flex-wrap: wrap; gap: 8px; }
.result-actions .button { flex: 1 1 auto; }
.preview-footnote { display: flex; gap: 10px; border-top: 1px solid var(--border-soft); padding-top: 17px; margin-top: 20px; }
.preview-footnote > span { color: var(--accent); font-size: 16px; }
.preview-footnote p { margin: 0; font-size: 10px; color: var(--muted); line-height: 1.65; }
.bottom-note { display: flex; gap: 12px; align-items: flex-start; margin-top: 18px; padding: 15px 17px; border: 1px solid #393340; border-radius: 12px; background: rgba(34, 29, 40, .52); }
.note-icon { display: grid; place-items: center; flex: 0 0 auto; width: 21px; height: 21px; border: 1px solid #59496b; border-radius: 50%; color: var(--accent-strong); font-family: Georgia, serif; font-size: 12px; }
.bottom-note strong { display: block; font-size: 11px; margin-bottom: 4px; }
.bottom-note p { color: var(--muted); font-size: 10px; line-height: 1.65; margin: 0; }
.app-footer { min-height: 39px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--border-soft); padding: 9px 28px; color: var(--subtle); font-size: 9px; letter-spacing: .04em; }
.app-footer span:first-child { letter-spacing: .13em; font-weight: 800; }
.toast { position: fixed; z-index: 30; right: 22px; bottom: 22px; max-width: min(440px, calc(100vw - 32px)); padding: 13px 16px; border: 1px solid #584967; border-radius: 11px; color: #ece5f5; background: #282231; box-shadow: var(--shadow); font-size: 12px; }
/* Library */
.library-heading { align-items: center; }
.library-toolbar { gap: 9px; flex-wrap: wrap; }
.upload-label { cursor: pointer; }
.library-filters { display: flex; align-items: center; gap: 18px; padding: 14px 0; margin-bottom: 18px; border-top: 1px solid var(--border-soft); border-bottom: 1px solid var(--border-soft); }
.filter-buttons { gap: 6px; }
.filter-button { padding: 7px 11px; border: 1px solid transparent; border-radius: 7px; color: var(--muted); background: transparent; font-size: 10px; cursor: pointer; }
.filter-button.active { color: var(--accent-strong); border-color: #52435f; background: #292431; }
.library-summary { margin-left: auto; color: var(--subtle); font-size: 10px; }
.asset-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.asset-card { min-width: 0; overflow: hidden; border: 1px solid var(--border); border-radius: 13px; background: #191a20; }
.asset-thumb { display: block; position: relative; width: 100%; aspect-ratio: 4 / 3; background: #0c0d11; object-fit: contain; }
.asset-thumb video { width: 100%; height: 100%; object-fit: contain; display: block; }
.asset-kind { position: absolute; top: 9px; left: 9px; padding: 4px 7px; color: #e4d4f6; background: rgba(26, 22, 34, .9); border: 1px solid #56476a; border-radius: 5px; letter-spacing: .1em; font-size: 8px; font-weight: 800; }
.asset-body { padding: 12px; }
.asset-title { color: #f0edf5; font-size: 11px; font-weight: 750; margin: 0 0 5px; overflow-wrap: anywhere; }
.asset-date { color: var(--subtle); font-size: 9px; margin: 0 0 9px; }
.asset-prompt { color: var(--muted); font-size: 10px; line-height: 1.55; margin: 0 0 12px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.asset-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.asset-actions .button { flex: 1 1 auto; padding: 8px 9px; font-size: 9px; }
.button.danger { color: #e4b7b7; border-color: #5c3e45; background: #2b2025; }
.button.danger:hover { background: #3a272d; }
.empty-library { text-align: center; padding: 70px 18px; border: 1px dashed #3d3c47; border-radius: 14px; background: rgba(23,24,30,.48); }
.empty-library-mark { margin: 0 auto 15px; display: grid; place-items: center; width: 54px; height: 54px; background: #282330; color: var(--accent); border-radius: 16px; font-size: 23px; }
.empty-library h3 { font-family: Georgia, serif; font-size: 22px; font-weight: 400; margin-bottom: 7px; }
.empty-library p { color: var(--muted); font-size: 11px; margin-bottom: 18px; }
.local-storage-note { padding: 15px 17px; margin-top: 22px; border: 1px solid #34343d; border-radius: 11px; background: #18191e; }
.local-storage-note strong { font-size: 11px; }
.local-storage-note p { color: var(--muted); font-size: 10px; line-height: 1.6; margin: 4px 0 0; }
/* Login */
.login-screen { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 22px; background: radial-gradient(ellipse at 50% 0%, rgba(106, 81, 137, .23), transparent 50%), #0f1014; }
.login-card { width: min(100%, 400px); padding: 35px; border: 1px solid #393441; border-radius: 19px; background: linear-gradient(150deg, #1d1b24, #15161b); box-shadow: var(--shadow); }
.login-card .brand-mark { margin-inline: auto; }
.login-card > .eyebrow, .login-card > h1, .login-card > .muted, .login-card > .tiny { text-align: center; }
.login-card h1 { font-size: 29px; letter-spacing: -.05em; margin: 0 0 10px; }
.login-card h1 span { color: var(--accent-strong); font-family: Georgia, serif; font-weight: 400; font-style: italic; }
.login-card > .muted { font-size: 12px; line-height: 1.65; margin-bottom: 24px; }
.login-card form { display: grid; gap: 9px; }
.login-card form .button { margin-top: 4px; min-height: 43px; }
.login-card .tiny { margin: 20px 0 0; line-height: 1.55; }
.login-card .form-error { text-align: center; margin: 2px 0 0; }
@media (max-width: 1200px) {
  .layout { grid-template-columns: 205px minmax(0, 1fr); }
  .workspace-grid { grid-template-columns: minmax(0, 1fr); }
  .preview-panel { position: static; }
  .result-media { aspect-ratio: 1.2 / 1; }
  .result-media img, .result-media video { max-height: 650px; }
  .empty-art { max-width: 480px; }
}
@media (max-width: 820px) {
  .topbar { padding: 0 18px; height: 68px; }
  .layout { display: block; min-height: calc(100vh - 106px); }
  .sidebar { padding: 9px 16px; border-right: 0; border-bottom: 1px solid var(--border-soft); flex-direction: row; align-items: center; gap: 8px; min-height: 0; }
  .sidebar > .side-label, .sidebar-bottom { display: none; }
  .nav-button { width: auto; flex: 1; justify-content: center; padding: 9px 12px; }
  .nav-button + .nav-button { margin-top: 0; }
  .nav-count { margin-left: 0; }
  .main-content { padding: 28px 18px 30px; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .model-pill { align-self: stretch; }
  .asset-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .app-footer { padding: 11px 18px; }
}
@media (max-width: 560px) {
  .topbar { padding: 0 12px; gap: 7px; }
  .brand-lockup { gap: 8px; }
  .brand-mark { width: 36px; height: 36px; font-size: 23px; border-radius: 10px; }
  .brand-name { font-size: 11px; letter-spacing: .12em; }
  .brand-subtitle { font-size: 7px; letter-spacing: .06em; }
  .topbar-actions { gap: 8px; }
  .service-status { display: none; }
  .main-content { padding: 23px 12px 25px; }
  .page-heading { gap: 16px; margin-bottom: 22px; }
  .page-heading h1 { font-size: 31px; }
  .heading-copy { font-size: 12px; }
  .mode-switch { gap: 5px; padding: 4px; margin-bottom: 12px; }
  .mode-tab { padding: 10px 8px; gap: 7px; }
  .mode-tab > span:first-child { width: 23px; font-size: 18px; }
  .mode-tab strong { font-size: 10px; }
  .mode-tab small { font-size: 9px; line-height: 1.35; }
  .panel { border-radius: 13px; }
  .prompt-panel, .preview-panel { padding: 15px; }
  .panel-heading h2 { font-size: 13px; }
  .suggestions { gap: 6px; }
  .suggestion-chip { font-size: 10px; padding: 7px 8px; }
  .form-grid, .video-settings, .advanced-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .span-2 { grid-column: auto; }
  .check-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .generate-footer { align-items: stretch; flex-direction: column; }
  .generate-button { width: 100%; }
  .privacy-note { align-self: flex-start; }
  .result-media { min-height: 190px; aspect-ratio: 1 / 1; }
  .result-actions { display: grid; grid-template-columns: 1fr; }
  .bottom-note { padding: 13px; }
  .app-footer { align-items: flex-start; flex-direction: column; gap: 4px; font-size: 8px; }
  .library-heading { align-items: stretch; }
  .library-toolbar { width: 100%; }
  .library-toolbar .button { flex: 1; }
  .library-filters { flex-wrap: wrap; gap: 10px; }
  .filter-label { width: 100%; }
  .library-summary { margin-left: auto; }
  .asset-grid { grid-template-columns: minmax(0, 1fr); }
  .asset-thumb { aspect-ratio: 16 / 10; }
  .login-card { padding: 25px 21px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}


/* Nocturne v2: deep black and violet, image references, storyboard and audio */
.reference-uploader { margin-top: 15px; padding: 15px; border: 1px solid #3a2850; border-radius: 12px; background: linear-gradient(135deg, rgba(67, 35, 95, .16), rgba(12, 9, 17, .88)); }
.reference-topline { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.reference-topline .eyebrow, .storyboard-head .eyebrow { margin-bottom: 5px; font-size: 8px; }
.reference-topline h3, .storyboard-head h3 { margin: 0 0 5px; font-size: 13px; font-weight: 750; }
.reference-help, .storyboard-head p { color: var(--muted); font-size: 10px; line-height: 1.6; margin: 0; max-width: 560px; }
.reference-upload-button { flex: 0 0 auto; }
.reference-preview-panel { display: flex; align-items: center; gap: 12px; padding: 9px; margin-top: 13px; border: 1px solid #463158; border-radius: 9px; background: rgba(5, 4, 8, .6); min-width: 0; }
.reference-preview-panel img { width: 68px; height: 78px; object-fit: contain; flex: 0 0 auto; background: #08060b; border-radius: 5px; }
.reference-file-copy { min-width: 0; }
.reference-file-copy strong, .reference-file-copy small { display: block; overflow-wrap: anywhere; }
.reference-file-copy strong { font-size: 11px; margin-bottom: 3px; }
.reference-file-copy small { color: var(--muted); font-size: 9px; line-height: 1.5; }
.text-button { margin-top: 7px; padding: 0; border: 0; color: #c29bfa; background: transparent; font-size: 10px; cursor: pointer; }
.reference-strength-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(80px, .9fr) 45px; align-items: center; gap: 10px; margin-top: 13px; }
.reference-strength-row label { font-size: 10px; font-weight: 650; }
.reference-strength-row input[type=range] { width: 100%; accent-color: var(--accent-strong); }
.reference-strength-row output { color: var(--accent-strong); font-size: 10px; text-align: right; }
.pose-presets { margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--border-soft); }
.preset-title { display: block; margin-bottom: 9px; color: var(--subtle); font-size: 8px; font-weight: 800; letter-spacing: .13em; }
.preset-chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.pose-chip { padding: 7px 8px; font-size: 9px; }
.storyboard-editor { margin-top: 19px; padding-top: 18px; border-top: 1px solid #4a315e; }
.storyboard-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 13px; }
.storyboard-head h3 { font-size: 15px; }
.storyboard-toolbar, .narration-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-bottom: 12px; }
.storyboard-empty { display: grid; justify-items: start; gap: 4px; padding: 18px; border: 1px dashed #49335b; border-radius: 10px; background: rgba(10, 7, 14, .52); }
.storyboard-empty > span { color: var(--accent-strong); font-size: 20px; }
.storyboard-empty strong { font-size: 11px; }
.storyboard-empty p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.storyboard-list { display: grid; gap: 12px; }
.story-scene { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 12px; padding: 11px; min-width: 0; border: 1px solid #382747; border-radius: 12px; background: rgba(11, 8, 15, .84); }
.story-scene-thumb { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: contain; align-self: start; background: #030305; border: 1px solid #2f203d; border-radius: 7px; }
.story-scene-main { min-width: 0; }
.story-scene-top { display: flex; align-items: flex-start; gap: 8px; justify-content: space-between; margin-bottom: 9px; }
.story-scene-top strong { font-size: 11px; line-height: 1.4; overflow-wrap: anywhere; }
.story-scene-order { display: flex; gap: 4px; flex: 0 0 auto; }
.story-scene-order button { width: 27px; height: 27px; border: 1px solid #49345c; border-radius: 6px; background: #21172c; color: #d7b8ff; cursor: pointer; }
.story-scene-order button:disabled { opacity: .25; cursor: default; }
.story-scene-controls { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
.story-scene-controls .form-field label { font-size: 9px; margin-bottom: 5px; }
.story-scene-controls .form-field input, .story-scene-controls .form-field select, .story-scene-controls .form-field textarea { font-size: 10px; padding: 8px 9px; height: 34px; }
.story-scene-controls .form-field textarea { height: auto; min-height: 52px; resize: vertical; line-height: 1.4; }
.story-scene-controls .wide { grid-column: 1 / -1; }
.story-scene-controls .form-field small { margin-top: 4px; }
.narration-editor { margin-top: 16px; padding: 13px; border: 1px solid #382747; border-radius: 11px; background: rgba(27, 17, 36, .42); }
.narration-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.narration-header strong { font-size: 11px; }
.narration-header p { margin: 4px 0 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.audio-icon { display: grid; place-items: center; width: 28px; height: 28px; flex: 0 0 auto; border-radius: 8px; border: 1px solid #5a3c76; color: var(--accent-strong); background: #281735; }
.narration-actions { margin-bottom: 6px; }
.narration-actions .button { font-size: 10px; padding: 8px 10px; }
#narrationAudioPreview { width: 100%; height: 36px; margin-top: 5px; accent-color: var(--accent-strong); }
#narrationStatus { margin: 7px 0 0; line-height: 1.5; overflow-wrap: anywhere; }
.storyboard-footer { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; align-items: center; margin-top: 13px; }
.storyboard-footer p { color: var(--subtle); font-size: 9px; line-height: 1.5; margin: 0; }
.storyboard-footer .full { width: auto; }
.storyboard-footer #previewStoryText { grid-column: 2; }
.storyboard-footer #exportStoryVideo { min-height: 39px; }
.story-scene-controls input[type=text], .story-scene-controls textarea { resize: vertical; }
@media (max-width: 820px) {
  .reference-uploader { padding: 13px; }
  .story-scene { grid-template-columns: 88px minmax(0,1fr); gap: 9px; }
  .story-scene-controls { grid-template-columns: minmax(0,1fr); }
  .story-scene-controls .wide { grid-column: auto; }
}
@media (max-width: 560px) {
  .reference-topline { flex-direction: column; }
  .reference-upload-button { width: 100%; }
  .reference-strength-row { grid-template-columns: minmax(0,1fr) 56px; }
  .reference-strength-row label { grid-column: 1 / -1; }
  .storyboard-head { flex-direction: column; }
  .storyboard-toolbar > .button { flex: 1 1 auto; }
  .story-scene { grid-template-columns: 76px minmax(0,1fr); padding: 8px; gap: 8px; }
  .story-scene-controls { grid-template-columns: minmax(0,1fr); }
  .story-scene-top { flex-direction: column; }
  .story-scene-order { align-self: flex-end; }
  .storyboard-footer { grid-template-columns: minmax(0,1fr); }
  .storyboard-footer .full, .storyboard-footer #previewStoryText { width: 100%; grid-column: auto; }
  .narration-actions > .button { flex: 1 1 auto; justify-content: center; }
  .reference-preview-panel img { width: 56px; height: 68px; }
}

/* Refinamentos de continuidade de personagem e mobile */
.story-scene-media { display: grid; align-content: start; gap: 7px; min-width: 0; }
.story-vary-button { width: 100%; min-width: 0; padding: 7px 5px; white-space: normal; font-size: 9px; }
.pose-chip:active, .suggestion-chip:active { transform: translateY(1px); }
.reference-uploader, .storyboard-editor, .narration-editor, .video-options { scroll-margin-top: 88px; }
@media (max-width: 560px) {
  .story-scene-media { grid-template-columns: 1fr; }
  .story-vary-button { font-size: 9px; padding: 7px 4px; }
  .reference-preview-panel { align-items: flex-start; }
  .reference-file-copy { overflow-wrap: anywhere; }
  .storyboard-editor { padding-top: 14px; }
  .story-scene { grid-template-columns: 76px minmax(0,1fr); }
}
