:root{font-family:system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;color:#20242c;background:#f3f4f6;font-synthesis:none;text-rendering:optimizeLegibility;--ink:#20242c;--muted:#858c98;--line:#e7e9ed;--accent:#6758df;--accent-dark:#5748ca;--purple-wash:#f1efff;--green:#3a9b74;--shadow:0 8px 28px rgba(32,36,44,.045)}*{box-sizing:border-box}body{margin:0;min-width:850px;min-height:100vh;background:#f4f5f7}.topbar{height:76px;display:flex;align-items:center;justify-content:space-between;padding:0 30px;background:#fff;border-bottom:1px solid #e9eaee}.brand,.top-actions{display:flex;align-items:center;gap:12px}.brand-mark{width:38px;height:38px;background:#ebe8ff;color:#6758df;border-radius:12px;display:grid;place-items:center;font-size:23px}.brand strong{font:750 16px system-ui,sans-serif;letter-spacing:-.3px}.brand small{display:block;color:#9298a3;font-size:11px;margin-top:1px}.save-state{font-size:12px;color:#777f8c;margin-right:12px}.save-state i,.green-dot{display:inline-block;width:7px;height:7px;border-radius:9px;background:#56b78c;margin-right:7px}.button{border:0;border-radius:9px;padding:10px 15px;font:600 12px system-ui,sans-serif;cursor:pointer;transition:transform .15s,background .15s,box-shadow .15s}.button:active{transform:translateY(1px)}.button:disabled{opacity:.45;cursor:default}.primary{background:var(--accent);color:#fff;box-shadow:0 3px 8px #6758df32}.primary:hover:not(:disabled){background:var(--accent-dark);box-shadow:0 5px 12px #6758df44}.quiet{background:#f1f2f5;color:#525965}.quiet:hover:not(:disabled){background:#e9eaf0}.outline{background:#fff;color:#5548c8;border:1px solid #d9d4ff}.outline:hover{background:#f8f7ff}.workspace{height:calc(100vh - 76px);min-height:650px;display:grid;grid-template-columns:245px minmax(400px,1fr) minmax(350px,430px);gap:17px;padding:18px}.panel{background:#fff;border:1px solid #e9eaee;border-radius:13px;box-shadow:var(--shadow)}.left-panel{display:flex;flex-direction:column;padding:20px 15px 13px;min-height:0}.section-heading,.panel-title{display:flex;align-items:center;justify-content:space-between}.section-heading{margin:0 2px 20px}.eyebrow{display:block;color:#9298a5;font-size:9px;font-weight:700;letter-spacing:1.2px}.section-heading h2,.panel-title h2,.modal-header h2{font:750 16px system-ui,sans-serif;letter-spacing:-.4px;margin:5px 0 0}.icon-button{border:0;background:#f3f4f7;color:#5f6671;border-radius:8px;width:31px;height:31px;font-size:19px;cursor:pointer}.icon-button:hover{background:#eae8ff;color:var(--accent)}.drop-zone{border:1px dashed #d6d8e2;background:#fafaff;border-radius:10px;min-height:136px;display:flex;flex-direction:column;align-items:center;justify-content:center;color:#555d69;gap:3px;transition:.2s}.drop-zone.dragging{border-color:var(--accent);background:#f4f2ff}.upload-icon{height:27px;width:27px;border-radius:9px;background:#ebe8ff;color:var(--accent);display:grid;place-items:center;margin-bottom:3px;font-size:17px}.drop-zone strong{font-size:12px}.drop-zone span{font-size:11px;color:#9095a0}.drop-zone small{font-size:9px;color:#a0a5ae;margin-top:6px}.text-button{border:0;background:transparent;color:var(--accent);font:600 11px system-ui,sans-serif;cursor:pointer;padding:3px}.text-button:hover{text-decoration:underline}.text-button.subtle{color:#9298a3}.photo-list{overflow:auto;margin-top:13px;display:flex;flex-direction:column;gap:7px}.photo-card{display:flex;gap:10px;align-items:center;padding:7px;border:1px solid transparent;border-radius:9px;cursor:pointer;min-width:0}.photo-card:hover{background:#f8f8fb}.photo-card.selected{background:#f4f2ff;border-color:#e3dfff}.photo-thumb{width:44px;height:49px;object-fit:cover;background:#eee;border-radius:6px}.photo-meta{min-width:0}.photo-meta strong{display:block;font-size:11px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.photo-meta small{display:block;color:#969ca6;font-size:9px;margin-top:4px}.photo-remove{margin-left:auto;background:none;border:0;color:#abb0b8;font-size:15px;cursor:pointer}.empty-note{font-size:10px;line-height:1.55;color:#a0a5ae;text-align:center;padding:17px 11px}.library-footer{margin-top:auto;border-top:1px solid #f0f0f3;padding-top:12px;display:flex;justify-content:space-between;color:#a0a5ae;font-size:10px}.center-panel{display:flex;flex-direction:column;min-width:0;gap:13px}.toolbar{min-height:62px;display:flex;align-items:center;gap:14px;padding:10px 16px}.tool-group{display:flex;flex-direction:column;gap:5px}.tool-group label,.field-label,.mini-label{font-size:8px;font-weight:700;letter-spacing:.9px;color:#959ba5}.tool-group select,.paper-select{border:0;color:#30343c;background:transparent;font:600 11px system-ui,sans-serif;outline:none}.toolbar-divider{height:26px;border-left:1px solid var(--line)}.zoom-control{display:flex;align-items:center;gap:8px;margin-left:auto;color:#777f8c}.zoom-control input{width:105px;accent-color:var(--accent)}.zoom-control b{font-size:10px;min-width:31px}.crop-panel{display:flex;flex-direction:column;min-height:0;flex:1;padding:17px}.crop-panel>.panel-title{margin-bottom:13px}.keyboard-hint{color:#a1a6af;font-size:9px}.crop-stage{background:#f7f8fa;border:1px solid #ebecef;border-radius:10px;overflow:hidden;position:relative;flex:1;min-height:300px;display:flex;align-items:center;justify-content:center}.crop-stage canvas{display:block;max-width:100%;max-height:100%;touch-action:none;cursor:grab}.crop-stage canvas:active{cursor:grabbing}.crop-empty{position:absolute;text-align:center;color:#9da3ad;display:flex;align-items:center;flex-direction:column;gap:7px}.empty-photo-icon{width:45px;height:45px;border-radius:13px;background:#eeeff3;color:#b1b5be;display:grid;place-items:center;font-size:22px}.crop-empty strong{font-size:12px;color:#777e89}.crop-empty span{font-size:10px}.crop-badge{position:absolute;top:12px;left:13px;padding:6px 9px;background:#272d38b8;color:#fff;border-radius:5px;font-size:8px;letter-spacing:.8px;display:flex;align-items:center;gap:6px}.crop-move-icon{width:13px;height:13px;flex:none;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.crop-footer{display:flex;align-items:center;justify-content:space-between;padding-top:12px;color:#8d939e;font-size:10px}.below-hint{display:flex;align-items:center;gap:8px;color:#969ca6;font-size:10px;padding:2px 4px}.tip-icon{color:#9b8ff0}.right-panel{padding:18px 17px;display:flex;flex-direction:column;min-height:0}.preview-title{align-items:flex-end}.preview-title h2{font-size:17px}.print-button{padding:9px 12px}.template-current{margin-top:17px;background:#f8f8fc;border:1px solid #efeff4;border-radius:9px;display:flex;justify-content:space-between;align-items:center;padding:9px 11px}.template-current strong{display:block;font-size:10px;margin-top:4px;font-weight:650}.mini-label{font-size:7px}.sheet-wrap{flex:1;min-height:0;background:#f2f3f6;border-radius:10px;margin-top:13px;display:flex;align-items:center;justify-content:center;overflow:hidden;padding:13px}.sheet{position:relative;background:#fff;box-shadow:0 4px 18px #242b3820;border:1px solid #e1e3e8;width:min(100%,calc((100vh - 330px)*.707));max-height:100%;aspect-ratio:210 / 297;overflow:hidden}.printable-guide{position:absolute;left:1.68%;top:1.19%;width:96.64%;height:97.62%;border:1px dashed #8ec6aa;pointer-events:none;z-index:3}.sheet-items{position:absolute;inset:0}.photo-slot{position:absolute;overflow:hidden;background:#f0efff;border:1px solid #7166ce;color:#6054ce;display:grid;place-items:center;font-size:clamp(7px,.75vw,12px);font-weight:650}.photo-slot img{width:100%;height:100%;object-fit:cover;display:block}.photo-slot small{font-size:8px}.sheet-stats{display:flex;justify-content:space-between;gap:8px;color:#858b96;font-size:9px;padding:11px 1px 9px}.sheet-stats>span:first-child{display:flex;align-items:center}.green-dot{width:6px;height:6px}.template-actions{padding-bottom:11px}.full-width{width:100%}.template-actions .button{width:100%;padding:10px}.printer-note{border-top:1px solid #eff0f2;padding:11px 1px 0;color:#9096a0;display:flex;gap:7px;font-size:9px;line-height:1.5}.printer-note b{color:#626975;font-weight:650}.modal{border:0;border-radius:15px;padding:0;color:var(--ink);box-shadow:0 22px 80px #20242c35;max-height:90vh}.modal::backdrop{background:#21253273;backdrop-filter:blur(3px)}.template-modal{width:min(920px,92vw)}.modal-header{padding:23px 25px 18px;display:flex;justify-content:space-between;align-items:flex-start;border-bottom:1px solid #eff0f3}.modal-header h2{font-size:20px;margin-top:6px}.modal-header p{color:#9197a2;font-size:11px;margin:6px 0 0}.template-filters{padding:14px 24px;display:flex;justify-content:space-between;align-items:center;color:#969ca6;font-size:10px}.template-filters input,.name-input{border:1px solid #e2e4e9;border-radius:8px;background:#fafbfc;padding:10px 12px;font:11px system-ui,sans-serif;outline:none}.template-filters input{width:280px}.template-filters input:focus,.name-input:focus{border-color:#a9a0f3;box-shadow:0 0 0 3px #6758df15}.template-grid{padding:0 24px 25px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;max-height:60vh;overflow:auto}.template-card{border:1px solid #eaebef;background:#fff;border-radius:10px;padding:11px;display:flex;gap:13px;align-items:center;text-align:left;cursor:pointer;min-height:121px;transition:.16s}.template-card:hover{border-color:#b8b1f3;box-shadow:0 5px 15px #6758df13;transform:translateY(-1px)}.template-card.active{border-color:#8175e6;background:#faf9ff}.template-mini{height:96px;width:68px;flex:none;border:1px solid #dce0e6;background:white;position:relative;overflow:hidden;box-shadow:0 2px 5px #30394a12}.mini-slot{position:absolute;background:#c9c3fa;border:1px solid #8175e6}.template-card-copy strong{font:700 11px system-ui,sans-serif;line-height:1.4;display:block}.template-card-copy small{color:#9399a3;font-size:9px;line-height:1.5;display:block;margin-top:6px}.custom-modal{width:min(1000px,94vw)}.custom-body{display:grid;grid-template-columns:275px 1fr;min-height:450px;max-height:66vh}.custom-sidebar{padding:18px 17px;border-right:1px solid #eeeef2;display:flex;flex-direction:column;min-height:0}.name-input{margin-top:6px}.paper-label{margin-top:15px}.paper-select{margin-top:6px;border:1px solid #e2e4e9;background:#fafbfc;border-radius:8px;padding:9px 10px}.palette-heading{display:flex;justify-content:space-between;align-items:center;margin-top:20px;margin-bottom:8px}.palette-heading span+span{font-size:7px;color:#a3a8b1;letter-spacing:.7px}.size-palette{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;overflow:auto;min-height:0}.size-tile{background:#fff;border:1px solid #e5e7eb;border-radius:8px;padding:7px 5px 6px;min-height:66px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;cursor:grab;user-select:none;transition:.12s}.size-tile:hover{border-color:#aca4ed;background:#faf9ff}.size-tile:active{cursor:grabbing}.tile-art{background:#d9d5fb;border:1px solid #7d70df;max-width:48px;max-height:38px;min-width:12px;min-height:12px}.size-tile span{font-size:8px;color:#69707c;text-align:center;line-height:1.2}.deleteBox{margin-top:11px}.snap-hint{color:#9ba1ab;font-size:9px;line-height:1.45;margin:8px 2px 0}.custom-canvas-area{background:#f3f4f7;padding:22px;display:flex;flex-direction:column;align-items:center;justify-content:center;min-width:0;overflow:auto}.custom-paper-frame{height:min(50vh,520px);aspect-ratio:210/297;max-width:100%;display:flex;justify-content:center;align-items:center}.custom-paper{height:100%;aspect-ratio:210/297;position:relative;background:#fff;box-shadow:0 5px 25px #212b3a1e;border:1px solid #dfe1e6;overflow:hidden}.custom-printable{position:absolute;inset:1.19% 1.68% 1.19%;border:1px dashed #8ec6aa;pointer-events:none}.custom-box{position:absolute;display:flex;align-items:center;justify-content:center;text-align:center;background:#d9d5fb;border:1px solid #6758df;color:#5146b5;font-size:clamp(7px,.7vw,10px);font-weight:650;cursor:grab;user-select:none;touch-action:none}.custom-box:hover{box-shadow:0 0 0 2px #6758df45}.custom-box.selected{outline:2px solid #6758df;outline-offset:2px;z-index:2}.custom-box.dragging{cursor:grabbing;opacity:.85}.custom-canvas-footer{width:100%;display:flex;justify-content:space-between;color:#969ca5;font-size:8px;margin-top:12px}.modal-footer{border-top:1px solid #eff0f3;padding:13px 21px;display:flex;justify-content:flex-end;gap:8px}.toast{position:fixed;bottom:22px;left:50%;transform:translate(-50%,16px);opacity:0;background:#272d38;color:#fff;border-radius:9px;padding:11px 16px;font-size:11px;box-shadow:0 7px 30px #1c233233;pointer-events:none;transition:.2s;z-index:20}.toast.show{opacity:1;transform:translate(-50%,0)}
@media(max-width:1200px){.workspace{grid-template-columns:205px minmax(360px,1fr) 345px;gap:11px;padding:12px}.right-panel{padding:14px}.left-panel{padding:15px 11px}.sheet-stats{font-size:8px}}
@media(max-width:1000px){body{min-width:760px}.workspace{height:auto;min-height:calc(100vh - 70px);grid-template-columns:195px minmax(430px,1fr)}.right-panel{grid-column:1/-1;min-height:600px}.sheet{width:min(55%,320px)}.crop-stage{min-height:440px}}
@media print{html,body{background:white!important;margin:0!important;min-width:0!important}.topbar,.left-panel,.center-panel,.right-panel>*:not(.sheet-wrap),.sheet-stats,.template-actions,.printer-note,.modal,.toast{display:none!important}.workspace{display:block;height:auto;min-height:0;padding:0;margin:0}.right-panel{display:block;padding:0;border:0;box-shadow:none}.sheet-wrap{display:block;padding:0;margin:0;background:white;border-radius:0;overflow:visible}.sheet{display:block!important;width:210mm;height:297mm;max-height:none;max-width:none;aspect-ratio:auto;border:0;box-shadow:none;overflow:hidden}.printable-guide{display:none}.photo-slot{print-color-adjust:exact;-webkit-print-color-adjust:exact}.photo-slot img{-webkit-print-color-adjust:exact;print-color-adjust:exact}@page{size:A4 portrait;margin:0}}
.custom-paper{max-width:100%;max-height:100%}@media print{.outside-printable{display:none!important}}
.live-crop-label{color:#7b8390;font-size:9px;display:flex;align-items:center;gap:6px}.live-crop-label i{width:6px;height:6px;background:#56b78c;border-radius:50%}
.face-status{color:#7b8390;font-size:9px}.face-status[data-state="detected"]{color:#327c5e}.face-status[data-state="error"]{color:#a35340}.face-status[data-state="detecting"]{color:#5548c8}
.crop-empty[hidden],.crop-badge[hidden]{display:none!important}
dialog.custom-modal:not([open]){display:none}
dialog.custom-modal{width:min(1040px,95vw);height:min(940px,94vh);max-height:94vh;display:flex;flex-direction:column;overflow:hidden}.custom-modal .modal-header{padding:19px 24px 15px;flex:none}.custom-modal .modal-header h2{font-size:19px}.custom-body{flex:1;min-height:0;max-height:none;grid-template-columns:275px minmax(0,1fr)}.custom-sidebar{overflow:hidden}.size-palette{flex:1;align-content:start}.custom-canvas-area{min-height:0;padding:16px;overflow:hidden}.custom-paper-frame{flex:none;max-width:100%;max-height:100%;height:auto;width:auto}.custom-paper{width:100%;height:100%;max-width:none;max-height:none}.custom-paper{box-sizing:border-box}.custom-printable{z-index:1;box-shadow:0 0 0 2000px rgba(54,65,82,.11)}#customBoxes{position:absolute;inset:0;z-index:2;pointer-events:none}.custom-box{pointer-events:auto}.custom-box.outside-safe{opacity:.42}.custom-canvas-footer{flex:none}.custom-modal .modal-footer{flex:none;background:#fff;position:relative;z-index:5}.custom-box.overlap{background:#ffe1df;border-color:#d6443a;color:#9e2820}
.custom-canvas-area{align-items:stretch;justify-content:flex-start;gap:8px}
.paper-viewport{flex:1;min-height:0;width:100%;overflow:auto;display:flex;align-items:safe center;justify-content:safe center}
.paper-zoom-stage{flex:none;display:flex;align-items:center;justify-content:center}
.custom-paper-frame{width:100%;height:100%;aspect-ratio:auto;max-width:none;max-height:none;display:block;flex:none}
.custom-paper{width:100%;height:100%;aspect-ratio:auto}
.custom-canvas-footer{margin-top:0}
.paper-zoom-bar{width:100%;min-height:36px;flex:none;border-top:1px solid #e7e8ec;display:flex;align-items:center;justify-content:center;gap:9px;color:#858c98}
.paper-zoom-bar>span{font-size:8px;font-weight:700;letter-spacing:.9px}
.paper-zoom-bar input{width:min(220px,35%);accent-color:var(--accent)}
.paper-zoom-bar strong{min-width:34px;font-size:10px}
.zoom-step{border:0;border-radius:6px;width:25px;height:25px;background:#fff;color:#545b67;font-size:16px;line-height:1;cursor:pointer}
.zoom-step:hover{background:#ebe8ff;color:var(--accent)}
.custom-paper:focus{outline:2px solid #a9a0f3;outline-offset:2px}
.box-context-menu{position:fixed;z-index:40;min-width:190px;padding:5px;background:#fff;border:1px solid #e1e3e9;border-radius:9px;box-shadow:0 8px 28px #20242c30}
.box-context-menu[hidden]{display:none}
.box-context-menu button{display:block;width:100%;border:0;border-radius:6px;background:transparent;text-align:left;padding:9px 10px;color:#30343c;font:500 12px system-ui,sans-serif;cursor:pointer}
.box-context-menu button:hover{background:#f1efff;color:#5146b5}
.box-context-menu button[hidden]{display:none}
.photo-assignment-hint{display:block;padding:4px 3px;color:#858c98;font-size:9px;line-height:1.45}
.photo-assignment-hint[hidden]{display:none}
.custom-box.has-name-tag{display:flex;flex-direction:column;justify-content:stretch;background:transparent;border:0}
.custom-photo-area{width:100%;flex:none;display:grid;place-items:center;text-align:center;background:#d9d5fb;border:1px solid #6758df;color:#5146b5;font-size:clamp(7px,.7vw,10px);font-weight:650}
.name-tag-preview{position:static;width:100%;flex:none;display:grid;place-items:center;background:#fff;border:1px solid #30343c;color:#20242c;font-size:clamp(6px,.62vw,9px);font-weight:600;line-height:1.1;overflow:hidden;overflow-wrap:anywhere;padding:1px 2px}
.custom-box.has-name-tag.selected{outline:2px solid #6758df;outline-offset:2px}
.photo-slot.name-tag-slot{display:flex;flex-direction:column;overflow:visible;background:transparent;border:0;color:#20242c;font-weight:500}
.photo-image-frame{width:100%;min-height:0;flex:none;display:grid;place-items:center;overflow:hidden;background:#f0efff;border:1px solid #7166ce;color:#6054ce}
.photo-image-frame img{width:100%;height:100%;object-fit:cover;display:block}
.photo-name-tag{width:100%;flex:none;display:grid;place-items:center;overflow:hidden;background:#fff;border:1px solid #30343c;color:#20242c;font:600 clamp(6px,.62vw,9px)/1.1 system-ui,sans-serif;text-align:center;overflow-wrap:anywhere;padding:1px 2px}

.custom-box:hover{z-index:5}
.rotate-box-button{position:absolute;z-index:9;right:3px;bottom:3px;width:20px;height:20px;padding:0;border:1px solid #d9d4ff;border-radius:6px;background:#fff;color:#5548c8;font:600 14px/18px system-ui,sans-serif;box-shadow:0 2px 8px #20242c20;cursor:pointer;opacity:0;visibility:hidden;transition:opacity .12s ease,background .12s ease}
.rotate-box-button:hover{background:#f1efff}
.custom-box:hover .rotate-box-button,.custom-box.selected .rotate-box-button,.photo-slot:hover .rotate-box-button,.photo-slot.live-selected .rotate-box-button,.rotate-box-button:focus-visible{opacity:1;visibility:visible}
.add-tag-hover{position:absolute;z-index:8;top:-25px;right:0;border:1px solid #d9d4ff;border-radius:6px;background:#fff;color:#5548c8;padding:4px 7px;font:600 9px system-ui,sans-serif;white-space:nowrap;opacity:0;visibility:hidden;cursor:pointer;box-shadow:0 2px 8px #20242c20;pointer-events:none}
.custom-box:hover .add-tag-hover,.custom-box.selected .add-tag-hover,.add-tag-hover:focus{opacity:1;visibility:visible;pointer-events:auto}
.photo-slot.has-live-tag-control{overflow:visible;cursor:pointer}
.photo-slot.live-selected{outline:2px solid #6758df;outline-offset:2px;z-index:6}
.live-add-tag{position:absolute;z-index:8;top:-22px;right:0;border:1px solid #d9d4ff;border-radius:6px;background:#fff;color:#5548c8;padding:4px 7px;font:600 9px system-ui,sans-serif;white-space:nowrap;opacity:0;visibility:hidden;pointer-events:none;cursor:pointer;box-shadow:0 2px 8px #20242c20}
.photo-slot:hover .live-add-tag,.photo-slot.live-selected .live-add-tag,.live-add-tag:focus{opacity:1;visibility:visible;pointer-events:auto}
.live-assign-photo{position:absolute;z-index:8;top:-44px;right:0;border:1px solid #d9d4ff;border-radius:6px;background:#fff;color:#5548c8;padding:4px 7px;font:600 9px system-ui,sans-serif;white-space:nowrap;opacity:0;visibility:hidden;pointer-events:none;cursor:pointer;box-shadow:0 2px 8px #20242c20}
.photo-slot:hover .live-assign-photo,.photo-slot.live-selected .live-assign-photo,.live-assign-photo:focus{opacity:1;visibility:visible;pointer-events:auto}

.tag-help{margin:4px 0 0;color:#8b929d;font-size:9px;line-height:1.35}
.live-add-tag{top:3px;right:3px}
.add-tag-hover{top:3px;right:3px}
.tag-style-toggles{display:flex;gap:14px;margin-top:7px}
.tag-style-toggles label{display:flex;align-items:center;gap:5px;color:#545b67;font-size:10px}
.photo-name-tag,.name-tag-preview{white-space:pre-wrap;overflow-wrap:anywhere}

/* Name tags use one shared composition in the editor preview, sheet preview, and print. */
.photo-slot.name-tag-slot{display:flex;flex-direction:column;overflow:visible;background:transparent;border:0;color:var(--ink);font-weight:500}
.name-tag-photo{width:100%;min-height:0;flex:none;display:grid;place-items:center;overflow:hidden;background:#f0efff;border:1px solid #7166ce;color:#6054ce}
.name-tag-image{width:100%;height:100%;object-fit:cover;display:block}
.name-tag-band{box-sizing:border-box;width:100%;flex:none;display:grid;place-items:center;overflow:hidden;background:#fff;border:1px solid #30343c;color:#20242c;text-align:center;white-space:pre-wrap;overflow-wrap:anywhere;padding:1mm}
@media print{.live-add-tag,.live-assign-photo,.add-tag-hover,.rotate-box-button{display:none!important}.photo-slot.live-selected{outline:none!important}.name-tag-band{font-size:inherit}}


/* One-click, on-device background removal progress dialog. */
.auto-background-dialog{width:min(360px,90vw);padding:28px 30px;text-align:center}
.auto-background-dialog h2{margin:10px 0 5px;font-size:18px}
.auto-background-dialog p{margin:0;color:#727987;font-size:12px;line-height:1.5}
.auto-background-dialog small{display:block;margin-top:14px;color:#9298a3;font-size:10px}
.auto-background-spinner{width:30px;height:30px;margin:0 auto 16px;border:3px solid #e8e5ff;border-top-color:var(--accent);border-radius:50%;animation:subject-spin .8s linear infinite}
@keyframes subject-spin{to{transform:rotate(360deg)}}
.auto-background-dialog::backdrop{background:#21253273;backdrop-filter:blur(3px)}
.auto-background-dialog:not([open]){display:none}
/* Give the crop workspace and live print sheet matching widths. */
.workspace{grid-template-columns:245px minmax(0,1fr) minmax(0,1fr)}
@media(max-width:1200px){.workspace{grid-template-columns:205px minmax(0,1fr) minmax(0,1fr)}}
.sheet-zoom-bar{min-height:34px;flex:none;margin-top:9px;display:flex;align-items:center;justify-content:flex-end;gap:7px;padding:0 3px;color:#858c98}
.sheet-zoom-bar>span{margin-right:auto;font-size:8px;font-weight:700;letter-spacing:.9px}
.sheet-zoom-bar input{width:min(150px,25%);accent-color:var(--accent)}
.sheet-zoom-bar strong{min-width:35px;font-size:10px}
.sheet-wrap{padding:0;overflow:auto;align-items:flex-start;justify-content:flex-start}
.sheet-zoom-stage{box-sizing:border-box;min-width:100%;min-height:100%;flex:none;display:flex;align-items:center;justify-content:center;padding:13px}
.sheet{max-width:none;max-height:none;flex:none}
@media print{.sheet-zoom-bar{display:none!important}.sheet-wrap{padding:0!important;overflow:visible!important}.sheet-zoom-stage{display:block!important;width:100%!important;height:auto!important;min-width:0!important;min-height:0!important;padding:0!important}}

/* Roomier main workspace and crop toolbar. */
.workspace{grid-template-columns:minmax(210px,245px) minmax(0,1fr) minmax(0,1fr);gap:20px;padding:20px}
.toolbar{display:grid;grid-template-columns:minmax(112px,1fr) auto auto auto minmax(120px,1.1fr);gap:11px;padding:11px 14px}
.toolbar .tool-group{min-width:0}
.toolbar .tool-group select{width:100%;min-width:0}
.toolbar .button{min-height:38px;padding:8px 13px;font-size:11px;white-space:nowrap}
.background-actions{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,.78fr);gap:6px;min-width:0}
.toolbar .background-actions .button{width:100%;min-width:0;padding-inline:7px;font-size:10px;justify-content:center}
.toolbar-divider{height:32px}
.zoom-control{min-width:0;gap:7px}
.zoom-control input{width:auto;min-width:45px;flex:1}
.crop-panel>.panel-title{gap:14px}
.keyboard-hint{text-align:right}
.section-heading{margin-bottom:22px}
.left-panel,.right-panel{padding:20px}
@media(max-width:1440px){
  .toolbar{display:grid;grid-template-columns:minmax(120px,.85fr) minmax(180px,1.4fr);grid-template-areas:"size zoom" "reset background";gap:9px 12px;padding:12px 14px}
  .toolbar-divider{display:none}
  .toolbar>.tool-group{grid-area:size;min-width:0}
  .toolbar>.zoom-control{grid-area:zoom;margin:0;min-width:0}
  .toolbar>#resetCrop{grid-area:reset;width:100%;min-width:0}
  .toolbar>.background-actions{grid-area:background;width:100%;min-width:0}
}
@media(max-width:1200px){
  .workspace{grid-template-columns:205px minmax(0,1fr) minmax(0,1fr);gap:15px;padding:15px}
  .left-panel,.right-panel{padding:16px}
  .toolbar{grid-template-columns:minmax(105px,.8fr) minmax(150px,1.2fr);gap:8px 10px}
  .toolbar .button{width:100%;min-width:0;justify-content:center;padding-inline:8px;font-size:10px}
}
@media(max-width:1000px){
  .workspace{height:auto;min-height:calc(100vh - 70px);grid-template-columns:195px minmax(0,1fr);gap:14px;padding:14px}
  .right-panel{grid-column:1/-1;min-height:600px;padding:18px}
  .sheet{width:min(55%,320px)}
  .crop-stage{min-height:440px}
}
/* Add a correctly sized photo box directly onto unused paper space. */
.sheet-add-box{position:absolute;z-index:9;transform:translate(-50%,-50%);width:30px;height:30px;padding:0;display:grid;place-items:center;border:1px solid #fff;border-radius:50%;background:var(--accent);color:#fff;font:500 23px/1 system-ui,sans-serif;box-shadow:0 2px 10px #29234a35;cursor:pointer}
.sheet-add-box:hover{background:var(--accent-dark);transform:translate(-50%,-50%) scale(1.07)}
.sheet-add-box[hidden],.live-size-menu[hidden]{display:none!important}
.live-size-menu{position:fixed;z-index:1001;width:min(300px,calc(100vw - 20px));max-height:min(390px,75vh);overflow:auto;padding:7px;background:#fff;border:1px solid #e4e5eb;border-radius:11px;box-shadow:0 12px 34px #2529392b}
.live-size-menu-heading{padding:8px 9px 7px;color:#777f8c;font-size:10px;font-weight:700;border-bottom:1px solid #eff0f3}
.live-size-option{display:grid;grid-template-columns:54px minmax(0,1fr);align-items:center;gap:9px;width:100%;min-height:48px;padding:6px 8px;border:0;border-radius:7px;background:#fff;color:var(--ink);text-align:left;cursor:pointer}
.live-size-option:hover,.live-size-option:focus-visible{background:#f6f4ff;outline:0}
.live-size-option>i{display:block;justify-self:center;max-width:46px;max-height:32px;border:1px solid #7568db;background:#f0efff}
.live-size-option strong{display:block;font-size:10px;font-weight:650;line-height:1.3}
.live-size-option small{display:block;margin-top:2px;color:#858c98;font-size:9px}
.photo-slot.extra-photo-slot{cursor:grab;touch-action:none}
.photo-slot.extra-photo-slot:active,.photo-slot.extra-photo-slot.dragging{cursor:grabbing}
.photo-slot.extra-photo-slot.dragging{z-index:7;opacity:.82}
.photo-slot.extra-photo-slot.move-invalid{outline:2px solid #d6443a;opacity:.55}
.photo-slot.live-draggable{cursor:grab;touch-action:none;user-select:none;-webkit-user-select:none}
.photo-slot.live-draggable img{pointer-events:none;-webkit-user-drag:none;user-drag:none}
.photo-slot.live-draggable:active,.photo-slot.live-draggable.dragging{cursor:grabbing}
.photo-slot.live-draggable.dragging{z-index:7;opacity:.82}
.photo-slot.live-draggable.move-invalid{outline:2px solid #d6443a;opacity:.55}
.sheet-snap-guides{position:absolute;inset:0;z-index:8;pointer-events:none}
.sheet-snap-guides i{position:absolute;display:block;opacity:.58}
.sheet-snap-guides .snap-guide-x{top:1.19%;height:97.62%;border-left:.5px dashed rgba(0,0,0,.55)}
.sheet-snap-guides .snap-guide-y{left:1.68%;width:96.64%;border-top:.5px dashed rgba(0,0,0,.55)}
.sheet-snap-guides i[hidden]{display:none}
@media print{#sheetAddBox,#liveSizeMenu,#sheetSnapGuides{display:none!important}}

/* Put more emphasis on the print sheet and keep empty work areas compact. */
@media(min-width:1001px){
  .workspace{grid-template-columns:minmax(205px,245px) minmax(0,.86fr) minmax(0,1.14fr);gap:18px;padding:18px}
}
.crop-panel.empty{flex:0 0 auto}
.crop-panel.empty .crop-stage{flex:none;height:clamp(230px,34vh,330px);min-height:230px}
.right-panel{padding:17px 18px}
.template-current{margin-top:10px;padding:7px 10px;min-height:42px}
.sheet-zoom-bar{min-height:30px;margin-top:3px}
.sheet-wrap{margin-top:8px;padding:8px}
.sheet-stats{padding:7px 1px 5px}
.template-actions{display:flex;justify-content:flex-end;padding:0 0 7px}
.template-actions .button{width:auto;padding:7px 11px;font-size:10px;white-space:nowrap}
.printer-note{padding-top:7px;font-size:8px;line-height:1.35}
@media(max-width:1000px){
  .workspace{grid-template-columns:195px minmax(0,1fr)}
  .crop-panel.empty .crop-stage{height:clamp(230px,34vh,330px)}
}
.layout-actions-row{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:9px}
.layout-actions-row .template-current{min-width:0;margin:0;padding:6px 9px}
.layout-actions-row .template-current>div{min-width:0}
.layout-actions-row .template-current strong{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.layout-actions-row .template-actions{flex:none;padding:0}
.layout-actions-row .template-actions .button{min-height:34px;padding:7px 10px}
@media(max-width:1200px){
  .layout-actions-row{grid-template-columns:minmax(0,1fr)}
  .layout-actions-row .template-actions{justify-content:flex-end}
}
.topbar .print-button{white-space:nowrap;min-width:112px}
.preview-title{align-items:center;gap:12px}
.preview-title>div{min-width:0}
.preview-title .tag-help{max-width:300px}
.preview-title .sheet-zoom-bar{flex:0 0 auto;min-height:0;margin:0;padding:0;gap:4px;justify-content:flex-end;white-space:nowrap}
.preview-title .sheet-zoom-bar>span{margin:0;font-size:7px}
.preview-title .sheet-zoom-bar input{width:clamp(58px,7vw,105px)}
.preview-title .sheet-zoom-bar .zoom-step{width:24px;height:26px}
@media(max-width:1280px){
  .preview-title{align-items:flex-start;flex-direction:column;gap:8px}
  .preview-title .sheet-zoom-bar{align-self:stretch;justify-content:flex-start}
  .preview-title .sheet-zoom-bar>span{margin-right:auto}
}

/* Name tags are edited in place on the photo, without a separate dialog. */
.name-tag-band[contenteditable="true"],.name-tag-preview[contenteditable="true"]{cursor:text;outline:2px solid #7465ee;outline-offset:1px;user-select:text;-webkit-user-select:text}
.name-tag-band[contenteditable="true"]:empty::before,.name-tag-preview[contenteditable="true"]:empty::before{content:"Type name here";color:#8b929d;font:500 10px system-ui,sans-serif}

/* Compact app header gives the photo workspace more vertical room. */
.topbar{height:60px;padding-inline:22px}
.brand-mark{width:32px;height:32px;border-radius:10px;font-size:20px}
.topbar .print-button{min-height:34px;padding:7px 11px}
.workspace{height:calc(100vh - 60px)}
@media(max-width:1000px){.workspace{min-height:calc(100vh - 60px)}}
.crop-stage{min-height:350px}
.template-card-select{flex:1;min-width:0;display:flex;align-items:center;gap:13px;padding:0;border:0;background:transparent;color:inherit;text-align:left;cursor:pointer}
.template-card-copy{min-width:0}
.template-edit-button{flex:none;align-self:center;min-height:34px;padding:7px 11px!important}

/* Keep the destructive library action quiet until the user needs it. */
.library-footer{align-items:center}
.clear-photos-button{width:32px;height:32px;display:grid;place-items:center;border:0;border-radius:8px;background:transparent;color:#8b919c;cursor:pointer;transition:background .15s,color .15s}
.clear-photos-button svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.clear-photos-button:hover{background:#fff0f0;color:#c33f49}
.clear-photos-button:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.clear-photos-button[hidden]{display:none}
.area-zoom-button{border:1px solid #ddd8ff;border-radius:7px;background:#fff;color:#5548c8;padding:5px 8px;font:600 9px system-ui,sans-serif;white-space:nowrap;cursor:pointer}
.area-zoom-button:hover,.area-zoom-button[aria-pressed="true"]{background:#f1efff;border-color:#a9a0f3}
.area-zoom-button:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
#sheetViewport.area-zoom-active{cursor:crosshair}
.sheet-area-marquee{position:fixed;z-index:1000;border:1px solid #6758df;background:#6758df26;box-shadow:0 0 0 9999px #20242c16;pointer-events:none}
.preview-controls{min-width:min(60%,520px);display:flex;flex:1;flex-direction:column;align-items:stretch;gap:3px}
.preview-controls>.area-zoom-button{align-self:flex-end}
.preview-controls>.sheet-zoom-bar{width:100%;margin:0;gap:8px}
.preview-controls>.sheet-zoom-bar input{flex:1;width:auto;min-width:220px;max-width:none}
@media(max-width:1280px){.preview-controls{width:100%;min-width:0;flex:none}.preview-controls>.area-zoom-button{align-self:flex-start}.preview-controls>.sheet-zoom-bar{width:100%}}
.preview-title{display:grid;grid-template-columns:minmax(0,1fr);align-items:stretch;gap:7px}
.preview-controls{width:100%;min-width:0;flex:none}
.preview-controls>.area-zoom-button{align-self:flex-start}
.preview-controls>.sheet-zoom-bar input{width:0;min-width:80px}
.preview-controls>.sheet-zoom-bar input:focus-visible{outline:2px solid var(--accent);outline-offset:2px;border-radius:4px}
.preview-controls{flex-direction:row;align-items:center;gap:10px}
.preview-controls>.area-zoom-button{align-self:center;flex:none}
.preview-controls>.sheet-zoom-bar{flex:1;min-width:0;min-height:30px}
.preview-controls>.sheet-zoom-bar input{min-width:60px}

/* Assign individual library photos directly to boxes on the print sheet. */
.photo-card[draggable="true"]{cursor:grab}
.photo-card.dragging{opacity:.5}
.photo-slot.photo-drop-target{outline:3px solid #6758df;outline-offset:2px;box-shadow:0 0 0 6px #6758df30;z-index:9}

/* Fluid, user-resizable workspace columns with a precise 3 px grab line. */
@media(min-width:1001px){
  .workspace{grid-template-columns:minmax(180px,18fr) 17px minmax(320px,35fr) 17px minmax(280px,47fr);gap:0}
  .panel-resizer{position:relative;align-self:stretch;width:17px;min-width:17px;cursor:col-resize;touch-action:none;user-select:none;outline:none}
  .panel-resizer::after{content:"";position:absolute;top:0;bottom:0;left:7px;width:3px;border-radius:3px;background:transparent;transition:background-color .15s,box-shadow .15s}
  .panel-resizer:hover::after,.panel-resizer:focus-visible::after,.resizing-panels .panel-resizer::after{background:var(--accent);box-shadow:0 0 0 3px #6758df20}
}
.resizing-panels{cursor:col-resize!important;user-select:none!important}
.resizing-panels *{cursor:col-resize!important;user-select:none!important}
@media(max-width:1000px){.panel-resizer{display:none}}
@media print{.panel-resizer{display:none!important}}

/* Compact, aligned formatting controls appear only while a name tag is edited. */
.tag-style-panel{position:fixed;z-index:40;left:50%;bottom:16px;transform:translateX(-50%);display:grid;grid-template-columns:minmax(145px,1.2fr) repeat(3,minmax(100px,.8fr)) auto auto auto auto;align-items:end;gap:10px;padding:12px 14px;background:#fff;border:1px solid #e4e5eb;border-radius:12px;box-shadow:0 10px 34px #20242c25;width:min(96vw,1050px)}
.tag-style-panel[hidden]{display:none!important}
.tag-style-panel>label{display:flex;flex-direction:column;gap:5px;color:#68707d;font-size:10px;font-weight:600;white-space:nowrap}
.tag-style-panel select,.tag-style-panel input[type=number]{height:36px;min-width:0;width:100%;padding:0 9px;border:1px solid #dfe2e8;border-radius:7px;background:#fff;color:#30343c;font:12px system-ui,sans-serif}
.tag-style-panel select{min-width:0}
.tag-number-control{display:flex;align-items:center;gap:7px}
.tag-number-control small{color:#7e8591;font-size:11px}
.tag-style-panel .tag-style-toggle{height:36px;flex-direction:row;align-items:center;gap:6px;padding:0 3px}
.tag-style-panel .tag-style-toggle input{accent-color:var(--accent)}
.tag-style-panel .button{height:36px;padding:0 13px;white-space:nowrap}
.tag-style-panel .tag-remove-button{color:#a33b42;background:#fff3f3}
.tag-style-panel .tag-remove-button:hover{background:#ffe6e7}
@media(max-width:900px){.tag-style-panel{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.tag-style-panel .tag-style-toggle{justify-content:flex-start}}
@media(max-width:520px){.tag-style-panel{left:8px;right:8px;bottom:8px;transform:none;width:auto;grid-template-columns:repeat(2,minmax(0,1fr));max-height:45vh;overflow:auto}.tag-style-panel #tagFont{grid-column:span 2}.tag-style-panel .button{width:100%}}
@media print{.tag-style-panel{display:none!important}}
.template-card{position:relative;padding-right:11px}
.template-card-actions{display:flex;flex-direction:column;gap:6px;flex:none;align-items:stretch}
.template-default-button{white-space:nowrap;min-height:31px;padding:6px 9px;font-size:10px}
.template-default-button:disabled{opacity:1;color:#6156cb;background:#f1efff;cursor:default}
.template-card{padding-bottom:39px}
.template-card-select{align-self:stretch;padding-bottom:4px}
.template-default-button{position:absolute;left:92px;bottom:9px;border:0;background:transparent;color:#777f8c;border-radius:5px;padding:4px 6px;font:550 9px system-ui,sans-serif;white-space:nowrap;cursor:pointer;transition:background .15s,color .15s}
.template-default-button:hover:not(:disabled){background:#f1efff;color:#5548c8}
.template-default-button:focus-visible{outline:2px solid #a9a0f3;outline-offset:1px}
.template-default-button.is-default{color:#6156cb;cursor:default}
.template-default-button:disabled{opacity:1}
.template-card-actions{position:absolute;right:11px;top:50%;transform:translateY(-50%)}

.sheet-content{position:absolute;left:50%;top:50%;transform-origin:center center;transition:transform .38s cubic-bezier(.2,.75,.25,1);will-change:transform}
.sheet-orientation{position:absolute;right:12px;bottom:12px;z-index:8;width:26px;height:26px;padding:0;border:1px solid #d9d4ff;border-radius:7px;background:#fff;color:#5548c8;font:600 18px/24px system-ui,sans-serif;text-align:center;box-shadow:0 2px 8px #20242c20;cursor:pointer;opacity:.9;transition:opacity .12s ease,background .12s ease,color .12s ease,transform .38s cubic-bezier(.2,.75,.25,1)}
.sheet-orientation:hover{background:#f1efff;color:var(--accent);opacity:1}
.sheet-orientation:focus-visible{outline:2px solid #a9a0f3;outline-offset:2px;opacity:1}
@media(prefers-reduced-motion:reduce){.sheet-content,.sheet-orientation{transition:none}}
@media print{.sheet-content{transition:none!important}.sheet-orientation{display:none!important}}


.sheet-zoom-stage{position:relative}


.sheet-stats{position:relative}
.sheet-stats>.sheet-orientation{position:absolute;left:auto;top:auto;right:0;bottom:calc(100% + 7px)}
.sheet-stats>.sheet-orientation{right:8px}
.custom-paper-frame{position:relative}
.custom-canvas-footer{position:relative}
.custom-canvas-footer>.sheet-orientation{position:absolute;right:8px;bottom:calc(100% + 7px);left:auto;top:auto}

/* Optional cloud sync controls */
.cloud-sync-button{border:1px solid #e4e1fb;border-radius:8px;background:#fff;color:#5b50c9;padding:7px 10px;font:600 10px system-ui,sans-serif;cursor:pointer;transition:background .15s,border-color .15s}.cloud-sync-button:hover{background:#f8f7ff;border-color:#cfc9ff}.save-state[data-sync="error"]{color:#a94442}.save-state[data-sync="saving"]{color:#7565ce}.save-state[data-sync="synced"]{color:#398665}.cloud-sync-dialog{width:min(440px,92vw)}.cloud-sync-form{display:grid;gap:9px;padding:18px 24px 4px}.cloud-sync-form label{font-size:11px;font-weight:650;color:#626975}.cloud-sync-form input{width:100%;border:1px solid #e2e4e9;border-radius:8px;background:#fafbfc;padding:10px 12px;font:12px system-ui,sans-serif;outline:none}.cloud-sync-form input:focus{border-color:#a9a0f3;box-shadow:0 0 0 3px #6758df15}.cloud-sync-message{min-height:36px;margin:12px 24px;color:#858c98;font-size:11px;line-height:1.5}.cloud-sync-footer{display:flex;align-items:center;justify-content:space-between;border-top:1px solid #eff0f3;padding:12px 20px}.cloud-sync-form[hidden],.cloud-sync-footer [hidden]{display:none}
