/* WE Brand Design Studio
   Calm, precise, Apple-grade UI. Light theme, brand blue accent. */

:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-2: #fafafa;
  --surface-3: #f2f2f4;
  --ink: #1d1d1f;
  --ink-2: #48484a;
  --muted: #86868b;
  --muted-2: #a1a1a6;
  --line: rgba(0, 0, 0, 0.08);
  --line-2: rgba(0, 0, 0, 0.12);
  --accent: #2B94E5;
  --accent-ink: #1B6FB0;
  --accent-soft: #eaf5fd;
  --accent-ring: rgba(43, 148, 229, 0.28);
  --pink: #F286B6;
  --magenta: #E6187F;
  --ok: #248a3d;
  --ok-soft: #e9f7ee;
  --warn: #b25000;
  --warn-soft: #fff4e5;
  --danger: #d70015;
  --danger-soft: #fdecec;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 8px;
  --shadow-1: 0 1px 2px rgba(0,0,0,.04), 0 6px 20px rgba(0,0,0,.06);
  --shadow-2: 0 2px 6px rgba(0,0,0,.06), 0 18px 48px rgba(0,0,0,.12);
  --shadow-pop: 0 4px 12px rgba(0,0,0,.08), 0 24px 64px rgba(0,0,0,.16);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --ease: cubic-bezier(.2,.7,.2,1);
  --ease-spring: cubic-bezier(.34,1.4,.64,1);
  --topbar: 56px;
  --rail: 76px;
  --panel: 316px;
  --order: 320px;
  --tabbar: 64px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; height: 100%; }
body {
  margin: 0; height: 100%; overflow: hidden;
  font-family: var(--font); font-size: 14px; line-height: 1.45; color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv11", "ss01", "tnum";
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: default; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
svg { display: block; }
::selection { background: rgba(43,148,229,.25); }
:focus-visible { outline: 3px solid var(--accent-ring); outline-offset: 2px; border-radius: 6px; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- app frame ---------- */
.app { display: flex; flex-direction: column; height: 100%; height: 100dvh; }
.topbar {
  height: var(--topbar); flex: 0 0 auto; display: flex; align-items: center; gap: 14px;
  padding: 0 16px 0 14px; background: rgba(255,255,255,.86); backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px); border-bottom: 1px solid var(--line); position: relative; z-index: 30;
}
.topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: linear-gradient(90deg,#E6187F 0%,#F0483C 14%,#F58220 28%,#F7C325 42%,#7DC242 56%,#12B2A6 70%,#2B94E5 84%,#7E57C2 100%); opacity: .9; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 600; letter-spacing: -.01em; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand img, .brand svg { height: 34px; width: auto; max-width: 150px; }
.brand .name { display: flex; flex-direction: column; line-height: 1.05; }
.brand .name small { font-size: 10.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.brand .name b { font-size: 15px; font-weight: 700; }
.design-name { flex: 1; display: flex; justify-content: center; min-width: 0; }
.design-name input {
  width: min(320px, 100%); text-align: center; border: 1px solid transparent; border-radius: 8px; padding: 6px 12px;
  background: transparent; font-weight: 600; font-size: 14px; color: var(--ink); transition: all .15s var(--ease);
}
.design-name input:hover { background: var(--surface-3); }
.design-name input:focus { background: #fff; border-color: var(--line-2); outline: 0; box-shadow: 0 0 0 3px var(--accent-ring); }
.topbar-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn {
  width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border-radius: 9px;
  color: var(--ink-2); transition: background .15s var(--ease), color .15s, transform .1s;
}
.icon-btn:hover { background: var(--surface-3); color: var(--ink); }
.icon-btn:active { transform: scale(.94); }
.icon-btn:disabled { opacity: .35; }
.icon-btn:disabled:hover { background: transparent; }
.icon-btn svg { width: 20px; height: 20px; }
.sep { width: 1px; height: 22px; background: var(--line-2); margin: 0 6px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 18px;
  border-radius: 11px; font-weight: 600; font-size: 14px; background: var(--accent); color: #fff; white-space: nowrap;
  transition: background .15s var(--ease), transform .12s var(--ease), box-shadow .15s, opacity .15s;
  box-shadow: 0 1px 0 rgba(255,255,255,.2) inset, 0 4px 14px rgba(43,148,229,.25);
}
.btn:hover { background: #2686d3; text-decoration: none; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; box-shadow: none; }
.btn.big { height: 48px; font-size: 15px; border-radius: 13px; }
.btn.block { width: 100%; }
.btn.secondary { background: var(--surface-3); color: var(--ink); box-shadow: none; }
.btn.secondary:hover { background: #e9e9ec; }
.btn.ghost { background: transparent; color: var(--ink-2); box-shadow: none; border: 1px solid var(--line-2); }
.btn.ghost:hover { background: var(--surface-3); color: var(--ink); }
.btn.danger { background: var(--danger-soft); color: var(--danger); box-shadow: none; }
.btn.danger:hover { background: #fadcdc; }
.btn.small { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.btn.pill { border-radius: 999px; }
.btn svg { width: 18px; height: 18px; }
.btn.dark { background: var(--ink); box-shadow: none; }
.btn.dark:hover { background: #000; }
.btn.spinning { pointer-events: none; }
.btn .spinner { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.link-btn { color: var(--accent-ink); font-weight: 600; font-size: 13px; }
.link-btn:hover { text-decoration: underline; }

/* ---------- workspace ---------- */
.workspace { flex: 1; display: grid; grid-template-columns: var(--rail) var(--panel) 1fr var(--order); min-height: 0; }
.rail {
  background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; padding: 10px 0; gap: 4px;
}
.rail-btn {
  width: 62px; height: 60px; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  color: var(--muted); font-size: 11px; font-weight: 600; transition: background .15s var(--ease), color .15s;
}
.rail-btn svg { width: 22px; height: 22px; }
.rail-btn:hover { background: var(--surface-3); color: var(--ink); }
.rail-btn.active { background: var(--accent-soft); color: var(--accent-ink); }
.rail .spacer { flex: 1; }

.panel { background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.panel-head { padding: 18px 18px 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.panel-head h2 { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.panel-head .sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.panel-body { flex: 1; overflow: auto; padding: 4px 18px 24px; overscroll-behavior: contain; }
.panel-body::-webkit-scrollbar, .layers::-webkit-scrollbar, .sheet-body::-webkit-scrollbar { width: 8px; }
.panel-body::-webkit-scrollbar-thumb, .sheet-body::-webkit-scrollbar-thumb { background: rgba(0,0,0,.12); border-radius: 8px; border: 2px solid #fff; }
.pane { display: none; }
.pane.active { display: block; }
.section { margin: 14px 0 6px; }
.section-title { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 18px 0 8px; display: flex; align-items: center; justify-content: space-between; }
.section-title:first-child { margin-top: 6px; }
.help-text { color: var(--muted); font-size: 12.5px; line-height: 1.45; margin: 6px 0 0; }
.back-btn { display: inline-flex; align-items: center; gap: 4px; color: var(--accent-ink); font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.back-btn svg { width: 16px; height: 16px; }

/* ---------- stage ---------- */
.stage { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg);
  background-image: radial-gradient(ellipse at 50% 40%, #fbfbfc 0%, #f5f5f7 55%, #eeeef1 100%); }
.stage-top { position: absolute; top: 14px; left: 0; right: 0; display: flex; justify-content: center; z-index: 5; pointer-events: none; }
.stage-top > * { pointer-events: auto; }
.segmented { display: inline-flex; background: rgba(0,0,0,.06); border-radius: 11px; padding: 3px; position: relative; }
.segmented button { position: relative; z-index: 1; padding: 0 18px; height: 32px; border-radius: 9px; font-weight: 600; font-size: 13px; color: var(--ink-2); transition: color .2s; min-width: 84px; }
.segmented button.active { color: var(--ink); }
.segmented .thumb { position: absolute; top: 3px; left: 3px; height: 32px; border-radius: 9px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.12), 0 4px 10px rgba(0,0,0,.06); transition: transform .28s var(--ease), width .28s var(--ease); }
.segmented .badge { display: inline-block; min-width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-left: 6px; vertical-align: 1px; }
.stage-canvas { flex: 1; position: relative; overflow: auto; display: flex; scrollbar-width: thin; }
.stage-canvas::-webkit-scrollbar { width: 8px; height: 8px; }
.stage-canvas::-webkit-scrollbar-thumb { background: rgba(0,0,0,.14); border-radius: 8px; }
.shirt-wrap { position: relative; margin: auto; flex: 0 0 auto; will-change: transform; user-select: none; -webkit-user-select: none; transition: width .35s var(--ease), height .35s var(--ease); }
.shirt-wrap .shirt-svg { position: absolute; inset: 0; width: 100%; height: 100%; filter: drop-shadow(0 18px 30px rgba(0,0,0,.14)) drop-shadow(0 2px 6px rgba(0,0,0,.06)); }
.shirt-wrap .shirt-photo { position: absolute; inset: 0; width: 100%; height: 100%; display: block; border-radius: 14px; object-fit: fill; box-shadow: var(--shadow-1); }
.photo-mode #preview-sizes, .photo-mode #preview-sizes + .help-text { display: none; }
.print-area { position: absolute; }
.print-area .guide { position: absolute; inset: -1px; border: 1.5px dashed rgba(0,0,0,.35); border-radius: 6px; pointer-events: none; opacity: 0; transition: opacity .25s; }
.print-area.dark .guide { border-color: rgba(255,255,255,.55); }
.print-area.show-guide .guide, .print-area.dragging .guide { opacity: 1; }
.print-area .guide-label { position: absolute; top: -26px; left: 50%; transform: translateX(-50%); font-size: 11px; font-weight: 600; color: rgba(0,0,0,.55); background: rgba(255,255,255,.85); padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.print-area.dark .guide-label { color: rgba(255,255,255,.9); background: rgba(0,0,0,.45); }
.ink-overlay { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.ink-overlay svg { width: 100%; height: 100%; display: block; }
.print-area .canvas-container { position: absolute !important; inset: 0; }
.print-area .lower-canvas { z-index: 1; }
.print-area .upper-canvas { z-index: 3 !important; }
.print-area .canvas-container .upper-canvas { cursor: default; }
.size-badge {
  position: absolute; z-index: 6; pointer-events: none; transform: translate(-50%, 0); background: rgba(29,29,31,.88); color: #fff; font-size: 11.5px; font-weight: 600;
  padding: 4px 9px; border-radius: 999px; white-space: nowrap; letter-spacing: .01em; opacity: 0; transition: opacity .15s; backdrop-filter: blur(6px);
}
.size-badge.show { opacity: 1; }
.size-badge .dpi { margin-left: 6px; padding-left: 6px; border-left: 1px solid rgba(255,255,255,.3); }
.size-badge .dpi.good { color: #7ee2a4; } .size-badge .dpi.fair { color: #ffcf6a; } .size-badge .dpi.bad { color: #ff8b8b; }
.stage-bottom { position: absolute; bottom: 14px; left: 0; right: 0; display: flex; justify-content: center; align-items: center; gap: 10px; z-index: 5; pointer-events: none; }
.stage-bottom > * { pointer-events: auto; }
.stage-hint { font-size: 12px; color: var(--muted); background: rgba(255,255,255,.7); padding: 6px 12px; border-radius: 999px; backdrop-filter: blur(8px); }
.stage-hint b { color: var(--ink-2); font-weight: 600; }
.chip-btn { height: 30px; padding: 0 12px; border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--ink-2); background: rgba(255,255,255,.8); border: 1px solid var(--line); display: inline-flex; align-items: center; gap: 6px; backdrop-filter: blur(8px); transition: background .15s; }
.chip-btn:hover { background: #fff; }
.chip-btn.on { background: var(--ink); color: #fff; border-color: transparent; }
.chip-btn svg { width: 14px; height: 14px; }
.zoom { display: inline-flex; align-items: center; gap: 2px; background: rgba(255,255,255,.8); border: 1px solid var(--line); border-radius: 999px; padding: 2px; backdrop-filter: blur(8px); }
.zoom button { width: 26px; height: 26px; border-radius: 50%; font-weight: 700; color: var(--ink-2); }
.zoom button:hover { background: var(--surface-3); }
.zoom span { font-size: 12px; font-weight: 600; min-width: 42px; text-align: center; color: var(--ink-2); }
.drop-veil { position: absolute; inset: 12px; border: 2px dashed var(--accent); border-radius: 20px; background: rgba(43,148,229,.08); display: none; align-items: center; justify-content: center; z-index: 20; font-weight: 700; color: var(--accent-ink); font-size: 16px; pointer-events: none; }
.drop-veil.on { display: flex; }
.empty-hint { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); text-align: center; pointer-events: none; z-index: 4; transition: opacity .25s; }
.empty-hint .t { font-weight: 600; font-size: 13.5px; color: rgba(0,0,0,.45); }
.empty-hint .s { font-size: 12px; color: rgba(0,0,0,.35); margin-top: 2px; }
.print-area.dark .empty-hint .t { color: rgba(255,255,255,.7); } .print-area.dark .empty-hint .s { color: rgba(255,255,255,.5); }

/* ---------- order panel ---------- */
.order { background: var(--surface); border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.order-body { flex: 1; overflow: auto; padding: 4px 18px 16px; }
.order-foot { padding: 14px 18px 18px; border-top: 1px solid var(--line); background: var(--surface); }
.sizes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.size-row { display: flex; align-items: center; justify-content: space-between; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px 6px 12px; transition: border-color .15s, background .15s; }
.size-row.has { border-color: rgba(43,148,229,.5); background: var(--accent-soft); }
.size-row .lbl { font-weight: 700; font-size: 13px; }
.stepper { display: inline-flex; align-items: center; gap: 2px; }
.stepper button { width: 26px; height: 26px; border-radius: 7px; font-weight: 700; color: var(--ink-2); font-size: 15px; line-height: 1; }
.stepper button:hover { background: rgba(0,0,0,.06); }
.stepper input { width: 34px; height: 26px; text-align: center; border: 0; background: transparent; font-weight: 700; font-size: 13px; -moz-appearance: textfield; padding: 0; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper input:focus { outline: 0; background: #fff; border-radius: 6px; box-shadow: 0 0 0 2px var(--accent-ring); }
.price-card { margin-top: 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.price-row { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; color: var(--ink-2); padding: 3px 0; }
.price-row b { color: var(--ink); font-weight: 600; }
.price-row.total { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 9px; font-size: 15px; }
.price-row.total b { font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.tier-hint { margin-top: 10px; font-size: 12px; color: var(--accent-ink); background: var(--accent-soft); padding: 8px 10px; border-radius: 8px; line-height: 1.4; }
.tier-hint.quiet { color: var(--muted); background: transparent; padding: 0; }
.order-empty { color: var(--muted); font-size: 12.5px; margin: 6px 0 0; }
.tiers-table { width: 100%; border-collapse: collapse; font-size: 12.5px; margin-top: 6px; }
.tiers-table th, .tiers-table td { text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.tiers-table th { color: var(--muted); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.tiers-table tr.on td { color: var(--accent-ink); font-weight: 700; background: var(--accent-soft); }
.tiers-table td:nth-child(n+2), .tiers-table th:nth-child(n+2) { text-align: right; }

/* ---------- product pane ---------- */
.product-card { display: flex; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.product-card .thumb { width: 54px; height: 54px; flex: 0 0 auto; }
.product-card .thumb svg { width: 100%; height: 100%; filter: drop-shadow(0 2px 4px rgba(0,0,0,.12)); }
.product-card b { display: block; font-size: 14px; }
.product-card span { display: block; color: var(--muted); font-size: 12px; line-height: 1.35; margin-top: 2px; }
.swatches { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.swatch { position: relative; aspect-ratio: 1; border-radius: 50%; border: 1px solid rgba(0,0,0,.12); cursor: pointer; transition: transform .15s var(--ease-spring); box-shadow: inset 0 -3px 6px rgba(0,0,0,.08), inset 0 2px 3px rgba(255,255,255,.35); }
.swatch:hover { transform: scale(1.08); }
.swatch.on { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--accent); }
.swatch.heather::after { content: ""; position: absolute; inset: 0; border-radius: 50%; opacity: .55; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='40' height='40'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='1.1' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/><feComponentTransfer><feFuncA type='linear' slope='0.9'/></feComponentTransfer></filter><rect width='40' height='40' filter='url(%23n)'/></svg>"); mix-blend-mode: soft-light; }
.print-area.empty .guide { opacity: .5; }
.swatch-name { margin-top: 8px; font-size: 13px; color: var(--ink-2); display: flex; align-items: center; gap: 8px; }
.swatch-name b { color: var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2); background: #fff; font-size: 13px; font-weight: 600; color: var(--ink-2); transition: all .15s var(--ease); }
.chip:hover { border-color: rgba(0,0,0,.25); }
.chip.on { background: var(--ink); color: #fff; border-color: transparent; }
.chip.on:hover { background: #000; }

/* ---------- text pane ---------- */
.add-text-btn { width: 100%; }
.quick-text { display: grid; gap: 8px; margin-top: 10px; }
.quick-text button { text-align: left; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); transition: all .15s var(--ease); }
.quick-text button:hover { border-color: rgba(0,0,0,.2); background: #fff; transform: translateY(-1px); box-shadow: var(--shadow-1); }
.quick-text .q1 { font-family: "Anton", Impact, sans-serif; font-size: 24px; letter-spacing: .04em; text-transform: uppercase; }
.quick-text .q2 { font-family: "Pacifico", cursive; font-size: 22px; }
.quick-text .q3 { font-family: "Montserrat", sans-serif; font-weight: 700; font-size: 15px; letter-spacing: .18em; text-transform: uppercase; }
.quick-text .q4 { font-family: "Playfair Display", serif; font-size: 21px; font-style: italic; }

/* ---------- shapes ---------- */
.shape-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.shape-grid button { aspect-ratio: 1; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); display: flex; align-items: center; justify-content: center; transition: all .15s var(--ease); color: var(--ink-2); }
.shape-grid button:hover { background: #fff; border-color: rgba(0,0,0,.2); transform: translateY(-1px); box-shadow: var(--shadow-1); color: var(--ink); }
.shape-grid svg { width: 30px; height: 30px; }

/* ---------- upload pane ---------- */
.dropzone { border: 1.5px dashed rgba(0,0,0,.18); border-radius: 14px; padding: 22px 16px; text-align: center; background: var(--surface-2); transition: all .15s var(--ease); cursor: pointer; }
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone svg { width: 34px; height: 34px; color: var(--accent); margin: 0 auto 8px; }
.dropzone b { display: block; font-size: 14px; }
.dropzone span { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; }
.dropzone input { display: none; }
.format-tips { display: grid; gap: 6px; margin-top: 12px; }
.format-tip { display: flex; gap: 10px; align-items: flex-start; font-size: 12.5px; color: var(--ink-2); line-height: 1.4; }
.format-tip .tag { flex: 0 0 auto; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; padding: 2px 7px; border-radius: 6px; background: var(--surface-3); color: var(--ink-2); margin-top: 1px; min-width: 40px; text-align: center; }
.format-tip .tag.best { background: var(--ok-soft); color: var(--ok); }
.format-tip .tag.warn { background: var(--warn-soft); color: var(--warn); }
.upload-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.upload-item { position: relative; aspect-ratio: 1; border-radius: 10px; border: 1px solid var(--line); overflow: hidden; background: #fff; cursor: pointer; transition: transform .15s var(--ease-spring), box-shadow .15s; }
.upload-item:hover { transform: scale(1.03); box-shadow: var(--shadow-1); }
.upload-item .checker, .checker { background-color: #fff; background-image: linear-gradient(45deg, #e6e6ea 25%, transparent 25%), linear-gradient(-45deg, #e6e6ea 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #e6e6ea 75%), linear-gradient(-45deg, transparent 75%, #e6e6ea 75%); background-size: 12px 12px; background-position: 0 0, 0 6px, 6px -6px, -6px 0; }
.upload-item img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.upload-item .flag { position: absolute; right: 5px; top: 5px; width: 8px; height: 8px; border-radius: 50%; }
.upload-item .flag.ok { background: #34c759; } .upload-item .flag.warn { background: #ff9f0a; } .upload-item .flag.bad { background: #ff3b30; }
.progress { height: 6px; background: var(--surface-3); border-radius: 999px; overflow: hidden; margin-top: 10px; }
.progress i { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .2s; }

/* ---------- artwork check card ---------- */
.check-card { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-top: 4px; }
.check-row { display: flex; gap: 10px; padding: 10px 12px; align-items: flex-start; border-top: 1px solid var(--line); font-size: 12.5px; line-height: 1.4; }
.check-row:first-child { border-top: 0; }
.check-row .ico { width: 22px; height: 22px; flex: 0 0 auto; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.check-row .ico svg { width: 13px; height: 13px; }
.check-row.ok .ico { background: var(--ok-soft); color: var(--ok); }
.check-row.warn .ico { background: var(--warn-soft); color: var(--warn); }
.check-row.bad .ico { background: var(--danger-soft); color: var(--danger); }
.check-row.info .ico { background: var(--accent-soft); color: var(--accent-ink); }
.check-row b { display: block; font-weight: 600; color: var(--ink); }
.check-row span { color: var(--ink-2); }
.check-row .act { margin-top: 6px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.meter { height: 6px; border-radius: 999px; background: linear-gradient(90deg, #ff3b30 0%, #ff9f0a 35%, #34c759 65%, #34c759 100%); position: relative; margin: 8px 0 4px; }
.meter i { position: absolute; top: -4px; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 2px solid var(--ink); transform: translateX(-50%); transition: left .2s var(--ease); box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.meter-scale { display: flex; justify-content: space-between; font-size: 10px; color: var(--muted); font-weight: 600; letter-spacing: .04em; }
.bg-tools { padding: 10px 12px 12px; background: var(--surface-2); border-top: 1px solid var(--line); }
.bg-tools .row { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.bg-tools label { font-size: 12px; color: var(--ink-2); font-weight: 600; white-space: nowrap; }
.before-after { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.before-after .ba { border-radius: 10px; overflow: hidden; border: 1px solid var(--line); position: relative; aspect-ratio: 1; }
.before-after .ba img { width: 100%; height: 100%; object-fit: contain; padding: 8px; position: relative; }
.before-after .ba .cap { position: absolute; left: 6px; bottom: 6px; font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: rgba(0,0,0,.6); color: #fff; }

/* ---------- properties ---------- */
.prop { margin-top: 12px; }
.prop-label { display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.prop-label .val { color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.field { width: 100%; height: 38px; border: 1px solid var(--line-2); border-radius: 10px; padding: 0 12px; background: #fff; transition: border-color .15s, box-shadow .15s; }
.field:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
textarea.field { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; line-height: 1.4; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field-row.three { grid-template-columns: 1fr 1fr 1fr; }
input[type=range] { -webkit-appearance: none; width: 100%; height: 28px; background: transparent; margin: 0; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 999px; background: linear-gradient(90deg, var(--accent) var(--pct, 0%), #e5e5ea var(--pct, 0%)); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 1px solid rgba(0,0,0,.12); box-shadow: 0 1px 4px rgba(0,0,0,.2); margin-top: -8px; transition: transform .1s; }
input[type=range]:active::-webkit-slider-thumb { transform: scale(1.1); }
input[type=range]::-moz-range-track { height: 4px; border-radius: 999px; background: #e5e5ea; }
input[type=range]::-moz-range-progress { height: 4px; border-radius: 999px; background: var(--accent); }
input[type=range]::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 1px solid rgba(0,0,0,.12); box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.toggle-row { display: flex; gap: 6px; }
.toggle-row button { flex: 1; height: 36px; border-radius: 9px; border: 1px solid var(--line-2); background: #fff; color: var(--ink-2); font-weight: 600; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; gap: 4px; transition: all .12s; }
.toggle-row button svg { width: 18px; height: 18px; }
.toggle-row button:hover { background: var(--surface-3); }
.toggle-row button.on { background: var(--ink); color: #fff; border-color: transparent; }
.font-btn { width: 100%; height: 44px; border: 1px solid var(--line-2); border-radius: 10px; background: #fff; display: flex; align-items: center; justify-content: space-between; padding: 0 12px; font-size: 17px; transition: border-color .15s; }
.font-btn:hover { border-color: rgba(0,0,0,.3); }
.font-btn svg { width: 16px; height: 16px; color: var(--muted); }
.color-row { display: flex; align-items: center; gap: 8px; }
.color-btn { width: 38px; height: 38px; border-radius: 10px; border: 1px solid rgba(0,0,0,.15); flex: 0 0 auto; cursor: pointer; box-shadow: inset 0 0 0 2px #fff; transition: transform .12s var(--ease-spring); position: relative; }
.color-btn:hover { transform: scale(1.06); }
.color-btn.none::after { content: ""; position: absolute; left: 6px; right: 6px; top: 50%; height: 2px; background: var(--danger); transform: rotate(-45deg); }
.action-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.action-grid button { height: 54px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 10.5px; font-weight: 600; color: var(--ink-2); transition: all .12s; }
.action-grid button svg { width: 18px; height: 18px; }
.action-grid button:hover { background: #fff; border-color: rgba(0,0,0,.2); color: var(--ink); }
.action-grid button.danger { color: var(--danger); }
.action-grid button.danger:hover { background: var(--danger-soft); border-color: transparent; }
.placement-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
.placement-grid button { padding: 8px 6px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); font-size: 11px; font-weight: 600; color: var(--ink-2); display: flex; flex-direction: column; align-items: center; gap: 4px; transition: all .12s; }
.placement-grid button:hover { background: #fff; border-color: rgba(0,0,0,.2); color: var(--ink); }
.placement-grid svg { width: 34px; height: 40px; }

/* ---------- popovers (font picker, colour picker) ---------- */
.popover { position: fixed; z-index: 300; background: #fff; border-radius: 14px; box-shadow: var(--shadow-pop); border: 1px solid var(--line); width: 300px; max-height: min(520px, calc(100vh - 80px)); display: flex; flex-direction: column; overflow: hidden; animation: pop .18s var(--ease-spring); transform-origin: top left; }
@keyframes pop { from { opacity: 0; transform: scale(.96) translateY(-4px); } to { opacity: 1; transform: none; } }
.popover-head { padding: 10px 12px; border-bottom: 1px solid var(--line); display: flex; gap: 8px; align-items: center; }
.popover-head input { flex: 1; height: 34px; border-radius: 9px; border: 1px solid var(--line-2); padding: 0 10px; }
.popover-body { overflow: auto; padding: 6px; }
.font-cat { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 10px 10px 4px; }
.font-item { width: 100%; text-align: left; padding: 8px 10px; border-radius: 9px; font-size: 20px; line-height: 1.2; display: flex; align-items: center; justify-content: space-between; color: var(--ink); white-space: nowrap; overflow: hidden; }
.font-item:hover { background: var(--surface-3); }
.font-item.on { background: var(--accent-soft); color: var(--accent-ink); }
.font-item small { font-family: var(--font); font-size: 11px; color: var(--muted); font-weight: 500; }
.color-pop { width: 252px; }
.color-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; padding: 10px; }
.color-grid button { aspect-ratio: 1; border-radius: 50%; border: 1px solid rgba(0,0,0,.12); transition: transform .12s var(--ease-spring); }
.color-grid button:hover { transform: scale(1.12); }
.color-grid button.on { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--accent); }
.color-custom { display: flex; gap: 8px; align-items: center; padding: 4px 10px 12px; }
.color-custom input[type=text] { flex: 1; height: 34px; border-radius: 9px; border: 1px solid var(--line-2); padding: 0 10px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; text-transform: uppercase; }
.color-custom input[type=color] { width: 40px; height: 34px; border: 1px solid var(--line-2); border-radius: 9px; padding: 2px; background: #fff; cursor: pointer; }

/* ---------- layers ---------- */
.layers { display: grid; gap: 6px; }
.layer { display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); cursor: pointer; transition: all .12s; }
.layer:hover { background: #fff; border-color: rgba(0,0,0,.18); }
.layer.on { border-color: var(--accent); background: var(--accent-soft); }
.layer .th { width: 36px; height: 36px; border-radius: 7px; border: 1px solid var(--line); background: #fff; display: flex; align-items: center; justify-content: center; overflow: hidden; flex: 0 0 auto; }
.layer .th img { max-width: 100%; max-height: 100%; }
.layer .th span { font-size: 15px; font-weight: 700; color: var(--ink-2); }
.layer .nm { flex: 1; min-width: 0; font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.layer .nm small { display: block; font-weight: 500; color: var(--muted); font-size: 11px; }
.layer .acts { display: flex; gap: 2px; opacity: .6; }
.layer:hover .acts, .layer.on .acts { opacity: 1; }
.layer .acts button { width: 26px; height: 26px; border-radius: 7px; color: var(--ink-2); display: inline-flex; align-items: center; justify-content: center; }
.layer .acts button:hover { background: rgba(0,0,0,.07); color: var(--ink); }
.layer .acts svg { width: 15px; height: 15px; }

/* ---------- sheets, modals, toasts ---------- */
.backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.28); z-index: 100; opacity: 0; transition: opacity .25s; backdrop-filter: blur(2px); }
.backdrop.on { opacity: 1; }
.sheet { position: fixed; top: 12px; right: 12px; bottom: 12px; width: min(560px, calc(100vw - 24px)); background: #fff; border-radius: 20px; box-shadow: var(--shadow-pop); z-index: 101; display: flex; flex-direction: column; transform: translateX(30px); opacity: 0; transition: transform .32s var(--ease), opacity .25s; overflow: hidden; }
.sheet.on { transform: none; opacity: 1; }
.sheet.wide { width: min(760px, calc(100vw - 24px)); }
.sheet-head { padding: 20px 24px 12px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.sheet-head h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
.sheet-head .sub { color: var(--muted); font-size: 13.5px; margin-top: 4px; }
.sheet-body { flex: 1; overflow: auto; padding: 4px 24px 28px; }
.sheet-foot { padding: 14px 24px calc(18px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; align-items: center; background: #fff; }
.close-x { width: 34px; height: 34px; border-radius: 50%; background: var(--surface-3); color: var(--ink-2); display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; transition: background .15s; }
.close-x:hover { background: #e5e5ea; color: var(--ink); }
.close-x svg { width: 16px; height: 16px; }
.modal { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -46%) scale(.98); width: min(440px, calc(100vw - 32px)); background: #fff; border-radius: 20px; box-shadow: var(--shadow-pop); z-index: 101; padding: 26px 26px 22px; opacity: 0; transition: transform .28s var(--ease-spring), opacity .2s; }
.modal.on { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.modal h3 { margin: 0 0 6px; font-size: 19px; font-weight: 700; letter-spacing: -.02em; }
.modal p { margin: 0 0 18px; color: var(--ink-2); font-size: 14px; line-height: 1.5; }
.modal .row { display: flex; gap: 10px; justify-content: flex-end; }
.toasts { position: fixed; left: 50%; bottom: 72px; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: rgba(29,29,31,.92); color: #fff; padding: 10px 16px; border-radius: 999px; font-size: 13.5px; font-weight: 500; box-shadow: var(--shadow-2); display: flex; gap: 10px; align-items: center; animation: toast-in .3s var(--ease-spring); pointer-events: auto; backdrop-filter: blur(8px); max-width: min(520px, calc(100vw - 32px)); }
.toast.ok { background: rgba(36,138,61,.95); } .toast.bad { background: rgba(215,0,21,.95); } .toast.warn { background: rgba(178,80,0,.95); }
.toast button { color: #fff; font-weight: 700; text-decoration: underline; }
.toast svg { width: 16px; height: 16px; flex: 0 0 auto; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(.96); } to { opacity: 1; transform: none; } }

/* ---------- explainers ---------- */
.explain h3 { font-size: 16px; font-weight: 700; margin: 22px 0 8px; letter-spacing: -.01em; }
.explain p { margin: 0 0 10px; color: var(--ink-2); font-size: 14px; line-height: 1.55; }
.explain p b { color: var(--ink); }
.explain ul { margin: 0 0 10px; padding-left: 18px; color: var(--ink-2); font-size: 14px; line-height: 1.55; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 12px 0 6px; }
.compare figure { margin: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--surface-2); }
.compare figure .pic { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; padding: 10px; }
.compare figure .pic svg, .compare figure .pic img, .compare figure .pic canvas { max-width: 100%; max-height: 100%; }
.compare figcaption { padding: 10px 12px 12px; font-size: 12.5px; line-height: 1.4; color: var(--ink-2); border-top: 1px solid var(--line); background: #fff; }
.compare figcaption b { display: block; color: var(--ink); font-weight: 700; margin-bottom: 2px; }
.compare figcaption .tag { display: inline-block; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 2px 7px; border-radius: 6px; margin-bottom: 6px; }
.tag.good { background: var(--ok-soft); color: var(--ok); } .tag.bad { background: var(--danger-soft); color: var(--danger); } .tag.warn { background: var(--warn-soft); color: var(--warn); } .tag.info { background: var(--accent-soft); color: var(--accent-ink); }
.dpi-table, .size-table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 8px 0 12px; }
.dpi-table th, .dpi-table td, .size-table th, .size-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.dpi-table th, .size-table th { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.size-table td:nth-child(n+2), .size-table th:nth-child(n+2) { text-align: right; font-variant-numeric: tabular-nums; }
.size-table tr.on td { background: var(--accent-soft); font-weight: 700; color: var(--accent-ink); }
.callout { border-radius: 12px; padding: 12px 14px; font-size: 13.5px; line-height: 1.5; margin: 12px 0; border: 1px solid transparent; }
.callout.info { background: var(--accent-soft); border-color: rgba(43,148,229,.2); color: var(--accent-ink); }
.callout.warn { background: var(--warn-soft); border-color: rgba(178,80,0,.15); color: var(--warn); }
.callout.ok { background: var(--ok-soft); border-color: rgba(36,138,61,.15); color: var(--ok); }
.help-menu { display: grid; gap: 8px; }
.help-menu button { text-align: left; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); transition: all .12s; }
.help-menu button:hover { background: #fff; border-color: rgba(0,0,0,.2); transform: translateY(-1px); box-shadow: var(--shadow-1); }
.help-menu .ic { width: 38px; height: 38px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-ink); display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.help-menu .ic svg { width: 20px; height: 20px; }
.help-menu b { display: block; font-size: 14px; }
.help-menu span { display: block; font-size: 12.5px; color: var(--muted); }
.zoom-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.zoom-compare canvas { width: 100%; border-radius: 12px; border: 1px solid var(--line); image-rendering: pixelated; }
.zoom-compare div { font-size: 12.5px; color: var(--ink-2); margin-top: 6px; }

/* ---------- review / checkout ---------- */
.review-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.review-mock { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--bg); position: relative; }
.review-mock img { width: 100%; display: block; }
.review-mock .cap { position: absolute; left: 10px; top: 10px; font-size: 11px; font-weight: 700; background: rgba(255,255,255,.85); padding: 3px 9px; border-radius: 999px; }
.review-mock.empty { display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 13px; aspect-ratio: 1; }
.summary { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-top: 14px; }
.summary .r { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--line); font-size: 13.5px; }
.summary .r:first-child { border-top: 0; }
.summary .r span { color: var(--muted); }
.summary .r b { font-weight: 600; text-align: right; }
.summary .r.total { background: var(--surface-2); font-size: 15px; }
.summary .r.total b { font-size: 18px; }
.size-pills { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.size-pills span { background: var(--surface-3); color: var(--ink); font-weight: 600; font-size: 12px; padding: 3px 9px; border-radius: 999px; }
.warn-list { display: grid; gap: 8px; margin-top: 12px; }
.warn-item { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; font-size: 13px; line-height: 1.4; }
.warn-item.warn { background: var(--warn-soft); color: var(--warn); } .warn-item.bad { background: var(--danger-soft); color: var(--danger); } .warn-item.ok { background: var(--ok-soft); color: var(--ok); }
.warn-item svg { width: 16px; height: 16px; flex: 0 0 auto; margin-top: 1px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 8px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid label { display: block; font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.form-grid label i { color: var(--muted); font-style: normal; font-weight: 500; }
.checkline { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--ink-2); margin-top: 14px; line-height: 1.45; }
.checkline input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--accent); }
.field.err { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(215,0,21,.15); }
.success { text-align: center; padding: 30px 10px 10px; }
.success .big { width: 76px; height: 76px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; animation: pop .5s var(--ease-spring); }
.success .big svg { width: 36px; height: 36px; }
.success h2 { margin: 0 0 6px; font-size: 24px; letter-spacing: -.02em; }
.success p { color: var(--ink-2); font-size: 14.5px; line-height: 1.55; margin: 0 auto 10px; max-width: 42ch; }
.success .code { display: inline-block; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 18px; font-weight: 700; background: var(--surface-3); padding: 8px 16px; border-radius: 10px; letter-spacing: .06em; margin: 8px 0 18px; }
.steps { text-align: left; display: grid; gap: 10px; margin: 18px auto; max-width: 380px; }
.steps div { display: flex; gap: 12px; font-size: 13.5px; color: var(--ink-2); line-height: 1.45; }
.steps div b { flex: 0 0 24px; height: 24px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; }

/* ---------- mobile chrome ---------- */
.tabbar { display: none; }
.mobile-sel { display: none; }
.sheet-handle { display: none; }
.loading { position: fixed; inset: 0; background: var(--bg); z-index: 500; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 14px; transition: opacity .4s; }
.loading.off { opacity: 0; pointer-events: none; }
.loading .mark { height: 64px; width: auto; max-width: 240px; animation: breathe 1.6s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { transform: scale(1); opacity: .85; } 50% { transform: scale(1.08); opacity: 1; } }
.loading span { font-size: 13px; color: var(--muted); font-weight: 500; }

@media (max-width: 1180px) {
  :root { --panel: 292px; --order: 292px; }
}
@media (max-width: 980px) {
  body { overflow: hidden; }
  :root { --topbar: 52px; }
  .workspace { grid-template-columns: 1fr; grid-template-rows: 1fr; }
  .rail, .order { display: none; }
  .panel { display: none; }
  .design-name input { width: min(200px, 100%); font-size: 13px; }
  .brand .name { display: none; }
  .stage { padding-bottom: var(--tabbar); }
  .stage-top { top: 10px; }
  .stage-bottom { bottom: calc(var(--tabbar) + 10px); gap: 6px; }
  .stage-hint { display: none; }
  .toasts { top: calc(var(--topbar) + 12px); bottom: auto; }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; height: var(--tabbar); background: rgba(255,255,255,.92); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border-top: 1px solid var(--line); z-index: 60; padding: 0 4px calc(env(safe-area-inset-bottom) / 2); }
  .tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 10.5px; font-weight: 600; color: var(--muted); padding-top: 2px; }
  .tabbar button svg { width: 22px; height: 22px; }
  .tabbar button.active { color: var(--accent-ink); }
  .tabbar button.order-tab { color: var(--accent-ink); }
  .tabbar button.order-tab .dot { position: absolute; }
  /* panels become bottom sheets */
  .panel.as-sheet, .order.as-sheet { display: flex; position: fixed; left: 0; right: 0; bottom: 0; top: auto; max-height: 78vh; max-height: 78svh; height: auto; border-radius: 20px 20px 0 0; box-shadow: var(--shadow-pop); z-index: 120; border: 0; transform: translateY(100%); transition: transform .32s var(--ease); }
  .panel.as-sheet.on, .order.as-sheet.on { transform: none; }
  .sheet-handle { display: block; width: 40px; height: 5px; border-radius: 999px; background: rgba(0,0,0,.18); margin: 8px auto 0; }
  .panel.as-sheet .panel-close, .order.as-sheet .panel-close { display: inline-flex !important; }
  .sheet-backdrop { position: fixed; inset: 0; z-index: 110; background: rgba(0,0,0,.18); opacity: 0; pointer-events: none; transition: opacity .25s; }
  .sheet-backdrop.on { opacity: 1; pointer-events: auto; }
  .panel-body, .order-body { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
  .sheet { top: auto; left: 0; right: 0; bottom: 0; width: 100%; max-height: 92vh; max-height: 92svh; border-radius: 20px 20px 0 0; transform: translateY(40px); }
  .sheet.wide { width: 100%; }
  .modal { width: min(440px, calc(100vw - 24px)); }
  .swatches { grid-template-columns: repeat(8, 1fr); }
  .mobile-sel { display: flex; position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabbar) + 54px); z-index: 7; gap: 4px; background: rgba(29,29,31,.92); border-radius: 999px; padding: 4px; backdrop-filter: blur(8px); opacity: 0; pointer-events: none; transition: opacity .15s; }
  .mobile-sel.show { opacity: 1; pointer-events: auto; }
  .mobile-sel button { color: #fff; font-size: 12px; font-weight: 600; padding: 0 12px; height: 32px; border-radius: 999px; display: inline-flex; align-items: center; gap: 5px; }
  .mobile-sel button svg { width: 15px; height: 15px; }
  .mobile-sel button:hover { background: rgba(255,255,255,.12); }
  .review-grid { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .compare { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .sizes { grid-template-columns: 1fr 1fr; }
  .compare { gap: 8px; }
  .sheet-head { padding: 18px 18px 10px; } .sheet-body { padding: 4px 18px 24px; } .sheet-foot { padding: 12px 18px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* ---------- guided start ---------- */
.intro { position: fixed; inset: 0; z-index: 400; overflow: auto; background: var(--bg); background-image: radial-gradient(ellipse at 50% 0%, #ffffff 0%, #f5f5f7 60%); padding: 28px 16px 48px; transition: opacity .4s var(--ease); -webkit-overflow-scrolling: touch; }
.intro.off { opacity: 0; pointer-events: none; }
.intro-card { max-width: 720px; margin: 0 auto; background: #fff; border-radius: 24px; box-shadow: var(--shadow-2); border: 1px solid var(--line); overflow: hidden; animation: pop .4s var(--ease-spring); }
.intro-top { display: flex; align-items: center; gap: 14px; padding: 18px 22px 0; flex-wrap: wrap; }
.intro-brand { display: flex; align-items: center; gap: 10px; }
.intro-brand img { height: 36px; width: auto; display: block; }
.intro-brand small { display: block; font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 600; line-height: 1.1; }
.intro-brand b { display: block; font-size: 14px; letter-spacing: -.01em; line-height: 1.1; }
.intro-steps { display: flex; gap: 4px; margin-left: auto; }
.intro-step { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px 0 4px; border-radius: 999px; color: var(--muted); font-size: 12px; font-weight: 600; transition: all .2s; }
.intro-step .n { width: 22px; height: 22px; border-radius: 50%; background: var(--surface-3); display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: var(--ink-2); }
.intro-step .n svg { width: 12px; height: 12px; }
.intro-step .l { display: none; }
.intro-step.on { background: var(--accent-soft); color: var(--accent-ink); }
.intro-step.on .n { background: var(--accent); color: #fff; }
.intro-step.on .l { display: inline; }
.intro-step.done .n { background: var(--ok-soft); color: var(--ok); }
.intro-step.done { cursor: pointer; }
.intro-skip { color: var(--muted); font-size: 12.5px; font-weight: 600; padding: 6px 8px; border-radius: 8px; }
.intro-skip:hover { background: var(--surface-3); color: var(--ink); }
.intro-body { padding: 26px 34px 10px; }
.intro-title { font-size: clamp(24px, 3.4vw, 32px); font-weight: 700; letter-spacing: -.025em; line-height: 1.15; margin: 0 0 10px; }
.intro-lead { font-size: 15.5px; line-height: 1.55; color: var(--ink-2); margin: 0 0 18px; }
.intro-how { display: grid; gap: 8px; margin: 6px 0 22px; }
.intro-how-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); font-size: 14px; font-weight: 500; }
.intro-how-item .ic { width: 34px; height: 34px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-ink); display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.intro-how-item .ic svg { width: 18px; height: 18px; }
.intro-how-item .num { font-size: 11px; font-weight: 700; color: var(--muted); width: 14px; }
.intro-label { display: block; font-size: 13px; font-weight: 700; margin: 6px 0 8px; }
.field.big { height: 50px; font-size: 17px; border-radius: 13px; padding: 0 16px; }
.intro-color { display: grid; grid-template-columns: 220px 1fr; gap: 24px; align-items: center; }
.intro-shirt svg { width: 100%; height: auto; }
.intro-swatches { grid-template-columns: repeat(6, 1fr); gap: 12px; }
.intro-tiers { margin: 0 0 18px; }
.intro-tiers td, .intro-tiers th { padding: 8px 8px; }
.intro-sizes { grid-template-columns: repeat(3, 1fr); }
.intro-price { margin-top: 14px; }
.intro-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 6px 0 16px; }
.intro-tool { padding: 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); display: flex; flex-direction: column; gap: 6px; }
.intro-tool .ic { width: 38px; height: 38px; border-radius: 11px; background: var(--accent-soft); color: var(--accent-ink); display: inline-flex; align-items: center; justify-content: center; }
.intro-tool .ic svg { width: 20px; height: 20px; }
.intro-tool b { font-size: 15px; }
.intro-tool span:last-child { font-size: 13px; color: var(--ink-2); line-height: 1.45; }
.intro-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 12px 34px 26px; }
.intro .compare figure .pic { padding: 4px; }
@media (max-width: 640px) {
  .intro { padding: 10px 10px 30px; }
  .intro-card { border-radius: 18px; }
  .intro-top { padding: 14px 16px 0; }
  .intro-brand b { display: none; } .intro-brand small { display: none; }
  .intro-body { padding: 18px 18px 8px; }
  .intro-foot { padding: 10px 18px 20px; }
  .intro-foot .btn { flex: 1; }
  .intro-color { grid-template-columns: 1fr; gap: 12px; }
  .intro-shirt { max-width: 200px; margin: 0 auto; }
  .intro-swatches { grid-template-columns: repeat(6, 1fr); gap: 10px; }
  .intro-sizes { grid-template-columns: 1fr 1fr; }
  .intro-tools { grid-template-columns: 1fr; }
  .intro-steps { width: 100%; order: 3; justify-content: space-between; margin-left: 0; }
}
