:root {
  --bfm-base: #0b0b0c;
  --bfm-surface-1: #141416;
  --bfm-surface-2: #1a1a1d;
  --bfm-text-dark: #ededee;
  --bfm-text-dark-2: #98989d;
  --bfm-text-dark-3: #5c5c60;
  --bfm-paper: #fafafa;
  --bfm-white: #fff;
  --bfm-ink: #141416;
  --bfm-ink-2: #5c5c60;
  --bfm-ink-3: #8b8b8f;
  --bfm-type-a: #a0e23b;
  --bfm-type-b: #3b77ff;
  --bfm-type-c: #fd8733;
  --bfm-hairline: rgba(20, 20, 22, .1);
  --bfm-safe-bottom: env(safe-area-inset-bottom, 0px);
  --sans: 'Pretendard Variable', 'Pretendard', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', sans-serif;
}

* { box-sizing: border-box; }

html,
body {
  margin: 0;
  min-height: 100%;
  background: #e7e7e7;
  color: var(--bfm-ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.58;
  letter-spacing: -.01em;
  word-break: keep-all;
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea,
select { font: inherit; }

button { -webkit-tap-highlight-color: transparent; }

.flow-app {
  position: relative;
  width: min(100%, 375px);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  background: var(--bfm-white);
}

.top {
  position: relative;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 52px;
  padding: 0 16px;
  background: var(--bfm-white);
  color: var(--bfm-ink);
}

.top .step {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
}

.top .flow-back {
  position: absolute;
  left: 12px;
  display: none;
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 22px;
  cursor: pointer;
}

.top .flow-logo {
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.03em;
}

.wrap {
  width: 100%;
  max-width: none;
  min-height: calc(100vh - 76px);
  min-height: calc(100dvh - 76px);
  margin: 0;
  padding: 0;
  background: var(--bfm-white);
}

.screen {
  display: none;
  min-height: calc(100vh - 76px);
  min-height: calc(100dvh - 76px);
  padding: 0 16px calc(16px + var(--bfm-safe-bottom));
  background: var(--bfm-white);
  color: var(--bfm-ink);
}

.screen.on { display: flex; flex-direction: column; }
.grow { min-height: 0; overflow-y: auto; }

.eyebrow,
.qsec {
  color: var(--bfm-ink);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0;
  text-transform: none;
}

h1,
.q,
.retake h2 {
  color: var(--bfm-ink);
  font-family: var(--sans);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.38;
  letter-spacing: -.015em;
}

.sub {
  color: var(--bfm-ink-2);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.6;
}

.note {
  color: var(--bfm-ink-3);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
  text-align: center;
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  padding: 14px 18px;
  border: 1px solid var(--bfm-surface-1);
  border-radius: 12px;
  background: var(--bfm-surface-1);
  box-shadow: none;
  color: var(--bfm-white);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
  cursor: pointer;
}

.btn:active:not(:disabled) { transform: scale(.99); }
.btn:disabled { opacity: .35; }

.btn.ghost {
  border-color: var(--bfm-hairline);
  background: var(--bfm-white);
  color: var(--bfm-ink);
}

.btn.sm { min-height: 51px; padding: 13px 18px; font-size: 16px; }

.linkbtn {
  width: 100%;
  padding: 8px;
  border: 0;
  background: transparent;
  color: var(--bfm-ink-2);
  font-size: 12px;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
}

.foot {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 12px;
  background: inherit;
}

/* Intro / designer frame 01 */
#s-intro { padding-top: 20px; }
#s-intro .grow { overflow: visible; }
#s-intro .intro-kicker { margin: 0 0 18px; color: var(--bfm-ink-2); font-size: 11px; font-weight: 500; }
#s-intro h1 { margin: 0; }
#s-intro .intro-copy { margin: 12px 0 0; color: var(--bfm-ink-2); font-size: 14px; line-height: 1.6; }

.guides {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 28px;
}

.guides .g {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  align-items: start;
  color: var(--bfm-ink);
  font-size: 12px;
  line-height: 1.5;
}

.guides .g .c {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 50%;
  background: var(--bfm-surface-1);
  color: var(--bfm-white);
  font-size: 10px;
  font-weight: 700;
}

.privacy {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 24px;
  padding: 12px;
  border: 1px solid var(--bfm-hairline);
  border-radius: 8px;
  background: var(--bfm-paper);
}

.privacy .i {
  display: grid;
  flex: none;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--bfm-ink);
  font-size: 11px;
}

.privacy b { display: block; color: var(--bfm-ink); font-size: 12px; font-weight: 700; }
.privacy p { margin: 2px 0 0; color: var(--bfm-ink-2); font-size: 11px; line-height: 1.48; }

.inapp,
.err {
  display: none;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(253, 135, 51, .45);
  border-radius: 8px;
  background: rgba(253, 135, 51, .07);
  color: #c65b11;
  font-size: 11px;
  line-height: 1.5;
}

.inapp.on,
.err.on { display: block; }

/* Consent extension, styled from the same designer tokens */
#s-prep { padding-top: 16px; }
.consent-intro { margin: 8px 0 0; color: var(--bfm-ink-2); font-size: 14px; }
.consent-list { display: flex; flex-direction: column; gap: 8px; margin-top: 22px; }
.consent-item {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  align-items: start;
  padding: 13px 12px;
  border: 1px solid var(--bfm-hairline);
  border-radius: 8px;
  background: var(--bfm-paper);
  cursor: pointer;
}
.consent-item input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--bfm-surface-1); }
.consent-item strong { display: block; font-size: 13px; font-weight: 700; }
.consent-item span { display: block; margin-top: 2px; color: var(--bfm-ink-2); font-size: 11px; line-height: 1.5; }
.pilot-code { display: block; margin-top: 14px; }
.pilot-code > span { display: block; margin-bottom: 7px; color: var(--bfm-ink); font-size: 12px; font-weight: 700; }
.pilot-code input { width: 100%; min-height: 48px; padding: 0 12px; border: 1px solid var(--bfm-hairline); border-radius: 12px; outline: 0; background: var(--bfm-white); color: var(--bfm-ink); font: 500 14px/1 var(--sans); }
.pilot-code input:focus { border-color: var(--bfm-ink); }
.pilot-code input::placeholder { color: var(--bfm-ink-3); font-size: 12px; }
.consent-summary { margin-top: 12px; color: var(--bfm-ink-3); font-size: 11px; line-height: 1.55; }
.consent-summary a, .privacy-notice a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.privacy-notice { margin-top: 12px; border: 1px solid var(--bfm-hairline); border-radius: 12px; background: var(--bfm-white); color: var(--bfm-ink-2); font-size: 11px; line-height: 1.55; }
.privacy-notice summary { cursor: pointer; padding: 12px 14px; color: var(--bfm-ink); font-size: 12px; font-weight: 700; }
.privacy-notice dl { margin: 0; padding: 0 14px 14px; }
.privacy-notice dl div { padding: 9px 0; border-top: 1px solid var(--bfm-hairline); }
.privacy-notice dt { color: var(--bfm-ink); font-weight: 700; margin-bottom: 3px; }
.privacy-notice dd { margin: 0; color: var(--bfm-ink-2); }
.participant-badge { display: none; margin-top: 12px; padding: 10px 12px; border-radius: 8px; background: var(--bfm-paper); font-size: 11px; }
.participant-badge.on { display: flex; justify-content: space-between; gap: 10px; }
.participant-badge code { color: var(--bfm-type-b); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-weight: 700; }

/* Camera / designer frames 03-05 */
body:has(#s-cam.on),
body:has(#s-video.on) { background: var(--bfm-base); }

.flow-app:has(#s-cam.on),
.flow-app:has(#s-video.on),
.flow-app:has(#s-cam.on) .wrap,
.flow-app:has(#s-video.on) .wrap,
.flow-app:has(#s-cam.on) .top,
.flow-app:has(#s-video.on) .top {
  background: var(--bfm-base);
  color: var(--bfm-white);
}

#s-cam,
#s-video {
  position: relative;
  min-height: calc(100vh - 76px);
  min-height: calc(100dvh - 76px);
  padding: 0;
  background: var(--bfm-base);
  color: var(--bfm-white);
}

.cam,
.video-capture-stage {
  position: relative;
  flex: 1;
  min-height: 430px;
  margin: 12px 16px 0;
  overflow: hidden;
  border: 0;
  border-radius: 14px;
  background: #050506;
  box-shadow: none;
}

.cam video,
.video-capture-stage video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

.oval,
.video-face-guide { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.oval svg { width: 74%; max-width: 300px; height: auto; transform-origin: center; will-change: transform; }
.oval text { paint-order: stroke; stroke: rgba(8, 9, 11, .8); stroke-width: 3.5px; stroke-linejoin: round; }

.coach { position: absolute; z-index: 4; top: 12px; right: 0; left: 0; bottom: auto; display: flex; justify-content: center; }
.coach .pill {
  display: flex;
  align-items: center;
  gap: 7px;
  max-width: calc(100% - 24px);
  padding: 6px 12px;
  border: 1px solid rgba(160, 227, 59, .75);
  border-radius: 99px;
  background: rgba(11, 11, 12, .78);
  color: var(--bfm-white);
  font-size: 10px;
  font-weight: 700;
  backdrop-filter: blur(6px);
}
.coach .pill .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--bfm-type-a); }
.coach .pill.ready { border-color: rgba(160, 227, 59, .75); color: var(--bfm-white); }
.coach .pill.ready .dot { background: var(--bfm-type-a); }

#s-cam .foot,
#s-video .foot { gap: 2px; padding: 18px 16px 8px; background: var(--bfm-base); }
#s-cam .btn,
#s-video .btn { border-color: #171719; background: #171719; color: #fff; }
#s-cam .linkbtn,
#s-video .linkbtn { color: #fff; }
.camera-site-mark { padding: 12px 0 calc(12px + var(--bfm-safe-bottom)); background: #141416; color: #fff; font-size: 10px; font-weight: 700; text-align: center; }

.video-face-guide::before {
  content: '';
  width: 58%;
  aspect-ratio: .76;
  border: 2px dashed rgba(255, 255, 255, .9);
  border-radius: 50%;
}
.video-countdown { position: absolute; z-index: 4; right: 0; bottom: 24px; left: 0; color: #fff; font-size: 48px; font-weight: 700; text-align: center; text-shadow: 0 2px 16px #000; }
.video-caption { position: absolute; z-index: 4; top: 14px; right: 14px; left: 14px; color: #fff; font-size: 11px; font-weight: 700; text-align: center; }
.video-quality { position: absolute; z-index: 4; right: 12px; bottom: 12px; left: 12px; display: flex; justify-content: center; }
.video-quality span { padding: 6px 10px; border: 1px solid rgba(160,226,59,.75); border-radius: 99px; background: rgba(11,11,12,.78); color: #fff; font-size: 10px; font-weight: 700; backdrop-filter: blur(6px); }
.record-progress { height: 3px; margin: 8px 16px 0; overflow: hidden; border-radius: 99px; background: rgba(255,255,255,.16); }
.record-progress > i { display: block; width: 0; height: 100%; background: var(--bfm-type-a); transition: width .18s linear; }

/* Analysis */
#s-scan,
#s-idx,
#s-upload { padding-top: 14px; }
.scanwrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 16px;
  overflow: hidden;
  border-radius: 8px;
  background: var(--bfm-paper);
}
.scanwrap canvas { display: block; width: 100%; height: auto; }
.scanstat {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 12px;
  background: linear-gradient(0deg, rgba(11,11,12,.78), transparent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}
.scanstat .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--bfm-type-a); }
.sigchips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.sigchip { display: flex; align-items: center; gap: 6px; padding: 7px 9px; border: 1px solid var(--bfm-hairline); border-radius: 99px; background: var(--bfm-white); color: var(--bfm-ink-2); font-size: 10px; font-weight: 500; }
.sigchip .d { width: 5px; height: 5px; border-radius: 50%; }

.upload-state { display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.upload-ring { width: 46px; height: 46px; margin-bottom: 20px; border: 4px solid var(--bfm-hairline); border-top-color: var(--bfm-ink); border-radius: 50%; animation: bfm-spin 1s linear infinite; }
@keyframes bfm-spin { to { transform: rotate(360deg); } }
.upload-state p { margin: 10px 0 0; color: var(--bfm-ink-2); font-size: 12px; }
.upload-progress { width: 100%; height: 4px; margin-top: 20px; overflow: hidden; border-radius: 99px; background: var(--bfm-hairline); }
.upload-progress i { display: block; width: 0; height: 100%; background: var(--bfm-ink); transition: width .25s ease; }

/* Retake */
.retake { display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; }
.retake .ic { display: grid; place-items: center; width: 56px; height: 56px; border: 1px solid var(--bfm-hairline); border-radius: 16px; background: var(--bfm-paper); font-size: 24px; }
.retake h2 { margin: 0; }
.retake p { max-width: 290px; margin: 0; color: var(--bfm-ink-2); font-size: 14px; }

/* Survey / designer frames 06-14 */
#s-survey { padding-top: 10px; }
#s-survey .survey-head { flex: none; }
.survey-meta { display: flex; justify-content: space-between; color: var(--bfm-ink-2); font-size: 11px; font-weight: 500; }
.prog { height: 2px; margin-top: 10px; overflow: hidden; border-radius: 0; background: var(--bfm-hairline); }
.prog .fl { height: 100%; background: var(--bfm-ink); transition: width .25s ease; }
#s-survey .grow { display: block; padding-top: 30px; }
.q { margin: 8px 0 0; }
.prime { display: none; margin-top: 12px; padding: 10px 12px; border: 1px solid var(--bfm-hairline); border-radius: 8px; background: var(--bfm-paper); color: var(--bfm-ink-2); font-size: 11px; }
.prime.on { display: flex; gap: 8px; }
.opts { display: flex; flex-direction: column; gap: 8px; margin-top: 24px; }
.opt {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--bfm-paper);
  color: var(--bfm-ink);
  font-size: 12px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}
.opt .rd { position: relative; flex: none; width: 15px; height: 15px; border: 1px solid var(--bfm-ink-3); border-radius: 50%; }
.opt.sel { border-color: var(--bfm-ink); background: var(--bfm-white); }
.opt.sel .rd { border: 4px solid var(--bfm-ink); }
.opt.sel .rd::after { display: none; }
.srow { display: grid; flex: none; grid-template-columns: 48px 1fr; gap: 8px; padding-top: 12px; }
.srow .btn { min-height: 44px; }
.srow .btn.ghost { width: 48px; padding: 8px; font-size: 11px; }

/* Result / designer frame 15 */
#s-result { min-height: auto; padding-top: 14px; }
#s-result .grow { overflow: visible; }
#resultHeading { margin: 8px 0 22px; }
.result-summary { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 12px; font-weight: 700; }
.result-summary::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--bfm-ink); }
.rep { margin-top: 10px; padding: 12px; border: 1px solid var(--bfm-hairline); border-radius: 12px; background: var(--bfm-white); }
.rep .h { display: flex; align-items: center; justify-content: space-between; }
.rep .h .t { color: var(--bfm-ink-2); font-size: 10px; font-weight: 500; }
.flag { display: inline-block; margin: 0 0 10px; color: var(--bfm-ink); font-size: 12px; font-weight: 700; }
.bar { margin-top: 14px; }
.bar .bt { display: flex; justify-content: space-between; margin-bottom: 7px; color: var(--bfm-ink); font-size: 11px; }
.bar .bt b { color: var(--bfm-ink); font-size: 12px; font-weight: 700; }
.bar .tr { height: 4px; overflow: hidden; border-radius: 99px; background: var(--bfm-hairline); }
.bar .fl { height: 100%; border-radius: 99px; background: var(--bfm-ink); transition: width .8s ease; }
.bar:nth-of-type(3) .fl { background: var(--bfm-type-a); }
.bar:nth-of-type(4) .fl { background: var(--bfm-type-c); }
.reason { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--bfm-hairline); color: var(--bfm-ink-2); font-size: 11px; text-align: center; }
.usedphoto { display: none; }
.rgthumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 18px; }
.rgthumbs .th { position: relative; overflow: hidden; aspect-ratio: .78; border: 0; border-radius: 6px; background: var(--bfm-paper); }
.rgthumbs .th img { display: block; width: 100%; height: 100%; object-fit: cover; }
.rgthumbs .th .lb { position: absolute; right: 0; bottom: 0; left: 0; padding: 4px; background: rgba(11,11,12,.62); color: #fff; font-size: 9px; font-weight: 700; text-align: center; }
.rgthumbs .th .lq,
.rgthumbs .th::after { display: none; }
#idxChips { display: none; }
#idxRep { margin-top: 14px; }
.region-index-title { margin: 0 0 12px; font-size: 14px; font-weight: 700; }
.region-row { margin-top: 12px; }
.region-row .region-line { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 11px; }
.region-row .region-line b { font-size: 11px; font-weight: 700; }
.region-row .region-track { height: 3px; overflow: hidden; background: var(--bfm-hairline); }
.region-row .region-track i { display: block; height: 100%; background: var(--bfm-ink); }
#resultDisclaimer { margin: 14px 6px 0; }
.result-research-id { margin: 10px 0 0; padding: 10px 12px; border: 1px solid var(--bfm-hairline); border-radius: 8px; background: var(--bfm-paper); color: var(--bfm-ink-2); font-size: 10px; font-weight: 600; text-align: center; }
#s-result .foot { margin: 0 -16px; padding: 14px 16px calc(16px + var(--bfm-safe-bottom)); border-top: 1px solid var(--bfm-hairline); }

.rxframe { width: calc(100% + 32px); min-height: calc(100vh - 76px); min-height: calc(100dvh - 76px); margin: 0 -16px; border: 0; background: var(--bfm-white); }
#s-prescription { padding-bottom: 0; }

body:has(#s-prescription.on) > .flow-app > .top { display: none; }
body:has(#s-prescription.on) .wrap,
body:has(#s-prescription.on) #s-prescription,
body:has(#s-prescription.on) .rxframe { min-height: 100vh; min-height: 100dvh; }

@media (min-width: 600px) {
  body { padding: 24px 0; }
  .flow-app { min-height: calc(100vh - 48px); border-radius: 18px; box-shadow: 0 30px 80px rgba(0,0,0,.18); }
  .screen { min-height: calc(100vh - 124px); }
  #s-cam,
  #s-video { min-height: calc(100vh - 124px); }
}

@media (max-width: 560px) {
  #s-cam .cam { margin: 12px 16px 0; border-radius: 14px; }
  #s-cam .foot { position: static; z-index: auto; padding: 18px 16px 8px; background: var(--bfm-base); }
  #s-scan .scanwrap { margin-right: 0; margin-left: 0; border-radius: 8px; }
}

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

/* --------------------------------------------------------------------------
   Figma fidelity pass — nodes 48:4, 52:4, 55:47, 53:4 and 57:4.
   Pilot-only consent/video/upload states intentionally keep their own layout.
   -------------------------------------------------------------------------- */

.flow-app {
  --bfm-logo-height: 52px;
  --bfm-logo-gap: 0px;
  --bfm-chrome-height: calc(52px + env(safe-area-inset-top, 0px));
}

body:has(#s-intro.on) .flow-app {
  --bfm-logo-height: 53px;
  --bfm-chrome-height: calc(53px + env(safe-area-inset-top, 0px));
}

body:has(#s-cam.on) .flow-app,
body:has(#s-video.on) .flow-app {
  --bfm-logo-height: 34px;
  --bfm-chrome-height: calc(34px + env(safe-area-inset-top, 0px));
}

body:has(#s-scan.on) .flow-app,
body:has(#s-result.on) .flow-app {
  --bfm-logo-height: 53px;
  --bfm-chrome-height: calc(53px + env(safe-area-inset-top, 0px));
}

body:has(#s-survey.on) .flow-app {
  --bfm-logo-height: 50px;
  --bfm-logo-gap: 80px;
  --bfm-chrome-height: calc(130px + env(safe-area-inset-top, 0px));
}

.top {
  height: calc(var(--bfm-logo-height) + env(safe-area-inset-top, 0px));
  margin-top: var(--bfm-logo-gap);
  padding-top: env(safe-area-inset-top, 0px);
}

.wrap,
.screen {
  min-height: calc(100vh - var(--bfm-chrome-height));
  min-height: calc(100dvh - var(--bfm-chrome-height));
}

body:has(#s-intro.on) .top .flow-logo,
body:has(#s-scan.on) .top .flow-logo,
body:has(#s-result.on) .top .flow-logo {
  font-size: 24px;
  line-height: 1.38;
  letter-spacing: -.36px;
}

body:has(#s-cam.on) .top,
body:has(#s-video.on) .top { align-items: flex-start; padding-bottom: 10px; }

body:has(#s-cam.on) .top .flow-logo,
body:has(#s-video.on) .top .flow-logo,
body:has(#s-survey.on) .top .flow-logo {
  font-size: 20px;
  line-height: normal;
  letter-spacing: -.4px;
}

/* Intro — Figma 48:4 */
#s-intro {
  justify-content: space-between;
  gap: 32px;
  padding: 32px 16px calc(32px + var(--bfm-safe-bottom));
}

#s-intro .grow { flex: 0 1 auto; overflow-y: auto; }
#s-intro .intro-kicker {
  margin: 0 0 32px;
  color: var(--bfm-ink-2);
  font-size: 14px;
  font-weight: 500;
  line-height: normal;
}

#s-intro h1 {
  font-size: 32px;
  line-height: 1.28;
  letter-spacing: -.64px;
}

#s-intro .intro-copy {
  margin: 10px 0 0;
  color: var(--bfm-ink-2);
  font-size: 16px;
  line-height: 1.58;
  letter-spacing: -.16px;
}

#s-intro .guides {
  gap: 16px;
  margin-top: 32px;
  padding: 10px 16px;
}

#s-intro .guides .g {
  grid-template-columns: 24px 1fr;
  gap: 10px;
  align-items: center;
  font-size: 14px;
  line-height: 1.6;
  letter-spacing: -.14px;
}

#s-intro .guides .g .c {
  width: 24px;
  height: 24px;
  font-size: 12px;
  font-weight: 500;
}

#s-intro .privacy {
  gap: 10px;
  margin-top: 32px;
  padding: 10px;
  border-color: #f4f3f0;
  border-radius: 14px;
  background: var(--bfm-paper);
}

#s-intro .privacy .i {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: #f4f3f0;
  font-size: 12px;
}

#s-intro .privacy b { font-size: 14px; font-weight: 500; line-height: normal; }
#s-intro .privacy p { margin-top: 4px; font-size: 12px; line-height: 1.5; }

#s-intro .inapp,
#s-intro .err {
  margin-top: 10px;
  padding: 16px;
  border-color: #cfa77f;
  border-radius: 14px;
  background: var(--bfm-white);
  color: #fd8733;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
}

#s-intro .foot { gap: 10px; padding-top: 0; }
#s-intro .btn { min-height: 51px; }
#s-intro .btn.ghost { min-height: 53px; border-color: #98989d; }

/* The consent extension intentionally is not a Figma screen. Make its generated
   research identifier unmissable before the second, camera-starting click. */
.participant-badge.on {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--bfm-hairline);
  border-radius: 12px;
}

.participant-badge code { justify-self: end; font-size: 13px; }
.participant-badge small {
  grid-column: 1 / -1;
  color: var(--bfm-ink-2);
  font-size: 12px;
  line-height: 1.5;
}

/* Camera — Figma 52:4, 55:4, 55:24 */
#s-cam,
#s-video {
  min-height: calc(100vh - var(--bfm-chrome-height));
  min-height: calc(100dvh - var(--bfm-chrome-height));
}

#s-cam .cam {
  min-height: 360px;
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

#s-cam .cam::before {
  position: absolute;
  z-index: 1;
  inset: 0;
  content: '';
  pointer-events: none;
}

#s-cam .cam::before { background: linear-gradient(to bottom, rgba(42,44,48,0), rgba(42,44,48,.68)); }
#s-cam .cam video { z-index: 0; }
#s-cam .oval { z-index: 2; }

#s-cam .coach { top: 32px; }
#s-cam .coach .pill {
  gap: 10px;
  max-width: calc(100% - 32px);
  padding: 10px 16px;
  border-color: #a0e23b;
  background: rgba(11,11,12,.88);
  font-size: 14px;
  line-height: normal;
}

#s-cam[data-region="tzone"] .coach .pill { font-size: 16px; }
#s-cam .coach .pill .dot { display: block; width: 8px; height: 8px; object-fit: contain; }

#s-cam .foot { gap: 0; padding: 0 16px; }
#s-cam .foot .btn { min-height: 51px; }
#s-cam .linkbtn { height: 40px; padding: 0; font-size: 14px; line-height: normal; }
#s-cam .camera-site-mark {
  display: grid;
  place-items: center;
  height: calc(77px + var(--bfm-safe-bottom));
  padding: 10px 16px calc(16px + var(--bfm-safe-bottom));
  font-size: 16px;
  line-height: normal;
}

/* Analysis — Figma 55:47. The canvas remains the participant's real capture. */
#s-scan {
  gap: 32px;
  padding: 32px 16px calc(20px + var(--bfm-safe-bottom));
}

#s-scan .grow {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 32px;
  overflow: visible;
}

.analysis-copy { display: flex; flex-direction: column; gap: 10px; }
.analysis-copy .eyebrow { color: var(--bfm-ink-2); font-size: 14px; font-weight: 500; }
.analysis-copy h1 {
  margin: 0;
  color: var(--bfm-base);
  font-size: 32px;
  line-height: 1.3;
  letter-spacing: -.64px;
}

.analysis-copy .sub {
  margin: 0;
  font-size: 16px;
  line-height: 1.58;
  letter-spacing: -.16px;
}

.analysis-points {
  margin: 0;
  padding-left: 21px;
  color: #98989d;
  font-size: 14px;
  line-height: 1.6;
  letter-spacing: -.14px;
}

#s-scan .scanwrap {
  flex: none;
  width: 100%;
  height: 251px;
  margin: 0;
  border-radius: 12px;
  background: #151719;
}

#s-scan .scanwrap canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.analysis-focus-frame {
  position: absolute;
  z-index: 3;
  top: 50%;
  left: 50%;
  width: 157px;
  height: 157px;
  border: 1px dashed #e2fffd;
  border-radius: 12px;
  box-shadow: 0 -4px 10px rgba(0,255,234,.25), 0 4px 10px rgba(0,255,234,.25);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.analysis-scan-line {
  position: absolute;
  z-index: 4;
  top: 71.5px;
  left: 50%;
  width: 384px;
  height: 30px;
  max-width: none;
  transform: translateX(-50%);
  pointer-events: none;
}

#s-scan .scanstat {
  z-index: 5;
  top: 221.5px;
  right: auto;
  bottom: auto;
  left: 50%;
  display: block;
  width: max-content;
  padding: 0;
  background: transparent;
  color: #e2fffd;
  font-size: 14px;
  font-weight: 500;
  line-height: normal;
  text-shadow: 0 -4px 10px rgba(0,255,234,.25), 0 4px 10px rgba(0,255,234,.25);
  transform: translateX(-50%);
}

#s-scan .sigchips { display: none; }
#s-scan .foot { gap: 10px; padding-top: 0; }
#s-scan .foot .btn { min-height: 51px; }
#s-scan .foot .linkbtn { height: 40px; padding: 0; font-size: 16px; text-decoration: underline; }

/* Survey — Figma 53:4 */
#s-survey {
  position: relative;
  min-height: calc(100vh - var(--bfm-chrome-height));
  min-height: calc(100dvh - var(--bfm-chrome-height));
  padding: 0 16px calc(81px + var(--bfm-safe-bottom));
}

#s-survey .survey-meta {
  padding-bottom: 10px;
  font-size: 14px;
  line-height: normal;
}

#s-survey .survey-meta > span:last-child { color: var(--bfm-ink); font-weight: 700; }
#s-survey .prog { height: 4px; margin-top: 0; border-radius: 999px; background: #ededee; }
#s-survey .prog .fl { border-radius: 99px; background: var(--bfm-base); }
#s-survey .grow { padding-top: 32px; overflow-y: auto; }
#s-survey .qsec { font-size: 14px; line-height: normal; letter-spacing: .14px; }
#s-survey .q {
  margin: 10px 0 0;
  font-size: 24px;
  line-height: 1.35;
  letter-spacing: -.24px;
}

#s-survey .prime {
  margin-top: 10px;
  padding: 10px 16px;
  border-color: #ededee;
  border-radius: 4px;
  background: var(--bfm-white);
  color: #98989d;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
}

#s-survey .prime .s { display: none; }
#s-survey .opts { gap: 10px; margin-top: 32px; }
#s-survey .opt {
  min-height: 46px;
  gap: 16px;
  padding: 10px 16px;
  border-color: #f4f3f0;
  border-radius: 12px;
  background: #fafafa;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.58;
  letter-spacing: -.16px;
}

#s-survey .opt .rd { width: 22px; height: 22px; border-color: #8b8b8f; }
#s-survey .opt.sel { border: 1.5px solid var(--bfm-ink); background: #fafafa; }
#s-survey .opt.sel .rd { border: 6px solid var(--bfm-ink); }

#s-survey .srow {
  position: absolute;
  z-index: 10;
  right: auto;
  bottom: 0;
  left: 50%;
  grid-template-columns: 96px 1fr;
  gap: 10px;
  width: 390px;
  min-height: calc(81px + var(--bfm-safe-bottom));
  padding: 10px 16px calc(16px + var(--bfm-safe-bottom));
  border: 1px solid #f4f3f0;
  background: var(--bfm-white);
  box-shadow: 0 -2px 2px rgba(0,0,0,.05);
  transform: translateX(-50%);
}

#s-survey .srow .btn { min-height: 51px; border-radius: 12px; font-size: 16px; }
#s-survey .srow .btn.ghost { width: 96px; padding: 16px 32px; border-color: #f4f3f0; border-radius: 10px; }

/* Report — Figma 57:4. Participant captures remain dynamic. */
#s-result {
  gap: 32px;
  min-height: calc(100vh - var(--bfm-chrome-height));
  min-height: calc(100dvh - var(--bfm-chrome-height));
  padding: 32px 16px 0;
}

#s-result .grow {
  display: flex;
  flex-direction: column;
  gap: 32px;
  overflow: visible;
}

.result-heading { display: flex; flex-direction: column; gap: 10px; }
.result-heading .eyebrow { color: #000; font-size: 14px; letter-spacing: .14px; }
#resultHeading { margin: 0; font-size: 28px; line-height: 1.32; letter-spacing: -.56px; }

#s-result .result-score-card {
  display: flex;
  flex-direction: column;
  gap: 32px;
  margin: 0;
  padding: 32px 16px;
  border-color: #f4f3f0;
  border-radius: 22px;
  box-shadow: 1px 1px 10px rgba(0,0,0,.05);
}

.result-score-card .result-summary {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: normal;
}

.result-score-card .result-summary::before { display: none; }
.result-score-card .result-summary img { flex: none; width: 9px; height: 9px; }
.result-score-card .h,
.result-score-card #flagWrap { display: none; }

.result-score-card .bar { margin: 0; }
.result-score-card .bar .bt {
  margin-bottom: 10px;
  font-size: 16px;
  line-height: normal;
}

.result-score-card .bar .bt b { font-size: 16px; }
.result-score-card .bar .tr { height: 6px; background: #ededee; }
.result-score-card .bar .fl { background: var(--bfm-base); }
.result-score-card .reason {
  margin: 0;
  padding: 0;
  border: 0;
  color: #98989d;
  font-size: 14px;
  line-height: 1.6;
  letter-spacing: -.14px;
}

#s-result .rgthumbs {
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 0;
}

#s-result .rgthumbs .th { height: 147.435px; aspect-ratio: auto; border-radius: 12px; }
#s-result .rgthumbs .th img { border-radius: 12px; }
#s-result .rgthumbs .th .lb {
  top: 121px;
  bottom: auto;
  min-height: 26px;
  padding: 4px 10px;
  font-size: 12px;
  line-height: 1.5;
}

#s-result #idxRep {
  display: block;
  margin: 0;
  padding: 16px;
  border-color: #f4f3f0;
  border-radius: 18px;
  box-shadow: 1px 1px 10px rgba(0,0,0,.05);
}

#s-result .region-index-title { margin: 0 0 32px; font-size: 16px; line-height: normal; }
#s-result .region-row { margin: 0; }
#s-result .region-row + .region-row { margin-top: 16px; }
#s-result .region-row .region-line { margin-bottom: 10px; font-size: 16px; line-height: normal; }
#s-result .region-row .region-line b { font-size: 16px; }
#s-result .region-row .region-track { height: 6px; border-radius: 999px; background: #ededee; }
#s-result .region-row .region-track i { border-radius: 99px; }
#s-result #idxRep > .note { margin: 32px 0 0 !important; font-size: 14px; line-height: 1.6; }

#s-result .result-research-id { margin: 0; font-size: 12px; }
#s-result .foot {
  gap: 10px;
  min-height: calc(127px + var(--bfm-safe-bottom));
  margin: 0 -16px;
  padding: 10px 16px calc(16px + var(--bfm-safe-bottom));
  border: 1px solid #f4f3f0;
  background: var(--bfm-white);
  box-shadow: 0 -2px 2px rgba(0,0,0,.05);
}

#s-result .foot .btn { min-height: 51px; }
#resultDisclaimer { margin: 0; color: #8b8b8f; font-size: 14px; line-height: 1.6; }
#s-result #retry { display: none; }
