/* Screen-only studio skin. Physical sheet geometry and print rules stay in styles.css. */
/* OD-LAYOUT-PRIMITIVES v1 — structure only */
@layer od-layout {
 :where(.od-stack,.od-row,.od-row-top,.od-cluster,.od-grid,.od-field,.od-stat,.od-cell,.od-tile)>*{min-width:0}
 .od-stack{display:flex;flex-direction:column;gap:var(--od-gap,8px)}
 .od-row,.od-row-top,.od-cluster{display:flex;gap:var(--od-gap,8px)}
 .od-row,.od-cluster{align-items:center}.od-row-top{align-items:flex-start}.od-cluster{flex-wrap:wrap}
 .od-fill{flex:1 1 0;min-width:0}.od-fixed{flex:none}
 .od-grid{display:grid;gap:var(--od-gap,12px);grid-template-columns:repeat(var(--od-cols,3),minmax(0,1fr))}
 .od-stat,.od-field,.od-cell{display:grid;gap:var(--od-gap,2px)}
 :where(.od-stat,.od-field,.od-cell,.od-tile)>*{display:block}
 .od-tile{display:grid;grid-template-rows:auto 1fr}
 .od-media{display:block;width:100%;height:auto;aspect-ratio:var(--od-ratio,auto)}.od-media-cover{object-fit:cover}
 .od-icon{display:inline-block;inline-size:var(--od-icon-size,1em);block-size:var(--od-icon-size,1em);flex:none;vertical-align:middle}
 .od-truncate{display:block;max-width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
 .od-clamp-2,.od-clamp-3{display:-webkit-box;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere}.od-clamp-2{-webkit-line-clamp:2}.od-clamp-3{-webkit-line-clamp:3}
 .od-lines-2{min-height:calc(2 * 1.4em)}.od-nowrap{white-space:nowrap}.od-keep{word-break:keep-all;overflow-wrap:anywhere}
 .od-screen{display:grid;grid-template-rows:auto minmax(0,1fr) auto;height:100%}.od-scroll{overflow-y:auto;overscroll-behavior:contain;min-height:0}
 .od-rail{display:flex;gap:var(--od-gap,8px);overflow-x:auto;scroll-snap-type:x proximity;scrollbar-width:none;padding-inline:var(--od-rail-pad,16px);scroll-padding-inline:var(--od-rail-pad,16px)}.od-rail::-webkit-scrollbar{display:none}.od-rail>*{flex:none;scroll-snap-align:start}.od-rail>:last-child{margin-inline-end:var(--od-rail-pad,16px)}
 .od-spacer{flex:none;visibility:hidden;pointer-events:none}.od-touch{min-width:44px;min-height:44px}
}
/* /OD-LAYOUT-PRIMITIVES v1 */
:root{
 --bg:#e3e9e5;--surface:#fbfcfa;--surface-warm:#eef2ee;--fg:#24362f;--fg-2:#3d5148;--muted:#596b62;--meta:#596b62;--border:#c7d3ca;--border-soft:#e5ece6;--sidebar:#dce6dd;--selected:#cbdccd;
 --accent:#315d4c;--accent-on:#ffffff;--accent-hover:#274b3d;--accent-active:#203f33;--success:#315d4c;--warn:#735322;--danger:#923d32;
 --font-display:Georgia,'Times New Roman',serif;--font-body:'Helvetica Neue',Helvetica,Arial,sans-serif;--font-mono:'SF Mono',ui-monospace,Menlo,monospace;
 --text-xs:12px;--text-sm:14px;--text-base:16px;--text-lg:18px;--text-xl:24px;--text-2xl:36px;--text-3xl:54px;--text-4xl:76px;
 --leading-body:1.55;--leading-tight:1.12;--tracking-display:-.025em;
 --space-1:4px;--space-2:8px;--space-3:12px;--space-4:16px;--space-5:20px;--space-6:24px;--space-8:32px;--space-12:48px;
 --section-y-desktop:96px;--section-y-tablet:68px;--section-y-phone:48px;
 --radius-sm:10px;--radius-md:16px;--radius-lg:20px;--radius-pill:9999px;
 --elev-flat:none;--elev-ring:0 0 0 1px var(--border);--elev-raised:0 8px 24px rgb(21 20 15 / .08);--focus-ring:0 0 0 3px rgb(110 116 72 / .3);
 --motion-fast:150ms;--motion-base:240ms;--ease-standard:cubic-bezier(.2,0,0,1);--container-max:1180px;--container-gutter-desktop:36px;--container-gutter-tablet:24px;--container-gutter-phone:16px;
 --ink:var(--fg);--line:var(--border);--accent-dark:var(--accent-hover);--purple-wash:var(--surface-warm);--green:var(--success);--shadow:none;--od-icon-size:18px;--coral:var(--accent);
 color:var(--fg);font-family:var(--font-body);font-synthesis:none;
}
html{background:var(--bg)}body{min-width:0;background:var(--bg);color:var(--fg);font:var(--text-base)/var(--leading-body) var(--font-body)}
button,input,select{font-family:var(--font-body)}button{cursor:pointer}button:disabled{cursor:not-allowed}button:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible,[tabindex]:focus-visible{outline:2px solid var(--success);outline-offset:3px;box-shadow:none}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
.topbar{height:auto;min-height:88px;padding:16px 28px;gap:24px;border-bottom:1px solid var(--ink);background:var(--surface)}
.brand{gap:12px;min-width:0}.brand-mark{width:44px;height:44px;border-radius:50%;background:var(--ink);color:var(--surface);--od-icon-size:24px}
.brand strong{font:500 28px/1.1 var(--font-display);letter-spacing:-1px}.brand small{font:10px/1.5 var(--font-mono);letter-spacing:.14em;color:var(--muted);margin-top:6px}
.studio-note{font-size:12px;color:var(--muted);position:relative}.studio-note summary{cursor:pointer;font-size:11px}.studio-note p{max-width:50ch;margin:8px 0 0}.brand:has(.studio-note[open]){align-items:flex-start}
.top-actions{gap:12px;flex-wrap:wrap;justify-content:flex-end}.save-state{color:var(--muted);font:11px/1.5 var(--font-mono);margin:0}.save-state i,.green-dot,.live-crop-label i{background:var(--success)}
.button,.cloud-sync-button,.area-zoom-button{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;border-radius:var(--radius-sm);padding:10px 16px;font:600 13px/1.3 var(--font-body);box-shadow:none;transition:background var(--motion-fast),transform var(--motion-fast)}
.topbar .print-button{min-height:44px;padding:12px 20px;min-width:140px}.primary{background:var(--accent);color:var(--accent-on);box-shadow:none}.primary:hover:not(:disabled){background:var(--accent-hover);box-shadow:none}.quiet{background:var(--surface-warm);color:var(--fg-2)}.outline,.cloud-sync-button,.area-zoom-button{background:transparent;border:1px solid var(--border);color:var(--fg)}
.button:disabled{opacity:.4}.text-button{color:var(--ink);font:600 12px/1.5 var(--font-body);text-underline-offset:4px;padding:8px 4px;min-height:40px}
.workspace{height:calc(100dvh - 116px);min-height:720px;padding:24px;gap:0}
.panel{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-md);box-shadow:none}
.left-panel,.right-panel{padding:20px}.center-panel{gap:16px}.section-heading,.panel-title{gap:12px;align-items:flex-start}
.eyebrow,.mini-label,.tool-group label,.field-label{font:500 10px/1.5 var(--font-mono);letter-spacing:.12em;color:var(--muted)}
.section-heading h2,.panel-title h2,.modal-header h2{font:400 24px/1.2 var(--font-display);letter-spacing:-.5px;margin-top:8px}
.section-heading .eyebrow::before{content:'I / ';color:var(--muted)}.crop-panel>.panel-title .eyebrow::before{content:'II / '}.preview-title .eyebrow::before{content:'III / '}
.section-heading{padding-bottom:16px;margin:0 0 20px;border-bottom:1px solid var(--border)}
.icon-button{display:inline-grid;place-items:center;width:40px;height:40px;min-width:40px;border-radius:4px;background:var(--surface-warm);color:var(--fg)}
.drop-zone{border-color:var(--muted);background:var(--surface-warm);border-radius:4px;min-height:184px;gap:4px}.upload-icon{width:40px;height:40px;background:transparent;color:var(--ink);--od-icon-size:24px}.drop-zone strong{font-size:14px}.drop-zone span{font-size:13px;color:var(--muted)}.drop-zone small{color:var(--muted);font:10px/1.6 var(--font-mono);margin-top:8px}.drop-zone.dragging{background:var(--bg);border-color:var(--ink)}
.empty-note{font-size:13px;color:var(--muted);padding:24px 8px;line-height:1.65}.library-footer{font:11px/1.5 var(--font-mono);color:var(--muted);border-color:var(--border);padding-top:16px}
.photo-card{padding:8px;border-radius:4px;gap:12px}.photo-card.selected{background:var(--bg);border-color:var(--muted)}.photo-thumb{border-radius:2px}.photo-meta strong{font-size:13px;color:var(--ink)}.photo-meta small{color:var(--muted);font:10px/1.6 var(--font-mono)}.photo-remove{color:var(--muted);min-width:32px;min-height:40px}.photo-assignment-hint{font-size:12px;line-height:1.6;color:var(--muted)}
.toolbar{padding:16px;gap:12px;background:var(--surface)}.tool-group{gap:8px}.tool-group select{font:600 13px/1.5 var(--font-body);min-height:36px;color:var(--ink)}
.toolbar .button,.toolbar .background-actions .button{min-height:40px;font-size:12px;padding:8px}.zoom-control{color:var(--muted)}.zoom-control b{font:11px var(--font-mono);min-width:40px}input[type=range]{accent-color:var(--ink)}
.crop-panel{padding:20px}.crop-panel>.panel-title{flex-wrap:wrap;margin-bottom:20px}.keyboard-hint{font-size:11px;line-height:1.6;color:var(--muted);text-align:left;max-width:42ch}
.crop-stage{background:var(--surface-warm);border:1px solid var(--border);border-radius:4px;min-height:340px}.crop-panel.empty{flex:1}.crop-panel.empty .crop-stage{flex:1;height:auto;min-height:340px}
.crop-empty{color:var(--muted);gap:8px;padding:24px}.crop-empty strong{font:400 22px/1.3 var(--font-display);color:var(--fg)}.crop-empty span{font-size:13px}.empty-photo-icon{font-size:32px;background:none;border:0;color:var(--muted);--od-icon-size:40px}
.crop-footer{flex-wrap:wrap;gap:12px;padding-top:16px;color:var(--muted);font:11px/1.5 var(--font-mono)}.live-crop-label,.face-status{font-size:11px;color:var(--muted)}.face-status[data-state=detecting]{color:var(--muted)}.face-status[data-state=detected]{color:var(--success)}
.crop-badge{background:var(--ink);color:var(--surface)}
.layout-actions-row{grid-template-columns:minmax(0,1fr);gap:12px}.layout-actions-row .template-current{padding:12px 16px;border:1px solid var(--border);background:var(--surface);border-radius:4px;gap:12px}.layout-actions-row .template-current strong{font-size:13px;white-space:normal;overflow:visible;text-overflow:clip;overflow-wrap:anywhere;line-height:1.5}.template-actions .button,.layout-actions-row .template-actions .button{min-height:44px;font-size:12px;padding:10px 16px}.below-hint{font-size:12px;line-height:1.65;color:var(--muted);align-items:flex-start}.tip-icon{color:var(--muted);display:block;flex:none}
.right-panel{background:var(--surface)}.preview-title{gap:16px;padding-bottom:16px;border-bottom:1px solid var(--border)}.preview-title>.od-field::after{content:'The final impression';display:block;font:400 24px/1.2 var(--font-display);margin-top:8px;color:var(--fg)}
.preview-controls{flex-wrap:wrap;gap:8px}.preview-controls>.sheet-zoom-bar{flex:1 1 220px;gap:8px;min-height:40px}.preview-title .sheet-zoom-bar>span{font:9px/1.5 var(--font-mono);color:var(--muted)}.sheet-zoom-bar strong{font:11px var(--font-mono);color:var(--ink)}.preview-title .sheet-zoom-bar .zoom-step,.zoom-step{display:inline-grid;place-items:center;width:32px;height:36px;background:var(--surface);color:var(--ink);border:1px solid var(--border);border-radius:4px}.area-zoom-button{min-height:36px;font-size:11px;padding:8px 12px}
.sheet-wrap{margin-top:16px;padding:12px;border:1px solid var(--border);border-radius:4px;background:var(--border);min-height:400px}.sheet-zoom-stage{padding:24px}.sheet{box-shadow:0 8px 24px rgb(21 20 15 / .12)}
.sheet-stats{font:10px/1.6 var(--font-mono);color:var(--muted);flex-wrap:wrap;gap:8px;padding-block:16px}.printer-note{font-size:12px;line-height:1.6;color:var(--muted);padding-top:16px;border-color:var(--border)}.printer-note b{color:var(--fg)}.printer-note>span:first-child{flex:none}
/* Sheet placeholders change visually; dimensions, image crops, and name-tag type remain application-owned. */
.photo-slot:not(.name-tag-slot),.photo-image-frame,.name-tag-photo{background:var(--surface-warm);border-color:var(--muted);color:var(--muted)}.mini-slot,.tile-art,.custom-photo-area{background:var(--border);border-color:var(--muted);color:var(--fg)}.custom-box:not(.has-name-tag){background:var(--border);border-color:var(--muted);color:var(--fg)}.custom-box.selected,.custom-box.has-name-tag.selected,.photo-slot.live-selected{outline-color:var(--success)}
.modal{background:var(--surface);border:1px solid var(--border);border-radius:8px;box-shadow:var(--elev-raised)}.modal::backdrop,.auto-background-dialog::backdrop{background:rgb(21 20 15 / .5);backdrop-filter:none}.modal-header{padding:24px;gap:16px;border-color:var(--border)}.modal-header h2,.custom-modal .modal-header h2{font-size:28px}.modal-header p{font-size:14px;line-height:1.6;color:var(--muted);max-width:70ch}.modal-footer,.cloud-sync-footer{border-color:var(--border);padding:16px 24px}
.template-filters{padding:20px 24px;gap:16px;color:var(--muted);font-size:12px;flex-wrap:wrap}.template-filters input,.name-input,.paper-select,.cloud-sync-form input,.tag-style-panel select,.tag-style-panel input[type=number]{min-height:44px;font:14px/1.5 var(--font-body);color:var(--ink);background:var(--surface);border:1px solid var(--border);border-radius:4px}.template-filters input{max-width:100%;flex:1}.template-grid{gap:16px}.template-card{border-color:var(--border);background:var(--surface);border-radius:4px;padding:16px 16px 52px;box-shadow:none}.template-card.active{background:var(--bg);border-color:var(--ink)}.template-card-copy strong{font:600 14px/1.5 var(--font-body)}.template-card-copy small{color:var(--muted);font-size:12px}.template-default-button{font:12px/1.5 var(--font-body);left:92px;bottom:12px;min-height:32px;color:var(--muted)}.template-default-button:disabled,.template-default-button.is-default{color:var(--ink);background:transparent}.template-card-actions{right:16px}.template-edit-button{font-size:12px!important}
.custom-sidebar{padding:20px;border-color:var(--border)}.custom-canvas-area{background:var(--surface-warm);padding:20px}.palette-heading span+span{color:var(--muted);font-size:9px}.size-tile{background:var(--surface);border-color:var(--border);border-radius:4px;min-height:84px;gap:8px}.size-tile span{color:var(--muted);font-size:11px}.snap-hint,.custom-canvas-footer,.paper-zoom-bar{font-size:11px;line-height:1.6;color:var(--muted)}
.box-context-menu,.live-size-menu,.tag-style-panel{background:var(--surface);border-color:var(--border);border-radius:8px;box-shadow:var(--elev-raised)}.box-context-menu button{background:transparent;color:var(--ink);font-size:14px;min-height:44px}.live-size-option{background:var(--surface);color:var(--ink);min-height:56px}.live-size-menu-heading,.live-size-option small{color:var(--muted);font-size:12px}.live-size-option strong{font-size:14px}.live-size-option>i{background:var(--surface-warm);border-color:var(--muted)}
.tag-style-panel>label{color:var(--muted);font-size:12px}.tag-number-control small{color:var(--muted)}.tag-style-panel .button{height:44px}.tag-style-panel .tag-style-toggle{height:44px}.cloud-sync-form label,.cloud-sync-message,.auto-background-dialog p{color:var(--muted);font-size:14px;line-height:1.6}.auto-background-dialog small{font-size:12px;color:var(--muted)}.auto-background-spinner{border-color:var(--border);border-top-color:var(--ink)}
.sheet-orientation,.rotate-box-button,.add-tag-hover,.live-add-tag,.live-assign-photo{background:var(--surface);color:var(--ink);border-color:var(--border);box-shadow:none}.sheet-orientation{display:grid;place-items:center;width:36px;height:36px}.sheet-add-box{background:var(--ink);color:var(--surface);border-color:var(--surface)}.clear-photos-button{color:var(--muted);width:40px;height:40px}.toast{background:var(--ink);color:var(--surface);font-size:14px;border-radius:4px;max-width:calc(100vw - 32px)}
.sheet-area-marquee{border-color:var(--ink);background:rgb(21 20 15 / .1)}.photo-slot.photo-drop-target{outline-color:var(--success);box-shadow:var(--focus-ring)}
@media(hover:hover){
 .quiet:hover:not(:disabled),.outline:hover,.cloud-sync-button:hover,.icon-button:hover,.area-zoom-button:hover,.photo-card:hover,.zoom-step:hover,.sheet-orientation:hover,.rotate-box-button:hover,.template-default-button:hover:not(:disabled),.box-context-menu button:hover,.live-size-option:hover{background:var(--bg);color:var(--ink);border-color:var(--muted)}
 .template-card:hover,.size-tile:hover{background:var(--bg);border-color:var(--muted);box-shadow:none}.panel-resizer:hover::after{background:var(--muted);box-shadow:none}
}
.area-zoom-button[aria-pressed=true]{background:var(--ink);color:var(--surface);border-color:var(--ink)}
@media(min-width:1440px){.workspace{padding:24px 28px}.toolbar{grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-areas:'size zoom' 'reset background'}.toolbar-divider{display:none}.toolbar>.tool-group{grid-area:size}.toolbar>.zoom-control{grid-area:zoom;margin:0}.toolbar>#resetCrop{grid-area:reset}.toolbar>.background-actions{grid-area:background}}
@media(max-width:1024px){.topbar{padding:16px 24px}.workspace{padding:16px}.save-state{max-width:180px}.brand strong{font-size:26px}}
@media(max-width:1000px){.workspace{height:auto;min-height:0;grid-template-columns:220px minmax(0,1fr);gap:16px!important}.right-panel{grid-column:1/-1;min-height:680px}.left-panel{min-height:560px}.sheet-wrap{min-height:520px}}
@media(max-width:767px){
 .topbar{flex-wrap:wrap;gap:16px;padding:20px}.brand{flex:1 1 100%}.top-actions{width:100%;justify-content:flex-start;gap:8px}.save-state{max-width:none;flex:1 1 100%;font-size:10px}.cloud-sync-button{flex:1}.topbar .print-button{flex:1}
 .workspace{display:flex;flex-direction:column;gap:16px!important;padding:16px;min-height:0}.left-panel{min-height:0;padding:20px}.drop-zone{min-height:140px}.photo-list{max-height:240px}.empty-note{padding:16px}.library-footer{margin-top:16px}.center-panel{width:100%}.right-panel{min-height:640px}.toolbar{grid-template-columns:minmax(0,1fr) minmax(0,1.2fr);padding:12px;gap:12px}.toolbar .button,.toolbar .background-actions .button{font-size:11px;white-space:normal;min-height:44px}.background-actions{grid-template-columns:1fr;gap:8px}.crop-panel.empty .crop-stage,.crop-stage{min-height:320px}.crop-panel,.right-panel{padding:16px}.preview-controls>.sheet-zoom-bar{flex-basis:100%}.preview-title .sheet-zoom-bar .zoom-step{width:36px;height:40px}.sheet-wrap{min-height:420px}.sheet-zoom-stage{padding:16px}.sheet-stats{font-size:10px}.template-grid{grid-template-columns:1fr;padding:0 16px 20px}.modal-header,.custom-modal .modal-header{padding:20px}.modal-header h2,.custom-modal .modal-header h2{font-size:24px}.custom-body{grid-template-columns:1fr;overflow:auto;display:flex;flex-direction:column}.custom-sidebar{flex:none;border-right:0;border-bottom:1px solid var(--border)}.size-palette{max-height:180px;grid-template-columns:repeat(3,minmax(0,1fr));flex:none}.custom-canvas-area{flex:1 0 400px;min-height:400px}.modal-footer{padding:16px}.template-current{flex-wrap:wrap}.keyboard-hint{max-width:none}.below-hint{padding:0 4px}.tag-style-panel select,.tag-style-panel input[type=number]{font-size:16px}.name-input,.paper-select,.cloud-sync-form input,.template-filters input{font-size:16px}
}
@media(max-width:375px){.topbar{padding:16px}.workspace{padding:12px}.brand strong{font-size:26px}.toolbar{gap:8px}.preview-title .sheet-zoom-bar>span{display:none}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}

/* Let copy determine control height; keep template actions in normal flow. */
.topbar{flex-wrap:wrap}.brand{flex:1 1 260px}.brand>div:last-child{min-width:0}.brand-mark{flex:none}.studio-note p{overflow-wrap:anywhere}
.workspace{height:auto;min-height:calc(100dvh - 116px);align-items:stretch}
.left-panel,.center-panel,.right-panel{min-width:0}
.toolbar{grid-template-columns:minmax(0,1fr)!important;grid-template-areas:"size" "zoom" "reset" "background"!important}
.toolbar-divider{display:none}.toolbar>.tool-group{grid-area:size}.toolbar>.zoom-control{grid-area:zoom;width:100%;margin:0}.toolbar>#resetCrop{grid-area:reset}.toolbar>.background-actions{grid-area:background;grid-template-columns:minmax(0,1fr)}
.toolbar .button,.toolbar .background-actions .button{white-space:normal;overflow-wrap:anywhere;min-height:44px;height:auto;font-size:13px;line-height:1.5}
.toolbar .tool-group select{width:100%;max-width:100%;min-width:0}
.section-heading>div,.panel-title>div,.modal-header>div{min-width:0}
.section-heading h2,.panel-title h2,.modal-header h2{overflow-wrap:anywhere}
.layout-actions-row .template-current{flex-wrap:wrap;align-items:flex-start}.template-current>div{flex:1 1 180px}.template-current>.text-button{flex:none}
.preview-controls>.sheet-zoom-bar{flex-wrap:wrap;flex-basis:100%;white-space:normal}.preview-controls>.sheet-zoom-bar input{flex:1 1 64px;min-width:40px}.preview-title .sheet-zoom-bar>span{flex-basis:100%;margin:0}.sheet-zoom-bar .zoom-step,.sheet-zoom-bar strong{flex:none}
.sheet-stats>span{min-width:0;max-width:100%;overflow-wrap:anywhere}.sheet-stats>span:first-child{align-items:flex-start}.green-dot{flex:none;margin-top:5px}.printer-note>span:last-child{min-width:0;overflow-wrap:anywhere}
.template-card{display:grid;grid-template-columns:minmax(0,1fr);gap:12px;padding:16px;min-height:0;cursor:default}
.template-card-select{width:100%;min-width:0;align-items:flex-start;padding:0;gap:12px}.template-mini{flex:none}.template-card-copy{min-width:0;overflow-wrap:anywhere}.template-card-copy strong,.template-card-copy small{white-space:normal}
.template-card-actions{position:static;transform:none;display:flex;flex-direction:row;flex-wrap:wrap;align-items:center;gap:8px;width:100%}
.template-default-button{position:static;transform:none;display:block;width:fit-content;max-width:100%;white-space:normal;text-align:left;min-height:40px;padding:8px;margin:0}
.template-edit-button{white-space:normal;height:auto!important;min-height:40px}
.tag-style-panel{grid-template-columns:repeat(auto-fit,minmax(120px,1fr));max-height:45dvh;overflow:auto;align-items:end}.tag-style-panel>label{min-width:0;white-space:normal}.tag-style-panel .button{height:auto;min-height:44px;white-space:normal;line-height:1.5}
.modal-footer{flex-wrap:wrap}.modal-header .icon-button{flex:none}.cloud-sync-footer{flex-wrap:wrap;gap:12px}
@media(min-width:1600px){.toolbar{grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;grid-template-areas:"size zoom" "reset background"!important}}
@media(max-width:767px){.workspace{min-height:0}.template-card-select{gap:12px}.template-mini{width:56px;height:80px}.tag-style-panel{grid-template-columns:repeat(2,minmax(0,1fr))}.brand small{letter-spacing:.08em}.sheet-stats{flex-direction:column}}

/* Arc-inspired shell: quiet tinted chrome around separate working surfaces. */
.topbar{background:var(--bg);border-bottom:0;padding-block:20px}
.brand-mark{background:var(--accent);border-radius:var(--radius-md)}
.brand strong{letter-spacing:-.8px}
.brand small{color:var(--muted);letter-spacing:.08em}
.workspace{padding-top:8px}
.left-panel{background:var(--sidebar);border-color:transparent;border-radius:var(--radius-lg)}
.panel{border-radius:var(--radius-lg)}
.section-heading{border-color:var(--border)}
.section-heading .eyebrow::before,.crop-panel>.panel-title .eyebrow::before,.preview-title .eyebrow::before{content:none}
.button,.cloud-sync-button,.area-zoom-button,.icon-button{border-radius:var(--radius-sm)}
.cloud-sync-button{background:var(--surface-warm)}
.primary{box-shadow:none}
.topbar .print-button{border-radius:var(--radius-pill)}
.drop-zone{background:var(--surface-warm);border:1px dashed var(--muted);border-radius:var(--radius-md)}
.upload-icon{background:var(--selected);border-radius:var(--radius-sm);color:var(--accent)}
.photo-card{border-radius:var(--radius-sm)}
.photo-card.selected{background:var(--surface);border-color:var(--accent)}
.photo-thumb{border-radius:6px}
.toolbar{border-color:transparent;background:var(--surface-warm)}
.toolbar .tool-group{padding:8px 12px;border:1px solid var(--border);border-radius:var(--radius-sm);background:var(--surface)}
.toolbar .zoom-control{padding:12px;border-radius:var(--radius-sm);background:var(--surface)}
.toolbar .quiet{background:var(--border-soft)}
.crop-stage,.sheet-wrap{border-radius:var(--radius-md);border-color:var(--border);background:var(--surface-warm)}
.crop-empty strong{font-size:24px}
.empty-photo-icon{color:var(--accent)}
.layout-actions-row .template-current{border-radius:var(--radius-md);padding:16px}
.layout-actions-row .template-actions{justify-content:flex-start}
.preview-title{border-bottom:0;padding-bottom:0}
.preview-controls{padding:12px;background:var(--surface-warm);border-radius:var(--radius-md)}
.preview-title .sheet-zoom-bar .zoom-step,.zoom-step{border-radius:var(--radius-sm)}
.sheet-stats{row-gap:12px}
.printer-note{border-color:var(--border)}
.modal,.box-context-menu,.live-size-menu,.tag-style-panel{border-radius:var(--radius-lg)}
.template-card,.size-tile{border-radius:var(--radius-md)}
.template-card.active{background:var(--surface-warm);border-color:var(--accent)}
.template-filters input,.name-input,.paper-select,.cloud-sync-form input,.tag-style-panel select,.tag-style-panel input[type=number]{border-radius:var(--radius-sm)}
.sheet-orientation{border-radius:var(--radius-sm)}
input[type=range]{accent-color:var(--accent)}
button:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible,[tabindex]:focus-visible{outline-color:var(--accent)}
.area-zoom-button[aria-pressed=true]{background:var(--accent);border-color:var(--accent)}
@media(hover:hover){
 .photo-card:hover{background:var(--selected)}
 .template-card:hover,.size-tile:hover{background:var(--surface-warm)}
 .text-button:hover{color:var(--accent)}
}
@media(max-width:767px){.topbar{padding:20px 16px}.workspace{padding-top:0}.left-panel,.crop-panel,.right-panel{padding:20px}.top-actions{gap:12px}}

/* Smaller screens use document flow instead of desktop resizer dimensions. */
@media(max-width:1000px){
 .workspace{grid-template-columns:220px minmax(0,1fr)!important;gap:16px!important;height:auto;min-height:0;padding:16px;align-items:start}
 .panel-resizer{display:none}
 .left-panel{min-height:0;max-height:none}
 .photo-list{max-height:320px}
 .right-panel{grid-column:1/-1;min-height:0}
 .sheet-wrap{flex:none;min-height:0;height:clamp(400px,65dvh,720px);overflow:auto}
 .crop-panel.empty .crop-stage,.crop-stage{flex:none;height:clamp(300px,44dvh,480px);min-height:0}
 .crop-panel{flex:none}
 .topbar{gap:16px;padding:16px 24px}
 .top-actions{flex:1 1 360px}
 .save-state{max-width:none}
 .custom-modal .modal-header{flex:none}
 .custom-body{grid-template-columns:220px minmax(0,1fr)}
 .custom-sidebar{padding:16px}
 .tag-style-panel{max-height:40dvh}
 button,input,select{touch-action:manipulation}
 .button,.icon-button,.clear-photos-button,.cloud-sync-button,.area-zoom-button,.sheet-orientation,.text-button,.template-default-button,.photo-remove{min-height:44px}
 .icon-button,.clear-photos-button,.sheet-orientation,.preview-title .sheet-zoom-bar .zoom-step,.zoom-step{min-width:44px;min-height:44px}
 .tool-group select,.paper-select{font-size:16px;min-height:44px}
 .template-grid{grid-template-columns:1fr}
}
@media(max-width:767px){
 .topbar{padding:16px;gap:16px}.brand{flex-basis:100%}.top-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));flex-basis:100%;width:100%;gap:12px}.top-actions .save-state{grid-column:1/-1;overflow-wrap:anywhere}
 .topbar .print-button{min-width:0;width:100%;padding:12px}.cloud-sync-button{width:100%;padding:12px}
 .workspace{display:flex;flex-direction:column;gap:16px!important;padding:0 12px 24px}
 .workspace>.left-panel,.workspace>.center-panel,.workspace>.right-panel{width:100%;max-width:100%}
 .left-panel,.crop-panel,.right-panel{padding:16px}
 .section-heading{margin-bottom:16px;padding-bottom:12px}.section-heading h2,.panel-title h2{font-size:22px}
 .drop-zone{min-height:128px;padding:16px;gap:4px}.photo-list{max-height:224px;margin-top:12px}.photo-meta{flex:1}.photo-remove{flex:none}.empty-note{padding:12px 8px}.library-footer{margin-top:12px;padding-top:8px}
 .toolbar{padding:12px;gap:8px}.toolbar .button,.toolbar .background-actions .button{font-size:14px;min-height:44px}.toolbar .background-actions{gap:8px}.toolbar .tool-group{padding:8px 12px}.toolbar .zoom-control{padding:8px 12px}
 .crop-panel.empty .crop-stage,.crop-stage{height:clamp(260px,48dvh,400px);min-height:0}.crop-empty{padding:16px;max-width:100%}.crop-empty strong{font-size:22px}.crop-footer{gap:8px;font-size:11px}.keyboard-hint{font-size:12px;line-height:1.5}
 .layout-actions-row .template-current{padding:12px;gap:8px}.template-current>div{flex-basis:100%}.template-current>.text-button{padding-inline:0}.template-actions,.template-actions .button{width:100%}
 .preview-controls{padding:12px;gap:12px}.preview-controls>.area-zoom-button{width:100%}.preview-controls>.sheet-zoom-bar{column-gap:8px;row-gap:12px}.preview-title .sheet-zoom-bar>span{display:block;flex-basis:100%}.preview-controls>.sheet-zoom-bar input{min-width:32px;flex:1 1 32px}.preview-title .sheet-zoom-bar .text-button{padding-inline:0}
 .sheet-wrap{height:clamp(340px,64dvh,560px);min-height:0;margin-top:12px;padding:0}.sheet-zoom-stage{padding:16px}.sheet-stats{padding-block:12px;gap:8px}.printer-note{padding-top:12px;font-size:12px}
 .modal{width:calc(100vw - 24px);max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px);margin:auto}
 dialog.custom-modal{width:calc(100vw - 16px);height:calc(100dvh - 16px);max-height:calc(100dvh - 16px)}
 .modal-header,.custom-modal .modal-header{padding:16px;gap:12px}.modal-header h2,.custom-modal .modal-header h2{font-size:24px}.modal-header p{font-size:13px}
 .custom-body{display:flex;flex-direction:column;overflow-y:auto;overflow-x:hidden;flex:1;min-height:0}
 .custom-sidebar{flex:none;padding:16px;overflow:visible}.size-palette{flex:none;grid-template-columns:repeat(3,minmax(0,1fr));max-height:184px;overflow:auto}.palette-heading{flex-wrap:wrap;gap:8px}.size-tile{min-height:80px}
 .custom-canvas-area{flex:none;min-height:400px;height:60dvh;padding:12px;overflow:hidden}.custom-canvas-footer{gap:8px;flex-wrap:wrap;padding-top:8px}.paper-zoom-bar{width:100%;flex-wrap:wrap;gap:8px}.paper-zoom-bar input{min-width:40px;flex:1;width:auto}
 .modal-footer{flex:none;padding:12px;display:grid;grid-template-columns:auto minmax(0,1fr);gap:8px}.modal-footer .button{white-space:normal;font-size:13px;line-height:1.4;padding:12px}
 .template-filters{padding:16px;gap:12px}.template-filters input{flex-basis:100%;width:100%;min-width:0}.template-grid{padding:0 16px 16px;max-height:55dvh}.template-card-select{align-items:flex-start}.template-card-copy strong{font-size:14px}.template-card-actions{gap:8px}
 .cloud-sync-form{padding:16px}.cloud-sync-message{margin:0 16px 16px;overflow-wrap:anywhere}.cloud-sync-footer{padding:16px}
 .tag-style-panel{left:8px;right:8px;bottom:max(8px,env(safe-area-inset-bottom));transform:none;width:auto;max-height:42dvh;padding:12px;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
 .tag-style-panel select,.tag-style-panel input[type=number],.name-input,.cloud-sync-form input,.template-filters input{font-size:16px}
 .toast{bottom:max(16px,env(safe-area-inset-bottom));font-size:13px;overflow-wrap:anywhere}
}
@media(max-width:390px){
 .preview-controls>.sheet-zoom-bar{display:grid;grid-template-columns:44px minmax(0,1fr) 44px;align-items:center}
 .preview-title .sheet-zoom-bar>span{grid-column:1/-1}.preview-controls>.sheet-zoom-bar input{width:100%}.preview-controls>.sheet-zoom-bar strong{grid-column:1/3}.preview-controls>.sheet-zoom-bar .text-button{grid-column:3}
 .size-palette{grid-template-columns:repeat(2,minmax(0,1fr))}
}

@font-face{font-family:Montserrat;font-style:normal;font-weight:400;font-display:swap;src:url("assets/fonts/montserrat-400.ttf") format("truetype")}
@font-face{font-family:Montserrat;font-style:normal;font-weight:500;font-display:swap;src:url("assets/fonts/montserrat-500.ttf") format("truetype")}
@font-face{font-family:Montserrat;font-style:normal;font-weight:600;font-display:swap;src:url("assets/fonts/montserrat-600.ttf") format("truetype")}
@font-face{font-family:Montserrat;font-style:normal;font-weight:700;font-display:swap;src:url("assets/fonts/montserrat-700.ttf") format("truetype")}

/* Opaque defaults keep the interface legible without backdrop-filter support. */
:root{
 --font-display:Montserrat,system-ui,sans-serif;
 --font-body:Montserrat,system-ui,sans-serif;
 --glass-edge:rgb(255 255 255 / .8);
 --glass-shadow:0 8px 24px rgb(36 54 47 / .07),inset 0 1px 0 rgb(255 255 255 / .9);
 --glass-blur:16px;
}
body{background:radial-gradient(ellipse at 5% 15%,var(--selected),transparent 55%),radial-gradient(ellipse at 95% 70%,var(--sidebar),transparent 55%),var(--bg)}
.brand strong{font-weight:600;font-size:26px;letter-spacing:-1px}
.section-heading h2,.panel-title h2,.modal-header h2,.custom-modal .modal-header h2{font-weight:600;line-height:1.3;font-size:22px}
.crop-empty strong,.preview-title>.od-field::after{font-family:var(--font-display);font-weight:500;font-size:20px;line-height:1.4}
.panel,.modal,.tag-style-panel,.box-context-menu,.live-size-menu{box-shadow:var(--glass-shadow)}
@supports ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))){
 .topbar{background:color-mix(in srgb,var(--bg) 72%,transparent);backdrop-filter:blur(var(--glass-blur));-webkit-backdrop-filter:blur(var(--glass-blur))}
 .panel,.modal,.tag-style-panel,.box-context-menu,.live-size-menu{background:color-mix(in srgb,var(--surface) 85%,transparent);border-color:var(--glass-edge);backdrop-filter:blur(var(--glass-blur));-webkit-backdrop-filter:blur(var(--glass-blur))}
 .left-panel{background:color-mix(in srgb,var(--sidebar) 82%,transparent)}
 .toolbar{background:color-mix(in srgb,var(--surface-warm) 84%,transparent)}
 .preview-controls,.layout-actions-row .template-current{background:color-mix(in srgb,var(--surface) 75%,transparent);border:1px solid var(--glass-edge)}
}
@media(prefers-reduced-transparency:reduce){
 .topbar{background:var(--bg)}
 .panel,.modal,.tag-style-panel,.box-context-menu,.live-size-menu,.preview-controls,.layout-actions-row .template-current{background:var(--surface);backdrop-filter:none;-webkit-backdrop-filter:none}
 .left-panel{background:var(--sidebar)}.toolbar{background:var(--surface-warm)}
}

/* Desktop keeps all three work areas inside a single viewport. */
@media(min-width:1001px){
 body{height:100dvh;min-height:0;display:flex;flex-direction:column}
 .topbar{flex:none;min-height:80px;padding:12px 24px;flex-wrap:nowrap}
 .top-actions{flex-wrap:nowrap}.brand{flex:1 1 auto}.save-state{max-width:180px}
 .workspace{display:grid;flex:1;min-height:0;height:auto;grid-template-columns:minmax(180px,18fr) 17px minmax(320px,38fr) 17px minmax(280px,44fr);gap:0!important;padding:8px 16px 16px;align-items:stretch}
 .workspace>.left-panel,.workspace>.center-panel,.workspace>.right-panel{grid-column:auto;min-height:0;max-height:100%}
 .left-panel,.right-panel,.crop-panel{padding:16px}.left-panel{overflow:auto}.photo-list{flex:1;min-height:0}.library-footer{flex:none;margin-top:12px}
 .center-panel{gap:8px;overflow-y:auto;overflow-x:hidden}
 .toolbar{flex:none;padding:8px;gap:8px;grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;grid-template-areas:"size zoom" "reset background"!important}
 .toolbar .tool-group{padding:4px 8px}.toolbar .zoom-control{padding:8px;gap:4px}.toolbar .background-actions{grid-template-columns:minmax(0,1fr);gap:4px}
 .toolbar .button,.toolbar .background-actions .button{font-size:12px;min-height:36px;padding:6px 8px}.tool-group select{min-height:28px}
 .crop-panel,.crop-panel.empty{flex:1 0 220px;min-height:220px}.crop-panel>.panel-title{margin-bottom:8px;gap:8px}.crop-panel .keyboard-hint{font-size:10px}
 .crop-stage,.crop-panel.empty .crop-stage{flex:1;min-height:120px;height:auto}.crop-empty{padding:12px;gap:4px}.crop-empty strong{font-size:18px}.crop-footer{padding-top:8px;gap:8px;font-size:10px}
 .layout-actions-row{gap:8px;flex:none}.layout-actions-row .template-current{padding:8px 12px;gap:8px}.template-current>div{flex:1 1 120px}.template-current>.text-button{font-size:11px}.layout-actions-row .template-actions .button{min-height:36px;padding:6px 12px}
 .below-hint{font-size:11px;line-height:1.4;flex:none}
 .right-panel{overflow-y:auto}.preview-title{flex:none;gap:12px}.preview-title>.od-field::after{font-size:20px}.preview-controls{padding:8px;gap:8px}
 .sheet-wrap{flex:1 0 180px;min-height:180px;height:auto;margin-top:12px;overflow:auto}.sheet-zoom-stage{padding:16px}
 .sheet-stats{flex:none;padding-block:12px}.printer-note{flex:none;font-size:11px;padding-top:12px}
}

/* Compact dark photo workspace. Paper and label rendering remain in styles.css. */
:root{
 --bg:#15171b;--surface:#24272d;--surface-warm:#2d3138;--sidebar:#202329;--selected:#3a4654;
 --fg:#edf0f4;--fg-2:#d4d9e1;--muted:#b1bac7;--meta:#b1bac7;--border:#454c57;--border-soft:#363c45;
 --accent:#a6c9ff;--accent-on:#152238;--accent-hover:#c1daff;--accent-active:#87b3f3;--success:#94d2b2;--warn:#edc489;--danger:#ffaca7;
 --radius-sm:4px;--radius-md:6px;--radius-lg:8px;--glass-shadow:none;--glass-edge:var(--border);
 --ink:var(--fg);--text-base:14px;--leading-body:1.5;
}
*,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important}
body{background:linear-gradient(135deg,var(--bg),var(--surface-warm));color:var(--fg);font-size:14px}
body::before{display:none}
.topbar{min-height:56px;padding:8px 16px;background:var(--bg);border-bottom:1px solid var(--border-soft);gap:16px}
.brand{gap:8px}.brand-mark{width:32px;height:32px;border-radius:6px;background:var(--surface-warm);color:var(--accent);--od-icon-size:20px}
.brand strong{font-size:18px;line-height:1.3;font-weight:600;letter-spacing:-.5px}.studio-subtitle,.studio-note{display:none}.top-actions{gap:8px}.save-state{font:11px/1.5 var(--font-body);color:var(--muted)}
.button,.cloud-sync-button,.area-zoom-button,.topbar .print-button{min-height:32px;padding:6px 12px;border-radius:4px;font-size:12px;line-height:1.4;box-shadow:none}
.topbar .print-button{min-width:112px}.primary{background:var(--accent);color:var(--accent-on)}.quiet,.cloud-sync-button{background:var(--surface-warm);color:var(--fg)}.outline,.area-zoom-button{color:var(--fg);background:transparent;border-color:var(--border)}
.text-button{font-size:12px;min-height:32px;padding:4px;color:var(--accent)}
.panel,.left-panel,.toolbar,.right-panel,.modal,.tag-style-panel,.box-context-menu,.live-size-menu{background:var(--surface);border:1px solid var(--border-soft);border-radius:6px;box-shadow:none}
.left-panel,.right-panel,.crop-panel{padding:12px}
.section-heading{padding-bottom:8px;margin-bottom:12px}.eyebrow,.mini-label,.field-label,.tool-group label{font:500 10px/1.4 var(--font-body);letter-spacing:.06em;color:var(--muted)}
.section-heading h2,.panel-title h2,.modal-header h2,.custom-modal .modal-header h2{font:600 15px/1.4 var(--font-body);letter-spacing:0;margin:0}
.section-heading .eyebrow,.crop-panel>.panel-title .eyebrow{display:none}
.preview-title>.od-field::after{content:none}.preview-title .eyebrow{font:600 13px/1.4 var(--font-body);letter-spacing:0;color:var(--fg)}
.icon-button,.clear-photos-button{width:32px;height:32px;min-width:32px;min-height:32px;background:var(--surface-warm);color:var(--fg);border-radius:4px}
.drop-zone{min-height:112px;padding:12px;background:var(--sidebar);border-color:var(--border);border-radius:4px;gap:2px}.upload-icon{width:28px;height:28px;--od-icon-size:20px;background:transparent;color:var(--muted);margin:0}.drop-zone strong{font-size:12px}.drop-zone span{font-size:12px}.drop-zone small{font-size:10px;margin-top:4px}
.photo-card.selected{background:var(--selected);border-color:var(--accent)}.photo-meta strong{font-size:12px}.empty-note{font-size:12px;padding:12px 4px;line-height:1.5}.library-footer{padding-top:8px;font-size:10px}.photo-assignment-hint{font-size:11px}
.toolbar{padding:8px;gap:8px}.toolbar .tool-group,.toolbar .zoom-control{padding:4px 8px;background:var(--sidebar);border:1px solid var(--border-soft);border-radius:4px}.toolbar .tool-group{gap:2px}.toolbar .tool-group select{color:var(--fg);font-size:12px;min-height:28px}.toolbar .quiet{background:var(--surface-warm)}
.toolbar .button,.toolbar .background-actions .button{font-size:11px;min-height:32px;padding:6px;line-height:1.4}.toolbar>.background-actions{gap:4px}
.crop-panel>.panel-title{margin-bottom:8px;align-items:center}.keyboard-hint{font-size:10px;line-height:1.4;max-width:32ch}.crop-stage{background:var(--bg);border-color:var(--border-soft);border-radius:4px}.crop-empty{gap:4px;padding:12px}.crop-empty strong{font:500 14px/1.5 var(--font-body)}.crop-empty span{font-size:12px}.empty-photo-icon{--od-icon-size:28px;color:var(--muted);width:32px;height:32px}
.crop-footer{padding-top:8px;font:10px/1.5 var(--font-body);gap:8px}.live-crop-label,.face-status{font-size:10px}.crop-badge{background:var(--surface-warm);color:var(--fg)}
.layout-actions-row{gap:8px}.layout-actions-row .template-current{padding:8px;background:var(--surface);border:1px solid var(--border-soft);border-radius:4px;gap:8px;align-items:center}.template-current>div{flex:1 1 100px}.template-current strong,.layout-actions-row .template-current strong{font-size:11px;line-height:1.4;margin-top:2px}.mini-label{font-size:9px}.layout-actions-row .template-actions .button{min-height:32px;padding:6px 10px;font-size:11px}.below-hint{display:none}
.preview-title{gap:8px}.preview-controls{padding:0;background:transparent;border:0;gap:8px;border-radius:0}.preview-controls>.sheet-zoom-bar{min-height:32px;gap:4px;flex-wrap:nowrap}.preview-title .sheet-zoom-bar>span{display:none}.preview-title .sheet-zoom-bar .zoom-step,.zoom-step{width:28px;height:28px;min-width:28px;min-height:28px;background:var(--surface-warm);color:var(--fg);border-color:var(--border);border-radius:4px}.preview-controls>.sheet-zoom-bar input{min-width:32px;flex:1}.preview-controls>.area-zoom-button{width:auto;min-height:28px;font-size:10px;padding:4px 8px}.sheet-zoom-bar strong{font-size:10px}
.sheet-wrap{background:var(--bg);border:1px solid var(--border-soft);border-radius:4px;padding:0;margin-top:8px}.sheet-zoom-stage{padding:8px}.sheet-stats{font:10px/1.5 var(--font-body);padding-block:8px;gap:8px}.printer-note{font-size:10px;line-height:1.4;padding-top:8px}.printer-note b{color:var(--fg)}
/* Printable artwork stays light against the dark editing surround. */
.sheet,.custom-paper,.template-mini{background:#fff;color:#20242c}.photo-slot:not(.name-tag-slot),.photo-image-frame,.name-tag-photo,.mini-slot,.tile-art,.custom-photo-area,.custom-box:not(.has-name-tag){background:#dce5ef;border-color:#65758a;color:#26384e}
.sheet-orientation,.rotate-box-button,.live-add-tag,.live-assign-photo,.add-tag-hover{background:var(--surface-warm);color:var(--fg);border-color:var(--border)}
.template-current .text-button{flex:none}.sheet-add-box{background:var(--accent);color:var(--accent-on)}
.modal-header,.custom-modal .modal-header{padding:16px;border-color:var(--border-soft)}.modal-header h2,.custom-modal .modal-header h2{font-size:18px}.modal-header p{font-size:12px;line-height:1.5;margin-top:4px}.modal-footer,.cloud-sync-footer{padding:12px 16px;border-color:var(--border-soft)}
.template-filters{padding:12px 16px}.template-filters input,.name-input,.paper-select,.cloud-sync-form input,.tag-style-panel select,.tag-style-panel input[type=number]{background:var(--sidebar);color:var(--fg);border-color:var(--border);border-radius:4px;min-height:36px;font-size:13px;color-scheme:dark}.template-card,.size-tile{background:var(--sidebar);border-color:var(--border);border-radius:4px}.template-card.active{background:var(--selected);border-color:var(--accent)}.template-card-copy strong{font-size:13px}.template-card-copy small{font-size:11px}.template-default-button:disabled,.template-default-button.is-default{color:var(--accent)}.template-card-actions{gap:4px}.custom-sidebar{padding:12px}.custom-canvas-area{background:var(--bg)}.size-tile span{color:var(--fg-2)}.tag-style-panel .tag-remove-button{color:var(--danger);background:var(--surface-warm)}.toast{background:var(--surface-warm);color:var(--fg);border:1px solid var(--border)}
.auto-background-spinner{border-color:var(--border);border-top-color:var(--accent)}.save-state[data-sync=error],.face-status[data-state=error]{color:var(--danger)}.save-state[data-sync=saving]{color:var(--muted)}.save-state[data-sync=synced],.face-status[data-state=detected]{color:var(--success)}
@media(hover:hover){
 .button:hover:not(:disabled),.cloud-sync-button:hover,.icon-button:hover,.area-zoom-button:hover,.photo-card:hover,.zoom-step:hover,.sheet-orientation:hover,.box-context-menu button:hover,.live-size-option:hover,.template-default-button:hover:not(:disabled){background:var(--surface-warm);color:var(--fg);border-color:var(--border)}
 .primary:hover:not(:disabled){background:var(--accent-hover);color:var(--accent-on)}
 .template-card:hover,.size-tile:hover{background:var(--surface-warm);border-color:var(--muted);transform:none}
}
@media(min-width:1001px){
 .topbar{min-height:56px;padding:8px 16px}.brand{flex:1}.save-state{max-width:none}
 .workspace{grid-template-columns:minmax(180px,15fr) 17px minmax(320px,42fr) 17px minmax(280px,43fr);padding:8px;min-height:0}
 .workspace>.left-panel,.workspace>.center-panel,.workspace>.right-panel{min-height:0}
 .center-panel{gap:8px}.left-panel,.crop-panel,.right-panel{padding:10px}
 .toolbar{display:flex!important;flex-wrap:wrap;align-items:center;gap:6px;padding:6px}
 .toolbar>.tool-group{flex:1 1 140px}.toolbar>.zoom-control{flex:1 1 140px;width:auto;min-width:0}
 .toolbar>#resetCrop{flex:0 0 auto;width:auto}.toolbar>.background-actions{display:flex;flex:1 1 230px;flex-wrap:wrap;width:auto}.toolbar .background-actions .button{flex:1 1 100px;width:auto}
 .crop-panel,.crop-panel.empty{flex:1 0 260px;min-height:260px}.crop-stage,.crop-panel.empty .crop-stage{flex:1;min-height:180px;height:auto}
 .crop-panel .keyboard-hint{display:none}.crop-footer{flex-wrap:wrap}.crop-panel>.panel-title{margin-bottom:6px}
 .layout-actions-row{display:flex;align-items:center;flex-wrap:wrap;gap:6px}.layout-actions-row .template-current{flex:1 1 240px;padding:6px 8px;flex-wrap:nowrap}.layout-actions-row .template-actions{flex:0 1 auto;width:auto}.layout-actions-row .template-actions .button{width:auto;white-space:normal}
 .right-panel{display:flex;flex-direction:column}.preview-title{gap:6px}.preview-controls{display:flex;flex-wrap:wrap;gap:4px}.preview-controls>.area-zoom-button{flex:0 0 auto}.preview-controls>.sheet-zoom-bar{flex:1 1 200px;min-height:28px}
 .sheet-wrap{flex:1 0 260px;min-height:260px;height:auto}.sheet-zoom-stage{padding:8px}.sheet-stats{padding-block:6px}.printer-note{font-size:10px;padding-top:6px}
}
@media(max-width:1000px){
 .workspace{padding:12px;gap:12px!important}.topbar{padding:12px 16px}.toolbar{gap:8px;padding:8px}
 .crop-panel.empty .crop-stage,.crop-stage{height:clamp(360px,55dvh,580px)}.sheet-wrap{height:clamp(480px,75dvh,840px)}
 .button,.cloud-sync-button,.text-button,.area-zoom-button,.icon-button,.clear-photos-button,.sheet-orientation,.preview-title .sheet-zoom-bar .zoom-step{min-height:44px}.icon-button,.preview-title .sheet-zoom-bar .zoom-step{min-width:44px}.toolbar .button,.toolbar .background-actions .button{min-height:44px;font-size:12px}
}
@media(max-width:767px){
 .topbar{padding:12px}.brand strong{font-size:18px}.top-actions{gap:8px}.workspace{padding:0 8px 16px;gap:12px!important}.left-panel,.crop-panel,.right-panel{padding:12px}
 .drop-zone{min-height:96px;padding:8px}.upload-icon{display:none}.section-heading h2,.panel-title h2{font-size:15px}.section-heading{margin-bottom:8px}.photo-list{max-height:180px}
 .toolbar{padding:8px}.toolbar .tool-group select,.paper-select,.tag-style-panel select,.tag-style-panel input[type=number],.name-input,.cloud-sync-form input,.template-filters input{font-size:16px}
 .crop-panel.empty .crop-stage,.crop-stage{height:clamp(340px,60dvh,560px)}.crop-panel .keyboard-hint{display:none}.sheet-wrap{height:clamp(440px,75dvh,680px)}
 .layout-actions-row .template-current{padding:8px}.template-current>div{flex-basis:100%}.preview-controls>.area-zoom-button{width:auto}.preview-controls{gap:8px}.preview-controls>.sheet-zoom-bar{flex-basis:100%;display:flex;flex-wrap:wrap}.preview-title .sheet-zoom-bar>span{display:none}.preview-controls>.sheet-zoom-bar strong,.preview-controls>.sheet-zoom-bar .text-button{grid-column:auto}
 .custom-modal .modal-header h2,.modal-header h2{font-size:17px}.modal-header,.custom-modal .modal-header{padding:12px}.modal-header p{font-size:12px}.modal-footer .button{font-size:12px}.tag-style-panel .button{min-height:44px}
}

.crop-help{font:11px/1.5 var(--font-body);color:var(--muted);padding-top:6px;flex:none}.crop-help summary{cursor:pointer;min-height:24px;width:fit-content;color:var(--fg-2)}.crop-help p{max-width:65ch;margin:6px 0;line-height:1.6}.crop-badge{pointer-events:none}#cropCanvas:focus-visible{outline:2px solid var(--accent);outline-offset:-3px}.crop-stage canvas{touch-action:none}@media(max-width:1000px){.crop-help summary{min-height:44px;display:flex;align-items:center}}

/* Size selection and placement stay beside the live sheet. */
#liveSizeMenu{position:static;width:100%;max-height:180px;overflow:auto;margin-top:8px;padding:8px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;box-shadow:none;flex:none}
#liveSizeMenu[hidden],.box-placement-bar[hidden],.box-placement-ghost[hidden]{display:none!important}
#liveSizeMenu .live-size-option{display:block;min-height:48px;padding:8px;border:1px solid var(--border);border-radius:4px;background:var(--sidebar);color:var(--fg);text-align:left}
#liveSizeMenu .live-size-option strong{font:600 12px/1.4 var(--font-body);overflow-wrap:anywhere}#liveSizeMenu .live-size-option small{font:11px/1.5 var(--font-body);color:var(--muted)}
#liveSizeMenu .live-size-option[aria-pressed=true]{border-color:var(--accent);background:var(--selected)}#liveSizeMenu .live-size-option:disabled{opacity:.5;cursor:not-allowed}
.box-placement-bar{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:4px 8px;align-items:center;padding:8px;margin-top:8px;border:1px solid var(--border);border-radius:4px;background:var(--sidebar);flex:none}
.box-placement-bar strong{font:600 12px/1.5 var(--font-body)}.box-placement-bar p{grid-column:1/-1;margin:0;color:var(--muted);font:11px/1.5 var(--font-body)}
.box-placement-ghost{position:absolute;z-index:10;box-sizing:border-box;pointer-events:none;display:grid;place-items:center;border:2px dashed #245cba;background:rgb(36 92 186 / .12);color:#152238;font:600 11px/1.4 var(--font-body);text-align:center;overflow-wrap:anywhere}
.box-placement-ghost[data-valid=false]{border-color:#923d32;background:rgb(146 61 50 / .15);color:#70261e}
.sheet.placing-box{cursor:crosshair;touch-action:none}.sheet.placing-box .photo-slot{pointer-events:none}.sheet.placing-box #sheetAddBox{display:none!important}
@media(max-width:1000px){#addPhotoBox,#finishBoxPlacement{min-height:44px}#liveSizeMenu{max-height:220px}#liveSizeMenu .live-size-option{min-height:56px}}

#liveSizeMenu .live-size-option{display:grid;grid-template-columns:44px minmax(0,1fr);gap:8px;align-items:center}
.size-shape-frame{display:grid;place-items:center;width:44px;height:44px}
.size-shape-frame i{display:block;box-sizing:border-box;border:1px solid var(--accent);background:var(--selected)}
#liveSizeMenu .live-size-option>span:last-child{min-width:0}

/* The modal drawer overlays the workspace without shrinking the print preview. */
.size-drawer{position:fixed;inset:0 0 auto;width:min(920px,calc(100% - 32px));max-width:none;max-height:85dvh;margin:0 auto;padding:0;overflow:hidden;background:var(--surface);color:var(--fg);border:1px solid var(--border);border-top:0;border-radius:0 0 12px 12px;box-shadow:0 16px 40px rgb(0 0 0 / .4)}
.size-drawer:not([open]){display:none}.size-drawer::backdrop{background:rgb(0 0 0 / .6)}
.size-drawer-header{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;padding:20px;border-bottom:1px solid var(--border-soft)}.size-drawer-header>div{min-width:0}.size-drawer-header h2{margin:0;font:600 18px/1.4 var(--font-body)}.size-drawer-header p{margin:4px 0 0;color:var(--muted);font:12px/1.5 var(--font-body)}.size-drawer-header button{flex:none;min-width:44px;min-height:44px}
#sizeDrawer #liveSizeMenu{max-height:calc(85dvh - 120px);margin:0;padding:16px;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;border:0;background:transparent;border-radius:0}
#sizeDrawer .live-size-option{min-height:72px}
@media(max-width:767px){.size-drawer{width:calc(100% - 16px)}.size-drawer-header{padding:16px}#sizeDrawer #liveSizeMenu{grid-template-columns:repeat(2,minmax(0,1fr));padding:12px;gap:8px}.size-drawer-header p{max-width:30ch}}
@media(max-width:375px){#sizeDrawer #liveSizeMenu{grid-template-columns:minmax(0,1fr)}}

.brand .brand-mark{width:36px;height:auto;aspect-ratio:2670 / 2873;background:transparent;border-radius:0}.studio-logo{display:block;width:100%;height:auto;object-fit:contain}

.name-tag-dialog{width:min(480px,calc(100vw - 24px));max-height:90dvh;overflow:auto}.name-tag-body{padding:16px;display:grid;gap:8px}.name-tag-body>label{font:600 13px/1.5 var(--font-body)}#nameTagText{display:block;width:100%;padding:10px;border:1px solid var(--border);border-radius:4px;background:var(--sidebar);color:var(--fg);font:16px/1.5 var(--font-body);resize:vertical}#nameTagError{margin:0;color:var(--danger);font:12px/1.5 var(--font-body)}
.name-tag-preview-card{display:flex;flex-direction:column;width:min(180px,100%);margin:8px auto;background:#fff;color:#15171b;border:1px solid var(--border);overflow:hidden}.name-tag-preview-photo{flex:1;min-height:0;display:grid;place-items:center;background:#dce5ef;color:#26384e;font-size:12px}.name-tag-preview-photo img{display:block;width:100%;height:100%;object-fit:cover;min-height:0}.name-tag-preview-photo img[hidden],#nameTagPreviewEmpty[hidden]{display:none}#nameTagPreviewText{flex:none;display:grid;place-items:center;width:100%;white-space:pre-wrap;overflow-wrap:anywhere;text-align:center;box-sizing:border-box;border-top:1px solid #30343c;background:#fff;color:#20242c}
#nameTagStyle summary{min-height:36px;cursor:pointer;color:var(--fg);font-size:13px}#nameTagDialog #tagStylePanel{position:static;transform:none;width:100%;max-height:none;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;padding:12px;background:var(--sidebar);box-shadow:none;margin:0}#nameTagDialog .modal-footer{display:flex;flex-wrap:wrap}#nameTagDialog .tag-remove-button{margin-right:auto;color:var(--danger)}#addCustomTag{margin-top:12px}
@media(max-width:767px){#addLiveTag{min-height:44px}#nameTagDialog .modal-footer .button{min-height:44px}}

.name-tag-dialog{width:min(600px,calc(100vw - 24px))}.name-tag-body{grid-template-columns:minmax(0,1fr) 156px;gap:16px;align-items:start}.name-tag-entry{display:grid;gap:8px;min-width:0}.name-tag-entry>label{font:600 13px/1.5 var(--font-body)}#nameTagText{min-height:80px;max-height:180px;font-size:14px;line-height:1.6}#nameTagHint{margin:0;color:var(--muted);font:11px/1.5 var(--font-body)}#nameTagError:empty{display:none}.name-tag-preview-wrap{display:grid;gap:8px;min-width:0}.tag-preview-label{font:500 10px/1.5 var(--font-body);letter-spacing:.08em;color:var(--muted)}.name-tag-preview-card{width:100%;margin:0;max-height:220px}.name-tag-preview-photo{font-size:11px}#nameTagStyle{grid-column:1/-1;border-top:1px solid var(--border-soft);padding-top:8px}#nameTagStyle summary{font-size:12px;min-height:32px}#nameTagDialog .modal-header{padding:16px}#nameTagDialog .modal-header h2{font-size:16px}#nameTagDialog .modal-header p{font-size:11px;margin-top:4px}#tagStyleRemove[hidden]{display:none!important}#nameTagDialog .modal-footer{gap:8px;padding:12px 16px}#nameTagDialog .modal-footer .button{font-size:12px;min-height:36px}
@media(max-width:520px){.name-tag-body{grid-template-columns:minmax(0,1fr);gap:12px}.name-tag-preview-wrap{width:128px;justify-self:center}#nameTagText{font-size:16px}#nameTagDialog .modal-footer .button{min-height:44px}.name-tag-dialog{max-height:90dvh}}

/* Keep all formatting visible on entry, as in the supplied reference. */
.name-tag-dialog{width:min(680px,calc(100vw - 24px));max-height:calc(100dvh - 24px)}
#nameTagDialog #tagStylePanel{padding:12px;gap:12px 16px}
#nameTagDialog #tagStylePanel>label{font-size:12px;gap:6px}
#nameTagDialog .modal-footer{position:sticky;bottom:0;background:var(--surface);z-index:1}
@media(max-width:520px){.name-tag-dialog{width:calc(100vw - 16px);max-height:calc(100dvh - 16px)}#nameTagDialog #tagStylePanel{gap:12px;padding:12px}.name-tag-preview-wrap{width:112px}}

.box-clipboard-actions{display:flex;gap:8px;flex-wrap:wrap}.custom-sidebar>.box-clipboard-actions{margin-top:12px}.box-clipboard-actions .button{flex:1;min-width:56px}@media(max-width:1000px){.box-clipboard-actions .button{min-height:44px}}

.how-to-use{align-self:flex-start;flex:none;margin-top:8px;text-decoration:underline;text-underline-offset:3px;font-size:12px}
.how-to-dialog{width:min(820px,calc(100vw - 24px));max-height:calc(100dvh - 32px);padding:0;overflow:hidden}
.how-to-dialog[open]{display:flex;flex-direction:column}.how-to-dialog:not([open]){display:none}
.how-to-dialog>.modal-header,.how-to-dialog>.modal-footer{flex:none}.how-to-dialog>.modal-header{gap:16px}.how-to-dialog .icon-button{flex:none;min-width:44px;min-height:44px}
.how-to-content{overflow-y:auto;overscroll-behavior:contain;min-height:0;padding:20px 24px;color:var(--fg-2);font:14px/1.65 var(--font-body)}
.how-to-content section{margin-block:24px;scroll-margin-top:16px}.how-to-content h3{font:600 18px/1.4 var(--font-body);color:var(--fg);margin:0 0 12px}.how-to-content h4{font:600 14px/1.5 var(--font-body);color:var(--fg);margin:0 0 4px}.how-to-content p{margin:0 0 12px;max-width:72ch}.how-to-content strong{color:var(--fg);font-weight:600}
.how-to-steps{padding-left:24px;margin:0;display:grid;gap:20px}.how-to-steps li{padding-left:4px}.how-to-steps li::marker{color:var(--accent);font-weight:600}
.how-to-index{display:flex;flex-wrap:wrap;gap:8px 16px;padding-bottom:16px;border-bottom:1px solid var(--border-soft)}.how-to-index a{display:inline-flex;align-items:center;min-height:44px;color:var(--accent);text-underline-offset:4px;font-size:13px}
.how-to-content kbd{display:inline-block;padding:0 4px;border:1px solid var(--border);border-radius:3px;background:var(--sidebar);color:var(--fg);font:12px/1.7 var(--font-mono)}
.how-to-table{margin-bottom:16px}.how-to-table table{border-collapse:collapse;width:100%;table-layout:fixed}.how-to-table th,.how-to-table td{padding:12px 8px;text-align:left;vertical-align:top;border-bottom:1px solid var(--border-soft);overflow-wrap:anywhere}.how-to-table th{color:var(--fg);font-size:13px}.how-to-table th:first-child{width:34%}.how-to-table td{font-size:13px;line-height:1.6}
.how-to-content details{border-top:1px solid var(--border-soft);padding:8px 0}.how-to-content summary{cursor:pointer;min-height:44px;align-content:center;color:var(--fg);font-size:14px}.how-to-content details p{padding-top:8px}
@media(max-width:767px){.how-to-dialog{width:calc(100vw - 16px);max-height:calc(100dvh - 16px)}.how-to-content{padding:16px;font-size:14px}.how-to-use{min-height:44px}.how-to-table th,.how-to-table td{padding:10px 6px}.how-to-dialog>.modal-footer .button{min-height:44px}}
