/* ── Tokens & themes ────────────────────────────────────── */
:root, [data-theme='beige'] {
  --bg: #f3efe7;
  --surface: #fffdf9;
  --surface-2: #efe9df;
  --surface-3: #e5ddd0;
  --ink: #1c1a17;
  --ink-2: #4f4942;
  --ink-3: #6a6158;
  --line: #e0d8ca;
  --line-2: #cfc3b1;
  --accent: #a8792a;
  --accent-ink: #7c5815;
  --accent-soft: #f3e7cf;
  --on-accent: #ffffff;
  --zone-mid: #c9a35a;
  --zone-side: #8fa3a0;
  --stage-a: #fbf8f2;
  --stage-b: #e8e0d2;
  --band: #ebe4d8;
  --grid: rgba(60, 45, 20, 0.07);
  --grid-strong: rgba(60, 45, 20, 0.14);
  --shadow-rgb: 40, 30, 15;
}
[data-theme='blue'] {
  --bg: #eaf0f7;
  --surface: #fbfcfe;
  --surface-2: #e2e9f3;
  --surface-3: #d3ddea;
  --ink: #0e1a2b;
  --ink-2: #3a4a60;
  --ink-3: #56667d;
  --line: #d2dce9;
  --line-2: #b9c7da;
  --accent: #1f5fd1;
  --accent-ink: #1849a3;
  --accent-soft: #dce7fb;
  --zone-mid: #4f86e8;
  --zone-side: #8aa6c8;
  --stage-a: #f7faff;
  --stage-b: #d8e2f0;
  --band: #dfe7f2;
  --grid: rgba(31, 95, 209, 0.08);
  --grid-strong: rgba(31, 95, 209, 0.16);
  --shadow-rgb: 14, 30, 60;
}
[data-theme='gray'] {
  --bg: #ececea;
  --surface: #fafaf9;
  --surface-2: #e4e4e1;
  --surface-3: #d6d6d2;
  --ink: #151515;
  --ink-2: #444648;
  --ink-3: #626467;
  --line: #d8d8d4;
  --line-2: #c2c2bd;
  --accent: #e0531b;
  --accent-ink: #ad3a0c;
  --accent-soft: #fbe2d6;
  --zone-mid: #e8794a;
  --zone-side: #9a9c9f;
  --stage-a: #f7f7f6;
  --stage-b: #dcdcd8;
  --band: #e2e2df;
  --grid: rgba(0, 0, 0, 0.065);
  --grid-strong: rgba(0, 0, 0, 0.13);
  --shadow-rgb: 0, 0, 0;
}
[data-theme='red'] {
  --bg: #f5ede9;
  --surface: #fffbfa;
  --surface-2: #f0e3de;
  --surface-3: #e6d3cc;
  --ink: #1e1311;
  --ink-2: #553e3a;
  --ink-3: #735c57;
  --line: #e8d6d0;
  --line-2: #d8beb6;
  --accent: #c0261c;
  --accent-ink: #9a1c14;
  --accent-soft: #f8dcd8;
  --zone-mid: #d4574d;
  --zone-side: #b39790;
  --stage-a: #fffaf8;
  --stage-b: #ecd9d2;
  --band: #efe0db;
  --grid: rgba(150, 30, 20, 0.07);
  --grid-strong: rgba(150, 30, 20, 0.14);
  --shadow-rgb: 50, 15, 10;
}
:root {
  --ok: #2e7a4d;
  --ok-soft: #e1f1e6;
  --warn: #8a5b00;
  --warn-soft: #fbefd2;
  --error: #b3261e;
  --error-soft: #fbe3df;
  --info: #335a88;
  --info-soft: #e3ecf6;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-md: 10px;
  --on-ink: #fbf8f2;
  --shadow: 0 1px 2px rgba(var(--shadow-rgb), 0.07), 0 6px 22px rgba(var(--shadow-rgb), 0.07);
  --shadow-lg: 0 12px 40px rgba(var(--shadow-rgb), 0.2);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Archivo', 'Inter', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
  --topbar: 60px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { overflow-x: clip; } /* safety net: the page itself never scrolls sideways */
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
body.modal-open { overflow: hidden; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.45; }
a { color: inherit; }
kbd {
  font: 600 11px/1 var(--font);
  border: 1px solid var(--line-2);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 3px 5px;
  background: var(--surface);
  color: var(--ink-2);
}
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 12px; top: -40px; z-index: 100; background: var(--ink); color: var(--on-ink); padding: 8px 12px; border-radius: 8px; }
.skip-link:focus { top: 10px; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.spacer { flex: 1; }
.icon { flex: none; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-ink); }
.screen-title { font: 500 32px/1.15 var(--display); letter-spacing: -0.01em; }
.lead { font-size: 17px; color: var(--ink-2); max-width: 60ch; }

/* ── Buttons & controls ─────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 999px; padding: 9px 18px;
  font-weight: 600; font-size: 14px; white-space: nowrap; text-decoration: none;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn.primary { background: var(--ink); color: var(--on-ink); }
.btn.primary:hover:not(:disabled) { background: color-mix(in oklab, var(--ink) 82%, var(--bg)); }
.btn.accent { background: var(--accent); color: var(--on-accent); }
.btn.accent:hover:not(:disabled) { background: color-mix(in oklab, var(--accent) 86%, var(--ink)); }
.btn.ghost { background: var(--surface); border-color: var(--line-2); }
.btn.ghost:hover:not(:disabled) { background: var(--surface-2); }
.btn.sm { padding: 6px 13px; font-size: 13px; }
.btn.lg { padding: 13px 24px; font-size: 16px; }
.btn.full { width: 100%; }
label.btn { cursor: pointer; }
.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px;
  border-radius: var(--radius-md); border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
}
.icon-btn:hover:not(:disabled) { background: var(--surface-2); color: var(--ink); }
.icon-btn.on { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.icon-btn.sm { width: 30px; height: 30px; border-radius: 8px; }
.link-btn { background: none; border: 0; padding: 2px 0; color: var(--accent-ink); font-weight: 600; font-size: 13px; display: inline-flex; gap: 5px; align-items: center; }
.link-btn:hover:not(:disabled) { text-decoration: underline; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-2); background: var(--surface);
  border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 500;
}
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }

.segmented { display: inline-flex; background: var(--surface-2); border-radius: var(--radius-md); padding: 3px; gap: 2px; }
.segmented.full { display: flex; width: 100%; }
.segmented button {
  flex: 1; border: 0; background: transparent; border-radius: 8px; padding: 7px 10px;
  font-size: 13px; font-weight: 500; color: var(--ink-2);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.segmented button:hover { color: var(--ink); }
.segmented button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); font-weight: 600; }
.segmented.sm button { padding: 5px 9px; font-size: 12px; }
.layout-seg button { flex-direction: column; gap: 3px; font-size: 11px; padding: 7px 4px; }

.slider { display: grid; gap: 6px; margin: 12px 0 4px; }
.slider-head { display: flex; justify-content: space-between; font-size: 13px; }
.slider-head label { color: var(--ink-2); font-weight: 500; }
.slider-head output { font-weight: 600; font-variant-numeric: tabular-nums; }
.slider input[type='range'] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 99px; margin: 6px 0;
  background: linear-gradient(to right, var(--ink) var(--pct), var(--surface-3) var(--pct));
}
.slider input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--surface);
  border: 2px solid var(--ink); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}
.slider input[type='range']::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--surface); border: 2px solid var(--ink); }
.hint { font-size: 12.5px; color: var(--ink-3); margin-top: 6px; }
.field-label { display: block; font-size: 12px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.06em; margin: 14px 0 7px; }
.field { display: grid; gap: 6px; font-size: 13px; font-weight: 500; color: var(--ink-2); margin-top: 14px; }
.field.inline { display: flex; align-items: center; gap: 8px; margin: 0; }
.field input, .field select {
  border: 1px solid var(--line-2); border-radius: var(--radius-md); padding: 9px 12px; background: var(--surface); color: var(--ink); font-size: 15px;
}
.pill { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 99px; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.error { background: var(--error-soft); color: var(--error); }

/* ── Logo & top bar ─────────────────────────────────────── */
.logo { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; font: 600 19px/1 var(--display); letter-spacing: -0.01em; color: var(--ink); }
.logo-dash { color: var(--accent-ink); }
.topbar {
  position: sticky; top: 0; z-index: 20; height: var(--topbar);
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 20px;
  padding: 0 18px; background: var(--bg); border-bottom: 1px solid var(--line);
}
.steps ol { list-style: none; display: flex; justify-content: center; gap: 4px; margin: 0; padding: 0; }
.steps a {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 99px;
  text-decoration: none; font-size: 14px; font-weight: 500; color: var(--ink-3);
}
.steps a:hover { background: var(--surface-2); color: var(--ink); }
.steps a.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); font-weight: 600; }
.step-n { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--surface-3); font-size: 11px; font-weight: 700; }
.steps a.on .step-n { background: var(--ink); color: var(--on-ink); }
.steps a.done .step-n { background: var(--ok); color: #fff; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.ring-name { display: flex; align-items: center; gap: 4px; color: var(--ink-3); }
.ring-name input { border: 1px solid transparent; background: transparent; border-radius: 8px; padding: 6px 8px; width: 150px; font-weight: 600; color: var(--ink); text-align: right; }
.ring-name input:hover, .ring-name input:focus { border-color: var(--line-2); background: var(--surface); }

/* ── Studio layout ──────────────────────────────────────── */
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.studio {
  display: grid; grid-template-columns: 300px minmax(0, 1fr) 340px;
  height: calc(100vh - var(--bar)); min-height: 620px;
}
.rail { background: var(--surface); display: flex; flex-direction: column; min-height: 0; }
.rail.library { border-right: 1px solid var(--line); }
.rail.specs { border-left: 1px solid var(--line); }
.rail-body { overflow-y: auto; padding: 16px; flex: 1; min-height: 0; }
.rail-tabs { display: flex; border-bottom: 1px solid var(--line); padding: 0 12px; }
.rail-tabs button { flex: 1; border: 0; background: none; padding: 13px 4px 11px; font-weight: 600; font-size: 14px; color: var(--ink-3); border-bottom: 2px solid transparent; }
.rail-tabs button.on { color: var(--ink); border-color: var(--ink); }
.rail-h { font-size: 13px; font-weight: 600; margin: 18px 0 8px; display: flex; gap: 6px; }
.rail-note { font-size: 13px; color: var(--ink-3); margin-bottom: 12px; }
.mobile-tabs { display: none; }

.search { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line-2); border-radius: var(--radius-md); padding: 0 10px; margin-bottom: 10px; color: var(--ink-3); background: var(--surface); }
.search input { border: 0; outline: none; padding: 9px 0; flex: 1; background: transparent; min-width: 0; }
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.tag { border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 3px 9px; font-size: 12px; color: var(--ink-2); text-transform: capitalize; }
.tag.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }

.lib-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.lib-tile { position: relative; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); overflow: hidden; transition: border-color 0.15s, box-shadow 0.15s; }
.lib-tile:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
.lib-tile.used { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.lib-tile-main { display: grid; gap: 2px; width: 100%; border: 0; background: none; padding: 8px 9px 9px; text-align: left; }
.lib-tile-main .pattern-art { height: 42px; width: 100%; color: var(--ink-2); background: var(--surface-2); border-radius: 7px; padding: 6px 4px; margin-bottom: 5px; }
.lib-tile-name { font-weight: 600; font-size: 13px; }
.lib-tile-zone { font-size: 11px; color: var(--ink-3); }
.lib-used { position: absolute; top: 6px; right: 6px; width: 18px; height: 18px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; }
.lib-tile-actions { display: flex; border-top: 1px solid var(--line); }
.lib-tile-actions button { flex: 1; border: 0; background: none; padding: 5px; font-size: 12px; font-weight: 600; color: var(--ink-2); display: inline-flex; align-items: center; justify-content: center; gap: 4px; }
.lib-tile-actions button + button { border-left: 1px solid var(--line); }
.lib-tile-actions button:hover:not(:disabled) { background: var(--surface-2); }
.lib-tile.new { border-style: dashed; border-color: var(--line-2); }
.new-plus { height: 42px; display: grid; place-items: center; color: var(--accent-ink); background: var(--accent-soft); border-radius: 7px; margin-bottom: 5px; }
.empty { text-align: center; padding: 18px 8px; color: var(--ink-3); display: grid; gap: 10px; justify-items: center; }

.tpl-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.tpl-card {
  position: relative; display: grid; gap: 3px; width: 100%; text-align: left; padding: 10px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface); transition: border-color 0.15s, box-shadow 0.15s;
}
.tpl-card:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
.tpl-card.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.tpl-card .band-map { margin-bottom: 6px; }
.tpl-name { font-weight: 600; }
.tpl-meta { font-size: 12px; color: var(--accent-ink); font-weight: 500; }
.tpl-blurb { font-size: 12.5px; color: var(--ink-3); }
.tpl-check { position: absolute; top: 10px; right: 10px; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; }

/* ── Pattern art & band map ─────────────────────────────── */
.pattern-art { display: block; }
.pattern-art.plain { display: grid; place-items: center; font-size: 11px; color: var(--ink-3); background: linear-gradient(135deg, var(--surface-2), var(--surface)); border-radius: 6px; }
.band-map { display: block; width: 100%; height: auto; overflow: visible; }
.band-map .band-bg { fill: var(--band); }
.band-map .band-zone path { stroke: var(--ink-2); }
.band-map .band-zone path.fill { fill: var(--ink-2); stroke: none; }
.band-map .zone-hit { fill: transparent; }
.band-map .band-zone.active .zone-hit { fill: rgba(181, 134, 47, 0.13); }
.band-map .band-zone.clickable { cursor: pointer; }
.band-map .band-zone.clickable:hover .zone-hit { fill: rgba(181, 134, 47, 0.2); }
.band-map .band-zone:focus-visible { outline: none; }
.band-map .band-zone:focus-visible .zone-hit { stroke: var(--accent); stroke-width: 0.3; }
.band-map .divider { stroke: var(--accent); }
.band-map .zone-label { font: 600 1.1px var(--font); fill: var(--ink-3); dominant-baseline: middle; display: none; }

/* ── Stage (cross carousel) ─────────────────────────────── */
.stage {
  position: relative; display: flex; flex-direction: column; min-height: 0; min-width: 0;
  padding: 14px 18px 14px; background: radial-gradient(ellipse at 50% 42%, var(--stage-a) 0%, var(--stage-b) 100%);
}
.stage-hint { position: absolute; top: 14px; left: 18px; display: flex; gap: 14px; font-size: 12px; color: var(--ink-3); z-index: 2; }
.stage-hint span { display: inline-flex; gap: 3px; align-items: center; }
.stage-tools { position: absolute; top: 12px; right: 16px; display: flex; gap: 6px; z-index: 2; }
.cross {
  flex: 1; min-height: 0; display: grid;
  grid-template-areas: '. top .' 'left center right' '. bottom .';
  grid-template-columns: minmax(110px, 1fr) minmax(240px, 2.4fr) minmax(110px, 1fr);
  grid-template-rows: auto minmax(220px, 1fr) auto;
  gap: 8px; padding-top: 30px;
}
.cross-top { grid-area: top; display: flex; justify-content: center; align-items: flex-end; }
.cross-bottom { grid-area: bottom; display: flex; justify-content: center; align-items: flex-start; }
.cross-left { grid-area: left; display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
.cross-right { grid-area: right; display: flex; justify-content: flex-start; align-items: center; gap: 8px; }
.cross-center { grid-area: center; position: relative; min-height: 0; }
.cross-center .ring-view { position: absolute; inset: 0; cursor: grab; }
.cross-center .ring-view:active { cursor: grabbing; }
.cross-top, .cross-bottom, .cross-left, .cross-right { touch-action: pan-y; }

.stage-card {
  border: 1px solid rgba(255, 255, 255, 0.7); background: rgba(255, 255, 255, 0.72); backdrop-filter: blur(6px);
  border-radius: 14px; box-shadow: var(--shadow); color: var(--ink-2); padding: 8px;
  display: flex; align-items: center; gap: 10px; transition: transform 0.18s, box-shadow 0.18s, background 0.18s;
}
.stage-card:hover { background: #fff; transform: translateY(-1px); box-shadow: var(--shadow-lg); color: var(--ink); }
.stage-card.middle { width: 190px; height: 78px; padding: 6px 14px 6px 8px; }
.stage-card.middle .pattern-art { height: 64px; width: 48px; flex: none; }
.stage-card.side { flex-direction: column; width: 96px; height: 236px; padding: 10px 8px 8px; gap: 6px; }
.stage-card.side .pattern-art { flex: 1; width: 100%; min-height: 0; }
.stage-card.far { opacity: 0.45; transform: scale(0.88); width: 78px; }
.stage-card.far:hover { opacity: 0.8; transform: scale(0.9); }
.stage-card-name { font-size: 12px; font-weight: 600; text-align: left; line-height: 1.2; }
.stage-card.side .stage-card-name { text-align: center; }
.stage-card .pattern-art.plain { width: 100%; height: 100%; }
.stage-empty { display: grid; gap: 4px; justify-items: center; text-align: center; font-size: 12px; color: var(--ink-3); padding: 10px; max-width: 160px; }

.enter-next { animation: enter-next 0.28s cubic-bezier(0.2, 0.8, 0.2, 1); }
.enter-prev { animation: enter-prev 0.28s cubic-bezier(0.2, 0.8, 0.2, 1); }
.cross-left .enter-next, .cross-right .enter-next { animation-name: enter-next-x; }
.cross-left .enter-prev, .cross-right .enter-prev { animation-name: enter-prev-x; }
@keyframes enter-next { from { transform: translateY(16px); opacity: 0.2; } }
@keyframes enter-prev { from { transform: translateY(-16px); opacity: 0.2; } }
@keyframes enter-next-x { from { transform: translateX(16px); opacity: 0.2; } }
@keyframes enter-prev-x { from { transform: translateX(-16px); opacity: 0.2; } }

.selection-bar { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px; margin-top: 10px; }
.sel-group { display: flex; align-items: center; gap: 6px; background: rgba(255, 255, 255, 0.8); border: 1px solid var(--line); border-radius: 14px; padding: 5px; }
.sel-group.disabled { opacity: 0.55; }
.sel-text { display: grid; grid-template-columns: auto auto; column-gap: 8px; align-items: baseline; min-width: 120px; padding: 0 4px; }
.sel-label { grid-column: 1 / -1; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--ink-3); }
.sel-text strong { font-size: 14px; }
.sel-count { font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.link-group { padding: 5px 7px; background: transparent; border: 0; }
.draw-btn { margin-left: 4px; }

.band-map-wrap { margin: 12px auto 0; width: min(100%, 720px); background: rgba(255, 255, 255, 0.65); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px 10px; }
.band-map-head { display: flex; justify-content: space-between; font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.band-map-head .muted { font-weight: 400; }

/* ── Specs rail ─────────────────────────────────────────── */
.spec-sec { padding: 4px 0 16px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.spec-sec:last-child { border-bottom: 0; }
.spec-sec h3 { font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.spec-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.spec-head h3 { margin: 0; }
.size-display { display: grid; }
.size-big { font: 600 26px/1.1 var(--display); }
.size-alt { font-size: 12.5px; color: var(--ink-3); }
.repeat-row { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-2); margin-top: 10px; }
.repeat-row > span { flex: 1; font-weight: 500; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line-2); border-radius: var(--radius-md); overflow: hidden; }
.stepper button { border: 0; background: var(--surface-2); width: 28px; height: 28px; font-weight: 700; }
.stepper output { min-width: 62px; text-align: center; font-weight: 600; font-size: 13px; }
.stepper small { color: var(--ink-3); font-weight: 400; }
.mat-group .field-label { margin-top: 8px; }
.swatches { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.swatch { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-md); padding: 6px 8px; text-align: left; font-size: 12.5px; }
.swatch:hover { border-color: var(--line-2); }
.swatch.on { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); font-weight: 600; }
.swatch-dot {
  width: 22px; height: 22px; border-radius: 50%; flex: none;
  background: radial-gradient(circle at 32% 28%, #fff calc(var(--m) * 38%), var(--c) calc(var(--m) * 38% + 18%), color-mix(in srgb, var(--c), #000 calc(var(--m) * 30%)) 100%);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}
.swatches.compact { grid-template-columns: repeat(5, 1fr); }
.swatches.compact .swatch { justify-content: center; padding: 6px; }
.mat-process { font-size: 12.5px; color: var(--ink-3); margin-top: 10px; }
.mat-process strong { color: var(--ink-2); }

.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.check { display: flex; gap: 9px; padding: 9px 10px; border-radius: var(--radius-md); font-size: 13px; }
.check strong { font-size: 13px; }
.check p { color: var(--ink-2); font-size: 12.5px; margin-top: 1px; }
.check-icon { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; }
.check.error { background: var(--error-soft); }
.check.error .check-icon { background: var(--error); color: #fff; }
.check.warn { background: var(--warn-soft); }
.check.warn .check-icon { background: var(--warn); color: #fff; }
.check.info { background: var(--info-soft); }
.check.info .check-icon { background: var(--info); color: #fff; }
.check.ok .check-icon { background: var(--ok-soft); color: var(--ok); }
.check.ok { padding: 5px 10px; }
.fix-btn { margin-top: 7px; display: inline-flex; align-items: center; gap: 5px; border: 1px solid currentColor; background: var(--surface); border-radius: 99px; padding: 4px 10px; font-size: 12px; font-weight: 600; color: var(--ink); }
.fix-btn:hover { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.checks-clear { display: flex; gap: 8px; align-items: center; color: var(--ok); font-weight: 600; font-size: 13px; }

.price-card { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-top: 1px solid var(--line); background: var(--surface); }
.price-card > div { display: grid; }
.price { font: 600 24px/1.1 var(--display); }

/* ── Modal & toast ──────────────────────────────────────── */
.modal-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(31, 28, 25, 0.42); display: grid; place-items: center; padding: 20px; animation: fade 0.15s; }
.modal { background: var(--surface); border-radius: 20px; box-shadow: var(--shadow-lg); width: min(560px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; animation: pop 0.2s cubic-bezier(0.2, 0.8, 0.2, 1); }
.modal.wide { width: min(1320px, 100%); height: min(860px, calc(100vh - 40px)); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px 12px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font: 500 21px/1.2 var(--display); }
.modal-body { padding: 18px 20px 20px; overflow: auto; flex: 1; min-height: 0; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(0.98); } }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60;
  display: flex; align-items: center; gap: 14px; background: var(--ink); color: #fbf8f2; padding: 11px 16px; border-radius: 12px;
  box-shadow: var(--shadow-lg); font-size: 14px; animation: toast-in 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.toast-action { background: none; border: 0; color: #f0cf8a; font-weight: 700; padding: 2px 4px; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } }

.kb-h { font-size: 13px; font-weight: 700; margin: 6px 0 8px; color: var(--ink-2); }
.kb-list { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; margin: 0 0 18px; font-size: 14px; }
.kb-list dd { margin: 0; color: var(--ink-2); }

/* ── Size finder ────────────────────────────────────────── */
.sf-pane { padding: 16px 0 4px; display: grid; gap: 10px; }
.size-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.size-chips .chip { min-width: 46px; justify-content: center; }
.sf-circle-wrap { display: grid; place-items: center; min-height: 120px; padding: 10px; background: var(--surface-2); border-radius: 14px; }
.sf-circle { border-radius: 50%; border: 2px dashed var(--accent); display: grid; place-items: center; font-size: 11px; font-weight: 600; color: var(--accent-ink); }
.sf-cal { display: grid; gap: 8px; background: var(--surface-2); border-radius: 14px; padding: 12px; }
.sf-card { border: 2px solid var(--ink); border-radius: var(--radius-md); max-width: 100%; }
.sf-steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; color: var(--ink-2); }
.sf-result { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--accent-soft); border-radius: 14px; padding: 14px 16px; margin-top: 16px; }
.sf-result > div { display: grid; }

/* ── Pattern editor ─────────────────────────────────────── */
.editor-modal .modal-body { padding: 0; display: flex; }
.editor { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.ed-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.ed-top input { border: 1px solid var(--line-2); border-radius: var(--radius-md); padding: 7px 10px; width: 190px; }
.ed-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 92px minmax(0, 1fr) 330px; }
.ed-tools { display: flex; flex-direction: column; gap: 4px; padding: 12px 8px; border-right: 1px solid var(--line); overflow-y: auto; }
.ed-tools hr { border: 0; border-top: 1px solid var(--line); width: 100%; margin: 6px 0; }
.tool { display: grid; justify-items: center; gap: 3px; border: 1px solid transparent; background: none; border-radius: var(--radius-md); padding: 7px 4px; font-size: 11px; font-weight: 500; color: var(--ink-2); }
.tool:hover:not(:disabled) { background: var(--surface-2); }
.tool.on { background: var(--ink); color: var(--on-ink); }
.ed-canvas-wrap { position: relative; display: flex; flex-direction: column; min-height: 0; background: var(--surface-2); padding: 18px; gap: 14px; overflow-y: auto; }
.ed-canvas { width: 100%; flex: 1; min-height: 240px; max-height: 520px; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); touch-action: none; color: var(--ink); }
.ed-canvas.tool-pen, .ed-canvas.tool-line, .ed-canvas.tool-circle, .ed-canvas.tool-dot { cursor: crosshair; }
.ed-canvas.tool-eraser { cursor: cell; }
.ed-tile { fill: #fffdf8; stroke: var(--accent); stroke-width: 0.7; }
.ed-grid line { stroke: var(--line); stroke-width: 0.35; }
.ed-axis { stroke: var(--accent); stroke-width: 0.6; stroke-dasharray: 3 2; }
.ed-stroke { stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; }
.ed-stroke.live { opacity: 0.6; }
.ed-ghost { opacity: 0.22; }
.ed-rubber { stroke: var(--accent); stroke-width: 0.8; stroke-dasharray: 2 2; }
.ed-cursor { fill: var(--accent); }
.ed-edge, .ed-tile-label { font: 600 5px var(--font); fill: var(--ink-3); text-anchor: middle; text-transform: uppercase; letter-spacing: 0.1em; }
.ed-empty { position: absolute; top: 34px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--on-ink); font-size: 13px; padding: 8px 14px; border-radius: var(--radius-md); pointer-events: none; text-align: center; width: max-content; max-width: 80%; }
.ed-props { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; background: var(--surface); border-radius: 14px; padding: 4px 16px 12px; }
.ed-props .slider { margin: 10px 0 0; }
.detail-note { grid-column: 1 / -1; display: flex; gap: 7px; align-items: center; font-size: 12.5px; margin-top: 8px; padding: 7px 10px; border-radius: var(--radius-md); }
.detail-note.ok { background: var(--ok-soft); color: var(--ok); }
.detail-note.warn { background: var(--warn-soft); color: var(--warn); }
.ed-preview { border-left: 1px solid var(--line); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; }
.ed-preview .field-label { margin: 0; }
.ed-ring { position: relative; height: 300px; border-radius: 14px; background: radial-gradient(ellipse at 50% 42%, var(--stage-a), var(--stage-b)); flex: none; }

/* ── Try-on ─────────────────────────────────────────────── */
.tryon { display: grid; grid-template-columns: minmax(0, 1fr) 360px; height: calc(100vh - var(--bar)); min-height: 600px; }
.tryon-scene { position: relative; overflow: hidden; background: radial-gradient(ellipse at 50% 40%, #fbf8f3, #e6ddcf); }
.tryon-scene.photo { background: #2a2622; }
.tryon-scene .hand { position: absolute; inset: 0; width: 100%; height: 100%; }
.tryon-scene .hand canvas, .tryon-scene .hand svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.tryon-scene .hand canvas { filter: drop-shadow(0 14px 18px rgb(58 42 28 / .22)); }
.hand .sleeve { fill: #3f4a57; }
.tryon-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ring-overlay { position: absolute; z-index: 2; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.28)); }
.tryon-scene.photo .ring-overlay { cursor: move; touch-action: none; }
.ring-overlay .ring-view { width: 100%; height: 100%; }
.tryon-badge { position: absolute; left: 16px; bottom: 16px; background: rgba(255, 255, 255, 0.88); border-radius: 99px; padding: 7px 14px; font-size: 13px; box-shadow: var(--shadow); }
.upload-drop { position: absolute; inset: 40px; border: 2px dashed rgba(255, 255, 255, 0.4); border-radius: 20px; display: grid; place-content: center; justify-items: center; gap: 8px; color: #f1ebe2; text-align: center; padding: 20px; }
.upload-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 10px; }
.upload-drop .btn.primary { background: #f1ebe2; border-color: #f1ebe2; color: #1c1a17; }
.upload-drop .btn.ghost { background: transparent; border-color: rgba(255, 255, 255, 0.55); color: #f1ebe2; }
.upload-drop .btn.ghost:hover { border-color: #fff; color: #fff; }
.photo-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btn:has(> input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Live webcam view (desktop): mirrored like a mirror, shutter at the foot */
.tryon-cam { position: absolute; inset: 0; background: #000; outline: none; }
.tryon-cam video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.cam-tip { position: absolute; top: 16px; left: 50%; transform: translateX(-50%); margin: 0; padding: 6px 12px; border-radius: 999px; background: rgba(0, 0, 0, 0.5); color: #fff; font-size: 13px; white-space: nowrap; }
.cam-bar { position: absolute; left: 0; right: 0; bottom: 20px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; padding: 0 20px; }
.cam-bar .btn { justify-self: end; }
.cam-shutter { width: 64px; height: 64px; border-radius: 50%; border: 4px solid #fff; background: rgba(255, 255, 255, 0.3); cursor: pointer; transition: background 0.15s; }
.cam-shutter:hover, .cam-shutter:focus-visible { background: #fff; }
.cam-shutter:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.upload-drop span { font-size: 13px; opacity: 0.8; max-width: 34ch; }
.tryon-controls { border-left: 1px solid var(--line); }
.tryon-controls .rail-body { display: flex; flex-direction: column; gap: 8px; }
.tryon-controls .screen-title { font-size: 26px; }
.tones { display: flex; gap: 8px; }
.tone { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--surface); background: var(--c); box-shadow: 0 0 0 1px var(--line-2); }
.tone.on { box-shadow: 0 0 0 2.5px var(--ink); }
.step-nav { display: flex; gap: 10px; align-items: center; padding: 14px 16px; border-top: 1px solid var(--line); }
.step-nav.sticky { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg) 30%); border: 0; padding: 22px 0 18px; }

/* ── Review ─────────────────────────────────────────────── */
.review { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(360px, 1fr); gap: 0; min-height: calc(100vh - var(--bar)); }
.review-hero { display: flex; flex-direction: column; gap: 14px; padding: 28px; background: radial-gradient(ellipse at 50% 35%, var(--stage-a), var(--stage-b)); position: sticky; top: var(--bar); height: calc(100vh - var(--bar)); }
.review-ring { position: relative; flex: 1; min-height: 260px; }
.review-ring .ring-view { position: absolute; inset: 0; }
.review-title h1 { font: 500 34px/1.1 var(--display); margin: 4px 0; }
.review-band { max-width: 640px; }
.review-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.review-side { padding: 24px; display: grid; gap: 16px; align-content: start; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card h2 { font: 500 19px/1.2 var(--display); margin-bottom: 12px; }
.spec-sheet { display: grid; grid-template-columns: 130px 1fr; gap: 8px 12px; margin: 0; font-size: 14px; }
.spec-sheet dt { color: var(--ink-3); }
.spec-sheet dd { margin: 0; font-weight: 500; text-transform: none; }
.price-lines { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 7px; font-size: 14px; }
.price-lines li { display: flex; justify-content: space-between; gap: 10px; }
.price-lines .total { border-top: 1px solid var(--line); padding-top: 9px; font-weight: 700; font-size: 16px; }
.export-card { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent-soft); }
.export-card > p { margin-bottom: 12px; }
.error-note { display: flex; gap: 6px; align-items: center; color: var(--error); font-size: 13px; margin-top: 10px; font-weight: 500; }
.next-steps { margin: 16px 0 0; padding-left: 20px; display: grid; gap: 5px; font-size: 13.5px; color: var(--ink-2); }
.review-side .step-nav { border: 0; padding: 0; }
.export { display: grid; gap: 14px; }
.format-list { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; }
.format-list legend { padding: 0; margin: 0 0 8px; }
.format { display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; cursor: pointer; }
.format.on { border-color: var(--ink); background: var(--surface-2); }
.format-name { font-weight: 700; font-family: ui-monospace, monospace; }
.format-desc { font-size: 13px; color: var(--ink-3); }
.check-row { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--ink-2); }
.progress-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.progress-steps li { display: flex; align-items: center; gap: 10px; color: var(--ink-3); }
.progress-steps li.done { color: var(--ink); }
.progress-steps li.now { color: var(--ink); font-weight: 600; }
.ps-dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-2); display: grid; place-items: center; flex: none; }
.progress-steps li.done .ps-dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.progress-steps li.now .ps-dot { border-color: var(--accent); border-top-color: transparent; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.file-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.file-list li { display: flex; align-items: center; gap: 10px; background: var(--surface-2); padding: 9px 12px; border-radius: var(--radius-md); font-size: 13.5px; }
.file-list li span:nth-child(2) { flex: 1; font-family: ui-monospace, monospace; font-size: 12.5px; word-break: break-all; }
.proto-note { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; color: var(--info); background: var(--info-soft); padding: 9px 12px; border-radius: var(--radius-md); }

/* ── Landing ────────────────────────────────────────────── */
.landing-nav { display: flex; align-items: center; gap: 24px; padding: 18px clamp(16px, 4vw, 48px); max-width: 1280px; margin: 0 auto; }
.landing-nav nav { display: flex; gap: 22px; margin-left: auto; }
.landing-nav nav a { text-decoration: none; font-size: 14px; font-weight: 500; color: var(--ink-2); }
.landing-nav nav a:hover { color: var(--ink); }
.landing main, .start-main { max-width: 1280px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 48px); }
.hero { display: grid; grid-template-columns: 1fr 1.05fr; gap: 40px; align-items: center; min-height: calc(100vh - 90px); padding: 20px 0 40px; }
.hero h1 { font: 500 clamp(40px, 5.4vw, 72px)/1.03 var(--display); letter-spacing: -0.02em; margin: 14px 0 18px; }
.hero h1 em { font-style: italic; color: var(--accent-ink); }
.hero-ctas { display: flex; gap: 12px; flex-wrap: wrap; margin: 28px 0 26px; }
.hero-facts { list-style: none; padding: 0; margin: 0; display: flex; gap: 22px; flex-wrap: wrap; color: var(--ink-3); font-size: 14px; }
.hero-facts strong { color: var(--ink); font-size: 16px; }
.hero-visual { position: relative; aspect-ratio: 1 / 1; border-radius: 32px; background: radial-gradient(ellipse at 50% 40%, var(--stage-a), var(--stage-b)); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6), var(--shadow); }
.hero-ring { position: absolute; inset: 0 0 70px; }
.hero-ring .ring-view { width: 100%; height: 100%; }
.hero-caption { position: absolute; left: 24px; right: 24px; bottom: 24px; display: grid; gap: 2px; }
.hero-caption strong { font: 500 20px/1.2 var(--display); }
.hero-caption span { font-size: 13px; color: var(--ink-2); }
.hero-dots { position: absolute; right: 24px; bottom: 30px; display: flex; gap: 6px; }
.hero-dots button { width: 8px; height: 8px; padding: 0; border-radius: 99px; border: 0; background: var(--line-2); transition: width 0.2s; }
.hero-dots button.on { width: 22px; background: var(--ink); }
.how, .features, .cost { padding: 70px 0; border-top: 1px solid var(--line); }
.how h2, .cost h2 { font: 500 38px/1.1 var(--display); letter-spacing: -0.01em; margin-bottom: 30px; max-width: 18ch; }
.how-steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.how-steps li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.how-n { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; margin-bottom: 14px; }
.how-steps h3 { font-size: 17px; margin-bottom: 6px; }
.how-steps p { color: var(--ink-2); font-size: 14px; }
.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.feature { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.feature.big { grid-column: 1 / -1; display: grid; grid-template-columns: 340px 1fr; gap: 36px; align-items: center; background: linear-gradient(135deg, var(--surface), var(--accent-soft)); }
.feature.big h3 { font: 500 30px/1.15 var(--display); margin-bottom: 10px; }
.feature.big p { font-size: 16px; color: var(--ink-2); max-width: 56ch; }
.feature h3 { font-size: 17px; margin: 12px 0 6px; }
.feature p { color: var(--ink-2); font-size: 14px; }
.feature-icon { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-ink); }
.mini-cross { position: relative; display: grid; grid-template-areas: '. t .' 'l m r' '. b .'; grid-template-columns: 70px minmax(0, 1fr) 70px; grid-template-rows: 60px 150px 60px; gap: 8px; }
.mc { background: #fff; border-radius: 12px; box-shadow: var(--shadow); display: grid; place-items: center; color: var(--ink-2); padding: 6px; }
.mc .pattern-art { width: 100%; height: 100%; }
.mc.top { grid-area: t; } .mc.bottom { grid-area: b; } .mc.left { grid-area: l; } .mc.right { grid-area: r; }
.mc.mid { grid-area: m; background: transparent; box-shadow: none; }
.mc-ring { width: 110px; height: 110px; border-radius: 50%; border: 14px solid var(--accent); box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.08), 0 8px 20px rgba(0, 0, 0, 0.12); }
.mc-arrow { position: absolute; font-weight: 700; color: var(--accent-ink); }
.mc-arrow.up { top: 66px; left: 50%; transform: translateX(-50%); } .mc-arrow.down { bottom: 66px; left: 50%; transform: translateX(-50%); }
.mc-arrow.l { left: 76px; top: 50%; transform: translateY(-50%); } .mc-arrow.r { right: 76px; top: 50%; transform: translateY(-50%); }
.cost-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 30px; }
.cost-card { border-radius: var(--radius); padding: 26px; display: grid; gap: 8px; }
.cost-card ul { margin: 8px 0 0; padding-left: 18px; color: var(--ink-2); display: grid; gap: 4px; }
.cost-big { font: 500 38px/1.1 var(--display); }
.muted-card { background: var(--surface-2); }
.accent-card { background: var(--ink); color: #fbf8f2; }
.accent-card .eyebrow { color: #f0cf8a; }
.accent-card ul { color: #d8d1c6; }
.landing-foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; max-width: 1280px; margin: 0 auto; padding: 26px clamp(16px, 4vw, 48px) 40px; font-size: 13px; color: var(--ink-3); border-top: 1px solid var(--line); }

/* ── Start / onboarding ─────────────────────────────────── */
.start-steps { list-style: none; display: flex; gap: 6px; margin: 0 auto; padding: 0; font-size: 13.5px; }
.start-steps li { padding: 6px 12px; border-radius: 99px; color: var(--ink-3); font-weight: 500; }
.start-steps li.on { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow); }
.start-steps li.done { color: var(--ok); }
.start-main section { padding: 26px 0 0; }
.start-main .lead { margin: 10px 0 26px; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.tpl-card.big { padding: 16px; gap: 5px; }
.tpl-card.big .band-map { margin-bottom: 10px; }
.tpl-card.big .tpl-name { font: 500 20px/1.2 var(--display); }
.size-step { max-width: 640px; display: grid; gap: 18px; }
.size-step .lead { margin: 0; }
.size-hero { display: grid; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.size-hero .size-big { font-size: 40px; }
.size-step .step-nav { border: 0; padding: 10px 0 30px; }

/* ── Responsive ─────────────────────────────────────────── */
/* The studio keeps its three columns down to 1024 px (the UI scales to fit, see --ui); below that it stacks. */
@media (max-width: 1023px) {
  .studio { grid-template-columns: 1fr; height: auto; min-height: 0; }
  .studio .stage { order: 1; height: min(78vh, 760px); min-height: 560px; }
  .studio .mobile-tabs { order: 2; display: flex; gap: 6px; padding: 10px 14px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: var(--topbar); z-index: 5; }
  .mobile-tabs button { flex: 1; border: 1px solid var(--line-2); background: var(--surface); border-radius: 99px; padding: 8px 10px; font-weight: 600; font-size: 13px; }
  .mobile-tabs button.on { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
  .studio .rail { order: 3; border: 0; }
  .studio .rail-body { overflow: visible; }
  .studio.panel-specs .library, .studio.panel-library .specs { display: none; }
  .studio .price-card { position: sticky; bottom: 0; box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.06); }
  .lib-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .swatches { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}
@media (max-width: 1180px) {
  .tryon { grid-template-columns: 1fr; height: auto; }
  .tryon-scene { height: 70vh; min-height: 460px; }
  .tryon-controls { border: 0; }
  .review { grid-template-columns: 1fr; }
  .review-hero { position: relative; top: 0; height: auto; }
  .review-ring { min-height: 360px; }
  .ed-body { grid-template-columns: 76px minmax(0, 1fr); }
  .ed-preview { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--line); flex-direction: row; flex-wrap: wrap; }
  .ed-preview .ed-ring { width: 100%; height: 240px; }
  .modal.wide { height: calc(100vh - 20px); }
  .editor-modal .modal-body { overflow-y: auto; }
  .hero { grid-template-columns: 1fr; min-height: 0; }
  .hero-visual { max-width: 560px; width: 100%; justify-self: center; }
  .how-steps { grid-template-columns: 1fr 1fr; }
  .features { grid-template-columns: 1fr 1fr; }
  .feature.big { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  :root { --topbar: 56px; }
  .topbar { grid-template-columns: auto 1fr auto; gap: 8px; padding: 0 12px; }
  .topbar .steps a { padding: 6px 8px; font-size: 0; gap: 0; }
  .topbar .steps a .step-n { font-size: 11px; }
  .ring-name { display: none; }
  .topbar-right .btn { padding: 6px 10px; }
  .stage { padding: 10px; }
  .stage-hint { display: none; }
  .cross { grid-template-columns: 66px minmax(0, 1fr) 66px; padding-top: 34px; gap: 6px; }
  .stage-card.far { display: none; }
  .stage-card.side { width: 64px; height: 180px; padding: 6px 4px; }
  .stage-card.side .stage-card-name { font-size: 10.5px; }
  .stage-card.middle { width: 150px; height: 62px; }
  .stage-card.middle .pattern-art { height: 50px; width: 36px; }
  .sel-text { min-width: 92px; }
  .draw-btn { width: 100%; }
  .landing-nav nav { display: none; }
  .how-steps, .features, .cost-grid { grid-template-columns: 1fr; }
  .ed-top input { width: 140px; }
  .ed-props { grid-template-columns: 1fr; }
  .spec-sheet { grid-template-columns: 110px 1fr; }
  .start-steps { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ── Polish fixes ───────────────────────────────────────── */
.stage-card .pattern-art.plain span { display: none; }
.stage-card .pattern-art.plain { background: linear-gradient(135deg, #f4f1ec 0%, #ffffff 45%, #e7e2d9 100%); box-shadow: inset 0 0 0 1px var(--line); }
.ed-canvas-wrap, .stage, .tryon-scene { -webkit-user-select: none; user-select: none; }
.repeat-row { gap: 6px; }
.repeat-row > span { font-size: 12.5px; }
.stepper output { min-width: 54px; }
.stage-card.middle .pattern-art.plain { width: 48px; height: 64px; }
.tryon-zoom { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); z-index: 3; box-shadow: var(--shadow); border-radius: var(--radius-md); }
.tryon-zoom .segmented { background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(6px); }
.tryon-scene .hand { transition: none; }
.segmented button { white-space: nowrap; }
.tpl-thumb { display: block; aspect-ratio: 4 / 3; border-radius: var(--radius-md); overflow: hidden; margin-bottom: 8px; background: radial-gradient(ellipse at 50% 40%, var(--stage-a), var(--stage-b)); }
.tpl-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transform: scale(1.18); }
.tpl-thumb-loading { display: block; width: 100%; height: 100%; background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.6) 50%, transparent 70%) var(--surface-2); background-size: 200% 100%; animation: shimmer 1.2s infinite linear; }
@keyframes shimmer { to { background-position: -200% 0; } }
.tpl-list .tpl-thumb { aspect-ratio: 16 / 9; }
@media (max-width: 760px) {
  .studio .stage { height: auto; min-height: 0; }
  .cross { grid-template-rows: auto 320px auto; }
  .logo { font-size: 16px; white-space: nowrap; gap: 6px; }
  .topbar .steps ol { gap: 0; }
  .stage-tools { top: 8px; right: 8px; }
  .tryon-zoom { top: 10px; }
  .modal-backdrop { padding: 8px; }
  .ed-tools { flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--line); }
  .ed-body { grid-template-columns: 1fr; }
  .ed-tools hr { display: none; }
  .tool { flex: 1 0 56px; }
}
@media (max-width: 760px) {
  .topbar-right .icon-btn { display: none; }
  .topbar-right .btn { padding: 6px 9px; }
}
