/*
 * Hearing check. Every value here is lifted from the design's .dc.html files
 * (docs/hearing-test/design/screens) and tokens.css; DESIGN_HANDOFF §2: "copy the
 * values exactly, but move them into classes and tokens".
 *
 * The accent-derived tokens below are the defaults for #1F4FD1. app.js recomputes
 * them from web.json (or ?accent=) at boot, in JS rather than color-mix(), which
 * Safari only has from 16.2.
 *
 * Font: Atkinson Hyperlegible Next, self-hosted (SIL OFL 1.1, fonts/OFL.txt) so
 * that "stays on this device" is true of the font request too.
 */

@font-face {
  font-family: 'Atkinson Hyperlegible Next';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('fonts/atkinson-hyperlegible-next-latin.woff2') format('woff2');
}

:root {
  --hc-accent: #1F4FD1;
  --hc-accent-press: #0F2E81;
  --hc-accent-hover: #11338E;
  --hc-accent-tint: #E7EEFC;
  --hc-accent-tint-12: #E2EBFC;
  --hc-accent-tint-13: #E0E9FC;
  --hc-accent-ring: #7499E8;

  --hc-bg: #EEF1F5;
  --hc-surface: #FFFFFF;
  --hc-surface-2: #F1F4F8;
  --hc-ink: #0F1B2D;
  --hc-ink-2: #2B3648;
  --hc-ink-3: #3B4658;
  --hc-muted: #4A5568;
  --hc-line: #E3E8EF;
  --hc-slot-line: #8A96A8;
  --hc-track: #D5DCE6;
  --hc-key-shadow: #C3CCD9;
  --hc-key-alt: #DDE3EB;
  --hc-sheet-backdrop: #6E7888;

  --hc-panel: #0F1B2D;
  --hc-panel-slot: #1C2A40;
  --hc-panel-muted: #B8C2D3;
  --hc-panel-empty: #56657D;
  --hc-correct-on-dark: #7FE0B0;
  --hc-dark-body: #C9D2E0;

  --hc-noise-bar: #8A96A8;
  --hc-curve-fill: #E3E8EF;
  --hc-zone-worse: #B8C2D0;
  --hc-zone-mid: #CDD5E0;
  --hc-zone-good: #E1E6ED;

  --hc-font: 'Atkinson Hyperlegible Next', 'Atkinson Hyperlegible', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--hc-bg);
  color: var(--hc-ink);
  font-family: var(--hc-font);
  font-size: 17px;
  /* The mocks leave body line-height at normal and set it only on text blocks;
     a global 1.4 here made every title and label taller than drawn. */
  line-height: normal;
  -webkit-tap-highlight-color: transparent;
}

button,
input {
  font: inherit;
  color: inherit;
}

a {
  color: var(--hc-accent);
}
a:hover {
  color: var(--hc-accent-hover);
}

:focus-visible {
  outline: 3px solid var(--hc-accent);
  outline-offset: 3px;
}
[tabindex='-1']:focus {
  outline: none;
}

[hidden] {
  display: none !important;
}

/* ── layout ─────────────────────────────────────────────────────────────── */

.hc-app {
  max-width: 480px;
  margin: 0 auto;
}

.hc-screen {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: 100vh;
  min-height: min(100dvh, 900px);
  padding: 24px 20px 24px;
  padding-top: max(24px, env(safe-area-inset-top));
  padding-bottom: max(24px, env(safe-area-inset-bottom));
}
.hc-screen-top {
  padding-top: max(16px, env(safe-area-inset-top));
}
.hc-gap-18 {
  gap: 18px;
}

.hc-row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.hc-stack-8,
.hc-stack-10,
.hc-stack-14 {
  display: flex;
  flex-direction: column;
}
.hc-stack-8 {
  gap: 8px;
}
.hc-stack-10 {
  gap: 10px;
}
.hc-stack-14 {
  gap: 14px;
}
.hc-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.hc-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}
.hc-mt-56 {
  margin-top: 56px;
}
.hc-mt-120 {
  margin-top: 120px;
  gap: 18px;
}
.hc-mt-auto {
  margin-top: auto;
}
.hc-actions {
  display: flex;
  flex-direction: column;
  margin-top: auto;
}
.hc-center-x {
  align-items: center;
}
.hc-gap-4 {
  gap: 4px;
}
.hc-gap-6 {
  gap: 6px;
}
.hc-gap-8 {
  gap: 8px;
}
.hc-gap-10 {
  gap: 10px;
}

/* ── type ───────────────────────────────────────────────────────────────── */

.hc-brand {
  font-size: 18px;
  font-weight: 800;
}
/* The unbranded page: where a clinic's logo would sit. Pill height, so the
   intro's top row doesn't grow. */
.hc-logo-slot {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  height: 34px;
  padding: 0 14px;
  border: 2px dashed var(--hc-slot-line);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  color: var(--hc-muted);
  white-space: nowrap;
}
.hc-h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: -0.015em;
}
.hc-h1-30 {
  font-size: 30px;
  line-height: 1.15;
  letter-spacing: 0;
}
.hc-h1-32 {
  font-size: 32px;
  letter-spacing: 0;
}
.hc-h1-36 {
  font-size: 36px;
  line-height: 1.1;
}
.hc-balance {
  text-wrap: balance;
}
.hc-pretty {
  text-wrap: pretty;
}
.hc-lede {
  margin: 0;
  font-size: 19px;
  line-height: 1.45;
  color: var(--hc-ink-3);
}
.hc-lede-20 {
  font-size: 20px;
}
.hc-lede-17 {
  font-size: 17px;
}

.hc-pill {
  font-size: 16px;
  font-weight: 700;
  color: var(--hc-ink);
  background: var(--hc-surface);
  border-radius: 999px;
  padding: 6px 12px;
  white-space: nowrap;
}
.hc-pill-sm {
  font-size: 14px;
  padding: 3px 10px;
}

/* ── buttons and links ─────────────────────────────────────────────────── */

.hc-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 68px;
  padding: 0 16px;
  border: 0;
  border-radius: 18px;
  background: var(--hc-accent);
  color: #FFFFFF;
  font-size: 22px;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 4px 0 var(--hc-accent-press);
  cursor: pointer;
  transition: transform 0.06s ease, box-shadow 0.06s ease;
}
a.hc-btn:hover {
  color: #FFFFFF;
}
.hc-btn:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--hc-accent-press);
}
.hc-btn:disabled {
  background: var(--hc-track);
  color: var(--hc-muted);
  box-shadow: none;
  cursor: default;
}
.hc-btn-21 {
  font-size: 21px;
}
.hc-btn-64 {
  height: 64px;
  margin-top: 4px;
}

.hc-btn2 {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 56px;
  padding: 0 16px;
  border: 0;
  border-radius: 16px;
  background: var(--hc-surface);
  color: var(--hc-ink);
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
a.hc-btn2:hover {
  color: var(--hc-ink);
}
.hc-btn2-52 {
  height: 52px;
}
.hc-btn2-60 {
  height: 60px;
  border-radius: 18px;
  font-size: 19px;
}

.hc-link {
  align-self: center;
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 10px 4px;
  border: 0;
  background: none;
  color: var(--hc-accent);
  font-size: 17px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.hc-link:hover {
  color: var(--hc-accent-hover);
}

.hc-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 52px;
  padding: 0 18px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: var(--hc-accent);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
}

.hc-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
}
.hc-back,
.hc-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--hc-ink);
  cursor: pointer;
}
.hc-back {
  margin-left: -8px;
}
.hc-icon-btn {
  background: var(--hc-bg);
  flex-shrink: 0;
}
.hc-step {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  color: var(--hc-muted);
}
.hc-dots {
  display: flex;
  gap: 4px;
}
.hc-dots span {
  width: 22px;
  height: 6px;
  border-radius: 3px;
  background: var(--hc-track);
}
.hc-dots span.on {
  background: var(--hc-accent);
}

/* ── cards, rows, banners ──────────────────────────────────────────────── */

.hc-card {
  margin: 0;
  background: var(--hc-surface);
  border-radius: 22px;
  list-style: none;
}

.hc-steps {
  padding: 6px 18px;
}
.hc-step-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 14px 0;
}
.hc-step-row + .hc-step-row {
  border-top: 1px solid var(--hc-line);
}
.hc-num {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--hc-ink);
  color: #FFFFFF;
  font-size: 22px;
  font-weight: 800;
}
.hc-num-34 {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  font-size: 18px;
}
.hc-row-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.hc-row-title {
  font-size: 19px;
  font-weight: 800;
}
.hc-row-body {
  font-size: 17px;
  line-height: 1.4;
  color: var(--hc-muted);
}

.hc-banner-tint {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--hc-accent-tint);
  color: var(--hc-ink);
  font-size: 17px;
  line-height: 1.4;
}
.hc-banner-tint svg,
.hc-banner-dark svg,
.hc-note-card svg,
.hc-hint svg,
.hc-note svg {
  flex-shrink: 0;
}
.hc-banner-dark {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--hc-panel);
  color: #FFFFFF;
  font-size: 16px;
  line-height: 1.4;
}
.hc-fineprint {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 15px;
  line-height: 1.4;
  color: var(--hc-muted);
}
.hc-fineprint svg {
  flex-shrink: 0;
  margin-top: 2px;
}
.hc-hint {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: auto;
  padding: 0 4px;
  font-size: 16px;
  line-height: 1.45;
  color: var(--hc-ink-3);
}
.hc-hint svg {
  margin-top: 2px;
}
.hc-note-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--hc-surface);
  font-size: 16px;
  line-height: 1.45;
}
.hc-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--hc-surface);
  box-shadow: inset 0 0 0 2px var(--hc-accent);
  font-size: 17px;
  line-height: 1.4;
}
.hc-note svg {
  margin-top: 2px;
  color: var(--hc-accent);
}

.hc-disc {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 112px;
  height: 112px;
  border-radius: 56px;
  background: var(--hc-surface);
  color: var(--hc-ink);
}
.hc-disc-accent {
  color: var(--hc-accent);
}
.hc-loadbar {
  width: 240px;
  height: 10px;
  border-radius: 5px;
  background: var(--hc-track);
  overflow: hidden;
}
.hc-loadbar span {
  display: block;
  width: 0;
  height: 10px;
  border-radius: 5px;
  background: var(--hc-accent);
  transition: width 0.2s ease;
}

/* ── "How this check works" (Kiarash 2026-09-27; not in the design package,
      built from its parts: the card, the list rows, the bottom sheet) ────── */

/* "Test your hearing / using the DIN method": one heading, second line quieter. */
.hc-h1-sub {
  display: block;
  margin-top: 4px;
  font-size: 22px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--hc-accent);
}
.hc-trust {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  margin-top: 4px;
  padding: 14px 14px 12px;
  border: 0;
  border-radius: 16px;
  background: var(--hc-surface);
  color: var(--hc-ink);
  text-align: left;
  cursor: pointer;
}
.hc-trust > svg {
  flex-shrink: 0;
}
.hc-trust-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex-grow: 1;
  font-size: 16px;
  line-height: 1.3;
}
.hc-trust-text strong {
  font-size: 17px;
  font-weight: 800;
}
.hc-trust-text > span {
  color: var(--hc-ink-3);
}
.hc-trust-text > .hc-trust-more {
  display: flex;
  align-items: center;
  margin-top: 4px;
  color: var(--hc-accent);
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
}
.hc-trust-more svg {
  width: 20px;
  height: 20px;
}
.hc-about {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
}
.hc-about-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 0;
}
.hc-about-row + .hc-about-row {
  border-top: 1px solid var(--hc-line);
}
.hc-about-row svg {
  flex-shrink: 0;
}
.hc-about .hc-row-title {
  font-size: 18px;
}
.hc-about .hc-row-body {
  font-size: 16px;
  color: var(--hc-ink-3);
}
.hc-study {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  font-size: 15px;
  color: var(--hc-muted);
}
.hc-study a {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  min-height: 44px;
  font-size: 17px;
  font-weight: 700;
  text-underline-offset: 3px;
}
.hc-btn2-soft {
  background: var(--hc-surface-2);
}
.hc-vh {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ── 02 mode ───────────────────────────────────────────────────────────── */

.hc-mode {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  padding: 18px;
  border: 0;
  border-radius: 22px;
  background: var(--hc-surface);
  color: var(--hc-ink);
  text-align: left;
  cursor: pointer;
}
.hc-mode.hc-selected {
  box-shadow: inset 0 0 0 3px var(--hc-accent);
}
.hc-mode-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: var(--hc-bg);
  color: var(--hc-ink);
}
.hc-mode-icon-accent {
  background: var(--hc-accent-tint-12);
  color: var(--hc-accent);
}
.hc-tag {
  font-size: 14px;
  font-weight: 800;
  color: #FFFFFF;
  background: var(--hc-accent);
  border-radius: 999px;
  padding: 4px 10px;
}
.hc-mode-foot {
  display: flex;
  align-items: center;
  gap: 12px;
}
.hc-mode-foot svg {
  flex-shrink: 0;
}
.hc-mode-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-grow: 1;
}
.hc-mode-title {
  font-size: 22px;
  font-weight: 800;
}
.hc-mode-body {
  font-size: 17px;
  line-height: 1.4;
  color: var(--hc-ink-3);
}

/* ── 03 volume + sheet ─────────────────────────────────────────────────── */

.hc-volume-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 26px 18px 20px;
}
.hc-orb {
  position: relative;
  width: 124px;
  height: 124px;
}
.hc-pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--hc-accent);
  opacity: 0;
}
.hc-orb.playing .hc-pulse {
  animation: hcPulse 1.8s ease-out infinite;
}
.hc-orb.playing .hc-pulse.two {
  animation-delay: 0.9s;
}
@keyframes hcPulse {
  0% {
    transform: scale(1);
    opacity: 0.5;
  }
  100% {
    transform: scale(1.45);
    opacity: 0;
  }
}
.hc-orb-btn {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: var(--hc-accent);
  color: #FFFFFF;
  cursor: pointer;
}
.hc-orb-status {
  font-size: 16px;
  font-weight: 700;
  color: var(--hc-muted);
}
.hc-inset {
  display: flex;
  align-items: center;
  gap: 14px;
  align-self: stretch;
  padding: 14px;
  border-radius: 16px;
  background: var(--hc-surface-2);
  font-size: 17px;
  line-height: 1.4;
}
.hc-inset svg {
  flex-shrink: 0;
}

.hc-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  background: var(--hc-sheet-backdrop);
}
.hc-sheet {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 480px;
  max-height: 100%;
  overflow-y: auto;
  padding: 12px 20px 24px;
  padding-bottom: max(24px, env(safe-area-inset-bottom));
  border-radius: 28px 28px 0 0;
  background: var(--hc-surface);
  color: var(--hc-ink);
}
.hc-grabber {
  align-self: center;
  width: 44px;
  height: 5px;
  border-radius: 3px;
  background: var(--hc-key-shadow);
}
.hc-sheet-title {
  margin: 0;
  font-size: 26px;
  line-height: 1.15;
  font-weight: 800;
}
.hc-sheet-lede {
  margin: 0;
  font-size: 17px;
  line-height: 1.4;
  color: var(--hc-ink-3);
}
.hc-tips {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.hc-tip {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px;
  border-radius: 16px;
  background: var(--hc-surface-2);
}
.hc-tip-title {
  font-size: 18px;
  font-weight: 800;
}
.hc-tip-body {
  font-size: 16px;
  line-height: 1.4;
  color: var(--hc-ink-3);
}

/* ── 03c ears ──────────────────────────────────────────────────────────── */

.hc-ear {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 180px;
  border: 0;
  border-radius: 22px;
  background: var(--hc-surface);
  color: var(--hc-ink);
  font-size: 26px;
  font-weight: 800;
  box-shadow: 0 3px 0 var(--hc-key-shadow);
  cursor: pointer;
}
.hc-ear:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--hc-key-shadow);
}

/* ── 04 / 06 the round ─────────────────────────────────────────────────── */

.hc-round {
  gap: 14px;
  padding-top: max(20px, env(safe-area-inset-top));
}
.hc-progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.hc-progress-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
}
.hc-count-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.hc-count {
  font-size: 17px;
  color: var(--hc-muted);
}
.hc-count b {
  font-size: 22px;
  font-weight: 800;
  color: var(--hc-ink);
}
.hc-bar {
  height: 10px;
  border-radius: 5px;
  background: var(--hc-track);
  overflow: hidden;
}
.hc-bar span {
  display: block;
  height: 10px;
  border-radius: 5px;
  background: var(--hc-accent);
  transition: width 0.3s ease;
}
.hc-bar.practice span {
  background: var(--hc-noise-bar);
}
.hc-pause {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 16px;
  background: var(--hc-surface);
  color: var(--hc-ink);
  cursor: pointer;
}
.hc-halfway {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--hc-surface);
  box-shadow: inset 0 0 0 2px var(--hc-accent);
  font-size: 16px;
  line-height: 1.35;
}
.hc-halfway svg {
  flex-shrink: 0;
}
[data-halfway]:empty {
  display: none;
}

.hc-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 18px 18px 20px;
  border-radius: 22px;
  background: var(--hc-panel);
  color: #FFFFFF;
}
.hc-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 24px;
}
.hc-panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 18px;
  line-height: 1.3;
  font-weight: 700;
}
.hc-panel-title [data-title-icon]:empty {
  display: none;
}
.hc-panel-title [data-title-icon] {
  display: flex;
}
.hc-panel-note {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--hc-panel-muted);
  white-space: nowrap;
}
.hc-wave {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 96px;
}
.hc-wave span {
  display: block;
  width: 8px;
  height: 56px;
  border-radius: 4px;
  background: #FFFFFF;
  transform-origin: center;
  animation: hcWave 1s ease-in-out infinite;
}
.hc-wave span:nth-child(2) {
  animation-delay: 0.12s;
}
.hc-wave span:nth-child(3) {
  animation-delay: 0.24s;
}
.hc-wave span:nth-child(4) {
  animation-delay: 0.36s;
}
.hc-wave span:nth-child(5) {
  animation-delay: 0.48s;
}
.hc-wave span:nth-child(6) {
  animation-delay: 0.6s;
}
.hc-wave span:nth-child(7) {
  animation-delay: 0.72s;
}
@keyframes hcWave {
  0%,
  100% {
    transform: scaleY(0.35);
  }
  50% {
    transform: scaleY(1);
  }
}
.hc-slots {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.hc-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 96px;
  border-radius: 14px;
  background: var(--hc-panel-slot);
  color: #FFFFFF;
  font-size: 52px;
  font-weight: 800;
}
.hc-slot.empty {
  color: var(--hc-panel-empty);
}
.hc-slot.active {
  box-shadow: inset 0 0 0 3px var(--hc-accent-ring);
}
.hc-slot.right {
  box-shadow: inset 0 0 0 3px var(--hc-correct-on-dark);
}
.hc-panel-hint {
  margin: 0;
  font-size: 16px;
  color: var(--hc-panel-muted);
}

.hc-keypad {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: auto;
}
.hc-keypad.off {
  opacity: 0.45;
}
.hc-key {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 70px;
  border: 0;
  border-radius: 16px;
  background: var(--hc-surface);
  color: var(--hc-ink);
  font-size: 34px;
  font-weight: 700;
  box-shadow: 0 3px 0 var(--hc-key-shadow);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}
.hc-key:disabled {
  color: var(--hc-ink);
  opacity: 1;
  cursor: default;
}
.hc-key:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--hc-key-shadow);
}
.hc-key-back {
  background: var(--hc-key-alt);
}

/* ── 05 ready ──────────────────────────────────────────────────────────── */

.hc-done {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 700;
}
.hc-done-dot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 16px;
  background: var(--hc-accent);
  color: #FFFFFF;
}
.hc-tile {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 16px;
  border-radius: 18px;
  background: var(--hc-surface);
}
.hc-tile-num {
  font-size: 40px;
  font-weight: 800;
  line-height: 1;
}
.hc-tile-cap {
  font-size: 16px;
  line-height: 1.35;
  color: var(--hc-ink-3);
}
.hc-ready-list {
  padding: 4px 18px;
}
.hc-ready-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 0;
}
.hc-ready-row + .hc-ready-row {
  border-top: 1px solid var(--hc-line);
}
.hc-ready-row svg {
  flex-shrink: 0;
}
.hc-ready-row .hc-row-body {
  color: var(--hc-ink-3);
}

/* ── error ─────────────────────────────────────────────────────────────── */

.hc-try {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 18px;
  border-radius: 18px;
}
.hc-try-title {
  font-size: 17px;
  font-weight: 800;
}
.hc-try ul {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding-left: 20px;
  font-size: 17px;
  line-height: 1.4;
  color: var(--hc-ink-3);
}

/* ── pilot form ────────────────────────────────────────────────────────── */

.hc-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.hc-field,
.hc-fieldset {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}
.hc-field-label {
  padding: 0;
  font-size: 17px;
  font-weight: 800;
}
.hc-optional {
  font-weight: 400;
  color: var(--hc-muted);
}
.hc-input {
  height: 56px;
  padding: 0 14px;
  border: 2px solid var(--hc-track);
  border-radius: 14px;
  background: var(--hc-surface);
  font-size: 18px;
}
.hc-input:focus {
  border-color: var(--hc-accent);
  outline: none;
}
.hc-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.hc-choice {
  position: relative;
}
.hc-choice input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
}
.hc-choice span {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 16px;
  border-radius: 14px;
  background: var(--hc-surface);
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
}
.hc-choice input:checked + span {
  background: var(--hc-accent);
  color: #FFFFFF;
}
.hc-choice input:focus-visible + span {
  outline: 3px solid var(--hc-accent);
  outline-offset: 3px;
}
.hc-form-error {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--hc-ink);
}
.hc-form-error:empty {
  display: none;
}

/* ── 08 result ─────────────────────────────────────────────────────────── */

.hc-result {
  gap: 14px;
  min-height: 0;
  padding-bottom: max(28px, env(safe-area-inset-bottom));
}
.hc-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 18px 16px 22px;
  border-radius: 22px;
  background: var(--hc-surface);
}
.hc-hero-label {
  align-self: flex-start;
  font-size: 17px;
  color: var(--hc-muted);
}
.hc-chart {
  display: block;
  width: 100%;
  height: auto;
  font-family: var(--hc-font);
}
.hc-chart-dial {
  max-width: 300px;
}
.hc-band {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 6px;
}
.hc-band svg {
  flex-shrink: 0;
}
.hc-h1-result {
  line-height: 1.1;
  text-align: center;
}
.hc-summary {
  margin: 4px 0 0;
  font-size: 18px;
  line-height: 1.45;
  color: var(--hc-ink-2);
  text-align: center;
  text-wrap: pretty;
}
.hc-tile-stat {
  gap: 10px;
}
.hc-tile-top {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 60px;
}
.hc-tile-top svg {
  flex-shrink: 0;
  margin-bottom: 4px;
}
.hc-noisebar {
  flex-shrink: 0;
  width: 18px;
  height: 60px;
  border-radius: 4px 4px 0 0;
  background: var(--hc-noise-bar);
}
.hc-voicebar {
  flex-shrink: 0;
  width: 18px;
  border-radius: 4px 4px 0 0;
  background: var(--hc-accent);
}
.hc-big {
  margin-left: 8px;
  font-size: 38px;
  font-weight: 800;
  line-height: 1;
}
.hc-big-flush,
.hc-big-solo {
  margin-left: 0;
}
.hc-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 16px 14px;
  border-radius: 22px;
  background: var(--hc-surface);
}
.hc-section-track {
  padding-bottom: 16px;
}
.hc-h2 {
  margin: 0;
  font-size: 19px;
  font-weight: 800;
}
.hc-h2-17 {
  font-size: 17px;
}
.hc-sub {
  margin: 0;
  font-size: 16px;
  line-height: 1.4;
  color: var(--hc-ink-3);
}
.hc-sub-loose {
  line-height: 1.45;
}
.hc-track-legend {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  color: var(--hc-muted);
}
.hc-cant {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px 4px 2px;
}
.hc-dark {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px 18px;
  border-radius: 22px;
  background: var(--hc-panel);
  color: #FFFFFF;
}
.hc-dark-title {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
  font-weight: 800;
}
.hc-dark-body {
  margin: 0;
  font-size: 16px;
  line-height: 1.45;
  color: var(--hc-dark-body);
}
/* The result's one booking button (Kiarash 2026-09-27: the early one went, and
   this one took its colour: the primary button's accent and pressed shadow). */
.hc-btn-card {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 60px;
  border-radius: 16px;
  background: var(--hc-accent);
  color: #FFFFFF;
  font-size: 20px;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 4px 0 var(--hc-accent-press);
  transition: transform 0.06s ease, box-shadow 0.06s ease;
}
a.hc-btn-card:hover {
  color: #FFFFFF;
}
/* The unbranded page renders booking and call as buttons that show a note. */
button.hc-btn-card,
button.hc-call {
  width: 100%;
  border: 0;
  font-family: inherit;
  cursor: pointer;
}
button.hc-call {
  width: auto;
  background: none;
  text-decoration: underline;
}
.hc-toast {
  position: fixed;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  z-index: 30;
  transform: translateX(-50%);
  width: max-content;
  max-width: min(440px, calc(100% - 40px));
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--hc-ink);
  color: #FFFFFF;
  font-size: 16px;
  line-height: 1.35;
  box-shadow: 0 8px 24px rgba(15, 27, 45, 0.25);
}
.hc-btn-card:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--hc-accent-press);
}
.hc-call,
a.hc-call:hover {
  align-self: center;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 4px;
  color: #FFFFFF;
  font-size: 17px;
  text-underline-offset: 3px;
}
.hc-dark :focus-visible {
  outline-color: #FFFFFF;
}
/* The code, inside the booking card (Kiarash 2026-09-28). */
.hc-coupon {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 12px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--hc-panel-slot);
  box-shadow: inset 0 0 0 2px var(--hc-panel-empty);
}
.hc-coupon-label {
  font-size: 15px;
  font-weight: 700;
  color: var(--hc-panel-muted);
}
.hc-coupon-note {
  font-size: 15px;
  line-height: 1.35;
  color: var(--hc-panel-muted);
}
.hc-coupon-code {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #FFFFFF;
  font-variant-numeric: tabular-nums;
}
.hc-coupon[data-state='pending'] .hc-coupon-code,
.hc-coupon[data-state='failed'] .hc-coupon-code {
  color: var(--hc-panel-empty);
}
.hc-coupon-retry {
  grid-column: 1 / -1;
  justify-self: start;
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: 12px;
  background: #FFFFFF;
  color: var(--hc-ink);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

/* Keep your result: save, share, invite. */
.hc-keep-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}
.hc-keep-invite {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--hc-line);
}
.hc-btn2-icon {
  gap: 10px;
}
.hc-btn2-icon svg {
  flex-shrink: 0;
}
.hc-btn2-outline {
  background: var(--hc-surface);
  color: var(--hc-accent);
  box-shadow: inset 0 0 0 2px var(--hc-accent);
}
a.hc-btn2-outline:hover {
  color: var(--hc-accent);
}
.hc-share-status:empty {
  display: none;
}

.hc-foot {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.hc-credit {
  font-size: 15px;
  line-height: 1.45;
  color: var(--hc-muted);
  text-align: center;
}

.hc-pilot {
  box-shadow: inset 0 0 0 2px var(--hc-ink);
}
.hc-pilot .hc-btn2 {
  background: var(--hc-surface-2);
  box-shadow: inset 0 0 0 2px var(--hc-track);
}
.hc-details summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  font-weight: 700;
  cursor: pointer;
}
.hc-table-wrap {
  overflow-x: auto;
}
.hc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}
.hc-table th,
.hc-table td {
  padding: 4px 6px;
  border-bottom: 1px solid var(--hc-line);
  text-align: right;
}

/* ── one step, one screen (Kiarash 2026-09-28) ──────────────────────────
   The design's frames are 390×844, the whole device; in a phone browser the
   bars leave 660–750 px, so every step scrolled. Vertical sizes now scale with
   the visible height (dvh): at 844 they equal the design, below it they
   tighten to fit, never under the floors (body 15px+, keys 50px, buttons 52px).
   Every step except the result and the pilot form fits 390×664 (iPhone Safari
   with its bars showing); tools/hearing-test/smoke.mjs checks each one. */

:root {
  --hc-v: 1vh;
}
@supports (height: 1dvh) {
  :root {
    --hc-v: 1dvh;
  }
}

.hc-screen:not(.hc-result) {
  gap: clamp(10px, calc(var(--hc-v) * 2.4), 20px);
  padding-top: max(clamp(12px, calc(var(--hc-v) * 2.8), 24px), env(safe-area-inset-top));
  padding-bottom: max(clamp(12px, calc(var(--hc-v) * 2.8), 24px), env(safe-area-inset-bottom));
}
.hc-screen-top:not(.hc-result) {
  padding-top: max(clamp(8px, calc(var(--hc-v) * 1.9), 16px), env(safe-area-inset-top));
}
.hc-screen:not(.hc-result) .hc-h1 {
  font-size: clamp(26px, calc(var(--hc-v) * 4), 34px);
}
.hc-screen:not(.hc-result) .hc-h1-36 {
  font-size: clamp(28px, calc(var(--hc-v) * 4.3), 36px);
}
.hc-screen:not(.hc-result) .hc-lede {
  font-size: clamp(17px, calc(var(--hc-v) * 2.25), 19px);
}
.hc-screen:not(.hc-result) .hc-btn {
  height: clamp(52px, calc(var(--hc-v) * 8), 68px);
  font-size: clamp(19px, calc(var(--hc-v) * 2.6), 22px);
}
.hc-screen:not(.hc-result) .hc-btn2 {
  height: clamp(48px, calc(var(--hc-v) * 6.6), 56px);
}
.hc-stack-8 {
  gap: clamp(4px, calc(var(--hc-v) * 0.95), 8px);
}

/* 01 intro: compact steps, no lede (the pill and the steps say it). */
.hc-intro:not(.hc-result) {
  gap: clamp(8px, calc(var(--hc-v) * 1.8), 20px);
}
.hc-intro .hc-h1 {
  line-height: 1.08;
}
.hc-intro .hc-trust {
  align-items: center;
}
.hc-intro .hc-trust-text strong {
  font-size: 16px;
  line-height: 1.25;
}
.hc-intro .hc-trust-text > span {
  font-size: 15px;
}
.hc-about-link {
  align-items: center;
  margin-top: 0;
}
.hc-trust-chevron {
  display: flex;
  flex-shrink: 0;
  color: var(--hc-accent);
}
.hc-intro .hc-h1-sub {
  font-size: clamp(18px, calc(var(--hc-v) * 2.6), 22px);
}
.hc-intro .hc-trust {
  padding-block: clamp(10px, calc(var(--hc-v) * 1.66), 14px) clamp(8px, calc(var(--hc-v) * 1.4), 12px);
}
.hc-intro .hc-steps {
  padding: 2px 16px;
}
.hc-intro .hc-step-row {
  gap: 14px;
  padding: clamp(8px, calc(var(--hc-v) * 1.5), 14px) 0;
}
.hc-intro .hc-num {
  width: clamp(34px, calc(var(--hc-v) * 5.2), 44px);
  height: clamp(34px, calc(var(--hc-v) * 5.2), 44px);
  border-radius: 10px;
  font-size: clamp(18px, calc(var(--hc-v) * 2.6), 22px);
}
.hc-intro .hc-row-title {
  font-size: 18px;
}
.hc-intro .hc-row-body {
  font-size: 16px;
  line-height: 1.35;
}
.hc-intro .hc-banner-tint {
  padding: clamp(10px, calc(var(--hc-v) * 1.66), 14px) 16px;
  font-size: 16px;
}
.hc-intro .hc-link {
  min-height: 44px;
  padding-block: 6px;
}

/* 02 mode */
.hc-mode {
  gap: clamp(8px, calc(var(--hc-v) * 1.66), 14px);
  padding: clamp(12px, calc(var(--hc-v) * 2.1), 18px) 18px;
}
.hc-mode-icon {
  width: clamp(46px, calc(var(--hc-v) * 7.6), 64px);
  height: clamp(46px, calc(var(--hc-v) * 7.6), 64px);
}
.hc-mode-icon svg {
  width: clamp(28px, calc(var(--hc-v) * 4.5), 38px);
  height: clamp(28px, calc(var(--hc-v) * 4.5), 38px);
}
.hc-stack-14 {
  gap: clamp(10px, calc(var(--hc-v) * 1.66), 14px);
}

/* 03 volume */
.hc-volume-card {
  gap: clamp(8px, calc(var(--hc-v) * 1.5), 18px);
  padding: clamp(14px, calc(var(--hc-v) * 3.1), 26px) 18px clamp(12px, calc(var(--hc-v) * 2.4), 20px);
}
.hc-orb {
  width: clamp(80px, calc(var(--hc-v) * 12.5), 124px);
  height: clamp(80px, calc(var(--hc-v) * 12.5), 124px);
}
.hc-inset {
  padding: clamp(10px, calc(var(--hc-v) * 1.66), 14px);
}
.hc-inset svg {
  width: clamp(34px, calc(var(--hc-v) * 5.2), 44px);
  height: clamp(34px, calc(var(--hc-v) * 5.2), 44px);
}
.hc-banner-dark {
  padding: clamp(10px, calc(var(--hc-v) * 1.66), 14px) 16px;
}

/* 03c ears */
.hc-ear {
  height: clamp(116px, calc(var(--hc-v) * 21.3), 180px);
  gap: clamp(6px, calc(var(--hc-v) * 1.4), 12px);
}
.hc-screen:not(.hc-result) .hc-btn2-60 {
  height: clamp(48px, calc(var(--hc-v) * 7.1), 60px);
}

/* 04 / 06 the round */
.hc-round:not(.hc-result) {
  gap: clamp(8px, calc(var(--hc-v) * 1.66), 14px);
}
.hc-panel {
  gap: clamp(10px, calc(var(--hc-v) * 1.9), 16px);
  padding: clamp(12px, calc(var(--hc-v) * 2.1), 18px) 18px clamp(12px, calc(var(--hc-v) * 2.4), 20px);
}
.hc-slot {
  height: clamp(60px, calc(var(--hc-v) * 11.4), 96px);
  font-size: clamp(40px, calc(var(--hc-v) * 6.2), 52px);
}
.hc-wave {
  height: clamp(60px, calc(var(--hc-v) * 11.4), 96px);
}
.hc-wave span {
  height: clamp(36px, calc(var(--hc-v) * 6.6), 56px);
}
.hc-keypad {
  gap: clamp(8px, calc(var(--hc-v) * 1.2), 10px);
}
.hc-key {
  height: clamp(50px, calc(var(--hc-v) * 8.3), 70px);
  font-size: clamp(28px, calc(var(--hc-v) * 4), 34px);
}
/* The halfway banner floats over the Next button instead of pushing the
   keypad down: it shows while the numbers play (keypad and Next are off) and
   goes at the first key press or after 4 s, so it never covers anything live. */
.hc-round {
  position: relative;
}
.hc-round [data-halfway] {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: max(clamp(12px, calc(var(--hc-v) * 2.8), 24px), env(safe-area-inset-bottom));
  z-index: 2;
}
.hc-halfway {
  padding: clamp(10px, calc(var(--hc-v) * 1.66), 14px) 14px;
  box-shadow: inset 0 0 0 2px var(--hc-accent), 0 8px 24px rgba(15, 27, 45, 0.18);
}

/* 05 ready */
.hc-tile-num {
  font-size: clamp(32px, calc(var(--hc-v) * 4.7), 40px);
}
.hc-screen:not(.hc-result) .hc-tile {
  padding: clamp(12px, calc(var(--hc-v) * 1.9), 16px);
}
.hc-ready-row {
  padding: clamp(10px, calc(var(--hc-v) * 1.9), 16px) 0;
}

/* loading, paused, error */
.hc-disc {
  width: clamp(80px, calc(var(--hc-v) * 13.3), 112px);
  height: clamp(80px, calc(var(--hc-v) * 13.3), 112px);
}
.hc-mt-56 {
  margin-top: clamp(8px, calc(var(--hc-v) * 6.6), 56px);
}
.hc-mt-120 {
  margin-top: clamp(24px, calc(var(--hc-v) * 14.2), 120px);
}

/* ── motion ────────────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .hc-wave span {
    animation: none;
    transform: scaleY(0.6);
  }
  .hc-orb.playing .hc-pulse {
    animation: none;
    opacity: 0;
  }
  .hc-btn,
  .hc-btn-card,
  .hc-bar span,
  .hc-loadbar span {
    transition: none;
  }
}
