*{box-sizing:border-box} :root{--ink:#25312f;--muted:#6b716d;--accent:#ae5b37;--line:#dedfd8;--paper:#f4f4ef;--green:#264c40}body{margin:0;background:var(--paper);color:var(--ink);font:16px/1.45 'Segoe UI',Arial,sans-serif}button,input,select{font:inherit}button{cursor:pointer;border:0}button:disabled{opacity:.45;cursor:wait}button:focus-visible,input:focus-visible,select:focus-visible,canvas:focus-visible{outline:3px solid #be724e;outline-offset:3px}button{transition:background .16s,color .16s}button:hover{filter:brightness(.96)}.app-header{height:86px;background:#202b29;color:#f4f1e9;display:flex;align-items:center;justify-content:space-between;padding:0 30px}.brand{display:flex;align-items:center;gap:14px;font-size:20px;font-weight:650;letter-spacing:3px}.brand-mark{font:italic 46px Georgia;letter-spacing:-4px;border-right:1px solid #64716a;padding-right:22px}.brand small{display:block;font-size:10px;letter-spacing:1.8px;font-weight:400;color:#b9c2bb;margin-top:2px}.project-name{font-size:15px}.project-name span{margin-left:24px;color:#bac0b9;font-size:12px;letter-spacing:1px}.quiet{background:transparent;color:inherit;font-size:14px;padding:10px 12px}.quiet span{margin-left:8px}.workspace{display:grid;grid-template-columns:312px minmax(0,1fr);min-height:calc(100vh - 86px)}.sidebar{background:#fbfbf7;border-right:1px solid var(--line);display:flex;flex-direction:column;max-height:calc(100vh - 86px);position:sticky;top:0}.side-title{padding:26px 26px 19px}.eyebrow{font-size:11px;letter-spacing:1.6px;font-weight:600;color:var(--muted)}h1{font:normal 29px/1.15 Georgia,serif;margin:12px 0 0;letter-spacing:-.7px}.tabs{display:flex;border-bottom:1px solid var(--line);padding:0 18px;gap:6px}.tabs button{background:none;color:var(--muted);padding:13px 10px;font-size:14px;flex:1;border-bottom:2px solid transparent}.tabs .active{border-color:var(--accent);color:var(--accent);font-weight:650}.panel{padding:22px 24px;overflow:auto;flex:1}.panel[hidden]{display:none}.sidebar-foot{padding:15px 18px;border-top:1px solid var(--line);font-size:12px;color:var(--muted)}.lock-icon{color:var(--green);margin-right:6px}.studio{padding:25px 30px 0;min-width:0;display:flex;flex-direction:column}.studio-toolbar{display:flex;justify-content:space-between;align-items:center;margin-bottom:21px;gap:12px}h2{font-size:20px;font-weight:500;margin:4px 0}.toolbar-actions{display:flex;align-items:center;gap:6px}.toolbar-actions .quiet{border:1px solid #ced2ca;border-radius:5px}.toolbar-actions .quiet[aria-pressed=true]{background:var(--green);color:white}.icon-button{background:#e7e9e2;width:38px;height:38px;font-size:22px;border-radius:5px}.stage-scroll{background:#dedfd7;overflow:auto;border:1px solid #d1d4ca;border-radius:7px;max-height:65vh}.stage{position:relative;aspect-ratio:16/9;width:100%;line-height:0}.stage img,.stage canvas{position:absolute;inset:0;width:100%;height:100%;object-fit:contain}.stage #preview{opacity:0}.stage #overlay{touch-action:none;pointer-events:none}.image-label{position:absolute;left:18px;bottom:18px;background:#fbfbf3e8;padding:8px 10px;color:#3d453e;font-size:10px;line-height:1;letter-spacing:1.2px;pointer-events:none;border-radius:3px}.under-stage{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-top:13px;font-size:12px;color:var(--muted)}.zoom{display:flex;gap:8px;align-items:center}.zoom select{border:0;background:none;font-size:12px;color:var(--ink)}.selection-summary{display:flex;gap:16px;align-items:center;padding:22px 0;margin-top:8px}.selection-summary>span{font:italic 36px Georgia;color:#a0a796}.selection-summary strong{font-size:15px;font-weight:500}.selection-summary p{color:var(--muted);font-size:13px;margin:3px 0}.export-bar{margin-top:auto;border-top:1px solid var(--line);padding:20px 0;display:flex;align-items:center;justify-content:space-between;gap:16px}.export-bar p{margin:4px 0;font-size:14px}.export-bar strong{font-size:25px;font-weight:500}.quality{font-size:10px;color:var(--muted);background:#e6e8df;margin-left:8px;padding:4px 7px;border-radius:3px}.export-actions{display:flex;gap:8px}.primary,.secondary{padding:12px 16px;border-radius:5px;font-size:14px;font-weight:550}.primary{background:var(--green);color:#fff}.primary span{margin-left:18px}.secondary{border:1px solid #cbd0c5;background:transparent;color:var(--ink)}.muted,.hint{font-size:13px;color:var(--muted)}.catalog-section{margin:0 0 24px}.section-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}.section-head h3{font-size:15px;font-weight:600;margin:0}.original-choice{background:none;font-size:12px;color:var(--muted);text-decoration:underline;padding:3px}.swatches{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px}.swatch-wrap{position:relative;min-width:0}.swatch{display:block;width:100%;padding:0;background:none;text-align:left;border-radius:5px;color:var(--ink)}.swatch .sample{height:57px;width:100%;object-fit:cover;background:#ddd;border-radius:5px;border:2px solid transparent;display:block}.swatch.handle .sample{object-fit:contain;background:#e8e9e1;padding:6px}.swatch.active .sample{border-color:var(--accent);box-shadow:0 0 0 2px #fff inset}.swatch .name{display:block;font-size:11px;line-height:1.25;margin-top:7px;padding-right:9px;min-height:29px;overflow-wrap:anywhere}.swatch-wrap .pool{position:absolute;right:4px;top:4px;width:16px;height:16px;accent-color:var(--green);cursor:pointer;margin:0}.section-desc{font-size:11px;color:var(--muted);margin:8px 0}.upload-row{display:flex;gap:6px;margin-top:9px}.upload-label{font-size:12px;cursor:pointer;color:var(--green);border:1px dashed #bdc5b8;border-radius:4px;padding:6px 8px;width:100%;text-align:center}.field{display:block;font-size:14px;margin:0 0 18px}.field>span{display:block;margin-bottom:7px}.field select,.field input[type=text],.field input[type=number]{width:100%;padding:9px 10px;border:1px solid #cbd0c5;border-radius:4px;background:white;color:var(--ink)}input[type=range]{width:100%;accent-color:var(--green)}input[type=checkbox]{accent-color:var(--green)}.button-grid{display:grid;grid-template-columns:1fr 1fr;gap:7px;margin:12px 0}.button-grid button{padding:9px 6px;border:1px solid var(--line);border-radius:4px;background:#fff;font-size:13px;color:var(--ink)}.button-grid button.active{background:var(--green);color:white;border-color:var(--green)}.wide{width:100%;margin:6px 0}.divider{border:0;border-top:1px solid var(--line);margin:22px 0}.status-box{padding:12px;background:#ecefe6;border-radius:5px;font-size:13px;margin:12px 0}.status-box strong{font-size:22px}.flexline{display:flex;gap:8px;align-items:center;font-size:13px;margin:10px 0}progress{width:100%;height:8px;accent-color:var(--green)}.toast{position:fixed;bottom:25px;left:50%;transform:translateX(-50%);background:#202b29;color:white;padding:13px 22px;border-radius:6px;z-index:30;max-width:90vw;font-size:14px;box-shadow:0 8px 30px #0003}dialog{max-width:570px;width:calc(100% - 32px);padding:32px;border:0;border-radius:10px;color:var(--ink);line-height:1.6}dialog::backdrop{background:#17221fcc}dialog h2{font:29px Georgia;margin:15px 0}dialog li{margin:14px 0;font-size:15px}dialog p{font-size:14px;color:var(--muted)}.close{float:right;background:none;font-size:26px}.export-links a{display:block;color:var(--green);margin:8px 0;font-size:13px}.edit-note{background:#fff4e6;color:#80502c;padding:10px;border-radius:4px;font-size:13px}.hidden-file{display:none}.working .swatch{pointer-events:none}.working .tabs{opacity:.6}.toolbar-actions .quiet{white-space:nowrap}@media(min-width:1600px){.workspace{grid-template-columns:340px minmax(0,1fr)}.studio{padding:30px 42px 0}.side-title{padding:30px}.panel{padding:24px 28px}.swatch .sample{height:64px}.stage-scroll{max-height:70vh}}@media(max-width:1050px){.workspace{grid-template-columns:270px minmax(0,1fr)}.studio{padding:20px 18px 0}.side-title,.panel{padding:20px 18px}.export-bar{align-items:flex-start;flex-direction:column}.export-actions{width:100%}.export-actions button{flex:1}.project-name span{display:none}.studio-toolbar{align-items:flex-start}.toolbar-actions .quiet{font-size:12px}.selection-summary{padding:15px 0}}@media(max-width:720px){.app-header{padding:0 16px;height:70px}.brand{font-size:16px;gap:10px}.brand small{font-size:8px}.brand-mark{font-size:38px;padding-right:16px}.project-name{display:none}.workspace{display:flex;flex-direction:column}.studio{order:-1;padding:20px 14px 0}.sidebar{max-height:none;position:static;border:0}.side-title{padding:22px 20px 12px}.side-title h1{font-size:25px}.side-title h1 br{display:none}.panel{overflow:visible}.swatches{grid-template-columns:repeat(3,1fr)}.swatch .sample{height:85px}.studio-toolbar h2{font-size:17px}.toolbar-actions{gap:3px}.toolbar-actions .quiet{font-size:11px;padding:9px 7px}.stage-scroll{max-height:70vh}.image-label{left:9px;bottom:9px;font-size:8px}.selection-summary{display:none}.export-bar{padding:13px 0;gap:8px}.under-stage{font-size:11px}.tabs{position:sticky;top:0;background:#fbfbf7;z-index:10}.swatch .name{font-size:13px}.eyebrow{font-size:10px}.export-actions button{font-size:13px}.sidebar-foot{display:none}}

/* Keep labels readable at narrow workspace widths. */
.swatch .name{font-size:13px;min-height:34px}.swatch .sample{height:65px}.hint{font-size:14px}.field small{font-size:12px;color:var(--muted)}.under-stage{font-size:12px}.upload-label,.original-choice{font-size:13px}.export-bar .quality{font-size:12px}@media(min-width:721px) and (max-width:900px){.workspace{grid-template-columns:235px minmax(0,1fr)}.panel,.side-title{padding-left:14px;padding-right:14px}h1{font-size:25px}.studio-toolbar{flex-direction:column;gap:10px}.swatch .name{font-size:12px}.export-actions{flex-direction:column}.export-bar{margin-top:20px}.studio{justify-content:flex-start}}

/* The fitted image always stays inside a viewport; zoom and pan move its stage. */
.viewer{min-width:0}.stage-scroll{position:relative;overflow:hidden;overflow:clip;height:clamp(220px,57vh,780px);max-height:none!important;touch-action:none;overscroll-behavior:contain;cursor:grab;user-select:none}.stage{position:absolute;aspect-ratio:auto;width:0;height:0;max-width:none;transform:none;will-change:left,top}.stage img,.stage canvas{user-select:none;-webkit-user-drag:none}.stage-scroll.is-editing{cursor:crosshair}.stage-scroll.is-panning{cursor:grabbing}.stage-scroll:focus-visible{outline:3px solid #be724e;outline-offset:3px}.under-stage{flex-wrap:wrap;align-items:flex-start}.under-stage #renderStatus{flex:1 1 220px}.viewer-controls{display:flex;align-items:center;justify-content:flex-end;gap:5px;flex-wrap:wrap}.viewer-button,.viewer-controls select{border:1px solid #cbd0c5;border-radius:4px;background:#fbfbf7;color:var(--ink);font-size:12px;line-height:1.3;min-height:34px;padding:7px 9px}.viewer-button[aria-pressed=true]{background:var(--green);color:white;border-color:var(--green)}#zoomIn,#zoomOut{font-size:18px;padding:3px 11px}#zoom{min-width:88px}.viewer-hint{font-size:12px;line-height:1.5;color:var(--muted);margin:9px 0 0}.visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.viewer:fullscreen,.viewer.viewer-expanded{width:100%;height:100%;max-width:none;background:var(--paper);padding:16px;display:grid;grid-template-rows:minmax(0,1fr) auto auto;gap:0}.viewer:fullscreen .stage-scroll,.viewer.viewer-expanded .stage-scroll{height:100%;min-height:0}.viewer.viewer-expanded{position:fixed;inset:0;z-index:1000}.viewer:fullscreen .under-stage,.viewer.viewer-expanded .under-stage{margin-top:10px}.viewer-open{overflow:hidden}.viewer:fullscreen .viewer-hint,.viewer.viewer-expanded .viewer-hint{margin-bottom:0}@media(max-width:720px){.stage-scroll{height:min(60vh,calc((100vw - 28px)*.5625));min-height:150px}.viewer-controls{justify-content:flex-start;width:100%}.viewer-button,.viewer-controls select{font-size:11px;min-height:36px}.viewer-hint{font-size:11px}.viewer:fullscreen,.viewer.viewer-expanded{padding:10px}.viewer:fullscreen .stage-scroll,.viewer.viewer-expanded .stage-scroll{min-height:0}.viewer:fullscreen .viewer-hint,.viewer.viewer-expanded .viewer-hint{font-size:10px}}

.texture-material{font-size:14px;font-weight:600;margin:8px 0}.project-actions{margin-top:18px}.project-save-status{font-size:12px;line-height:1.5;color:var(--green);padding:9px 10px;background:#edf1e9;border-radius:4px;margin:10px 0}
