/* Template studio and shared free rectangle editor. */
.template-page .rect-editor{cursor:crosshair}
.template-page .rect-editor.pan-mode,.template-page .rect-editor.pan-mode .rect-editor-box,.template-page .rect-editor.pan-mode .rect-editor-box>i{cursor:grab}
.template-page .rect-editor.panning,.template-page .rect-editor.panning .rect-editor-box,.template-page .rect-editor.panning .rect-editor-box>i{cursor:grabbing}
.template-image-toolbar{margin-top:14px;color:#b3c7e6;font-size:11px}
.template-image-modes{display:inline-flex;border:1px solid #627ca466;border-radius:8px;padding:3px;gap:3px;background:#07182a55}
.template-image-modes button,.template-image-zoom button{border:1px solid transparent;border-radius:6px;color:#b9cdeb;background:transparent;padding:5px 8px;font-size:11px;white-space:nowrap}
.template-image-modes button[aria-pressed="true"]{background:#567dfc45;color:#e9f1ff;border-color:#6e94ee77}
.template-image-zoom{display:flex;align-items:center;gap:5px;margin-top:9px;min-width:0}
.template-image-zoom label{white-space:nowrap}.template-image-zoom input{accent-color:#7095ff;flex:1;width:55px;min-width:30px}.template-image-zoom output{font-size:10px;width:32px;text-align:center}
.template-image-zoom button{padding:3px 6px;background:#5375a52a;border-color:#6382b04d}
.template-image-tip{font-size:10px;color:#93acd0;line-height:1.8;margin-top:7px}
.template-page .template-crop-stage{height:300px;margin-top:10px}
.template-page .template-preview-stage{display:grid;grid-template-columns:minmax(0,1fr) 34px;gap:10px;padding-inline:0}
.template-preview-image{display:flex;align-items:center;justify-content:center;min-width:0}
.template-preview-image canvas.qr-editable{cursor:grab;touch-action:none}
.template-preview-image canvas.qr-dragging{cursor:grabbing}
.template-zoom-tools{display:flex;flex-direction:column;align-items:center;gap:9px;color:#a8bedf;font-size:10px;align-self:center}
.template-zoom-tools input{writing-mode:vertical-lr;direction:rtl;width:24px;height:260px;accent-color:#7395ff;cursor:ns-resize}
.template-zoom-tools button{width:30px;height:30px;border:1px solid #6584b27a;background:#5477b02a;border-radius:8px;color:#d5e3ff;font-size:18px;line-height:1;cursor:pointer}
.template-zoom-tools button:disabled,.template-zoom-tools input:disabled{opacity:.4;cursor:default}
.template-adjust-tip{text-align:center;color:#9db3d5;font-size:10px;line-height:1.8;margin-top:10px}
.template-page [hidden],.qr-template-admin [hidden]{display:none!important}
.template-original-link{border:0;background:transparent;text-decoration:underline;padding:0;cursor:pointer}.template-original-dialog{width:min(540px,calc(100% - 32px))}.template-original-dialog>img{max-height:74dvh;width:auto;max-width:100%;margin:16px auto 0;object-fit:contain}.template-original-dialog>img:not([src]){display:none}
.template-title-icon .tdl-icon{width:28px;height:28px}.template-upload-icon .tdl-icon{width:30px;height:30px}
.template-shell{width:calc(100% - 64px);max-width:1356px;margin-inline:auto}
.template-page .tdl-tool-nav,.template-page .tdl-tool-footer{max-width:1290px}
.template-heading{text-align:center;margin:24px 0 18px}.template-heading>span{font-size:12px;letter-spacing:1.5px;color:#b096ff}.template-heading h1{font-size:43px;line-height:1.35;margin:6px 0 4px;font-weight:800}.template-heading p{color:#bfcee6;font-size:17px}
.template-steps{list-style:none;display:grid;grid-template-columns:repeat(4,1fr);max-width:990px;margin:18px auto 20px;padding:0;border:1px solid #7190c280;border-radius:18px;overflow:hidden;background:#152a475c}
.template-steps li{padding:10px 16px;display:flex;align-items:center;justify-content:center;gap:14px;border-right:1px solid #5f799c70;color:#95a9c7;font-size:14px}.template-steps li:last-child{border:0}.template-steps b{border:1px solid #89a6d97a;border-radius:50%;width:30px;height:30px;display:grid;place-items:center;font-weight:600;background:#7898c124}.template-steps .current{background:linear-gradient(110deg,#324fd85c,#553ca25c);color:#fff}.template-steps .current b,.template-steps .done b{background:linear-gradient(130deg,#127fff,#4c4aff);box-shadow:0 0 10px #5678ff66;color:white;border-color:#87afff}.template-steps .done{color:#e6eeff}
.template-workspace{display:grid;grid-template-columns:1fr 1.03fr 1.01fr;gap:14px;align-items:stretch}.template-panel{padding:20px 24px;min-width:0;display:flex;flex-direction:column}.template-panel h2{font-size:21px;display:flex;align-items:center;gap:12px;line-height:1.4}.template-title-icon{color:#7daaff;font-size:31px;line-height:1}.template-panel-note{font-size:12px;color:#98afcd;padding-left:43px;margin-top:-2px}.template-card-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin-top:18px}.template-card{position:relative;display:flex;flex-direction:column;align-items:center;gap:8px;padding:6px 6px 8px;border:1px solid transparent;border-radius:13px;background:transparent;min-width:0;color:#dbe5f8;cursor:pointer}.template-card img{width:100%;aspect-ratio:9/14;object-fit:contain;border:1px solid #7395c38c;background:#122340;padding:5px;border-radius:12px}.template-card span{font-size:13px;text-align:center;overflow-wrap:anywhere}.template-card b{display:none;position:absolute;right:11px;top:11px;place-items:center;color:white;background:#246cff;border:1px solid #b8d0ff;border-radius:50%;width:27px;height:27px;font-size:17px}.template-card[aria-pressed="true"] img{border:2px solid #5f87ff;box-shadow:0 0 0 2px #7985ff3d,0 0 12px #526fff44}.template-card[aria-pressed="true"] b{display:grid}.template-card:hover{background:#698eff15}.template-wide{width:100%;margin-top:auto;font-size:13px;min-height:43px}.template-library .template-wide{margin-top:18px}
.template-file{position:absolute;width:1px;height:1px;clip-path:inset(50%);overflow:hidden}.template-upload{width:100%;border:1px dashed #8eaee0b0;min-height:109px;background:#08182e55;border-radius:10px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;margin-top:26px;color:#cad9ef}.template-upload-icon{font-size:32px;color:#729fff;line-height:1}.template-upload strong{font-size:13px}.template-upload>span:last-child{font-size:12px;color:#a0b5d4}.template-upload.dragging{background:#2a4aa177;border-color:#b8d4ff}
.rect-editor{position:relative;overflow:hidden;background:#061224;border:1px solid #415d8780;border-radius:6px;touch-action:none;user-select:none}.rect-editor>canvas{position:absolute;inset:0;display:block;width:100%;height:100%}.rect-editor-box{position:absolute;border:2px solid #87b4ff;cursor:move;touch-action:none;z-index:2;box-shadow:0 0 0 1px #285ddaaa}.rect-editor-grid{position:absolute;inset:0;background:linear-gradient(90deg,transparent 33%,#ffffff24 33%,#ffffff24 33.5%,transparent 33.5%,transparent 66%,#ffffff24 66%,#ffffff24 66.5%,transparent 66.5%),linear-gradient(transparent 33%,#ffffff24 33%,#ffffff24 33.5%,transparent 33.5%,transparent 66%,#ffffff24 66%,#ffffff24 66.5%,transparent 66.5%);pointer-events:none}.rect-editor-box>i{position:absolute;width:12px;height:12px;background:#528cff;border:2px solid #b0ceff;border-radius:2px;transform:translate(-50%,-50%)}.rect-editor-box [data-handle="nw"]{left:0;top:0;cursor:nwse-resize}.rect-editor-box [data-handle="n"]{left:50%;top:0;cursor:ns-resize}.rect-editor-box [data-handle="ne"]{left:100%;top:0;cursor:nesw-resize}.rect-editor-box [data-handle="e"]{left:100%;top:50%;cursor:ew-resize}.rect-editor-box [data-handle="se"]{left:100%;top:100%;cursor:nwse-resize}.rect-editor-box [data-handle="s"]{left:50%;top:100%;cursor:ns-resize}.rect-editor-box [data-handle="sw"]{left:0;top:100%;cursor:nesw-resize}.rect-editor-box [data-handle="w"]{left:0;top:50%;cursor:ew-resize}
.template-crop-stage{height:252px;margin-top:16px}.template-crop-empty{position:absolute;inset:0;display:grid;place-content:center;text-align:center;color:#8ea4c5;font-size:13px;line-height:2;pointer-events:none}.template-crop-tools{display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:11px;color:#a3b6d3;margin:12px 0 20px}.template-crop-tools label{display:flex;gap:5px;align-items:center}.template-crop-tools input{accent-color:#668eff}.template-scale{display:flex;gap:10px;align-items:center;flex-wrap:wrap;color:#b4c6e2;font-size:11px;margin-top:auto}.template-scale input{width:95px;flex:1;accent-color:#578bff;min-width:55px}.template-scale button{font-size:11px;color:#b6cbe8;background:transparent;border:0;border-left:1px solid #55749a5a;padding:4px 0 4px 8px}.template-edit-actions,.template-save-actions{display:flex;gap:12px;margin-top:20px}.template-edit-actions>button{flex:1;padding-inline:10px;font-size:14px}.template-privacy,.template-save-tip{color:#90a8cb;font-size:10px;line-height:1.7;margin-top:10px;text-align:center}
.template-preview-heading{display:flex;align-items:center;justify-content:space-between;gap:10px}.template-success{font-size:10px;color:#61e3b6;background:#10625225;border:1px solid #2f81654f;border-radius:8px;padding:5px 8px;white-space:nowrap}.template-preview-stage{min-height:436px;display:flex;align-items:center;justify-content:center;flex:1;margin-top:14px;padding:0 12px;min-width:0}.template-preview-stage canvas{width:auto;max-width:100%;height:auto;max-height:438px;object-fit:contain;border-radius:8px;box-shadow:0 0 16px #5071cd2b}.template-output-info{display:flex;justify-content:center;align-items:center;gap:16px;border:1px solid #627fa466;border-radius:10px;background:#132a4744;color:#b8cbe7;padding:12px 8px;font-size:12px;margin-top:16px}.template-output-info span+span{border-left:1px solid #718bb566;padding-left:16px}.template-save-actions{margin-top:13px}.template-save-actions button{font-size:13px;padding-inline:12px}.template-save-actions button:first-child{flex:1}.template-save-actions button:last-child{font-size:11px}
.template-message{min-height:26px;font-size:12px;color:#c4d5f2;text-align:center;margin-top:15px}.template-empty{font-size:13px;line-height:1.8;color:#9fb3d0;text-align:center;padding:24px 10px}.template-alert{border:1px solid #ffb79b77;background:#773b3033;color:#ffd0bb;border-radius:10px;padding:14px;margin-bottom:15px}
.template-gallery{width:min(1100px,calc(100% - 32px));max-height:88dvh;color:#e9f0ff;background:linear-gradient(135deg,#203653,#0a172b 65%);border:1px solid #789cc9;border-radius:20px;padding:24px;box-shadow:0 20px 100px #0009}.template-gallery::backdrop{background:#020817bb;backdrop-filter:blur(8px)}.template-gallery>header{display:flex;justify-content:space-between;gap:14px;align-items:flex-start}.template-gallery h2{font-size:23px}.template-gallery header p{font-size:12px;color:#a5bcda;margin-top:6px}.template-gallery header>button{border:0;background:#6784ae24;color:#d7e6ff;font-size:26px;line-height:1;width:34px;height:34px;border-radius:8px}.template-gallery-search{display:flex;gap:16px;align-items:center;font-size:13px;margin:20px 0}.template-gallery-search input{background:#13253f;color:#e7f0ff;border:1px solid #7e9bca7a;border-radius:8px;padding:9px 12px;flex:1;min-width:0}.template-gallery-grid{grid-template-columns:repeat(6,minmax(0,1fr));margin:0;max-height:56dvh;overflow:auto;padding:4px}.template-gallery-pagination{display:flex;gap:16px;justify-content:center;align-items:center;font-size:12px;margin-top:18px}.template-gallery-pagination button{color:#d1e1f9;background:#57759d2f;border:1px solid #7793bc75;border-radius:6px;padding:6px 12px}
@media(min-width:1600px){.template-panel{padding:22px 26px}.template-card img{height:210px;aspect-ratio:auto}.template-panel h2{font-size:23px}}
@media(max-width:1120px){.template-panel{padding:18px 15px}.template-panel h2{font-size:18px}.template-card-grid{gap:8px}.template-preview-stage{padding-inline:0}.template-save-actions{gap:8px}.template-preview-heading{flex-wrap:wrap}.template-success{margin-left:32px}.template-scale{gap:6px}.template-crop-tools{flex-wrap:wrap}.template-steps li{padding-inline:10px;gap:8px;font-size:13px}}
@media(max-width:920px){.template-workspace{grid-template-columns:1fr 1fr}.template-library{grid-column:1/-1}.template-library .template-card-grid{grid-template-columns:repeat(4,minmax(0,1fr))}.template-library .template-card img{max-height:210px}.template-library .template-wide{width:auto;align-self:center;min-width:220px}.template-preview-stage canvas{max-height:438px}.template-panel-note{padding-left:38px}.template-gallery-grid{grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(max-width:620px){.template-shell{width:calc(100% - 32px)}.template-heading h1{font-size:29px}.template-heading p{font-size:13px}.template-heading>span{font-size:10px}.template-steps{margin-top:14px;border-radius:12px}.template-steps li{flex-direction:column;gap:5px;font-size:10px;padding:9px 3px}.template-steps b{width:25px;height:25px}.template-workspace{grid-template-columns:1fr}.template-library .template-card-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.template-card img{aspect-ratio:9/14;max-height:230px}.template-edit{min-height:565px}.template-preview-stage{min-height:440px}.template-panel{padding:20px}.template-preview-heading{flex-wrap:nowrap}.template-success{margin:0;font-size:10px}.template-gallery{padding:17px}.template-gallery-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.template-gallery h2{font-size:20px}.template-gallery-search{gap:10px}.template-privacy{font-size:11px}.template-preview-stage canvas{max-height:520px}.template-save-tip{font-size:11px}}
