#preview.checkerboard{background:repeating-conic-gradient(#e2e2e2 0 25%,#fff 0 50%) 0 0/20px 20px}
:root {
  --ink:#1e302a; --secondary:#5c685f; --line:#d6d9ce; --paper:#f6f6f0;
  --panel:#fffefa; --accent:#23483a; --wash:#e9efe4;
  font-family:"Inter","Segoe UI",Arial,sans-serif; color:var(--ink); font-size:14px;
  background:var(--paper); font-synthesis:none;
}
* {box-sizing:border-box}
body {margin:0}
button,input,select {font:inherit;color:inherit}
button,select {cursor:pointer}
button {border:1px solid var(--line);border-radius:6px;background:var(--panel);padding:8px 12px;font-weight:600}
button:hover,select:hover {border-color:#8d9e8f;background-color:#f0f3eb}
button:disabled,select:disabled {opacity:.46;cursor:default}
:focus-visible {outline:3px solid #a0772e;outline-offset:3px}
[hidden]{display:none!important}
.tools,.zoom-tools,.view-toolbar,.export-actions,.file-strip,.crop-actions,.sample-row,.control-row{display:flex;align-items:center}
.workspace {min-width:0}
.workspace-head {justify-content:space-between;gap:12px;margin:0 0 17px}
h1,h2 {margin:0}
h1 {font:normal clamp(28px,3vw,47px)/1.06 Georgia,"Times New Roman",serif;letter-spacing:-.05em}
h2 {font:650 16px/1.3 "Segoe UI",Arial,sans-serif;letter-spacing:-.035em}
.scene-indicator {white-space:nowrap;font-size:11px;display:flex;align-items:center;gap:6px;line-height:1.5;color:var(--secondary);font-variant-numeric:tabular-nums}
.scene-indicator b {font-weight:650;color:var(--ink)}
.preview-card,.panel {border:1px solid var(--line);border-radius:11px;background:var(--panel);overflow:hidden}
#stage {background:#e4e5dd;position:relative;display:grid;place-items:center;overflow:hidden;width:100%;height:clamp(290px,52vh,740px);isolation:isolate}
#preview {display:block;max-width:100%;max-height:100%;object-fit:contain;touch-action:none}
.view-toolbar {justify-content:space-between;gap:10px;min-height:43px;padding:5px 10px 5px 16px;border-top:1px solid var(--line);background:#fafbf6}
#scene-name {font:550 12px/1.3 "Segoe UI",Arial,sans-serif;letter-spacing:.015em}
.tools {gap:8px}.tools button {font-size:12px;border:0;background:transparent;border-radius:4px;padding:5px 8px}.tools button:hover{background:#e8ece2}.tools .vl{height:15px}
#zoom-in,#zoom-out{font-size:17px}#zoom-value {min-width:46px;font-variant-numeric:tabular-nums}
#crop-open {display:flex;align-items:center;gap:7px}
.crop-icon,.copy-icon {display:inline-block;position:relative;width:13px;height:13px}
.crop-icon:before,.crop-icon:after {content:"";display:block;position:absolute;width:9px;height:9px}
.crop-icon:before {border:solid currentColor;border-width:0 0 1.5px 1.5px;left:1px;top:0}
.crop-icon:after {border:solid currentColor;border-width:1.5px 1.5px 0 0;left:3px;top:3px}
.scenes-block {margin-top:22px}.scenes-block h2 {margin-bottom:12px}
#scenes {display:grid;grid-template-columns:repeat(auto-fit,minmax(82px,1fr));gap:8px}
#scenes button {display:flex;flex-direction:column;position:relative;padding:3px;border-radius:7px;border:1px solid transparent;background:transparent;gap:5px;text-align:left;min-width:0;overflow:hidden;font:600 11px "Segoe UI",Arial,sans-serif;color:var(--secondary)}
#scenes button:hover {background:#e9ebe3;border-color:#b7c1b5}
#scenes button:is([aria-current="true"],[aria-pressed="true"],[aria-selected="true"],.active,.selected){background:#f1f5ec;border-color:var(--accent);color:var(--accent)}
#scenes canvas,#scenes img {display:block;background:#e1e2db;width:100%;height:auto;aspect-ratio:4/3;border-radius:4px;object-fit:cover}
#scenes button span {padding:0 3px 3px;white-space:normal;overflow-wrap:anywhere}
.panel {border-radius:10px}
.artwork,.section,.export {padding:18px 20px}
.panel h2 {font-size:17px;margin-bottom:15px}
.section,.export {border-top:1px solid var(--line)}
.pair {display:grid;grid-template-columns:1fr 1fr;gap:10px}
.field {display:grid;gap:5px;color:var(--secondary);font-size:11px;font-weight:600}
select {min-width:0;border:1px solid var(--line);border-radius:5px;background:var(--panel);font-size:12px;color:var(--ink);padding:6px 7px;min-height:31px}
.drop-zone {display:flex;flex-direction:column;align-items:center;justify-content:center;width:100%;margin-top:12px;padding:12px 8px;gap:4px;border:1px dashed #a2b39f;border-radius:7px;background:#f4f7ef}
.drop-zone:hover,.drop-zone.dragover {background:#e4eedf;border-color:#527650}
.upload-icon {width:24px;height:24px;border:1px solid #cbd6c6;display:grid;place-content:center;border-radius:6px;font-size:17px;margin-bottom:2px;background:#fbfdf7}
.drop-zone b {font-size:13px}.drop-zone small,.file-copy small {font-size:11px;color:var(--secondary);font-weight:400}
.file-strip {gap:6px;margin:10px 0}.file-copy {display:grid;gap:2px;flex:1;min-width:0}
.file-copy strong {font-size:12px;overflow-wrap:anywhere;font-weight:600}
.file-strip img {width:28px;height:34px;object-fit:cover;border-radius:2px}.file-strip button {border:0;background:transparent;padding:4px;font-size:16px}
.sample-row,.control-row {justify-content:space-between;gap:9px;font-size:12px}.sample-row span{white-space:nowrap}.sample-row select {max-width:65%}
.text-action {border:0;background:transparent;color:var(--accent);font-size:12px;padding:7px 0;margin:3px 0}.text-action span{padding-left:4px}
details>summary {cursor:pointer;list-style:none;display:flex;align-items:center;justify-content:space-between}
details>summary::-webkit-details-marker {display:none}
details>summary:after {content:"";width:6px;height:6px;border:solid currentColor;border-width:0 1.5px 1.5px 0;transform:rotate(45deg);margin-right:3px;flex-shrink:0}
details[open]>summary:after {transform:rotate(225deg)}
.section>summary {font-size:16px;font-weight:650;letter-spacing:-.03em}
.placement>summary {font-size:12px;color:var(--secondary);font-weight:600}
.detail-body {display:grid;gap:10px;margin-top:14px}
.control-row select,.control-row input[type=range] {width:48%}input[type=range],input[type=checkbox] {accent-color:var(--accent)}output{font-size:11px;color:var(--secondary)}
.swatches {display:grid;grid-template-columns:1fr 1fr;gap:12px 8px;margin-top:16px}
.swatches label {display:flex;align-items:center;gap:8px;font-size:12px;cursor:pointer}
input[type=color] {appearance:none;border:1px solid #b9bfb4;border-radius:50%;width:23px;height:23px;padding:2px;cursor:pointer;background:var(--panel);overflow:hidden}
input[type=color]::-webkit-color-swatch-wrapper {padding:0}
input[type=color]::-webkit-color-swatch {border:0;border-radius:50%}
.export {background:#f7f8f2}
.export-actions,.crop-actions {gap:8px;margin-top:12px}
.primary {border:1px solid var(--accent);background:var(--accent);color:#fff}
.primary:hover {border-color:#345e4b;background:#345e4b}
#download {flex:1;padding:9px 12px;display:flex;justify-content:center;align-items:center;gap:9px}#download span{font-size:16px}
#copy {width:41px;display:grid;place-content:center}
.copy-icon:before,.copy-icon:after {content:"";position:absolute;border:1.5px solid currentColor;border-radius:2px;width:8px;height:9px}
.copy-icon:before{top:0;left:0}.copy-icon:after{top:3px;left:3px;background:var(--panel)}
#status:not(:empty) {padding:9px 20px;border-top:1px solid var(--line);font-size:12px;line-height:1.4}
#crop-panel {border-top:1px solid var(--line);padding:12px}
.ratios {display:flex;gap:5px;flex-wrap:wrap;margin:0;padding:0;border:0}
.ratios legend {font-size:12px;margin-bottom:6px}
.ratios label{cursor:pointer;position:relative}.ratios input{position:absolute;opacity:0}.ratios span{display:block;padding:5px 8px;border:1px solid var(--line);border-radius:4px;font-size:12px}
.ratios input:checked+span{border-color:var(--accent);background:var(--wash)}.ratios input:focus-visible+span{outline:2px solid #a0772e}
#crop-frame {position:absolute;z-index:2;border:1.5px solid white;box-shadow:0 0 0 2000px #14221a6b;touch-action:none;cursor:move}
#crop-resize {position:absolute;right:-5px;bottom:-5px;padding:0;width:13px;height:13px;border-radius:2px;border:1px solid #173626;background:white;cursor:nwse-resize;touch-action:none}
.crop-actions {justify-content:flex-end}.crop-actions button{font-size:12px}
.turn-pair {display:flex;gap:4px}.turn-pair button,#design-crop {font-size:12px;padding:5px 8px}.control-row input[type=checkbox]{width:16px;height:16px;cursor:pointer}
#artwork-editor{display:block;width:100%;height:160px;object-fit:contain;background:#eeefe9;border:1px solid var(--line);border-radius:5px;touch-action:none}
.panel:has(#source option[value="image"]:checked) #design-colour-row,
.panel:has(#source option[value="colour"]:checked) :is(#drop-zone,.sample-row,.placement),
.panel:has(#clear-white:not(:checked)) label:has(#white-threshold),
.panel:has(#corners option:not([value="rounded"]):checked) label:has(#roundness){display:none}
/* Three working areas share the viewport; the canvas stays in view while editing. */
:root{--ink:#202227;--secondary:#60636b;--line:#dddfe3;--paper:#f1f2f4;--panel:#fff;--accent:#354db7;--wash:#e9edff;font-family:Inter,"Segoe UI",sans-serif}
.studio{display:grid;grid-template-columns:clamp(185px,17vw,254px) minmax(0,1fr) clamp(270px,22vw,338px);height:100dvh}
.scenes-block,.panel{background:#fcfcfd;min-width:0;overflow:auto;scrollbar-width:thin}
.scenes-block{margin:0;border-right:1px solid var(--line)}
.library-tools{background:#fcfcfd;padding:20px 14px 14px;display:grid;gap:12px;position:sticky;top:0;z-index:1}
.library-tools h2,.panel h2,.section>summary{font:600 15px/1.3 Inter,"Segoe UI",sans-serif;letter-spacing:-.02em;margin:0}
.library-tools select{width:100%}
#scenes{padding:0 10px 16px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 4px}
#scenes button{padding:3px;gap:4px;color:#4b4f58;border-radius:6px;font-size:11.5px;font-weight:500}
#scenes button.active{background:var(--wash);border-color:#6478c9;color:#233a9a}
#scenes button:hover{background:#eaecef}
#scenes canvas{aspect-ratio:4/3;border-radius:3px}
.workspace{background:#e9eaec;min-height:0;padding:clamp(10px,2vw,30px);display:grid;place-content:stretch}
.preview-card{background:transparent;border:0;border-radius:0;display:flex;flex-direction:column;justify-content:center;position:relative}
#stage{flex:1;height:auto;min-height:0;background:transparent;border-radius:5px}
#preview{box-shadow:0 2px 14px #1b203014}
.view-toolbar{background:transparent;border:0;padding:12px 0 0;gap:8px;flex-wrap:wrap}
.view-label{display:flex;gap:9px;align-items:baseline}
#scene-name{font:600 16px/1.2 Inter,"Segoe UI",sans-serif;letter-spacing:-.025em}
#scene-index{font:500 11px/1.2 ui-monospace,monospace;color:#646873}
.tools{padding:4px;background:#fff;border:1px solid #d5d7dd;border-radius:8px}
.tools .vl{width:1px;background:var(--line)}
.panel{border:0;border-left:1px solid var(--line);border-radius:0}
.panel h2{margin:0 0 14px}
.artwork,.section,.export{padding:18px}
select{border-radius:6px;min-height:34px;background:#fff;font-size:13px}
.field,.file-copy small,.drop-zone small{font-size:12px}
.sample-row,.control-row,.swatches label,.file-copy strong,.placement>summary{font-size:13px}
.drop-zone{padding:17px 8px;background:#f3f5fc;border:1px dashed #a6aec7;border-radius:7px;color:#26336a}
.drop-zone:hover{background:#eaedfa;border-color:var(--accent)}
.upload-icon{border:0;background:transparent;color:var(--accent);font-size:21px}
.sample-row{margin:12px 0 2px}
.primary,.primary:hover{background:#263361;border-color:#263361}
.export{background:#f7f8fb}
#download{min-height:40px}
#crop-panel{background:#fff;border:1px solid var(--line);border-radius:6px;margin-top:8px}
#reset{justify-self:start;font-size:12px}
@media(max-width:1050px) and (min-width:761px){.studio{grid-template-columns:162px minmax(0,1fr) 255px}.artwork,.section,.export{padding:14px}.workspace{padding:10px}.library-tools{padding:16px 10px 10px}}
@media(max-width:760px){.studio{display:flex;flex-direction:column;height:auto}.workspace{order:0;padding:12px}.preview-card{display:block}#stage{height:clamp(225px,47vh,480px)}.scenes-block{order:1;border:0;border-bottom:1px solid var(--line);overflow:visible}.library-tools{position:static;display:flex;align-items:center;justify-content:space-between;padding:12px 14px 6px}.library-tools select{width:auto}#scenes{display:flex;overflow-x:auto;padding:4px 10px 10px;gap:6px}#scenes button{flex:0 0 88px}.panel{order:2;border:0;overflow:visible}.artwork,.export,.section{padding:16px}.view-toolbar{padding-top:8px}}

#scenes canvas{background-size:cover;background-position:center}
@media(max-width:760px){#stage{height:auto;aspect-ratio:4/3}}
