:root{--paper:#FDFFFD;--ink:#000100;--muted:#494B49;--line:#A0A3A0;--accent:#4AF5E8;--forest:#E2117B;--white:#fff;font-family:'Microsoft YaHei','PingFang SC',system-ui,sans-serif;color:var(--ink);background:var(--paper);font-synthesis:none}*{box-sizing:border-box}body{margin:0}button,input,textarea{font:inherit}button,a{touch-action:manipulation}button{cursor:pointer;border:1px solid var(--line);padding:12px 16px;background:transparent;color:inherit;min-height:44px;transition:background .15s}button:hover{background:#4AF5E8}button:disabled{opacity:.45;cursor:wait}button:focus-visible,a:focus-visible,input:focus-visible,textarea:focus-visible{outline:3px solid var(--forest);outline-offset:3px}button.primary{background:var(--ink);color:white;border-color:var(--ink)}button.accent{background:var(--accent);border-color:var(--accent)}button.quiet{border-color:transparent;padding:10px 12px}button.secondary{background:white}.danger{color:#933c2c}.topbar{display:flex;align-items:center;gap:32px;padding:24px 40px;border-bottom:1px solid var(--line)}.brand{color:inherit;text-decoration:none;font-weight:800;font-size:24px;letter-spacing:-1px}.brand span{font-size:13px;letter-spacing:0;font-weight:400;margin-left:16px}.topbar nav{margin-left:auto;display:flex;gap:8px}.local-mark{font-size:12px;color:var(--muted)}main{max-width:1360px;margin:auto;padding:0 40px 64px}.intro{display:flex;justify-content:space-between;gap:40px;padding:64px 0 56px;align-items:center}.eyebrow{font-size:12px;letter-spacing:2px;color:var(--muted);margin:0 0 20px}h1{font-size:48px;font-weight:600;line-height:1.25;letter-spacing:-1.5px;margin:0 0 24px}.lead{color:var(--muted);line-height:1.9;font-size:16px;margin:0}.intro-note{width:320px;min-height:240px;background:var(--accent);padding:32px;transform:rotate(-2deg);display:flex;flex-direction:column;justify-content:space-between}.intro-note>span{font-size:12px}.intro-note p{font-size:24px;line-height:1.55}.intro-note small{font-size:12px}.section-head{display:flex;justify-content:space-between;align-items:center;gap:16px;margin:32px 0 16px}.section-head h2{font-size:24px;font-weight:500;margin:0}.section-head>span,.hint{color:var(--muted);font-size:12px;line-height:1.8}.actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.template-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:16px}.template{background:white;text-align:left;padding:24px;min-height:190px;position:relative;display:flex;flex-direction:column;align-items:flex-start;justify-content:space-between;border:1px solid var(--line)}.template .number{font-size:12px;letter-spacing:1px;color:var(--muted)}.template strong{font-size:24px;font-weight:500}.template p{font-size:13px;color:var(--muted);margin:8px 0 0;line-height:1.7}.template .arrow{position:absolute;right:24px;top:20px;font-size:22px}.template:nth-child(2){background:var(--forest);color:white}.template:nth-child(2) p,.template:nth-child(2) .number{color:#FDFFFD}.template:nth-child(6){background:var(--accent)}#library{margin-top:48px;scroll-margin-top:20px}.work-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:24px}.work-card{background:#fff;padding:12px;min-width:0;border:1px solid var(--line)}.work-card img{display:block;width:100%;aspect-ratio:3/4;object-fit:contain;background:var(--paper)}.work-open{display:block;width:100%;padding:0;border:0}.work-card h3{font-size:16px;overflow-wrap:anywhere;font-weight:500;margin:14px 0 6px}.work-card p{font-size:12px;color:var(--muted)}.work-card .actions{gap:0}.work-card .actions button{font-size:12px;padding:8px}.empty{grid-column:1/-1;border:1px dashed #A0A3A0;padding:56px 24px;text-align:center;color:var(--muted)}.empty h3{color:var(--ink);font-size:20px;font-weight:500}.editor-head{display:flex;justify-content:space-between;gap:24px;align-items:center;padding:28px 0}.editor-head h1{font-size:28px;margin:12px 0 0}.back{padding:0;min-height:30px;border:0;color:var(--muted);font-size:13px}.editor-layout{display:grid;grid-template-columns:minmax(0,1fr) 360px;gap:32px;align-items:start}.preview-panel{position:sticky;top:16px;padding:24px;background:#F1F1EE;border:1px solid var(--line);min-width:0}.preview-top,.preview-bottom{display:flex;justify-content:space-between;align-items:center;font-size:11px;color:var(--muted);gap:8px}.preview-top{margin-bottom:24px;letter-spacing:1px}.preview-bottom{margin-top:16px}.preview-bottom button{font-size:12px}#canvasHost{max-width:450px;margin:auto;aspect-ratio:3/4;background:white;box-shadow:0 8px 24px #00010012;overflow:hidden}#canvasHost canvas{touch-action:pan-y}.controls{background:white;border:1px solid var(--line);padding:24px}.panel-title{display:flex;justify-content:space-between;font-size:18px;margin-bottom:24px}.panel-title span+span{font-size:12px;color:var(--muted)}label{display:block;font-size:13px;margin-bottom:18px;line-height:1.5}input:not([type=range]),textarea{display:block;margin-top:8px;border:1px solid var(--line);background:#FDFFFD;color:var(--ink);padding:12px;width:100%;border-radius:0;min-height:44px}textarea{resize:vertical;min-height:90px}input[type=range]{display:block;width:100%;accent-color:var(--forest);margin:12px 0}.field-note{float:right;color:var(--muted);font-size:11px}.control-section{border-top:1px solid var(--line);margin-top:24px;padding-top:20px}.control-section h3{font-size:15px;margin:0 0 16px}.control-section button{font-size:12px;padding:10px}.two{display:grid;grid-template-columns:1fr 1fr;gap:12px}.layer-row{display:flex;gap:8px;align-items:center;border-bottom:1px solid var(--line)}.layer-row button{width:100%;text-align:left;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.layer-row.selected{background:var(--accent)}footer{border-top:1px solid var(--line);padding:24px 40px;display:flex;justify-content:space-between;font-size:11px;color:var(--muted)}.notice{position:fixed;left:50%;bottom:24px;transform:translateX(-50%);max-width:min(680px,90vw);background:var(--ink);color:white;padding:16px 24px;z-index:20;box-shadow:0 8px 30px #0002;display:none;font-size:14px;line-height:1.65}.notice.show{display:block}.notice.error{background:#803829}dialog{border:1px solid var(--line);background:var(--paper);color:var(--ink);max-width:600px;width:90%;padding:32px;max-height:85vh;overflow:auto}dialog::backdrop{background:#00010080}dialog h2{font-size:24px;margin-top:0}dialog p{line-height:1.8}#dialogPreview{display:flex;gap:12px;flex-wrap:wrap;margin:16px 0}#dialogPreview img{width:110px;height:146px;object-fit:contain}body.busy main{pointer-events:none}body.busy .topbar{pointer-events:none}[hidden]{display:none!important}@media(max-width:800px){.topbar{padding:20px;gap:8px}.brand span,.local-mark{display:none}.topbar nav{gap:0}.topbar button{font-size:13px;padding:10px}main{padding:0 20px 40px}.intro{padding:40px 0;gap:24px}h1{font-size:36px}.intro-note{display:none}.template-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.template{padding:20px 16px;min-height:185px}.template strong{font-size:20px}.template .arrow{right:16px}.section-head{align-items:flex-start;flex-wrap:wrap}.section-head h2{font-size:22px}.work-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.editor-head{align-items:flex-start;flex-direction:column;gap:16px}.editor-head .actions{width:100%}.editor-head h1{font-size:26px}.editor-layout{display:flex;flex-direction:column;gap:20px}.preview-panel{position:static;width:100%;padding:16px}.controls{width:100%;padding:20px}.preview-bottom>span{display:none}.preview-bottom{justify-content:flex-end}.preview-top{margin-bottom:16px}footer{padding:20px;gap:16px}.notice{bottom:12px;padding:14px 18px}.lead br{display:none}}@media(prefers-reduced-motion:reduce){*{transition:none!important}}
/* Editor-first workspace: Photo / Cards / Library share one persistent navigation. */
.topbar{padding:14px 32px;gap:24px}.topbar nav{margin:0 auto;gap:4px}.workspace-tab{border-color:transparent;font-size:15px;padding:10px 18px}.workspace-tab span{font-size:12px;color:var(--muted);margin-left:6px}.workspace-tab small{font-size:11px;margin-left:5px}.workspace-tab[aria-pressed=true]{background:var(--ink);color:var(--paper)}.workspace-tab[aria-pressed=true] span{color:var(--paper)}
main{padding:0 32px 32px}.editor-head{padding:20px 0;gap:16px}.workspace-kicker{font-size:11px;color:var(--muted);margin:0 0 6px;letter-spacing:1px}.editor-head h1{font-size:22px;margin:0;letter-spacing:-.5px}.editor-layout{gap:24px;grid-template-columns:minmax(0,1fr) 360px}.preview-panel{padding:20px}.preview-top{margin-bottom:16px}.preview-bottom{margin-top:12px}.controls{padding:20px}.template-section{border-bottom:1px solid var(--line);padding-bottom:14px;margin-bottom:20px}.template-section .panel-title{margin-bottom:12px;align-items:center;font-size:14px}.template-section .panel-title button{padding:4px 8px;min-height:32px;font-size:12px}.template-switcher{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}.template-option{padding:10px 3px;font-size:12px;white-space:nowrap;background:var(--paper)}.template-option[aria-pressed=true]{background:var(--accent);border-color:var(--ink)}#templateHint{margin:12px 0 0}.panel-title{margin-bottom:18px}#library{margin-top:28px}footer{padding:16px 32px}
@media(min-width:1000px) and (min-height:700px){#canvasHost{max-width:min(450px,calc((100vh - 290px)*.75))}}
@media(max-width:800px){.topbar{padding:12px 16px;gap:12px;flex-wrap:wrap}.topbar nav{margin-left:auto;margin-right:0}.topbar .workspace-tab{padding:10px 11px;font-size:14px}.workspace-tab span{display:none}main{padding:0 16px 24px}.editor-head{padding:16px 0;gap:12px}.workspace-kicker{display:none}.editor-head h1{font-size:21px}.editor-head .actions{gap:4px}.editor-head .actions button{padding:9px 11px;font-size:12px}.editor-head .actions .hint{width:100%;font-size:11px}.editor-layout{gap:16px}.preview-panel{padding:12px}.controls{padding:16px}.template-option{font-size:12px}.preview-top{font-size:9px}footer{padding:16px}.brand{font-size:22px}}
/* Reference-informed workspace: compact tool shelf beside a persistent canvas. */
.editor-layout{grid-template-columns:340px minmax(0,1fr);gap:20px}.controls{grid-column:1;grid-row:1;max-height:calc(100vh - 190px);overflow-y:auto;scrollbar-width:thin;overscroll-behavior:contain}.preview-panel{grid-column:2;grid-row:1}.canvas-upload{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:16px;padding-bottom:12px;border-bottom:1px solid var(--line)}.canvas-upload>span{font-size:11px;color:var(--muted)}.canvas-upload button{font-size:12px;padding:8px 12px}.tool-tabs{display:grid;grid-template-columns:repeat(3,1fr);border-bottom:1px solid var(--line);margin:0 -20px 20px;padding:0 12px;position:sticky;top:-20px;background:white;z-index:1}.tool-tabs button{border:0;border-bottom:3px solid transparent;font-size:13px;padding:12px 8px}.tool-tabs button[aria-pressed=true]{border-bottom-color:var(--forest);color:var(--forest);font-weight:700}.controls .control-section{margin:0;padding:0;border:0}.material-categories{display:flex;gap:4px;margin-bottom:12px}.material-categories button{flex:1;font-size:12px;padding:8px;min-height:36px}.material-categories button[aria-pressed=true]{background:var(--ink);color:var(--paper)}.material-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-bottom:24px}.material-tile{display:flex;flex-direction:column;gap:10px;align-items:center;justify-content:center;min-width:0;min-height:104px;padding:10px!important;font-size:11px!important;background:#FDFFFD}.material-preview{display:flex;align-items:center;justify-content:center;padding:6px;background:var(--accent);min-height:30px;font-size:10px;max-width:100%;overflow-wrap:anywhere}.custom-heading{border-top:1px solid var(--line);padding-top:18px}.layer-heading{display:flex;justify-content:space-between;align-items:center;margin-top:20px}.layer-heading h3{margin:0}.layer-heading button{font-size:11px}#layerControls{margin-top:16px}#panelWords .panel-title{display:none}
@media(min-width:1000px) and (min-height:700px){#canvasHost{max-width:min(450px,calc((100vh - 365px)*.75))}}
@media(max-width:800px){.controls{max-height:none;overflow:visible}.editor-layout{display:flex}.preview-panel{order:0}.controls{order:1}.canvas-upload{margin-bottom:12px;padding-bottom:8px}.canvas-upload>span{max-width:170px;font-size:10px}.canvas-upload button{font-size:11px;padding:8px}.tool-tabs{margin:0 -16px 16px;position:static}#canvasHost{max-width:225px}.preview-bottom{margin-top:8px}.preview-bottom button{min-height:32px;padding:6px}.material-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.editor-head .actions #quickPhoto{background:white}}
@media(min-width:1000px) and (min-height:700px){#canvasHost{max-width:min(450px,max(330px,calc((100vh - 365px)*.75)))}}
/* Approved Combos structure; RCT colors and native editing remain independent. */
.topbar{min-height:64px;padding:10px 24px;gap:16px;flex-wrap:nowrap}.topbar #navLibrary{margin-left:auto}.topbar .local-mark{font-size:11px}main{max-width:1600px;padding:0 24px 32px}.mode-row{display:flex;justify-content:space-between;align-items:center;height:52px;max-width:420px;gap:8px}.mode-row nav,.history-actions{display:flex;gap:8px}.mode-row .workspace-tab{width:100px;min-height:44px;padding:8px}.history-actions button{width:44px;padding:0;font-size:22px}.editor-layout{display:grid;grid-template-columns:420px minmax(0,1fr);gap:24px;align-items:start}.controls{grid-column:1;grid-row:auto;padding:0;background:transparent;border:0;max-height:none;overflow:visible;order:0}.canvas-area{grid-column:2;grid-row:auto;min-width:0;order:1}.file-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-bottom:12px}.file-actions button{min-height:44px}.template-section{margin:0 0 12px;padding:0 0 12px}.template-section .panel-title{margin-bottom:8px}.template-switcher{gap:8px}.template-option{white-space:normal;min-width:0;overflow:hidden}.template-option img{display:block;width:100%;aspect-ratio:3/4;object-fit:contain;margin-bottom:6px}.template-option span{display:block;font-size:12px;line-height:1.6}.asset-empty{padding:20px 16px;border:1px dashed var(--line);background:var(--white);text-align:center;margin-bottom:12px}.asset-empty strong{font-size:14px;font-weight:500}.asset-empty p{font-size:12px;color:var(--muted);margin:8px 0 0}.optional-tools{border:1px solid var(--line);background:var(--white);margin:12px 0;padding:0 12px;min-width:0}.optional-tools summary{min-height:44px;align-content:center;cursor:pointer;font-size:13px}.optional-tools>div{padding:12px 0}.optional-tools .control-section{border:0;padding:0;margin:0}.optional-tools label{font-size:12px}.controls .optional-tools .actions button{font-size:12px;padding:8px}.material-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin-bottom:12px}.material-tile{min-height:72px;height:auto;padding:5px 3px!important;gap:5px}.material-preview{min-height:30px;padding:3px;font-size:9px;background:var(--paper);color:var(--ink)}.material-tile>span:last-child{font-size:10px;line-height:1.35}.material-categories{margin:8px 0}.material-categories button{min-height:40px}.layer-heading{margin-top:12px}.layer-heading h3{font-size:13px}.layer-heading button{min-height:44px}#assetSelectionNone{padding:12px 0;border-block:1px solid var(--line);margin:0;min-height:44px}.preview-panel{position:static;padding:20px;grid-column:auto;grid-row:auto}.preview-top{flex-wrap:wrap;letter-spacing:0;gap:8px;margin-bottom:12px}.preview-top h1{font-size:16px;margin:0;letter-spacing:0;line-height:1.5;flex:1}.preview-top #previewType{font-size:10px}.canvas-upload{margin:0 0 12px;padding:0 0 8px}.canvas-upload>span{max-width:none}.preview-bottom{justify-content:space-between}.preview-bottom>span{display:block}.preview-bottom button{min-height:44px}#canvasHostWrapper{position:relative;width:100%;max-width:540px;margin:auto}#canvasHost{width:100%;max-width:none;margin:0;aspect-ratio:3/4}#inlineFields{position:absolute;inset:0;pointer-events:none;z-index:2}#inlineFields input,#inlineFields textarea{position:absolute;pointer-events:auto;margin:0;min-height:0;background:transparent;border:1px dashed transparent;padding:2px;resize:none;overflow:hidden;line-height:1.18;border-radius:0}#inlineFields input:hover,#inlineFields textarea:hover{border-color:var(--line)}#inlineFields input:focus,#inlineFields textarea:focus{background:#FDFFFDee;border-color:var(--forest);outline:2px solid var(--forest);outline-offset:1px}.empty-photo{aspect-ratio:3/4;max-width:540px;margin:auto;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:16px;background:white;padding:24px;text-align:center}.empty-photo>span{font-size:40px;color:var(--forest)}.empty-photo h2{font-size:20px;font-weight:500;margin:0}.empty-photo p{font-size:13px;color:var(--muted);line-height:1.8;margin:0}.compatibility-tools{display:none!important}#home{padding-top:16px}#backToEditor{min-height:44px}#library{margin-top:12px}.work-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:16px}
@media(max-width:800px){.topbar{min-height:56px;padding:6px 16px}.topbar .brand span,.topbar .local-mark{display:none}.topbar #navLibrary{font-size:13px;padding:8px 12px}main{padding:0 16px 24px}.mode-row{max-width:none}.editor-layout{display:flex;flex-direction:column;gap:12px}.controls,.canvas-area{width:100%}.controls{order:0;padding:0}.canvas-area{order:1}.preview-panel{padding:0;border:0;background:transparent;order:initial}.material-grid{grid-template-columns:repeat(4,minmax(0,1fr))}.template-option{font-size:12px}.preview-top{font-size:10px}.preview-top h1{font-size:15px}#canvasHostWrapper{max-width:none}#canvasHost{max-width:none}.canvas-upload{gap:8px}.canvas-upload>span{max-width:180px}.canvas-upload button{font-size:12px}.preview-bottom>span{display:block}.work-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.work-card{padding:8px}.optional-tools{width:100%}.empty-photo{width:100%;max-width:none}.controls .control-section{padding:0}.file-actions{gap:8px}.file-actions button{padding:8px 10px}.mode-row .workspace-tab{width:100px}.history-actions{gap:8px}}
/* Template thumbnails are neutral layout diagrams, not fabricated content assets. */
.template-option .template-mini{display:block;position:relative;height:68px;max-width:100%;background:var(--white);border:1px solid var(--line);margin:0 0 8px;overflow:hidden}.template-mini .mini-title,.template-mini .mini-picture,.template-mini .mini-lines{position:absolute;display:block;margin:0;background:var(--line)}.template-mini .mini-title{left:12%;top:12%;width:58%;height:5%}.template-mini .mini-picture{left:12%;right:12%;top:25%;height:40%;background:#F1F1EE;border:1px solid var(--line)}.template-mini .mini-lines{left:12%;right:24%;top:76%;height:3%;box-shadow:0 6px 0 var(--line)}body[data-mode=card] .template-option .template-mini{height:140px;margin-bottom:8px}body[data-mode=card] .template-mini .mini-picture{top:29%;height:23%}body[data-mode=card] .template-mini .mini-lines{top:65%;height:3%;box-shadow:0 10px 0 var(--line),0 20px 0 var(--line)}.template-mini.start .mini-title{top:70%}.template-mini.start .mini-picture{top:10%;height:50%}.template-mini.chapter .mini-title{width:72%}.template-mini.event .mini-lines{right:12%}.template-mini.skill .mini-lines{right:30%}#inlineFields .inline-field{color:transparent;caret-color:var(--ink);background:transparent}#inlineFields .inline-field:focus{color:var(--ink);background:var(--paper);overflow:auto}#inlineFields .inline-field:focus::selection{background:var(--accent);color:var(--ink)}
/* Reference detail pass: measurements from the live Combos editor, 2026-09-20.
   Palette and exported artwork remain RCT-owned. */
:root{--ui-radius:5px;--tile-radius:8px;font-family:Inter,ui-sans-serif,system-ui,'Microsoft YaHei',sans-serif;font-size:14px;line-height:1.4}
button{border-radius:var(--ui-radius);min-height:36px;padding:6px 10px;font-size:12px;line-height:1.4;font-weight:400;transition:background .15s,border-color .15s}
button.primary,button.accent{font-weight:700}button:disabled{cursor:default}button.quiet{padding:6px 10px}
input:not([type=range]),textarea{border-radius:5px;border-width:1px;padding:8px 10px;font-size:13px;line-height:1.4}
input[type=range]{accent-color:var(--forest)}::selection{background:var(--accent);color:var(--ink)}
.topbar{min-height:52px;padding:6px 24px;gap:12px}.brand{font-size:20px;letter-spacing:-.4px}.brand span{font-size:12px;margin-left:12px}.topbar .workspace-tab{font-size:12px;padding:6px 10px}
.mode-row{display:grid;grid-template-columns:1fr 1fr;gap:7px;height:auto;padding:10px 0 5px;max-width:420px}
.mode-row nav{display:grid;grid-template-columns:1fr 1fr;gap:0;border:1px solid var(--line);border-radius:5px;overflow:hidden}
.mode-row .workspace-tab{width:auto;min-height:36px;padding:6px 5px;border:0;border-radius:0;font-size:13px;font-weight:700;line-height:1.05}
.mode-row .workspace-tab+button{border-left:1px solid var(--line)}
.history-actions{display:grid;grid-template-columns:1fr 1fr;gap:4px}.history-actions button{width:auto;min-height:38px;border:1px solid var(--line);font-size:12px;line-height:1.05;padding:6px 5px}
.file-actions{gap:5px 7px;margin-bottom:10px}.file-actions button{min-height:36px;padding:6px 7px;font-size:12px;line-height:1.05}
.template-section{padding:8px 0 10px;margin:0 0 8px}.template-section .panel-title{font-size:12px;margin-bottom:6px}.template-section .panel-title button{min-height:28px;font-size:11px;padding:4px 8px}
.template-switcher{display:flex;gap:4px;overflow-x:auto;padding:0 0 2px;scrollbar-width:thin}.template-option{display:flex;align-items:center;gap:6px;flex:1 0 0;min-height:42px;padding:2px 5px;border-radius:5px;white-space:nowrap}.template-option span{font-size:11px;line-height:1.2}.template-option .template-mini,body[data-mode=card] .template-option .template-mini{width:38px;flex:0 0 38px;height:34px;margin:0;border-radius:2px}.template-mini .mini-lines,body[data-mode=card] .template-mini .mini-lines{box-shadow:0 3px 0 var(--line),0 6px 0 var(--line)}
#templateHint{font-size:11px;line-height:1.4;margin:6px 0 0}.asset-empty{border-style:solid;border-radius:8px;padding:14px 10px;margin-bottom:8px}.asset-empty strong{font-size:12px;font-weight:600}.asset-empty p{font-size:11px;margin:5px 0 0;line-height:1.4}
.optional-tools{margin:6px 0;border-radius:5px;padding:0 10px}.optional-tools summary{min-height:36px;font-size:12px}.optional-tools>div{padding:6px 0}.optional-tools label{font-size:12px;margin-bottom:10px}.optional-tools h3{font-size:13px;margin:4px 0 8px}
.material-categories{gap:4px;overflow-x:auto;margin:4px 0 7px}.material-categories button{flex:none;border-radius:999px;min-height:36px;padding:6px 11px;font-size:12px;white-space:nowrap}.material-categories button[aria-pressed=true]{font-weight:700}
.material-grid{gap:7px;max-height:214px;overflow-y:auto;padding:1px 2px 2px 0;margin-bottom:8px;scrollbar-width:thin}.material-tile{border-radius:8px;min-height:64px;padding:3px!important;gap:4px}.material-preview{border-radius:3px}.controls .optional-tools .actions button{font-size:12px;padding:6px 8px;min-height:34px}
#assetSelectionNone{min-height:32px;padding:8px 0;border-top:0;font-size:12px;font-weight:600}.layer-heading{margin-top:6px}.layer-heading h3{font-size:12px}.layer-heading button{min-height:32px;font-size:11px}.controls .hint{font-size:11px;line-height:1.4;margin:8px 0}.controls #layerControls .actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px}.controls #layerControls .actions button{border:1px solid var(--line);min-height:34px;font-size:12px}
.preview-panel{border-radius:8px;padding:12px}.preview-top{gap:6px;margin-bottom:8px}.preview-top h1{font-size:13px;font-weight:700}.preview-top #previewType{font-size:10px}.canvas-upload{padding-bottom:7px;margin-bottom:10px}.canvas-upload button{min-height:34px;font-size:12px;padding:6px 10px}.empty-photo{border:1px solid var(--line);border-radius:8px;gap:10px;padding:16px}.empty-photo h2{font-size:16px;font-weight:600}.empty-photo p{font-size:12px;line-height:1.4}.empty-photo>span{font-size:28px}.preview-bottom{margin-top:8px;font-size:11px}.preview-bottom button{min-height:32px;font-size:11px;padding:6px 8px}
.work-card{border-radius:8px}.work-card img{border-radius:5px}.work-card .actions{gap:4px}.work-card button{font-size:12px}.section-head h2{font-size:20px}dialog{border-radius:8px}footer{font-size:11px;padding:12px 24px}.notice{border-radius:5px;font-size:12px}
@media(max-width:800px){.topbar{padding:6px 10px;min-height:44px}.topbar #navLibrary{font-size:12px;padding:6px 8px}main{padding:0 10px 20px}.mode-row{max-width:none}.mode-row .workspace-tab{width:auto}.editor-layout{gap:10px}.preview-panel{border-radius:0;padding:0}.template-option{padding:2px 4px;gap:4px}.file-actions button{padding:6px 7px}.canvas-upload>span{font-size:11px}.preview-top h1{font-size:13px}.history-actions{gap:4px}footer{padding:12px 10px}.controls{padding:0}.material-grid{grid-template-columns:repeat(4,minmax(0,1fr))}}

/* PHOTOBOOTH: four real image slots, using the existing compact editor tokens. */
.photo-slots-panel{margin:8px 0 12px;padding:12px;border:1px solid var(--line);border-radius:var(--tile-radius);background:var(--paper)}
.photo-slots-panel .panel-title{font-size:12px;margin-bottom:8px}.photo-slots{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:7px}
.photo-slot{padding:3px;position:relative;aspect-ratio:1/1.1;background:var(--white);border-radius:var(--ui-radius);overflow:hidden;min-width:0}
.photo-slot[aria-pressed=true]{border:2px solid var(--forest);box-shadow:0 0 0 1px var(--forest)}.photo-slot>span{font-size:22px;color:var(--muted)}
.photo-slot img{width:100%;height:100%;object-fit:cover;border-radius:3px;display:block}.photo-slot small{position:absolute;bottom:4px;left:4px;background:var(--ink);color:var(--white);border-radius:3px;padding:2px 5px;font-size:10px}
.photo-slots-panel .actions{gap:3px}.photo-slots-panel .actions button{font-size:11px;padding:5px 7px}
.template-mini.photobooth .mini-picture{width:12px;height:26px;top:3px;left:12px;background:repeating-linear-gradient(to bottom,var(--ink) 0 5px,var(--paper) 5px 7px);transform:rotate(6deg)}
.template-mini.template-card-thumb{display:flex;align-items:center;justify-content:center;background:#F6F7F6}.template-card-thumb img{display:block;width:auto;height:100%;max-width:100%;object-fit:contain}
.card-symbol-panel{padding:12px;border:1px solid var(--line);border-radius:8px;background:var(--white);margin:8px 0}
.card-symbol-panel .panel-title{font-size:12px;margin-bottom:10px}.card-symbols{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:6px}
.card-symbol{display:flex;flex-direction:column;align-items:center;gap:6px;min-width:0;padding:8px 3px;border-radius:5px;background:var(--paper);color:var(--forest)}
.card-symbol[aria-pressed=true]{border-color:var(--forest);background:var(--accent)}.card-symbol svg{display:block;width:36px;height:36px;max-width:100%}.card-symbol span{font-size:11px;line-height:1.3}
.symbol-credit{display:block;font-size:10px;line-height:1.5;color:var(--muted);overflow-wrap:anywhere}.card-symbol-panel .hint{margin:8px 0}


/* Approved B palette: romance collection UI. Geometry and typography unchanged. */
body{background:#FDFFFD}.topbar{background:#FDFFFD;border-color:#A0A3A0}.brand{color:#E2117B}
button{background:#FDFFFD;border-color:#A0A3A0;box-shadow:inset 0 1px 0 #FFFFFF,inset 0 -2px 1px #00010014}button:hover{background:#4AF5E8}
button.primary{background:#E2117B;border-color:#E2117B;color:#fff;box-shadow:inset 0 1px 0 #FFFFFF44,inset 0 -2px 1px #00000026}
button.accent{background:#4AF5E8;border-color:#000100;color:#000100}
.workspace-tab[aria-pressed=true]{background:#4AF5E8;color:#E2117B;border-color:#E2117B;box-shadow:inset 0 -3px 0 #E2117B}
.card-symbol[aria-pressed=true],.template-option[aria-pressed=true]{background:#4AF5E8;border-color:#E2117B;color:#E2117B;box-shadow:inset 0 0 0 1px #E2117B}
.card-symbol{background:#4AF5E8;color:#E2117B}.preview-panel{background:#F1F1EE;border-color:#A0A3A0;box-shadow:inset 0 1px 2px #00010012}
.card-symbol-panel,.optional-tools{background:#FDFFFD;border-color:#A0A3A0}input:not([type=range]),textarea{background:#FDFFFD;border-color:#A0A3A0;box-shadow:inset 0 1px 2px #0001000D}
#canvasHost{box-shadow:0 7px 18px #00010022}.symbol-credit{color:#494B49}.notice{background:#E2117B}.notice.error{background:#803829}::selection{background:#4AF5E8;color:#000100}

/* Shared UI states across photo, cards and local library. Artwork assets stay unchanged. */
.work-card,.tool-tabs,.empty-photo,.asset-empty,.photo-slot{background:#FDFFFD}.workspace-tab[aria-pressed=true] span{color:#E2117B}.material-categories button[aria-pressed=true]{background:#4AF5E8;color:#000100;border-color:#E2117B}.photo-slot[aria-pressed=true]{border-color:#E2117B;box-shadow:0 0 0 1px #E2117B}

/* Confirmed UI palette: magenta/cyan only; auxiliary artwork colors do not enter controls. */
body{background:#FDFFFD}.topbar{background:#FDFFFD;border-color:#000100}.brand{color:#E2117B}
button{background:#FDFFFD;border-color:#000100;box-shadow:none}button:hover{background:#4AF5E8;color:#000100}
button.primary{background:#E2117B;border-color:#000100;color:#000100;box-shadow:inset 0 -2px 0 #000100}
button.accent{background:#4AF5E8;border-color:#000100;color:#000100}
.workspace-tab[aria-pressed=true]{background:#E2117B;color:#000100;border-color:#000100;box-shadow:none}
.workspace-tab[aria-pressed=true] span{color:#000100}
.card-symbol[aria-pressed=true],.template-option[aria-pressed=true]{background:#4AF5E8;border-color:#000100;color:#000100;box-shadow:inset 0 0 0 1px #000100}
.card-symbol{background:#FDFFFD;color:#000100}.card-symbol svg{color:#E2117B}
.preview-panel{background:#F1F1EE;border-color:#000100;box-shadow:none}
.card-symbol-panel,.optional-tools{background:#FDFFFD;border-color:#000100}
input:not([type=range]),textarea{background:#FDFFFD;border-color:#A0A3A0;box-shadow:none}
#canvasHost{box-shadow:0 7px 18px #00010022}.symbol-credit{color:#494B49}
.notice{background:#000100;color:#FDFFFD}.notice.error{background:#803829}
.field-error{margin:4px 0 14px;color:#803829;font-size:13px;line-height:1.5}#fields [aria-invalid=true],#inlineFields [aria-invalid=true]{border-color:#803829!important}.example-row{width:100%;margin:2px 0;padding:8px 0;border-bottom:1px solid var(--line);font-size:14px}.example-row strong{display:block;margin-bottom:3px}#showItemExample{margin:0 0 12px;padding:8px 10px;text-decoration:underline;text-underline-offset:3px}
::selection{background:#4AF5E8;color:#000100}
.material-categories button[aria-pressed=true]{background:#4AF5E8;color:#000100;border-color:#000100}



.photo-slot[aria-pressed=true]{border-color:#E2117B;background:#4AF5E8;box-shadow:0 0 0 1px #E2117B}.photo-slot>span{color:#E2117B}

/* Scene U card tools share the existing editor state and canvas. */
#mobileActions{display:none}
#cardTools{border:1px solid #000100;background:#FDFFFD;min-width:0}
.card-tool-tabs{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));border-bottom:1px solid #000100}
.card-tool-tabs button{min-height:52px;border:0;border-right:1px solid #A0A3A0;border-radius:0;padding:7px 3px;font-size:13px}
.card-tool-tabs button:last-child{border-right:0}.card-tool-tabs button[aria-selected=true]{background:#4AF5E8;font-weight:700;box-shadow:inset 0 -3px #E2117B}
.card-tool-content{padding:10px;min-height:0}.card-tool-content>[data-card-panel][hidden]{display:none!important}
.card-options{display:flex;flex-wrap:wrap;gap:6px;margin:4px 0 10px}.card-choice{min-height:44px;padding:8px 12px;background:#FDFFFD;font-size:13px}.card-choice[aria-pressed=true]{background:#4AF5E8;border-color:#000100;box-shadow:inset 0 -3px #E2117B}
.event-background-slot{margin:12px 0 0;padding:10px;border:1px dashed #A0A3A0;background:#F6F7F6}.event-background-slot[hidden]{display:none}.event-background-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:8px;font-size:13px}.event-background-heading span{color:#656B69;font-size:11px}.event-background-options{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}.event-background-options button:disabled{min-height:44px;border:1px solid #C6CBC9;background:#F6F7F6;color:#707573;cursor:not-allowed}
.card-sticker-group{border-bottom:1px solid #A0A3A0;padding:6px 0}.card-sticker-group h3{font-size:13px;margin:0 0 6px}.card-sticker-instance{margin:0 6px 6px 0}
.card-sticker-fields{display:grid;grid-template-columns:1fr 1fr;gap:8px}#cardStickerSelected{border-top:1px solid #A0A3A0;padding-top:10px}#cardStickerSelected label{font-size:12px;margin:4px 0}
.card-sticker-tabs{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin:0 8px 8px}.card-sticker-tabs button{min-height:44px;padding:7px 2px;font-size:13px}.card-sticker-tabs button[aria-selected=true]{background:#4AF5E8;border-color:#000100}
.card-field-tabs{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin:0 0 7px}.card-field-tab{min-height:44px;padding:6px 2px;font-size:13px}.card-field-tab[aria-selected=true]{background:#4AF5E8;border-color:#000100}.card-field-tabs+[id=fields] label{margin:0}.card-field-tabs+[id=fields] input,.card-field-tabs+[id=fields] textarea{margin-top:4px;min-height:44px;height:44px;padding:8px 10px;resize:none}.card-field-tabs+[id=fields] .field-note{display:none}#cardFieldHelp{margin:3px 0 2px}#cardNameDetails{margin:3px 0 0;border-top:1px solid #A0A3A0}#cardNameDetails summary{min-height:44px;align-content:center;font-size:12px;cursor:pointer}#cardNameDetails label{margin:0 0 5px}#cardNameDetails input{margin-top:3px}#cardWordsPanel #showItemExample{min-height:36px;margin:0;padding:3px 8px;font-size:11px}
.card-sticker-palette{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}.card-sticker-tile{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;min-width:0;min-height:78px;padding:3px;border:0;box-shadow:none}.card-sticker-tile img{display:block;width:46px;height:47px;object-fit:contain}.card-sticker-tile span{font-size:12px;white-space:nowrap}.card-sticker-tile:focus-visible,.card-sticker-tile:hover{outline:2px solid #4AF5E8;outline-offset:0}
#cardStickers .card-sticker-group{border:0;padding:0}#cardStickers .card-sticker-group h3{font-size:11px;color:#494B49;margin:0 0 2px}
#cardTools #photoAdjust,#cardTools #wordsAdjust{border:0;margin:0;padding:0;background:none}#cardTools #photoAdjust>summary,#cardTools #wordsAdjust>summary{display:none}#cardTools #panelPhoto,#cardTools #panelWords{padding:0}
#cardTools input[type=range]{height:44px;min-height:44px;margin:0;touch-action:pan-x}#cardTools #cropControls label{display:grid;grid-template-columns:88px minmax(0,1fr);align-items:center;min-height:44px;margin:0;font-size:12px}
#cardTools #cardSymbolPanel{border:0;padding:8px 0;margin:0}
#canvasHost{position:relative}#cardLiveCanvas{display:block;position:absolute;inset:0;width:100%;height:100%;pointer-events:none}#canvasHost .canvas-container{position:relative;z-index:1}body[data-card-visual=true] #canvasHost canvas{touch-action:none}
.card-3d-launch{position:absolute;right:10px;top:10px;z-index:3;min-width:44px;min-height:44px;padding:4px 8px;background:#FDFFFD;border:1px solid #000100;font-size:11px}
.card-3d-launch{right:6px;top:auto;bottom:12px;width:44px;height:44px;min-width:44px;min-height:44px;padding:0;border:1px solid #4AF5E8;border-radius:50%;background:#FDFFFD;font-size:12px}
#card3dDialog{width:min(520px,calc(100vw - 24px));max-height:calc(100dvh - 24px);padding:12px;background:#FDFFFD;text-align:center;overflow:auto}
.card-3d-head{display:flex;justify-content:space-between;align-items:center;gap:8px}.card-3d-head h2{font-size:16px;margin:0}.card-3d-head button{min-height:44px}
#card3dCanvas{display:block;width:min(100%,360px);height:auto;aspect-ratio:3/4;margin:8px auto;background:#F1F1EE;touch-action:none;outline-offset:3px}.card-3d-actions{display:flex;justify-content:center;gap:8px}.card-3d-actions button{min-height:44px}.card-3d-actions+p{font-size:11px;color:#494B49;margin:8px 0 0}
@media(max-width:800px){
 body[data-card-visual=true]{overflow:hidden}
 body[data-card-visual=true] .topbar{height:56px;min-height:56px;max-height:56px;padding:0 7px;gap:2px;flex-wrap:nowrap;border-bottom:1px solid #000100}
 body[data-card-visual=true] .topbar .brand{flex:0 0 91px;min-width:0;font-size:18px;white-space:nowrap;letter-spacing:-.5px}
 body[data-card-visual=true] .topbar #navLibrary,body[data-card-visual=true] .topbar .local-mark{display:none}
 body[data-card-visual=true] #mobileActions{display:flex;flex:1;gap:2px;min-width:0}
 body[data-card-visual=true] #mobileActions button{flex:1 1 0;min-width:0;min-height:44px;height:44px;padding:2px 0;font-size:11px;white-space:nowrap}
 body[data-card-visual=true] #mobileSave{background:#4AF5E8}body[data-card-visual=true] #mobileExport{background:#FDFFFD}
 body[data-card-visual=true] #editor{max-width:none;height:calc(100dvh - 56px);padding:0;overflow:hidden}
 body[data-card-visual=true] .mode-row,body[data-card-visual=true] footer{display:none}
 body[data-card-visual=true] .editor-layout{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:44px minmax(0,1fr) 292px;gap:0;height:calc(100dvh - 56px - max(34px,env(safe-area-inset-bottom)));min-height:0}
 body[data-card-visual=true] .controls,body[data-card-visual=true] .canvas-area{display:contents}
 body[data-card-visual=true] .controls>.file-actions,body[data-card-visual=true] .controls>#materialShelf,body[data-card-visual=true] .controls>.compatibility-tools,body[data-card-visual=true] .controls>#photoSlotsPanel{display:none!important}
 body[data-card-visual=true] .template-section{grid-row:1;grid-column:1;height:44px;margin:0;padding:0 9px;border:0;overflow:hidden}
 body[data-card-visual=true] .template-section .panel-title,body[data-card-visual=true] #templateHint{display:none}
 body[data-card-visual=true] .template-switcher{height:44px;gap:5px;overflow:visible;padding:0;align-items:center}
 body[data-card-visual=true] .template-option{height:40px;min-height:40px;padding:2px 5px;font-size:11px;flex:1 1 0}
 body[data-card-visual=true] .template-option .template-mini{width:33px;flex-basis:33px;height:30px}
 body[data-card-visual=true] .preview-panel{grid-row:2;grid-column:1;position:relative;top:0;display:flex;align-items:center;justify-content:center;width:100%;height:100%;padding:10px 0;margin:0;border:0;border-radius:0;background:#FDFFFD;overflow:hidden}
 body[data-card-visual=true] .preview-panel .preview-top,body[data-card-visual=true] .preview-panel .canvas-upload,body[data-card-visual=true] .preview-panel .preview-bottom{display:none}
 body[data-card-visual=true] #canvasHostWrapper{width:min(288px,calc((100dvh - 426px)*.75));max-width:calc(100vw - 36px);margin:0 auto}
 body[data-card-visual=true] #canvasHost{width:100%;max-width:none;box-shadow:none}
 body[data-card-visual=true] #inlineFields{display:none}
 body[data-card-visual=true] #cardTools{grid-row:3;grid-column:1;display:grid;grid-template-rows:56px minmax(0,1fr);height:292px;border-left:0;border-right:0;border-bottom:0;overflow:hidden}
 body[data-card-visual=true] .card-tool-tabs button{min-height:56px;height:56px}
 body[data-card-visual=true] .card-tool-content{height:100%;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;padding:8px 10px 18px}
 body[data-card-visual=true] .card-tool-content .control-section{border:0;margin:0;padding:0}
 body[data-card-visual=true] .card-tool-content .control-section h3{font-size:13px;margin:0 0 5px}
 body[data-card-visual=true] .card-tool-content .hint{margin:3px 0;font-size:11px}
 body[data-card-visual=true] .card-tool-content .actions button{min-height:44px}
 body[data-card-visual=true] .card-tool-content #photoAdjust{width:100%}
 body[data-card-visual=true] .card-sticker-tabs{position:sticky;top:-8px;z-index:4;background:#FDFFFD;padding:8px 0;margin:-8px 0 8px;border-bottom:1px solid #A0A3A0}
 body[data-card-visual=true] #cardStickerSelected{padding-top:5px}body[data-card-visual=true] #cardStickerSelected label{margin:0}body[data-card-visual=true] #cardStickerSelected input:not([type=range]){min-height:40px;margin-top:2px;padding:7px}body[data-card-visual=true] #cardStickerSelected #cardStickerRemove{min-height:44px}
}
@media(max-width:800px) and (max-height:740px){body[data-card-visual=true] .editor-layout{grid-template-rows:44px minmax(0,1fr) 240px;height:calc(100dvh - 56px - max(16px,env(safe-area-inset-bottom)))}body[data-card-visual=true] #cardTools{height:240px}body[data-card-visual=true] #canvasHostWrapper{width:min(258px,calc((100dvh - 388px)*.75))}}
@media(max-width:800px){body[data-card-visual=true][data-keyboard=true] .topbar{position:fixed;left:0;right:0;top:var(--scene-visual-top,0px);z-index:12}body[data-card-visual=true][data-keyboard=true] #editor{position:fixed;left:0;right:0;top:calc(var(--scene-visual-top,0px) + 56px);height:calc(var(--scene-visual-height,100dvh) - 56px)}body[data-card-visual=true][data-keyboard=true] .editor-layout{height:calc(var(--scene-visual-height,100dvh) - 56px);grid-template-rows:44px minmax(0,1fr) 190px}body[data-card-visual=true][data-keyboard=true] #cardTools{height:190px}body[data-card-visual=true][data-keyboard=true] #canvasHostWrapper{width:min(288px,calc((var(--scene-visual-height,100dvh) - 322px)*.75))}}
/* Photo uses the same 56 / 44 / preview / dock mobile shell as the cards. */
.photo-tool-tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));border-bottom:1px solid #000100}.photo-tool-tabs button{min-height:56px;border:0;border-right:1px solid #A0A3A0}.photo-tool-tabs button:last-child{border-right:0}.photo-tool-tabs button[aria-selected=true]{background:#4AF5E8;box-shadow:inset 0 -3px #E2117B}.photo-tool-content{min-height:0;padding:8px 10px 18px;overflow-y:auto;overscroll-behavior:contain}.photo-tool-content>[data-photo-panel][hidden]{display:none!important}#photoTools #photoAdjust,#photoTools #wordsAdjust{border:0;margin:0;padding:0;background:transparent}#photoTools #photoAdjust>summary,#photoTools #wordsAdjust>summary{display:none}#photoTools #panelPhoto,#photoTools #panelWords{padding:0}#photoTools #photoSlotsPanel{border:0;padding:0;margin:0 0 8px}#photoTools #photoSlotsPanel .panel-title,#photoTools #photoSlotsPanel>.hint{display:none}#photoTools .photo-slots{margin:0 0 6px}#photoTools #cropControls label{display:grid;grid-template-columns:88px minmax(0,1fr);align-items:center;min-height:44px;margin:0}#photoTools input[type=range]{height:44px;min-height:44px;margin:0;touch-action:pan-x}
#photoTools #photoSlotsPanel .actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px}#photoTools #photoSlotsPanel .actions button{min-height:44px;padding:5px;font-size:12px}#slotAdjust{display:none}#photoTools #slotAdjust{display:block}
@media(max-width:800px){body[data-photo-mobile=true]{overflow:hidden}body[data-photo-mobile=true] .topbar{height:56px;min-height:56px;max-height:56px;padding:0 7px;gap:2px;border-bottom:1px solid #000100}body[data-photo-mobile=true] .topbar .brand{flex:0 0 91px;min-width:0;font-size:18px;white-space:nowrap;letter-spacing:-.5px}body[data-photo-mobile=true] .topbar #navLibrary,body[data-photo-mobile=true] .topbar .local-mark{display:none}body[data-photo-mobile=true] #mobileActions{display:flex;flex:1;gap:2px;min-width:0}body[data-photo-mobile=true] #mobileActions button{flex:1 1 0;min-width:0;min-height:44px;height:44px;padding:2px 0;font-size:11px;white-space:nowrap}body[data-photo-mobile=true] #mobileSave{background:#4AF5E8}body[data-photo-mobile=true] #mobileExport{background:#FDFFFD}body[data-photo-mobile=true] #editor{max-width:none;height:calc(100dvh - 56px);padding:0;overflow:hidden}body[data-photo-mobile=true] .mode-row,body[data-photo-mobile=true] footer{display:none}body[data-photo-mobile=true] .editor-layout{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:44px minmax(0,1fr) 292px;gap:0;height:calc(100dvh - 56px - max(34px,env(safe-area-inset-bottom)));min-height:0}body[data-photo-mobile=true] .controls,body[data-photo-mobile=true] .canvas-area{display:contents}body[data-photo-mobile=true] .controls>.file-actions,body[data-photo-mobile=true] .controls>#cardTools,body[data-photo-mobile=true] .controls>.compatibility-tools{display:none!important}body[data-photo-mobile=true] .template-section{grid-row:1;grid-column:1;height:44px;margin:0;padding:0 9px;border:0;overflow:hidden}body[data-photo-mobile=true] .template-section .panel-title,body[data-photo-mobile=true] #templateHint{display:none}body[data-photo-mobile=true] .template-switcher{height:44px;grid-template-columns:repeat(4,minmax(0,1fr));gap:4px;align-items:center}body[data-photo-mobile=true] .template-option{height:40px;min-height:40px;padding:2px 4px;font-size:11px;min-width:0}body[data-photo-mobile=true] .template-option .template-mini{display:none}body[data-photo-mobile=true] .preview-panel{grid-row:2;grid-column:1;position:relative;top:0;display:flex;align-items:center;justify-content:center;width:100%;height:100%;padding:10px 0;margin:0;border:0;background:#FDFFFD;overflow:hidden}body[data-photo-mobile=true] .preview-panel .preview-top,body[data-photo-mobile=true] .preview-panel .canvas-upload,body[data-photo-mobile=true] .preview-panel .preview-bottom{display:none}body[data-photo-mobile=true] #canvasHostWrapper,body[data-photo-mobile=true] #emptyPhoto{width:min(288px,calc((100dvh - 426px)*.75));max-width:calc(100vw - 36px);margin:0 auto}body[data-photo-mobile=true] #canvasHost{width:100%;max-width:none;box-shadow:none}body[data-photo-mobile=true] #emptyPhoto{height:auto;min-height:0;padding:12px;gap:8px}body[data-photo-mobile=true] #inlineFields{display:none}body[data-photo-mobile=true] #photoTools{grid-row:3;grid-column:1;display:grid;grid-template-rows:56px minmax(0,1fr);height:292px;border-top:1px solid #000100;overflow:hidden}body[data-photo-mobile=true] .photo-tool-content{height:100%}body[data-photo-mobile=true] .photo-tool-content .actions button{min-height:44px}}
@media(max-width:800px) and (max-height:740px){body[data-photo-mobile=true] .editor-layout{grid-template-rows:44px minmax(0,1fr) 240px;height:calc(100dvh - 56px - max(16px,env(safe-area-inset-bottom)))}body[data-photo-mobile=true] #photoTools{height:240px}body[data-photo-mobile=true] #canvasHostWrapper,body[data-photo-mobile=true] #emptyPhoto{width:min(258px,calc((100dvh - 388px)*.75))}}
@media(max-width:800px){body[data-photo-mobile=true][data-keyboard=true] .topbar{position:fixed;left:0;right:0;top:var(--scene-visual-top,0px);z-index:12}body[data-photo-mobile=true][data-keyboard=true] #editor{position:fixed;left:0;right:0;top:calc(var(--scene-visual-top,0px) + 56px);height:calc(var(--scene-visual-height,100dvh) - 56px)}body[data-photo-mobile=true][data-keyboard=true] .editor-layout{height:calc(var(--scene-visual-height,100dvh) - 56px);grid-template-rows:44px minmax(0,1fr) 190px}body[data-photo-mobile=true][data-keyboard=true] #photoTools{height:190px}body[data-photo-mobile=true][data-keyboard=true] #canvasHostWrapper,body[data-photo-mobile=true][data-keyboard=true] #emptyPhoto{width:min(288px,calc((var(--scene-visual-height,100dvh) - 322px)*.75))}}
@media(prefers-reduced-motion:reduce){.work-card,.card-choice{transition:none!important;transform:none!important}}
.work-grid{display:block}.work-group{margin:0 0 30px}.work-group-heading{display:flex;align-items:center;gap:12px;margin:0 0 12px;font-size:22px;font-weight:700;letter-spacing:-.02em}.work-group-heading span{font-size:12px;font-weight:400;color:var(--muted)}.work-group-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}.work-card{position:relative;min-width:0;padding:9px;transition:transform .18s ease,box-shadow .18s ease}.work-card:hover{transform:translateY(-3px);box-shadow:0 8px 20px #00010018}.work-card-details{display:flex;justify-content:space-between;align-items:flex-start;gap:4px;min-width:0}.work-card-details>div:first-child{min-width:0}.work-card h4{font-size:15px;line-height:1.4;overflow-wrap:anywhere;font-weight:600;margin:10px 0 4px}.work-card-details p{margin:0 0 4px}.work-actions-menu{position:relative;flex:none;margin-top:3px}.work-actions-menu summary{list-style:none;cursor:pointer;display:flex;align-items:center;justify-content:center;min-width:44px;min-height:44px;padding:4px 6px;font-size:12px;border:1px solid var(--line);background:var(--paper)}.work-actions-menu summary::-webkit-details-marker{display:none}.work-actions-menu[open] summary{background:var(--accent);border-color:var(--ink)}.work-menu-actions{position:absolute;right:0;top:44px;z-index:10;min-width:150px;padding:4px;background:var(--paper);border:1px solid var(--ink);box-shadow:0 8px 18px #00010020}.work-menu-actions button{display:block;width:100%;min-height:44px;border:0;text-align:left;padding:8px 10px;font-size:12px;white-space:nowrap}.work-menu-actions button:hover{background:var(--accent)}
.work-group:has(.work-actions-menu[open]),.work-card:has(.work-actions-menu[open]){position:relative;z-index:20}
.work-actions-trigger{flex:none;min-width:44px;width:44px;height:44px;min-height:44px;padding:0;margin-top:3px;background:#FDFFFD;border:1px solid #A0A3A0;font-size:22px;line-height:1}.work-action-dialog{width:320px;max-width:calc(100vw - 24px);height:288px;max-height:calc(100dvh - 24px);padding:12px;border:1px solid #A0A3A0;border-radius:12px;background:#FDFFFD;overflow:auto}.work-action-dialog h2{font-size:16px;line-height:32px;margin:0 0 8px;font-weight:600}.work-dialog-actions{display:grid;gap:2px}.work-dialog-actions button{display:block;width:100%;height:44px;min-height:44px;padding:8px 14px;border:0;background:#F6F7F6;text-align:left;font-size:13px}.work-dialog-actions button:nth-last-child(2){background:#FFF0F3}.work-dialog-actions button:hover{background:#4AF5E8}.work-action-dialog::backdrop{background:#00010066}.rename-dialog{width:320px;max-width:calc(100vw - 24px);padding:16px}.rename-dialog h2{font-size:18px}.rename-dialog .actions{justify-content:flex-end}
#home{max-width:1360px;padding:16px 24px 48px}#home #backToEditor{margin:0 0 12px}#library{margin:0}#library .section-head{margin:0 0 10px;align-items:center}#libraryHeading{font-size:30px;font-weight:600}#library .section-head .actions button{min-height:44px;padding:5px 10px;font-size:12px}#library>.hint{display:none}#libraryTabs{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));width:min(622px,100%);gap:10px;margin:0 0 12px}#libraryTabs button{min-height:44px;padding:7px;font-size:13px}#libraryTabs button[aria-pressed=true]{background:#4AF5E8;border-color:#000100}#photoLibraryEntry{display:flex;flex-direction:column;justify-content:center;align-items:flex-start;gap:5px;width:100%;min-height:70px;padding:9px 14px;text-align:left;background:#EAF7F6;border:1px solid #ADCFCD}#photoLibraryEntry strong{font-size:18px;font-weight:600}#photoLibraryEntry span{font-size:12px}.work-group{margin:26px 0 30px;scroll-margin-top:12px}.work-group-heading{font-size:23px;font-weight:500;margin-bottom:14px}.work-group-grid{grid-template-columns:repeat(3,minmax(0,316px));justify-content:center;gap:24px}.work-card{width:100%;max-width:316px;min-height:470px;height:auto;padding:12px;border:0;background:transparent}.work-card img{width:100%;aspect-ratio:3/4;object-fit:contain}.work-card h4{margin:8px 0 0;font-size:16px;font-weight:500}.work-card-details p{display:none}.work-actions-menu{margin-top:4px}.work-actions-menu summary{font-size:22px;font-weight:600;line-height:1}.work-card:hover{box-shadow:0 8px 20px #00010012}
@media(max-width:800px){.work-group-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.work-group-heading{font-size:18px}.work-card{padding:6px}.work-card h4{font-size:13px}.work-card-details p{font-size:10px}.work-actions-menu summary{min-width:44px;min-height:44px;padding:2px;font-size:10px}}
@media(max-width:800px){#home{padding:8px 10px 32px}#home #backToEditor{margin:0 0 -8px}#library .section-head{display:flex;flex-wrap:nowrap;gap:5px}#libraryHeading{font-size:26px;white-space:nowrap}#library .section-head .actions{gap:0;margin-left:auto;flex-wrap:nowrap}#library .section-head .actions button{padding:4px 5px;font-size:11px;white-space:nowrap}#libraryTabs{width:100%;gap:4px;margin:0 0 14px}#libraryTabs button{padding:5px 0}#photoLibraryEntry{padding:8px 15px}#photoLibraryEntry strong{font-size:17px}.work-group{margin:28px 0 22px}.work-group-heading{font-size:19px;margin-bottom:12px}.work-group-grid{grid-template-columns:repeat(2,minmax(0,179px));gap:12px}.work-card{width:100%;max-width:179px;min-height:280px;height:auto;padding:9px}.work-card h4{font-size:13px;margin:5px 0 0;line-height:1.3}.work-actions-menu{margin:0}.work-actions-menu summary{font-size:20px}}
@media(max-width:800px){.work-group-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(min-width:801px) and (max-width:1043px){.work-group-grid{grid-template-columns:repeat(2,minmax(0,316px))}}
@media(prefers-reduced-motion:reduce){.work-card{transition:none!important;transform:none!important}}

/* Grounded warehouse: Page 1 55:1863/55:1864, grids 125:11924/125:14609.
   Shared ESM WorkTile; static slots stay fixed while only artwork lifts on hover. */
body[data-view=library]{overflow:auto!important}
body[data-view=library] #home{display:block;max-width:1360px;min-height:calc(100dvh - 52px);padding:12px 24px 48px}
body[data-view=library] #home #backToEditor{min-height:44px;margin:0 0 -8px}
body[data-view=library] #library .section-head{min-height:44px;margin:0 0 10px}
body[data-view=library] footer{display:flex}
body[data-view=library] .topbar #navLibrary{display:block}
.warehouse-icon{display:inline-block;width:24px!important;height:24px!important;flex:none;aspect-ratio:auto!important;object-fit:contain;vertical-align:middle;background:transparent!important;border-radius:0!important}
.warehouse-tools{display:flex;gap:12px;min-height:44px;margin-bottom:12px}
.warehouse-tools button,.warehouse-section-head button,.warehouse-dialog button,.warehouse-opening button,.warehouse-summary button{min-height:44px;display:inline-flex;align-items:center;justify-content:center;gap:6px}
.warehouse-body{display:block}
.warehouse-summary{display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:auto auto;column-gap:16px;align-content:center;min-height:72px;padding:12px 16px;background:var(--paper);border:1px solid var(--line);margin-bottom:12px}
.warehouse-summary h3{font-size:20px;font-weight:500;line-height:24px;margin:0;overflow-wrap:anywhere}.warehouse-summary p{font-size:12px;color:var(--muted);margin:4px 0 0}.warehouse-summary button{grid-column:2;grid-row:1/3}
.warehouse-opening{display:flex;align-items:center;gap:24px;min-height:248px;padding:16px;background:var(--white);margin-bottom:52px}
.warehouse-cover-open,.warehouse-cover-empty{width:161px;min-width:161px;height:215px;padding:0;border:0;background:var(--paper)}.warehouse-cover-open img{display:block;width:161px;height:215px;object-fit:contain}.warehouse-cover-empty{display:flex;align-items:center;justify-content:center;text-align:center;border:1px dashed var(--line);font-size:12px;color:var(--muted);padding:12px}
.warehouse-cover-text{min-width:0}.warehouse-cover-text h3{display:flex;align-items:center;gap:8px;font-size:16px;margin:0;font-weight:400}.warehouse-cover-text p{font-size:16px;margin:4px 0}.warehouse-cover-text button{font-size:13px;padding:4px 0;display:flex;justify-content:flex-start}
.warehouse-section{margin:0 0 48px}.warehouse-section-head{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:44px;margin-bottom:10px}.warehouse-section-head h3{display:flex;align-items:center;gap:8px;font-size:20px;font-weight:400;line-height:24px;margin:0}.warehouse-section-head h3 span{font-size:12px;color:var(--muted);margin-left:4px}.warehouse-section-head .actions{gap:8px;flex-wrap:nowrap}.warehouse-arrow{width:44px;padding:0}
.warehouse-rail{display:flex;gap:24px;overflow-x:auto;overflow-y:hidden;scroll-snap-type:x proximity;touch-action:pan-x pan-y;scrollbar-width:thin;padding:0 0 8px;min-height:470px;overscroll-behavior-x:contain}
.warehouse-body .work-card{flex:0 0 316px;width:316px;max-width:316px;min-height:470px;padding:9px;background:transparent;border:0;border-radius:8px;scroll-snap-align:start;transform:none!important;box-shadow:none!important}
.warehouse-body .work-open{display:flex;align-items:center;justify-content:center;padding:0;width:100%;height:398px;background:transparent;border:0;overflow:visible}.warehouse-body .work-open img{display:block;width:100%;height:398px;aspect-ratio:auto;object-fit:contain;transform-origin:center;transition:transform .18s ease,filter .18s ease}
.warehouse-body .work-card-details{display:flex;align-items:center;gap:4px;margin-top:8px}.warehouse-body .work-card-details>div{flex:1;min-width:0}.warehouse-body .work-card h4{font-size:16px;font-weight:400;line-height:20px;margin:0;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere}.warehouse-body .work-card-details .work-type{display:block;font-size:11px;color:var(--muted);margin:4px 0 0}.warehouse-body .work-actions-trigger{margin:0;display:flex;align-items:center;justify-content:center;min-height:44px;border:0;background:transparent}
.warehouse-empty-row{display:flex;align-items:center;justify-content:center;width:100%;min-height:215px;border:1px dashed var(--line);color:var(--muted);padding:24px;font-size:13px}
.warehouse-type-filters#libraryTabs{display:flex;overflow-x:auto;gap:4px;width:100%;margin:0 0 24px}.warehouse-type-filters button{flex:0 0 110px;min-height:44px;font-size:14px}.warehouse-type-filters button[aria-pressed=true]{background:var(--accent);border-color:var(--ink)}
.warehouse-work-grid{display:grid;grid-template-columns:repeat(3,minmax(0,316px));gap:24px 12px;justify-content:start}.warehouse-work-grid .work-card{width:100%}
.warehouse-dialog{width:min(620px,calc(100vw - 24px));max-height:calc(100dvh - 24px);padding:20px;overflow:auto}.warehouse-dialog h2{font-size:18px;margin:0 0 16px;overflow-wrap:anywhere}.warehouse-dialog-actions{display:grid;gap:6px;margin-bottom:12px}.warehouse-dialog-actions button{text-align:left;justify-content:flex-start;width:100%}.warehouse-view-image{display:block;max-width:100%;width:300px;height:400px;object-fit:contain;margin:0 auto}.warehouse-viewer>button{margin:8px 8px 12px 0}.warehouse-cover-picker{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-bottom:12px}.warehouse-cover-picker button{display:flex;flex-direction:column;gap:8px;overflow-wrap:anywhere}.warehouse-cover-picker img{width:90px;height:120px;object-fit:contain}
.work-placement-label select{display:block;width:100%;min-height:44px;margin-top:8px;border:1px solid var(--line);border-radius:5px;background:var(--paper);color:var(--ink);font:inherit;padding:8px}
@media(max-width:1043px) and (min-width:801px){.warehouse-work-grid{grid-template-columns:repeat(2,minmax(0,316px))}}
@media(max-width:800px){body[data-view=library] #home{padding:8px 10px 32px;min-height:calc(100dvh - 44px)}.warehouse-summary{padding:12px 10px}.warehouse-summary h3{font-size:18px}.warehouse-opening{margin-bottom:24px;padding:16px;gap:24px}.warehouse-cover-text{flex:1}.warehouse-cover-text p{font-size:14px}.warehouse-section{margin-bottom:24px}.warehouse-section-head{gap:6px;flex-wrap:wrap;margin-bottom:4px}.warehouse-section-head h3{font-size:20px}.warehouse-section-head .actions{gap:0;max-width:100%;margin-left:auto}.warehouse-section-head button{font-size:11px;padding:4px}.warehouse-section-head .warehouse-arrow{width:44px;min-width:44px}.warehouse-rail{min-height:280px;gap:24px;scroll-snap-type:x mandatory}.warehouse-body .work-card{flex-basis:179px;width:179px;max-width:179px;min-height:280px;padding:9px}.warehouse-body .work-open,.warehouse-body .work-open img{height:215px}.warehouse-body .work-card-details{margin-top:6px}.warehouse-body .work-card h4{font-size:13px;line-height:16px}.warehouse-body .work-card-details .work-type{font-size:10px;margin-top:2px}.warehouse-body .work-actions-trigger{width:44px;min-width:44px;min-height:44px;padding:0}.warehouse-body .work-actions-trigger .warehouse-icon{width:20px!important;height:20px!important}.warehouse-work-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:24px 12px}.warehouse-work-grid .work-card{width:100%;max-width:none;min-width:0}.warehouse-work-grid .work-open,.warehouse-work-grid .work-open img{height:auto;min-height:0;aspect-ratio:161/215}.warehouse-type-filters#libraryTabs{gap:4px;margin-bottom:24px}.warehouse-type-filters button{flex:0 0 calc((100% - 16px)/5);font-size:13px;padding:4px}.warehouse-view-image{max-height:50dvh;height:auto;aspect-ratio:3/4}.warehouse-dialog{padding:16px}.warehouse-cover-picker img{width:80px;height:106px}}
@media(prefers-reduced-motion:reduce){.warehouse-body .work-card:hover .work-open img{transform:none;filter:none}.warehouse-rail{scroll-behavior:auto}}



.warehouse-rail.is-edge-scrolling{scroll-snap-type:none}

body[data-view=library] .topbar #navLibrary{display:inline-flex;align-items:center;justify-content:center;min-width:44px;min-height:44px;padding:6px 10px}
body[data-view=library] .topbar #navLibraryLabel{display:inline!important;margin:0;font-size:12px;color:var(--ink)}

@media(min-width:801px){.warehouse-body .work-card{padding:12px}.warehouse-body .work-open{width:290px;height:386.67px;margin:1px}.warehouse-body .work-open img{width:290px;height:386.67px}.warehouse-body .work-card-details{width:291px;margin-top:6px;align-items:flex-start}}
@media(max-width:800px){.warehouse-body .work-open{margin:0}.warehouse-body .work-card-details{align-items:flex-start}.warehouse-rail .work-card-details>div{max-width:110px}.warehouse-rail .work-card h4{margin-top:1px}}

/* Frozen Photo fields and Event background choices share the existing tool dock. */
.photo-appearance{display:flex;gap:10px;margin:12px 0}.photo-appearance button{flex:1;min-height:44px}.photo-appearance button[aria-pressed=true]{background:var(--accent);border-color:var(--ink)}
.event-background-slot{padding:0;margin:0}.event-background-slot fieldset{padding:0;border:0;margin:0 0 8px;min-width:0}.event-background-slot legend{padding:0;font-size:14px;line-height:18px;margin-bottom:7px}.event-background-options{display:flex;gap:8px;overflow-x:auto;scrollbar-width:thin;padding-bottom:2px}.event-background-options .card-choice{position:relative;flex:0 0 80px;min-width:80px;height:44px;min-height:44px;padding:2px;font-size:10px;overflow:hidden}.event-background-options img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;opacity:.4;pointer-events:none}.event-background-options .card-choice[aria-pressed=true]{outline:2px solid var(--forest);outline-offset:-2px;background:var(--accent)}.event-background-options .color-choice{background:var(--swatch)}.event-background-slot>.actions{display:flex;justify-content:space-between;margin-top:8px}.event-background-slot>.actions button{min-height:44px}.event-background-slot img{z-index:0}#cardBorders .card-choice{position:relative;min-height:76px;padding-top:54px}#cardBorders img{position:absolute;top:4px;left:calc(50% - 18px);width:36px;height:48px;object-fit:contain}
@media(max-width:800px){#photoTools .card-field-tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:0 0 12px}#photoTools .card-field-tab{min-height:44px;padding:4px;font-size:12px}#photoTools #fields input,#photoTools #fields textarea{height:78px;min-height:78px;margin-top:0}#photoTools #fields label{margin:0}#photoTools #fields .field-note{display:none}#photoTools #cardFieldHelp{margin:4px 0;font-size:11px}#photoTools #cardNameDetails{display:inline-block;width:calc(50% - 10px);vertical-align:top;margin-left:10px}#photoTools #showItemExample{width:calc(50% - 10px);padding:4px}#photoTools #panelPhoto .actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}#photoTools #panelPhoto h3,#photoTools #photoHint{display:none}.event-background-slot{min-height:234px}}
@media(hover:hover) and (pointer:fine) and (prefers-reduced-motion:no-preference){body:not(:has(dialog[open])) .warehouse-body .work-card:hover .work-open img{transform:translateY(-3px) rotate(.5deg);filter:drop-shadow(0 8px 8px #00010018)}body:not(:has(dialog[open])) .warehouse-rail .work-card:has(+ .work-card:hover) .work-open img{transform:translateX(-4px)}body:not(:has(dialog[open])) .warehouse-rail .work-card:hover + .work-card .work-open img{transform:translateX(4px)}}

@media(max-width:800px){body[data-card-visual=true] #cardTools[data-background-open=true]{grid-template-rows:minmax(0,1fr)}#cardTools[data-background-open=true]>.card-tool-tabs{display:none}body[data-card-visual=true] #cardTools[data-background-open=true] .card-tool-content{grid-row:1;min-height:0;height:100%;padding:0}.event-background-slot{padding:18px 12px 14px}.event-background-slot fieldset{margin-bottom:1px}.event-background-options{padding-bottom:0}.event-background-slot>.actions{margin-top:6px}}

.event-background-slot{border:0;background:var(--paper)}.event-background-options button:not(:disabled){cursor:pointer;color:var(--ink)}
@media(max-width:800px){.event-background-options{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px;overflow:visible;scrollbar-width:none}.event-background-options .card-choice{width:100%;min-width:0;min-height:44px;flex:none;font-size:11px;line-height:14px}.event-background-slot{min-height:0}.event-background-slot legend{line-height:18px}}

/* Desktop Photo uses the same controls, with two visible inspector docks. Mobile rules stay scoped. */
@media(min-width:801px){
 body[data-view=editor][data-photo-desktop=true] .topbar{height:73px;min-height:73px;padding:16px 32px}
 body[data-photo-desktop=true] #editor{max-width:1360px;padding:0 32px 32px}
 body[data-photo-desktop=true] .mode-row{height:44px;max-width:none;margin:0}
 #desktopPhotoActions{height:88px;display:flex;align-items:flex-start;padding:20px 0;gap:8px}
 #desktopPhotoActions h1{flex:1;min-width:0;font-size:22px;line-height:29px;font-weight:400;margin:0}
 #desktopPhotoActions .file-actions{display:flex;gap:8px;flex:none;margin:0}#desktopPhotoActions .file-actions button{height:48px;min-height:48px;font-size:13px}#desktopPhotoActions #materialsToggle{display:none}
 body[data-photo-desktop=true] .editor-layout{grid-template-columns:390px minmax(0,1fr);gap:20px;align-items:start}
 body[data-photo-desktop=true] .controls{width:390px;height:660px;overflow:hidden}
 body[data-photo-desktop=true] .template-section{height:44px;margin:0 0 8px;padding:0;border:0}body[data-photo-desktop=true] .template-section .panel-title,body[data-photo-desktop=true] #templateHint{display:none}
 body[data-photo-desktop=true] .template-switcher{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:4px;height:44px;padding:0 5px}body[data-photo-desktop=true] .template-option{height:44px;min-height:44px;padding:2px;font-size:14px}body[data-photo-desktop=true] .template-mini{display:none}
 body[data-photo-desktop=true] #photoTools{height:608px;display:grid;grid-template-rows:56px minmax(0,1fr);overflow:hidden}
 body[data-photo-desktop=true] .photo-tool-content{display:grid;grid-template-rows:236px 292px;gap:16px;padding:0;overflow:hidden}
 body[data-photo-desktop=true] #photo-photo-panel{height:236px;min-height:0;overflow-y:auto;padding:8px 10px}
 body[data-photo-desktop=true] #photo-words-panel{height:292px;min-height:0;overflow:hidden;border-top:1px solid var(--ink)}
 body[data-photo-desktop=true] #photo-words-panel::before{content:'文字';display:block;height:56px;padding:18px 12px;background:var(--accent);border-bottom:1px solid var(--ink);font-size:14px}
 body[data-photo-desktop=true] #photo-words-panel #wordsAdjust{height:236px;overflow-y:auto;padding:8px 10px}
 body[data-photo-desktop=true] #photo-elements-panel{grid-row:1 / span 2;height:544px;overflow-y:auto;padding:8px 10px}
 body[data-photo-desktop=true] #photoTools .card-field-tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:0 0 12px}
 body[data-photo-desktop=true] #photoTools .card-field-tab{min-height:44px;font-size:12px;padding:4px}
 body[data-photo-desktop=true] #photoTools #fields input,body[data-photo-desktop=true] #photoTools #fields textarea{height:78px;min-height:78px;margin-top:0}
 body[data-photo-desktop=true] #photoTools #fields label{margin:0}body[data-photo-desktop=true] #photoTools .field-note{display:none}
 body[data-photo-desktop=true] #photoTools #cardFieldHelp{margin:4px 0;font-size:11px}
 body[data-photo-desktop=true] #photoTools #cardNameDetails{display:inline-block;width:calc(50% - 10px);margin-left:10px;vertical-align:top}
 body[data-photo-desktop=true] #photoTools #showItemExample{width:calc(50% - 10px);padding:4px}
 body[data-photo-desktop=true] .canvas-area{grid-column:2;grid-row:1;min-width:0}
 body[data-photo-desktop=true] .preview-panel{position:relative;top:0;min-height:737px;padding:20px;border:0;background:var(--paper)}
 body[data-photo-desktop=true] .preview-top{height:15px;margin:0;justify-content:center;gap:12px}
 body[data-photo-desktop=true] .canvas-upload{height:57px;margin:16px 0 0;padding:0 0 12px;justify-content:center}
 body[data-photo-desktop=true] #canvasHostWrapper{width:min(401.25px,100%);margin:16px auto 0}
 body[data-photo-desktop=true] #canvasHost{width:100%;max-width:401.25px;box-shadow:none}
 body[data-photo-desktop=true] .empty-photo{width:min(401.25px,100%);height:535px;margin:16px auto 0}
 body[data-photo-desktop=true] .preview-bottom{margin:16px auto 0;max-width:401.25px}
}
body[data-view=library] .topbar #navLibrary{width:85px;height:44px;min-height:44px;border:1px solid var(--ink);border-radius:5px;background:var(--forest);color:var(--ink);font-size:12px}
@media(min-width:801px){
 body[data-photo-desktop=true] #photo-words-panel::before{box-sizing:border-box;height:56px;min-height:56px}
 body[data-photo-desktop=true] .mode-row{display:flex;justify-content:flex-start;align-items:center;height:44px;max-width:none;padding:4px 10px;margin:0;gap:4px}
 body[data-photo-desktop=true] .mode-row nav{display:flex;flex:none;grid-template-columns:none;width:auto;border:0;border-radius:0;overflow:visible;gap:4px}
 body[data-photo-desktop=true] .mode-row .workspace-tab{flex:none;width:90px;height:36px;min-height:36px;padding:6px 10px;border:1px solid var(--ink);font-size:12px;font-weight:400}
 body[data-photo-desktop=true] .history-actions{display:flex;flex:none;grid-template-columns:none;gap:4px}
 body[data-photo-desktop=true] .history-actions button{flex:none;width:86px;height:36px;min-height:36px;padding:6px 10px;font-size:12px}
}
@media(min-width:801px){body[data-photo-desktop=true] #photoTools .card-field-tabs{margin-bottom:6px}}
/* Short desktop viewports keep the full 3:4 artwork and scroll each current-operation dock. */
@media(min-width:801px) and (max-height:849px){
 body[data-view=editor][data-photo-desktop=true] .topbar{height:56px;min-height:56px;padding:8px 24px}
 body[data-photo-desktop=true] #editor{padding:0 24px 16px}
 body[data-photo-desktop=true] #desktopPhotoActions{height:64px;padding:8px 0}
 body[data-photo-desktop=true] .controls{height:calc(100dvh - 180px);min-height:300px}
 body[data-photo-desktop=true] #photoTools{height:calc(100% - 52px);grid-template-rows:56px minmax(0,1fr)}
 body[data-photo-desktop=true] .photo-tool-content{grid-template-rows:minmax(120px,1fr) minmax(170px,1fr);gap:12px;min-height:0}
 body[data-photo-desktop=true] #photo-photo-panel,body[data-photo-desktop=true] #photo-words-panel{height:auto;min-height:0}
 body[data-photo-desktop=true] #photo-words-panel #wordsAdjust{height:calc(100% - 56px);min-height:0;overflow-y:auto}
 body[data-photo-desktop=true] #photo-elements-panel{height:auto;min-height:0}
 body[data-photo-desktop=true] .preview-panel{height:calc(100dvh - 164px);min-height:0;padding:14px;overflow-y:auto}
 body[data-photo-desktop=true] .canvas-upload{display:none}
 body[data-photo-desktop=true] #canvasHostWrapper,body[data-photo-desktop=true] .empty-photo{width:min(401.25px,100%,calc((100dvh - 284px)*.75))}
 body[data-photo-desktop=true] .empty-photo{height:auto;aspect-ratio:3/4;min-height:0}
}
/* V3 keeps the validated preview shell; direct targets are UI only, outside PNG. */
#photoV3Targets{position:absolute;inset:0;pointer-events:none;z-index:3}
#photoV3Targets button{position:absolute;pointer-events:auto;min-height:0;padding:0;border:1px dashed transparent;border-radius:0;background:transparent;color:#FDFFFD;box-shadow:none;transform-origin:center;font-size:28px;text-shadow:0 1px 5px #151515}
#photoV3Targets .photo-v3-slot[data-filled=false]{border-color:#FDFFFD99;background:#15151520}
#photoV3Targets button:hover,#photoV3Targets button:focus-visible{border-color:#E2117B;outline:2px solid #4AF5E8;outline-offset:0}
#photoV3Targets .photo-v3-text-target{z-index:2}
body[data-photo-v3=true] .canvas-upload,body[data-photo-v3=true] #materialsToggle,body[data-photo-v3=true] #quickPhoto{display:none!important}
body[data-photo-v3=true] #photoTools{grid-template-rows:minmax(0,1fr)}
#photoV3Dock{min-height:0;height:100%;overflow-y:auto;overscroll-behavior:contain;padding:8px}
.photo-v3-variants{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.photo-v3-variant{height:104px;min-width:0;display:flex;align-items:center;justify-content:center;gap:8px;padding:6px;font-size:12px}
.photo-v3-variant img{height:88px;width:66px;object-fit:contain;background:#eee8dd}
#photoV3Dock button[aria-pressed=true]{background:#4AF5E8;box-shadow:inset 0 -3px #E2117B}
.photo-v3-filters{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-top:14px}
#photoV3Dock button{min-height:44px;font-size:12px}
.photo-v3-hint{font-size:12px;line-height:1.6;margin:16px 4px 0}
.photo-v3-entry{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:18px 4px 6px}
.photo-v3-edit-header{display:flex;align-items:center;gap:8px;height:44px;margin:0 4px 4px}
.photo-v3-edit-header strong{flex:1;font-size:13px}
.photo-v3-edit-header button{width:68px;padding:4px}
.photo-v3-edit-header select{width:90px;height:36px;min-height:36px;margin:0;font-size:12px;padding:3px}
#photoV3Dock textarea{display:block;width:calc(100% - 24px);height:64px;min-height:64px;margin:8px 12px 10px;padding:8px;font-size:14px;resize:none}
.photo-v3-text-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:0 4px 8px}
.photo-v3-move{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:5px;margin:0 4px 8px}
.photo-v3-crop-slots{display:flex;gap:6px;margin-bottom:4px}.photo-v3-crop-slots button{flex:1;min-width:0;padding:4px}
#photoV3Dock label{display:grid;grid-template-columns:86px minmax(0,1fr);align-items:center;min-height:44px;margin:0 4px;font-size:12px}
#photoV3Dock input[type=range]{height:44px;min-height:44px;margin:0;touch-action:pan-x}
@media(max-width:800px) and (max-height:740px){body[data-photo-v3=true]:not([data-keyboard=true]) .editor-layout{grid-template-rows:44px minmax(0,1fr) 292px;height:calc(100dvh - 56px)}body[data-photo-v3=true]:not([data-keyboard=true]) #photoTools{height:292px}body[data-photo-v3=true]:not([data-keyboard=true]) #canvasHostWrapper{width:min(216px,calc((100dvh - 412px)*.75));max-width:calc(100vw - 24px)}}
.photo-v3-error{margin:6px 4px;color:#A51D50;font-size:12px;line-height:1.5}
.photo-v3-entry{grid-template-columns:1fr;margin-top:18px}
.photo-v3-variants{gap:6px}.photo-v3-hint{margin-top:20px}.photo-v3-entry{margin-top:26.8px}
.photo-v3-information{margin:8px 4px}.photo-v3-information summary{min-height:44px;align-content:center;font-size:12px;cursor:pointer}#photoV3Dock .photo-v3-information label{display:block;margin:6px 0}#photoV3Dock .photo-v3-information input,#photoV3Dock .photo-v3-information select{width:100%;min-height:44px;margin:4px 0}
.photo-v3-variants{position:relative}.photo-v3-example-label{position:absolute;left:8px;top:7px;background:#FDFFFDd9;color:#494B49;font-size:9px;line-height:14px;padding:0 3px;pointer-events:none}
