/* Studio workspace: shared palette, comfortable type and deliberate hierarchy. */
:root {
  --bg: #101115;
  --panel: #18191f;
  --line: #2a2b34;
  --text: #eeedf5;
  --muted: #9a99aa;
  --purple: #c5b0ff;
  --mint: #96ddca;
}
.studio-app { font-family: Inter, "Segoe UI", sans-serif; font-size: 14px; line-height: 1.5; }
:where(.studio-app) :is(button, input, select, textarea) { font: inherit; }
.studio-app button, .studio-app a, .studio-app select { transition: background .16s, border-color .16s, color .16s, box-shadow .16s; }
.studio-app input:focus-visible { outline: 2px solid var(--purple); outline-offset: 3px; }
.studio-app button:disabled { cursor: not-allowed; }
.skip-link { position: fixed; left: 20px; top: -80px; z-index: 200; padding: 12px 20px; background: var(--purple); color: #20182f; border-radius: 8px; }
.skip-link:focus { top: 12px; }
.sidebar { width: 244px; padding: 28px 16px 20px; background: #141519; }
.brand { padding: 0 8px 30px; font-size: 22px; gap: 11px; }
.brand-mark { width: 36px; height: 36px; border-radius: 12px; box-shadow: 0 3px 18px #b69bff18; }
.brand-light { color: #aaa6ba; }
.new-button { min-height: 45px; padding: 10px 14px; border-color: #6a568e; background: #30263f; color: #e5d9ff; border-radius: 10px; font-size: 13px; }
.new-button:hover { background: #403052; border-color: #ae91dd; }
.new-button kbd { padding: 0 5px; line-height: 20px; }
.section-label { padding: 26px 10px 12px; font-size: 10px; letter-spacing: 1.4px; color: #9b97a8; }
.section-label span { background: #282630; color: #bcb4cd; border-radius: 5px; min-width: 21px; text-align: center; }
#scene-search, #folder-filter { margin: 0 0 10px; width: 100%; padding: 10px 12px; font-size: 12px; border-color: var(--line); background: #1b1c23; border-radius: 8px; color: #ccc8d8; }
#scene-search::placeholder { color: #93909f; }
#folder-filter { margin-bottom: 16px; }
.archive-link { order: 1; padding: 13px 10px; margin-top: 12px; border-top: 1px solid var(--line); color: #aaa4b8; font-size: 12px; }
.archive-link:hover { color: var(--purple); }
.sidebar-footer { order: 2; font-size: 10px; padding: 16px 5px 0; color: #bbb6c9; }
.sidebar-footer small { color: #8a8598; font-size: 10px; }
.small-logo { color: var(--purple); }
#sessions { scrollbar-width: thin; scrollbar-color: #3b3549 transparent; }
.no-sessions { padding: 15px 12px; margin: 6px 0; border: 1px dashed #33303d; border-radius: 10px; font-size: 12px; color: #9690a4; line-height: 1.8; }
.session-row { position: relative; margin: 3px 0; border-radius: 8px; }
.session-item { padding: 12px 10px; color: #b8b3c5; font-size: 12px; min-height: 43px; }
.session-item.active { background: #2a2535; color: #eee4ff; box-shadow: inset 2px 0 var(--purple); }
.session-icon { color: #b49bd8; }
.session-menu { position: relative; flex: 0 0 28px; }
.session-menu > summary { list-style: none; cursor: pointer; color: #aaa1b8; text-align: center; border-radius: 6px; font-size: 18px; line-height: 32px; }
.session-menu > summary::-webkit-details-marker { display: none; }
.session-menu > summary:hover, .session-menu[open] > summary { background: #342c42; color: #eee4ff; }
.session-menu-items { position: absolute; top: 32px; right: 0; z-index: 12; width: 190px; padding: 5px; border: 1px solid #46404f; border-radius: 10px; background: #22212a; box-shadow: 0 10px 30px #0008; }
.session-action { display: block; width: 100%; text-align: left; font-size: 12px; padding: 9px 10px; border-radius: 5px; color: #d1c8df; }
.session-action:hover { background: #373040; }
.session-action:last-child { color: #ecadb5; }
main { margin-left: 244px; }
.topbar { height: 70px; padding: 0 28px; background: #141519; }
.breadcrumb { flex: 1; font-size: 12px; color: #9691a4; }
.breadcrumb strong { color: #e3ddec; }
.topbar-actions { gap: 18px; }
.topbar .download-button { padding: 7px 12px; font-size: 12px; background: #202027; border-color: #36313f; color: #d5c9e8; }
.api-nav-link { text-decoration: none; font-size: 11px; color: #aaa1ba; }
.system-state { font-size: 11px; color: #a5a0b1; }
.system-state i.ok { box-shadow: 0 0 0 4px #96ddca0b; }
.workspace { grid-template-columns: minmax(320px, 370px) minmax(0, 1fr); }
.conversation { background: #17181e; }
.panel-heading { padding: 22px; min-height: 88px; }
.director-avatar { width: 40px; height: 40px; border: 1px solid #4b3b63; border-radius: 13px; background: #30263f; }
.panel-heading h1 { font-size: 14px; margin-bottom: 3px; }
.panel-heading p { font-size: 11px; color: #a39caf; }
.live-dot { width: 5px; height: 5px; }
.messages { min-height: 100px; padding: 28px 24px; }
.message-label { font-size: 11px; margin-bottom: 12px; }
.message-body { font-size: 13px; line-height: 1.85; color: #c7c1d2; }
.message.user .message-body { background: #25232e; border-color: #393241; padding: 13px 15px; border-radius: 14px 14px 4px 14px; }
.greeting-title { font-size: clamp(24px, 1.9vw, 30px); font-weight: 500; letter-spacing: -.9px; line-height: 1.3; margin: 14px 0 20px; }
.greeting-title span { color: #c6b1ef; }
.greeting-note { border-left-color: #675180; font-size: 12px; line-height: 1.75; color: #a399b2; padding-left: 14px; margin-top: 23px; }
.prompt-starters { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 22px; }
.prompt-starter { background: #24212d; border: 1px solid #41344f; border-radius: 20px; padding: 7px 11px; color: #d3c3e8; font-size: 11px !important; }
.prompt-starter:hover { background: #342a42; border-color: #a184c6; }
.composer-wrap { flex-shrink: 0; max-height: 55%; padding: 14px 18px 18px; overflow-y: auto; border-top: 1px solid #25242d; background: #17181e; }
.composer-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 3px 12px; }
.text-button { border: 0; background: transparent; padding: 4px 0; color: #c2b2d9; font-size: 12px !important; }
.text-button:hover { color: #eee1ff; }
#composer-mode { color: #9a90aa; font-size: 10px; white-space: nowrap; }
.composer { background: #202027; border: 1px solid #48404f; padding: 14px 14px 10px; border-radius: 14px; box-shadow: 0 6px 24px #0001; }
.composer:focus-within { border-color: #b69bdc; box-shadow: 0 0 0 3px #b69bdc0c; }
.composer textarea { font-size: 13px; resize: none; min-height: 70px; max-height: 150px; line-height: 1.7; }
.composer textarea::placeholder { color: #aaa0b7; }
.composer-bottom > span { font-size: 10px; color: #9b90aa; }
.composer-bottom button { width: 34px; height: 34px; border-radius: 10px; font-size: 23px; }
.composer-bottom button:hover { background: #dbcbff; }
.composer-note { font-size: 10px; color: #92879f; margin-top: 11px; }
.studio { padding: 30px 32px 22px; max-width: 1600px; scrollbar-gutter: stable; }
.studio-heading { gap: 20px; align-items: flex-start; }
.eyebrow { font-size: 9px; font-weight: 600; letter-spacing: 1.6px; color: #a69bb8; margin-bottom: 8px; }
.eyebrow > span { display: inline-block; width: 5px; height: 5px; background: var(--mint); border-radius: 50%; margin: 0 5px 1px 0; }
.studio-heading h2 { font-size: clamp(25px, 2.25vw, 34px); line-height: 1.2; letter-spacing: -1px; font-weight: 500; }
.studio-heading h2 > span { font-size: 25px; color: #8e7aab; margin-left: 10px; }
.studio-controls-row { gap: 10px; }
.quality-control { font-size: 10px; color: #a59caf; gap: 5px; }
.studio-app select { font-size: 12px; padding: 9px 10px; background: #202027; border-color: #3a3443; border-radius: 8px; color: #d8cfe5; }
.tabs { gap: 6px; margin-top: 26px; padding: 0 0 9px; border-bottom-color: #302b38; }
.tab { padding: 9px 13px; border-radius: 8px; border-bottom: 0; font-size: 12px; color: #aaa1b7; gap: 8px; margin: 0; white-space: nowrap; }
.tab:hover { background: #23202b; color: #dfd3ec; }
.tab.active { color: #e0ceff; background: #2c2538; box-shadow: inset 0 0 0 1px #4a3b5d; }
.preview-frame { margin-top: 18px; border: 1px solid #3b3249; border-radius: 16px; box-shadow: 0 14px 40px #0002; }
.pane { width: 100%; min-width: 0; height: clamp(350px, 43vh, 570px); min-height: 350px; }
.empty-preview { padding: 12px 25px 34px; background: radial-gradient(ellipse at 50% 30%, #35274450, transparent 70%), radial-gradient(#76618718 .7px, transparent .7px); background-size: auto, 22px 22px; }
.grid-art { max-width: 540px; margin: -5px 0 0; }
.grid-art svg { max-height: 230px; }
.art-label { bottom: 17px; font-size: 8px; letter-spacing: 2px; color: #a397b5; }
.empty-preview h3 { font-size: 21px; letter-spacing: -.5px; margin: 2px 0 10px; }
.empty-preview p { font-size: 12px; line-height: 1.85; color: #a89bb7; max-width: 380px; }
.frame-footer { background: #19171f; border-color: #302a39; color: #a496b5; font-size: 9px; padding: 12px 16px; letter-spacing: .7px; }
.frame-footer i { background: var(--mint); }
.render-bar { padding: 15px 0; margin: 0 0 16px; gap: 16px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.render-bar strong { font-size: 12px; color: #ddd2e9; }
.render-bar small { font-size: 11px; color: #a195ad; }
.render-dot { border-color: #2c2535; }
.download-button { padding: 9px 13px; font-size: 12px !important; line-height: 1.4; border-radius: 8px; border-color: #554366; background: #2c2338; color: #e0cef6; }
.download-button:hover { background: #3b2d4c; border-color: #9576b6; }
.interactive-lab { border: 0; border-radius: 0; padding: 0; margin: 22px 0 28px; background: transparent; }
.inspiration-heading h3 { font-size: 15px; font-weight: 500; letter-spacing: -.2px; }
.inspiration-heading > span { color: #92849f; font-size: 8px; }
.section-description { font-size: 12px; color: #a397ae; margin: 5px 0 16px; line-height: 1.7; }
.demo-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.demo-card { align-items: flex-start; gap: 12px; border: 1px solid #35303f; background: #1c1a23; border-radius: 12px; padding: 16px 13px; min-height: 115px; flex-direction: column; position: relative; }
.demo-card::after { content: '↗'; position: absolute; top: 13px; right: 14px; color: #857292; font-size: 16px; }
.demo-card:hover { transform: none; background: #24202d; border-color: #8e769e; box-shadow: 0 5px 20px #0002; }
.demo-icon { background: #31263f; color: #cdb4ed; border: 1px solid #4a375e; width: 32px; height: 32px; border-radius: 9px; font: 23px Georgia, serif; }
.demo-card:nth-child(3n+2) .demo-icon { color: #9adbc7; background: #20342f; border-color: #38564c; }
.demo-card:nth-child(3n) .demo-icon { color: #e3c799; background: #342e25; border-color: #554735; }
.demo-card strong { font-size: 12px; line-height: 1.45; font-weight: 500; }
.demo-card small { font-size: 10px; line-height: 1.6; color: #a49aaf; margin-top: 5px; }
.demo-grid:not(.expanded) .demo-card:nth-child(n+4) { display: none; }
.storyboard { margin: 0 0 24px; padding: 16px; background: #1a1820; border-color: #37303f; border-radius: 10px; }
.storyboard summary { font-size: 12px; color: #c7bbd3; font-weight: 400; }
.storyboard p { font-size: 12px; }
.inspiration { padding-top: 22px; }
.idea-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
.idea { min-height: 62px; padding: 12px; border-color: #302b38; background: #18171e; border-radius: 10px; }
.idea:hover { transform: none; background: #221d2c; }
.idea strong { font-size: 12px; color: #cfc0df; font-weight: 400; }
.idea small { font-size: 10px; color: #a092af; }
.idea-art { width: 34px; height: 34px; font-size: 27px; }
.studio-footer { font-size: 10px; color: #9685a6; margin-top: 28px; }
.settings-dialog, .drive-dialog { color: var(--text); width: 600px; max-width: calc(100vw - 32px); max-height: calc(100dvh - 48px); padding: 26px; border: 1px solid #574366; border-radius: 18px; background: #1b1822; box-shadow: 0 25px 100px #0008; scrollbar-width: thin; }
.settings-dialog::backdrop, .drive-dialog::backdrop { background: #08070bbd; backdrop-filter: blur(8px); }
.dialog-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.dialog-heading h2 { font-size: 25px; font-weight: 500; letter-spacing: -.7px; margin: 0; }
.icon-button { border: 1px solid #47394f; border-radius: 8px; background: #28202f; color: #d2bddf; height: 36px; width: 36px; flex-shrink: 0; font-size: 21px !important; }
.icon-button:hover { background: #3c2c46; }
.scene-settings { margin: 16px 0 0; border: 1px solid #3c3046; border-radius: 10px; padding: 4px 14px 10px; color: #c9bbd5; }
.scene-settings summary { padding: 11px 0; color: #e0d0ed; font-size: 13px; }
.scene-settings:not([open]) { padding-bottom: 4px; }
.scene-settings p { font-size: 12px; line-height: 1.75; color: #a99ab6; }
.scene-settings label { font-size: 12px; color: #baacc7; }
.scene-settings input:not([type=checkbox]), .scene-settings select, .scene-settings textarea { background: #141219 !important; color: #e5d9ee !important; border-color: #4a3a55 !important; padding: 10px !important; font-size: 12px !important; }
.scene-settings input[type=checkbox] { accent-color: var(--purple); vertical-align: middle; margin-right: 6px; }
.scene-settings > label > input:not([type=checkbox]) { margin-top: 5px; }
.settings-grid { gap: 14px; }
.dialog-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 24px; padding-top: 20px; border-top: 1px solid #3a2e43; }
.dialog-footer span { font-size: 11px; color: #a895b7; }
.primary-button { padding: 10px 22px; border-radius: 9px; border: 1px solid #c6a6ea; background: var(--purple); color: #261634; font-size: 13px !important; font-weight: 600 !important; }
.primary-button:hover { background: #ddc5ff; }
.export-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 16px; margin: 24px 0; }
.export-grid label { display: flex; flex-direction: column; gap: 8px; color: #cbbbd8; font-size: 12px; }
.export-grid input, .export-grid select { width: 100%; min-height: 42px; padding: 10px 12px; background: #141219; color: #eee1fa; border: 1px solid #4a3a55; border-radius: 8px; font-size: 13px; }
.export-grid small { font-size: 10px; color: #a895b8; }
.export-summary { display: grid; gap: 8px; padding: 16px; border: 1px solid #493752; border-radius: 10px; background: #26202f; }
.export-summary strong { color: #e7d5ff; font-size: 16px; font-weight: 500; }
.export-summary span { color: #b1a0bf; font-size: 12px; line-height: 1.7; }
@media (max-width: 480px) { .export-grid { grid-template-columns: 1fr; gap: 16px; } .export-grid input, .export-grid select { font-size: 16px; } }
#plan-panel { background: #251e30; border-color: #695080; border-radius: 12px; margin: 0 0 16px; }
#plan-panel h3 { margin: 0 0 8px; font-size: 14px; }
#plan-panel .download-button { white-space: normal; margin: 4px 0; }
.inline-error { background: #351e29; border: 1px solid #6a3c50; padding: 10px 12px; border-radius: 8px; font-size: 12px; }
.code-heading { gap: 12px; flex-wrap: wrap; font-size: 11px; padding: 12px 16px; }
.code-pane pre, .live-code-editor { font-size: 12px; line-height: 1.8; }
.live-code-editor { min-height: 0; }
.code-pane pre { overflow: auto; }
.job-history { font-size: 12px; margin: 0 0 18px; }
.production-actions:empty { display: none; }
.production-actions:not(:has(> :not([hidden]))) { display: none; }
.mobile-workspace-tabs, #toggle-sidebar, .close-sidebar { display: none; }
.sidebar-backdrop { position: fixed; inset: 0; border: 0; background: #08070bbd; z-index: 40; }
.archive-page { padding: 32px; }
.archive-page h1 { font-size: 28px; font-weight: 500; }
.archive-card { border-color: #44354e; background: #201a28; }
.account-panel { background: radial-gradient(ellipse at 50% 0, #37263d, #101115 65%); }
.account-panel h1 { font-size: 28px; font-weight: 500; letter-spacing: -.8px; }
.account-panel input { border-color: #554161; background: #211b29; }
.account-panel .download-button { margin-right: 8px; }
@media (min-width: 1600px) {
  .workspace { grid-template-columns: 410px minmax(0, 1fr); }
  .studio { padding: 36px 44px; }
  .messages { padding: 34px 28px; }
  .composer-wrap { padding: 16px 24px 22px; }
}
@media (min-width: 1001px) {
  main { height: 100dvh; display: flex; flex-direction: column; }
  .workspace { flex: 1; min-height: 0; overflow: hidden; }
  .conversation { height: 100%; min-height: 0; position: relative; }
  .studio { height: 100%; overflow-y: auto; margin: 0 auto; }
}
@media (min-width: 1001px) and (max-width: 1399px) {
  .sidebar { width: 212px; padding: 24px 12px 18px; }
  main { margin-left: 212px; }
  .workspace { grid-template-columns: 322px minmax(0, 1fr); }
  .studio { padding: 25px 22px; }
  .studio-heading { flex-wrap: wrap; }
  .studio-controls-row { width: 100%; }
  .quality-control { flex-direction: row; align-items: center; }
  .quality-control > span { display: none; }
  .demo-card { padding: 13px 10px; }
  .demo-card strong { font-size: 11px; }
  .topbar { padding: 0 22px; }
  .topbar-actions { gap: 12px; }
}
@media (max-width: 1000px) {
  .sidebar { display: flex; position: fixed; inset: 0 auto 0 0; height: 100dvh; width: 270px; padding: 28px 18px; flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 0; z-index: 50; transform: translateX(-100%); transition: transform .2s ease; }
  .sidebar.is-open { transform: translateX(0); }
  .close-sidebar { display: block; position: absolute; right: 12px; top: 11px; width: 28px; height: 28px; }
  .sidebar .brand { padding: 0 8px 30px; }
  .sidebar .brand > span:last-child, .sidebar .new-button kbd, .sidebar .section-label, .sidebar .sidebar-footer, .sidebar .session-item span:last-child, .sidebar .no-sessions { display: block; }
  .sidebar .section-label, .sidebar .sidebar-footer { display: flex; }
  .sidebar .new-button { font-size: 13px; width: auto; justify-content: flex-start; margin: 0; }
  .sidebar #scene-search, .sidebar #folder-filter { flex: none; width: 100%; }
  .sidebar #sessions { display: block; flex: 1; }
  .sidebar .session-item { justify-content: flex-start; padding: 12px 10px; }
  main { margin-left: 0; height: 100dvh; display: flex; flex-direction: column; }
  #toggle-sidebar { display: block; }
  .topbar { flex-shrink: 0; height: 64px; padding: 0 18px; gap: 13px; }
  .breadcrumb { font-size: 12px; }
  .topbar-actions { gap: 14px; }
  .workspace { flex: 1; min-height: 0; overflow: hidden; display: grid; grid-template-columns: 330px minmax(0, 1fr); }
  .conversation { height: 100%; min-height: 0; position: relative; border-bottom: 0; }
  .studio { height: 100%; overflow-y: auto; padding: 24px 20px; }
  .studio-heading { flex-wrap: wrap; }
  .studio-controls-row { width: 100%; }
  .quality-control { flex-direction: column; align-items: flex-start; }
  .studio-heading h2 { font-size: 26px; }
  .demo-grid { grid-template-columns: 1fr; }
  .demo-card { flex-direction: row; min-height: auto; padding: 14px; }
  .demo-card > div { padding-right: 18px; }
  .idea-grid { grid-template-columns: 1fr; }
  .inspiration-heading > span { display: none; }
}
@media (max-width: 760px) {
  .topbar { height: 60px; padding: 0 14px; gap: 10px; }
  .topbar .breadcrumb { font-size: 0; }
  .breadcrumb strong { font-size: 13px; }
  .breadcrumb > span { display: none; }
  .topbar-actions { gap: 9px; }
  .topbar .download-button { font-size: 11px !important; padding: 7px 9px; }
  .system-state { font-size: 0; }
  .api-nav-link { display: none; }
  .mobile-workspace-tabs { flex-shrink: 0; display: flex; gap: 4px; margin: 12px 16px; padding: 4px; border: 1px solid #342d3d; border-radius: 11px; background: #1b1821; }
  .mobile-workspace-tabs button { flex: 1; min-height: 36px; color: #b5a4c6; background: transparent; border: 0; border-radius: 7px; font-size: 12px; }
  .mobile-workspace-tabs button[aria-pressed=true] { color: #ead9ff; background: #372a44; box-shadow: 0 2px 7px #0002; }
  .workspace { display: block; }
  .conversation { border-right: 0; height: 100%; }
  .studio-app[data-mobile-view=chat] .studio, .studio-app[data-mobile-view=studio] .conversation { display: none; }
  .panel-heading { padding: 15px 20px; min-height: 72px; }
  .messages { padding: 24px; }
  .greeting-title { font-size: 28px; max-width: 360px; }
  .composer-wrap { max-height: 56%; padding: 12px 16px 16px; }
  .composer textarea { font-size: 16px; min-height: 62px; }
  .composer-note { font-size: 10px; }
  .studio { padding: 15px 16px 28px; }
  .studio-heading { gap: 18px; }
  .studio-heading h2 { font-size: 29px; }
  .studio-controls-row { gap: 10px; }
  .quality-control { flex: 1; min-width: 0; }
  .quality-control select { width: 100%; }
  .studio-app select { font-size: 12px; }
  .tabs { margin-top: 20px; gap: 3px; display: grid; grid-template-columns: 1.35fr 1.1fr .9fr; }
  .tab { justify-content: center; padding: 9px 4px; font-size: 11px; gap: 5px; min-width: 0; }
  .pane { height: 360px; min-height: 300px; }
  .grid-art svg { max-height: 180px; }
  .empty-preview { padding: 12px 20px 24px; }
  .empty-preview h3 { font-size: 19px; text-align: center; }
  .frame-footer { font-size: 8px; padding: 11px; letter-spacing: .3px; gap: 10px; }
  #resolution { text-align: right; }
  .demo-grid { grid-template-columns: 1fr; }
  .demo-card { align-items: center; }
  .demo-card strong { font-size: 13px; }
  .demo-card small { font-size: 11px; }
  .idea-grid { grid-template-columns: 1fr; }
  .idea strong { font-size: 12px; }
  .idea small { font-size: 10px; }
  .studio-footer { gap: 10px; font-size: 9px; }
  .settings-dialog, .drive-dialog { padding: 20px; max-height: calc(100dvh - 24px); }
  .settings-dialog input:not([type=checkbox]), .settings-dialog textarea, .settings-dialog select { font-size: 16px !important; }
  .settings-grid { grid-template-columns: 1fr; }
  .dialog-footer { align-items: flex-end; }
  .dialog-footer span { max-width: 180px; }
  .archive-page { padding: 22px; }
  main:has(.archive-page) .mobile-workspace-tabs { display: none; }
  .setup-banner { max-height: 110px; overflow: auto; margin: 0 16px 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .studio-app *, .studio-app *::before, .studio-app *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
