:root{--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light;--bg:#f6f7f9;--panel:#fff;--panel-soft:#f0f4f3;--surface:#fff;--surface-soft:#fbfcfc;--control:#fff;--readonly:#f8faf9;--callout:#fff8ed;--callout-line:#e5c99e;--selected:#e6f3ee;--work-bg:#eef7f3;--work-line:#c9d8d2;--spinner-line:#b7d5ca;--log-bg:#101514;--log-ink:#d8f4e7;--media-bg:#f4f4f4;--backdrop:#18211f73;--soft-backdrop:#18211f57;--ink:#18211f;--muted:#61706d;--line:#d8dfdc;--accent:#1f7a5a;--accent-strong:#155d45;--warn:#a15c13;--danger:#a33838;--shadow:0 1px 2px #18211f14}:root[data-theme=dark]{--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark;--bg:#101513;--panel:#161d1a;--panel-soft:#1f2b26;--surface:#19211e;--surface-soft:#141b18;--control:#111815;--readonly:#141b18;--callout:#2a2417;--callout-line:#6d5630;--selected:#17362c;--work-bg:#14241f;--work-line:#2c5a4b;--spinner-line:#3f7564;--log-bg:#070b0a;--log-ink:#bcebd7;--media-bg:#101513;--backdrop:#030605ad;--soft-backdrop:#0306058a;--ink:#e4ece9;--muted:#9baaa5;--line:#2b3632;--accent:#42b887;--accent-strong:#72d3aa;--warn:#d39a55;--danger:#e37d7d;--shadow:0 1px 2px #00000047}@media (prefers-color-scheme:dark){:root:not([data-theme]){--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark;--bg:#101513;--panel:#161d1a;--panel-soft:#1f2b26;--surface:#19211e;--surface-soft:#141b18;--control:#111815;--readonly:#141b18;--callout:#2a2417;--callout-line:#6d5630;--selected:#17362c;--work-bg:#14241f;--work-line:#2c5a4b;--spinner-line:#3f7564;--log-bg:#070b0a;--log-ink:#bcebd7;--media-bg:#101513;--backdrop:#030605ad;--soft-backdrop:#0306058a;--ink:#e4ece9;--muted:#9baaa5;--line:#2b3632;--accent:#42b887;--accent-strong:#72d3aa;--warn:#d39a55;--danger:#e37d7d;--shadow:0 1px 2px #00000047}}*{box-sizing:border-box}body{background:var(--bg);color:var(--ink);letter-spacing:0;margin:0;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;overflow-x:hidden}button,input,select,textarea{font:inherit}button{border:1px solid var(--line);background:var(--control);min-height:34px;color:var(--ink);cursor:pointer;border-radius:6px;padding:6px 11px;line-height:1.25}.button-link{border:1px solid var(--line);background:var(--control);min-height:34px;color:var(--ink);border-radius:6px;justify-content:center;align-items:center;padding:6px 11px;line-height:1.25;text-decoration:none;display:inline-flex}.button-icon{flex:none;width:16px;height:16px;margin-right:6px}button:hover,.button-link:hover{border-color:var(--accent)}button.primary{border-color:var(--accent);background:var(--accent);color:#fff}button.primary:hover{background:var(--accent-strong)}button:disabled{cursor:not-allowed;opacity:.55}input,select,textarea{border:1px solid var(--line);background:var(--control);width:100%;color:var(--ink);border-radius:6px;padding:8px 9px}textarea{resize:vertical;line-height:1.5}textarea[readonly]{background:var(--readonly)}label{color:var(--muted);gap:6px;font-size:13px;display:grid}.inline-check{align-items:center;gap:8px;display:inline-flex}.inline-check input{width:auto}.app-header{border-bottom:1px solid var(--line);background:var(--panel);justify-content:space-between;align-items:center;gap:16px;min-height:76px;padding:14px 22px;display:flex}.app-header h1{margin:0;font-size:22px;line-height:1.2}.app-header p{color:var(--muted);margin:4px 0 0;font-size:13px}.header-actions,.actions,.inline-actions{flex-wrap:wrap;gap:8px;display:flex}.locale-control,.theme-control{grid-template-columns:none;align-items:center;gap:8px;display:inline-flex}.locale-control span,.theme-control span{color:var(--muted);white-space:nowrap;font-size:12px}.locale-control select,.theme-control select{width:auto;min-width:112px;padding-block:6px}.layout{grid-template-columns:minmax(280px,340px) minmax(0,1fr);gap:14px;padding:14px;display:grid}.sidebar,.workspace{align-content:start;gap:14px;display:grid}.panel,.tab-panel{border:1px solid var(--line);background:var(--panel);box-shadow:var(--shadow);border-radius:8px;padding:14px}.panel-title{justify-content:space-between;align-items:center;gap:10px;min-width:0;margin-bottom:12px;display:flex}.panel-actions{flex:none;gap:8px;display:flex}.panel-title h2{margin:0;font-size:16px}.panel-title button{flex:none}.divider{background:var(--line);height:1px;margin:12px 0}.settings-body{gap:10px;display:grid}.panel.collapsed .settings-body{display:none}.panel.collapsed .panel-title{margin-bottom:0}.form-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-bottom:12px;display:grid}.project-panel{gap:12px;display:grid}.character-settings-head{border:1px solid var(--callout-line);background:var(--callout);border-radius:6px;justify-content:space-between;align-items:flex-start;gap:16px;padding:10px 12px;display:flex}.character-settings-head h3{margin:0 0 4px;font-size:14px}.character-settings-head p{color:var(--muted);margin:0;font-size:13px;line-height:1.5}.character-settings-head .inline-actions{flex:none}.status-pill{background:var(--panel-soft);color:var(--muted);border-radius:999px;padding:4px 9px;font-size:12px}.notice-card{border:1px solid var(--callout-line);background:var(--callout);color:var(--ink);border-radius:8px;padding:12px 14px}.notice-card h2{margin:0 0 4px;font-size:16px}.notice-card p{color:var(--muted);margin:0;line-height:1.5}.character-list,.selected-list{flex-wrap:wrap;gap:7px;display:flex}.character-list-head{justify-content:space-between;align-items:center;gap:8px;display:flex}.character-list-head h3{margin:0;font-size:14px}.character-list-head span{color:var(--muted);font-size:12px}.character-list-empty{width:100%;color:var(--muted);margin:0;font-size:13px;line-height:1.5}.character-chip{border:1px solid var(--line);background:var(--control);color:var(--ink);border-radius:999px;padding:6px 10px}.character-entry{grid-template-columns:minmax(0,1fr) auto;align-items:stretch;display:inline-grid}.character-entry .character-chip{text-align:left;text-overflow:ellipsis;white-space:nowrap;border-radius:999px 0 0 999px;min-width:0;overflow:hidden}.character-edit-btn{border-left:0;border-radius:0 999px 999px 0;min-width:48px;min-height:0;padding-inline:8px 10px}.character-entry .character-chip.selected+.character-edit-btn{border-color:var(--accent);background:var(--selected);color:var(--accent-strong)}.character-dialog{border:1px solid var(--line);border-radius:8px;width:min(760px,100vw - 32px);max-height:calc(100vh - 32px);padding:0}.character-dialog::backdrop{background:var(--backdrop)}.character-dialog form{gap:12px;padding:16px;display:grid}.character-form-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;display:grid}.form-error{min-height:1.5em;color:var(--danger);margin:0;font-size:13px}.selected-list{border:1px dashed var(--line);background:var(--surface-soft);border-radius:8px;min-height:32px;padding:8px}.tab-panel{display:none}.tab-panel.active{display:block}.code-area{min-height:54vh;color:var(--ink);font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,Liberation Mono,monospace;font-size:13px}.generated-prompt{cursor:text}.prompt-field{gap:8px;display:grid}.copy-prompt-btn{justify-self:end}.stage-actions{flex-wrap:wrap;justify-content:flex-end;gap:8px;display:flex}.result-actions,.navigation-actions{padding-top:2px}.panel-list,.prompt-list,.image-list{gap:12px;margin-top:12px;display:grid}.panel-list.compact{margin-top:8px}.flow-section{border:1px solid var(--line);background:var(--surface);border-radius:8px;gap:10px;padding:12px;display:grid}.sub-tabs{flex-wrap:wrap;gap:7px;margin-bottom:8px;display:flex}.flow-tabs{margin-bottom:12px}.flow-tabs button{min-width:96px}.sub-tabs button.active{border-color:var(--accent);background:var(--accent);color:#fff}.parse-summary{gap:8px;margin-top:10px;display:grid}.parse-line{border-left:3px solid var(--line);color:var(--muted);padding-left:9px;font-size:13px;line-height:1.45}.work-status{border:1px solid var(--work-line);background:var(--work-bg);color:var(--accent-strong);border-radius:8px;align-items:center;gap:10px;padding:10px 12px;font-size:14px;font-weight:600;display:flex}.work-spinner{border:2px solid var(--spinner-line);border-top-color:var(--accent);border-radius:50%;flex:none;width:16px;height:16px;animation:.8s linear infinite work-spin}.stop-ai-btn{border:1px solid var(--work-line);color:var(--accent-strong);cursor:pointer;background:0 0;border-radius:6px;margin-left:auto;padding:4px 12px;font-size:13px;font-weight:600}.stop-ai-btn:hover{background:var(--work-bg)}.regenerate-image-btn{border:1px solid var(--work-line);color:var(--accent-strong);cursor:pointer;background:0 0;border-radius:6px;margin-top:10px;padding:6px 14px;font-size:13px;font-weight:600}.regenerate-image-btn:hover{background:var(--work-bg)}@keyframes work-spin{to{transform:rotate(360deg)}}.is-hidden{display:none!important}.story-card,.prompt-card,.image-card,.history-item{border:1px solid var(--line);background:var(--surface);border-radius:8px;padding:12px}.four-panel-story-card{grid-template-columns:auto minmax(0,1fr);align-items:start;gap:12px;display:grid}.four-panel-story-selector{place-items:start;padding-top:2px;display:grid}.four-panel-story-selector input{margin:0}.four-panel-story-content{min-width:0}.card-head{justify-content:space-between;align-items:center;gap:10px;min-width:0;margin-bottom:8px;display:flex}.card-head h3{overflow-wrap:anywhere;margin:0;font-size:14px}.card-head span,.history-item span{color:var(--muted);font-size:12px}.prompt-card textarea,.story-card textarea{min-height:210px;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,Liberation Mono,monospace;font-size:13px}.image-card img{border:1px solid var(--line);background:var(--media-bg);border-radius:8px;max-width:min(100%,360px);display:block}.image-card .error{color:var(--danger);white-space:pre-wrap}.history-list{gap:8px;display:grid}.history-item{text-align:left;gap:6px;display:grid}.history-item button{text-align:left;width:100%}.log-output{border:1px solid var(--line);background:var(--log-bg);height:260px;color:var(--log-ink);white-space:pre-wrap;border-radius:8px;margin:0;padding:12px;overflow:auto}.confirm-dialog{border:1px solid var(--line);width:min(420px,100vw - 32px);color:var(--ink);background:var(--panel);box-shadow:0 14px 48px var(--soft-backdrop);border-radius:8px;padding:0}.confirm-dialog::backdrop{background:var(--soft-backdrop)}.confirm-dialog form{gap:12px;padding:16px;display:grid}.confirm-dialog h2{margin:0;font-size:16px}.confirm-dialog p{color:var(--muted);margin:0;line-height:1.5}.dialog-actions{justify-content:flex-end;gap:8px;display:flex}@media (width<=920px){.app-header{padding:14px 16px}.layout{grid-template-columns:1fr;gap:12px;padding:12px}.workspace{order:1}.sidebar{order:2}.form-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.log-output{height:180px}.code-area{min-height:360px}.code-area.small,.prompt-card textarea,.story-card textarea{min-height:190px}}@media (width<=720px){button,input,select,textarea{font-size:15px}button,.button-link{white-space:normal;min-height:40px;padding:8px 10px}.app-header{flex-direction:column;align-items:flex-start}.app-header h1{font-size:20px}.header-actions,.actions,.inline-actions,.stage-actions{grid-template-columns:repeat(auto-fit,minmax(132px,1fr));width:100%;display:grid}.panel,.tab-panel{padding:12px}.panel-title,.card-head{flex-wrap:wrap;align-items:flex-start}.card-head{grid-template-columns:1fr;display:grid}.sub-tabs{scrollbar-width:thin;flex-wrap:nowrap;margin:0 -12px 8px;padding:0 12px 4px;overflow-x:auto}.sub-tabs button{flex:none}.flow-tabs button{min-width:108px}.character-list{overscroll-behavior:contain;border:1px solid var(--line);background:var(--surface-soft);scrollbar-width:thin;border-radius:8px;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));max-height:min(50vh,420px);padding:8px;display:grid;overflow-y:auto}.selected-list{flex-wrap:wrap;overflow:visible}.character-entry{width:100%}.character-entry .character-chip,.character-edit-btn{min-height:40px}.character-settings-head{display:grid}.character-settings-head .inline-actions{grid-template-columns:repeat(3,minmax(0,1fr));display:grid}}@media (width<=560px){.app-header{gap:12px;padding:12px}.header-actions{grid-template-columns:repeat(2,minmax(0,1fr))}#fullAutoBtn{grid-column:1/-1}.layout{gap:10px;padding:8px}.panel,.tab-panel,.flow-section,.story-card,.prompt-card,.image-card,.history-item,.notice-card{border-radius:6px;padding:10px}.panel-title h2,.notice-card h2{font-size:15px}.form-grid,.character-form-grid{grid-template-columns:1fr}.notice-card p{font-size:13px}.sub-tabs{margin-inline:-10px;padding-inline:10px}.character-list{grid-template-columns:1fr;max-height:46vh}.code-area{min-height:300px}.code-area.small,.prompt-card textarea,.story-card textarea{min-height:170px}.log-output{height:150px;padding:10px}.image-card img{max-width:100%}.copy-prompt-btn{justify-self:stretch}.dialog-actions{grid-template-columns:1fr 1fr;display:grid}}@media (width<=380px){.header-actions,.actions,.inline-actions,.stage-actions{grid-template-columns:1fr}}:root{--bg:#f6f5f1;--accent:#596b46;--accent-strong:#425333;--selected:#edf1e5;--line:#e0e1d8;--shadow:none}:root[data-theme=dark]{--bg:#141814;--accent:#8aaa6a;--accent-strong:#728f55;--selected:#293522;--line:#343d32}@media (prefers-color-scheme:dark){:root:not([data-theme]){--bg:#141814;--accent:#8aaa6a;--accent-strong:#728f55;--selected:#293522;--line:#343d32}}[hidden]{display:none!important}body{font-size:14px}button,.button-link,input,select{border-radius:9px;min-height:42px}button,.button-link{transition:border-color .15s}button:focus-visible,a:focus-visible,summary:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:3px solid var(--accent);outline-offset:3px}button.primary{padding-inline:20px}.app-header{gap:24px;min-height:86px;padding:16px 32px}.app-header h1{letter-spacing:-.6px;white-space:nowrap;font-size:19px}.app-header p{font-size:12px}.header-actions{justify-content:flex-end;align-items:center;gap:8px}.header-actions .button-link{width:42px;font-size:0;overflow:hidden}.header-actions .button-icon{margin:0}.locale-control span,.theme-control span{clip-path:inset(50%);width:1px;height:1px;position:absolute;overflow:hidden}.locale-control select,.theme-control select{min-width:85px;font-size:12px}.layout{grid-template-columns:230px minmax(0,1fr);gap:0;max-width:1600px;margin:auto;padding:0}.studio-nav{border-right:1px solid var(--line);flex-direction:column;align-self:start;gap:12px;height:calc(100dvh - 86px);padding:36px 22px;display:flex;position:sticky;top:0}.studio-wordmark{letter-spacing:3px;padding:0 10px;font-size:22px;font-weight:800}.studio-wordmark span{letter-spacing:2px;color:var(--muted);margin-top:6px;font-size:10px;display:block}.nav-caption{color:var(--muted);margin:0 0 26px;padding:0 10px;font-size:12px}.studio-nav>button{text-align:left;background:0 0;border-color:#0000;align-items:center;gap:13px;padding:15px 10px;display:flex}.studio-nav button small{color:var(--muted);margin-top:6px;font-size:11px;font-weight:400;display:block}.step-number{color:var(--muted);border:1px solid var(--line);border-radius:50%;flex-shrink:0;place-items:center;width:30px;height:30px;font-size:12px;display:grid}.studio-nav>button[aria-current]{background:var(--selected);color:var(--accent);font-weight:650}.studio-nav>button[aria-current] .step-number{background:var(--accent);border-color:var(--accent);color:#fff}.nav-tools{border-top:1px solid var(--line);gap:5px;margin-top:28px;padding-top:20px;display:grid}.nav-tools button{color:var(--muted);background:0 0;border-color:#0000;justify-content:space-between;display:flex}.local-note{color:var(--muted);margin-top:auto;padding:30px 10px 0;font-size:11px;line-height:1.9}.workspace{gap:24px;min-width:0;padding:40px clamp(20px,4vw,64px)}.studio-heading{justify-content:space-between;align-items:center;gap:15px;display:flex}.eyebrow{letter-spacing:2px;color:var(--accent);margin:0 0 12px;font-size:11px}.studio-heading h2{letter-spacing:-1px;margin:0;font-size:clamp(24px,2.7vw,36px);font-weight:650;line-height:1.4}.studio-heading p:last-child{color:var(--muted);margin-bottom:0;line-height:1.8}.studio-mark{color:var(--accent);opacity:.6;font-size:74px;line-height:1}.panel,.tab-panel{border-radius:16px;padding:26px}.project-panel{gap:20px}.project-panel>.panel-title{margin-bottom:0}.plot-field{gap:10px;font-size:13px}.plot-field textarea{background:var(--surface-soft);border-radius:12px;padding:16px;font-size:15px;line-height:1.9}.inspiration-actions{color:var(--muted);flex-wrap:wrap;align-items:center;gap:8px;margin-top:-10px;font-size:11px;display:flex}.inspiration-actions button{background:var(--surface-soft);border-radius:30px;min-height:32px;font-size:12px}.form-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:18px;margin:0}.character-settings-head{border:0;border-top:1px solid var(--line);background:0 0;border-radius:0;order:8;gap:20px;padding:18px 0 0}.character-settings-head p{max-width:440px;font-size:11px}.character-settings-head .inline-actions{flex-wrap:wrap;flex-shrink:1}.character-settings-head button{font-size:12px}.character-list{scrollbar-width:thin;max-height:235px;padding:4px;overflow-y:auto}.character-entry{border-radius:9px}.character-chip{font-size:12px}.character-chip.selected{border-color:var(--accent);background:var(--selected);color:var(--accent)}.character-list-head h3{font-size:13px}.selected-list{background:var(--surface-soft);border-radius:10px;min-height:42px;padding:10px}.layout[data-step=setup] .workspace>.tab-panel,.layout:not([data-step=setup]) .project-panel,.layout[data-step=story] #standardStepImagesPanel,.layout[data-step=images] #standardStepPromptPanel,.layout[data-step=story] #longStepImagesPanel,.layout[data-step=images] #longStepOutlinePanel,.layout[data-step=images] #longStepEpisodesPanel,#storyPrompt>.flow-tabs,#longStepImagesTab,.layout[data-step=images] #longManga>.flow-tabs{display:none}.prompt-details{border:1px solid var(--line);border-radius:10px;margin:16px 0;overflow:hidden}.prompt-details summary{cursor:pointer;color:var(--muted);background:var(--surface-soft);padding:14px;font-size:12px}.prompt-details .prompt-field{margin:12px}.code-area.small{min-height:160px}.stage-actions{gap:10px;margin-block:18px}.studio-footer{justify-content:space-between;align-items:center;gap:18px;padding:4px 0 20px;display:flex}.studio-footer strong{font-size:12px;font-weight:500}.studio-footer p{color:var(--muted);margin:6px 0 0;font-size:11px}.studio-feedback{border:1px solid var(--callout-line);background:var(--callout);overflow-wrap:anywhere;border-radius:10px;padding:14px 18px;line-height:1.7}.studio-tools-dialog{border:1px solid var(--line);width:min(680px,100% - 32px);max-height:85dvh;color:var(--ink);background:var(--panel);border-radius:18px;padding:24px}.studio-tools-dialog::backdrop{background:var(--backdrop);-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px)}.studio-tools-dialog .panel{border:0;padding:10px 0}.studio-tools-dialog #settingsPanel>.panel-title h2,#settingsToggleBtn{display:none}.studio-tools-dialog .settings-body{grid-template-columns:1fr 1fr;gap:18px}.studio-tools-dialog .divider{grid-column:1/-1}.work-status{z-index:5;position:sticky;top:12px}@media (width<=1100px){.app-header{align-items:flex-start;padding:18px 22px}.header-actions{max-width:560px}.layout{grid-template-columns:195px minmax(0,1fr)}.studio-nav{padding-inline:12px}.workspace{padding:30px 24px}.character-settings-head{flex-direction:column}}@media (width<=760px){.app-header{flex-direction:column;gap:16px}.header-actions{justify-content:flex-start;max-width:none;display:flex}.header-actions button{font-size:12px}.layout{display:block}.studio-nav{border-right:0;border-bottom:1px solid var(--line);grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;height:auto;padding:12px 16px;display:grid;position:static}.studio-wordmark,.nav-caption,.local-note,.studio-nav button small{display:none}.studio-nav>button{gap:7px;padding:10px 6px;font-size:12px}.step-number{width:24px;height:24px;font-size:10px}.nav-tools{grid-column:1/-1;justify-content:space-between;margin:8px 0 0;padding-top:8px;display:flex}.nav-tools button{gap:12px;font-size:12px}.workspace{gap:20px;padding:24px 16px}.studio-mark{display:none}.panel,.tab-panel{border-radius:12px;padding:18px}.form-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.studio-footer{flex-wrap:wrap}.studio-footer>.inline-actions{width:100%}.studio-footer button.primary{flex:1}.studio-tools-dialog .settings-body{grid-template-columns:1fr}.character-settings-head .inline-actions{gap:5px}}@media (prefers-reduced-motion:reduce){*,:before,:after{scroll-behavior:auto!important;transition:none!important;animation-duration:.01ms!important}}
