/* Zine editor design contract: docs/zine-editor-design-system.md. */
:root{--ui-space-1:4px;--ui-space-2:8px;--ui-space-3:12px;--ui-space-4:16px;--ui-space-6:24px;--ui-space-8:32px;--action-primary-width:192px;--action-secondary-width:144px;--action-height:48px;--ui-ink:#eceae4;--ui-muted:#b0ada6;--ui-line:#55524e;--ui-panel:#171615;--ui-key:#302e2c;}
body{--op-dim:var(--ui-muted);--op-ink:var(--ui-ink);--op-line:var(--ui-line);}
body.mono-doc{filter:none;}
body.mono-high .photo-el,body.mono-high .spill-slice,body.mono-high .pg-thumb,body.mono-high .photo-strip .thumb,body.mono-high .seq-item,body.mono-high .layout-row button i,body.mono-high .wz-photo-row img{filter:url(#bwHigh);}
button,input,select,textarea{font-size:14px;}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,[tabindex]:focus-visible{outline:2px solid var(--rf-red);outline-offset:3px;}
button:disabled{cursor:not-allowed;}
button[data-action-size]{height:auto!important;min-height:48px!important;max-width:100%!important;line-height:1.3!important;font-size:14px!important;letter-spacing:.025em!important;flex-shrink:0!important;padding:8px 12px!important;white-space:normal!important;box-sizing:border-box;}
button[data-action-size="secondary"]{width:var(--action-secondary-width)!important;}
button[data-action-size="primary"]{width:var(--action-primary-width)!important;}
button[data-action-size]::after{font-size:14px!important;letter-spacing:.025em!important;}
#monoDocBtn{font-size:12px!important;}
:is(.header-actions,.tools-col,.tool-group,.export-row,.dest-foot-actions,.archive-head,.layout-row){gap:8px;}
:is(.header-actions,.tools-col,.tool-group,.export-row){min-width:0;}
.step-group{gap:8px;flex-shrink:0;}
.step-group button,.header-actions .step-group button{width:48px!important;min-width:48px!important;height:48px!important;flex:0 0 48px!important;position:relative!important;inset:auto!important;transform:none!important;}
/* Setup is a document with progressive disclosure, not fields separated by other tasks. */
#wizard,#preflight{--op-ink:#eceae4;--op-dim:#b0ada6;--op-panel:#171615;--op-key:#302e2c;--op-key-up:#403e3b;--op-line:#55524e;--hairline:#55524e;--mid:#b0ada6;background:#0b0a0a;color:#eceae4;}
#wizard .wizard-card,#preflight .wizard-card{background:#0b0a0a;color:#eceae4;}
#wizard{padding:clamp(12px,3vw,32px);overflow-y:auto;}
#wizard .wizard-card{max-width:1200px;display:flex;flex-direction:column;height:auto!important;min-height:0;overflow:visible;gap:24px;}
#wizard .wz-scroll{display:flex;flex-direction:column;flex:0 0 auto;overflow:visible;gap:24px;}
#wizard .wz-heading{margin:0;font-size:clamp(24px,3vw,32px);line-height:1.15;color:var(--ui-ink);}
#wizard .wz-sec-k{margin:0;color:var(--ui-muted);font-size:14px;}
#wizard .wz-presets{margin:0;gap:12px;}
#wizard .wz-preset{color:var(--ui-ink);background:var(--ui-key);border:1px solid var(--ui-line);min-height:80px;padding:16px;}
#wizard .wz-preset.sel{border-color:var(--rf-red);}
#wizard .wz-preset b{font-size:18px;line-height:1.3;}
#wizard .wz-preset em,#wizard .field-explainer{font-size:14px;line-height:1.5;color:var(--ui-muted);}
.preset-changed{display:block;font:14px/1.4 var(--font-mono);color:var(--ui-ink);margin-top:8px;}
#wizard .wz-body{display:grid;grid-template-columns:minmax(0,1fr) minmax(240px,.65fr);gap:32px;margin:0;}
#wizard .wz-form{display:flex;flex-direction:column;gap:24px;min-width:0;}
#wizard .wz-field{margin:0!important;min-width:0;}
#wizard .wz-aside{display:flex!important;flex-direction:column;gap:16px;min-width:0;}
#wizard .wizard-card:not(.deep) .wz-form{display:none;}
#wizard .wizard-card:not(.deep) .wz-body{grid-template-columns:minmax(0,1fr);}
#wizard .wizard-card:not(.deep) .wz-aside{max-width:480px;}
#wizard .wz-settings-btn{align-self:flex-start;margin:0;}
#wizard .wz-action{position:static!important;margin:0;padding:16px 0 0;background:none;border-top:1px solid var(--ui-line);justify-content:flex-start;}
#wizard .wz-photos,#wizard .wz-titling,#wizard .wz-recipe{margin:0;}
#wizard .archive-head{display:flex;flex-wrap:wrap;align-items:center;gap:12px;margin-bottom:16px!important;}
#wizard .archive-head .k{flex-basis:100%;margin:0;}
#wizard input,#wizard select{background:var(--ui-key);color:var(--ui-ink);border:1px solid var(--ui-line);min-height:48px;}
#wizard .k,#wizard label,#wizard summary,#wizard .wz-preview__label,#preflight h2,#preflight .pf-list b,#preflight .pf-list li::before{color:var(--ui-ink);}
#wizard .binding-trigger,#wizard .binding-dropdown,#wizard .bd-item{background:var(--ui-key);color:var(--ui-ink);}
#wizard .wz-preview{background:none;color:var(--ui-muted);}
#wizard .wz-form [data-step]{display:block;}
.format-validation{border-left:3px solid var(--rf-red);padding:12px 16px;font:16px/1.5 var(--font-display);max-width:65ch;}
.format-validation[hidden]{display:none;}
.orientation-control{display:flex;flex-wrap:wrap;gap:8px;align-items:center;font:14px/1.4 var(--font-mono);}
.orientation-control select{min-height:48px;max-width:100%;padding:8px;background:var(--ui-key);color:var(--ui-ink);border:1px solid var(--ui-line);}
.desk-orientation{font-size:0;flex:0 0 auto;}
.desk-orientation select{max-width:150px;font-size:14px;}
#wzOrientation .field-explainer{margin-top:8px;}
/* Header controls are direct whenever measured space permits. */
.export-row{display:flex!important;align-items:center;flex-wrap:nowrap!important;}
body.direct-header-actions .export-extra,body.direct-header-actions .extra-panel{display:contents!important;}
body.direct-header-actions #extraToggle{display:none!important;}
body:not(.direct-header-actions) .export-extra{display:block!important;position:relative;}
body:not(.direct-header-actions) #extraToggle{display:inline-flex!important;}
body:not(.direct-header-actions) .extra-panel{display:none!important;position:fixed;left:var(--menu-x,8px);top:var(--menu-y,128px);right:auto;width:var(--menu-width,min(304px,calc(100vw - 16px)));max-width:calc(100vw - 16px);max-height:calc(100dvh - var(--menu-y,128px) - 8px);overflow:auto;padding:8px;gap:8px;border:1px solid var(--ui-line);background:var(--ui-panel);z-index:90;box-sizing:border-box;}
body:not(.direct-header-actions) .export-extra.open .extra-panel{display:flex!important;flex-direction:column;}
body:not(.direct-header-actions) .extra-panel button[data-action-size]{width:100%!important;flex:0 0 auto!important;min-height:48px!important;}
/* Pro tools wrap into coherent rows. No second, competing More menu is needed. */
#toolMoreBtn{display:none!important;}
body.pro .toolbar #toolViewGroup{display:flex!important;position:static!important;flex-wrap:wrap;inset:auto;width:auto;padding:0;background:none;border:0;}
.tools-col,.tools-col .tool-group{display:flex;flex-wrap:wrap;gap:8px;}
/* Read-only gallery navigation stays visible; bottom order is Edit — count — Exit. */
body.reading .canvas-area{padding:56px 60px 92px!important;}
body.reading #spread :is(.photo-el,.text-el,.shape-el,.draw-el){pointer-events:none;user-select:none;}
body.reading .desk-navigation,body.reading .handle-layer,body.reading .obj-commands{display:none!important;}
body.reading .read-hud{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);gap:12px;opacity:1;bottom:max(12px,env(safe-area-inset-bottom));max-width:calc(100vw - 24px);width:480px;box-sizing:border-box;padding:8px 12px;background:var(--ui-panel);border:1px solid var(--ui-line);color:var(--ui-ink);letter-spacing:0;}
body.reading .read-hud button{min-width:48px;min-height:48px;color:var(--ui-ink);font-size:14px;letter-spacing:0;white-space:normal;}
body.reading .read-hud .read-where{white-space:nowrap;display:block;font-size:14px;color:var(--ui-ink);letter-spacing:0;}
.read-arrows{display:none;}
body.reading .read-arrows{display:flex;position:fixed;inset:48px 8px 88px;justify-content:space-between;align-items:center;pointer-events:none;z-index:75;}
.read-arrows button{pointer-events:auto;width:48px;height:64px;background:none;border:0;display:flex;align-items:center;justify-content:center;}
.read-arrows button:disabled{opacity:.3;}
/* Bounded dialogues: fixed actions, scrolling content, equal peer actions. */
.compact-overlay{display:none;position:fixed;inset:0;z-index:200;background:#000a;padding:16px;box-sizing:border-box;align-items:center;justify-content:center;}
.compact-overlay.show{display:flex;}
.compact-card{width:min(100%,32rem);max-height:calc(100dvh - 32px);display:flex;flex-direction:column;gap:16px;box-sizing:border-box;padding:24px;background:var(--ui-panel);color:var(--ui-ink);border:1px solid var(--ui-line);}
.compact-card h2{font-size:24px;line-height:1.2;margin:0;}
.compact-message{overflow:auto;min-height:0;font:16px/1.5 var(--font-display);}
.compact-actions{display:flex;justify-content:flex-end;gap:8px;flex-wrap:wrap;flex-shrink:0;}
.compact-actions button{width:144px;max-width:100%;min-height:48px;flex:1 1 120px;white-space:normal;font-size:14px;}
#preflight .pf-card{max-width:38rem;margin:auto;}
#preflight h2{font-size:28px;}
#preflight .pf-list span,#preflight .pf-details{font:16px/1.5 var(--font-display);color:var(--ui-muted);}
#preflight .pf-list b{font-size:16px;}
#preflight .pf-actions{position:sticky;bottom:0;background:#0b0a0a;padding-block:16px;margin-top:16px;}
#preflight .pf-details p{margin-top:12px;}
/* Export preserves the summary; Customize is leading aligned. */
#destMoreBtn.dest-customize{align-self:flex-start!important;margin:12px 0!important;flex-shrink:0;}
.dest-foot-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:8px;}
.dest-foot-actions button{height:auto;min-height:48px;}
.dest-modal .dest-card{background:#0b0a0a;}
.dest-summary{color:var(--ui-ink);}
.dest-summary dt,.dest-sub,.dest-desc,.preflight-item{color:var(--ui-muted);}
.dest-summary dd{color:var(--ui-ink);}
@media(max-width:63.99rem){#wizard .wz-body{grid-template-columns:minmax(0,1fr);}#wizard .wz-aside{max-width:480px;}#wizard .wz-presets{grid-template-columns:repeat(2,minmax(0,1fr));}.dest-foot{gap:12px;}.dest-foot-actions{justify-content:flex-start;}.dest-foot-actions button[data-action-size]{width:144px!important;flex-basis:144px!important;}.dest-customize{align-self:flex-start!important;}}
@media(max-width:29rem){#wizard .wz-presets{grid-template-columns:minmax(0,1fr);}body.reading .read-hud{gap:4px;padding:4px 8px;}.read-hud button{padding:0!important;}#wizard .wizard-card,#wizard .wz-scroll{gap:20px;}.compact-card{padding:16px;}.export-bar{max-width:100%;}.export-row{justify-content:flex-start!important;}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;animation:none!important;transition:none!important;}}
.dest-foot-actions{flex-direction:row!important;align-items:center!important;}
.dest-foot{align-items:center!important;}
#destMoreBtn{white-space:normal!important;overflow:visible;}
#destMoreBtn .cta-label{white-space:normal;line-height:1.3;}
.dest-summary dl>div{padding-block:10px;}
.dest-summary dt,.dest-summary dd{font-size:14px;line-height:1.4;}
.dest-summary .dest-head{margin-bottom:12px;}
.binding-zone{position:absolute;top:0;bottom:0;background:repeating-linear-gradient(45deg,#ff51401a 0 2px,transparent 2px 6px);border-inline:1px dashed #c73e31;pointer-events:none;z-index:2;}
.clean-view .binding-zone{display:none;}

.paper-own{display:flex;}

.desk-orientation{font-size:14px;flex:0 0 144px;max-width:100%;}
.desk-orientation select{width:100%;}
body:not(.direct-header-actions) .extra-panel .desk-orientation{flex-basis:auto;width:100%;}
body.direct-header-actions .desk-orientation{gap:0;font-size:0;width:144px;}
body.compact-pro-tools.pro #toolMoreBtn{display:inline-flex!important;}
body.compact-pro-tools.pro .toolbar #toolViewGroup{display:none!important;}
body.compact-pro-tools.pro .toolbar.more-open #toolViewGroup{display:flex!important;flex-direction:column;position:fixed!important;top:var(--tools-y);left:var(--tools-x);width:var(--tools-width);max-height:calc(100dvh - var(--tools-y) - 8px);overflow:auto;padding:8px;border:1px solid var(--ui-line);background:var(--ui-panel);z-index:90;}
body.compact-pro-tools.pro #toolViewGroup button{width:100%!important;flex-basis:auto!important;}
@media(max-width:47.99rem){#app>header{display:grid!important;grid-template-columns:minmax(0,1fr) auto;gap:4px 8px;}#app>header>div:first-child{grid-column:1;grid-row:1;}#app>header .header-actions{grid-column:2;grid-row:1;}#app>header .export-bar{grid-column:1/-1;grid-row:2;}#app>header .fmt-line{min-height:48px;align-items:center;}.fmt-summary{font-size:12px;}.export-row{justify-content:flex-end!important;}}
/* Width is not a flex basis: the same control can live in a row or a column. */
button[data-action-size]{flex:0 0 auto!important;}
.toolbar .tools-col{flex-direction:row!important;align-items:flex-start;align-content:flex-start;flex-wrap:wrap!important;height:auto;}
.toolbar .tool-group,body.pro .toolbar #toolViewGroup{flex-direction:row!important;align-items:flex-start;align-content:flex-start;flex:0 1 auto;margin:0;padding:0;border:0;gap:8px;}
body.compact-pro-tools.pro .toolbar.more-open #toolViewGroup{flex-direction:column!important;}
body.reading #app>header,body.reading #app .toolbar,body.reading #app .photo-strip,body.reading #app .spreads-strip,body.reading #app .sel-param-row,body.reading #toast{display:none!important;}
body.reading #app{grid-template-columns:minmax(0,1fr)!important;grid-template-rows:minmax(0,1fr)!important;grid-template-areas:'canvas'!important;}
body.reading #app .canvas-wrap{padding:0!important;}
.toast{height:max-content!important;width:max-content;max-width:min(32rem,calc(100vw - 24px));max-height:min(12rem,40dvh);overflow:auto;font-size:14px;line-height:1.5;letter-spacing:0;text-transform:none;box-sizing:border-box;}
#wizard .wz-preview{display:block;}
#wizard .wz-presets{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));}
#wizard .wz-preset{width:100%;height:auto;}
#wizard .wz-sec-k::before{content:none;}

.pdf-preview-top{display:flex;flex-wrap:wrap;gap:8px;align-items:center;}
.pdf-preview-top button{flex-shrink:0;}
:is(.margins-panel,.bleed-panel,.side-sheet) button{min-width:48px;}
@media(min-width:64rem){#wizard .wz-presets{grid-template-columns:repeat(4,minmax(0,1fr));}}
@media(max-width:29rem){:root{--action-primary-width:160px;--action-secondary-width:128px;}#wizard .wz-presets{grid-template-columns:minmax(0,1fr);}.pdf-preview-head{flex-wrap:wrap;gap:8px;}.pdf-preview-head button[data-action-size]{width:128px!important;}.dest-foot{align-items:center!important;}.dest-foot-actions{width:144px;}}
[hidden],button[data-action-size][hidden]{display:none!important;}
body.clean-view .safe-zone,body.clean-view .trim-hatch,body.clean-view .trim-mark,body.clean-view .page-notes,body.clean-view .bleed-edge,body.clean-view .spine-edge,body.clean-view .spine-label,body.clean-view .gutter-line,body.reading .empty-canvas-hint,body.reading .cover-photo-prompt{display:none!important;}
#wizard .cover-preview-page{background:#eceae4;color:#161615;}
.pdf-preview-head{flex-wrap:wrap;gap:8px;}
@media (max-height:30rem){#app .canvas-wrap{padding-block:8px;}body.pro #app .canvas-area{padding-block:8px;}}
/* Selecting artwork must never move it under the pointer. */
#app .canvas-wrap,#app:has(.photo-el.selected,.text-el.selected,.shape-el.selected) .canvas-wrap{padding-bottom:76px;}
@media(max-height:30rem){#app .canvas-wrap,#app:has(.photo-el.selected,.text-el.selected,.shape-el.selected) .canvas-wrap{padding-bottom:20px;}}
.fmt-num{min-height:48px!important;font-size:12px!important;}
#wizard .wz-field[data-step] .k::before{display:none;content:none;}
#preflight .pf-list{list-style:decimal;padding-left:24px;}
#preflight .pf-list li{padding-left:4px;}
#preflight .pf-list li::before{display:none;content:none;}

/* Page-strip movement is immediate: animation must not expose clipped thumbnails. */
.pg-strip{transition:none!important;}
/* Section-local hierarchy: choices/preview lead, configuration/support follows. */
#wizard .wz-body{display:grid!important;grid-template-columns:minmax(0,1fr)!important;align-items:start;gap:32px;}
#wizard .wz-primary,#wizard .wz-support,#wizard .wz-aside{display:flex;flex-direction:column;align-items:stretch;gap:24px;min-width:0;max-width:none!important;}
#wizard .wz-primary .wz-presets{grid-template-columns:repeat(2,minmax(0,1fr));}
#wizard .wz-preset{min-height:96px;align-items:flex-start;}
#wizard .wz-aside .wz-preview{max-width:none;}
#wizard .wz-preview__stage{justify-content:center;min-height:160px;}
#wizard .wz-preview__meta{font-size:14px;line-height:1.65;overflow-wrap:anywhere;}
#wizard .wz-form{display:flex!important;flex-direction:column;grid-column:1/-1;gap:24px;}
#wizard .wizard-card:not(.deep) .wz-form{display:none!important;}
#wizard .wz-brief{display:flex;flex-direction:column;gap:12px;min-width:0;margin:0;padding:0;border:0;}
#wizard .wz-action{position:static!important;inset:auto!important;transform:none!important;display:flex;justify-content:center!important;align-items:center;gap:16px;background:none!important;margin:0;padding:24px 0!important;border-top:1px solid var(--ui-line);width:100%;}
#wizard .wz-action #startBtn{position:static!important;flex:0 0 auto!important;}
.home-print-config{display:flex;flex-direction:column;gap:16px;min-width:0;}
.home-print-config label{display:flex;flex-direction:column;gap:8px;font-size:14px;line-height:1.4;}
.home-print-config select,.home-print-config input{width:100%;max-width:100%;box-sizing:border-box;min-width:0;}
.home-print-config p,.section-support{font-size:14px;line-height:1.6;color:var(--ui-muted);margin:0;overflow-wrap:anywhere;}
.home-print-values{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;}
.home-print-config .home-borderless{flex-direction:row;align-items:center;gap:12px;}
.home-borderless input{width:24px!important;height:24px!important;min-height:24px!important;flex:0 0 24px;}
#homeFitPages{align-self:flex-start;}
#homeSheetDiagram svg{display:block;width:100%;max-height:250px;}
#wizard .section-split{display:grid;grid-template-columns:minmax(0,1fr);gap:24px;align-items:start;}
.section-main,.section-support{min-width:0;display:flex;flex-direction:column;gap:16px;}
#wizard .archive-head{margin-bottom:0!important;}
#wizard .wz-t-field{margin:0;}
#wizard .wz-t-note{margin:0;}
@media(min-width:60rem){#wizard .wz-body,#wizard .section-split{grid-template-columns:minmax(380px,1.35fr) minmax(320px,1fr)!important;}#wizard .wz-primary .wz-presets{grid-template-columns:repeat(2,minmax(0,1fr));}#wizard .wz-support{align-self:start;}}
@media(max-width:29rem){#wizard .wz-primary .wz-presets{grid-template-columns:minmax(0,1fr);}.home-print-values{grid-template-columns:minmax(0,1fr);}#wizard .wz-preset{min-height:96px;}}
.dest-physical-summary{font-size:14px;line-height:1.5;color:var(--ui-muted);margin:16px 0 0;}
@media(max-width:59.99rem){.dest-modal .dest-body{display:block!important;overflow-y:auto!important;min-height:0;}.dest-modal .dest-picks{display:block!important;overflow:visible!important;}.dest-modal .dest-side{display:block!important;margin-top:24px;}.dest-modal .dest-summary,.dest-modal .dest-customize{order:initial;}.dest-modal .dest-more{overflow:visible!important;}.dest-modal.more-open .dest-picks{display:block!important;}.dest-modal .dest-summary dl{grid-template-columns:repeat(2,minmax(0,1fr));}}
@media(min-width:60rem){.dest-modal .dest-body{display:grid!important;grid-template-columns:minmax(380px,1.35fr) minmax(320px,1fr);align-items:start;}.dest-modal .dest-side{display:flex!important;flex-direction:column;}.dest-modal .dest-summary{order:initial;}.dest-modal .dest-picks{display:block!important;}}
.home-print-calculations{display:flex;flex-direction:column;gap:16px;min-width:0;}
#wizard .wz-form>.section-split{display:grid!important;padding:24px 0 0;border-top:1px solid var(--ui-line);gap:24px 32px;}
#wizard .wz-form .wz-field{padding:0;margin:0!important;}
#wizard .wz-form .section-main>.k{margin:0;}
#wizard .wz-form .section-support{font-size:14px;line-height:1.6;}
#wizard .wz-form .binding-note-slot,#wizard .wz-form .binding-guides{margin:0;}
#wizard .wz-form .binding-note{padding:0;border:0;font-size:14px;}
#wizard .wz-form .field-explainer,#wizard .wz-form .pages-hint{margin:0;font-size:14px;line-height:1.6;}
#wizard .wz-form .wz-options{min-height:0!important;gap:8px;}
#wizard .wz-form .wz-options button{min-height:48px;font-size:14px;padding:10px 16px;letter-spacing:.025em;}
#wizard .wz-form #bindingTriggerSub{white-space:normal;}
#wizard .wz-form .wz-advanced__body{margin:0;}
#wizard .wz-form #wzOrientation{padding:0;}
#wizard .wz-form .home-print-advanced{padding-bottom:0;border-bottom:0;}
.home-print-advanced label{font-size:14px;line-height:1.4;}
.home-print-advanced{padding-bottom:24px;border-bottom:1px solid var(--ui-line);}
.home-print-values label{display:grid!important;grid-template-rows:auto minmax(48px,auto);align-content:start;gap:8px;}
.home-print-advanced .home-borderless{display:flex;align-items:center;gap:12px;font-size:14px;}
.home-print-guide{font-size:14px;line-height:1.6;color:var(--ui-muted);}
.home-print-guide summary{cursor:pointer;min-height:48px;display:flex;align-items:center;color:var(--ui-ink);}
.home-print-guide p{margin:8px 0 0;}
#wizard .wz-brief p{font-size:14px;line-height:1.6;margin:0;color:var(--ui-muted);}

#destAssemblyDetails summary{font-size:14px;line-height:1.5;min-height:48px;}
#destAssemblyDetails p{font-size:14px;line-height:1.6;margin:8px 0 0;overflow-wrap:anywhere;}

.toast:not(.show){visibility:hidden;pointer-events:none;}

/* Thumbnail rails must not stretch or shrink when no device-specific mode applies. */
@media(max-width:63.99rem){.photo-strip{flex-direction:column;}.photo-strip .thumb,.photo-strip .add-thumb{flex:0 0 auto;width:100%;height:auto;aspect-ratio:1;}}
.text-el::before{content:'';position:absolute;inset:-6px;cursor:inherit;}
.text-el.editing::before{display:none;}

/* A hidden conditional helper must not leave an empty slot in a flex/grid group. */
#wizard .section-support:empty{display:none;}
#wizard .home-print-advanced .section-main>button{align-self:flex-start;}

#wizard .wz-body>.wz-settings-btn{grid-column:1/-1;justify-self:start;}

#wizard .wz-form>.section-split[hidden]{display:none!important;}

/* Share label/input tracks so wrapped labels never stagger the numeric fields. */
@supports(grid-template-rows:subgrid){.home-print-values label{grid-row:span 2;grid-template-rows:subgrid;}}

/* Forward actions: one persistent surface, one text/arrow interaction. */
button.action-forward,button.action-forward:hover,button.action-forward:focus-visible,button.action-forward:active{display:inline-flex!important;align-items:center;justify-content:center;gap:12px;background:var(--rf-red)!important;border:1px solid var(--rf-red)!important;color:#fff!important;opacity:1!important;filter:none!important;box-shadow:none!important;transform:none!important;visibility:visible;}
button.action-forward .cta-label{color:inherit!important;animation:none!important;}
button.action-forward>.tri{position:static!important;inset:auto!important;opacity:.5;border-left-color:currentColor!important;animation:none!important;filter:none;transition:opacity .15s,filter .15s;}
button.action-forward:not(:disabled):is(:hover,:focus-visible,:active){color:#0b0b0b!important;}
button.action-forward:not(:disabled):is(:hover,:focus-visible,:active)>.tri{opacity:1;filter:drop-shadow(0 0 4px currentColor);}
button.action-forward:disabled{background:var(--ui-key)!important;border-color:var(--ui-line)!important;color:var(--ui-muted)!important;}
#wizard .wz-preset{min-height:80px;gap:10px;padding:12px;align-items:flex-start;border-width:1px;box-shadow:none;}
#wizard .wz-preset>span{display:flex;flex-direction:column;gap:4px;align-items:flex-start;}
#wizard .wz-preset b,#wizard .wz-preset em{margin:0;}
#wizard .wz-preset i{width:24px!important;height:34px!important;margin-top:2px;}
#wizard .wz-preset[data-size="sq148"] i{height:24px!important;}
#wizard .wz-preset[data-binding="folded"] i{width:20px!important;height:28px!important;}
#wizard .wz-preset.sel{border-color:var(--rf-red);}
.section-number{color:var(--rf-red);font:inherit;}
.fmt-num,.fmt-num:hover,.fmt-num:focus-visible{border-bottom:0!important;text-decoration:none!important;}
.fmt-num:hover,.fmt-num:focus-visible{font-weight:700;}
/* Paint the whole interface neutrally without a body filter changing fixed positioning. */
body.mono-doc{--rf-red:#c8c8c8;--rf-yellow:#b8b8b8;--ui-ink:#ececec;--ui-muted:#b0b0b0;--ui-line:#555;--ui-panel:#171717;--ui-key:#303030;--op-ink:#ececec;--op-dim:#b0b0b0;--op-panel:#171717;--op-key:#303030;--op-key-up:#404040;--op-line:#555;--arrow-active:#ececec;--arrow-idle:#888;}
body.mono-doc :is(button,input,textarea,select,.k,.section-number,.field-explainer,.pages-hint,.wz-preview__meta,.dest-summary,.preflight,.toast,.read-hud,.cover-preview-page,.viewer img,.home-print-guide svg,#homeSheetDiagram){filter:grayscale(1);}
body.mono-doc :is(#wizard,#preflight){--op-ink:var(--ui-ink);--op-dim:var(--ui-muted);--op-key:var(--ui-key);--op-line:var(--ui-line);}
body.mono-doc button.action-forward{background:#757575!important;border-color:#757575!important;}
/* One bounded export scroller. The footer remains outside its scrolling body. */
.dest-modal.show{padding:0!important;overflow:hidden!important;align-items:stretch;}
.dest-modal .dest-card{width:100%;max-width:none;height:100%;max-height:100%;margin:0;min-height:0;display:flex;flex-direction:column;box-sizing:border-box;overflow:hidden;padding:24px clamp(16px,5vw,72px);}
.dest-modal .dest-top,.dest-modal .dest-foot{flex:0 0 auto;}
.dest-modal .dest-body{flex:1 1 0;min-height:0;overflow-y:auto!important;overscroll-behavior:contain;touch-action:pan-y;grid-auto-rows:max-content!important;align-items:start;padding-block:24px;scrollbar-gutter:stable;}
.dest-modal :is(.dest-picks,.dest-side,.dest-more){min-height:auto!important;overflow:visible!important;}
.dest-modal .dest-foot{position:static;margin-top:0;padding-block:16px 0;}
@media(min-width:60rem){.dest-modal .dest-side{position:sticky;top:0;align-self:start;max-height:none;} .dest-modal.more-open .dest-side{position:static;}}
@media(max-height:32rem){.dest-modal .dest-card{padding-block:8px;}.dest-modal .dest-body{padding-block:12px;}.dest-modal .dest-foot{padding-top:8px;}.dest-modal .dest-sub{display:none;}}
/* Native semantics, product-drawn checkboxes, sliders and select menus. */
input[type=number]{-moz-appearance:textfield;appearance:textfield;}
input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0;}
input[type=checkbox]:not(.bp-switch input){appearance:none;-webkit-appearance:none;width:22px!important;height:22px!important;min-height:22px!important;border:1px solid var(--ui-line);border-radius:0;background:var(--ui-key);display:inline-grid;place-items:center;margin:0;flex:0 0 22px;}
input[type=checkbox]:not(.bp-switch input)::before{content:'';width:6px;height:11px;border:solid var(--ui-ink);border-width:0 2px 2px 0;transform:rotate(45deg) scale(0);margin-top:-3px;}
input[type=checkbox]:not(.bp-switch input):checked{border-color:var(--rf-red);background:var(--rf-red);}
input[type=checkbox]:not(.bp-switch input):checked::before{transform:rotate(45deg) scale(1);border-color:#0b0b0b;}
input[type=range]{appearance:none;-webkit-appearance:none;background:transparent;border:0!important;min-height:48px;}
input[type=range]::-webkit-slider-runnable-track{height:2px;background:var(--ui-line);}
input[type=range]::-webkit-slider-thumb{appearance:none;-webkit-appearance:none;width:14px;height:22px;background:var(--rf-red);border:0;border-radius:0;margin-top:-10px;}
input[type=range]::-moz-range-track{height:2px;background:var(--ui-line);}
input[type=range]::-moz-range-thumb{width:14px;height:22px;background:var(--rf-red);border:0;border-radius:0;}
.ctrl-select{position:relative;display:inline-flex;align-items:stretch;min-width:0;width:100%;max-width:100%;}
.ctrl-select>select{position:absolute!important;inset:0!important;width:100%!important;height:100%!important;opacity:0;pointer-events:none;min-width:0;}
.ctrl-select-trigger{width:100%;min-width:0;min-height:48px;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 12px;background:var(--ui-key);color:var(--ui-ink);border:1px solid var(--ui-line);border-radius:0;font:14px/1.4 var(--font-body);text-align:left;box-sizing:border-box;}
.ctrl-select-trigger .ctrl-select-value{min-width:0;overflow-wrap:anywhere;}
.ctrl-select-trigger .tri{border-top-color:var(--ui-muted);}
.ctrl-select-trigger[aria-expanded=true]{border-color:var(--rf-red);}
.ctrl-select-trigger[aria-expanded=true] .tri{border-top-color:var(--rf-red);}
.ctrl-select-trigger:disabled{opacity:.5;}
.ctrl-select-popup{position:fixed;z-index:240;display:flex;flex-direction:column;box-sizing:border-box;padding:4px;background:var(--ui-panel);color:var(--ui-ink);border:1px solid var(--ui-line);overflow-y:auto;overscroll-behavior:contain;touch-action:pan-y;box-shadow:0 12px 28px #0008;}
.ctrl-select-option{display:flex;align-items:center;gap:12px;flex:0 0 auto;min-height:48px;box-sizing:border-box;padding:10px 12px;font:14px/1.4 var(--font-body);overflow-wrap:anywhere;cursor:pointer;}
.ctrl-select-option::before{content:'';width:6px;height:6px;flex:0 0 6px;background:transparent;}
.ctrl-select-option[aria-selected=true]::before{background:var(--rf-red);}
.ctrl-select-option.is-active{background:var(--ui-key);}

#wizard .section-main>.wz-t-field,#wizard .section-main>.wz-titling-heading{flex:0 0 auto;}
button.action-forward{transition:color .15s ease!important;}
body.mono-doc svg{filter:grayscale(1);}

.dest-modal .dest-foot-actions{width:auto;}
@media(max-width:22rem){:root{--action-primary-width:144px;--action-secondary-width:128px;}}

.dest-modal .preflight{max-height:none;overflow:visible;}

body.mono-doc:not(.paper-dark) :is(.page,.cover-preview-page){background:#e9e9e9!important;}

.home-borderless{min-height:48px;}
.home-borderless input{position:relative;}
.home-borderless input::after{content:"";position:absolute;width:48px;height:48px;left:50%;top:50%;transform:translate(-50%,-50%);}
body.mono-doc{--white:#0b0b0b;--black:#e9e9e9;--mid:#888;--hairline:#242424;--rf-red-glow:#aaa;--rf-red-glow-45:rgba(200,200,200,.45);--rf-red-glow-65:rgba(200,200,200,.65);--rf-red-glow-70:rgba(200,200,200,.7);--rf-red-glow-75:rgba(200,200,200,.75);}
body.mono-doc label{filter:grayscale(1);}

/* Presets share two metadata tracks; no reserved empty card area. */
#wizard .wz-presets{align-items:start;}
#wizard .wz-preset b{font-size:16px;line-height:1.3;}
#wizard .wz-preset em{font-size:14px;line-height:1.4;}
#wizard .preset-line{display:block;}

/* A shared label track aligns the first preset with the print-stock field. */
#wizard .wz-primary{gap:8px;}
#wizard .wz-primary>.wz-sec-k{margin:0;min-height:20px;line-height:20px;}
#wizard .wz-primary>.wz-aside{margin-top:16px;}
#homePrintConfig>label:first-child{line-height:20px;gap:8px;}
#wizard .wz-preset b{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 8px;}
#wizard .preset-changed{display:inline;font:12px/1.3 var(--font-mono);margin:0;color:var(--ui-muted);}
#wizard .preset-changed[hidden]{display:none;}
/* Photos: actions and their help share a row; the archive owns the full next row. */
#wizard #wzStepPhotos{row-gap:16px;}
#wizard #wzStepPhotos>.section-main{gap:0;}
#wizard #wzStepPhotos .archive-head{display:flex;flex-direction:column;align-items:stretch;gap:8px;}
#wizard #wzStepPhotos #archiveCount{min-height:20px;line-height:20px;}
#wizard .archive-actions{display:flex;flex-wrap:wrap;align-items:center;gap:8px;}
#wizard .archive-actions .wz-reorder{margin:0;}
#wizard #wzStepPhotos>.section-support{padding-top:28px;}
#wizard #wzPhotoNote{margin:0;font-size:14px;line-height:1.6;max-width:48ch;}
#wizard #wzStepPhotos>#archiveGrid{grid-column:1/-1;margin:0;}
#wizard #wzStepPhotos>#archiveGrid:empty{display:none;}
@media(max-width:59.99rem){#wizard #wzStepPhotos>.section-support{padding-top:0;}}

/* Project entry belongs with format; cover choice belongs with its preview. */
#wizard .wz-heading-row{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px 24px;}
#wizard .wz-heading-row h2{margin:0;}
#wizard .wz-project-actions{margin:0;}
#wizard .wz-project-actions:empty{display:none;}
#wizard #wzChooseCover{display:flex;margin:16px auto;justify-content:center;}
.cover-preview-titling{background:transparent!important;}
/* Compact secondary actions operate only on the selected photo. */
#objCommands{max-width:calc(100vw - 24px);flex-wrap:wrap;gap:8px;}
#objCommands :is(#photoFitBtn,#photoFillBtn){width:72px;min-height:48px;flex:0 0 72px;padding:8px 10px;font:14px/1.3 var(--font-mono);border:1px solid var(--ui-line);background:var(--ui-key);color:var(--ui-ink);}
#objCommands :is(#photoFitBtn,#photoFillBtn)[aria-pressed=true]{border-color:var(--rf-red);}
#objCommands :is(#photoFitBtn,#photoFillBtn)::after{content:none;}
/* Page rail and primary completion action share the bottom navigation region. */
.desk-footer{grid-area:nav;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:16px;align-items:center;min-width:0;padding:8px 12px;background:var(--white);}
.desk-footer>.spreads-strip{grid-area:auto;min-width:0;width:100%;padding:0!important;}
.desk-footer>#exportBtn{justify-self:end;}
body.reading .desk-footer{display:none!important;}
body.reading .read-current{color:var(--rf-red);}
body.reading-from-editor .read-hud{grid-template-columns:minmax(48px,1fr) auto minmax(48px,1fr);}
#readExit[hidden]{display:none!important;}
@media(max-width:47.99rem){.desk-footer{grid-template-columns:minmax(0,1fr);gap:4px;padding:4px 8px;}.desk-footer>#exportBtn{grid-column:1;}}
