:root{font-family:ui-sans-serif,-apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",sans-serif;color-scheme:dark;--text:#f5f7fc;--muted:#b6c0d0;--subtle:#8f9bad;--panel:rgba(14,20,25,.91);--panel-soft:rgba(23,31,39,.86);--border:rgba(184,202,220,.22);--border-strong:rgba(202,218,234,.42);--accent:#a6c3ff;--accent-hover:#bdd2ff;--on-accent:#10203d;--focus:#d2dfff;--error:#ffb1b4;--error-bg:rgba(135,42,53,.19);--warning:#f0cf9a;--warning-bg:rgba(126,92,32,.18);--success:#a4ddc5;--shadow:0 24px 100px rgba(0,0,0,.18);--button-quiet:rgba(239,244,255,.06)}
:root[data-theme=day]{color-scheme:light;--text:#0e1830;--muted:#596b8b;--subtle:#71809b;--panel:rgba(255,255,255,.94);--panel-soft:rgba(247,249,253,.95);--border:rgba(58,84,127,.18);--border-strong:rgba(62,94,150,.36);--accent:#245ded;--accent-hover:#184ccf;--on-accent:#fff;--focus:#1749c8;--error:#ac2538;--error-bg:#fff0f2;--warning:#8a5a11;--warning-bg:#fff8ea;--success:#176646;--shadow:0 20px 70px rgba(60,69,82,.075);--button-quiet:rgba(40,63,106,.045)}
*{box-sizing:border-box}html{min-height:100%;scroll-behavior:smooth}body{margin:0;min-width:320px;min-height:100svh;color:var(--text);background:#070d13;font-size:16px;line-height:1.6}button,input,textarea{font:inherit}button,a,input,textarea{touch-action:manipulation}button,a{ -webkit-tap-highlight-color:transparent}button{color:inherit;cursor:pointer}button:disabled{cursor:not-allowed;opacity:.5}button,input,textarea,a{outline-offset:4px}button:focus-visible,input:focus-visible,textarea:focus-visible,a:focus-visible{outline:3px solid var(--focus)}input,textarea{color:var(--text)}textarea{resize:vertical}button svg,.button svg,.upload-button svg{width:20px;height:20px;flex-shrink:0;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}button{border:0;background:none}h1,h2,h3,p{margin:0}h1,h2,h3{line-height:1.35}a{color:var(--accent)}[hidden]{display:none!important}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}.muted{color:var(--muted)}.small{font-size:13px;line-height:1.7}.scene,.scene-scrim{position:fixed;inset:0;pointer-events:none}.scene{z-index:-3}.scene-scrim{z-index:-2}
.site-header{display:flex;align-items:center;justify-content:space-between;gap:24px;padding:25px 4.4vw;position:relative;z-index:2}.brand{display:flex;align-items:center;gap:14px;white-space:nowrap;font-size:25px;line-height:1.2;font-weight:700;letter-spacing:-.7px}.brand img{width:58px;height:58px;object-fit:contain;border-radius:12px}.header-actions{display:flex;align-items:center;gap:24px}.theme-switch{display:flex;padding:3px;border:1px solid var(--border);border-radius:28px;background:rgba(177,193,215,.07)}.theme-switch button{min-height:38px;min-width:87px;display:flex;align-items:center;justify-content:center;gap:8px;padding:5px 14px;border-radius:24px;color:var(--muted);font-size:14px}.theme-switch button[aria-pressed=true]{color:var(--text);background:rgba(196,210,229,.16);box-shadow:0 1px 8px rgba(0,0,0,.07)}[data-theme=day] .theme-switch{background:rgba(231,235,242,.9)}[data-theme=day] .theme-switch button[aria-pressed=true]{background:#fff}.theme-switch button[aria-pressed=true] svg{color:var(--accent)}.theme-switch svg{width:19px;height:19px}.help-button{font-size:15px;padding:10px 4px;min-height:44px;min-width:44px}.help-button:hover,.text-button:hover{text-decoration:underline;text-underline-offset:4px}.skip-link{position:fixed;left:15px;top:10px;z-index:50;padding:10px 16px;background:var(--panel);transform:translateY(-150%);border:1px solid var(--border)}.skip-link:focus{transform:none}main{position:relative;z-index:1;outline:none!important}.boot-state{text-align:center;padding:22vh 24px;color:var(--muted)}.home{max-width:990px;margin:68px auto 0;padding:0 24px 100px;text-align:center}.home h1{font-size:clamp(34px,4.1vw,58px);font-weight:680;letter-spacing:.015em;line-height:1.4;text-wrap:balance}.home-subtitle{color:var(--muted);font-size:clamp(17px,1.6vw,24px);margin-top:20px;letter-spacing:.03em}.composer{margin-top:30px;text-align:left;border:1px solid var(--border-strong);border-radius:20px;background:rgba(13,19,24,.82);padding:22px 24px 14px;box-shadow:var(--shadow);backdrop-filter:blur(12px);transition:border-color .18s,box-shadow .18s}.composer:focus-within{border-color:var(--accent);box-shadow:0 0 0 3px rgba(145,180,244,.10),var(--shadow)}[data-theme=day] .composer{background:rgba(255,255,255,.93)}.composer.dragover{border-color:var(--accent);box-shadow:0 0 0 5px rgba(130,169,235,.2)}.composer label{display:block;font-size:15px;font-weight:600}.composer textarea{display:block;width:100%;min-height:110px;max-height:320px;padding:14px 0 8px;border:0;outline:none;background:transparent;font-size:18px;line-height:1.7;resize:vertical}.composer textarea::placeholder{color:var(--muted);opacity:.94}.composer textarea:focus-visible{outline:none}.composer-footer{border-top:1px solid var(--border);padding-top:13px;display:flex;align-items:center;justify-content:space-between;gap:16px}.upload-button{display:inline-flex;align-items:center;gap:9px;min-height:44px;padding:8px 2px;font-size:15px}.upload-button:hover{color:var(--accent)}.upload-button svg{width:23px;height:23px}.button{display:inline-flex;align-items:center;justify-content:center;gap:12px;min-height:44px;padding:10px 20px;border-radius:12px;font-weight:600;text-decoration:none;border:1px solid transparent;font-size:15px;line-height:1.5;transition:background-color .15s,box-shadow .15s}.button.primary{background:var(--accent);color:var(--on-accent)}.button.primary:not(:disabled):hover{background:var(--accent-hover)}.button.secondary{border-color:var(--border);background:var(--button-quiet)}.button.secondary:not(:disabled):hover{background:var(--border)}.composer .button.primary{min-width:175px;border-radius:19px;min-height:47px}.home-hint{margin-top:23px;color:var(--muted);font-size:14px}.upload-hint{font-size:12px;color:var(--subtle);margin:8px 0 0}.attachments{list-style:none;margin:6px 0 14px;padding:0;display:flex;flex-direction:column;gap:7px}.attachment{display:flex;align-items:center;gap:10px;background:var(--button-quiet);border:1px solid var(--border);border-radius:10px;padding:9px 10px;font-size:13px}.attachment-info{flex:1;min-width:0}.attachment-name{display:block;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.attachment-status{font-size:12px;color:var(--muted)}.attachment.failed .attachment-status{color:var(--error)}.attachment-icon{color:var(--muted);display:grid;place-items:center}.attachment-icon svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.6}.attachment .icon-button{width:36px;height:36px;min-width:36px}.text-button{min-height:44px;padding:8px 4px;color:var(--accent);font-size:14px}.input-status{font-size:13px;color:var(--muted);margin-top:8px;text-align:left}.alert{display:flex;align-items:flex-start;gap:12px;border:1px solid color-mix(in srgb,var(--error) 35%,transparent);background:var(--error-bg);color:var(--error);padding:12px 15px;border-radius:12px;margin:18px 0;text-align:left;font-size:14px}.alert-copy{flex:1}.alert .text-button{color:inherit;min-height:32px;padding:4px 0;font-weight:600}.alert .icon-button{color:inherit;width:30px;height:30px;min-width:30px}.notice{padding:13px 16px;border:1px solid var(--border);border-radius:12px;font-size:13px;color:var(--muted);background:var(--button-quiet);margin-bottom:20px}.notice svg{width:17px;height:17px;vertical-align:middle;margin-right:7px}.icon-button{display:inline-flex;align-items:center;justify-content:center;min-width:44px;width:44px;height:44px;border-radius:9px;padding:0;color:var(--muted);font-size:25px}.icon-button:not(:disabled):hover{background:var(--button-quiet);color:var(--text)}.icon-button svg{width:17px;height:17px}.spinner{display:inline-block;width:17px;height:17px;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:spin .8s linear infinite;vertical-align:middle;flex-shrink:0}@keyframes spin{to{transform:rotate(360deg)}}
.workflow{width:min(1180px,calc(100% - 64px));margin:14px auto 70px}.stepper{list-style:none;padding:0;display:flex;justify-content:center;align-items:center;gap:0;margin:10px auto 38px;font-size:13px;color:var(--muted)}.stepper li{display:flex;align-items:center;gap:9px;white-space:nowrap}.stepper li:not(:last-child):after{content:"";width:48px;height:1px;background:var(--border);margin:0 18px}.step-number{width:25px;height:25px;border-radius:50%;border:1px solid var(--border-strong);display:grid;place-items:center;font-size:12px}.stepper [aria-current=step]{color:var(--text);font-weight:600}.stepper [aria-current=step] .step-number{color:var(--on-accent);background:var(--accent);border-color:var(--accent)}.stepper .is-complete .step-number{background:var(--button-quiet);color:var(--accent);border-color:var(--border)}.page-heading{display:flex;justify-content:space-between;align-items:flex-start;gap:24px;margin-bottom:25px}.page-heading h1{font-size:32px;letter-spacing:-.4px;font-weight:650}.page-heading p{color:var(--muted);margin-top:7px;font-size:14px}.outline-layout{display:grid;grid-template-columns:minmax(0,1fr) 285px;align-items:start;gap:24px}.surface{background:var(--panel);border:1px solid var(--border);border-radius:18px;box-shadow:var(--shadow)}.outline-main{padding:25px}.field-label{font-size:13px;font-weight:600;display:block;margin-bottom:8px}.text-input,.outline-bullets{border:1px solid var(--border);border-radius:9px;background:var(--panel-soft);padding:10px 12px;color:var(--text);width:100%;line-height:1.6}.text-input::placeholder,.outline-bullets::placeholder{color:var(--subtle)}.deck-title{font-size:19px;font-weight:600}.outline-list{list-style:none;padding:0;margin:25px 0 0;display:flex;flex-direction:column;gap:14px}.outline-card{border:1px solid var(--border);border-radius:12px;padding:15px;background:var(--panel-soft)}.outline-card-top{display:flex;align-items:center;gap:11px;margin-bottom:10px}.slide-number{display:flex;align-items:center;justify-content:center;width:26px;height:26px;border-radius:7px;background:var(--button-quiet);color:var(--muted);font-size:12px;flex-shrink:0}.outline-card-top .text-input{flex:1;min-width:0;padding:6px 8px;background:transparent;font-size:15px;font-weight:550;border-color:transparent}.outline-card-top .text-input:hover,.outline-card-top .text-input:focus{border-color:var(--border)}.slide-controls{display:flex;gap:2px}.slide-controls .icon-button{min-width:32px;width:32px;height:34px}.outline-bullets{font-size:14px;resize:vertical;min-height:83px;background:transparent;color:var(--muted);border-color:transparent;padding:4px 8px 8px;line-height:1.8}.outline-bullets:hover,.outline-bullets:focus{border-color:var(--border)}.bullet-label{margin-left:8px;font-size:11px;color:var(--subtle);font-weight:400;margin-bottom:1px}.add-slide{margin-top:16px;width:100%;border-style:dashed!important;color:var(--muted);font-weight:500}.style-panel{padding:23px;position:sticky;top:24px}.style-panel h2{font-size:17px}.style-panel>p{font-size:12px;color:var(--muted);margin:5px 0 17px}.style-options{border:0;padding:0;margin:0;display:flex;flex-direction:column;gap:10px}.style-option{position:relative;display:flex;align-items:center;gap:11px;padding:12px;border:1px solid var(--border);border-radius:10px;cursor:pointer;background:var(--button-quiet)}.style-option:has(input:checked){border-color:var(--accent);background:color-mix(in srgb,var(--accent) 8%,transparent)}.style-option:has(input:focus-visible){outline:3px solid var(--focus);outline-offset:3px}.style-option input{accent-color:var(--accent);width:16px;height:16px;flex-shrink:0;margin:0}.style-label{font-weight:550;font-size:14px;display:block}.style-description{font-size:11px;line-height:1.6;color:var(--muted);display:block;margin-top:2px}.style-note{border-top:1px solid var(--border);padding-top:16px;margin-top:19px!important;line-height:1.8}.outline-actions{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:20px 2px}.save-status{font-size:12px;color:var(--muted)}.save-status.error{color:var(--error)}.action-group{display:flex;align-items:center;gap:12px}.outline-actions .primary{min-width:185px}.outline-actions .save-status{margin-top:3px}.section-title{font-size:15px}.generation{max-width:670px;margin:45px auto 0;padding:35px 40px}.generation-heading{text-align:center}.generation-symbol{display:grid;place-items:center;width:52px;height:52px;margin:0 auto 19px;background:var(--button-quiet);border:1px solid var(--border);border-radius:17px;color:var(--accent)}.generation-symbol svg{width:25px;height:25px;stroke:currentColor;fill:none;stroke-width:1.5}.generation h1{font-size:27px;font-weight:650}.generation-heading p{font-size:14px;color:var(--muted);margin-top:9px}.stages{list-style:none;margin:31px 0 23px;padding:0;display:flex;flex-direction:column;gap:0}.stage{display:flex;align-items:center;gap:15px;padding:15px 0;position:relative}.stage:not(:last-child):after{content:"";width:1px;position:absolute;left:14px;top:43px;bottom:-12px;background:var(--border)}.stage-indicator{width:29px;height:29px;display:grid;place-items:center;border:1px solid var(--border);border-radius:50%;color:var(--subtle);font-size:12px;position:relative;background:var(--panel)}.stage-indicator svg{height:15px;width:15px;fill:none;stroke:currentColor;stroke-width:2}.stage-label{flex:1;color:var(--subtle);font-size:15px}.stage-state{font-size:12px;color:var(--subtle)}.stage.completed .stage-indicator{color:var(--success);border-color:var(--success)}.stage.completed .stage-label{color:var(--muted)}.stage.running .stage-indicator{color:var(--accent);border-color:var(--accent)}.stage.running .stage-label{color:var(--text);font-weight:600}.stage.running .stage-state{color:var(--accent)}.stage.failed .stage-indicator,.stage.failed .stage-state{color:var(--error);border-color:var(--error)}.generation-footer{text-align:center;border-top:1px solid var(--border);padding-top:12px}.generation-footer .small{margin-top:9px}.connection-note{font-size:13px;color:var(--muted);margin-top:15px;line-height:1.7}.generation-retry{display:flex;justify-content:center;margin:20px 0 6px}.readonly-outline{padding:4px 0 0 23px;display:flex;flex-direction:column;gap:18px}.readonly-outline h3{font-size:16px;margin-bottom:6px}.readonly-outline ul{font-size:14px;color:var(--muted);padding-left:20px}.readonly-title{font-size:20px;margin-bottom:22px}
.preview-heading{align-items:center}.preview-heading .button{min-width:190px}.preview-title{overflow-wrap:anywhere;max-width:650px}.preview-layout{display:grid;grid-template-columns:174px minmax(0,1fr);gap:22px;align-items:start}.thumbnail-panel{padding:14px 12px;max-height:650px;overflow:auto;scrollbar-width:thin}.thumbnail-list{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:13px}.thumbnail{display:block;padding:5px;width:100%;border-radius:9px;border:2px solid transparent;text-align:left}.thumbnail:hover{background:var(--button-quiet)}.thumbnail[aria-current=true]{border-color:var(--accent);background:var(--button-quiet)}.thumbnail img{display:block;width:100%;aspect-ratio:16/9;object-fit:contain;background:#fff;border-radius:4px}.thumbnail-caption{display:block;font-size:11px;color:var(--muted);margin:5px 3px 0}.preview-main{min-width:0}.preview-frame{padding:19px}.preview-stage{position:relative;background:#fff;border-radius:7px;overflow:hidden;min-height:100px;aspect-ratio:16/9}.preview-stage img{width:100%;height:100%;object-fit:contain;display:block}.preview-image-error{position:absolute;inset:0;padding:20px;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:8px;color:#283a55;background:#f2f5fa;text-align:center;font-size:14px}.preview-controls{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:14px}.page-controls{display:flex;align-items:center;gap:10px}.page-count{min-width:78px;text-align:center;font-size:13px;color:var(--muted)}.fullscreen-button{font-size:12px;min-height:40px;padding:8px 10px;font-weight:500;color:var(--muted)}.fullscreen-button svg{width:16px;height:16px}.preview-description{display:flex;justify-content:space-between;gap:18px;align-items:start;margin-top:17px}.preview-description p{font-size:12px;line-height:1.8;color:var(--muted);max-width:570px}.preview-description .text-button{white-space:nowrap;padding-top:0;min-height:32px;font-size:13px}.result-secondary-actions{display:flex;align-items:center;justify-content:flex-end;gap:17px;margin-top:18px}.result-secondary-actions .text-button{font-size:13px}.dialog{width:min(560px,calc(100% - 32px));max-height:85svh;border:1px solid var(--border-strong);border-radius:19px;padding:27px;color:var(--text);background:var(--panel);box-shadow:0 25px 120px rgba(0,0,0,.3);overflow:auto}.dialog::backdrop{background:rgba(0,8,17,.63);backdrop-filter:blur(6px)}.dialog-heading{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:22px}.dialog-heading h2{font-size:20px;line-height:1.4}.dialog-heading .icon-button{margin:-8px -6px -8px 0;flex-shrink:0}.help-steps{margin:0;padding-left:23px;display:flex;flex-direction:column;gap:18px}.help-steps strong{font-size:15px}.help-steps p{font-size:14px;color:var(--muted);margin-top:4px}.help-note{border-top:1px solid var(--border);padding-top:19px;margin-top:22px;margin-bottom:17px}.help-note h3{font-size:15px;margin-bottom:7px}.help-note p{font-size:13px;color:var(--muted)}.dialog-confirm{width:100%;margin-top:24px}.preview-dialog{width:calc(100% - 40px);max-width:none;height:calc(100svh - 40px);max-height:none;padding:20px 26px}.preview-dialog .dialog-heading{margin-bottom:8px}.preview-dialog .dialog-heading h2{font-size:15px;color:var(--muted);font-weight:500}.fullscreen-stage{height:calc(100svh - 175px);display:flex;align-items:center;justify-content:center}.fullscreen-stage img{width:100%;height:100%;object-fit:contain}.fullscreen-controls{display:flex;justify-content:center;align-items:center;gap:18px;margin-top:10px}.noscript{margin:20px;padding:20px;background:var(--panel);color:var(--error)}
@media(min-width:1500px){.home{margin-top:88px;max-width:1060px}.composer{margin-top:35px;padding:24px 28px 15px}.composer textarea{min-height:128px}.site-header{padding-top:31px}.home-subtitle{margin-top:23px}}
@media(max-width:900px){.site-header{padding:21px 28px}.brand{font-size:22px}.brand img{width:49px;height:49px}.home{margin-top:70px;padding-left:32px;padding-right:32px}.home h1{font-size:40px}.outline-layout{grid-template-columns:minmax(0,1fr) 240px;gap:18px}.outline-main{padding:19px}.style-panel{padding:18px}.workflow{width:calc(100% - 44px)}.page-heading h1{font-size:27px}.preview-layout{grid-template-columns:136px minmax(0,1fr);gap:15px}.preview-frame{padding:14px}.thumbnail-panel{padding:9px 6px}.preview-description{display:block}.preview-description .text-button{margin-top:8px}.preview-heading{align-items:flex-start}.preview-heading .button{min-width:170px;padding:10px 15px}.slide-controls .icon-button{min-width:29px;width:29px}.outline-card{padding:12px}}
@media(max-width:680px){.site-header{padding:17px 20px;gap:10px}.brand{gap:7px;font-size:19px;letter-spacing:-.5px}.brand img{width:42px;height:42px;border-radius:9px}.header-actions{gap:11px}.theme-switch button{min-width:37px;width:39px;min-height:36px;padding:6px}.theme-switch button span{display:none}.help-button{font-size:13px;min-width:35px;padding:8px 0}.home{margin:66px auto 0;padding:0 21px 75px}.home h1{font-size:32px;line-height:1.55;letter-spacing:0}.home-subtitle{font-size:15px;margin-top:15px}.composer{margin-top:26px;padding:18px 17px 12px;border-radius:17px}.composer textarea{font-size:16px;min-height:151px}.composer-footer{gap:10px;padding-top:12px}.composer .button.primary{min-width:138px;font-size:14px;padding:10px 16px;gap:8px}.upload-button{font-size:14px;gap:6px}.upload-button svg{width:20px;height:20px}.upload-hint{font-size:11px}.home-hint{font-size:12px;margin-top:20px}.scene{background-position:50% center}.workflow{width:calc(100% - 32px);margin-top:14px}.stepper{font-size:11px;margin-bottom:27px;justify-content:space-between}.stepper li{gap:5px}.step-number{width:20px;height:20px;font-size:10px}.stepper li:not(:last-child):after{width:12px;margin:0 7px}.page-heading{margin-bottom:20px;gap:12px}.page-heading h1{font-size:24px}.page-heading p{font-size:13px}.page-heading>.text-button{font-size:12px;white-space:nowrap}.outline-layout{display:flex;flex-direction:column;gap:18px}.outline-main{width:100%;padding:18px 14px}.outline-list{margin-top:19px}.outline-card{padding:12px 8px}.outline-card-top{gap:6px;flex-wrap:wrap}.outline-card-top .text-input{font-size:14px;flex-basis:calc(100% - 39px)}.slide-controls{margin-left:auto;height:28px;margin-top:-4px}.slide-controls .icon-button{min-width:39px;width:39px;height:31px}.outline-bullets{font-size:13px}.style-panel{position:static;width:100%;padding:19px 16px}.style-options{display:grid;grid-template-columns:1fr 1fr;gap:9px}.style-option{padding:12px 10px;align-items:flex-start;gap:9px}.style-option input{margin-top:3px}.style-description{font-size:10px}.style-note{margin-top:16px!important}.outline-actions{position:sticky;bottom:0;background:var(--panel);backdrop-filter:blur(12px);border-top:1px solid var(--border);margin:18px -16px 0;padding:13px 16px;z-index:3}.outline-actions .primary{min-width:165px;font-size:14px}.outline-actions .section-title{font-size:13px}.save-status{font-size:11px}.generation{margin:25px auto 0;padding:29px 22px}.generation h1{font-size:23px}.generation-heading p{font-size:13px}.stage-label{font-size:14px}.stage-state{font-size:11px}.preview-heading{flex-wrap:wrap}.preview-heading .button{width:100%;margin-top:7px}.preview-layout{display:flex;flex-direction:column-reverse;gap:14px}.thumbnail-panel{width:100%;max-height:none;overflow-x:auto;padding:9px}.thumbnail-list{flex-direction:row;gap:7px}.thumbnail-list li{flex:0 0 112px}.thumbnail-caption{font-size:10px}.preview-main{width:100%}.preview-frame{padding:10px}.preview-controls{margin-top:10px;gap:4px}.page-controls{gap:1px}.page-count{min-width:70px;font-size:12px}.preview-controls .icon-button{width:37px;min-width:37px;height:37px}.fullscreen-button{font-size:11px;padding:7px;gap:5px}.preview-description p{font-size:11px}.result-secondary-actions{justify-content:center;gap:21px;margin-top:13px}.result-secondary-actions .text-button{font-size:12px}.preview-dialog{width:calc(100% - 16px);height:calc(100svh - 20px);padding:18px 12px}.fullscreen-stage{height:calc(100svh - 160px)}.dialog{padding:23px 20px}.dialog-heading h2{font-size:18px}.attachment .text-button{font-size:12px}.alert{font-size:13px}.notice{font-size:12px}}
@media(max-width:370px){.site-header{padding-left:14px;padding-right:14px}.brand{font-size:17px}.brand img{width:35px;height:35px}.header-actions{gap:7px}.home h1{font-size:29px}.home{padding-left:16px;padding-right:16px}.stepper li:not(:last-child):after{width:7px;margin:0 4px}.stepper{font-size:10px}}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}*,*::before,*::after{animation:none!important;transition:none!important}.spinner{border-style:dotted;border-right-color:currentColor}}
.browser-caption{font-size:12px;color:var(--muted);margin-top:7px;letter-spacing:.015em}
.local-import{max-width:690px;margin:23px auto 0;text-align:left;font-size:13px;color:var(--muted)}
.local-import>summary{width:max-content;max-width:100%;margin:auto;padding:8px 4px;cursor:pointer;min-height:38px;text-underline-offset:4px}
.local-import>summary:hover{color:var(--text)}
.local-import>summary:focus-visible{outline:3px solid var(--focus);outline-offset:4px;border-radius:5px}
.local-import-content{background:var(--panel);border:1px solid var(--border);border-radius:15px;padding:19px 20px;margin-top:9px;box-shadow:var(--shadow)}
.import-options{display:grid;grid-template-columns:1fr 1fr;gap:20px;margin-top:15px}
.import-options .button{font-size:13px;min-height:43px;width:100%;font-weight:550;padding:9px 12px}
.import-options p{font-size:11px;line-height:1.8;margin:9px 0 0}
.local-import-footnote{border-top:1px solid var(--border);font-size:11px;margin-top:17px;padding-top:12px}
#local-import-status:not(:empty){margin-top:10px;font-size:12px;color:var(--accent)}
.persistence-note{font-size:12px;line-height:1.8;color:var(--error);margin:10px 0}
.persistence-note:empty{display:none}
.notice.is-warning{border-color:color-mix(in srgb,var(--error) 35%,transparent);background:var(--error-bg);color:var(--error)}.notice.is-warning .text-button{color:inherit;font-weight:600;min-height:32px;padding:4px 0;margin-left:6px}
.template-review{padding:28px 30px}
.template-review>h2{font-size:19px;margin-bottom:7px}
.template-slide-list{padding:0;list-style:none;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin:24px 0 0}
.template-slide-list>li{border:1px solid var(--border);border-radius:12px;padding:18px;background:var(--panel-soft);min-width:0}
.template-slide-list h3{font-size:15px;margin-bottom:11px;overflow-wrap:anywhere}
.template-slide-list ul{padding-left:19px;display:flex;flex-direction:column;gap:8px;margin:0;color:var(--muted);font-size:13px;line-height:1.7;overflow-wrap:anywhere}
.template-review>.notice{margin-top:23px;margin-bottom:0}
.preview-warnings{margin:20px 0 0;color:var(--muted);font-size:12px;border-top:1px solid var(--border);padding-top:13px}
.preview-warnings summary{cursor:pointer;min-height:30px;padding:4px 0}
.preview-warnings ul{padding-left:21px;line-height:1.8}
@media(max-width:680px){.browser-caption{font-size:11px}.local-import{font-size:12px;margin-top:16px}.local-import-content{padding:16px}.import-options{grid-template-columns:1fr;gap:15px}.import-options .button{width:100%}.import-options p{margin-top:6px}.template-review{padding:20px 15px}.template-slide-list{grid-template-columns:1fr;margin-top:20px}.template-slide-list>li{padding:15px}.result-secondary-actions{flex-wrap:wrap;gap:8px 18px}.persistence-note{font-size:11px}}
.route-switch{display:inline-flex;gap:5px;padding:5px;margin-top:25px;border:1px solid var(--border);border-radius:28px;background:var(--panel-soft);backdrop-filter:blur(12px)}
.route-switch button{min-height:44px;padding:9px 24px;border-radius:24px;color:var(--muted);font-size:14px}
.route-switch button[aria-pressed=true]{color:var(--text);background:var(--button-quiet);box-shadow:inset 0 0 0 1px var(--border-strong)}
.route-switch button:focus-visible{outline:3px solid var(--focus);outline-offset:3px}
.route-switch+.alert{margin-bottom:0}.route-switch~form .composer{margin-top:19px}
.route-source{border-bottom:1px solid var(--border);padding-bottom:16px;margin-bottom:19px}
.route-source-heading{display:flex;align-items:center;justify-content:space-between;gap:15px;font-size:14px;font-weight:600}
.route-source-heading>span{min-width:0;overflow-wrap:anywhere}.route-source-heading .upload-button{flex-shrink:0;font-size:13px}
.route-source-empty,.route-source-caption{color:var(--muted);font-size:12px;line-height:1.7;margin-top:5px}
.route-source-issue{color:var(--error);font-size:13px;line-height:1.7;margin-top:9px}.route-source-issue.route-source-warning{color:var(--warning)}.route-source-note{color:var(--muted);font-size:13px;line-height:1.7;margin-top:9px}
.image-source-list{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;padding:0;margin:10px 0 12px;list-style:none}
.image-source-list li{position:relative;border:1px solid var(--border);border-radius:9px;overflow:hidden;background:var(--panel-soft)}
.image-source-list img{display:block;width:100%;aspect-ratio:16/9;object-fit:contain;background:#13171b}
.image-source-list li>span{display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-size:11px;padding:7px 9px;color:var(--muted)}
.image-source-list .icon-button{position:absolute;right:3px;top:3px;width:30px;height:30px;min-width:30px;color:#fff;background:rgba(10,14,19,.82);font-size:22px}
.comparison-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:14px;align-items:start}
.original-frame{padding:16px;overflow:hidden}.original-frame h2,.comparison-label{font-size:13px;font-weight:550;margin:0 0 12px;color:var(--muted)}
.original-frame img{width:100%;height:auto;display:block;object-fit:contain;border-radius:4px;background:#111}.comparison-grid .preview-frame{min-width:0}
.comparison-grid .preview-controls{flex-wrap:wrap}.comparison-grid .fullscreen-button{font-size:11px;padding:7px;gap:5px}
.text-updated{color:var(--text)}
@media(max-width:960px){.comparison-grid{grid-template-columns:1fr}.original-frame img{max-height:360px}}
@media(max-width:680px){.route-switch{width:100%;display:flex;margin-top:20px}.route-switch button{flex:1;padding:7px 9px;font-size:13px;min-height:42px}.image-source-list{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.route-source-heading{font-size:13px}.route-source-heading .upload-button{font-size:12px}.route-source-caption{font-size:11px}.comparison-grid{gap:10px}.original-frame{padding:10px}.original-frame img{max-height:270px}.original-frame h2,.comparison-label{font-size:12px;margin-bottom:9px}}

.composer-footer .primary{margin-left:auto}.template-slide-list li.text-updated{white-space:pre-line}

.template-data{border-top:1px solid var(--border);margin-top:15px;padding-top:13px}.template-data h4{font-size:12px;margin:0 0 9px;font-weight:550;color:var(--muted)}.template-data-scroll{width:100%;overflow:auto;max-height:260px;border:1px solid var(--border);border-radius:7px;font-size:12px}.template-data-scroll:focus-visible{outline:3px solid var(--focus);outline-offset:3px}.template-data table{border-collapse:collapse;width:100%;text-align:left}.template-data th,.template-data td{padding:8px 10px;border-bottom:1px solid var(--border);min-width:65px;max-width:240px;overflow-wrap:anywhere;white-space:pre-line}.template-data th{font-weight:550;color:var(--muted);background:var(--button-quiet);position:sticky;top:0}.template-data tr:last-child td{border-bottom:0}

.composer label.fresh-option{display:inline-flex;align-items:center;gap:8px;min-height:44px;font-size:14px;font-weight:500;color:var(--muted);cursor:pointer}.fresh-option input{width:16px;height:16px;accent-color:var(--accent)}

.review-panel{margin:0 0 20px;padding:18px 20px}
.review-panel h2{font-size:16px;margin:0 0 6px}
.review-panel p{margin:0 0 10px;color:var(--muted)}
.review-panel ul{list-style:none;margin:0;padding:0;display:grid;gap:6px}
.review-panel li{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;line-height:1.5}
.supplement{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-top:20px;padding-top:18px;border-top:1px solid var(--border)}
.supplement-note{margin:4px 0 0;color:var(--muted);font-size:14px}

.template-data-hint {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}

.generation-mode {
  margin: 22px 0 0;
  padding: 0;
  border: 0;
  display: grid;
  gap: 10px;
}
.generation-mode legend { margin-bottom: 10px; }
.mode-option {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel-soft);
  cursor: pointer;
}
.mode-option:has(input:checked) { border-color: var(--accent); }
.mode-option:has(input:disabled) { cursor: not-allowed; opacity: .6; }
.mode-option input { margin-top: 3px; accent-color: var(--accent); }
.mode-option span { display: grid; gap: 3px; }
.mode-option small { color: var(--muted); font-size: 13px; line-height: 1.5; }
.design-progress { color: var(--muted); margin: 0 0 16px; }
.design-grid {
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}
.design-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
  padding: 12px;
  display: grid;
  gap: 10px;
}
.design-frame {
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel-soft);
}
.design-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.design-placeholder {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.design-placeholder.is-error { color: var(--error); background: var(--error-bg); }
.design-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.design-stale { font-size: 12px; color: var(--error); }
.design-redraw { display: flex; gap: 8px; }
.design-redraw .text-input { flex: 1; min-width: 0; }
.billing-chip { font-variant-numeric: tabular-nums; white-space: nowrap; min-width: 0; min-height: 40px; padding: 7px 16px; font-size: 14px; }
.billing-dialog { width: min(460px, calc(100% - 32px)); }
.billing-dialog h2 { font-size: 20px; line-height: 1.4; margin-bottom: 10px; }
.billing-dialog .dialog-text { font-size: 14px; line-height: 1.7; margin-bottom: 18px; }
.billing-dialog .field-error { margin-top: 8px; font-size: 13px; color: var(--error); }
#billing-dialog .field-error:empty { display: none; }
.billing-dialog .dialog-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.billing-dialog .dialog-actions .button { min-width: 96px; min-height: 44px; border-radius: 12px; }
.billing-dialog #billing-forget { margin-right: auto; }
.data-dialog{width:min(500px,calc(100% - 32px))}.data-dialog .dialog-text{margin:8px 0 20px}.data-delete-actions{display:grid;gap:12px}.button.danger{border-color:color-mix(in srgb,var(--error) 55%,var(--border));background:var(--error-bg);color:var(--error)}.button.danger:not(:disabled):hover{background:color-mix(in srgb,var(--error-bg) 70%,var(--error) 30%)}.data-dialog .field-error{margin-top:12px;color:var(--error);font-size:13px}.data-dialog .field-error:empty{display:none}
@media (max-width: 680px) { .billing-chip { padding: 6px 10px; font-size: 13px; min-height: 36px; } }
.template-render-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 24px; margin-bottom: 24px; }
.template-render-page { margin: 0; min-width: 0; }
.template-render-page figcaption { margin-bottom: 8px; font-weight: 600; }
.template-render-page img { display: block; width: 100%; height: auto; border-radius: 8px; background: white; border: 1px solid #cbd5d1; }
.template-page-issues { font-size: .875rem; line-height: 1.7; padding-left: 20px; }

/* Material reading details share the existing attachment surface. */
.material-warnings{font-size:13px;line-height:1.6;color:var(--warning);margin-top:6px;white-space:normal}.material-warnings summary{cursor:pointer}.material-warnings ul{padding-left:18px;margin:6px 0}.material-ack,.composer .material-ack{display:flex;align-items:flex-start;gap:8px;font-size:13px;font-weight:400;line-height:1.6;margin-top:8px;color:var(--muted);white-space:normal}.material-ack input{margin-top:5px;flex-shrink:0}.supplement{flex-wrap:wrap}.supplement-files{flex-basis:100%;width:100%;margin-top:12px}.supplement-files .attachment{width:100%;text-align:left}.outline-actions>div{max-width:70%}
.supplement-archive-tip{font-size:13px;line-height:1.6;color:var(--muted);margin:6px 0 0}.archive-contents{font-size:13px;line-height:1.6;margin-top:6px;white-space:normal}.archive-contents summary{cursor:pointer;color:var(--muted)}.archive-contents ul{padding-left:18px;margin:6px 0;max-height:180px;overflow:auto}.archive-contents li{overflow-wrap:anywhere}.archive-file-status{display:inline-block;min-width:50px;margin-right:7px}.archive-file-status.skipped{color:var(--warning)}

/* Featured templates extend the existing day / night creation workspace. */
.home{max-width:948px;margin-top:30px;padding-bottom:0}
.home h1{font-size:clamp(32px,3.5vw,48px);line-height:1.4}
.home-subtitle{font-size:clamp(15px,1.5vw,19px);margin-top:13px}
.home .composer textarea{min-height:92px}
.home-hint{margin-top:15px;font-size:12px}
.template-gallery{width:calc(100% - 48px);max-width:1180px;margin:42px auto 0;padding-bottom:52px;scroll-margin-top:24px}
.template-gallery-heading{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.template-gallery-heading h2{font-size:26px;font-weight:650;line-height:1.35}
.template-count{padding:2px 9px;border:1px solid var(--border);border-radius:18px;background:var(--button-quiet);color:var(--accent);font-size:12px;white-space:nowrap}
.template-gallery-subtitle{color:var(--muted);font-size:14px;margin-top:7px}
.template-filters{display:flex;align-items:center;flex-wrap:wrap;gap:9px;margin:20px 0 22px}
.template-filter{min-height:40px;padding:7px 19px;border:1px solid var(--border);border-radius:22px;color:var(--muted);font-size:13px;background:var(--panel-soft);transition:background-color .15s,border-color .15s}
.template-filter:not(:disabled):hover{color:var(--text);border-color:var(--border-strong)}
.template-filter[aria-pressed=true]{background:var(--accent);color:var(--on-accent);border-color:transparent}
.template-filter[aria-pressed=true]:not(:disabled):hover{background:var(--accent-hover);color:var(--on-accent)}
.template-gallery-error{margin:0 0 20px;padding:12px 15px;border:1px solid color-mix(in srgb,var(--error) 35%,transparent);border-radius:12px;background:var(--error-bg);color:var(--error);font-size:14px;overflow-wrap:anywhere}
.template-gallery-error:empty{display:none}
.template-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:22px}
.template-card{min-width:0;padding:9px;border:1px solid var(--border);border-radius:13px;background:var(--panel);box-shadow:0 8px 24px rgba(0,0,0,.06);transition:border-color .15s,box-shadow .15s}
.template-card:hover{border-color:var(--border-strong)}
.template-card.is-selected{border-color:var(--accent);box-shadow:inset 0 0 0 1px var(--accent),0 0 0 3px color-mix(in srgb,var(--accent) 10%,transparent)}
.template-cover-button{display:block;width:100%;padding:0;border-radius:6px;overflow:hidden;background:#fff;line-height:0}
.template-cover-button:focus-visible{outline-offset:3px}
.template-card-cover{display:block;width:100%;height:auto;aspect-ratio:16/9;object-fit:contain;background:#fff}
.template-card-body{padding:12px 5px 5px}
.template-card-title{font-size:15px;font-weight:600;line-height:1.5;overflow-wrap:anywhere}
.template-card-meta{font-size:12px;color:var(--muted);margin-top:6px}
.template-card-actions{display:flex;align-items:stretch;gap:9px;margin-top:12px}
.template-card-actions .button{min-width:0;min-height:40px;padding:7px 10px;gap:7px;font-size:13px;border-radius:9px}
.template-card-actions .button:first-child{flex:1;border-color:var(--border);background:var(--button-quiet)}
.template-card-actions .button:first-child:not(:disabled):hover{background:var(--border)}
.template-card-actions .button:last-child{flex:1.35}
.template-card-actions .button svg{width:17px;height:17px}
.template-gallery-more{display:flex;align-items:center;justify-content:center;gap:9px;min-width:198px;min-height:44px;margin:27px auto 0;padding:9px 20px;border:1px solid var(--border);border-radius:10px;background:var(--panel-soft);font-size:14px}
.template-gallery-more:not(:disabled):hover{border-color:var(--border-strong);background:var(--panel)}
.gallery-source-info{display:flex;align-items:center;gap:15px;min-width:0;text-align:left}
.gallery-source-thumb{display:block;flex:0 0 120px;width:120px;aspect-ratio:16/9;object-fit:contain;background:#fff;border-radius:5px}
.gallery-source-info>div{min-width:0}
.gallery-source-label{font-size:11px;font-weight:400;line-height:1.6;color:var(--accent);margin-bottom:2px}
.gallery-source-name{font-size:15px;line-height:1.5;font-weight:600;overflow-wrap:anywhere}
.gallery-source-actions{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;flex-shrink:0}
.gallery-source-actions .button{min-height:40px;padding:8px 16px;border-color:var(--border);border-radius:9px;font-size:13px;background:var(--button-quiet)}
.gallery-source-actions .text-button,.gallery-source-actions .upload-button{min-height:32px;padding:4px 2px;font-size:11px;font-weight:400;color:var(--muted)}
.template-gallery-dialog{width:min(1260px,calc(100% - 48px));max-height:calc(100svh - 48px);padding:26px 30px 24px;overscroll-behavior:contain}
.template-dialog-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;padding-bottom:21px;border-bottom:1px solid var(--border)}
.template-dialog-heading h2{font-size:29px;line-height:1.35;margin-top:5px;overflow-wrap:anywhere}
.template-preview-close{flex-shrink:0}
.template-dialog-tags{display:flex;flex-wrap:wrap;gap:9px;margin-top:13px}
.template-dialog-tags span{font-size:12px;border:1px solid var(--border);padding:3px 13px;border-radius:20px;color:var(--muted)}
.template-dialog-body{display:grid;grid-template-columns:minmax(0,1fr) 275px;gap:28px;padding-top:22px}
.template-dialog-body>div{min-width:0}
.template-preview-panel{min-width:0;border:1px solid var(--border);border-radius:12px;background:var(--panel-soft);overflow:hidden}
.template-preview-toolbar{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:10px;padding:10px 14px;border-bottom:1px solid var(--border);font-size:13px}
.template-preview-toolbar strong{font-weight:600}
.template-zoom-controls{display:flex;align-items:center;flex-wrap:wrap;gap:7px}
.template-zoom-controls button{display:inline-flex;align-items:center;justify-content:center;gap:4px;min-height:32px;min-width:32px;padding:4px 8px;border:1px solid var(--border);border-radius:6px;font-size:12px;color:var(--muted);white-space:nowrap}
.template-zoom-controls button:not(:disabled):hover{color:var(--text);background:var(--button-quiet);border-color:var(--border-strong)}
.template-zoom-controls button svg{width:14px;height:14px}
.template-preview-viewport{max-height:60svh;min-height:160px;padding:15px;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:var(--border-strong) transparent}
.template-preview-viewport:focus-visible{outline:3px solid var(--focus);outline-offset:-4px}
.template-preview-sheet{display:block;width:100%;max-width:none;height:auto;margin:0 auto;background:#fff}
.template-preview-caption{font-size:11px;color:var(--muted);margin-top:7px}
.template-details{display:flex;flex-direction:column;min-width:0}
.template-details h3{font-size:16px;font-weight:600;margin:1px 0 8px}
.template-details p{font-size:13px;color:var(--muted);line-height:1.8}
.template-details p+h3{border-top:1px solid var(--border);padding-top:21px;margin-top:22px}
.template-chapters{list-style:none;padding:0;margin:13px 0 0;display:flex;flex-direction:column;gap:14px}
.template-chapters li{display:flex;align-items:center;gap:12px;font-size:14px;overflow-wrap:anywhere}
.chapter-number{display:inline-flex;align-items:center;justify-content:center;flex:0 0 28px;width:28px;height:28px;border-radius:50%;background:color-mix(in srgb,var(--accent) 12%,transparent);font-size:12px;color:var(--accent);font-variant-numeric:tabular-nums}
.template-editability-note{padding:12px 14px;background:var(--button-quiet);border:1px solid var(--border);border-radius:9px;margin-top:24px;font-size:12px;color:var(--muted);line-height:1.8}
.template-details .template-compatibility-note{font-size:11px;margin:10px 0 24px}
.template-dialog-footer{position:sticky;bottom:0;display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:10px 18px;margin-top:16px;padding:12px 0 0;border-top:1px solid var(--border);background:var(--page-bg);z-index:1}
.template-dialog-use{display:inline-flex;align-items:center;justify-content:center;min-height:46px;min-width:148px;padding:10px 18px;background:var(--accent);color:var(--on-accent);border-radius:10px;font-size:15px;font-weight:600}
.template-dialog-use:not(:disabled):hover{background:var(--accent-hover)}
#template-dialog-status{min-width:0;flex:1 1 200px;font-size:13px;color:var(--muted);overflow-wrap:anywhere}
#template-dialog-status:empty{display:none}
#template-dialog-status[role=alert]{color:var(--error)}
.template-gallery-dialog.zoom-expanded .template-dialog-body{grid-template-columns:minmax(0,1fr)}
.template-gallery-dialog.zoom-expanded .template-details{display:none}
.template-gallery-dialog.zoom-expanded .template-preview-viewport{max-height:calc(100svh - 290px)}
@media(max-width:900px){
  .template-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}
  .template-gallery{width:calc(100% - 64px)}
  .template-gallery-dialog{padding:24px;width:calc(100% - 32px);max-height:calc(100svh - 32px)}
  .template-dialog-body{grid-template-columns:minmax(0,1fr) 230px;gap:20px}
  .template-dialog-heading h2{font-size:25px}
  .template-preview-toolbar{padding:10px}
  .template-preview-viewport{padding:10px}
}
@media(max-width:680px){
  .home{margin-top:24px;padding-bottom:0}
  .home h1{font-size:32px;line-height:1.5}
  .home .composer textarea{min-height:116px}
  .template-gallery{width:calc(100% - 42px);margin-top:36px;padding-bottom:36px}
  .template-gallery-heading h2{font-size:23px}
  .template-gallery-subtitle{font-size:13px;line-height:1.8}
  .template-filters{gap:8px;margin-top:16px;margin-bottom:18px}
  .template-filter{padding:7px 15px;min-height:40px;font-size:12px}
  .template-grid{grid-template-columns:minmax(0,1fr);gap:18px}
  .template-card-body{padding:12px 6px 6px}
  .template-card-actions .button{min-height:44px}
  .template-gallery-more{margin-top:22px}
  .gallery-source-info{gap:10px;flex:1}
  .gallery-source-thumb{flex-basis:78px;width:78px}
  .gallery-source-name{font-size:13px}
  .gallery-source-label{font-size:10px}
  .route-source-heading:has(.gallery-source-info){flex-wrap:wrap;gap:12px}
  .route-source-heading:has(.gallery-source-info) .gallery-source-info{flex:1 1 100%}
  .gallery-source-info>div{flex:1;min-width:0}
  .gallery-source-actions{flex-direction:row;justify-content:flex-end;gap:12px;margin-left:auto}
  .gallery-source-actions .button{min-height:40px;padding:7px 12px;font-size:12px}
  .gallery-source-actions .text-button,.gallery-source-actions .upload-button{min-height:40px}
  .template-gallery-dialog{width:calc(100% - 20px);max-height:calc(100svh - 20px);padding:18px 16px;border-radius:15px}
  .template-dialog-heading{gap:10px;padding-bottom:16px}
  .template-dialog-heading h2{font-size:21px}
  .template-preview-close{min-height:44px;padding-inline:9px;font-size:12px}
  .template-dialog-tags{gap:6px;margin-top:10px}
  .template-dialog-tags span{padding:3px 9px;font-size:11px}
  .template-dialog-body{display:flex;flex-direction:column;gap:22px;padding-top:16px}
  .template-preview-toolbar{align-items:flex-start}
  .template-zoom-controls{gap:6px}
  .template-zoom-controls button{min-height:40px;min-width:36px;padding:6px 8px;font-size:11px}
  .template-preview-viewport{max-height:52svh;padding:9px}
  .template-details p+h3{padding-top:16px;margin-top:16px}
  .template-chapters{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
  .template-chapters li{align-items:flex-start;gap:8px;font-size:12px;line-height:1.8}
  .chapter-number{flex-basis:25px;width:25px;height:25px;font-size:11px}
  .template-editability-note{margin-top:18px}
  .template-details .template-compatibility-note{margin-bottom:18px}
  .template-dialog-use{width:100%}
  .template-gallery-dialog.zoom-expanded .template-preview-viewport{max-height:calc(100svh - 270px)}
}
@media(max-width:370px){
  .template-gallery{width:calc(100% - 32px)}
  .home h1{font-size:29px}
  .template-filter{padding-inline:12px}
  .template-chapters{grid-template-columns:minmax(0,1fr)}
}
@media(prefers-reduced-motion:reduce){
  html:has(.template-gallery){scroll-behavior:auto}
  .template-card,.template-filter{transition:none}
}

.template-input-warnings{margin-top:10px;font-size:12px;text-align:left;color:var(--muted);line-height:1.7}
.template-input-warnings summary{cursor:pointer}
.template-input-warnings ul{padding-left:20px;max-height:180px;overflow:auto;margin-top:8px}
.template-image-error{font-size:14px;line-height:1.8;color:var(--error)}

/* The blue workspace shares its geometry across day and night themes. */
:root{
  --page-bg:#0d1723;
  --page-glow:rgba(42,100,191,.28);
  --scene-grid:rgba(114,159,224,.16);
  --workspace-panel:rgba(29,42,59,.88);
  --workspace-input:rgba(10,21,36,.46);
  --workspace-card:rgba(27,40,57,.86);
  --workspace-blue:#1760f5;
  --workspace-blue-hover:#3778ff;
  --workspace-selected:#8db7ff;
  --workspace-soft-blue:rgba(63,112,195,.24);
}
:root[data-theme=day]{
  --page-bg:#f5f8fd;
  --page-glow:rgba(168,206,255,.4);
  --scene-grid:rgba(73,133,223,.13);
  --workspace-panel:rgba(255,255,255,.94);
  --workspace-input:rgba(241,246,253,.7);
  --workspace-card:rgba(255,255,255,.93);
  --workspace-blue:#1855db;
  --workspace-blue-hover:#1046c3;
  --workspace-selected:#1958e5;
  --workspace-soft-blue:#edf4ff;
}
body,[data-theme=day] body{background:var(--page-bg);isolation:isolate}
.scene,[data-theme=day] .scene{background:radial-gradient(ellipse 65% 520px at 50% 0,var(--page-glow),transparent),var(--page-bg)}
.scene::before,.scene::after{content:"";position:absolute;inset:0 0 auto;height:620px;mask-image:linear-gradient(#000,transparent)}
.scene::before{background-image:linear-gradient(var(--scene-grid) 1px,transparent 1px),linear-gradient(90deg,var(--scene-grid) 1px,transparent 1px);background-size:72px 64px;background-position:center 13px}
.scene::after{background-image:linear-gradient(39deg,transparent 49.8%,var(--scene-grid) 50%,transparent 50.2%),linear-gradient(-39deg,transparent 49.8%,var(--scene-grid) 50%,transparent 50.2%);background-size:290px 230px;mask-image:linear-gradient(90deg,#000,transparent 29%,transparent 71%,#000);opacity:.5}
.scene-scrim,[data-theme=day] .scene-scrim,body[data-view]:not([data-view=input]) .scene-scrim,[data-theme=day] body[data-view]:not([data-view=input]) .scene-scrim{background:linear-gradient(transparent 200px,var(--page-bg) 680px)}
.site-header{width:calc(100% - 112px);max-width:1180px;margin:0 auto;padding:18px 0;gap:20px;flex-wrap:wrap}
.brand{gap:12px;flex-shrink:0;letter-spacing:-.6px}
.brand-mark{display:block;flex:none;width:44px;height:48px;background:#84b3ff;mask:url('/assets/pptsmith-mark.svg') center/contain no-repeat}
[data-theme=day] .brand-mark{background:#1957e8}
.brand-lockup{display:flex;flex-direction:column;align-items:flex-start;gap:4px}
.brand-name{font-size:26px;font-weight:750;line-height:1.08;letter-spacing:-.7px}
.brand-wordmark{display:block;width:128px;height:auto;aspect-ratio:1252/148;overflow:hidden;filter:invert(1);opacity:.86}
[data-theme=day] .brand-wordmark{filter:none;opacity:.82}
.header-actions{gap:14px;flex-wrap:wrap;justify-content:flex-end;margin-left:auto}
.theme-switch{border-radius:24px;background:var(--button-quiet)}
.theme-switch button{min-width:76px;min-height:34px;padding:4px 11px}
.theme-switch button[aria-pressed=true]{background:var(--workspace-soft-blue);color:var(--text);box-shadow:inset 0 0 0 1px rgba(95,154,255,.22)}
[data-theme=day] .theme-switch{background:rgba(240,246,255,.8)}
[data-theme=day] .theme-switch button[aria-pressed=true]{color:var(--workspace-blue)}
.help-button{border-left:1px solid var(--border);border-radius:0;padding-left:16px;font-size:13px}
.home{width:calc((100% - 112px)*.84);max-width:1000px;margin:20px auto 0;padding:0}
.home h1{font-size:clamp(30px,3.5vw,46px);line-height:1.35;letter-spacing:.01em;font-weight:750}
.home-subtitle{margin-top:9px;font-size:18px;letter-spacing:.02em}
.home .route-switch{display:inline-flex;width:auto;min-width:470px;margin-top:16px;padding:4px;gap:4px;background:var(--button-quiet);border-color:var(--border)}
.home .route-switch button{display:flex;align-items:center;justify-content:center;gap:9px;flex:1;min-height:40px;padding:7px 20px;font-weight:550;white-space:nowrap}
.home .route-switch button[aria-pressed=true]{background:var(--workspace-soft-blue);color:var(--text);box-shadow:none}
[data-theme=day] .home .route-switch button[aria-pressed=true]{background:#fff;box-shadow:0 3px 12px rgba(41,73,126,.12)}
.home .route-switch button[aria-pressed=true] svg{color:var(--workspace-selected)}
.home .composer{margin-top:15px;padding:20px 22px 12px;border-radius:17px;background:var(--workspace-panel);box-shadow:0 12px 40px rgba(0,0,0,.12)}
[data-theme=day] .home .composer{box-shadow:0 10px 32px rgba(64,94,145,.1)}
.template-composer{display:grid;grid-template-columns:250px minmax(0,1fr);column-gap:26px;row-gap:0}
.composer-brief{min-width:0}
.composer-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:38px;margin-bottom:10px}
.composer .composer-heading label{font-size:18px;font-weight:700}
.composer-heading .template-upload{font-size:13px;min-height:36px;padding:6px 13px;border-radius:8px;background:transparent;gap:8px;white-space:nowrap}
.home .composer textarea{height:110px;min-height:110px;width:100%;padding:11px 13px;border:1px solid var(--border);border-radius:8px;background:var(--workspace-input);font-size:14px;line-height:1.8;resize:vertical}
.home .composer textarea:focus{border-color:var(--border-strong);box-shadow:0 0 0 2px color-mix(in srgb,var(--accent) 12%,transparent)}
.home .composer textarea:focus-visible{outline:2px solid var(--focus);outline-offset:2px}
.brief-examples{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}
.brief-examples button{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:34px;padding:5px 10px;border:1px solid var(--border);border-radius:7px;font-size:12px;line-height:1.5;background:var(--button-quiet)}
.brief-examples button svg{width:15px;height:15px}
.brief-examples button:not(:disabled):hover{background:var(--workspace-soft-blue);border-color:var(--border-strong)}
.template-source{min-width:0;padding:11px 12px 9px;border:1px solid var(--border);border-radius:9px;background:var(--workspace-input)}
.template-source .gallery-source-thumb{display:block;width:100%;height:112px;border-radius:5px;object-fit:cover;object-position:top;background:#fff}
.template-source-placeholder{display:flex;align-items:center;justify-content:center;flex-direction:column;gap:9px;height:112px;border:1px dashed var(--border-strong);border-radius:5px;background:linear-gradient(135deg,var(--workspace-soft-blue),transparent);color:var(--muted)}
.template-source-placeholder svg{width:38px;height:38px;fill:none;stroke:var(--accent);stroke-width:1.2}
.template-source-placeholder span{font-size:11px}
.template-source .gallery-source-label{display:flex;align-items:center;gap:7px;margin:8px 0 4px;font-size:11px;font-weight:600;color:var(--muted)}
.template-source.has-template .gallery-source-label{color:var(--text)}
.template-source-check{display:inline-flex;align-items:center;justify-content:center;width:19px;height:19px;border-radius:50%;background:var(--workspace-blue);color:#fff}
.template-source-check svg{width:13px;height:13px;fill:none;stroke:currentColor;stroke-width:2}
.template-source .gallery-source-name{font-size:16px;line-height:1.5;font-weight:650;overflow-wrap:anywhere}
.template-source-browse{display:inline-flex;align-items:center;gap:4px;padding:3px 0;min-height:28px;font-size:12px;color:var(--accent)}
.template-source-browse:hover{text-decoration:underline;text-underline-offset:3px}
.template-source-browse svg{width:14px;height:14px}
.home .attachments{grid-column:1/-1;margin:12px 0 0}
.home .attachments:empty{display:none}
.home .composer-footer{grid-column:1/-1;margin-top:14px;padding-top:10px}
.home .composer .button.primary{min-height:42px;min-width:165px;border-radius:8px;background:var(--workspace-blue);color:#fff;box-shadow:inset 0 0 0 1px rgba(255,255,255,.1),0 2px 7px rgba(10,68,182,.15)}
.home .composer .button.primary:not(:disabled):hover{background:var(--workspace-blue-hover)}
.home .upload-button{font-size:13px;min-height:40px}
.home .upload-hint{grid-column:1/-1;margin-top:4px;font-size:10px;line-height:1.7}
.template-source-notes{grid-column:1/-1;margin-top:6px;color:var(--muted);text-align:left;font-size:11px}
.template-source-notes summary{cursor:pointer;width:fit-content;padding:3px 0}
.template-source-notes[open]{padding-top:7px;border-top:1px solid var(--border)}
.template-source-notes .route-source-caption{font-size:11px}
.home .template-source-notes .upload-hint{font-size:11px;margin:5px 0 0}
.template-source-notes ul{padding-left:18px;max-height:170px;overflow:auto;line-height:1.8}
.template-source-issue{grid-column:1/-1}
.home .home-hint{display:block;margin-top:14px;font-size:12px}
.home .browser-caption{font-size:11px;margin:3px 0 0;color:var(--subtle)}
.home .local-import{margin-top:5px}
.home .local-import>summary{padding:3px;min-height:28px;font-size:12px}
.home .input-status:empty{display:none}
.template-gallery{width:calc(100% - 112px);margin-top:20px;padding-bottom:0}
.template-gallery-heading h2{font-size:26px;font-weight:700}
.template-count{color:var(--muted);background:var(--button-quiet);border-color:transparent}
.template-gallery-toolbar{display:flex;align-items:center;justify-content:space-between;gap:20px}
.template-gallery-intro{min-width:0}
.template-search{display:flex;align-items:center;gap:10px;flex:0 1 235px;min-width:180px;padding:7px 13px;border:1px solid var(--border-strong);border-radius:24px;background:var(--button-quiet);color:var(--muted)}
.template-search svg{width:19px;height:19px;flex-shrink:0;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round}
.template-search input{width:100%;min-width:0;padding:0;border:0;background:transparent;font-size:12px;line-height:1.8}
.template-search input::placeholder{color:var(--subtle)}
.template-search input:focus-visible{outline:none}
.template-search:focus-within{outline:2px solid var(--focus);outline-offset:3px}
.template-filter-bar{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:10px 18px;margin:15px 0 17px}
.template-filters{gap:7px;margin:0}
.template-filter{min-height:34px;padding:6px 15px;font-size:12px;background:var(--button-quiet)}
.template-filters .template-filter[aria-pressed=true]{background:var(--workspace-blue);color:#fff}
.template-filter-extras{display:flex;align-items:center;flex-wrap:wrap;gap:12px}
.template-scenario-filters{display:flex;align-items:center;flex-wrap:wrap;gap:6px}
.template-filter-label{font-size:11px;color:var(--muted);white-space:nowrap;margin-right:2px}
.template-scenario-filter{padding:5px 10px;min-height:30px;font-size:11px}
.template-scenario-filter[aria-pressed=true]{background:var(--workspace-soft-blue);color:var(--accent);border-color:color-mix(in srgb,var(--accent) 35%,transparent)}
.template-color-filter{display:flex;align-items:center;gap:8px;padding-left:12px;border-left:1px solid var(--border);font-size:11px}
.template-color-current{display:inline-flex;align-items:center;gap:7px;color:var(--muted);white-space:nowrap}
.template-color-swatch{display:inline-block;width:18px;height:18px;background:#1c60ed;border:2px solid var(--workspace-card);border-radius:50%;box-shadow:0 0 0 1px var(--border-strong)}
.template-filter-summary{display:flex;align-items:center;gap:15px;margin:-3px 0 12px;font-size:12px;color:var(--muted)}
.template-filter-reset{padding:3px 0;min-height:28px;font-size:12px}
.template-empty-state{grid-column:1/-1;text-align:center;padding:44px 20px;border:1px dashed var(--border-strong);border-radius:12px;background:var(--workspace-card)}
.template-empty-state h3{font-size:17px}
.template-empty-state p{color:var(--muted);font-size:13px;margin:8px 0 18px}
.template-cover-button{position:relative}
.template-selected-badge{position:absolute;right:8px;top:8px;display:inline-flex;align-items:center;min-height:25px;padding:4px 10px;border:1px solid rgba(255,255,255,.4);border-radius:20px;background:#d7e7ff;color:#124cc8;font-size:11px;font-weight:650;line-height:1.5;box-shadow:0 2px 8px rgba(13,45,101,.12)}
.template-grid{gap:18px}
.template-card{background:var(--workspace-card);padding:9px;border-radius:12px}
.template-card-body{padding:9px 2px 1px}
.template-card-title{font-size:16px}
.template-card-meta{margin-top:3px}
.template-card-actions{gap:8px;margin-top:8px}
.template-card-actions .button{min-height:36px;border-radius:7px}
.template-card-actions .button:last-child{background:var(--workspace-soft-blue);color:var(--accent);border-color:color-mix(in srgb,var(--accent) 30%,transparent)}
.template-card-actions .button:last-child:not(:disabled):hover{background:color-mix(in srgb,var(--accent) 22%,var(--workspace-card))}
.template-card.is-selected{border-color:var(--workspace-selected);box-shadow:inset 0 0 0 1px var(--workspace-selected),0 0 0 3px color-mix(in srgb,var(--workspace-selected) 8%,transparent)}
.template-card.is-selected .button:last-child:disabled{opacity:1;background:var(--workspace-soft-blue)}
.template-gallery-more{min-height:38px;min-width:180px;margin-top:23px;font-size:13px;border-radius:8px;background:var(--button-quiet)}
.site-footer{display:flex;align-items:center;justify-content:center;gap:18px;margin:24px auto 26px;color:var(--subtle);font-size:11px}
.site-footer::before,.site-footer::after{content:"";width:70px;height:1px;background:var(--border)}
@media(max-width:1050px){
  .home{width:calc(100% - 80px)}
  .template-composer{grid-template-columns:220px minmax(0,1fr);column-gap:22px}
  .brief-examples{gap:6px}
  .brief-examples button{padding-inline:8px;font-size:11px}
}
@media(max-width:900px){
  .site-header,.template-gallery{width:calc(100% - 48px)}
  .home{width:calc(100% - 64px)}
  .home h1{font-size:32px}
  .template-composer{grid-template-columns:200px minmax(0,1fr);column-gap:18px}
  .template-filter-bar{align-items:flex-start;gap:10px;margin-bottom:15px}
  .template-filter-extras{width:100%;justify-content:space-between}
}
@media(max-width:680px){
  .site-header{width:calc(100% - 32px);padding:14px 0;gap:14px}
  .brand{gap:9px}
  .brand-mark{width:38px;height:42px}
  .brand-name{font-size:22px;letter-spacing:-.5px}
  .brand-wordmark{width:108px}
  .header-actions{gap:8px}
  .theme-switch button{min-width:60px;padding:4px 8px;font-size:12px}
  .theme-switch svg{width:16px;height:16px}
  .help-button{padding-left:10px;min-width:38px;font-size:12px}
  .home{width:calc(100% - 32px);margin-top:18px}
  .home h1{font-size:clamp(25px,6.2vw,32px);letter-spacing:0;line-height:1.45}
  .home-subtitle{font-size:14px;margin-top:8px}
  .home .route-switch{display:flex;width:100%;min-width:0;margin-top:18px}
  .home .route-switch button{padding:7px 5px;gap:6px;font-size:12px;min-width:0;white-space:normal;line-height:1.45}
  .home .route-switch svg{width:17px;height:17px}
  .home .composer{padding:14px 14px 10px;border-radius:13px}
  .template-composer{grid-template-columns:minmax(0,1fr);row-gap:14px}
  .template-source{display:grid;grid-template-columns:108px minmax(0,1fr);column-gap:12px;align-content:center;padding:10px}
  .template-source .gallery-source-thumb,.template-source-placeholder{grid-row:1/4;align-self:center;width:108px;height:76px;min-height:76px}
  .template-source-placeholder{gap:5px}
  .template-source-placeholder svg{width:28px;height:28px}
  .template-source-placeholder span{font-size:9px;text-align:center;padding:0 3px}
  .template-source .gallery-source-label{margin:0 0 2px;font-size:10px}
  .template-source .gallery-source-name{font-size:14px}
  .template-source-browse{min-height:28px;justify-self:start;padding:2px 0;font-size:11px}
  .composer .composer-heading label{font-size:16px}
  .composer-heading{margin-bottom:9px}
  .composer-heading .template-upload{font-size:12px;min-height:34px;padding:5px 9px}
  .home .composer textarea{height:112px;min-height:112px;font-size:14px}
  .brief-examples{gap:6px}
  .brief-examples button{font-size:11px;padding:5px 7px}
  .home .composer-footer{margin-top:0;padding-top:10px;gap:10px}
  .home .composer:not(.template-composer) .composer-footer{margin-top:14px}
  .home .composer .button.primary{min-width:138px;padding:9px 12px;font-size:13px}
  .home .upload-hint,.template-source-notes{margin-top:0}
  .home .home-hint{font-size:11px}
  .template-gallery{width:calc(100% - 32px);margin-top:24px}
  .template-gallery-heading h2{font-size:23px}
  .template-gallery-subtitle{font-size:12px}
  .template-gallery-toolbar{align-items:flex-start;flex-wrap:wrap;gap:12px}
  .template-search{flex:1 1 100%;min-width:0;padding:7px 12px}
  .template-filter-bar{margin-top:12px;gap:12px}
  .template-filters{gap:6px}
  .template-filter{min-height:34px;padding:6px 12px;font-size:11px}
  .template-filter-extras{align-items:flex-start;gap:10px}
  .template-scenario-filters{gap:5px}
  .template-scenario-filter{padding:5px 8px;min-height:30px;font-size:10px}
  .template-filter-label{font-size:10px}
  .template-color-filter{padding-left:0;border:0;gap:7px}
  .template-filter-summary{margin-top:-3px}
  .template-grid{gap:15px}
  .site-footer{font-size:10px;gap:12px}
  .site-footer::before,.site-footer::after{width:42px}
}
.language-toggle{min-width:42px;min-height:40px;padding:7px 8px;border:1px solid var(--border);border-radius:10px;background:var(--button-quiet);font-size:12px;font-weight:650;white-space:nowrap}
.language-toggle:hover{background:var(--border)}
@media(max-width:680px){
  .site-header{flex-wrap:wrap}
  .header-actions{justify-content:flex-end;flex-wrap:wrap;margin-left:auto}
  .language-toggle{min-width:38px;min-height:36px;padding:5px;font-size:11px}
}

/* Theme-colour catalogue: swatches use external rules to respect the site CSP. */
.template-search{flex-basis:285px}
.template-filter-panel{margin:18px 0 20px;padding:14px 18px;border:1px solid var(--border);border-radius:12px;background:color-mix(in srgb,var(--workspace-card) 55%,transparent)}
.template-filter-row{display:flex;align-items:flex-start;gap:19px;padding:6px 0}
.template-filter-row>.template-filter-label{flex:0 0 56px;line-height:34px;font-size:12px;margin:0}
.template-filter-row .template-filters{gap:7px;margin:0}
.template-filter-panel .template-filter{min-height:34px;padding:5px 13px;font-size:12px}
.template-filter-panel .template-filter[aria-pressed=true]{background:var(--workspace-blue);color:#fff;border-color:transparent}
.template-filter-panel .template-filter{display:inline-flex;align-items:center;gap:7px}
.template-filter-panel .template-filter small{font-size:10px;opacity:.8}
.template-filter-help{font-size:12px;color:var(--muted);margin:-9px 0 14px;line-height:1.7}
.template-filter-summary{flex-wrap:wrap;gap:8px 15px}
.template-active-filters{display:flex;flex-wrap:wrap;gap:6px;min-width:0;max-width:100%}
.template-filter-chip{display:inline-flex;align-items:center;gap:9px;max-width:100%;min-height:32px;padding:4px 10px;border:1px solid var(--border-strong);border-radius:7px;background:var(--workspace-soft-blue);color:var(--text);font-size:12px}
.template-filter-chip>span:first-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
.template-filter-chip>span:last-child{flex-shrink:0;font-size:16px}
.template-color-option{display:inline-flex;align-items:center;gap:7px}
.template-color-option small{font-size:10px;opacity:.8}
.template-color-swatch{width:13px;height:13px;flex-shrink:0;border:1px solid rgba(255,255,255,.55);box-shadow:0 0 0 1px var(--border);border-radius:50%}
.template-color-swatch[data-color-family=black-gold]{background:#252f38}
.template-color-swatch[data-color-family=blue-teal]{background:#277d7a}
.template-color-swatch[data-color-family=green]{background:#35574d}
.template-color-swatch[data-color-family=purple]{background:#493352}
.template-color-swatch[data-color-family=wine]{background:#662f41}
.template-color-swatch[data-color-family=brown]{background:#7b4131}
.template-color-swatch[data-color-family=navy-gold]{background:#123a63}
.template-mobile-filters{display:none}
.template-card{display:flex;flex-direction:column}
.template-card-body{display:flex;flex-direction:column;flex:1;min-width:0}
.template-card-title{font-size:15px}
.template-card-color{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:4px}
.template-card-color .template-card-meta{margin:0;min-width:0;overflow-wrap:anywhere}
.template-palette{display:inline-flex;gap:4px;flex-shrink:0}
.template-palette .template-tone{display:block;width:12px;height:12px;flex-shrink:0}.template-palette .template-tone circle{stroke:rgba(255,255,255,.5);stroke-width:1px;filter:drop-shadow(0 0 1px color-mix(in srgb,var(--border) 65%,transparent))}
.template-card-audience{font-size:11px;line-height:1.7;color:var(--muted);margin-top:6px;overflow-wrap:anywhere}
.template-scenario-tags{display:flex;flex-wrap:wrap;gap:5px;margin:7px 0 9px}
.template-scenario-tags span{font-size:10px;line-height:1.6;padding:2px 7px;background:var(--button-quiet);border-radius:4px;color:var(--muted)}
.template-card-actions{margin-top:auto;padding-top:0}
.template-preview-audience{margin:6px 0;color:var(--muted);font-size:13px;overflow-wrap:anywhere}
.template-preview-palette{display:flex;align-items:center;gap:9px;margin:10px 0 18px;font-size:12px;color:var(--muted)}
@media(max-width:680px){
  .template-filter-panel{display:none}
  .template-mobile-filters{display:grid;grid-template-columns:minmax(0,1fr);gap:8px;margin:18px 0 20px}
  .template-mobile-filters label{display:grid;grid-template-columns:64px minmax(0,1fr);gap:8px;align-items:center;min-width:0;font-size:11px;color:var(--muted)}
  .template-mobile-filters select{display:block;min-height:42px;width:100%;padding:7px 10px;border:1px solid var(--border-strong);border-radius:8px;color:var(--text);background:var(--workspace-card);font:inherit;font-size:12px}
  html[lang=en] .template-mobile-filters{grid-template-columns:minmax(0,1fr)}
  html[lang=en] .template-mobile-filters label{display:grid;grid-template-columns:64px minmax(0,1fr);gap:8px;align-items:center}
  html[lang=en] .template-mobile-filters select{margin-top:0;padding-inline:10px}
  .template-search{flex-basis:100%}
}

/* Palette values from 配色与受众索引.csv. */
.template-fit-dialog{max-width:640px;width:min(640px,calc(100vw - 32px))}
.template-fit-body{padding:0 2px}
.template-fit-body>p{line-height:1.65}
.template-fit-metrics{display:flex;gap:10px;margin:18px 0}
.template-fit-metrics>div{flex:1;min-width:0;padding:12px;border:1px solid var(--border);border-radius:12px;background:var(--surface)}
.template-fit-metrics strong{display:block;font-size:24px;line-height:1.1}
.template-fit-metrics span{display:block;margin-top:4px;color:var(--muted);font-size:12px}
.template-fit-reasons,.template-fit-pages ul{margin:12px 0;padding-left:20px;line-height:1.65}
.template-fit-pages{margin:12px 0}
.template-fit-pages summary{cursor:pointer;font-weight:600}
.template-fit-warning{padding:12px;border:1px solid color-mix(in srgb,var(--danger) 45%,var(--border));border-radius:12px;background:color-mix(in srgb,var(--danger) 10%,transparent)}
.template-fit-note{color:var(--muted)}
.template-fit-dialog .dialog-actions{display:flex;flex-wrap:wrap;gap:10px;margin-top:18px;align-items:center}
@media(max-width:560px){.template-fit-metrics{flex-direction:column}.template-fit-dialog .dialog-actions .button{flex:1}}
.content-type-field{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:12px;font-size:13px;color:var(--muted)}
.content-type-field select{min-height:34px;border:1px solid var(--border);border-radius:8px;background:var(--surface);color:var(--text);padding:4px 8px;font:inherit}
.content-type-field small{flex-basis:100%;font-size:12px;color:var(--muted)}
/* Keep source ordering and production evidence within the existing card layout. */
.image-order-controls{display:flex;justify-content:flex-end;gap:6px;padding:0 8px 6px}
.image-order-controls .text-button{padding:4px;min-width:32px;min-height:32px}
.image-order-controls svg{width:16px;height:16px}
.agent-progress{margin:14px 0;text-align:left}
.agent-progress details,.agent-decision{margin-top:12px}
.agent-decision h2{font-size:16px}
.agent-progress ol{padding-left:22px}
.stage.observed .stage-state{color:var(--muted)}
.design-frame.is-agent-original img{object-fit:contain}
.agent-revision-quote h2{font-size:16px}

/* Template workflow layout only. Existing page background, brand and icon rules stay unchanged. */
.template-composer{grid-template-columns:260px minmax(0,1fr);column-gap:28px;align-items:start}
.template-composer .template-source{padding:16px}
.template-composer .template-source .gallery-source-thumb{height:auto;aspect-ratio:16/9}
.template-composer .template-source .template-upload{display:flex;width:100%;margin-top:13px;justify-content:center;gap:8px;font-size:12px;min-height:42px;border-radius:8px}
.template-composer .template-source .template-upload svg{width:17px;height:17px}
.template-composer .composer-heading{margin-bottom:12px}
.template-composer .composer-brief textarea{min-height:136px}
.template-source-materials{margin-top:17px;padding:10px 13px;border:1px dashed var(--border-strong);border-radius:10px}
.template-source-materials .upload-button{padding:3px 0;min-height:36px}
.template-source-materials .attachments:not(:empty){margin:8px 0 0}
.template-source-materials .attachment{min-width:0}
.template-input-settings{margin-top:13px;color:var(--muted);font-size:12px}
.template-input-settings>summary{cursor:pointer;min-height:36px;padding:7px 0;width:fit-content}
.template-input-settings .generation-mode{margin:9px 0 0;padding:14px;border:1px solid var(--border);border-radius:10px;min-width:0}
.template-input-settings .generation-mode .small{font-size:11px}
.template-input-settings .content-type-field{min-width:0;font-size:12px}
.template-input-settings select{max-width:100%;min-width:0;min-height:40px}
.template-input-settings .content-type-field small{font-size:11px}
.template-composer .composer-footer{padding-top:16px;margin-top:20px}

.generation-layout{display:grid;grid-template-columns:minmax(0,1fr) 270px;gap:22px;align-items:start;max-width:1080px;margin:30px auto 0}
.generation-layout .generation{width:100%;max-width:none;margin:0;padding:30px;min-width:0}
.generation-layout .generation-heading{text-align:left;position:relative;padding-left:68px;min-height:54px}
.generation-layout .generation-symbol{position:absolute;left:0;top:0;margin:0}
.generation-layout .generation h1{font-size:25px;overflow-wrap:anywhere}
.generation-context{padding:22px;min-width:0}
.generation-context h2{font-size:14px;margin-bottom:16px}
.generation-context-title{font-size:14px;font-weight:550;overflow-wrap:anywhere}
.generation-context dl{display:grid;grid-template-columns:auto minmax(0,1fr);gap:10px 16px;margin:20px 0;font-size:12px;color:var(--muted)}
.generation-context dd{text-align:right;margin:0;overflow-wrap:anywhere;color:var(--text)}
.generation-context .text-button{font-size:12px;text-align:left;white-space:normal}
.generation-layout .generation-footer{text-align:left;margin-top:22px;padding-top:18px}
.generation-layout #generation-retry:empty{display:none}
.agent-progress{margin:24px 0}
.agent-progress-heading{display:flex;align-items:baseline;justify-content:space-between;gap:12px;flex-wrap:wrap;font-size:14px}
.agent-progress-heading .small{font-size:12px}
.agent-progress-counts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-top:17px}
.agent-progress-count{padding:16px 12px;background:var(--button-quiet);border:1px solid var(--border);border-radius:10px;min-width:0}
.agent-progress-count>span{display:block;font-size:12px;color:var(--muted)}
.agent-progress-count strong{display:block;font-size:27px;font-weight:650;line-height:1.3;margin-top:7px;font-variant-numeric:tabular-nums}
.agent-progress-count small{font-size:12px;color:var(--muted);font-weight:400;white-space:nowrap}
.agent-progress-count progress{appearance:none;display:block;width:100%;height:4px;margin-top:14px;border:0;border-radius:4px;background:var(--border);overflow:hidden;accent-color:var(--accent)}
.agent-progress-count progress::-webkit-progress-bar{background:var(--border);border-radius:4px}
.agent-progress-count progress::-webkit-progress-value{background:var(--accent);border-radius:4px}
.agent-progress-count progress::-moz-progress-bar{background:var(--accent);border-radius:4px}
.agent-failed-count{font-size:12px;color:var(--error);margin-top:12px}
.agent-progress-events{padding-top:14px;border-top:1px solid var(--border);margin-top:20px}
.agent-progress-events summary{cursor:pointer;font-size:12px;color:var(--muted);min-height:36px}
.agent-progress-events ol{font-size:12px;color:var(--muted);line-height:1.9}
.generation-layout .generation-retry{justify-content:flex-start}
.generation-layout #generation-retry>.notice{margin-top:18px;font-size:12px}

.result-workflow .preview-heading h1{font-size:25px;line-height:1.45;overflow-wrap:anywhere}
.result-heading-actions{display:flex;gap:10px;align-items:center;flex-shrink:0}
.result-heading-actions .button{white-space:nowrap;font-size:13px}
.result-check-strip{list-style:none;display:flex;align-items:center;gap:8px 24px;flex-wrap:wrap;padding:0 0 17px;margin:0 0 10px;border-bottom:1px solid var(--border);color:var(--muted);font-size:12px}
.result-check-strip .is-passed{color:var(--success)}
.result-inspection{margin:14px 0 20px;font-size:13px}
.result-inspection>summary{min-height:36px;cursor:pointer;color:var(--muted)}
.result-inspection[open]{border:1px solid var(--border);border-radius:12px;background:var(--panel);padding:16px 20px}
.result-inspection .notice{margin:14px 0}
.result-inspection .agent-editability h2{font-size:16px}
.result-inspection .agent-editability ul{font-size:12px;padding-left:20px}
.result-viewer{min-width:0;margin:20px 0}
.result-viewer-toolbar{display:flex;align-items:center;gap:16px;margin-bottom:15px}
.result-viewer-toolbar>p{font-size:11px;flex:1;min-width:0}
.result-viewer-modes{display:flex;padding:3px;gap:3px;border:1px solid var(--border);background:var(--button-quiet);border-radius:9px;flex-shrink:0}
.result-viewer-modes button{padding:7px 14px;min-height:36px;border-radius:6px;color:var(--muted);font-size:12px}
.result-viewer-modes [aria-pressed=true]{background:var(--panel);color:var(--accent);box-shadow:0 1px 5px rgba(0,0,0,.06)}
.result-viewer-toolbar .fullscreen-button{margin-left:auto;white-space:nowrap;flex-shrink:0;min-height:40px;font-size:12px;padding:8px}
.result-reader{display:grid;grid-template-columns:178px minmax(0,1fr);overflow:hidden;border:1px solid var(--border);border-radius:14px;background:var(--panel)}
.result-page-rail{min-width:0;max-height:max(380px,calc(100svh - 320px));overflow-y:auto;border-right:1px solid var(--border);background:var(--panel-soft);scrollbar-width:thin}
.result-page-rail ol{list-style:none;display:grid;gap:9px;padding:12px;margin:0}
.result-page-rail li{min-width:0}
.result-thumbnail{display:block;width:100%;max-width:100%;overflow:hidden;border:1px solid transparent;border-radius:8px;padding:6px;text-align:left}
.result-thumbnail[aria-current=true]{border-color:var(--accent);background:var(--button-quiet);box-shadow:0 0 0 1px var(--accent)}
.result-thumbnail img{display:block;width:100%;aspect-ratio:16/9;object-fit:contain;border-radius:3px;background:var(--panel)}
.result-thumbnail span{display:block;font-size:11px;color:var(--muted);padding-top:6px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.result-reading-main{padding:17px 20px;min-width:0;background:var(--panel-soft)}
.result-page-list{min-width:0}
.result-viewer .result-page{margin:0;border:0;padding:0;background:transparent;box-shadow:none}
.result-page figcaption{font-size:12px;margin-bottom:11px;color:var(--text);overflow-wrap:anywhere}
.result-image-stage{position:relative;aspect-ratio:16/9;max-height:max(240px,calc(100svh - 450px));margin:auto;overflow:hidden;border-radius:5px;background:var(--panel);box-shadow:0 2px 12px rgba(0,0,0,.06)}
.result-image-stage>.result-main-image{display:block;width:100%;height:100%;object-fit:contain}
.result-image-error{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;background:var(--panel);color:var(--muted);font-size:12px;padding:15px;text-align:center}
.result-image-error .button{font-size:12px}
.result-reader-controls{display:flex;align-items:center;justify-content:space-between;gap:15px;margin-top:15px}
.result-keyboard-hint{font-size:11px}
.result-pager{display:flex;align-items:center;gap:8px}
.result-pager select{min-height:38px;width:60px;padding:5px 8px;border:1px solid var(--border);border-radius:7px;background:var(--panel);color:var(--text);font:inherit;font-size:12px}
.result-pager .icon-button{width:38px;min-width:38px;height:38px;background:var(--button-quiet)}
.result-viewer .agent-page-feedback{border-top:1px solid var(--border);padding-top:12px;margin-top:14px;font-size:13px}
.agent-page-feedback summary{cursor:pointer;min-height:36px}
.agent-page-feedback .field-label{margin-top:8px}
.result-viewer.is-overview .result-reader{display:block;border:0;background:transparent;border-radius:0}
.result-viewer.is-overview .result-page-rail,.result-viewer.is-overview .result-reader-controls{display:none}
.result-viewer.is-overview .result-reading-main{padding:0;background:transparent}
.result-viewer.is-overview .result-page-list{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:17px;align-items:start}
.result-viewer.is-overview .result-page{background:var(--panel);border:1px solid var(--border);border-radius:11px;padding:12px;min-width:0}
.result-viewer.is-overview .result-main-image{cursor:zoom-in}
.result-fullscreen-dialog{width:100vw;max-width:none;height:100svh;max-height:none;inset:0;margin:0;padding:20px 30px;border:0;border-radius:0;background:var(--panel);color:var(--text)}
.result-fullscreen-dialog[open]{display:flex;flex-direction:column;gap:15px}
.result-fullscreen-dialog .dialog-heading{flex-shrink:0;margin:0;gap:20px}
.result-fullscreen-dialog h2{font-size:16px}
.result-fullscreen-stage{flex:1;min-height:0;position:relative;display:flex;align-items:center;justify-content:center}
.result-fullscreen-stage>img{display:block;width:100%;height:100%;object-fit:contain}
.result-fullscreen-controls{display:flex;justify-content:center;align-items:center;gap:20px;flex-shrink:0}
@media(max-width:1000px){.generation-layout{grid-template-columns:minmax(0,1fr) 230px;gap:16px}.generation-layout .generation{padding:24px}.result-workflow .preview-heading{flex-wrap:wrap}.result-heading-actions{margin-left:auto}.result-reader{grid-template-columns:146px minmax(0,1fr)}.result-reader-controls .result-keyboard-hint{display:none}}
@media(max-width:800px){.template-composer{grid-template-columns:220px minmax(0,1fr);column-gap:20px}.generation-layout{grid-template-columns:minmax(0,1fr)}.generation-context{padding:18px}.generation-context dl{margin:12px 0}.generation-context #generation-outline-link{margin-top:5px}.generation-layout .generation-heading{padding-left:62px}.result-viewer-toolbar>p{display:none}}
@media(max-width:680px){
  .template-composer{grid-template-columns:minmax(0,1fr);row-gap:18px}
  .template-composer .template-source{display:grid;grid-template-columns:110px minmax(0,1fr);gap:5px 15px;padding:14px}
  .template-composer .template-source>.gallery-source-thumb,.template-composer .template-source>.template-source-placeholder{grid-column:1;grid-row:1/5;align-self:start;width:100%;height:auto;aspect-ratio:4/3;min-height:90px}
  .template-composer .template-source>.gallery-source-label,.template-composer .template-source>.gallery-source-name,.template-composer .template-source>.template-source-browse{grid-column:2;margin:0}
  .template-composer .template-source>.template-upload{grid-column:1/-1;margin-top:8px;min-height:40px}
  .template-composer .template-source .gallery-source-name{font-size:13px}
  .template-composer .template-source-placeholder span{font-size:10px;text-align:center}
  .template-composer .template-source-placeholder svg{width:29px;height:29px}
  .template-composer .composer-brief textarea{min-height:138px}
  .template-source-materials{margin-top:14px}
  .template-composer .composer-footer{margin-top:0;flex-wrap:wrap;gap:11px}
  .template-composer .composer-footer>.button.primary{width:100%;min-height:44px}
  .template-composer .content-type-field{align-items:flex-start;flex-direction:column;gap:6px}
  .template-input-settings .content-type-field select{width:100%}
  .generation-layout{margin-top:16px}
  .generation-layout .generation{padding:21px 16px}
  .generation-layout .generation h1{font-size:21px}
  .generation-layout .generation-heading{padding-left:54px;min-height:44px}
  .generation-layout .generation-symbol{width:40px;height:40px;border-radius:12px}
  .generation-layout .generation-heading p{font-size:12px}
  .agent-progress-counts{gap:7px}
  .agent-progress-count{padding:12px 9px}
  .agent-progress-count>span{font-size:11px}
  .agent-progress-count strong{font-size:24px}
  .agent-progress-count small{font-size:10px}
  .agent-progress-heading,.agent-progress-heading .small{font-size:12px}
  .result-workflow .preview-heading h1{font-size:22px}
  .result-heading-actions{width:100%;gap:8px;flex-wrap:wrap}
  .result-heading-actions .button{flex:1;min-height:44px;font-size:12px;padding:9px}
  .result-check-strip{font-size:11px;gap:6px 13px}
  .result-inspection[open]{padding:13px}
  .result-viewer-toolbar{gap:7px}
  .result-viewer-modes button{padding:7px 10px;font-size:11px}
  .result-viewer-toolbar .fullscreen-button{font-size:11px;gap:5px;padding:5px}
  .result-reader{display:flex;flex-direction:column}
  .result-page-rail{order:2;max-height:none;border-right:0;border-top:1px solid var(--border);overflow:hidden}
  .result-page-rail ol{display:flex;gap:8px;padding:11px;overflow-x:auto;scrollbar-width:thin}
  .result-page-rail li{flex:0 0 100px}
  .result-reading-main{padding:13px 10px}
  .result-reader-controls{justify-content:center}
  .result-page figcaption{font-size:11px}
  .result-viewer.is-overview .result-page-list{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  .result-viewer.is-overview .result-page{padding:8px}
  .result-fullscreen-dialog{padding:14px}
  .result-fullscreen-dialog h2{font-size:13px}
}

.result-open-page{display:none}.result-viewer.is-overview .result-open-page{display:inline-flex;margin-left:10px;font-size:11px;min-height:32px;padding:4px 0}
.template-source-actions{display:flex;align-items:center;gap:16px;margin-top:5px;flex-wrap:wrap}
.template-source-actions .template-source-browse{min-height:36px}
@media(max-width:680px){.template-composer .template-source>.template-source-actions{grid-column:2;margin:0;gap:8px}.template-source-actions .template-source-browse{font-size:11px;min-height:34px}}

.result-delivery-notice{margin:0 0 14px}

.site-copyright{text-align:center;font-size:.75rem;color:var(--muted,#65758b);padding:20px 12px 26px}.data-record-list{max-height:34vh;overflow:auto}.data-record-list li{margin:10px 0;overflow-wrap:anywhere}.data-delete-actions{flex-wrap:wrap}

.template-provider-filters { margin: 16px 0 4px; }
.template-provider-filters .template-filters { margin: 0; }
.template-provider-filters .template-filter { min-height: 40px; display: inline-flex; align-items: center; gap: 7px; }
.template-provider-filters .template-filter small { font-variant-numeric: tabular-nums; }
.template-provider-label { color: var(--muted); font-size: 12px; }
.template-filter-details { margin: 6px 0 16px; color: var(--muted); }
.template-filter-details > summary { width: fit-content; padding: 8px 2px; cursor: pointer; font-size: 14px; }
.template-filter-details .template-filter-panel { margin-top: 3px; }
.template-library-drawer {
  inset: 0 0 0 auto; margin: 0; height: 100dvh; max-height: 100dvh;
  width: min(760px, 86vw); max-width: 100vw; padding: 0; border-radius: 0;
  border-width: 0 0 0 1px; overscroll-behavior: contain; scrollbar-gutter: stable;
  background: var(--page-bg);
}
.template-library-drawer::backdrop { background: rgb(8 18 33 / 36%); backdrop-filter: none; }
.template-library-drawer[open] { animation: template-library-in 230ms cubic-bezier(.22,.75,.22,1) both; }
.template-library-drawer[open]::backdrop { animation: template-library-shade 230ms ease-out both; }
.template-library-drawer[open].is-closing { animation: template-library-out 180ms ease-in both; pointer-events: none; }
.template-library-drawer[open].is-closing::backdrop { animation: template-library-shade 180ms ease-in reverse both; }
@keyframes template-library-in { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes template-library-out { from { transform: translateX(0); } to { transform: translateX(100%); } }
@keyframes template-library-shade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .template-library-drawer[open], .template-library-drawer[open]::backdrop,
  .template-library-drawer[open].is-closing, .template-library-drawer[open].is-closing::backdrop { animation: none; }
}
html:has(.template-library-drawer[open]) { overflow: hidden; }
.template-drawer-bar {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 24px; border-bottom: 1px solid var(--border); background: var(--page-bg);
}
.template-drawer-bar h2 { font-size: 21px; }
.template-library-drawer .template-gallery-intro { display: none; }
.template-library-drawer .template-search { flex: 1; }
.template-library-drawer .template-gallery { width: auto; margin: 18px 24px 32px; }
.template-library-drawer .template-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.template-library-drawer .template-gallery-toolbar { flex-wrap: wrap; }
@media (max-width: 680px) {
  .template-library-drawer { width: 100vw; border: 0; }
  .template-library-drawer .template-gallery { margin: 14px 16px 28px; }
  .template-drawer-bar { padding: 8px 16px; }
  .template-drawer-bar .button { min-height: 44px; }
  .template-library-drawer .template-grid { grid-template-columns: minmax(0, 1fr); }
  .template-provider-filters .template-filter-row { display: block; }
  .template-provider-filters .template-filter { min-height: 44px; padding: 5px 10px; }
}

.template-download-status:not([hidden]) { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-bottom: 12px; color: var(--muted); font-size: 13px; }
#template-dialog-status:not([hidden]) { margin-bottom: 0; }
#template-dialog-status [role="alert"] { color: var(--error); }
