:root {
  --brand-main: #047857;
  --brand-sub: #FCD34D;
  --progress-green: #4ADE80;
  --ink: #0F172A;
  --slate: #334155;
  --muted: #94A3B8;
  --surface: #F8FAFC;
  --green: var(--brand-main);
  --blue: var(--brand-sub);
  --dot-idle: #EEF2F7;
  --guide-fill: rgba(248, 250, 252, 0.78);
  --guide-dark: rgba(0, 0, 0, 0.31);
  --line-soft: rgba(248, 250, 252, 0.48);
  --font: Pretendard, "Noto Sans KR", "Apple SD Gothic Neo", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #f8fafc;
  color: var(--ink);
  font-family: var(--font);
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}

button {
  font: inherit;
}

.figma-liveness {
  --camera-top: clamp(211px, calc(100vh - 357px), 283px);
  --camera-top: clamp(211px, calc(100dvh - 357px), 283px);
  position: relative;
  width: min(100vw, 375px);
  height: min(100vh, 812px);
  height: min(100dvh, 812px);
  overflow: hidden;
  background: #ffffff;
  isolation: isolate;
}

.top-bar-image {
  position: absolute;
  z-index: 21;
  top: 0;
  left: 0;
  width: 100%;
  height: auto;
  display: none;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.figma-liveness[data-screen="intro"] .top-bar-intro {
  display: block;
}

.figma-liveness[data-screen="guide"] .top-bar-flow,
.figma-liveness[data-screen="camera"] .top-bar-flow,
.figma-liveness[data-screen="result"] .top-bar-flow {
  display: block;
}

.ios-status {
  position: absolute;
  z-index: 20;
  top: 0;
  left: 0;
  right: 0;
  height: 44px;
  pointer-events: none;
  display: none;
}

.ios-time {
  position: absolute;
  top: 15px;
  left: 36px;
  color: #000000;
  font-size: 13px;
  line-height: 1;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.ios-icons {
  position: absolute;
  top: 16px;
  right: 25px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #000000;
}

.signal {
  width: 14px;
  height: 10px;
  display: inline-flex;
  align-items: end;
  gap: 2px;
}

.signal i {
  width: 3px;
  display: block;
  border-radius: 2px;
  background: currentColor;
}

.signal i:nth-child(1) { height: 4px; }
.signal i:nth-child(2) { height: 7px; }
.signal i:nth-child(3) { height: 10px; }

.wifi {
  position: relative;
  width: 14px;
  height: 10px;
  overflow: hidden;
}

.wifi::before,
.wifi::after {
  content: "";
  position: absolute;
  left: 50%;
  border: 2px solid currentColor;
  border-color: currentColor currentColor transparent transparent;
  border-radius: 50%;
  transform: translateX(-50%) rotate(-45deg);
}

.wifi::before {
  top: 2px;
  width: 13px;
  height: 13px;
}

.wifi::after {
  top: 6px;
  width: 6px;
  height: 6px;
}

.battery {
  position: relative;
  width: 24px;
  height: 11px;
  display: inline-block;
  border: 1px solid currentColor;
  border-radius: 3px;
}

.battery::after {
  content: "";
  position: absolute;
  top: 3px;
  right: -3px;
  width: 2px;
  height: 5px;
  border-radius: 0 2px 2px 0;
  background: currentColor;
}

.battery i {
  position: absolute;
  inset: 2px;
  display: block;
  border-radius: 2px;
  background: currentColor;
}

.back-button {
  position: absolute;
  z-index: 22;
  top: 60px;
  left: 14px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  opacity: 0;
}

.back-button svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mobile-page-title {
  position: absolute;
  z-index: 22;
  top: 58px;
  left: 64px;
  right: 64px;
  display: none;
  color: var(--ink);
  font-size: 19px;
  line-height: 1;
  font-weight: 820;
  text-align: center;
  pointer-events: none;
}

.intro-screen,
.guide-screen,
.camera-screen,
.result-screen {
  position: absolute;
  inset: 0;
}

.guide-screen,
.camera-screen,
.result-screen {
  display: none;
}

.figma-liveness[data-screen="guide"] .guide-screen,
.figma-liveness[data-screen="camera"] .camera-screen,
.figma-liveness[data-screen="result"] .result-screen {
  display: block;
}

.figma-liveness[data-screen="guide"] .intro-screen,
.figma-liveness[data-screen="camera"] .intro-screen,
.figma-liveness[data-screen="result"] .intro-screen {
  display: none;
}

.intro-title {
  position: absolute;
  top: 68px;
  left: 110px;
  right: 110px;
  margin: 0;
  font-size: 19px;
  line-height: 1;
  font-weight: 820;
  text-align: center;
  display: none;
}

.intro-copy {
  position: absolute;
  top: 145px;
  left: 24px;
  margin: 0;
  color: var(--ink);
  font-size: 32px;
  line-height: 1.38;
  font-weight: 700;
  word-break: keep-all;
}

.intro-face {
  position: absolute;
  top: clamp(183px, calc(100vh - 482px), 264px);
  top: clamp(183px, calc(100dvh - 482px), 264px);
  left: 50%;
  width: clamp(206px, 70.7vw, 265px);
  height: clamp(206px, 70.7vw, 265px);
  aspect-ratio: 1 / 1;
  transform: translateX(-50%);
}

.intro-face canvas,
.rive-canvas {
  display: block;
  width: 100%;
  height: 100%;
  user-select: none;
  -webkit-user-drag: none;
}

.intro-notes {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 162px;
  display: grid;
  gap: 0;
  margin: 0;
  padding: 16px 24px;
  list-style: none;
  border-radius: 8px;
  background: var(--surface);
  color: var(--slate);
  font-size: 15px;
  line-height: 1.2;
  font-weight: 700;
}

.intro-notes li {
  display: grid;
  grid-template-columns: 36px 1fr;
  align-items: center;
  gap: 16px;
  min-height: 48px;
}

.intro-notes li + li {
  border-top: 1px solid rgba(148, 163, 184, 0.24);
}

.note-icon {
  width: 36px;
  height: 36px;
  display: block;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

.start-button {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 86px;
  height: 57px;
  border: 0;
  border-radius: 28px;
  background: var(--brand-main);
  color: #ffffff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.intro-help-button {
  position: absolute;
  left: 50%;
  bottom: 45px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.2;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 4px;
  white-space: nowrap;
  cursor: pointer;
  transform: translateX(-50%);
}

.guide-title {
  position: absolute;
  z-index: 22;
  top: 68px;
  left: 110px;
  right: 110px;
  margin: 0;
  color: var(--ink);
  font-size: 19px;
  line-height: 1;
  font-weight: 820;
  text-align: center;
}

.guide-page {
  position: absolute;
  inset: 0;
  display: none;
}

.figma-liveness[data-guide-step="0"] .guide-page-level,
.figma-liveness[data-guide-step="1"] .guide-page-target {
  display: block;
}

.guide-copy {
  position: absolute;
  top: 150px;
  left: 24px;
  right: 24px;
  margin: 0;
  color: var(--ink);
  font-size: 31px;
  line-height: 1.36;
  font-weight: 800;
  text-align: center;
  word-break: keep-all;
}

.accent {
  color: var(--brand-main);
}

.guide-illustration {
  position: absolute;
  left: 50%;
  display: block;
  width: auto;
  user-select: none;
  -webkit-user-drag: none;
  transform: translateX(-50%);
}

.guide-level-art {
  top: 330px;
  width: 280px;
  height: 235px;
}

.guide-target-art {
  top: 312px;
  width: 295px;
  height: 270px;
}

.guide-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 176px;
  display: flex;
  justify-content: center;
  gap: 14px;
}

.guide-dot {
  width: 12px;
  height: 12px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--dot-idle);
  cursor: pointer;
}

.figma-liveness[data-guide-step="0"] .guide-dot[data-guide-dot="0"],
.figma-liveness[data-guide-step="1"] .guide-dot[data-guide-dot="1"] {
  background: var(--brand-sub);
}

.guide-start-button {
  bottom: 31px;
}

.prompt {
  position: absolute;
  z-index: 5;
  top: 148px;
  left: 24px;
  right: 24px;
  color: var(--ink);
  font-size: 31px;
  line-height: 1.36;
  font-weight: 700;
  text-align: center;
  word-break: keep-all;
  text-wrap: balance;
  pointer-events: none;
}

.prompt-line {
  display: block;
}

.prompt .accent {
  color: var(--brand-main);
}

.camera-ring {
  position: absolute;
  z-index: 3;
  top: var(--camera-top);
  left: 50%;
  width: 281px;
  height: 281px;
  overflow: hidden;
  border-radius: 50%;
  background: #cbd5e1;
  transform: translateX(-50%);
}

.camera-ring video,
.fake-feed,
.feed-soften,
.front-mask,
.cross-guide,
.side-guide,
.return-guide {
  position: absolute;
  inset: 0;
}

.camera-ring video,
.fake-feed {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

.fake-feed {
  opacity: 1;
  transform: none;
  background: #CBD5E1;
}

.figma-liveness[data-camera="live"] .fake-feed {
  opacity: 0;
}

.feed-soften {
  --feed-tint: rgba(203, 213, 225, 0.3);
  --feed-tint-opacity: 0;
  --feed-side-opacity: 0;
  --feed-side-gradient: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 0) 50%,
    rgba(0, 0, 0, 0.12) 58%,
    rgba(0, 0, 0, 0.42) 76%,
    rgba(0, 0, 0, 0.68) 92%,
    rgba(0, 0, 0, 0.82) 100%
  );
  overflow: hidden;
  pointer-events: none;
}

.feed-soften::before,
.feed-soften::after {
  position: absolute;
  inset: 0;
  content: "";
  opacity: 0;
  pointer-events: none;
  transition: opacity 320ms cubic-bezier(0.22, 0.61, 0.36, 1);
  will-change: opacity;
}

.feed-soften::before {
  background: var(--feed-tint);
  opacity: var(--feed-tint-opacity);
}

.feed-soften::after {
  background: var(--feed-side-gradient);
  opacity: var(--feed-side-opacity);
}

.front-mask,
.cross-guide,
.side-guide,
.return-guide,
.outer-hold {
  opacity: 0;
  pointer-events: none;
}

.front-dim {
  fill: var(--guide-dark);
}

.face-track {
  fill: #ffffff;
  stroke: none;
}

.cross-line,
.target-line,
.target-arrow,
.target-head,
.target-dot,
.side-track,
.side-progress,
.return-track,
.return-progress {
  fill: none;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.cross-line {
  stroke: rgba(248, 250, 252, 0.42);
  stroke-width: 10;
}

.target-line,
.side-track,
.return-track {
  stroke: rgba(248, 250, 252, 0.94);
  stroke-width: 10;
}

.target-arrow,
.side-progress,
.return-progress {
  stroke: var(--progress-green);
  stroke-width: 14;
}

.side-progress,
.side-head,
.return-progress {
  opacity: 0;
}

.target-arrow,
.target-head,
.target-dot {
  opacity: 0;
}

.target-arrow,
.side-progress,
.return-progress {
  marker-end: none;
}

.target-arrow::after {
  content: "";
}

.center-dot,
.target-dot,
.side-target {
  fill: var(--progress-green);
}

.target-line,
.side-track,
.return-track,
.side-target {
  opacity: 0;
}

.side-head,
.target-head,
.return-head {
  fill: var(--progress-green);
}

.outer-track,
.outer-progress {
  fill: none;
  stroke-width: 7;
  vector-effect: non-scaling-stroke;
}

.outer-hold {
  position: absolute;
  z-index: 4;
  top: calc(var(--camera-top) - 5.5px);
  left: 50%;
  width: 292px;
  height: 292px;
  transform: translateX(-50%);
}

.outer-track {
  display: none;
}

.outer-progress {
  opacity: 0;
  stroke: var(--progress-green);
  stroke-linecap: round;
  transition: opacity 120ms linear, stroke-dashoffset 160ms linear;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
}

.figma-liveness[data-outer-progress="active"] .outer-progress {
  opacity: 1;
}

.figma-liveness[data-mode="front-position"] .front-mask,
.figma-liveness[data-mode="front-far"] .front-mask,
.figma-liveness[data-mode="front-near"] .front-mask,
.figma-liveness[data-mode="initial-hold"] .front-mask {
  opacity: 1;
}

.figma-liveness[data-mode="front-correction"] .cross-guide,
.figma-liveness[data-mode="return-correction"] .cross-guide,
.figma-liveness[data-mode="return-guide"] .return-guide,
.figma-liveness[data-mode="side"] .side-guide {
  opacity: 1;
}

.figma-liveness[data-screen="camera"][data-outer-progress="active"] .outer-hold {
  opacity: 1;
}

.figma-liveness[data-mode="front-correction"] .feed-soften,
.figma-liveness[data-mode="return-correction"] .feed-soften,
.figma-liveness[data-mode="return-guide"] .feed-soften,
.figma-liveness[data-mode="return-hold"] .feed-soften {
  --feed-tint-opacity: 0.36;
}

.figma-liveness[data-mode="side"] .feed-soften {
  --feed-side-opacity: 0;
}

.figma-liveness[data-mode="side"] .camera-ring,
.figma-liveness[data-mode="side"] .fake-feed {
  background: linear-gradient(90deg, #B2BBC5 0%, #BBC4CF 28%, #CAD4E0 50%, #CBD5E1 62%, #CBD5E1 100%);
}

.figma-liveness[data-side="left"] .feed-soften {
  --feed-side-gradient: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 0) 50%,
    rgba(0, 0, 0, 0.12) 58%,
    rgba(0, 0, 0, 0.42) 76%,
    rgba(0, 0, 0, 0.68) 92%,
    rgba(0, 0, 0, 0.82) 100%
  );
}

.figma-liveness[data-mode="side"][data-side="right"] .camera-ring,
.figma-liveness[data-mode="side"][data-side="right"] .fake-feed {
  background: linear-gradient(90deg, #B2BBC5 0%, #BBC4CF 28%, #CAD4E0 50%, #CBD5E1 62%, #CBD5E1 100%);
}

.figma-liveness[data-side="right"] .feed-soften {
  --feed-side-gradient: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.82) 0%,
    rgba(0, 0, 0, 0.68) 8%,
    rgba(0, 0, 0, 0.42) 24%,
    rgba(0, 0, 0, 0.12) 42%,
    rgba(0, 0, 0, 0) 50%,
    rgba(0, 0, 0, 0) 100%
  );
}

.figma-liveness[data-mode="return-correction"] .feed-soften,
.figma-liveness[data-mode="return-guide"] .feed-soften,
.figma-liveness[data-mode="return-hold"] .feed-soften {
  --feed-tint: rgba(15, 23, 42, 0.18);
}

.figma-liveness[data-camera="live"] .camera-ring video {
  opacity: 1;
}

.figma-liveness[data-camera="live"] .fake-feed {
  opacity: 0;
}

.figma-liveness[data-mode="front-correction"] .target-line,
.figma-liveness[data-mode="front-correction"] .target-arrow,
.figma-liveness[data-mode="front-correction"] .target-head,
.figma-liveness[data-mode="return-correction"] .target-line,
.figma-liveness[data-mode="return-correction"] .target-arrow,
.figma-liveness[data-mode="return-correction"] .target-head {
  opacity: 0;
}

.figma-liveness[data-mode="front-correction"][data-correction="up"] .target-line.target-up,
.figma-liveness[data-mode="front-correction"][data-correction="up"] .target-arrow.target-up,
.figma-liveness[data-mode="front-correction"][data-correction="up"] .target-head.target-up,
.figma-liveness[data-mode="return-correction"][data-correction="up"] .target-line.target-up,
.figma-liveness[data-mode="return-correction"][data-correction="up"] .target-arrow.target-up,
.figma-liveness[data-mode="return-correction"][data-correction="up"] .target-head.target-up,
.figma-liveness[data-mode="front-correction"][data-correction="down"] .target-line.target-down,
.figma-liveness[data-mode="front-correction"][data-correction="down"] .target-arrow.target-down,
.figma-liveness[data-mode="front-correction"][data-correction="down"] .target-head.target-down,
.figma-liveness[data-mode="return-correction"][data-correction="down"] .target-line.target-down,
.figma-liveness[data-mode="return-correction"][data-correction="down"] .target-arrow.target-down,
.figma-liveness[data-mode="return-correction"][data-correction="down"] .target-head.target-down,
.figma-liveness[data-mode="front-correction"][data-correction="left"] .target-line.target-left,
.figma-liveness[data-mode="front-correction"][data-correction="left"] .target-arrow.target-left,
.figma-liveness[data-mode="front-correction"][data-correction="left"] .target-head.target-left,
.figma-liveness[data-mode="return-correction"][data-correction="left"] .target-line.target-left,
.figma-liveness[data-mode="return-correction"][data-correction="left"] .target-arrow.target-left,
.figma-liveness[data-mode="return-correction"][data-correction="left"] .target-head.target-left,
.figma-liveness[data-mode="front-correction"][data-correction="right"] .target-line.target-right,
.figma-liveness[data-mode="front-correction"][data-correction="right"] .target-arrow.target-right,
.figma-liveness[data-mode="front-correction"][data-correction="right"] .target-head.target-right,
.figma-liveness[data-mode="return-correction"][data-correction="right"] .target-line.target-right,
.figma-liveness[data-mode="return-correction"][data-correction="right"] .target-arrow.target-right,
.figma-liveness[data-mode="return-correction"][data-correction="right"] .target-head.target-right {
  opacity: 1;
}

.figma-liveness[data-mode="front-correction"] .target-line.is-active,
.figma-liveness[data-mode="front-correction"] .target-arrow.is-active,
.figma-liveness[data-mode="front-correction"] .target-head.is-active,
.figma-liveness[data-mode="return-correction"] .target-line.is-active,
.figma-liveness[data-mode="return-correction"] .target-arrow.is-active,
.figma-liveness[data-mode="return-correction"] .target-head.is-active {
  opacity: 1;
}

.figma-liveness[data-mode="side"][data-side="left"] .side-target-left,
.figma-liveness[data-mode="side"][data-side="right"] .side-target-right,
.figma-liveness[data-mode="side"] .side-track {
  opacity: 1;
}

.figma-liveness[data-mode="side"] .side-progress.is-active,
.figma-liveness[data-mode="side"] .side-head.is-active,
.figma-liveness[data-mode="return-guide"] .return-progress {
  opacity: 1;
}

.figma-liveness[data-mode="return-guide"] .return-track {
  opacity: 1;
}

.figma-liveness[data-intro="true"] .direction-overlay {
  opacity: 0.92;
}

.direction-overlay {
  position: absolute;
  z-index: 8;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 80ms linear;
}

.side-intro {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  overflow: hidden;
  border-radius: inherit;
  transform: scaleX(1);
  transform-origin: center;
  user-select: none;
  -webkit-user-drag: none;
}

.figma-liveness[data-side="left"] .side-intro {
  transform: scaleX(-1);
}

.capture-dots {
  position: absolute;
  z-index: 5;
  top: calc(var(--camera-top) + 335px);
  left: 0;
  right: 0;
  display: none;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

.figma-liveness[data-mode="side"] .capture-dots,
.figma-liveness[data-mode="return-correction"] .capture-dots,
.figma-liveness[data-mode="return-guide"] .capture-dots,
.figma-liveness[data-mode="return-hold"] .capture-dots,
.figma-liveness[data-screen="result"] .result-dots {
  display: flex;
}

.capture-dots span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--dot-idle);
}

.capture-dots span.is-active,
.capture-dots span.is-complete {
  background: var(--brand-sub);
}

.tip-button {
  position: absolute;
  z-index: 24;
  left: 50%;
  right: auto;
  bottom: 60px;
  height: auto;
  padding: 0;
  display: none;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.2;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 4px;
  white-space: nowrap;
  cursor: pointer;
  transform: translateX(-50%);
}

.tip-button.is-visible {
  display: block;
}

.figma-liveness[data-tip="open"] .tip-button.is-visible {
  bottom: 40px;
  display: block;
}

.result-tip-button {
  bottom: 106px;
}

.tip-sheet {
  position: absolute;
  z-index: 24;
  left: 24px;
  right: 24px;
  bottom: 99px;
  display: none;
  pointer-events: none;
}

.tip-sheet.is-open {
  display: grid;
  justify-items: center;
  gap: 0;
}

.tip-card-image {
  width: 100%;
  max-width: 327px;
  height: auto;
  display: block;
  border-radius: 8px;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.tip-close-link {
  display: none;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.2;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
  pointer-events: auto;
}

.result-title {
  position: absolute;
  top: 146px;
  left: 24px;
  right: 24px;
  margin: 0;
  color: var(--ink);
  font-size: 31px;
  line-height: 1.36;
  font-weight: 700;
  text-align: center;
  word-break: keep-all;
}

.result-circle {
  position: absolute;
  top: var(--camera-top);
  left: 50%;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.34);
  transform: translateX(-50%);
}

.result-dots {
  top: calc(var(--camera-top) + 335px);
}

.retry-button {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 31px;
  height: 57px;
  display: none;
  border: 0;
  border-radius: 28px;
  background: var(--brand-main);
  color: #ffffff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.figma-liveness[data-result="failure"] .retry-button,
.figma-liveness[data-result="camera-permission"] .retry-button,
.figma-liveness[data-result="camera-unavailable"] .retry-button,
.figma-liveness[data-result="startup-error"] .retry-button {
  display: block;
}

.figma-liveness[data-result="camera-permission"] .result-circle,
.figma-liveness[data-result="camera-permission"] .result-dots,
.figma-liveness[data-result="camera-unavailable"] .result-circle,
.figma-liveness[data-result="camera-unavailable"] .result-dots,
.figma-liveness[data-result="startup-error"] .result-circle,
.figma-liveness[data-result="startup-error"] .result-dots {
  display: none;
}

.loading-layer {
  position: absolute;
  z-index: 40;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}

.loading-layer.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #e2e8f0;
  border-top-color: var(--brand-main);
  border-radius: 50%;
  animation: spin 820ms linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes tip-glow {
  0%,
  100% {
    box-shadow:
      0 13px 26px rgba(15, 23, 42, 0.18),
      0 0 0 0 rgba(34, 197, 94, 0);
  }

  48% {
    box-shadow:
      0 16px 32px rgba(15, 23, 42, 0.22),
      0 0 0 9px rgba(34, 197, 94, 0.2);
  }
}

@media (prefers-reduced-motion: reduce) {
  .tip-button {
    animation: none;
  }
}

@media (min-width: 430px) {
  .figma-liveness {
    border-radius: 8px;
    box-shadow: 0 22px 70px rgba(15, 23, 42, 0.14);
  }
}

@media (max-width: 429px), (pointer: coarse) {
  body {
    display: block;
    background: #ffffff;
  }

  .figma-liveness {
    --camera-top: var(--mobile-camera-top, 239px);
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    width: 100dvw;
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
    box-shadow: none;
    transform: none;
  }

  .figma-liveness[data-screen="intro"] .top-bar-intro,
  .figma-liveness[data-screen="guide"] .top-bar-flow,
  .figma-liveness[data-screen="camera"] .top-bar-flow,
  .figma-liveness[data-screen="result"] .top-bar-flow {
    display: block;
  }

  .back-button {
    top: var(--mobile-back-top, 16px);
    left: var(--mobile-back-left, 20px);
    width: var(--mobile-back-size, 34px);
    height: var(--mobile-back-size, 34px);
    display: grid;
    opacity: 1;
  }

  .back-button svg {
    width: var(--mobile-back-icon, 24px);
    height: var(--mobile-back-icon, 24px);
    opacity: 0;
  }

  .mobile-page-title {
    display: none;
  }

  .intro-copy {
    top: var(--mobile-intro-copy-top, 101px);
    left: var(--mobile-pad, 24px);
    font-size: var(--mobile-intro-copy-font, 32px);
  }

  .intro-face {
    top: var(--mobile-intro-face-top, 220px);
    width: var(--mobile-intro-face-width, 265px);
    height: var(--mobile-intro-face-width, 265px);
  }

  .intro-notes {
    left: var(--mobile-pad, 24px);
    right: var(--mobile-pad, 24px);
    bottom: calc(var(--mobile-button-bottom, 31px) + var(--mobile-button-height, 57px) + 74px);
    gap: var(--mobile-notes-gap, 14px);
    font-size: var(--mobile-notes-font, 15px);
    line-height: 1.2;
  }

  .intro-notes li {
    grid-template-columns: var(--mobile-note-icon, 36px) 1fr;
    gap: var(--mobile-notes-gap, 14px);
  }

  .note-icon {
    width: var(--mobile-note-icon, 36px);
    height: var(--mobile-note-icon, 36px);
  }

  .start-button {
    left: var(--mobile-pad, 24px);
    right: var(--mobile-pad, 24px);
    bottom: var(--mobile-button-bottom, 31px);
    height: var(--mobile-button-height, 57px);
    border-radius: var(--mobile-button-radius, 28px);
    font-size: var(--mobile-button-font, 16px);
  }

  .figma-liveness[data-screen="intro"] .start-button {
    bottom: calc(var(--mobile-button-bottom, 31px) + 55px);
  }

  .intro-help-button {
    bottom: calc(var(--mobile-button-bottom, 31px) + 14px);
  }

  .guide-title {
    top: 68px;
    left: var(--mobile-title-inset, 64px);
    right: var(--mobile-title-inset, 64px);
    font-size: var(--mobile-title-font, 19px);
  }

  .guide-copy {
    top: 150px;
    left: var(--mobile-pad, 24px);
    right: var(--mobile-pad, 24px);
    font-size: var(--mobile-prompt-font, 31px);
  }

  .guide-level-art {
    top: 330px;
    width: min(280px, calc(100vw - 64px));
    height: auto;
  }

  .guide-target-art {
    top: 312px;
    width: min(295px, calc(100vw - 48px));
    height: auto;
  }

  .guide-dots {
    bottom: calc(var(--mobile-button-bottom, 31px) + var(--mobile-button-height, 57px) + 88px);
  }

  .guide-start-button {
    bottom: var(--mobile-button-bottom, 31px);
  }

  .prompt {
    top: var(--mobile-prompt-top, 104px);
    font-size: var(--mobile-prompt-font, 31px);
  }

  .camera-ring {
    width: var(--mobile-camera-size, 281px);
    height: var(--mobile-camera-size, 281px);
  }

  .outer-hold {
    top: var(--mobile-outer-top, 233.5px);
    width: var(--mobile-outer-size, 292px);
    height: var(--mobile-outer-size, 292px);
  }

  .side-intro {
    inset: 0;
    width: 100%;
    height: 100%;
  }

  .capture-dots,
  .result-dots {
    top: var(--mobile-dots-top, 574px);
    gap: var(--mobile-dot-gap, 10px);
  }

  .capture-dots span {
    width: var(--mobile-dot-size, 12px);
    height: var(--mobile-dot-size, 12px);
  }

  .tip-button {
    left: 50%;
    right: auto;
    bottom: 60px;
    height: auto;
    border-radius: 0;
    font-size: 14px;
  }

  .result-tip-button {
    bottom: calc(var(--mobile-button-bottom, 31px) + var(--mobile-button-height, 57px) + 18px);
  }

  .tip-sheet {
    left: var(--mobile-pad, 24px);
    right: var(--mobile-pad, 24px);
    bottom: 99px;
    gap: 0;
  }

  .tip-card-image {
    max-width: 327px;
  }

  .result-circle {
    width: var(--mobile-result-size, 280px);
    height: var(--mobile-result-size, 280px);
  }

  .result-title {
    top: var(--mobile-result-title-top, 122px);
    left: var(--mobile-pad, 24px);
    right: var(--mobile-pad, 24px);
    font-size: var(--mobile-result-title-font, 31px);
  }

  .retry-button {
    left: var(--mobile-pad, 24px);
    right: var(--mobile-pad, 24px);
    bottom: var(--mobile-button-bottom, 31px);
    height: var(--mobile-button-height, 57px);
    border-radius: var(--mobile-button-radius, 28px);
    font-size: var(--mobile-button-font, 16px);
  }

  .loading-layer {
    font-size: var(--mobile-loading-font, 15px);
  }

  .loading-spinner {
    width: var(--mobile-loading-spinner, 32px);
    height: var(--mobile-loading-spinner, 32px);
  }
}
