/* ═══════════════════════════════════════════════════════════════════════════
   WesternFashion UK — Kiosk Stylesheet
   Target: 10"–13" tablet / kiosk touchscreen, also works on phones
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Design tokens ────────────────────────────────────────────────────────── */
:root {
  --bg        : #f4efe8;          /* warm cream */
  --surface   : #ffffff;
  --surface2  : #f9f6f1;
  --ink       : #181824;
  --ink2      : #3c3c50;
  --muted     : #7a7880;
  --border    : #e2dbd0;

  --navy      : #0f2944;          /* deep navy — primary */
  --navy2     : #1a3f66;
  --royal     : #1a448a;          /* royal blue — accent highlight */
  --gold      : #b8960c;          /* warm gold — accent */
  --gold-bg   : #fef9e7;
  --gold-mid  : #f5d060;
  --emerald   : #165a38;
  --emerald-bg: #e8f5ee;
  --rose      : #8b1a2f;
  --rose-bg   : #fdeaea;
  --amber     : #92400e;
  --amber-bg  : #fef3c7;

  --shadow    : 0 4px 20px rgba(15,41,68,.09);
  --shadow-sm : 0 2px 8px  rgba(15,41,68,.07);
  --radius    : 18px;
  --radius-sm : 12px;
  --radius-xs : 8px;

  --ff-head   : 'Playfair Display', Georgia, serif;
  --ff-body   : 'Inter', system-ui, sans-serif;

  --t-ease    : cubic-bezier(.4,0,.2,1);
}

/* ── Reset ────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%;
  font-family: var(--ff-body);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  overscroll-behavior: none;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; }
input, select { font: inherit; }
img { max-width: 100%; display: block; }

/* ── Screen system ────────────────────────────────────────────────────────── */
#app {
  position : relative;
  height   : 100vh;
  height   : 100dvh;          /* dynamic viewport — fits mobile chrome bars */
  overflow : hidden;
}

.screen {
  display   : none;
  position  : absolute;
  inset     : 0;
  height    : 100%;
  animation : fadeIn .3s var(--t-ease);
}
.screen.active { display: flex; flex-direction: column; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}

/* ── Top bar (shown on inner screens) ────────────────────────────────────── */
.topbar {
  display        : flex;
  align-items    : center;
  gap            : 12px;
  padding        : 16px 20px;
  background     : var(--navy);
  color          : #fff;
  flex-shrink    : 0;
}
.topbar-logo {
  font-family   : var(--ff-head);
  font-size     : 18px;
  font-weight   : 700;
  letter-spacing: .04em;
  color         : #fff;
}
.topbar-sub {
  font-size  : 12px;
  opacity    : .65;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.topbar-back {
  width       : 40px;
  height      : 40px;
  border-radius: 50%;
  background  : rgba(255,255,255,.12);
  display     : flex;
  align-items : center;
  justify-content: center;
  font-size   : 18px;
  color       : #fff;
  flex-shrink : 0;
  transition  : background .15s;
}
.topbar-back:active { background: rgba(255,255,255,.22); }
.topbar-spacer { flex: 1; }
.topbar-step {
  font-size   : 12px;
  opacity     : .6;
  font-weight : 600;
}

/* ── Scroll body ──────────────────────────────────────────────────────────── */
.scroll-body {
  flex      : 1;
  overflow-y: auto;
  padding   : 24px 20px 40px;
  max-width : 680px;
  width     : 100%;
  margin    : 0 auto;
}

/* ── Welcome screen ───────────────────────────────────────────────────────── */
#screen-welcome {
  background: var(--navy);
  justify-content: center;
  align-items: center;
  padding: 40px 24px;
  text-align: center;
  gap: 0;
  overflow-y: auto;
}
.welcome-badge {
  display     : inline-flex;
  align-items : center;
  gap         : 7px;
  background  : rgba(255,255,255,.12);
  color       : rgba(255,255,255,.85);
  font-size   : 12px;
  font-weight : 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding     : 7px 16px;
  border-radius: 999px;
  margin-bottom: 24px;
}
.welcome-greeting {
  font-family : var(--ff-head);
  font-size   : clamp(36px, 7vw, 56px);
  font-weight : 800;
  color       : #fff;
  line-height : 1.15;
  margin-bottom: 12px;
  letter-spacing: -.01em;
}
.welcome-subtitle {
  font-size   : clamp(15px, 2.5vw, 17px);
  color       : rgba(255,255,255,.65);
  max-width   : 380px;
  line-height : 1.6;
  margin-bottom: 40px;
}
.welcome-icon {
  font-size   : 64px;
  margin-bottom: 20px;
  animation   : pulse 3s infinite;
}
.btn-welcome {
  background  : var(--gold);
  color       : var(--navy);
  font-size   : 18px;
  font-weight : 700;
  padding     : 18px 48px;
  border-radius: 999px;
  letter-spacing: .03em;
  box-shadow  : 0 8px 24px rgba(184,150,12,.35);
  transition  : transform .15s, box-shadow .15s;
}
.btn-welcome:active {
  transform   : scale(.97);
  box-shadow  : 0 4px 12px rgba(184,150,12,.25);
}
.welcome-footer {
  margin-top  : 40px;
  font-size   : 12px;
  color       : rgba(255,255,255,.35);
  letter-spacing: .06em;
}

/* ── Section heading ──────────────────────────────────────────────────────── */
.section-head {
  margin-bottom : 8px;
}
.section-head h2 {
  font-family   : var(--ff-head);
  font-size     : clamp(22px, 4vw, 28px);
  font-weight   : 700;
  color         : var(--navy);
  line-height   : 1.25;
}
.section-head p {
  font-size     : 14px;
  color         : var(--muted);
  margin-top    : 6px;
  line-height   : 1.55;
}

/* ── Choice cards (method / sex / garment) ────────────────────────────────── */
.choice-grid {
  display       : grid;
  gap           : 14px;
  margin-top    : 20px;
}
.choice-grid.cols-2 { grid-template-columns: 1fr 1fr; }
.choice-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }

.choice-card {
  background    : var(--surface);
  border        : 2px solid var(--border);
  border-radius : var(--radius);
  padding       : 22px 18px;
  text-align    : center;
  transition    : border-color .15s, box-shadow .15s, transform .1s;
  cursor        : pointer;
  box-shadow    : var(--shadow-sm);
  display       : flex;
  flex-direction: column;
  align-items   : center;
  gap           : 10px;
}
.choice-card:active {
  transform     : scale(.97);
  box-shadow    : none;
}
.choice-card.sel {
  border-color  : var(--navy);
  background    : #eaf0f8;
  box-shadow    : 0 0 0 4px rgba(15,41,68,.08);
}
.choice-card .cc-icon {
  font-size     : 36px;
  line-height   : 1;
}
.choice-card .cc-title {
  font-size     : 15px;
  font-weight   : 700;
  color         : var(--navy);
}
.choice-card .cc-desc {
  font-size     : 12px;
  color         : var(--muted);
  line-height   : 1.45;
}

/* Sex selection - 2 large cards */
.sex-card {
  padding: 30px 20px;
}
.sex-card .cc-icon { font-size: 52px; }
.sex-card .cc-title { font-size: 17px; }

/* Garment grid — tighter */
.garment-grid {
  display       : grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap           : 12px;
  margin-top    : 16px;
}
.garment-card {
  background    : var(--surface);
  border        : 2px solid var(--border);
  border-radius : var(--radius-sm);
  padding       : 16px 12px;
  text-align    : center;
  cursor        : pointer;
  transition    : border-color .15s, box-shadow .1s, transform .1s;
  display       : flex;
  flex-direction: column;
  align-items   : center;
  gap           : 8px;
  box-shadow    : var(--shadow-sm);
}
.garment-card:active   { transform: scale(.96); }
.garment-card.sel      { border-color: var(--navy); background: #eaf0f8; }
.garment-card .gc-icon { font-size: 30px; }
.garment-card .gc-name { font-size: 13px; font-weight: 700; color: var(--navy); }
.garment-card .gc-tag  {
  font-size   : 10px;
  color       : var(--muted);
  background  : var(--surface2);
  padding     : 2px 8px;
  border-radius: 999px;
}
.garment-card.sel .gc-tag {
  background  : rgba(15,41,68,.1);
  color       : var(--navy2);
}

/* Garment season separator */
.garment-season {
  font-size    : 11px;
  font-weight  : 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color        : var(--muted);
  margin-top   : 18px;
  margin-bottom: 6px;
  padding-left : 2px;
}

/* ── Form elements ────────────────────────────────────────────────────────── */
.form-card {
  background    : var(--surface);
  border-radius : var(--radius);
  padding       : 22px 20px;
  margin-bottom : 16px;
  box-shadow    : var(--shadow-sm);
  border        : 1px solid var(--border);
}
.form-card h3 {
  font-size     : 15px;
  font-weight   : 700;
  color         : var(--navy);
  margin-bottom : 14px;
  display       : flex;
  align-items   : center;
  gap           : 8px;
}
.form-row {
  margin-bottom : 14px;
}
.form-row label {
  display       : block;
  font-size     : 13px;
  font-weight   : 600;
  color         : var(--ink2);
  margin-bottom : 5px;
}
.form-row .hint {
  font-size     : 11px;
  color         : var(--muted);
  font-weight   : 400;
  margin-left   : 4px;
}
.input-wrap {
  display       : flex;
  align-items   : center;
  gap           : 8px;
}
.input-wrap input {
  flex          : 1;
  height        : 48px;
  border        : 1.5px solid var(--border);
  border-radius : var(--radius-xs);
  padding       : 0 14px;
  font-size     : 16px;
  color         : var(--ink);
  background    : var(--surface2);
  outline       : none;
  transition    : border-color .15s;
  -webkit-appearance: none;
}
.input-wrap input:focus { border-color: var(--navy2); background: #fff; }
.input-unit {
  font-size     : 13px;
  font-weight   : 600;
  color         : var(--muted);
  min-width     : 30px;
}
.unit-toggle {
  display       : flex;
  gap           : 4px;
  background    : var(--surface2);
  border-radius : var(--radius-xs);
  padding       : 4px;
  margin-bottom : 16px;
}
.unit-btn {
  flex          : 1;
  height        : 34px;
  border-radius : 6px;
  font-size     : 13px;
  font-weight   : 600;
  color         : var(--muted);
  transition    : background .12s, color .12s;
}
.unit-btn.on {
  background    : var(--navy);
  color         : #fff;
}

/* Select input */
select.wf-select {
  width         : 100%;
  height        : 48px;
  border        : 1.5px solid var(--border);
  border-radius : var(--radius-xs);
  padding       : 0 14px;
  font-size     : 16px;
  color         : var(--ink);
  background    : var(--surface2);
  outline       : none;
  appearance    : none;
  cursor        : pointer;
}
select.wf-select:focus { border-color: var(--navy2); }

/* Shape picker (radio buttons as cards) */
.shape-grid {
  display       : grid;
  grid-template-columns: repeat(4,1fr);
  gap           : 8px;
}
.shape-btn {
  border        : 2px solid var(--border);
  border-radius : var(--radius-xs);
  padding       : 10px 6px;
  text-align    : center;
  cursor        : pointer;
  transition    : border-color .12s;
  background    : var(--surface2);
}
.shape-btn.on { border-color: var(--navy2); background: #eaf0f8; }
.shape-btn .sb-icon { font-size: 22px; }
.shape-btn .sb-label { font-size: 11px; font-weight: 700; color: var(--navy); margin-top: 4px; }

/* ── Primary action button ────────────────────────────────────────────────── */
.btn-primary {
  display       : flex;
  align-items   : center;
  justify-content: center;
  gap           : 8px;
  width         : 100%;
  height        : 56px;
  background    : var(--navy);
  color         : #fff;
  border-radius : 999px;
  font-size     : 16px;
  font-weight   : 700;
  letter-spacing: .02em;
  transition    : transform .12s, background .12s;
  box-shadow    : 0 6px 20px rgba(15,41,68,.22);
  margin-top    : 8px;
}
.btn-primary:active  { transform: scale(.97); }
.btn-primary:disabled{ opacity: .45; pointer-events: none; }
.btn-primary.gold    { background: var(--gold); color: var(--navy); }
.btn-secondary {
  display       : flex;
  align-items   : center;
  justify-content: center;
  width         : 100%;
  height        : 48px;
  border        : 2px solid var(--border);
  border-radius : 999px;
  font-size     : 15px;
  font-weight   : 600;
  color         : var(--ink2);
  background    : var(--surface);
  transition    : border-color .12s;
  margin-top    : 8px;
}
.btn-secondary:active { border-color: var(--navy); }

/* ── Camera screen ────────────────────────────────────────────────────────── */
#screen-camera { background: #000; }
#screen-camera .topbar { background: rgba(0,0,0,.7); position: absolute; top: 0; left: 0; right: 0; z-index: 10; }
.cam-wrap {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
#camVideo {
  width: 100%;
  height: 100%;
  object-fit: contain;   /* FIT the whole frame to the device — never larger than screen */
  transform: scaleX(-1); /* mirror for front camera */
}
#camCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;   /* match the live preview framing exactly */
  touch-action: none;
}
#camLiveWrap { background: #0a0f17; }   /* neutral fill behind a letterboxed feed */
.cam-guide {
  position     : absolute;
  inset        : 0;
  pointer-events: none;
  display      : flex;
  align-items  : center;
  justify-content: center;
}
.cam-guide svg { opacity: .6; max-height: 94%; }
.cam-hud {
  position  : absolute;
  bottom    : 0;
  left      : 0;
  right     : 0;
  background: linear-gradient(transparent, rgba(0,0,0,.7));
  padding   : 24px 20px 32px;
  z-index   : 5;
}
.cam-instruction {
  text-align  : center;
  color       : #fff;
  font-size   : 15px;
  font-weight : 600;
  margin-bottom: 16px;
  line-height : 1.5;
}
.cam-btn-row {
  display     : flex;
  gap         : 12px;
  align-items : center;
  justify-content: center;
}
.btn-capture {
  width         : 72px;
  height        : 72px;
  border-radius : 50%;
  background    : #fff;
  border        : 4px solid var(--gold);
  display       : flex;
  align-items   : center;
  justify-content: center;
  font-size     : 28px;
  transition    : transform .1s;
  flex-shrink   : 0;
}
.btn-capture:active { transform: scale(.92); }
.cam-height-row {
  display     : flex;
  align-items : center;
  gap         : 10px;
  background  : rgba(255,255,255,.12);
  border-radius: var(--radius-xs);
  padding     : 10px 14px;
  margin-bottom: 12px;
}
.cam-height-row label { color: #fff; font-size: 13px; font-weight: 600; white-space: nowrap; }
.cam-height-row input {
  flex          : 1;
  background    : rgba(255,255,255,.15);
  border        : 1.5px solid rgba(255,255,255,.3);
  border-radius : 6px;
  color         : #fff;
  font-size     : 16px;
  height        : 38px;
  padding       : 0 12px;
  outline       : none;
}
.cam-height-row input::placeholder { color: rgba(255,255,255,.5); }
.cam-height-row .input-unit { color: rgba(255,255,255,.7); font-size: 13px; font-weight: 600; min-width: 26px; }

/* Marker phase */
.marker-dot {
  position      : absolute;
  width         : 28px;
  height        : 28px;
  border-radius : 50%;
  border        : 3px solid #fff;
  background    : rgba(184,150,12,.85);
  transform     : translate(-50%,-50%);
  cursor        : crosshair;
  z-index       : 8;
  pointer-events: none;
}
.marker-line {
  position      : absolute;
  height        : 2px;
  background    : rgba(184,150,12,.7);
  transform-origin: left center;
  pointer-events: none;
  z-index       : 7;
}
.marker-label {
  position      : absolute;
  color         : var(--gold-mid);
  font-size     : 11px;
  font-weight   : 700;
  background    : rgba(0,0,0,.6);
  padding       : 2px 8px;
  border-radius : 999px;
  white-space   : nowrap;
  pointer-events: none;
  z-index       : 9;
  transform     : translate(14px, -50%);
}

/* ── Results screen ───────────────────────────────────────────────────────── */
.result-card {
  background    : var(--surface);
  border-radius : var(--radius);
  box-shadow    : var(--shadow);
  margin-bottom : 18px;
  overflow      : hidden;
  animation     : slideUp .35s var(--t-ease) both;
  border        : 1px solid var(--border);
}
.result-card:nth-child(2) { animation-delay: .06s; }
.result-card:nth-child(3) { animation-delay: .12s; }
.result-card:nth-child(4) { animation-delay: .18s; }

.rc-header {
  background    : var(--navy);
  padding       : 18px 22px 14px;
  display       : flex;
  align-items   : center;
  gap           : 14px;
}
.rc-label {
  font-size     : 12px;
  font-weight   : 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color         : rgba(255,255,255,.6);
  margin-bottom : 3px;
}
.rc-size {
  font-family   : var(--ff-head);
  font-size     : clamp(28px, 5vw, 38px);
  font-weight   : 800;
  color         : #fff;
  letter-spacing: -.01em;
  line-height   : 1.1;
}
.rc-sublabel {
  font-size     : 13px;
  color         : rgba(255,255,255,.7);
  margin-top    : 2px;
  line-height   : 1.4;
}
.rc-badge {
  margin-left   : auto;
  flex-shrink   : 0;
  width         : 52px;
  height        : 52px;
  border-radius : 50%;
  background    : var(--gold);
  display       : flex;
  align-items   : center;
  justify-content: center;
  font-size     : 24px;
}

/* Size — trouser specific */
.result-card.cat-trouser .rc-header { background: var(--emerald); }
.result-card.cat-leg .rc-header     { background: #2d3a58; }

.rc-body {
  padding       : 16px 22px;
}
.rc-row {
  font-size     : 13px;
  color         : var(--ink2);
  padding       : 7px 0;
  border-bottom : 1px solid var(--border);
  line-height   : 1.5;
}
.rc-row:last-child { border-bottom: none; }
.rc-row strong     { color: var(--ink); font-weight: 700; }

.rc-extra {
  background  : var(--gold-bg);
  border      : 1px solid #f5d060;
  border-radius: var(--radius-xs);
  padding     : 10px 14px;
  font-size   : 13px;
  color       : var(--amber);
  font-weight : 600;
  margin-top  : 10px;
  line-height : 1.5;
}
.rc-extra::before { content: '💡 '; }

/* Tips accordion */
.rc-tips-toggle {
  display       : flex;
  align-items   : center;
  justify-content: space-between;
  padding       : 12px 22px;
  background    : var(--surface2);
  font-size     : 13px;
  font-weight   : 700;
  color         : var(--navy);
  cursor        : pointer;
  border-top    : 1px solid var(--border);
}
.rc-tips-toggle .arrow { transition: transform .2s; font-size: 14px; }
.rc-tips-toggle.open .arrow { transform: rotate(180deg); }
.rc-tips-body {
  display       : none;
  padding       : 14px 22px 16px;
  background    : var(--surface2);
  border-top    : 1px solid var(--border);
}
.rc-tips-body.open { display: block; }
.rc-tip {
  display       : flex;
  gap           : 10px;
  font-size     : 13px;
  color         : var(--ink2);
  line-height   : 1.55;
  margin-bottom : 8px;
}
.rc-tip:last-child { margin-bottom: 0; }
.rc-tip::before    { content: '›'; color: var(--gold); font-weight: 900; font-size: 16px; flex-shrink: 0; }

/* Brand note */
.brand-note {
  background    : var(--amber-bg);
  border-radius : var(--radius-sm);
  padding       : 14px 16px;
  font-size     : 13px;
  color         : var(--amber);
  line-height   : 1.6;
  margin-bottom : 18px;
}
.brand-note strong { font-weight: 700; }

/* Restart bar */
.restart-bar {
  background    : var(--navy);
  padding       : 16px 20px;
  display       : flex;
  gap           : 10px;
}
.btn-restart {
  flex          : 1;
  height        : 48px;
  border-radius : 999px;
  font-size     : 14px;
  font-weight   : 700;
  display       : flex;
  align-items   : center;
  justify-content: center;
  gap           : 6px;
  transition    : opacity .12s;
}
.btn-restart:active { opacity: .8; }
.btn-restart.new    { background: var(--gold); color: var(--navy); }
.btn-restart.more   { background: rgba(255,255,255,.15); color: #fff; }

/* ── Estimated badge ──────────────────────────────────────────────────────── */
.est-banner {
  background    : var(--amber-bg);
  border        : 1px solid #fde68a;
  border-radius : var(--radius-sm);
  padding       : 12px 16px;
  font-size     : 13px;
  color         : var(--amber);
  margin-bottom : 16px;
  font-weight   : 500;
  line-height   : 1.55;
}
.est-banner strong { font-weight: 700; }

/* ── Confidence pill (result screen) ──────────────────────────────────────── */
.conf-pill {
  display       : flex;
  align-items   : center;
  gap           : 12px;
  border-radius : var(--radius-sm);
  padding       : 12px 16px;
  margin-bottom : 16px;
  border        : 1px solid transparent;
}
.conf-pill .conf-ic {
  flex-shrink   : 0;
  width         : 30px;
  height        : 30px;
  border-radius : 50%;
  display       : flex;
  align-items   : center;
  justify-content: center;
  font-size     : 16px;
  font-weight   : 900;
  color         : #fff;
}
.conf-pill .conf-tx        { display: flex; flex-direction: column; line-height: 1.4; }
.conf-pill .conf-tx strong { font-size: 14px; font-weight: 700; }
.conf-pill .conf-tx span   { font-size: 12px; opacity: .85; }

.conf-pill.conf-high        { background: var(--emerald-bg); border-color: #bfe6cf; color: var(--emerald); }
.conf-pill.conf-high .conf-ic { background: var(--emerald); }
.conf-pill.conf-low         { background: var(--amber-bg); border-color: #fde68a; color: var(--amber); }
.conf-pill.conf-low .conf-ic  { background: var(--amber); }

/* ── Progress dots ────────────────────────────────────────────────────────── */
.progress-dots {
  display     : flex;
  gap         : 6px;
  align-items : center;
}
.pd {
  width        : 8px;
  height       : 8px;
  border-radius: 50%;
  background   : rgba(255,255,255,.25);
}
.pd.on { background: var(--gold); width: 20px; border-radius: 4px; }

/* ── Misc utils ───────────────────────────────────────────────────────────── */
.mt8  { margin-top: 8px; }
.mt16 { margin-top: 16px; }
.mt24 { margin-top: 24px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.center { text-align: center; }
.muted  { color: var(--muted); }
.small  { font-size: 13px; }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .choice-grid.cols-3 { grid-template-columns: 1fr; }
  .garment-grid       { grid-template-columns: repeat(auto-fill, minmax(110px,1fr)); }
  .shape-grid         { grid-template-columns: repeat(2,1fr); }
  .scroll-body        { padding: 16px 14px 32px; }
  .rc-size            { font-size: 30px; }
}
@media (min-width: 769px) {
  .scroll-body { padding: 40px 32px 64px; max-width: 760px; }
  .choice-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
  .garment-grid { grid-template-columns: repeat(auto-fill, minmax(180px,1fr)); }
}

/* ── Tablet / iPad — scale up the whole UI to fill the screen ─────────────── */
@media (min-width: 820px) {
  .topbar           { padding: 22px 30px; }
  .topbar-logo      { font-size: 24px; }
  .topbar-sub       { font-size: 14px; }
  .topbar-back      { width: 50px; height: 50px; font-size: 24px; }

  .section-head h2  { font-size: 30px; }
  .section-head p   { font-size: 17px; }

  /* Method screen — center the cards and make them large & tappable */
  #screen-method .scroll-body,
  #screen-sex .scroll-body { display: flex; flex-direction: column; justify-content: center; }
  .method-grid      { gap: 20px; max-width: 640px; margin: 0 auto; }
  .method-card      { padding: 30px 28px; border-radius: 24px; gap: 24px; }
  .method-card:hover{ transform: translateY(-2px); }
  .mc-icon          { font-size: 56px; }
  .mc-title         { font-size: 24px; }
  .mc-badge         { font-size: 12px; padding: 3px 11px; }
  .mc-desc          { font-size: 16px; margin-top: 6px; }
  .mc-arrow         { font-size: 30px; }

  /* Sex chooser bigger */
  .choice-grid.cols-2 { gap: 22px; max-width: 620px; margin: 22px auto 0; }
  .sex-card         { padding: 40px 24px; border-radius: 24px; }
  .cc-icon          { font-size: 64px; }
  .cc-title         { font-size: 26px; }
  .cc-desc          { font-size: 16px; }

  /* Body-stats rows bigger */
  .btn-voice-start  { padding: 22px 44px; font-size: 22px; }
  .btn-voice-start .mic-icon { font-size: 36px; }
  .bs-row-inner     { padding: 20px 22px; }
  .bs-icon          { font-size: 34px; width: 46px; }
  .bs-label         { font-size: 19px; }
  .bs-input         { width: 110px; font-size: 22px; padding: 12px 14px; }
  .bs-mic           { width: 50px; height: 50px; font-size: 22px; }

  /* Garment cards bigger */
  .garment-grid     { grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); gap: 16px; }
  .gc-icon          { font-size: 48px; }
  .gc-name          { font-size: 17px; }

  /* Primary buttons */
  .btn-primary, .btn-welcome { font-size: 20px; padding: 20px; }
}

/* Large landscape kiosk (≥1100px) — center content column */
@media (min-width: 1100px) {
  .method-grid, .choice-grid.cols-2 { max-width: 720px; }
  .section-head h2  { font-size: 34px; }
}

/* ── Scan phase chip (front / side) ───────────────────────────────────────── */
.scan-phase-chip {
  position      : absolute;
  top           : 20px;
  left          : 50%;
  transform     : translateX(-50%);
  z-index       : 14;
  background    : linear-gradient(135deg, var(--royal), #2a5fb0);
  color         : #fff;
  font-size     : 14px;
  font-weight   : 800;
  letter-spacing: .03em;
  padding       : 8px 20px;
  border-radius : 999px;
  box-shadow    : 0 4px 16px rgba(0,0,0,.35);
  pointer-events: none;
}

/* ── Position hint pill ───────────────────────────────────────────────────── */
.pos-hint-wrap {
  position    : absolute;
  top         : 70px;
  left        : 0; right: 0;
  display     : flex;
  justify-content: center;
  z-index     : 12;
  pointer-events: none;
  padding     : 0 16px;
}
.pos-hint {
  padding       : 9px 20px;
  border-radius : 999px;
  font-size     : 14px;
  font-weight   : 700;
  line-height   : 1;
  max-width     : 88vw;
  text-align    : center;
  transition    : background .25s, color .25s;
  backdrop-filter: blur(6px);
}
.pos-hint.neutral { background: rgba(0,0,0,.55);       color: rgba(255,255,255,.85); }
.pos-hint.ok      { background: rgba(22,100,56,.88);    color: #ffffff; }
.pos-hint.warn    { background: rgba(184,150,12,.88);   color: #1a1a2e; }
.pos-hint.bad     { background: rgba(139,26,47,.88);    color: #ffffff; }

/* ── Countdown overlay ────────────────────────────────────────────────────── */
.countdown-overlay {
  position       : absolute;
  inset          : 0;
  display        : flex;
  flex-direction : column;
  align-items    : center;
  justify-content: center;
  background     : rgba(0,0,0,.42);
  z-index        : 25;
  gap            : 0;
}
.countdown-num {
  font-family  : var(--ff-head);
  font-size    : clamp(120px, 28vw, 220px);
  font-weight  : 800;
  color        : #ffffff;
  line-height  : 1;
  text-shadow  : 0 0 80px rgba(184,150,12,.8), 0 8px 32px rgba(0,0,0,.6);
  animation    : countPop .85s var(--t-ease);
}
.countdown-label {
  font-size    : 20px;
  font-weight  : 700;
  color        : rgba(255,255,255,.9);
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-top   : 8px;
  text-shadow  : 0 2px 8px rgba(0,0,0,.5);
}
@keyframes countPop {
  0%   { transform: scale(2.2);  opacity: 0; }
  25%  { transform: scale(1.05); opacity: 1; }
  85%  { transform: scale(1);    opacity: 1; }
  100% { transform: scale(.75);  opacity: 0; }
}

/* Countdown progress ring (SVG injected by JS) */
.countdown-ring {
  position     : absolute;
  inset        : 0;
  pointer-events: none;
}
.countdown-ring svg circle.track {
  fill         : none;
  stroke       : rgba(255,255,255,.15);
  stroke-width : 6;
}
.countdown-ring svg circle.progress {
  fill         : none;
  stroke       : var(--gold);
  stroke-width : 6;
  stroke-linecap: round;
  transition   : stroke-dashoffset 1s linear;
}

/* Camera flash on snap */
.cam-flash {
  position     : absolute;
  inset        : 0;
  background   : #fff;
  opacity      : 0;
  pointer-events: none;
  z-index      : 30;
  transition   : opacity .05s;
}
.cam-flash.on { opacity: 1; }

/* Marker legend strip */
.legend-dot {
  display      : flex;
  align-items  : center;
  gap          : 5px;
  font-size    : 11px;
  font-weight  : 700;
  color        : #fff;
  white-space  : nowrap;
}
.legend-dot span {
  width        : 12px;
  height       : 12px;
  border-radius: 50%;
  display      : inline-block;
  flex-shrink  : 0;
  border       : 2px solid rgba(255,255,255,.5);
}
.legend-dot.done { opacity: .5; }
.legend-dot.active { opacity: 1; }
.legend-dot.active span { box-shadow: 0 0 0 3px rgba(255,255,255,.35); }

/* ══════════════════════════════════════════════════════════════════════════
 *  METHOD CARDS  (Camera Scan highlighted)
 * ══════════════════════════════════════════════════════════════════════════ */
.method-grid {
  display       : flex;
  flex-direction: column;
  gap           : 12px;
  padding-bottom: 24px;
}
.method-card {
  display        : flex;
  align-items    : center;
  gap            : 16px;
  background     : #fff;
  border         : 2px solid #e8e2d8;
  border-radius  : 18px;
  padding        : 18px 16px;
  width          : 100%;
  text-align     : left;
  cursor         : pointer;
  transition     : border-color .2s, box-shadow .2s, transform .15s;
}
.method-card:active { transform: scale(.98); }
.method-card.highlight {
  border-color   : var(--royal);
  background     : linear-gradient(135deg,#eef3ff 0%,#fff 100%);
  box-shadow     : 0 4px 16px rgba(26,68,138,.12);
}
.mc-icon {
  font-size      : 36px;
  flex-shrink    : 0;
  line-height    : 1;
}
.mc-body { flex: 1; }
.mc-title {
  font-size      : 17px;
  font-weight    : 700;
  color          : var(--navy);
  display        : flex;
  align-items    : center;
  gap            : 8px;
}
.mc-badge {
  font-size      : 10px;
  font-weight    : 700;
  background     : var(--royal);
  color          : #fff;
  border-radius  : 999px;
  padding        : 2px 8px;
  letter-spacing : .04em;
  text-transform : uppercase;
}
/* Accuracy signalling — one badge per method */
.mc-badge.rec  { background: #1f9d55; }               /* Recommended — green */
.mc-badge.best { background: var(--navy); }           /* Most accurate — navy */
.mc-badge.soft { background: #e6e8ec; color: var(--ink2); } /* Quick estimate — muted grey */
.mc-desc {
  font-size      : 13px;
  color          : var(--ink2);
  margin-top     : 3px;
  line-height    : 1.5;
}
.mc-arrow {
  font-size      : 22px;
  color          : #bbb;
  flex-shrink    : 0;
}

/* ══════════════════════════════════════════════════════════════════════════
 *  BODY STATS — Voice UI
 * ══════════════════════════════════════════════════════════════════════════ */
.voice-hero {
  display        : flex;
  flex-direction : column;
  align-items    : center;
  padding        : 24px 0 20px;
  gap            : 12px;
}

.btn-voice-start {
  display        : flex;
  align-items    : center;
  gap            : 12px;
  background     : var(--navy);
  color          : #fff;
  border         : none;
  border-radius  : 999px;
  padding        : 16px 32px;
  font-size      : 18px;
  font-weight    : 700;
  cursor         : pointer;
  transition     : background .2s, transform .15s, box-shadow .2s;
  box-shadow     : 0 4px 20px rgba(15,41,68,.28);
}
.btn-voice-start .mic-icon { font-size: 28px; line-height:1; }
.btn-voice-start:active    { transform: scale(.96); }
.btn-voice-start.busy      { background: var(--royal); }
.btn-voice-start.done      { background: #1a6641; }
.btn-voice-start:disabled  { opacity: .75; cursor: default; }

.voice-status {
  display        : inline-flex;
  align-items    : center;
  gap            : 6px;
  background     : rgba(15,41,68,.08);
  border-radius  : 999px;
  padding        : 6px 16px;
  font-size      : 14px;
  font-weight    : 600;
  color          : var(--navy);
}
.voice-status.listening { background: rgba(26,68,138,.12); color: var(--royal); animation: pulse 1.1s infinite; }
.voice-status.ok        { background: rgba(26,100,65,.12); color: #1a6641; }
.voice-status.warn      { background: rgba(184,150,12,.16); color: #8a6d00; }

.voice-hint {
  font-size      : 13px;
  color          : var(--muted);
  text-align     : center;
  max-width      : 280px;
  line-height    : 1.6;
  margin         : 0;
}

/* ── 3 input rows ─────────────────────────────────────────────────────── */
.bs-fields {
  display        : flex;
  flex-direction : column;
  gap            : 10px;
  margin-bottom  : 20px;
}
.bs-row {
  background     : #fff;
  border         : 2px solid #e8e2d8;
  border-radius  : 16px;
  overflow       : hidden;
  transition     : border-color .2s, box-shadow .2s;
}
.bs-row.active {
  border-color   : var(--royal);
  box-shadow     : 0 0 0 4px rgba(26,68,138,.1);
}
.bs-row.filled {
  border-color   : #1a6641;
  background     : #f5fbf7;
}
.bs-row-inner {
  display        : flex;
  align-items    : center;
  gap            : 12px;
  padding        : 14px 16px;
}
.bs-icon {
  font-size      : 26px;
  flex-shrink    : 0;
  width          : 36px;
  text-align     : center;
}
.bs-label-wrap { flex: 1; min-width: 0; }
.bs-label      { font-size: 15px; font-weight: 700; color: var(--navy); }
.bs-val        { font-size: 13px; color: #1a6641; font-weight: 600; min-height: 18px; }
.bs-input {
  width          : 80px;
  border         : 1.5px solid #d0c8bc;
  border-radius  : 10px;
  padding        : 8px 10px;
  font-size      : 16px;
  font-weight    : 600;
  color          : var(--navy);
  text-align     : right;
  -moz-appearance: textfield;
  flex-shrink    : 0;
}
.bs-input::-webkit-outer-spin-button,
.bs-input::-webkit-inner-spin-button { -webkit-appearance: none; }
.bs-unit {
  font-size      : 13px;
  font-weight    : 600;
  color          : var(--muted);
  white-space    : nowrap;
  flex-shrink    : 0;
}
.bs-mic {
  background     : none;
  border         : 1.5px solid #e0d8cc;
  border-radius  : 50%;
  width          : 38px;
  height         : 38px;
  font-size      : 16px;
  cursor         : pointer;
  flex-shrink    : 0;
  transition     : background .15s;
}
.bs-mic:active  { background: #eef3ff; }

/* ── Weight mic on the 3D-scan review panel ───────────────────────────────── */
.crc-mic {
  background     : rgba(255,255,255,.15);
  border         : 1.5px solid rgba(255,255,255,.35);
  border-radius  : 50%;
  width          : 40px;
  height         : 40px;
  font-size      : 18px;
  cursor         : pointer;
  flex-shrink    : 0;
  color          : #fff;
  transition     : background .15s, transform .1s;
}
.crc-mic:active    { transform: scale(.92); }
.crc-mic.listening {
  background : #d64545;
  border-color: #ff8a7a;
  animation  : crcMicPulse 1s ease-in-out infinite;
}
@keyframes crcMicPulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(214,69,69,.55); }
  50%     { box-shadow: 0 0 0 8px rgba(214,69,69,0); }
}

/* ── Body build selector ──────────────────────────────────────────────── */
.build-block { margin-bottom: 18px; }
.build-title {
  font-size  : 15px;
  font-weight: 700;
  color      : var(--navy);
  margin-bottom: 10px;
}
.build-title span { font-weight: 500; font-size: 13px; color: var(--muted); }
.build-grid {
  display              : grid;
  grid-template-columns: repeat(4, 1fr);
  gap                  : 8px;
}
.build-btn {
  display       : flex;
  flex-direction: column;
  align-items   : center;
  gap           : 4px;
  padding       : 12px 6px;
  background    : #fff;
  border        : 2px solid #e8e2d8;
  border-radius : 14px;
  cursor        : pointer;
  transition    : border-color .15s, background .15s, transform .12s;
}
.build-btn:active { transform: scale(.96); }
.build-btn.on {
  border-color : var(--royal);
  background   : #eef3ff;
  box-shadow   : 0 0 0 3px rgba(26,68,138,.1);
}
.bb-ico { font-size: 26px; line-height: 1; }
.bb-lbl { font-size: 12px; font-weight: 700; color: var(--navy); text-align: center; }

@media (min-width: 820px) {
  .build-btn { padding: 18px 8px; border-radius: 18px; }
  .bb-ico    { font-size: 36px; }
  .bb-lbl    { font-size: 15px; }
  .build-title { font-size: 18px; }
}

/* ── Auto-submit progress bar ─────────────────────────────────────────── */
.bs-auto-panel {
  background     : linear-gradient(135deg,#1a6641,#2a8e57);
  border-radius  : 14px;
  padding        : 16px 18px;
  color          : #fff;
  font-size      : 14px;
  font-weight    : 600;
  margin-bottom  : 16px;
  display        : flex;
  flex-direction : column;
  gap            : 10px;
}
.bs-auto-track {
  height         : 6px;
  background     : rgba(255,255,255,.25);
  border-radius  : 999px;
  overflow       : hidden;
}
.bs-auto-fill {
  height         : 100%;
  background     : #fff;
  border-radius  : 999px;
  width          : 0;
  transition     : width 1.8s linear;
}

/* ══════════════════════════════════════════════════════════════════════════
 *  CAMERA — Scanning spinner + review card
 * ══════════════════════════════════════════════════════════════════════════ */
.scan-spinner {
  width          : 64px;
  height         : 64px;
  border         : 5px solid rgba(255,255,255,.2);
  border-top     : 5px solid var(--gold);
  border-radius  : 50%;
  animation      : spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Camera measurement review card */
.cam-review-card {
  background     : rgba(10,20,40,.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top     : 1px solid rgba(255,255,255,.12);
  border-radius  : 24px 24px 0 0;
  padding        : 22px 20px 36px;
  color          : #fff;
}
.crc-head {
  display        : flex;
  align-items    : center;
  gap            : 14px;
  margin-bottom  : 18px;
}
.crc-icon   { font-size: 32px; }
.crc-title  { font-size: 18px; font-weight: 800; color: #fff; }
.crc-note   { font-size: 13px; color: rgba(255,255,255,.65); margin-top: 3px; }

.crc-table  { display: flex; flex-direction: column; gap: 0; margin-bottom: 20px; }
.cr-row {
  display        : flex;
  justify-content: space-between;
  align-items    : center;
  padding        : 10px 0;
  border-bottom  : 1px solid rgba(255,255,255,.09);
}
.cr-row:last-child { border-bottom: none; }
.cr-lbl { font-size: 14px; color: rgba(255,255,255,.65); font-weight: 500; }
.cr-val { font-size: 15px; font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; }

.crc-actions {
  display        : flex;
  gap            : 12px;
}
.crc-retake {
  flex           : none;
  width          : auto;
  height         : 48px;
  padding        : 0 22px;
  font-size      : 15px;
  background     : rgba(255,255,255,.1);
  border         : 1.5px solid rgba(255,255,255,.2);
  color          : #fff;
  border-radius  : 12px;
  cursor         : pointer;
  font-weight    : 600;
}
.crc-confirm {
  flex           : 1;
  height         : 48px;
  font-size      : 16px;
  border-radius  : 12px;
}

/* ── Print — results only ─────────────────────────────────────────────────── */
@media print {
  body { background: #fff; }
  .topbar, .restart-bar { display: none; }
  .result-card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
  .rc-tips-body { display: block !important; }
}

/* ── Brand size comparison strip ("Your size at…", backend-controlled) ────── */
.brsz-card {
  background    : var(--surface);
  border        : 2px solid var(--border);
  border-radius : 16px;
  padding       : 16px;
  margin-top    : 14px;
}
.brsz-title { font-weight: 800; font-size: 15px; color: var(--navy); }
.brsz-note  { font-size: 12px; color: var(--ink2); margin: 2px 0 10px; }
.brsz-grid  {
  display               : grid;
  grid-template-columns : repeat(auto-fill, minmax(150px, 1fr));
  gap                   : 8px;
}
.brsz-chip {
  display         : flex;
  justify-content : space-between;
  align-items     : center;
  gap             : 8px;
  background      : #eaf0f8;
  border-radius   : 10px;
  padding         : 9px 12px;
}
.brsz-name { font-size: 13px; font-weight: 600; color: var(--ink2); }
.brsz-size { font-size: 14px; font-weight: 800; color: var(--navy); white-space: nowrap; }
