/* CheckAge styles. One file, in sections: tokens, base, layout, components,
   screens. Visual source: docs/checkage-screens (Components sheet first).
   Support floor iOS 15: no color-mix(), :has(), nesting. Animations are only
   declared inside @media (prefers-reduced-motion: no-preference). */

/* ---------------------------------------------------------------- tokens */

/* Theme: the brand is these tokens. Accent shades are written out (no
   color-mix() on iOS 15). */
:root {
  --accent: #1d4ed8;
  --on-accent: #ffffff;
  --accent-soft: #1d4ed814;
  --accent-tint: #1d4ed82e;
  --ink: #101828;
  --text: #344054;
  --muted: #475467;
  --line: #e4e7ec;
  --surface: #f6f7f9;
  --camera: #0a0c10;
  --success: #067647;
  --warning: #fdb022;

  --radius-btn: 14px;
  --btn-h: 56px;

  /* Derived from the Components sheet. */
  --bg: #ffffff;
  --success-soft: #ecfdf3;
  --success-on-dark: #47cd89;
  --disabled-bg: #f2f4f7;
  --disabled-text: #667085;
  --pressed-shade: rgba(0, 0, 0, 0.18);
  --camera-panel: #1c2028;
  --camera-text: #c9ced6;
  --camera-veil: rgba(5, 7, 10, 0.62);
  --scrim: rgba(16, 24, 40, 0.82);
  --banner-bg: #fffaeb;
  --banner-line: #fedf89;
  --banner-text: #93370d;
  --banner-icon: #b54708;
  --danger: #b42318;
  --danger-soft: #fef3f2;
  --kbd-line: #d0d5dd;
  --field-line: #667085;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --gutter: 24px;
}

/* ------------------------------------------------------------------ base */

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

[hidden] {
  /* biome-ignore lint/complexity/noImportantStyles: hidden must win over component display rules */
  display: none !important;
}

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 25px;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

/* Dynamic viewport where supported (iOS 15.4+), so the bottom button stays
   above Safari's toolbar. */
@supports (min-height: 100dvh) {
  body {
    min-height: 100dvh;
  }
}

h1,
h2,
p {
  margin: 0;
}

a {
  color: var(--accent);
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.icon {
  flex: none;
  width: 24px;
  height: 24px;
}

/* Read by screen readers, not shown. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------------------------------------------------------------- layout */

.app {
  display: flex;
  flex: 1 0 auto;
  flex-direction: column;
}

/* A screen fills the viewport: header, body (grows), actions, footer. */
.screen {
  display: flex;
  flex: 1 0 auto;
  flex-direction: column;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px)
    env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
}

.site-header {
  display: flex;
  flex: none;
  align-items: center;
  padding: 20px var(--gutter) 0;
}

/* CheckAge logo (i-logo), 132×40. */
.logo {
  display: block;
  flex: none;
  width: 132px;
  height: 40px;
  color: var(--accent);
}

.logo__word {
  fill: var(--ink);
  font-family: var(--font);
  letter-spacing: -0.02em;
}

/* Client logo slot (header): the mocks' 104×32 box, 132×40 on Entry. An
   image is fitted inside, left-aligned; without one the client name is a
   single-line text wordmark. */
.client-logo {
  display: flex;
  flex: none;
  align-items: center;
  width: 104px;
  max-width: 100%;
  height: 32px;
  overflow: hidden;
}

.client-logo__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: left center;
}

.client-logo__name {
  overflow: hidden;
  color: var(--ink);
  font-size: 15px;
  line-height: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.screen__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  padding: 24px var(--gutter) 0;
}

/* Centered illustration + text block of info screens. */
.hero {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 20px;
  align-items: center;
  justify-content: center;
  padding-bottom: 40px;
  text-align: center;
}

.hero__text {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 300px;
}

.title {
  color: var(--ink);
  font-size: 28px;
  line-height: 34px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.title--lg {
  font-size: 30px;
  line-height: 36px;
}

.lead {
  color: var(--text);
  font-size: 17px;
  line-height: 25px;
}

.lead--muted {
  color: var(--muted);
}

/* Bottom block in the thumb zone: note + one primary button. */
.actions {
  display: flex;
  flex: none;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 16px var(--gutter) 0;
}

.site-footer {
  display: flex;
  flex: none;
  gap: 6px;
  align-items: center;
  justify-content: center;
  padding: 14px var(--gutter) 28px;
  color: var(--muted);
  font-size: 13px;
  line-height: 18px;
}

.site-footer .icon {
  width: 15px;
  height: 15px;
}

.site-footer strong {
  color: var(--text);
  font-weight: 600;
}

/* ------------------------------------------------------------ components */

/* Primary button: 56 px tall, 14 px radius, full width, 17/600 label. */
.btn {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: var(--btn-h);
  margin: 0;
  padding: 0 20px;
  border: 0;
  border-radius: var(--radius-btn);
  background: var(--accent);
  color: var(--on-accent);
  font-family: inherit;
  font-size: 17px;
  line-height: 22px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-appearance: none;
  appearance: none;
}

.btn:active {
  box-shadow: inset 0 0 0 999px var(--pressed-shade);
}

.btn:disabled {
  background: var(--disabled-bg);
  box-shadow: none;
  color: var(--disabled-text);
  cursor: default;
}

.btn .icon {
  width: 20px;
  height: 20px;
}

/* Consent note: 13/19 muted, centered, 10 px above Start. */
.consent {
  color: var(--muted);
  font-size: 13px;
  line-height: 19px;
  text-align: center;
}

.consent a {
  /* Underlined: colour alone does not set the link apart from the muted text.
     The vertical padding grows the tap area to 44 px without moving the lines. */
  padding: 14px 0;
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.alert {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid var(--danger);
  border-radius: 12px;
  color: var(--danger);
  font-size: 15px;
  line-height: 20px;
}

/* Round illustration behind an icon (entry, end screens). */
.hero__icon {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
}

.hero__icon .icon {
  width: 52px;
  height: 52px;
}

.hero__icon--success {
  width: 104px;
  height: 104px;
  background: var(--success-soft);
}

.hero__disc {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--success);
  color: #ffffff;
}

.hero__disc .icon {
  width: 34px;
  height: 34px;
  stroke-width: 3;
}

.hero__icon--neutral {
  width: 104px;
  height: 104px;
  background: var(--surface);
  color: var(--muted);
}

.hero__icon--neutral .icon {
  width: 44px;
  height: 44px;
}

/* Step progress. Current label bold; done and current bars use the accent
   (white on camera screens). */
.progress {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.progress-label {
  color: var(--muted);
  font-size: 13px;
  line-height: 18px;
  font-weight: 600;
}

.progress-items {
  display: grid;
  grid-auto-columns: minmax(0, 1fr);
  grid-auto-flow: column;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.progress-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
}

.progress-item::before {
  content: "";
  height: 4px;
  border-radius: 2px;
  background: var(--line);
}

.progress-item.is-done::before,
.progress-item.is-current::before {
  background: var(--accent);
}

.progress-item.is-current {
  color: var(--ink);
  font-weight: 600;
}

.progress--camera .progress-label,
.progress--camera .progress-item {
  color: var(--camera-text);
}

.progress--camera .progress-item::before {
  background: rgba(255, 255, 255, 0.28);
}

.progress--camera .progress-item.is-done::before,
.progress--camera .progress-item.is-current::before {
  background: #ffffff;
}

.progress--camera .progress-item.is-current {
  color: #ffffff;
}

/* Countdown ring: 56 px, 4 px stroke on a 60 % dark disc; amber in the last
   5 s. Markup: .ring > svg (viewBox 0 0 56 56) > circle.ring__track +
   circle.ring__bar (r 24, dasharray 150.8, rotate(-90 28 28)), then
   .ring__value with the seconds. */
.ring {
  position: relative;
  flex: none;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(10, 12, 16, 0.6);
}

.ring svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 56px;
  height: 56px;
}

.ring__track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.22);
  stroke-width: 4;
}

.ring__bar {
  fill: none;
  stroke: #ffffff;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 150.8;
}

.ring.is-warning .ring__bar {
  stroke: var(--warning);
}

.ring__value {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 17px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Hint chip: 15/500 white on 82 % ink, one at a time below the guide
   (inside .camera__hint). Not .chip: that is the light label chip of the
   permission help screens. */
.hint-chip {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 10px 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: var(--scrim);
  color: #ffffff;
  font-size: 15px;
  line-height: 20px;
  font-weight: 500;
}

.hint-chip .icon {
  width: 18px;
  height: 18px;
}

/* Microphone level: icon + 20 segments of 8×28; lit ones get .is-on. */
.level {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  color: #ffffff;
}

.level .icon {
  width: 22px;
  height: 22px;
}

.level__bars {
  display: flex;
  gap: 4px;
  align-items: center;
}

.level__seg {
  display: block;
  width: 8px;
  height: 28px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.2);
}

.level__seg.is-on {
  background: #ffffff;
}

/* ID card frame: ID-1 ratio 1.59 : 1, outside darkened to 62 %, white
   corner marks (.card-frame__corner--tl/tr/bl/br). */
.card-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 1.59;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 14px;
  box-shadow: 0 0 0 1400px var(--camera-veil);
}

.card-frame__corner {
  position: absolute;
  width: 30px;
  height: 30px;
  border: 0 solid #ffffff;
}

.card-frame__corner--tl {
  top: -2px;
  left: -2px;
  border-width: 4px 0 0 4px;
  border-top-left-radius: 14px;
}

.card-frame__corner--tr {
  top: -2px;
  right: -2px;
  border-width: 4px 4px 0 0;
  border-top-right-radius: 14px;
}

.card-frame__corner--bl {
  bottom: -2px;
  left: -2px;
  border-width: 0 0 4px 4px;
  border-bottom-left-radius: 14px;
}

.card-frame__corner--br {
  right: -2px;
  bottom: -2px;
  border-width: 0 4px 4px 0;
  border-bottom-right-radius: 14px;
}

/* Slow-connection banner: never blocking. Light on info screens,
   .banner--camera on camera screens. */
.banner {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--banner-line);
  border-radius: 12px;
  background: var(--banner-bg);
  color: var(--banner-text);
  font-size: 15px;
  line-height: 20px;
  font-weight: 500;
}

.banner .icon {
  width: 20px;
  height: 20px;
  color: var(--banner-icon);
}

.banner--camera {
  border-color: rgba(253, 176, 34, 0.55);
  background: rgba(16, 24, 40, 0.92);
  color: #ffffff;
}

.banner--camera .icon {
  color: var(--warning);
}

/* Illustrations: accent parts use currentColor. */
.ill {
  display: block;
  flex: none;
  max-width: 100%;
  height: auto;
  color: var(--accent);
}

.ill-soft {
  fill: var(--accent-soft);
}

.ill-tint {
  fill: var(--accent-tint);
}

/* --------------------------------------------------------------- screens */

/* Entry: larger client-logo slot, as in the Main mock. */
.screen--entry .client-logo {
  width: 132px;
  height: 40px;
}

.screen--entry .client-logo__name {
  font-size: 18px;
  line-height: 24px;
}

.screen--entry .hero__text {
  max-width: 310px;
}

/* Location: progress on top, then the pulsing pin centered in the rest. A
   screen's panels fill the space between header and footer. */
.screen > [data-panel] {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

/* Progress and hero share the free height equally, as in the mock. A 0px
   basis (not the 0% of flex: 1) so it holds when the height is not fixed. */
.screen__body > .progress {
  flex: 1 1 0px;
  justify-content: flex-start;
}

/* Progress bar with the slow-connection banner under it (processing): takes
   the progress bar's share of the height, so the banner never moves the
   hero. */
.screen__top {
  display: flex;
  flex: 1 1 0px;
  flex-direction: column;
  gap: 16px;
}

.title--md {
  font-size: 26px;
  line-height: 32px;
}

.title--sm {
  font-size: 22px;
  line-height: 28px;
}

.lead--sm {
  font-size: 16px;
  line-height: 24px;
}

.hero--locating,
.hero--selfie,
.hero--fill {
  flex: 1 1 0px;
}

.hero--locating .hero__text {
  gap: 8px;
}

/* Three concentric discs: 168, 112 and 60 px. */
.rings {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 168px;
  height: 168px;
  border-radius: 50%;
  background: var(--accent-soft);
}

.rings__mid {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  background: var(--accent-tint);
}

.rings__core {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
}

.rings__core .icon {
  width: 28px;
  height: 28px;
}

/* Permission help (denied-location, denied-camera). */
.denied__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.denied__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--danger-soft);
  color: var(--danger);
}

.denied__icon .icon {
  width: 28px;
  height: 28px;
}

.chip {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  line-height: 18px;
  font-weight: 600;
}

.chip .icon {
  width: 15px;
  height: 15px;
}

.denied__intro {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 20px;
}

.howto {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 22px;
}

.howto__title {
  color: var(--muted);
  font-size: 13px;
  line-height: 18px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.howto__steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.howto__steps li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  color: var(--text);
  font-size: 16px;
  line-height: 24px;
  counter-increment: step;
}

.howto__steps li::before {
  content: counter(step);
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  line-height: 1;
  font-weight: 700;
}

.howto__steps li > span {
  padding-top: 1px;
}

.howto__note {
  margin: 16px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  line-height: 21px;
}

/* A key / icon cap quoted inside help text ("aA", the tune icon). */
.kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 24px;
  padding: 0 6px;
  border: 1px solid var(--kbd-line);
  border-radius: 6px;
  background: var(--bg);
  color: var(--ink);
  font-size: 13px;
  line-height: 1;
  font-weight: 700;
  vertical-align: -5px;
}

.kbd .icon {
  width: 16px;
  height: 16px;
}

/* Camera fallback (screen F, no mock): the denied layout plus the Copy link
   outcome under the button. The live region is always there (so the label is
   announced when it appears) but takes no room while empty. */
.fallback__status {
  margin-top: -10px;
}

.fallback__copied {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  margin-top: 10px;
  color: var(--success);
  font-size: 15px;
  line-height: 20px;
  font-weight: 600;
}

.fallback__copied .icon {
  width: 18px;
  height: 18px;
}

.fallback__manual {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fallback__label {
  color: var(--muted);
  font-size: 13px;
  line-height: 18px;
  font-weight: 600;
}

/* 16 px text: iOS zooms into smaller fields on focus. */
.fallback__link {
  width: 100%;
  height: 48px;
  margin: 0;
  padding: 0 14px;
  border: 1px solid var(--field-line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 16px;
  line-height: 22px;
  -webkit-appearance: none;
  appearance: none;
}

/* Camera screens: dark, full bleed. */
.screen--camera {
  position: relative;
  overflow: hidden;
  max-width: none;
  background: var(--camera);
  color: #ffffff;
}

/* Selfie intro (SelfieIntro): smile + mic in the 120 px disc. */
.hero__icon--pair {
  gap: 4px;
}

.hero__icon--pair .icon {
  width: 44px;
  height: 44px;
}

.hero__icon--pair > :last-child {
  width: 30px;
  height: 30px;
}

.hero__text--wide {
  max-width: 320px;
}

/* Small print under the primary button. */
.actions__note {
  color: var(--muted);
  font-size: 13px;
  line-height: 18px;
  text-align: center;
}

/* Camera panel (SelfieFrame, SelfieVoice): covers the whole viewport over
   the light page, full bleed. Positions follow the 390 × 844 mocks and scale
   with the visible height (--vh: small viewport unit where supported), so
   the guide, hint and captions keep clear of each other on short phones. */
.camera {
  --vh: 1vh;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --oval-top: calc(var(--safe-top) + max(92px, 17.77 * var(--vh)));
  --oval-w: calc(29.38 * var(--vh));
  --oval-h: calc(37.91 * var(--vh));
  --voice-oval-top: calc(var(--safe-top) + max(92px, 12.32 * var(--vh)));
  --voice-oval-w: calc(19.9 * var(--vh));
  --voice-oval-h: calc(25.59 * var(--vh));

  position: fixed;
  inset: 0;
  z-index: 10;
  overflow: hidden;
  background: var(--camera);
  color: #ffffff;
}

@supports (height: 1svh) {
  .camera {
    --vh: 1svh;
  }
}

.camera__video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--camera-panel);
}

/* Front camera: show it like a mirror (the recording is not mirrored). */
.camera__video--mirror {
  transform: scaleX(-1);
}

/* Progress (+ countdown ring on the selfie), on top of everything. */
.camera__top {
  position: relative;
  z-index: 2;
  display: flex;
  flex: none;
  gap: 16px;
  align-items: flex-start;
  padding: calc(var(--safe-top) + 24px) calc(env(safe-area-inset-right, 0px) + 20px) 0
    calc(env(safe-area-inset-left, 0px) + 20px);
}

.camera__top .progress {
  flex: 1;
}

/* Kept in place (no layout jump) once the countdown reaches zero. */
.ring.is-over {
  visibility: hidden;
}

/* One phase of the camera screen (framing, voice): a full-size layer. */
.camera__phase {
  position: absolute;
  inset: 0;
  z-index: 1;
}

/* Face guide: white oval, everything outside it darkened. */
.oval {
  position: absolute;
  top: var(--oval-top);
  left: 50%;
  width: var(--oval-w);
  height: var(--oval-h);
  border: 3px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 0 1400px rgba(5, 7, 10, 0.6);
  transform: translateX(-50%);
}

.oval--small {
  top: var(--voice-oval-top);
  width: var(--voice-oval-w);
  height: var(--voice-oval-h);
}

/* Live hint slot, 24 px below the oval. */
.camera__hint {
  position: absolute;
  top: calc(var(--oval-top) + var(--oval-h) + 24px);
  right: 0;
  left: 0;
  display: flex;
  justify-content: center;
  padding: 0 16px;
}

.camera__caption {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  padding: 0 28px calc(var(--safe-bottom) + 52px);
  text-align: center;
}

.camera__caption--voice {
  padding-right: 32px;
  padding-left: 32px;
}

/* Framing title and lead: one polite live region (the MediaPipe-mode head
   turns swap them). */
.camera__say {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.camera__title {
  color: #ffffff;
  font-size: 24px;
  line-height: 30px;
  font-weight: 600;
  text-align: center;
}

.camera__lead {
  color: var(--camera-text);
  font-size: 16px;
  line-height: 23px;
}

/* Head-turn cue (MediaPipe-mode selfie): a small chevron in a hint-chip
   disc, 12 px beside the oval at mid-height, on the side the visitor turns
   toward as seen in the mirrored preview. */
.turn-cue {
  position: absolute;
  top: calc(var(--oval-top) + var(--oval-h) / 2 - 20px);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  background: var(--scrim);
  color: #ffffff;
}

.turn-cue--left {
  right: calc(50% + var(--oval-w) / 2 + 12px);
}

.turn-cue--right {
  left: calc(50% + var(--oval-w) / 2 + 12px);
}

.turn-cue .icon {
  width: 22px;
  height: 22px;
}

/* SelfieVoice: title, six digits and level bar, 30 px below the oval. */
.voice {
  position: absolute;
  top: calc(var(--voice-oval-top) + var(--voice-oval-h) + 30px);
  right: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
  padding: 0 20px;
}

.digits {
  display: flex;
  gap: 8px;
}

.digit {
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(50px, calc((100vw - 80px) / 6));
  height: 68px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-size: 40px;
  line-height: 1;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.voice__level {
  margin-top: 8px;
}

/* ID card camera (DocFront, DocFrontLite, DocBack): the panel is a column of
   top bar, stage and shutter. At 390 × 844 the stage puts the side chip at
   226 px and the frame at 272 px, as in the mocks; the spacers around it
   (::before, ::after) give or take the height of other phones.
   On short phones the frame narrows (keeping the ID-1 ratio) to leave room
   for everything else: --doc-rest is that room, with --doc-caption the
   expected caption height. The text never shrinks; if the caption is taller
   than expected (a font or a translation), the frame alone gives way, so
   the caption and the shutter never overlap.
   .doc--lite: no hint slot, the caption comes up under the frame. */
.doc {
  --doc-caption: 84px; /* two-line title + one-line lead */
  --doc-banner: 0px; /* the slow-connection banner's room while it shows */
  --doc-rest: calc(381px + var(--doc-caption) + var(--doc-banner));
}

.doc--lite {
  --doc-rest: calc(327px + var(--doc-caption) + var(--doc-banner));
}

/* Slow-connection banner showing: see .doc > .banner-slot--camera. */
.is-slow .doc {
  --doc-banner: 28px;
}

/* Narrow phones: the lead wraps too (so hiding it frees the room of a
   two-line banner). */
@media (max-width: 374px) {
  .doc {
    --doc-caption: 106px;
  }

  .is-slow .doc {
    --doc-banner: 8px;
  }
}

.doc__stage {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: center;
  min-height: 0;
  padding: 0 calc(env(safe-area-inset-right, 0px) + 24px) 0
    calc(env(safe-area-inset-left, 0px) + 24px);
}

/* The spacers give way first (shrink factor 1000 against the frame's 1);
   the frame only shrinks once they are down to 12 px. */
.doc__stage::before,
.doc__stage::after {
  content: "";
  flex: 1 1000 146px;
  min-height: 12px;
}

.doc__stage::after {
  flex-basis: 50px;
}

.doc--lite .doc__stage::after {
  flex-basis: 104px;
}

/* Above the frame's veil; never shrunk (see .doc__frame). */
.doc__stage > *,
.doc__controls {
  position: relative;
  z-index: 1;
  flex: none;
}

.doc__side {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.side-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 999px;
  background: #ffffff;
  color: var(--ink);
  font-size: 14px;
  line-height: 18px;
  font-weight: 600;
}

/* The only item that gives way when the column is short of room. */
.doc__stage > .doc__frame {
  z-index: 0;
  flex: 0 1 auto;
  min-height: 0;
  width: min(
    100%,
    calc((100 * var(--vh) - var(--doc-rest) - var(--safe-top) - var(--safe-bottom)) * 1.59)
  );
}

/* Hint chips ("Avoid glare", "Hold steady") go here, 24 px under the frame.
   Keeps its room while empty. */
.doc__hint {
  display: flex;
  justify-content: center;
  width: 100%;
  min-height: 42px;
  margin-top: 24px;
}

.doc__caption {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 84px; /* two-line title: front and back keep the same layout */
  margin-top: 21px;
  padding: 0 8px;
  text-align: center;
}

.doc--lite .doc__caption {
  margin-top: 33px;
}

.doc__title {
  color: #ffffff;
  font-size: 22px;
  line-height: 28px;
  font-weight: 600;
}

.doc__lead {
  color: var(--camera-text);
  font-size: 15px;
  line-height: 22px;
}

.doc__controls {
  display: flex;
  flex: none;
  justify-content: center;
  padding-bottom: calc(var(--safe-bottom) + 56px);
}

/* Shutter: 80 px white ring around a 62 px disc. */
.shutter {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  margin: 0;
  padding: 0;
  border: 4px solid #ffffff;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-appearance: none;
  appearance: none;
}

.shutter__dot {
  display: block;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: #ffffff;
}

.shutter:active .shutter__dot {
  transform: scale(0.9);
}

.shutter:disabled {
  opacity: 0.6;
  cursor: default;
}

/* Camera banner at the bottom of every camera screen. This deliberately
   departs from WeakConnection.png, which has it under the top bar: the owner
   moved it to the bottom (2026-11-11, R37). It never covers the guide, the
   digits, a caption or the shutter: each screen makes room for it.
   Selfie: the last line of the phase's caption, so the caption moves up
   while it shows; it sits 24 px above the safe area. */
.camera__caption > .banner-slot--camera {
  align-self: stretch;
  margin: -8px -12px 0; /* no caption gap while empty; 16 px side gutters */
}

.camera__caption--voice > .banner-slot--camera {
  margin-right: -16px;
  margin-left: -16px;
}

.camera__caption .banner--camera {
  margin: 24px 0 -28px;
  text-align: left;
}

/* Voice phase: no room for both on short phones (the digits and level bar
   sit right above the note), so the banner takes the note's place while it
   shows. The visitor has read the note by then. */
.is-slow .camera__caption--voice > .camera__lead {
  display: none;
}

/* Framing with live hints: the chip under the oval and a caption pushed up
   by the banner do not both fit on short phones (320 × 568, Italian title on
   two lines), so there the banner takes the lead's place too. The hints say
   more than the lead does. Taller phones keep both. */
@media (max-height: 667px) {
  .is-slow .camera__phase--hints .camera__say > .camera__lead {
    display: none;
  }
}

/* ID camera: in the column, between the stage and the shutter, above the
   frame's veil. While it shows it takes the room of the lead line and of
   part of the space under the shutter, so the chip, frame and title stay
   where they are on short phones (whose frame is already at its smallest);
   --doc-banner is what is left over (a two-line banner on a wider phone). */
.is-slow .doc__caption {
  min-height: 0;
}

.is-slow .doc__lead {
  display: none;
}

.is-slow .doc__controls {
  padding-bottom: calc(var(--safe-bottom) + 24px);
}

.doc > .banner-slot--camera {
  position: relative;
  z-index: 1;
  flex: none;
  padding: 0 calc(env(safe-area-inset-right, 0px) + 16px) 0
    calc(env(safe-area-inset-left, 0px) + 16px);
}

.doc .banner--camera {
  margin-bottom: 16px;
}

/* Front side captured: the free space under the centered content. */
.camera__bottom {
  position: absolute;
  right: 16px;
  bottom: calc(var(--safe-bottom) + 24px);
  left: 16px;
  z-index: 3;
}

/* A server message on a camera screen (id-back opens on its camera). */
.camera__alert {
  position: absolute;
  top: calc(var(--safe-top) + 96px);
  right: 16px;
  left: 16px;
  z-index: 3;
}

.camera__alert .alert {
  margin: 0;
  background: var(--danger-soft);
}

/* Front side captured (DocConfirm): the photo as a 226 × 142 card with a
   check, centered on the dark screen; the bar fills during the pause. */
.confirm {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 28px;
  align-items: center;
  justify-content: center;
  padding: 0 32px;
}

.confirm__thumb {
  position: relative;
  flex: none;
  width: 226px;
  height: 142px;
}

.confirm__img {
  display: block;
  width: 100%;
  height: 100%;
  border: 2px solid #ffffff;
  border-radius: 12px;
  background: #c7ced8;
  object-fit: cover;
}

.confirm__badge {
  position: absolute;
  right: -14px;
  bottom: -14px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 3px solid var(--camera);
  border-radius: 50%;
  background: var(--success);
  color: #ffffff;
}

.confirm__badge .icon {
  width: 26px;
  height: 26px;
  stroke-width: 3;
}

.confirm__text {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  text-align: center;
}

.confirm__bar {
  width: 120px;
  height: 4px;
  overflow: hidden;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.2);
}

.confirm__fill {
  display: block;
  width: 60%;
  height: 100%;
  border-radius: 2px;
  background: #ffffff;
}

/* DocTransition: the three tips under the text. */
.tips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tips li {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
}

/* Processing: spinner, text and the per-item upload status. */
.spinner {
  display: block;
  flex: none;
}

.spinner circle {
  fill: none;
  stroke-width: 5;
}

.spinner--small circle {
  stroke-width: 2.5;
}

.spinner__track {
  stroke: var(--line);
}

.spinner__arc {
  stroke: var(--accent);
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: center;
}

.hero__text--tight {
  gap: 8px;
}

.title--compact {
  font-size: 24px;
  line-height: 30px;
}

.sendlist {
  align-self: stretch;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  text-align: left;
}

.sendlist__item {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: 16px;
  line-height: 22px;
}

.sendlist__status {
  display: inline-flex;
  flex: none;
  gap: 4px;
  align-items: center;
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
}

.sendlist__status--sent {
  color: var(--success);
}

.sendlist__status--sent .icon {
  width: 16px;
  height: 16px;
  stroke-width: 2.6;
}

.sendlist__status--sending {
  gap: 6px;
  color: var(--muted);
}

/* Resume: play icon in the 104 px disc. */
.hero__icon--resume {
  width: 104px;
  height: 104px;
}

.hero__icon--resume .icon {
  width: 40px;
  height: 40px;
}

/* Rotate hint: CSS only, covers the page on a phone held in landscape. */
.rotate-hint {
  display: none;
}

@media (orientation: landscape) and (max-height: 500px) {
  .rotate-hint {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    justify-content: center;
    padding: 24px calc(var(--gutter) + env(safe-area-inset-right, 0px)) 24px
      calc(var(--gutter) + env(safe-area-inset-left, 0px));
    background: var(--bg);
    text-align: center;
  }

  .app {
    visibility: hidden;
  }
}

.rotate-hint__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 96px;
  height: 96px;
  margin-bottom: 10px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
}

.rotate-hint__icon .icon {
  width: 44px;
  height: 44px;
}

.rotate-hint__title {
  max-width: 320px;
  color: var(--ink);
  font-size: 22px;
  line-height: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.rotate-hint__body {
  max-width: 320px;
  color: var(--muted);
  font-size: 16px;
  line-height: 24px;
}

/* ---------------------------------------------------------------- motion */

@media (prefers-reduced-motion: no-preference) {
  .btn {
    transition: box-shadow 0.1s ease;
  }

  .ring__bar {
    transition:
      stroke-dashoffset 0.25s linear,
      stroke 0.2s ease;
  }

  .spinner {
    animation: spin 1s linear infinite;
  }

  .confirm__fill {
    animation: fill-bar 1s ease-out both;
  }

  .shutter__dot {
    transition: transform 0.1s ease;
  }

  .rotate-hint__icon .icon {
    animation: rotate-upright 1.6s ease-in-out infinite;
  }

  .turn-cue--left .icon {
    animation: nudge-left 1.2s ease-in-out infinite;
  }

  .turn-cue--right .icon {
    animation: nudge-right 1.2s ease-in-out infinite;
  }
}

@keyframes nudge-left {
  50% {
    transform: translateX(-3px);
  }
}

@keyframes nudge-right {
  50% {
    transform: translateX(3px);
  }
}

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

@keyframes fill-bar {
  from {
    width: 0;
  }

  to {
    width: 100%;
  }
}

@keyframes rotate-upright {
  0%,
  20% {
    transform: rotate(-90deg);
  }

  60%,
  100% {
    transform: rotate(0deg);
  }
}
