@font-face { font-family: Montserrat; src: url('assets/fonts/Montserrat-UI.woff2') format('woff2'), url('assets/fonts/Montserrat-VF.ttf') format('truetype'); font-weight: 100 900; font-display: swap; }

:root {
  --ink: #0a0a0a;
  --ink-2: #2b2a28;
  --gray: #7a756c;
  --gray-2: #a39e94;
  --line: #e7e4de;
  --line-2: #d8d4cb;
  --bg: #f6f5f1;
  --panel: #fbfaf7;
  --white: #ffffff;
  --orange: #fa6713;
  --orange-dk: #d9520a;
  --blue: #0a84ff;
  --warn: #b5460f;
  --radius: 3px;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --ui: Montserrat, "Helvetica Neue", Arial, sans-serif;
  --inspector: 404px;
  --top: 60px;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 500 13px/1.45 var(--ui); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { opacity: .35; cursor: default; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- header */
.top { height: var(--top); display: flex; align-items: center; gap: 18px; padding: 0 18px 0 22px; border-bottom: 1px solid var(--line); background: var(--white); position: sticky; top: 0; z-index: 20; }
.brand { display: flex; flex-direction: column; text-decoration: none; color: var(--ink); line-height: 1; flex-shrink: 0; }
.brand-logo { display: block; height: 17px; width: auto; }
.brand-sub { font: 500 9px/1 var(--mono); letter-spacing: .24em; color: var(--gray); margin-top: 6px; }
.brand-sub b { color: var(--orange); font-weight: 700; }
.design-name input { border: 1px solid transparent; background: transparent; font-weight: 700; font-size: 14px; padding: 7px 9px; width: 210px; border-radius: var(--radius); }
.design-name input:hover { border-color: var(--line); }
.design-name input:focus { border-color: var(--line-2); background: var(--bg); outline: none; }
.command.menu { width: 380px; padding: 12px; }
.command input { width: 100%; height: 40px; border: 1px solid var(--line-2); border-radius: 6px; padding: 0 12px; font-size: 13px; outline: none; }
.command input:focus { border-color: var(--ink); }
.command small { display: block; margin-top: 8px; color: var(--gray); font-size: 11px; line-height: 1.6; }
.command small b { color: var(--ink-2); font-weight: 600; }
.top-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.top-sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }
#designsBtn[aria-pressed=true] { background: var(--ink); color: var(--white); border-color: var(--ink); }
.icon-btn { width: 34px; height: 34px; display: grid; place-items: center; border-radius: var(--radius); color: var(--ink-2); }
.icon-btn:hover:not(:disabled) { background: var(--bg); }
.icon-btn svg { width: 17px; height: 17px; }
.btn { height: 36px; padding: 0 15px; border-radius: var(--radius); font-weight: 700; font-size: 12px; letter-spacing: .02em; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.btn.ghost { border: 1px solid var(--line-2); background: var(--white); }
.btn.ghost:hover { border-color: var(--ink); }
.btn.primary { background: var(--ink); color: var(--white); }
.btn.primary:hover { background: #262626; }
.btn.orange { background: var(--orange); color: var(--white); }
.btn.orange:hover { background: var(--orange-dk); }
.btn.small { height: 30px; padding: 0 11px; font-size: 11px; }
.btn.block { width: 100%; justify-content: center; }
.menu-wrap { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 8px); width: 290px; background: var(--white); border: 1px solid var(--line); box-shadow: 0 18px 50px rgba(0,0,0,.14); padding: 6px; z-index: 40; border-radius: 6px; }
.menu > button { display: block; width: 100%; text-align: left; padding: 9px 11px; border-radius: 4px; font-size: 12.5px; }
.menu > button:hover { background: var(--bg); }
.menu > button small { display: block; color: var(--gray); font-size: 11px; font-weight: 500; margin-top: 1px; }
.menu > button:first-child { border-bottom: 1px solid var(--line); border-radius: 4px 4px 0 0; margin-bottom: 4px; padding-bottom: 11px; }
.menu > .menu-sep { border-top: 1px solid var(--line); border-radius: 0 0 4px 4px; margin-top: 4px; padding-top: 11px; }

/* ---------- layout */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) var(--inspector); height: calc(100vh - var(--top)); }
.stage { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.stage-bar { display: flex; align-items: center; gap: 8px; padding: 14px 18px 0; }
.view-wrap { margin-left: auto; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--radius); padding: 2px; background: var(--white); }
.seg button { padding: 6px 14px; font-size: 11.5px; font-weight: 600; border-radius: 2px; color: var(--ink-2); }
.seg button[aria-pressed=true] { background: var(--ink); color: var(--white); }
.stage-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chip { height: 30px; padding: 0 12px; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-2); border-radius: 14px; font-size: 11px; font-weight: 600; background: var(--white); color: var(--ink-2); }
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed=true] { background: var(--ink); border-color: var(--ink); color: var(--white); }
.chip svg { width: 15px; height: 15px; }
.chip:active, .chip.holding { background: var(--orange); border-color: var(--orange); color: var(--white); }
.bg-swatches { display: flex; gap: 4px; padding: 0 4px; }
.bg-swatches button { width: 20px; height: 20px; border-radius: 50%; border: 1px solid rgba(0,0,0,.18); }
.bg-swatches button[aria-pressed=true] { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--ink); }
.zoom { display: flex; align-items: center; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--white); }
.zoom button { height: 28px; min-width: 28px; font-weight: 600; font-size: 12px; }
.zoom #zoomLabel { font: 600 10.5px var(--mono); min-width: 48px; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
.canvas-wrap { position: relative; flex: 1; min-height: 0; margin: 10px 18px 0; }
.canvas-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#overlay { pointer-events: none; }
.canvas-wrap.grab #stage { cursor: grab; }
.canvas-wrap.move #stage { cursor: move; }
.canvas-wrap.grabbing #stage { cursor: grabbing; }
.loading { position: absolute; inset: 0; display: grid; place-content: center; gap: 12px; justify-items: center; color: var(--gray); font-size: 12px; background: var(--bg); }
.loading .bar { width: 180px; height: 2px; background: var(--line); overflow: hidden; }
.loading .bar i { display: block; height: 100%; width: 0; background: var(--orange); transition: width .2s; }
.stage-foot { display: flex; align-items: center; gap: 12px; padding: 8px 18px 12px; min-height: 44px; flex-wrap: wrap; }
.tip { margin: 0 0 0 auto; color: var(--gray); font-size: 11px; }
.warnings { display: flex; gap: 8px; flex-wrap: wrap; }
.warn { display: inline-flex; align-items: center; gap: 8px; background: #fff3ea; border: 1px solid #f6c9a8; color: var(--warn); padding: 5px 6px 5px 10px; border-radius: 14px; font-size: 11px; font-weight: 600; }
.warn button { background: var(--white); border: 1px solid #f0bf9c; border-radius: 10px; padding: 2px 8px; font-size: 10.5px; font-weight: 700; }
.roster-chip { display: inline-flex; align-items: center; gap: 8px; background: var(--ink); color: var(--white); padding: 5px 6px 5px 12px; border-radius: 14px; font-size: 11px; font-weight: 600; }
.roster-chip button { color: var(--white); opacity: .7; padding: 0 6px; font-size: 13px; }
.roster-chip select { background: transparent; color: var(--white); border: 0; font-weight: 700; font-size: 11px; }
.roster-chip option { color: var(--ink); }

/* ---------- inspector */
.inspector { background: var(--panel); border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.tabs { display: flex; border-bottom: 1px solid var(--line); padding: 0 8px; overflow-x: auto; scrollbar-width: none; flex-shrink: 0; background: var(--white); }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { padding: 14px 10px 12px; font-size: 11.5px; font-weight: 600; color: var(--gray); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected=true] { color: var(--ink); border-bottom-color: var(--orange); }
.panels { flex: 1; overflow-y: auto; min-height: 0; }
.panel { padding: 18px 20px 40px; }
.sec { padding: 16px 0; border-top: 1px solid var(--line); }
.sec:first-child { border-top: 0; padding-top: 2px; }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.sec-head h3 { margin: 0; font: 700 10px var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--ink-2); }
.sec-head .aside { font-size: 11px; color: var(--gray); }
.linkish { font-size: 11px; font-weight: 600; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-2); }
.linkish:hover { color: var(--orange); text-decoration-color: var(--orange); }
.hint { font-size: 11px; color: var(--gray); margin: 8px 0 0; line-height: 1.5; }

/* presets */
.presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.preset { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 2px 6px; border-radius: var(--radius); border: 1px solid transparent; }
.preset:hover { background: var(--white); border-color: var(--line); }
.preset[aria-pressed=true] { border-color: var(--ink); background: var(--white); }
.preset i { display: block; width: 100%; max-width: 64px; height: 24px; transform: skewX(-14deg); border: 1px solid rgba(0,0,0,.12); }
.preset span { font-size: 10.5px; font-weight: 600; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.preset-actions { display: flex; gap: 8px; margin-top: 12px; }

/* zone rows */
.zones { display: flex; flex-direction: column; gap: 2px; }
.zone-group { font: 600 9.5px var(--mono); letter-spacing: .16em; color: var(--gray); margin: 10px 0 4px; text-transform: uppercase; }
.zone-group:first-child { margin-top: 0; }
.zone { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px; padding: 6px 6px; border-radius: var(--radius); }
.zone:hover { background: var(--white); }
.swatch { width: 34px; height: 34px; border-radius: var(--radius); border: 1px solid rgba(0,0,0,.16); box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); }
.swatch.sm { width: 24px; height: 24px; }
.zone-label { min-width: 0; text-align: left; }
.zone-label strong { display: block; font-size: 12.5px; font-weight: 600; }
.zone-label small { display: block; font: 500 10px var(--mono); color: var(--gray); letter-spacing: .03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.link-btn { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; color: var(--gray-2); }
.link-btn:hover { background: var(--bg); color: var(--ink); }
.link-btn[aria-pressed=true] { color: var(--orange); }
.link-btn svg { width: 15px; height: 15px; }

/* controls */
.row { display: flex; align-items: center; gap: 10px; }
.row + .row { margin-top: 10px; }
.field { display: block; }
.field > span { display: flex; justify-content: space-between; font-size: 11px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.field > span em { font: 500 10px var(--mono); color: var(--gray); font-style: normal; }
.field input[type=text], .field input[type=email], .field input[type=tel], .field input[type=number], .field input:not([type]), .field select, textarea { width: 100%; height: 38px; border: 1px solid var(--line-2); background: var(--white); border-radius: var(--radius); padding: 0 11px; font-weight: 600; font-size: 13px; }
textarea { height: auto; padding: 10px 11px; font: 500 12px/1.5 var(--mono); resize: vertical; }
.field input:focus, .field select:focus, textarea:focus { outline: none; border-color: var(--ink); }
.upper { text-transform: uppercase; letter-spacing: .04em; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid-name { display: grid; grid-template-columns: 1fr 86px; gap: 10px; }
.slider { display: grid; grid-template-columns: 92px 1fr 44px; align-items: center; gap: 10px; margin-top: 10px; }
.slider label { font-size: 11px; font-weight: 600; color: var(--ink-2); }
.slider output { font: 500 10.5px var(--mono); color: var(--gray); text-align: right; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 18px; background: transparent; }
input[type=range]::-webkit-slider-runnable-track { height: 2px; background: var(--line-2); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: var(--ink); margin-top: -6px; border: 2px solid var(--white); box-shadow: 0 0 0 1px var(--ink); }
input[type=range]::-moz-range-track { height: 2px; background: var(--line-2); }
input[type=range]::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--ink); border: 2px solid var(--white); }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; font-size: 12px; font-weight: 600; cursor: pointer; }
.toggle input { appearance: none; width: 34px; height: 20px; border-radius: 10px; background: var(--line-2); position: relative; cursor: pointer; flex-shrink: 0; transition: background .15s; }
.toggle input::after { content: ''; position: absolute; width: 16px; height: 16px; border-radius: 50%; background: var(--white); top: 2px; left: 2px; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.toggle input:checked { background: var(--ink); }
.toggle input:checked::after { transform: translateX(14px); }
.toggle small { display: block; font-weight: 500; color: var(--gray); font-size: 10.5px; }
.seg.full { display: flex; width: 100%; }
.seg.full button { flex: 1; padding: 7px 4px; }
.color-inline { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 600; }
.color-inline .swatch { width: 26px; height: 26px; }

/* fonts */
.fonts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.font-tile { height: 70px; border: 1px solid var(--line); background: var(--white); border-radius: var(--radius); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; overflow: hidden; }
.font-tile:hover { border-color: var(--gray-2); }
.font-tile[aria-pressed=true] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.font-tile b { font-size: 28px; line-height: 1; font-weight: 400; }
.font-tile span { font-size: 9.5px; color: var(--gray); font-weight: 600; white-space: nowrap; }
.style-presets { display: flex; gap: 6px; flex-wrap: wrap; }
.contrast { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 11px; color: var(--gray); }
.contrast b { font: 700 11px var(--mono); color: var(--ink); }
.contrast .pill { padding: 2px 8px; border-radius: 10px; font-weight: 700; font-size: 10px; letter-spacing: .06em; white-space: nowrap; margin-left: auto; }
.pill.good { background: #e6f4ea; color: #1e6b35; }
.pill.ok { background: #fff4d6; color: #7a5a00; }
.pill.bad { background: #ffe5dc; color: var(--warn); }

/* patterns */
.pattern-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.pattern-tile { display: flex; flex-direction: column; gap: 5px; align-items: stretch; }
.pattern-tile img, .pattern-tile .ph { width: 100%; aspect-ratio: 1; border-radius: var(--radius); border: 1px solid var(--line); background: var(--line); display: block; }
.pattern-tile[aria-pressed=true] img { outline: 2px solid var(--ink); outline-offset: 2px; }
.pattern-tile span { font-size: 10px; font-weight: 600; color: var(--ink-2); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* logos */
.drop { border: 1.5px dashed var(--line-2); border-radius: 6px; padding: 22px 16px; text-align: center; background: var(--white); cursor: pointer; display: block; }
.drop:hover, .drop.over { border-color: var(--orange); background: #fff8f3; }
.drop strong { display: block; font-size: 13px; }
.drop small { display: block; color: var(--gray); font-size: 11px; margin-top: 4px; }
.logo-card { border: 1px solid var(--line); background: var(--white); border-radius: 6px; padding: 12px; margin-top: 12px; }
.logo-card header { display: flex; gap: 12px; align-items: center; margin-bottom: 6px; }
.logo-card .thumb { width: 52px; height: 52px; border-radius: var(--radius); background: repeating-conic-gradient(#eee 0 25%, #fff 0 50%) 0 0/12px 12px; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--line); flex-shrink: 0; }
.logo-card .thumb img { max-width: 90%; max-height: 90%; }
.logo-card header div { flex: 1; min-width: 0; }
.logo-card header strong { display: block; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logo-card header small { color: var(--gray); font-size: 10.5px; }
.palette-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.palette-chips .swatch { width: 24px; height: 24px; }
.note { font-size: 11px; padding: 8px 10px; border-radius: var(--radius); background: #fff8e6; color: #6d5200; margin-top: 10px; }

/* roster */
.roster-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.roster-table th { font: 600 9.5px var(--mono); letter-spacing: .12em; color: var(--gray); text-align: left; padding: 0 4px 6px; }
.roster-table td { padding: 3px 3px; border-top: 1px solid var(--line); }
.roster-table input, .roster-table select { width: 100%; height: 30px; border: 1px solid transparent; background: transparent; border-radius: 2px; padding: 0 4px; font-weight: 600; font-size: 11.5px; }
.roster-table input:hover, .roster-table select:hover { border-color: var(--line); }
.roster-table input:focus, .roster-table select:focus { border-color: var(--ink); background: var(--white); outline: none; }
.roster-table tr.active td { background: #fff3ea; }
.roster-table .num { width: 42px; }
.roster-table .size { width: 62px; }
.roster-table .qty { width: 40px; }
.roster-table .act { width: 54px; white-space: nowrap; text-align: right; }
.roster-table .act button { width: 26px; height: 26px; border-radius: 50%; color: var(--gray); }
.roster-table .act button:hover { background: var(--bg); color: var(--ink); }
.roster-table .act svg { width: 14px; height: 14px; }
.size-run { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.size-run span { font: 600 10.5px var(--mono); background: var(--white); border: 1px solid var(--line); padding: 3px 8px; border-radius: 10px; }
.issues { margin: 10px 0 0; padding: 0; list-style: none; font-size: 11px; }
.issues li { padding: 5px 0 5px 16px; position: relative; color: var(--warn); }
.issues li::before { content: ''; position: absolute; left: 2px; top: 11px; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.issues li.info { color: var(--gray); }

/* designs */
.design-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.design-card { border: 1px solid var(--line); border-radius: 6px; background: var(--white); overflow: hidden; display: flex; flex-direction: column; }
.design-card.current { border-color: var(--ink); }
.design-card img { width: 100%; aspect-ratio: 2 / 1.1; object-fit: cover; background: #f6f5f8; display: block; cursor: pointer; }
.design-card .meta { padding: 8px 10px 4px; }
.design-card strong { display: block; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.design-card small { color: var(--gray); font-size: 10px; }
.design-card .acts { display: flex; align-items: center; gap: 2px; padding: 2px 6px 8px; }
.design-card .acts button { font-size: 10.5px; font-weight: 600; padding: 4px 6px; border-radius: 2px; color: var(--ink-2); }
.design-card .acts button:hover { background: var(--bg); }
.thumb-wrap { position: relative; }
.pick { position: absolute; top: 6px; right: 6px; display: flex; align-items: center; gap: 4px; font-size: 10px; font-weight: 600; background: rgba(255,255,255,.92); border: 1px solid var(--line); border-radius: 10px; padding: 2px 7px 2px 4px; cursor: pointer; }
.pick input { margin: 0; accent-color: var(--orange); }
.empty { border: 1px dashed var(--line-2); border-radius: 6px; padding: 26px 18px; text-align: center; color: var(--gray); font-size: 12px; grid-column: 1 / -1; }

/* color picker */
.picker { position: fixed; z-index: 60; width: 280px; background: var(--white); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 22px 60px rgba(0,0,0,.2); padding: 14px; }
.picker h4 { margin: 0 0 10px; font: 700 10px var(--mono); letter-spacing: .16em; text-transform: uppercase; display: flex; justify-content: space-between; align-items: center; }
.picker h4 button { font-size: 16px; color: var(--gray); }
.sv { position: relative; height: 150px; border-radius: 4px; cursor: crosshair; touch-action: none; }
.sv::before, .sv::after { content: ''; position: absolute; inset: 0; border-radius: 4px; }
.sv::before { background: linear-gradient(to right, #fff, rgba(255,255,255,0)); }
.sv::after { background: linear-gradient(to top, #000, rgba(0,0,0,0)); }
.sv i { position: absolute; width: 14px; height: 14px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.4); transform: translate(-50%, -50%); z-index: 1; pointer-events: none; }
.hue { margin-top: 10px; }
.hue input { background: linear-gradient(to right, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00); height: 10px; border-radius: 5px; }
.hue input::-webkit-slider-runnable-track { background: transparent; }
.picker-row { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.picker-row input { flex: 1; height: 32px; border: 1px solid var(--line-2); border-radius: var(--radius); padding: 0 9px; font: 600 12px var(--mono); text-transform: uppercase; }
.picker-row .swatch { width: 32px; height: 32px; }
.picker-row button { height: 32px; width: 32px; border: 1px solid var(--line-2); border-radius: var(--radius); display: grid; place-items: center; }
.picker-row button svg { width: 15px; height: 15px; }
.picker .lib { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; margin-top: 12px; }
.picker .lib button { aspect-ratio: 1; border-radius: 3px; border: 1px solid rgba(0,0,0,.14); }
.picker .lib button:hover { transform: scale(1.15); }
.picker .sub { font: 600 9px var(--mono); letter-spacing: .14em; color: var(--gray); margin-top: 12px; text-transform: uppercase; }
.picker .name { font-size: 11px; color: var(--gray); margin-top: 6px; min-height: 16px; }

/* compare */
.compare { width: min(1400px, 94vw); max-height: 92vh; border: 0; border-radius: 10px; padding: 0; background: var(--bg); }
.compare::backdrop { background: rgba(10,10,10,.55); }
.compare-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); background: var(--white); position: sticky; top: 0; }
.compare-head h2 { margin: 0; font-size: 15px; }
.compare-grid { display: grid; gap: 14px; padding: 18px 20px 22px; }
.compare-card { background: var(--white); border: 1px solid var(--line); border-radius: 6px; padding: 10px; }
.compare-card canvas, .compare-card img { width: 100%; display: block; }
.compare-card .meta { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; gap: 8px; }
.compare-card strong { font-size: 12.5px; }
.compare-card small { display: block; color: var(--gray); font-size: 10.5px; }

/* toast + busy */
.toast { position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px); background: var(--ink); color: var(--white); padding: 11px 16px; border-radius: 6px; font-size: 12px; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s; z-index: 80; max-width: min(560px, 92vw); box-shadow: 0 10px 30px rgba(0,0,0,.2); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast b { color: var(--orange); }
.busy { position: fixed; inset: 0; background: rgba(246,245,241,.72); z-index: 70; display: grid; place-items: center; backdrop-filter: blur(2px); }
.busy div { background: var(--white); border: 1px solid var(--line); padding: 16px 22px; border-radius: 8px; display: flex; align-items: center; gap: 12px; font-weight: 600; font-size: 12.5px; box-shadow: 0 16px 40px rgba(0,0,0,.12); }
.busy i { width: 16px; height: 16px; border: 2px solid var(--line-2); border-top-color: var(--orange); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- responsive */
@media (max-width: 1180px) {
  :root { --inspector: 360px; }
  .design-name input { width: 150px; }
}
@media (max-width: 900px) {
  :root { --top: auto; }
  .top { flex-wrap: wrap; gap: 10px; padding: 10px 14px; position: static; }
  .design-name { order: 3; flex: 1; }
  .design-name input { width: 100%; }
  .top-actions { margin-left: auto; }
  .layout { display: block; height: auto; }
  .stage { position: sticky; top: 0; z-index: 10; background: var(--bg); border-bottom: 1px solid var(--line); }
  .canvas-wrap { height: 46vh; flex: none; margin: 8px 12px 0; }
  .stage-bar { padding: 8px 12px 0; }
  .stage-foot { padding: 6px 12px 8px; min-height: 0; }
  .tip { display: none; }
  .bg-swatches { display: none; }
  .inspector { border-left: 0; }
  .tabs { position: static; }
  .panels { overflow: visible; }
  .panel { padding: 16px 16px 60px; }
}
@media (max-width: 520px) {
  .brand-sub { display: none; }
  .brand-logo { height: 15px; }
  .design-name { display: none; }
  .top { gap: 8px; }
  .icon-btn { width: 30px; }
  .seg button { padding: 5px 10px; font-size: 11px; }
  .chip { height: 26px; padding: 0 9px; font-size: 10.5px; }
  .zoom button { height: 26px; }
  .stage-bar { gap: 8px; }
  .btn { padding: 0 11px; }
  .top-actions #saveBtn { display: none; }
  .stage-tools .chip#guidesBtn { display: none; }
  .presets { grid-template-columns: repeat(4, 1fr); }
  .fonts { grid-template-columns: repeat(3, 1fr); }
  .pattern-grid { grid-template-columns: repeat(3, 1fr); }
  .design-grid { grid-template-columns: 1fr; }
  .slider { grid-template-columns: 80px 1fr 40px; }
  .canvas-wrap { height: 34vh; }
  .stage-foot { padding: 4px 12px 6px; gap: 6px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .stage-foot::-webkit-scrollbar { display: none; }
  .roster-chip, .warn { white-space: nowrap; flex-shrink: 0; }
  .stage-bar { flex-wrap: nowrap; }
  .stage-tools { flex-wrap: nowrap; gap: 6px; }
  .stage-tools #zonesBtn { display: none; }
  .zoom #zoomLabel { min-width: 40px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- view menu */
.view-menu { width: 300px; padding: 12px 14px; }
.vm-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; font-size: 11.5px; font-weight: 600; color: var(--ink-2); }
.vm-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 0 4px; border-top: 1px solid var(--line); margin-top: 6px; }
.vm-tip { margin: 8px 0 0; font-size: 10.5px; color: var(--gray); line-height: 1.5; }

/* ---------- 3D */
.canvas-wrap canvas.view3d { cursor: grab; z-index: 1; }
.canvas-wrap canvas.view3d:active { cursor: grabbing; }
.canvas-wrap.mode3d #stage, .canvas-wrap.mode3d #overlay { visibility: hidden; }
.loading { z-index: 2; }
.seg .seg-3d { font-weight: 800; letter-spacing: .04em; }
.seg .seg-3d[aria-pressed=false] { color: var(--orange-dk); }
.spin-btn[aria-pressed=true] { background: var(--orange); border-color: var(--orange); color: var(--white); }

/* ---------- randomizer */
.shuffle-bar { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 18px 0; }
.btn.shuffle { height: 44px; padding: 0 26px; border-radius: 22px; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; box-shadow: 0 8px 22px rgba(250,103,19,.28); }
.btn.shuffle svg { width: 18px; height: 18px; }
.btn.shuffle.rolled svg { animation: roll .45s cubic-bezier(.3,1.4,.5,1); }
@keyframes roll { from { transform: rotate(-200deg) scale(.7); } to { transform: none; } }
.icon-btn.round { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--white); }
.icon-btn.round svg { width: 16px; height: 16px; }

/* ---------- step tabs */
.tabs { padding: 0 6px; gap: 2px; }
.tabs button { flex: 1; justify-content: center; display: inline-flex; align-items: center; gap: 5px; padding: 15px 2px 13px; font-size: 11.5px; }
.tabs button i { font: 700 9.5px/18px var(--mono); font-style: normal; width: 18px; height: 18px; border-radius: 50%; text-align: center; background: var(--line); color: var(--gray); }
.tabs button[aria-selected=true] i { background: var(--orange); color: var(--white); }
.panel { padding: 20px 22px 32px; }
.lead { margin: 0 0 16px; font-size: 13px; line-height: 1.5; color: var(--ink-2); }
.step-label { font: 700 10px var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--gray); margin: 20px 0 10px; }
.step-foot { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); }
.btn.block { height: 44px; font-size: 12.5px; }
.back-link { display: inline-block; margin-bottom: 14px; }

/* ---------- drop-downs */
.dd { position: relative; display: flex; flex-direction: column; min-width: 0; }
.dd-label { font-size: 11px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.dd-btn { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 46px; padding: 6px 12px 6px 8px; border: 1px solid var(--line-2); background: var(--white); border-radius: 6px; text-align: left; }
.dd-btn:hover, .dd.open .dd-btn { border-color: var(--ink); }
.dd-current { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.dd-caret { width: 8px; height: 8px; border-right: 1.6px solid var(--ink-2); border-bottom: 1.6px solid var(--ink-2); transform: rotate(45deg) translate(-2px, -2px); flex-shrink: 0; transition: transform .15s; }
.dd.open .dd-caret { transform: rotate(-135deg) translate(-2px, -2px); }
.dd-text { display: flex; flex-direction: column; min-width: 0; }
.dd-text strong { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dd-text small { font-size: 10.5px; color: var(--gray); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dd-swatch { display: block; width: 44px; height: 22px; flex-shrink: 0; transform: skewX(-14deg); border: 1px solid rgba(0,0,0,.12); }
.dd-img { width: 32px; height: 32px; border-radius: 4px; flex-shrink: 0; border: 1px solid var(--line); object-fit: cover; background: var(--line); }
.dd-font { font-size: 24px; line-height: 1; font-weight: 400; width: 40px; text-align: center; flex-shrink: 0; }
.dd-list { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 45; background: var(--white); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 18px 50px rgba(0,0,0,.16); padding: 6px; max-height: 360px; overflow-y: auto; }
.dd.wide .dd-list { min-width: 100%; }
.grid2 .dd:last-child .dd-list { left: auto; right: 0; }
.grid2 .dd.wide .dd-list { width: calc(200% + 10px); }
.grid2 .dd.wide:first-child .dd-list { left: 0; right: auto; }
.dd-list.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 4px; }
.dd-opt { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 5px; text-align: left; }
.dd-list.grid .dd-opt { flex-direction: column; align-items: stretch; gap: 6px; padding: 8px; }
.dd-list.grid .dd-opt .dd-swatch { width: auto; margin: 0 4px; }
.dd-list.grid .dd-opt .dd-img { width: 100%; height: auto; aspect-ratio: 1; }
.dd-list.grid .dd-opt .dd-font { width: auto; font-size: 30px; padding: 4px 0; }
.dd-list.grid .dd-text { align-items: center; }
.dd-list.grid .dd-text strong { font-size: 11px; }
.dd-opt:hover { background: var(--bg); }
.dd-opt[aria-selected=true] { background: var(--bg); box-shadow: inset 0 0 0 1.5px var(--ink); }
.dd.compact .dd-btn { min-height: 40px; border-radius: 20px; padding: 0 14px; }
.dd.compact .dd-text strong { font-size: 12px; }
.dd.compact .dd-list { min-width: 170px; }
.dd.up .dd-list { top: auto; bottom: calc(100% + 6px); }

/* ---------- color chips */
.chip-colors { display: flex; gap: 10px; flex-wrap: wrap; }
.chip-color { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 76px; }
.chip-color > span { font-size: 11.5px; font-weight: 600; margin-top: 6px; }
.chip-color small { font: 500 10px var(--mono); color: var(--gray); }
.swatch.lg { width: 76px; height: 46px; border-radius: 6px; transition: transform .12s; }
.swatch.lg:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0,0,0,.12); }

/* ---------- more options */
.mores { margin-top: 18px; }
.more { border-top: 1px solid var(--line); }
.more:last-child { border-bottom: 1px solid var(--line); }
.chip-colors + .more, .row + .more, .more:first-of-type { margin-top: 18px; }
.mores .more { margin-top: 0; }
.more summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 2px; cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.more summary::-webkit-details-marker { display: none; }
.more summary:hover { color: var(--ink); }
.more summary i { width: 7px; height: 7px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: rotate(45deg); transition: transform .15s; margin-right: 4px; }
.more[open] summary i { transform: rotate(-135deg); }
.more-body { padding: 0 2px 16px; }
.more-body > .slider:first-child { margin-top: 0; }

@media (max-width: 1180px) {
  .tabs button { font-size: 11px; gap: 4px; }
  .tabs button i { width: 16px; height: 16px; line-height: 16px; }
}
@media (max-width: 900px) {
  .shuffle-bar { padding: 8px 12px 0; }
  .btn.shuffle { height: 40px; }
  .top-sep { display: none; }
  .command.menu { width: min(380px, 90vw); }
}
@media (max-width: 520px) {
  #designsBtn { display: none; }
  .tabs button { font-size: 11px; }
  .chip-color { min-width: 64px; }
  .swatch.lg { width: 64px; }
  .grid2 .dd.wide .dd-list { width: auto; }
}

/* Customer studio: quiet framing, clear progression and optional detail. */
:root { --radius: 7px; --inspector: 412px; }
.studio-intro { padding: 25px 28px 4px; display: flex; align-items: end; justify-content: space-between; gap: 16px; }
.eyebrow { font: 700 9px var(--mono); letter-spacing: .15em; color: var(--gray); }
h1 { font-size: clamp(20px, 2.2vw, 30px); letter-spacing: -.055em; margin: 5px 0 0; font-weight: 700; }
.studio-intro p { font-size: 11px; color: var(--gray); margin: 0 0 4px; }
.inspector-heading { padding: 23px 22px 15px; position: relative; border-bottom: 1px solid var(--line); }
.inspector-heading h2 { font-size: 21px; letter-spacing: -.04em; margin: 5px 0 4px; }
#stepCount { color: var(--gray); font-size: 10px; }
.canvas-wrap { border-radius: 14px; overflow: hidden; }
.shuffle-help { text-align: center; font-size: 10px; color: var(--gray); margin: 9px 10px 0; }
#randomMode .dd-label { display: none; }
.sample-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 7px; }
.sample-card { padding: 10px 6px; border: 1px solid var(--line); border-radius: 8px; background: #fff; text-align: center; }
.sample-card:hover { border-color: var(--orange); }
.sample-card img { width: 100%; height: 78px; object-fit: contain; margin-bottom: 8px; }
.sample-card strong, .sample-card small, .sample-card span { display: block; font-size: 10px; }
.sample-card small { font-size: 9px; color: var(--gray); margin: 4px 0 8px; }
.sample-card span { font-size: 9px; color: var(--orange-dk); font-weight: 700; }
button.drop { width: 100%; }
#mobileUndo, #mobileRedo, #mobileSave, #mobileDesigns { display: none; }
.quote-dialog { border: 1px solid var(--line); border-radius: 16px; padding: 26px; width: min(570px, calc(100vw - 24px)); max-height: 92dvh; overflow: auto; }
.quote-dialog::backdrop { background: rgb(10 10 10 / .42); backdrop-filter: blur(4px); }
.quote-head { display: flex; align-items: start; justify-content: space-between; gap: 14px; }
.quote-head h2 { margin: 6px 0 15px; font-size: 24px; letter-spacing: -.04em; }
.quote-summary { display: flex; align-items: center; gap: 14px; background: var(--bg); border-radius: 10px; padding: 10px 14px 10px 10px; font-size: 12px; margin-bottom: 18px; }
.quote-summary img { width: 150px; height: auto; border-radius: 6px; background: #fff; flex-shrink: 0; }
.quote-summary strong { display: block; font-size: 14px; margin-bottom: 3px; }
.quote-summary span { color: var(--gray); line-height: 1.5; }
.quote-dialog .field { margin-bottom: 14px; }
.quote-dialog input, .quote-dialog textarea { width: 100%; }
#quoteStatus { font-size: 12px; line-height: 1.6; font-weight: 600; }
#quoteBackup { margin-top: 16px; }
@media (max-width: 1100px) { .studio-intro p { display: none; } .design-name input { width: 130px; } .top { gap: 10px; padding: 0 12px; } }
@media (max-width: 900px) { .studio-intro { padding: 14px 16px 0; } .inspector-heading { padding: 18px 16px 10px; } .stage { position: relative; } .view-menu .bg-swatches { display: flex; } }
@media (max-width: 650px) {
  .top { height: auto; min-height: 60px; flex-wrap: wrap; padding: 10px 12px; gap: 7px; }
  .top-actions { gap: 5px; } .design-name, .top-actions > #undo, .top-actions > #redo { display: none; }
  #designsBtn, #saveBtn { display: none; }
  #mobileUndo, #mobileRedo, #mobileSave, #mobileDesigns { display: block; }
  #exportBtn, #quoteBtn { font-size: 10px; padding: 0 10px; height: 34px; }
  .brand-logo { height: 13px; } .brand-sub { display: block; font-size: 7px; }
  .studio-intro h1 { font-size: 23px; }
  .shuffle-help { font-size: 9px; }
  .quote-dialog { padding: 20px; } .quote-head h2 { font-size: 21px; }
  .quote-dialog .grid2 { grid-template-columns: 1fr; gap: 0; }
  .quote-summary img { width: 110px; }
}

@media (max-width: 650px) {
  #exportMenu, .command.menu { position: fixed; top: 61px; left: 12px; right: 12px; width: auto; max-height: calc(100dvh - 85px); overflow: auto; }
  .cmd-wrap { display: block; }
}

/* Product first. Editing is an optional workspace, never a checkout prerequisite. */
:root { --top: 60px; --actions: 94px; }
body { overflow: hidden; }
.top { height: var(--top); min-height: var(--top); flex-wrap: nowrap; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr); height: calc(100vh - var(--top) - var(--actions)); height: calc(100dvh - var(--top) - var(--actions)); }
.layout.editing { grid-template-columns: minmax(0, 1fr) var(--inspector); }
.stage { position: relative; min-height: 0; border: 0; }
.studio-intro { padding: 18px 28px 0; }
.stage-bar { padding-top: 10px; }
.canvas-wrap { flex: 1; height: auto; min-height: 80px; }
.stage-foot { min-height: 0; padding: 4px 18px; }
.shuffle-bar { padding-top: 4px; }
.btn.shuffle { height: 36px; padding: 0 15px; font-size: 11px; letter-spacing: 0; text-transform: none; box-shadow: none; border-radius: 18px; }
.icon-btn.round { width: 34px; height: 34px; }
.shuffle-help { margin: 5px 10px 6px; }
.design-actions { height: var(--actions); background: #fff; border-top: 1px solid var(--line); display: grid; grid-template-columns: minmax(0,1fr) auto auto; column-gap: 12px; align-content: center; padding: 10px 28px calc(10px + env(safe-area-inset-bottom)); position: relative; z-index: 21; }
.action-message { display: flex; flex-direction: column; justify-content: center; gap: 3px; }
.action-message strong { font-size: 14px; }
.action-message span { font-size: 11px; color: var(--gray); }
.design-actions .btn { height: 44px; justify-content: center; padding: 0 24px; }
.design-actions #quoteBtn { height: 44px; background: var(--orange); color: #15100c; font-size: 13px; }
.design-actions #quoteBtn:hover { background: #f98139; }
.design-actions small { grid-column: 2 / 4; text-align: right; color: var(--gray); font-size: 9px; margin-top: 5px; }
.inspector { min-height: 0; }
.inspector-heading { display: flex; align-items: start; justify-content: space-between; gap: 10px; padding: 18px 20px 12px; }
.inspector-heading h2 { font-size: 20px; }
.edit-tabs { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 20px 14px; border-bottom: 1px solid var(--line); background: #fff; }
.edit-tabs button { height: 32px; padding: 0 13px; border: 1px solid var(--line-2); border-radius: 16px; background: var(--white); font-size: 11.5px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.edit-tabs button:hover { border-color: var(--ink); }
.edit-tabs button[aria-selected=true] { background: var(--ink); border-color: var(--ink); color: var(--white); }
.panels { overflow-y: auto; overscroll-behavior: contain; }
.toast { bottom: calc(var(--actions) + 12px); }
@media (max-width: 900px) {
  .top { padding: 8px 14px; }
  .design-name { display: none; }
  .layout.editing { grid-template-columns: minmax(0,1fr); grid-template-rows: minmax(170px, 42%) minmax(0,1fr); }
  .layout.editing .studio-intro, .layout.editing .shuffle-help { display: none; }
  .layout.editing .shuffle-bar { padding-top: 0; padding-bottom: 4px; }
  .layout.editing .inspector { border-top: 1px solid var(--line); }
  .layout.editing .inspector-heading { padding: 10px 16px; }
  .layout.editing .inspector-heading h2 { font-size: 17px; margin: 0; }
  .layout.editing .inspector-heading .eyebrow, .layout.editing #stepCount { display: none; }
  .edit-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 10px 16px; }
  .edit-tabs::-webkit-scrollbar { display: none; }
  .studio-intro { padding: 15px 16px 0; }
  .panel { padding: 16px 16px 32px; }
}
@media (max-width: 650px) {
  :root { --actions: calc(92px + env(safe-area-inset-bottom)); }
  .top { padding: 8px 14px; }
  .top-actions { gap: 8px; }
  .studio-intro h1 { font-size: 22px; }
  .design-actions { grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); padding-left: 14px; padding-right: 14px; gap: 7px 10px; }
  .action-message { display: none; }
  .design-actions .btn { padding: 0 12px; }
  .design-actions small { grid-column: 1 / -1; text-align: center; margin: 0; }
  .shuffle-help { font-size: 9px; }
  .layout.editing .shuffle-bar { display: none; }
  .layout.editing .canvas-wrap { margin-top: 2px; }
}
@media (max-height: 560px) and (min-width: 901px) {
  .studio-intro { display: none; }
}
/* Short landscape screens need side-by-side controls to keep the editor usable. */
@media (min-width: 651px) and (max-width: 900px) and (max-height: 560px) {
  .layout.editing { grid-template-columns: minmax(0,1fr) minmax(320px,.9fr); grid-template-rows: minmax(0,1fr); }
  .studio-intro, .shuffle-help { display: none; }
  .layout.editing .inspector { border-top: 0; border-left: 1px solid var(--line); }
  .layout.editing .shuffle-bar { display: none; }
}

/* Camera controls stay inside View, leaving the garment uncluttered. */
#camera3dRow[hidden], #flatViewTools[hidden] { display: none; }
#camera3dAngle { width: 154px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); color: var(--ink); font: inherit; }

/* Persistent backdrop choices directly below View, including narrow screens. */
.stage-bar { padding-bottom: 40px; }
.view-wrap > .backdrop-quick { position: absolute; right: 0; top: calc(100% + 10px); display: flex; gap: 6px; padding: 4px; width: max-content; }
.backdrop-quick button { flex: 0 0 20px; }
.backdrop-quick button:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }
.view-wrap > .view-menu { top: calc(100% + 48px); }
