@font-face { font-family: "Inter"; src: url(/fonts/inter-latin.woff2) format("woff2"); font-weight: 400 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Plus Jakarta Sans"; src: url(/fonts/jakarta-latin.woff2) format("woff2"); font-weight: 600 800; font-style: normal; font-display: swap; }

/* ============================================================ tokens */
:root {
  --bg: #0B1020;
  --bg-2: #121936;
  --surface: rgba(255, 255, 255, .06);
  --surface-solid: #161d38;
  --surface-hi: rgba(255, 255, 255, .11);
  --border: rgba(255, 255, 255, .15);
  --text: #F3F5FF;
  --muted: #A9B3D8;               /* 9:1 on --bg */
  --violet: #7C5CFF;
  --cyan: #22D3EE;
  --coral: #FF7A8A;
  --green: #34D399;
  --danger: #FF8DA0;
  --warn: #FFD166;
  --on-grad: #0B1020;             /* dark text on the gradient: AA for large/bold text */
  --grad: linear-gradient(135deg, #7C5CFF 0%, #22D3EE 100%);
  --link: #8FD8FF;
  --paper: #F7F5EE;
  --paper-line: rgba(28, 47, 122, .07);
  --glow: 0 0 0 1px rgba(124, 92, 255, .5), 0 10px 40px -8px rgba(124, 92, 255, .55);
  --shadow: 0 1px 0 rgba(255, 255, 255, .07) inset, 0 24px 48px -24px rgba(0, 0, 0, .7), 0 6px 18px rgba(0, 0, 0, .25);
  --r-lg: 24px; --r: 18px; --r-sm: 14px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --tap: 48px;
  --font-head: "Plus Jakarta Sans", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --spring: cubic-bezier(.34, 1.4, .5, 1);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #F3F4FB;
  --bg-2: #E6E9F8;
  --surface: rgba(255, 255, 255, .7);
  --surface-solid: #ffffff;
  --surface-hi: rgba(255, 255, 255, .95);
  --border: rgba(22, 30, 80, .13);
  --text: #12162B;
  --muted: #4A5378;               /* 7:1 on --bg */
  --danger: #B3203D;
  --warn: #8A5A00;
  --link: #4A33C9;
  --glow: 0 0 0 1px rgba(124, 92, 255, .45), 0 10px 36px -10px rgba(124, 92, 255, .45);
  --shadow: 0 1px 0 rgba(255, 255, 255, .9) inset, 0 24px 48px -28px rgba(40, 50, 120, .35), 0 4px 14px rgba(40, 50, 120, .1);
  color-scheme: light;
}

/* ============================================================== base */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font: 400 16px/1.5 var(--font-body);
  padding-bottom: env(safe-area-inset-bottom);
  overflow-x: hidden;
}
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--font-head); line-height: 1.12; margin: 0; letter-spacing: -.02em; }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; border-radius: 8px; }
a { color: var(--link); }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ====================================================== background fx */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; background:
  radial-gradient(1200px 700px at 80% -10%, var(--bg-2), transparent 60%), var(--bg); }
.blob { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .5; will-change: transform; }
.b1 { width: 52vmax; height: 52vmax; left: -14vmax; top: -12vmax; background: #7C5CFF; animation: drift1 28s ease-in-out infinite alternate; }
.b2 { width: 44vmax; height: 44vmax; right: -12vmax; top: 18vh; background: #22D3EE; opacity: .32; animation: drift2 34s ease-in-out infinite alternate; }
.b3 { width: 36vmax; height: 36vmax; left: 22vw; bottom: -18vmax; background: #FF7A8A; opacity: .26; animation: drift3 40s ease-in-out infinite alternate; }
:root[data-theme="light"] .blob { opacity: .28; }
:root[data-theme="light"] .b2 { opacity: .22; }
:root[data-theme="light"] .b3 { opacity: .18; }
@keyframes drift1 { to { transform: translate3d(14vw, 10vh, 0) scale(1.15); } }
@keyframes drift2 { to { transform: translate3d(-16vw, -8vh, 0) scale(.9); } }
@keyframes drift3 { to { transform: translate3d(12vw, -14vh, 0) scale(1.2); } }
.grain {
  position: absolute; inset: -50%; opacity: .07; mix-blend-mode: overlay; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ============================================================== glass */
.glass {
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(20px) saturate(150%); backdrop-filter: blur(20px) saturate(150%);
}

/* ============================================================= topbar */
.topbar {
  position: sticky; top: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between; gap: var(--s2);
  padding: var(--s2) var(--s4); padding-top: calc(var(--s2) + env(safe-area-inset-top));
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font: 600 1rem var(--font-head); min-width: 0; }
.brand b { font-weight: 800; }
.logo { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--grad); flex: none; box-shadow: 0 6px 18px -4px rgba(124, 92, 255, .6); }
.brand-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { display: flex; align-items: center; gap: var(--s2); }
.icon-btn, .pill-btn {
  height: 44px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; font: 600 .9rem var(--font-body);
  transition: transform .2s var(--spring), background .2s, border-color .2s;
}
.icon-btn { width: 44px; font-size: 1.1rem; }
.pill-btn { padding: 0 var(--s4); }
.icon-btn:hover, .pill-btn:hover { background: var(--surface-hi); border-color: color-mix(in srgb, var(--violet) 60%, var(--border)); }
.icon-btn:active, .pill-btn:active { transform: scale(.92); }
#themeBtn .i-sun { display: none; }
:root[data-theme="light"] #themeBtn .i-sun { display: block; }
:root[data-theme="light"] #themeBtn .i-moon { display: none; }

/* ============================================================ stepper */
.stepper { position: relative; max-width: 560px; margin: var(--s4) auto 0; padding: 0 var(--s4); }
.stepper ol { list-style: none; margin: 0; padding: 0; display: flex; justify-content: space-between; position: relative; z-index: 1; }
.stepper li button, .stepper li a {
  display: flex; flex-direction: column; align-items: center; gap: 6px; background: none; border: 0; color: var(--muted);
  font: 600 .8rem var(--font-body); cursor: pointer; padding: 4px 8px; min-width: 64px; text-decoration: none;
}
.stepper .dot {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font: 700 .85rem var(--font-head);
  background: var(--surface-solid); border: 1.5px solid var(--border); color: var(--muted);
  transition: background .4s var(--ease), color .4s, transform .5s var(--spring), border-color .4s, box-shadow .4s;
}
.stepper li.done .dot { background: color-mix(in srgb, var(--green) 25%, var(--surface-solid)); border-color: var(--green); color: var(--green); }
.stepper li.done .dot::before { content: "✓"; }
.stepper li.done .dot { font-size: 0; }
.stepper li.done .dot::before { font-size: .95rem; }
.stepper li.current .dot { background: var(--grad); border-color: transparent; color: var(--on-grad); transform: scale(1.15); box-shadow: var(--glow); }
.stepper li.current button, .stepper li.current a { color: var(--text); }
.stepper .track { position: absolute; left: calc(var(--s4) + 40px); right: calc(var(--s4) + 40px); top: 21px; height: 3px; border-radius: 3px; background: var(--border); }
.stepper .fill { display: block; height: 100%; width: 0; border-radius: 3px; background: var(--grad); }

/* ============================================================== layout */
main { padding: var(--s4) 0 var(--s7); }
.container { max-width: 1120px; margin: 0 auto; padding: 0 var(--s4); }
.screen { display: block; }
.field-label { font-weight: 600; color: var(--muted); }

/* ============================================================ buttons */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); min-height: var(--tap);
  padding: 10px 20px; border-radius: var(--r-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font: 600 1rem var(--font-body); cursor: pointer; text-decoration: none; overflow: hidden; -webkit-tap-highlight-color: transparent;
  transition: transform .2s var(--spring), background .2s, border-color .2s, box-shadow .25s;
}
.btn:hover { background: var(--surface-hi); border-color: color-mix(in srgb, var(--violet) 55%, var(--border)); }
.btn:active { transform: scale(.96); }
.btn.primary { background: var(--grad); border-color: transparent; color: var(--on-grad); font-family: var(--font-head); font-weight: 800; box-shadow: 0 10px 28px -10px rgba(124, 92, 255, .8); }
.btn.primary:hover { box-shadow: 0 14px 36px -8px rgba(34, 211, 238, .55); filter: saturate(1.1) brightness(1.05); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--link); }
.btn.ghost:hover { background: var(--surface); }
.btn.big { width: 100%; min-height: 56px; font-size: 1.1rem; }
.btn.primary.big { font-size: 1.2rem; }
.btn.small { min-height: 40px; padding: 6px 14px; font-size: .9rem; }
.btn:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; filter: grayscale(.4); }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: 600 .85rem var(--font-body); cursor: pointer; transition: transform .2s var(--spring), background .2s, opacity .2s;
}
.chip:hover:not(:disabled) { background: var(--surface-hi); }
.chip:active:not(:disabled) { transform: scale(.92); }
.chip:disabled { opacity: .4; cursor: not-allowed; }
.chip.accent { border-color: color-mix(in srgb, var(--violet) 70%, transparent); color: var(--link); }

/* ====================================================== sliding pills */
.seg { position: relative; display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 4px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); }
.seg .thumb {
  position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc((100% - 8px) / var(--n, 2)); border-radius: 999px;
  background: var(--grad); box-shadow: 0 6px 16px -6px rgba(124, 92, 255, .8);
  transform: translateX(calc(var(--i, 0) * 100%)); transition: transform .5s var(--spring);
}
.seg button {
  position: relative; z-index: 1; min-height: 44px; padding: 6px 18px; border: 0; border-radius: 999px; background: transparent; color: var(--muted);
  font: 700 .95rem var(--font-body); cursor: pointer; white-space: nowrap; transition: color .3s;
}
.seg button[aria-checked="true"] { color: var(--on-grad); }
.seg.small button { min-height: 38px; min-width: 50px; padding: 4px 14px; font-size: .9rem; }

/* ============================================================ landing */
.hero { text-align: center; padding: var(--s5) 0 var(--s5); max-width: 760px; margin: 0 auto; }
.kicker { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 var(--s4); padding: 6px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--muted); font: 600 .8rem var(--font-body); letter-spacing: .02em; }
.spark { width: 8px; height: 8px; border-radius: 50%; background: var(--coral); box-shadow: 0 0 12px var(--coral); }
.hero h1 { font-size: clamp(2.2rem, 7.5vw, 4rem); font-weight: 800; }
.hero h1 .w { display: inline-block; }
.lead { color: var(--muted); font-size: 1.05rem; margin: var(--s4) auto 0; max-width: 560px; }

.garment-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s3); perspective: 1000px; }
.card-wrap { animation: float 7s ease-in-out infinite; animation-delay: calc(var(--i, 0) * -1.1s); }
@keyframes float { 50% { transform: translateY(-7px); } }
.garment-card {
  position: relative; width: 100%; text-decoration: none; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: var(--s5) var(--s3) var(--s4); min-height: 190px;
  border-radius: var(--r-lg); border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; text-align: center;
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); box-shadow: var(--shadow); transform-style: preserve-3d; overflow: hidden;
  transition: border-color .3s, box-shadow .3s;
  -webkit-tap-highlight-color: transparent;
}
.garment-card::before {
  content: ""; position: absolute; inset: 0; opacity: 0; transition: opacity .35s; pointer-events: none;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 30%), rgba(124, 92, 255, .38), rgba(34, 211, 238, .12) 45%, transparent 70%);
}
.garment-card:hover::before, .garment-card:focus-visible::before { opacity: 1; }
.garment-card:hover { border-color: color-mix(in srgb, var(--violet) 65%, var(--border)); }
.garment-card[aria-checked="true"] { border-color: transparent; box-shadow: var(--glow); background: color-mix(in srgb, var(--violet) 16%, var(--surface)); }
.garment-card[aria-checked="true"]::after {
  content: "✓"; position: absolute; top: 12px; right: 12px; width: 26px; height: 26px; line-height: 26px; text-align: center; border-radius: 50%;
  background: var(--grad); color: var(--on-grad); font-weight: 800; font-size: 14px; animation: popin .5s var(--spring);
}
@keyframes popin { from { transform: scale(0); } }
.gicon { width: 86px; height: 86px; filter: drop-shadow(0 8px 14px rgba(124, 92, 255, .35)); transform: translateZ(30px); transition: transform .4s var(--spring); }
.garment-card:hover .gicon { transform: translateZ(40px) scale(1.08); }
.garment-card .gname { font: 800 1.05rem var(--font-head); margin-top: var(--s2); transform: translateZ(20px); }
.garment-card .gblurb { font-size: .78rem; color: var(--muted); transform: translateZ(10px); }

.start-row { display: grid; gap: var(--s4); max-width: 520px; margin: var(--s6) auto 0; }
.view-pick { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); }

/* ======================================================== screen head */
.screen-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); margin: var(--s3) 0 var(--s4); }
.screen-title { flex: 1; min-width: 100px; margin: 0; font: 800 1.5rem var(--font-head); letter-spacing: -.02em; }
.head-controls { display: flex; gap: var(--s2); flex-wrap: wrap; }
.screen-head .btn.ghost { padding-left: 0; }

/* ========================================================= measure */
.measure-layout { display: grid; gap: var(--s4); }
.stage-host {
  position: sticky; top: calc(66px + env(safe-area-inset-top)); z-index: 14; height: 42vh; min-height: 270px; max-height: 480px;
  border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow), 0 0 0 1px rgba(255,255,255,.04);
  background-color: var(--paper);
  background-image: linear-gradient(var(--paper-line) 1px, transparent 1px), linear-gradient(90deg, var(--paper-line) 1px, transparent 1px);
  background-size: 24px 24px;
}
.stage { position: relative; width: 100%; height: 100%; perspective: 1100px; }
.view { position: absolute; inset: 0; }
.view svg { width: 100%; height: 100%; display: block; }
#view3d { touch-action: none; cursor: grab; }
#view3d:active { cursor: grabbing; }
.reset-view { position: absolute; right: 10px; bottom: 10px; z-index: 3; background: rgba(11, 16, 32, .8); color: #fff; border-color: rgba(255, 255, 255, .2); }

.fields { padding: var(--s4); border-radius: var(--r-lg); }
.grabber { display: none; }
.tools { display: flex; flex-wrap: wrap; gap: var(--s2); margin-bottom: var(--s3); }
.fields .intro { margin: 0 0 var(--s4); }
.hint { margin: 6px 4px 0; font-size: .82rem; color: var(--muted); }
.q { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--surface-hi); border: 1px solid var(--border); font-size: .7rem; font-weight: 700; }

/* floating-label inputs */
.field { margin-bottom: var(--s4); }
.field.plain label { display: block; font-weight: 600; margin-bottom: 6px; }
.field.plain .opt { color: var(--muted); font-weight: 400; }
.inp {
  position: relative; display: flex; align-items: stretch; height: 60px; border-radius: var(--r-sm); border: 1.5px solid var(--border);
  background: var(--surface-solid); transition: border-color .25s, box-shadow .25s;
}
.inp input {
  flex: 1; min-width: 0; height: 100%; padding: 24px 8px 6px 16px; border: 0; border-radius: var(--r-sm) 0 0 var(--r-sm); background: transparent;
  color: var(--text); font: 600 1.25rem var(--font-body); font-variant-numeric: tabular-nums;
}
.inp label {
  position: absolute; left: 16px; top: 19px; font: 500 1rem var(--font-body); color: var(--muted); pointer-events: none; transform-origin: left top;
  transition: transform .3s var(--ease), color .25s;
}
.inp input:focus + label, .inp input:not(:placeholder-shown) + label { transform: translateY(-13px) scale(.75); }
.inp input:focus { outline: none; }
.inp:focus-within { border-color: transparent; box-shadow: 0 0 0 2px var(--violet), 0 0 0 6px rgba(124, 92, 255, .28), 0 0 24px rgba(34, 211, 238, .25); }
.inp:focus-within label { color: var(--link); }
.inp .unit { align-self: center; padding-right: 6px; font: 500 .85rem var(--font-body); color: var(--muted); pointer-events: none; }
.inp .acts { display: flex; align-items: center; gap: 6px; padding: 0 8px 0 2px; }
.inp .acts button {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer;
  font: 700 1.1rem/1 var(--font-body); display: grid; place-items: center; transition: transform .15s var(--spring), background .2s;
}
.inp .acts button:hover { background: var(--surface-hi); }
.inp .acts button:active { transform: scale(.82); background: var(--violet); color: #fff; }
.inp .acts .info { font-size: .85rem; color: var(--link); }
.field.invalid .inp { border-color: var(--danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 25%, transparent); }
.error { margin: 6px 4px 0; font-size: .85rem; color: var(--danger); }
.error:empty { display: none; }
.options { border: 1px solid var(--border); border-radius: var(--r-sm); padding: var(--s2) var(--s4) var(--s3); margin: 0 0 var(--s4); }
.options legend { font-weight: 700; padding: 0 6px; }
.check { display: flex; align-items: center; gap: var(--s3); min-height: var(--tap); font-weight: 500; cursor: pointer; }
.check input { width: 24px; height: 24px; accent-color: var(--violet); }
.msg { margin: var(--s2) 0; font-size: .95rem; }
.msg:empty { display: none; }
.error-msg { color: var(--danger); }
.actions { position: sticky; bottom: 0; padding-top: var(--s2); }

/* ======================================================== diagram fx */
.diagram-svg.has-active .dim { opacity: .35; transition: opacity .3s; }
.diagram-svg .dim { cursor: pointer; transition: opacity .3s; }
.diagram-svg .dim.active { opacity: 1; }
.diagram-svg .dim.active .dl { stroke: #E0245E; animation: linePulse 1.1s ease-in-out infinite; }
.diagram-svg .dim.active .ah { fill: #E0245E; }
.diagram-svg .dim.active .val, .diagram-svg .dim.active .nm { fill: #E0245E; }
@keyframes linePulse { 50% { stroke-width: 4.6; filter: drop-shadow(0 0 4px rgba(224, 36, 94, .7)); } }
/* draw-on + spring pop (JS adds .anim) */
.diagram-svg.anim .dl { stroke-dasharray: var(--len); stroke-dashoffset: var(--len); animation: draw .9s var(--ease) forwards; animation-delay: calc(var(--i) * 90ms + 150ms); }
.diagram-svg.anim .ex { opacity: 0; animation: fadein .5s ease forwards; animation-delay: calc(var(--i) * 90ms + 500ms); }
.diagram-svg.anim .ah { opacity: 0; animation: fadein .3s ease forwards; animation-delay: calc(var(--i) * 90ms + 700ms); }
.diagram-svg.anim .pop { transform-box: fill-box; transform-origin: center; opacity: 0; animation: springpop .7s var(--spring) forwards; animation-delay: calc(var(--i) * 90ms + 600ms); }
.diagram-svg.anim .dim.active .dl { animation: linePulse 1.1s ease-in-out infinite; stroke-dasharray: none; stroke-dashoffset: 0; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fadein { to { opacity: .65; } }
@keyframes springpop { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.diagram-svg.anim .ah { --o: 1; }
.diagram-svg.anim .ah { animation-name: fadeinFull; }
@keyframes fadeinFull { to { opacity: 1; } }
.diagram-svg.guide-only .dim:not(.active) { display: none; }
.diagram-svg.guide-only .val { display: none; }

/* 3D labels */
.lbl3d {
  display: flex; flex-direction: column; align-items: center; line-height: 1.1; padding: 2px 8px 3px;
  background: rgba(255, 253, 247, .94); border: 1.2px solid #1c2f7a; border-radius: 8px; color: #1c2f7a;
  font: 600 12px var(--font-body); white-space: nowrap; pointer-events: none; box-shadow: 0 4px 10px -4px rgba(28, 47, 122, .35);
}
.lbl3d .n { font-size: 10px; font-weight: 500; color: #5d6694; }
.lbl3d .v { font-size: 14px; font-weight: 700; }
.lbl3d .v.empty { color: #7a84ad; }
.lbl3d.active { border-color: #E0245E; color: #E0245E; box-shadow: 0 0 0 3px rgba(224, 36, 94, .25); }

/* =========================================================== share */
.share-layout { display: grid; gap: var(--s5); }
.sheet {
  background: #fffdf7; color: #1c2f7a; border: 1.5px solid #d6cfb8; border-radius: var(--r-lg); padding: var(--s4);
  box-shadow: 0 30px 60px -28px rgba(0, 0, 0, .7), 0 0 0 1px rgba(255, 255, 255, .05); width: 100%; max-width: 560px; margin: 0 auto;
}
.sheet .stage { height: 100%; }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--s3); border-bottom: 2px solid #1c2f7a; padding-bottom: 10px; }
.sheet-kicker { margin: 0; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: #5d6694; }
.sheet-title { margin: 0; font: 800 1.6rem var(--font-head); letter-spacing: -.02em; }
.sheet-meta { margin: 0; text-align: right; font-size: .85rem; }
.sheet-meta div { margin-top: 2px; }
.sheet-meta dt { display: inline; color: #5d6694; }
.sheet-meta dt::after { content: ": "; }
.sheet-meta dd { display: inline; margin: 0; font-weight: 700; }
.sheet-slot { position: relative; aspect-ratio: 5 / 6; margin: 8px 0; background: #fffdf7; }
.capture-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; z-index: 5; }
.sheet-table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.sheet-table th, .sheet-table td { padding: 6px 8px; border-top: 1px solid #ded9c6; text-align: left; }
.sheet-table th { font-weight: 500; color: #4a5486; }
.sheet-table td { font-weight: 700; font-variant-numeric: tabular-nums; }
.sheet-table td.empty { color: #8a93b8; font-weight: 400; }
.sheet-options { margin: 8px 0 0; font-size: .9rem; color: #4a5486; }
.sheet.capturing { box-shadow: none; border-radius: 0; }

.share-panel { max-width: 560px; width: 100%; margin: 0 auto; padding: var(--s5); border-radius: var(--r-lg); }
.phone-row { display: grid; grid-template-columns: 132px 1fr; gap: var(--s2); }
input[type="text"], input[type="tel"], select {
  width: 100%; min-height: var(--tap); padding: 10px 14px; border-radius: var(--r-sm); border: 1.5px solid var(--border);
  background: var(--surface-solid); color: var(--text); font: 500 1.05rem var(--font-body);
  transition: border-color .25s, box-shadow .25s;
}
input[type="text"]:focus, input[type="tel"]:focus, select:focus { outline: none; border-color: transparent; box-shadow: 0 0 0 2px var(--violet), 0 0 0 6px rgba(124, 92, 255, .28); }
.btn-stack { display: grid; gap: var(--s3); margin-top: var(--s2); }
.msg.status { color: var(--muted); }
.note { margin-top: var(--s4); padding: var(--s3) var(--s4); border-radius: var(--r-sm); background: color-mix(in srgb, var(--cyan) 10%, transparent); border: 1px solid color-mix(in srgb, var(--cyan) 28%, transparent); font-size: .88rem; }

/* ============================================ toasts, shutter, confetti */
.toasts { position: fixed; z-index: 100; right: var(--s4); bottom: calc(var(--s4) + env(safe-area-inset-bottom)); display: grid; gap: var(--s2); width: min(380px, calc(100vw - 32px)); pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; gap: var(--s3); align-items: flex-start; padding: 12px 16px; border-radius: var(--r-sm); cursor: pointer;
  background: color-mix(in srgb, var(--surface-solid) 92%, transparent); border: 1px solid var(--border); box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .6);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); font-size: .92rem;
}
.toast .ti { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .8rem; color: #0B1020; background: var(--green); }
.toast.warn .ti { background: var(--warn); } .toast.error .ti { background: var(--coral); } .toast.info .ti { background: var(--cyan); }
.shutter { position: fixed; z-index: 90; background: #fff; pointer-events: none; border-radius: var(--r-lg); opacity: 0; }
.success-pop { position: fixed; z-index: 95; left: 50%; top: 42%; margin: -36px 0 0 -36px; width: 72px; height: 72px; pointer-events: none; filter: drop-shadow(0 8px 24px rgba(52, 211, 153, .6)); }
.confetto { position: fixed; z-index: 94; width: 8px; height: 12px; border-radius: 2px; pointer-events: none; }
.ghost-card {
  position: fixed; z-index: 80; display: flex; align-items: center; justify-content: center; pointer-events: none; overflow: hidden;
  border-radius: var(--r-lg); background: var(--surface-solid); border: 1px solid var(--border); box-shadow: var(--glow);
}
.ghost-card .gicon { width: 60%; height: 60%; }
.ghost-card .gname, .ghost-card .gblurb { display: none; }

/* ============================================================ dialog */
.dlg { border: 0; padding: 0; background: transparent; color: var(--text); max-width: none; max-height: none; width: 100%; height: 100%; }
.dlg::backdrop { background: rgba(5, 8, 20, .62); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.dlg[open] { display: grid; place-items: center; }
.dlg-inner { width: min(560px, calc(100vw - 24px)); max-height: min(86vh, 760px); overflow: auto; padding: var(--s5); border-radius: var(--r-lg); background: var(--surface-solid); }
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s4); }
.dlg-head h2 { font-size: 1.25rem; font-weight: 800; }
.guide-art { height: 300px; border-radius: var(--r-sm); overflow: hidden; background-color: var(--paper); background-image: linear-gradient(var(--paper-line) 1px, transparent 1px), linear-gradient(90deg, var(--paper-line) 1px, transparent 1px); background-size: 20px 20px; }
.guide-art svg { width: 100%; height: 100%; }
.guide-text ul { margin: var(--s2) 0 0; padding-left: 1.2em; color: var(--muted); font-size: .92rem; }
.guide-hint { margin: var(--s4) 0 0; font-weight: 600; }
.save-form { display: grid; gap: var(--s3); margin-bottom: var(--s4); }
.plist { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); }
.plist li { display: flex; align-items: center; gap: var(--s3); padding: var(--s3); border-radius: var(--r-sm); border: 1px solid var(--border); background: var(--surface); }
.plist .pi { flex: 1; min-width: 0; }
.plist .pn { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plist .pm { font-size: .8rem; color: var(--muted); }
.empty-note { color: var(--muted); text-align: center; padding: var(--s5) 0; }

/* ============================================================== tour */
.tour { position: fixed; inset: 0; z-index: 120; }
.tour-spot { position: fixed; border-radius: 18px; box-shadow: 0 0 0 9999px rgba(5, 8, 20, .74), 0 0 0 3px var(--cyan), 0 0 30px rgba(34, 211, 238, .5); transition: all .45s var(--ease); pointer-events: none; }
.tour-card { position: fixed; padding: var(--s4); border-radius: var(--r); background: var(--surface-solid); }
.tour-card h3 { font-size: 1.1rem; margin: 2px 0 6px; }
.tour-step { margin: 0; font-size: .75rem; color: var(--cyan); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.tour-text { margin: 0 0 var(--s3); color: var(--muted); font-size: .92rem; }
.tour-actions { display: flex; justify-content: space-between; gap: var(--s2); }

/* ============================================================ desktop */
@media (min-width: 820px) {
  main { padding: var(--s5) 0 var(--s7); }
  .container { padding: 0 var(--s5); }
  .garment-grid { grid-template-columns: repeat(3, 1fr); gap: var(--s4); }
  .measure-layout { grid-template-columns: minmax(0, 1.2fr) minmax(360px, 1fr); align-items: start; }
  .stage-host { height: min(78vh, 720px); max-height: none; top: 84px; }
  .share-layout { grid-template-columns: minmax(0, 560px) minmax(340px, 1fr); align-items: start; }
  .sheet, .share-panel { margin: 0; }
  .start-row { grid-template-columns: auto 1fr; align-items: center; max-width: 720px; }
  .view-pick { gap: var(--s4); }
}

/* ======================================== mobile: bottom-sheet inputs */
@media (max-width: 819px) {
  .brand-name { font-size: .92rem; }
  .pill-btn span { display: none; }
  .pill-btn { width: 44px; padding: 0; }
  .fields {
    margin: -4px calc(var(--s4) * -1) 0; padding: var(--s3) var(--s4) var(--s4); border-radius: 28px 28px 0 0; border-bottom: 0;
    background: color-mix(in srgb, var(--surface-solid) 94%, transparent); position: relative; z-index: 12;
  }
  .grabber { display: block; width: 44px; height: 5px; border-radius: 3px; background: var(--border); margin: 0 auto var(--s3); }
  .actions { padding: var(--s3) 0 calc(var(--s2) + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--surface-solid) 40%); margin: 0 calc(var(--s4) * -1); padding-left: var(--s4); padding-right: var(--s4); }
  .dlg[open] { place-items: end center; }
  .dlg-inner { width: 100%; border-radius: 28px 28px 0 0; max-height: 88vh; padding-bottom: calc(var(--s5) + env(safe-area-inset-bottom)); }
  .toasts { left: var(--s4); right: var(--s4); width: auto; bottom: calc(80px + env(safe-area-inset-bottom)); }
  .lbl3d { padding: 1px 5px 2px; }
  .lbl3d .n { font-size: 8px; }
  .lbl3d .v { font-size: 11px; }
  .guide-art { height: 240px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .blob { animation: none !important; }
}

/* ================================================== content pages (SEO) */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: var(--s3); top: -100px; z-index: 200; padding: 10px 16px; border-radius: 10px; background: var(--surface-solid); color: var(--text); border: 2px solid var(--cyan); }
.skip:focus { top: var(--s3); }
.main-nav { display: flex; align-items: center; gap: var(--s1); }
.main-nav > a { color: var(--text); text-decoration: none; font-weight: 600; font-size: .95rem; padding: 10px 12px; border-radius: 999px; }
.main-nav > a:hover, .main-nav > a[aria-current="page"] { background: var(--surface-hi); }
.crumbs { margin: var(--s3) 0 0; }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; font-size: .85rem; color: var(--muted); }
.crumbs li + li::before { content: "/"; margin-right: 6px; opacity: .6; }
.crumbs a { color: var(--muted); }
.crumbs [aria-current] { color: var(--text); font-weight: 600; }
.page-hero { text-align: center; padding: var(--s5) 0; max-width: 760px; margin: 0 auto; }
.page-hero.compact { text-align: left; padding: var(--s4) 0 var(--s3); max-width: none; }
.page-hero.compact h1 { font-size: clamp(1.7rem, 5vw, 2.6rem); font-weight: 800; }
.page-hero.compact .lead { margin-left: 0; }
.hero .w { animation: riseIn .8s var(--ease) both; animation-delay: calc(var(--i, 0) * 90ms); }
@keyframes riseIn { from { opacity: 0; transform: translateY(26px); } }
.cta-row { display: flex; flex-wrap: wrap; gap: var(--s3); justify-content: center; margin: var(--s5) 0 0; }
.cta-row .btn { min-height: 52px; }
.section-title { font-size: 1.5rem; font-weight: 800; margin: var(--s6) 0 var(--s4); text-align: center; }
.how .steps { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s3); grid-template-columns: 1fr; }
.steps li { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s4); border-radius: var(--r); background: var(--surface); border: 1px solid var(--border); }
.steps .num { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--grad); color: var(--on-grad); font: 800 .95rem var(--font-head); }
.steps h3 { font-size: 1.05rem; margin: 0 0 4px; }
.steps p { margin: 0; color: var(--muted); font-size: .95rem; }
.tool { margin: var(--s2) 0 var(--s6); }
.prose { max-width: 760px; margin: var(--s6) auto 0; }
.prose h2 { font-size: 1.5rem; font-weight: 800; margin: var(--s6) 0 var(--s3); }
.prose p, .prose li { color: var(--text); line-height: 1.7; }
.prose p { margin: 0 0 var(--s3); }
.prose .small, .small { font-size: .85rem; color: var(--muted); }
.prose-head { display: flex; align-items: center; gap: var(--s3); margin-top: var(--s6); }
.prose-head h2 { margin: 0; }
.gicon.big { width: 64px; height: 64px; flex: none; }
.callouts { display: grid; gap: var(--s3); margin: var(--s4) 0; }
.callout { margin: 0; padding: var(--s3) var(--s4); border-radius: var(--r-sm); background: color-mix(in srgb, var(--violet) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--violet) 35%, var(--border)); }
.table-wrap { overflow-x: auto; border-radius: var(--r-sm); border: 1px solid var(--border); background: var(--surface); }
.mtable { width: 100%; border-collapse: collapse; font-size: .95rem; min-width: 480px; }
.mtable th, .mtable td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.mtable thead th { background: var(--surface-hi); font-weight: 700; }
.mtable tbody th { font-weight: 600; white-space: nowrap; }
.mtable tbody tr:last-child > * { border-bottom: 0; }
.mtable .num { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--muted); }
.checks { padding-left: 1.2em; }
.checks li { margin-bottom: 6px; }
.faq details { margin: 0 0 var(--s2); border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface); }
.faq summary { cursor: pointer; padding: 14px var(--s4); font-weight: 700; min-height: 48px; list-style-position: inside; }
.faq details[open] summary { border-bottom: 1px solid var(--border); }
.faq details p { padding: var(--s3) var(--s4) var(--s2); margin: 0; }
.linklist { padding-left: 1.2em; }
.linklist li { margin-bottom: 8px; }
.guide-list { list-style: none; margin: 0 auto; padding: 0; display: grid; gap: var(--s3); max-width: 900px; }
.guide-item { display: flex; gap: var(--s4); align-items: center; padding: var(--s4); border-radius: var(--r); background: var(--surface); border: 1px solid var(--border); }
.guide-item .gicon { width: 64px; height: 64px; flex: none; }
.guide-item h2 { font-size: 1.15rem; margin: 0 0 4px; }
.guide-item p { margin: 0 0 4px; color: var(--muted); }
.site-footer { border-top: 1px solid var(--border); padding: var(--s6) 0 var(--s5); margin-top: var(--s6); background: color-mix(in srgb, var(--bg) 70%, transparent); }
.foot-grid { display: grid; gap: var(--s5); grid-template-columns: 1fr; }
.foot-title { font: 800 1rem var(--font-head); margin: 0 0 var(--s2); }
.foot-note { color: var(--muted); font-size: .9rem; margin: 0; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: .92rem; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--text); text-decoration: underline; }
.copy { margin-top: var(--s5); color: var(--muted); font-size: .85rem; }
@media (min-width: 820px) {
  .foot-grid { grid-template-columns: 1.4fr 1fr 1fr; }
  .how .steps { grid-template-columns: repeat(3, 1fr); }
  .callouts { grid-template-columns: 1fr 1fr; }
  .page-hero.compact { display: block; }
}
@media (max-width: 560px) {
  .brand-name { display: none; }
  .main-nav > a { padding: 10px 8px; }
}
