:root {
  color-scheme: light;
  --ink: #243447;
  --muted: #65758a;
  --line: #dce8e0;
  --soft-line: #edf3ee;
  --bg: #f5faf5;
  --surface: #ffffff;
  --leaf: #6aaf67;
  --leaf-dark: #4a7a4a;
  --sun: #ffd84d;
  --sky: #3f8df3;
  --coral: #ff7d63;
  --violet: #7568e8;
  --mint: #dff7ea;
  --shadow: 0 18px 44px rgba(36, 52, 71, 0.13);
  --app-height: 100dvh;
  --app-width: 100vw;
  --bottom-safe: max(22px, env(safe-area-inset-bottom));
  --setup-control-height: 68px;
  --game-bubble-font-size: clamp(22px, 2.4vw, 30px);
  --game-bubble-mobile-font-size: clamp(21px, 5.4vw, 28px);
  --game-cta-font-size: clamp(26px, 3.4vw, 38px);
  --game-cta-mobile-font-size: clamp(24px, 6vw, 32px);
  --story-dialogue-font-size: clamp(36px, 4.8vw, 58px);
  --story-dialogue-mobile-font-size: clamp(30px, 7.6vw, 42px);
  --attention-pulse-duration: 0.9s;
}

/* Standalone hearing-only additions. Existing parity pages continue to use the
   source project's original selectors above. */
.hearing-standalone-shell [hidden] {
  display: none !important;
}

.hearing-completion-screen {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: max(28px, env(safe-area-inset-top)) max(28px, env(safe-area-inset-right)) max(28px, env(safe-area-inset-bottom)) max(28px, env(safe-area-inset-left));
}

.hearing-completion-card {
  width: min(680px, 92vw);
  min-height: min(620px, 84dvh);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 36px;
  border: 3px solid #c9ddd2;
  border-radius: 32px;
  background: rgba(255, 253, 247, 0.96);
  box-shadow: 0 18px 40px rgba(42, 83, 62, 0.14);
  text-align: center;
}

.hearing-completion-card .character-container {
  width: min(300px, 46vw);
  aspect-ratio: 304 / 375;
}

.hearing-completion-card h1 {
  margin: 0;
  color: #243447;
  font-size: clamp(34px, 5vw, 58px);
}

.hearing-completion-card p {
  margin: 0;
  color: #496254;
  font-size: clamp(21px, 2.4vw, 30px);
}

.hearing-completion-actions {
  display: flex;
  justify-content: center;
}

.hearing-admin-page {
  min-height: 100vh;
  padding: 32px;
  background: #f5fbf7;
  color: #243447;
  font-family: "Noto Sans SC", "PingFang SC", sans-serif;
}

.hearing-admin-login {
  min-height: calc(100vh - 64px);
  display: grid;
  place-items: center;
}

.hearing-admin-login > div,
.hearing-admin-shell,
.hearing-admin-detail {
  border: 2px solid #c9ddd2;
  border-radius: 24px;
  background: #fffdf7;
  box-shadow: 0 12px 30px rgba(42, 83, 62, 0.12);
}

.hearing-admin-login > div {
  width: min(520px, 92vw);
  display: grid;
  gap: 18px;
  padding: 36px;
}

.hearing-admin-login input {
  min-height: 56px;
  padding: 0 16px;
  border: 2px solid #bdd2c5;
  border-radius: 14px;
  font-size: 22px;
}

.hearing-admin-shell {
  width: min(1240px, 100%);
  margin: 0 auto;
  padding: 24px;
}

.hearing-admin-shell > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.hearing-admin-shell > header > div:last-child {
  display: flex;
  gap: 12px;
}

.hearing-admin-table-wrap {
  overflow-x: auto;
}

.hearing-admin-page table {
  width: 100%;
  border-collapse: collapse;
  font-size: 17px;
}

.hearing-admin-page th,
.hearing-admin-page td {
  padding: 14px 12px;
  border-bottom: 1px solid #dbe8df;
  text-align: left;
}

.hearing-admin-page tbody tr {
  cursor: pointer;
}

.hearing-admin-page tbody tr:hover {
  background: #eef8f1;
}

.hearing-admin-detail {
  margin-top: 24px;
  padding: 24px;
}

@media (max-width: 720px) {
.hearing-admin-page { padding: 14px; }

.hearing-admin-shell > header { align-items: flex-start; flex-direction: column; }

}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  width: 100%;
  height: var(--app-height);
  min-height: 0;
  max-height: var(--app-height);
  overflow: hidden;
  overscroll-behavior-x: none;
}

body {
  margin: 0;
  overflow: hidden;
  background:
    linear-gradient(0deg, rgba(255, 255, 255, 0.44), rgba(255, 255, 255, 0.44)),
    repeating-linear-gradient(90deg, rgba(34, 169, 107, 0.07) 0 1px, transparent 1px 56px),
    repeating-linear-gradient(0deg, rgba(63, 141, 243, 0.06) 0 1px, transparent 1px 56px),
    var(--bg);
  color: var(--ink);
  font-family:
    Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 20px;
  letter-spacing: 0;
}

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

button {
  border: 0;
  cursor: pointer;
  touch-action: manipulation;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.46;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 56px;
  line-height: 1.05;
}

h2 {
  margin-bottom: 0;
  font-size: 34px;
  line-height: 1.14;
}

h3 {
  margin-bottom: 12px;
  font-size: 34px;
  line-height: 1.12;
}

h4 {
  margin-bottom: 16px;
  font-size: 34px;
  line-height: 1.2;
}

.setup-screen {
  position: relative;
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  overflow: hidden;
  overscroll-behavior-x: none;
  padding: 28px;
  background-color: #FDFBF7;
}

.setup-screen::before,
.setup-screen::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(100px);
  will-change: transform, opacity;
}

.setup-screen::before {
  width: 74vmin; height: 74vmin;
  top: -20%; left: -14%;
  background: radial-gradient(circle, rgba(170,220,195,0.78) 0%, rgba(170,220,195,0.30) 50%, transparent 72%);
  animation: ambientGlowA 8s ease-in-out infinite;
}

.setup-screen::after {
  width: 60vmin; height: 60vmin;
  bottom: -6%; right: -4%;
  background: radial-gradient(circle, rgba(255,238,188,0.70) 0%, rgba(255,238,188,0.24) 50%, transparent 72%);
  animation: ambientGlowB 10s ease-in-out infinite;
}

@keyframes ambientGlowA {
  0%,100% { transform: scale(0.92); opacity: 0.65; }
  50%     { transform: scale(1.12); opacity: 1; }
}

@keyframes ambientGlowB {
  0%,100% { transform: scale(0.88); opacity: 0.55; }
  50%     { transform: scale(1.15); opacity: 1; }
}

.floating-stars {
  position: absolute;
  inset: 0;
  display: none;
  pointer-events: none;
}

.floating-stars i {
  position: absolute;
  width: 32px;
  height: 32px;
  background: var(--sun);
  clip-path: polygon(50% 0, 61% 34%, 96% 35%, 68% 56%, 79% 91%, 50% 70%, 21% 91%, 32% 56%, 4% 35%, 39% 34%);
  opacity: 0.55;
  animation: twinkle 2.4s ease-in-out infinite;
}

.floating-stars i:nth-child(1) {
  left: 10%;
  top: 16%;
}

.floating-stars i:nth-child(2) {
  right: 12%;
  top: 20%;
  background: var(--coral);
  animation-delay: 0.45s;
}

.floating-stars i:nth-child(3) {
  right: 18%;
  bottom: 14%;
  background: var(--sky);
  animation-delay: 0.8s;
}

.setup-panel {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(250px, 0.75fr);
  gap: clamp(26px, 4vw, 54px);
  align-items: center;
  width: min(1100px, 94vw);
  padding: clamp(28px, 4dvh, 42px) clamp(34px, 5vw, 60px);
  border: 1.5px solid rgba(255,255,255,0.55);
  border-radius: 20px;
  background: rgba(255,255,255,0.62);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 8px 40px rgba(120,140,130,0.10), 0 2px 8px rgba(120,140,130,0.06);
}

.drawer-brand,
.drawer-task {
  display: flex;
  align-items: center;
}

.setup-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-auto-rows: minmax(0, auto);
  gap: 15px;
}

.setup-left {
  min-width: 0;
}

.setup-play-zone {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 20px;
  min-height: 100%;
}

.field {
  display: grid;
  gap: 10px;
  color: var(--ink);
  font-size: 22px;
  font-weight: 900;
}

.field > span {
  color: var(--muted);
  font-size: 20px;
  font-weight: 900;
  padding-left: 4px;
}

.field input,
.field select {
  width: 100%;
  min-width: 0;
  border: 3px solid var(--line);
  border-left: 5px solid var(--leaf);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field input,
.field select {
  height: var(--setup-control-height);
  min-height: var(--setup-control-height);
  padding: 0 18px;
  font-size: 24px;
  font-weight: 900;
}

.field.invalid input,
.field.invalid select,
.field.invalid .segment-option {
  border-color: #ef4c3f;
  border-left-color: #ef4c3f;
  background: #fff3f0;
  box-shadow: 0 0 0 4px rgba(239, 76, 63, 0.14);
}

.field input:focus,
.field select:focus {
  border-color: var(--leaf);
  border-left-color: var(--leaf-dark);
  box-shadow: 0 0 0 5px rgba(34, 169, 107, 0.18);
}

.segmented-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: var(--setup-control-height);
  gap: 12px;
}

.edu-segment-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.segment-option {
  height: var(--setup-control-height);
  min-height: 0;
  border: 2.5px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-size: 22px;
  font-weight: 950;
  box-shadow: 0 4px 0 #cddbd2;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.segment-option:hover:not(.picked) {
  border-color: var(--leaf);
  background: var(--mint);
}

.segment-option.picked {
  border-color: var(--leaf);
  background: var(--leaf);
  color: #fff;
  box-shadow: 0 4px 0 var(--leaf-dark);
}

.setup-age-note {
  margin: 16px 0 0;
  color: var(--leaf-dark);
  font-size: 18px;
  font-weight: 850;
  text-align: center;
}

.setup-age-note.warning {
  color: #d7392f;
}

.setup-voice-button {
  z-index: 2;
  min-height: 66px;
  padding: 18px 42px;
  border: 3px solid var(--leaf);
  border-radius: 999px;
  background: #fff;
  color: var(--leaf);
  font-size: 26px;
  font-weight: 950;
  box-shadow: 0 6px 18px rgba(34, 169, 107, 0.12);
  transition: all 0.2s;
}

.setup-voice-button:hover {
  background: var(--leaf);
  color: #fff;
  transform: translateY(-2px);
}

.setup-voice-button.recording {
  border-color: #ff4757;
  background: #ff4757;
  color: #fff;
  animation: pulseGreen var(--attention-pulse-duration) ease-in-out infinite;
}

.setup-voice-button.transcribing {
  border-color: #cddbd2;
  background: #f4f7f5;
  color: #758393;
  box-shadow: none;
  cursor: not-allowed;
}

.primary,
.secondary,
.option,
.drawer-item,
.drawer-hearing-link,
.drawer-section-toggle,
.drawer-task {
  border-radius: 12px;
  min-height: 46px;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    border-color 0.16s ease,
    background 0.16s ease;
}

.primary,
.secondary {
  padding: 12px 20px;
  color: #fff;
  font-weight: 900;
}

.primary {
  background: var(--leaf);
  box-shadow: 0 5px 0 var(--leaf-dark);
}

.secondary {
  background: var(--sky);
  box-shadow: 0 5px 0 #2167bf;
}

.big-button {
  min-width: 178px;
  min-height: 76px;
  font-size: 28px;
}

.setup-start-button {
  position: relative;
  z-index: 1;
  display: grid;
  width: clamp(190px, 22vw, 280px);
  height: clamp(190px, 22vw, 280px);
  min-height: 0;
  place-items: center;
  align-content: center;
  border: 8px solid #e9fff1;
  border-radius: 999px;
  background: #5b8c5a;
  box-shadow:
    0 10px 0 #0f5f35,
    0 24px 42px rgba(18,122,73,0.24);
  color: #fff;
  text-align: center;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.setup-start-button span {
  display: block;
  font-size: clamp(40px, 5vw, 62px);
  font-weight: 1000;
  line-height: 0.98;
  color: #fff;
}

.setup-start-button small {
  display: block;
  margin-top: 4px;
  font-size: clamp(40px, 5vw, 62px);
  font-weight: 1000;
  line-height: 0.98;
}

.primary:hover,
.secondary:hover,
.option:hover,
.drawer-item:hover,
.drawer-hearing-link:hover,
.drawer-section-toggle:hover,
.drawer-task:hover {
  transform: translateY(-1px);
}

.primary:active,
.secondary:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.22);
}

.app-shell {
  position: relative;
  width: 100%;
  height: var(--app-height);
  max-height: var(--app-height);
  overflow: hidden;
  overscroll-behavior-x: none;
}

.app-shell::before,
.app-shell::after {
  content: "";
  position: absolute;
  z-index: 0;
  pointer-events: none;
}

.app-shell::before {
  left: 86px;
  bottom: 30px;
  width: 104px;
  height: 44px;
  border-radius: 999px;
  background: #e9f7ff;
  box-shadow: 34px 12px 0 #e9f7ff, -24px 14px 0 #e9f7ff;
  opacity: 0.68;
}

.app-shell::after {
  right: 110px;
  bottom: 84px;
  width: 42px;
  height: 42px;
  background: var(--sun);
  clip-path: polygon(50% 0, 61% 34%, 96% 35%, 68% 56%, 79% 91%, 50% 70%, 21% 91%, 32% 56%, 4% 35%, 39% 34%);
  opacity: 0.55;
  animation: twinkle 2.4s ease-in-out infinite;
}

.icon-button {
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font-size: 28px;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(36, 52, 71, 0.1);
}

.hidden-drawer {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
}

.drawer-mask {
  position: absolute;
  inset: 0;
  opacity: 0;
  background: rgba(20, 31, 43, 0.24);
  transition: opacity 0.18s ease;
}

.drawer-panel {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: min(360px, 86vw);
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 100dvh;
  padding: 22px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  border-right: 2px solid var(--soft-line);
  background: #fff;
  box-shadow: var(--shadow);
  transform: translateX(-104%);
  transition: transform 0.22s ease;
  -webkit-overflow-scrolling: touch;
}

.drawer-panel > * {
  flex-shrink: 0;
}

.hidden-drawer.open {
  pointer-events: auto;
}

.hidden-drawer.open .drawer-mask {
  opacity: 1;
}

.hidden-drawer.open .drawer-panel {
  transform: translateX(0);
}

.drawer-brand {
  gap: 12px;
  margin-bottom: 8px;
}

.drawer-logo {
  width: 58px;
  height: 58px;
  border: 2px solid #e3efe5;
  border-radius: 20px;
  object-fit: contain;
  background: #fff;
}

.drawer-brand div {
  display: grid;
  min-width: 0;
}

.drawer-brand strong {
  font-size: 22px;
}

.drawer-brand span {
  overflow: hidden;
  color: var(--muted);
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drawer-item {
  width: 100%;
  padding: 0 16px;
  border: 2px solid var(--soft-line);
  background: #fff;
  color: var(--ink);
  font-weight: 900;
  text-align: left;
}

.drawer-hearing-link,
.drawer-section-toggle {
  width: 100%;
  min-height: 62px;
  padding: 0 16px;
  border: 2px solid var(--soft-line);
  border-radius: 12px;
  font-weight: 950;
  text-align: left;
}

.drawer-hearing-link {
  background: var(--mint);
  color: var(--leaf-dark);
}

.drawer-hearing-link.active {
  border-color: var(--leaf);
  background: #dff5e8;
}

.drawer-section-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #fff;
  color: var(--ink);
}

.drawer-section-toggle em {
  color: var(--leaf-dark);
  font-size: 16px;
  font-style: normal;
}

.drawer-section-toggle::after {
  content: "⌄";
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  transition: transform 0.16s ease;
}

.drawer-section-toggle.open::after {
  transform: rotate(180deg);
}

.drawer-task-list {
  display: none;
  align-content: start;
  gap: 8px;
  overflow: visible;
  padding: 0 2px 18px 0;
}

.drawer-task-list.open {
  display: grid;
}

.drawer-spacer {
  flex: 1 1 auto;
  min-height: 18px;
}

.drawer-task {
  justify-content: flex-start;
  gap: 10px;
  width: 100%;
  padding: 9px 11px;
  border: 2px solid transparent;
  background: #f8fbf8;
  color: var(--ink);
  text-align: left;
}

.drawer-task span {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 999px;
  background: #e8efe9;
  color: var(--muted);
  font-size: 16px;
  font-weight: 900;
}

.drawer-task strong {
  overflow: hidden;
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drawer-task.active {
  border-color: var(--leaf);
  background: #f0fbf4;
}

.drawer-task.done span {
  background: var(--leaf);
  color: #fff;
}

.draft-resume-actions .big-button {
  min-height: 72px;
}

.single-page {
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  overscroll-behavior-x: none;
  -webkit-overflow-scrolling: touch;
}

.hearing-page {
  display: grid;
  place-items: stretch center;
  padding: clamp(8px, 1.5dvh, 16px) clamp(10px, 2.5vw, 28px) var(--bottom-safe);
}

.hearing-card {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: clamp(14px, 2dvh, 22px);
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: clamp(20px, 3dvh, 34px) clamp(22px, 4vw, 48px);
  overflow: auto;
  border: 2px solid var(--soft-line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 28px rgba(36, 52, 71, 0.08);
  -webkit-overflow-scrolling: touch;
}

.hearing-step-card {
  align-content: center;
}

.hearing-intro-card {
  place-items: center;
  align-items: center;
  min-height: 0;
}

.hearing-intro-layout {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(280px, 1fr);
  align-items: center;
  justify-content: center;
  gap: clamp(34px, 5vw, 86px);
  width: min(920px, 100%);
}

.hearing-intro-main {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: clamp(18px, 2.6dvh, 30px);
  min-width: 0;
  text-align: center;
}

.hearing-hero-icon {
  display: grid;
  place-items: center;
  width: clamp(210px, 20vw, 280px);
  aspect-ratio: 1;
  justify-self: center;
  border: 2px solid #d8e9ff;
  border-radius: 12px;
  background: linear-gradient(180deg, #f5fbff, #ffffff);
  box-shadow: inset 0 -8px 0 rgba(63, 141, 243, 0.08);
}

.hearing-copy {
  display: grid;
  gap: 12px;
  justify-items: center;
  min-width: 0;
}

.hearing-copy h3 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(38px, 5vw, 58px);
  line-height: 1.05;
}

.hearing-instruction,
.hearing-summary-note {
  margin: 0;
  color: var(--muted);
  font-size: clamp(20px, 2.5vw, 28px);
  font-weight: 900;
  line-height: 1.45;
  text-align: center;
}

.hearing-check-row {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  width: 100%;
}

.hearing-check-button {
  min-width: clamp(150px, 14vw, 190px);
}

.hearing-env-status {
  display: inline-grid;
  min-height: 46px;
  place-items: center;
  padding: 8px 16px;
  border-radius: 999px;
  background: #f7faf7;
  color: var(--muted);
  font-size: 18px;
  font-weight: 950;
}

.hearing-env-status.quiet {
  background: var(--mint);
  color: var(--leaf-dark);
}

.hearing-env-status.noisy {
  background: #fff1d2;
  color: #9a6400;
}

.hearing-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  width: 100%;
}

.hearing-start-button {
  min-width: clamp(210px, 18vw, 260px);
}

.hearing-stage-label {
  display: inline-grid;
  min-height: 36px;
  place-items: center;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--mint);
  color: var(--leaf-dark);
  font-size: 18px;
  font-weight: 950;
}

.hearing-ear-target {
  position: relative;
  display: grid;
  place-items: center;
  gap: 8px;
  width: clamp(180px, 24vw, 240px);
  aspect-ratio: 1;
  padding: 14px;
  border: 3px solid #d8e9ff;
  border-radius: 12px;
  background: #f5fbff;
  overflow: hidden;
}

.hearing-focus-row .hearing-ear-target:not(.compact) {
  align-self: center;
  width: clamp(190px, 28vmin, 250px);
}

.hearing-focus-row {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  justify-content: center;
  gap: clamp(22px, 4vw, 52px);
  width: 100%;
}

.hearing-ear-target.left {
  border-color: #d8e9ff;
  background: linear-gradient(90deg, #e8f3ff 0 34%, #f8fcff 34% 100%);
}

.hearing-ear-target.right {
  border-color: #cdebd8;
  background: linear-gradient(90deg, #f8fff9 0 66%, #e9f9f0 66% 100%);
}

.hearing-ear-target::before {
  content: "";
  position: absolute;
  top: 14px;
  bottom: 14px;
  width: 18px;
  border-radius: 999px;
  opacity: 0.95;
}

.hearing-ear-target.left::before {
  left: 14px;
  background: var(--sky);
  box-shadow: 20px 22px 0 rgba(63, 141, 243, 0.18), 20px -22px 0 rgba(63, 141, 243, 0.18);
}

.hearing-ear-target.right::before {
  right: 14px;
  background: var(--leaf);
  box-shadow: -20px 22px 0 rgba(41, 171, 110, 0.18), -20px -22px 0 rgba(41, 171, 110, 0.18);
}

.hearing-ear-target.compact {
  width: clamp(130px, 16vw, 170px);
}

.hearing-ear-target strong {
  color: var(--ink);
  font-size: clamp(22px, 2.6vw, 30px);
  font-weight: 1000;
}

.hearing-ear-target.right .ear-illustration {
  justify-self: end;
  margin-right: 26px;
}

.hearing-ear-target.compact .ear-illustration {
  width: min(110px, 74%);
}

.hearing-ear-target.left .ear-illustration {
  justify-self: start;
  margin-left: 26px;
  transform: scaleX(-1);
}

.hearing-ear-target.left .sound-wave {
  stroke: var(--sky);
}

.hearing-play-button {
  margin: 2px 0;
}

.hearing-response-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  gap: 14px;
  width: min(620px, 100%);
}

.hearing-response-slot {
  display: grid;
  place-items: center;
  width: min(620px, 100%);
  min-height: clamp(86px, 12dvh, 112px);
  visibility: hidden;
  pointer-events: none;
}

.hearing-response-slot.ready {
  visibility: visible;
  pointer-events: auto;
}

.hearing-response-slot .hearing-response-grid {
  width: 100%;
}

.hearing-response-grid .option {
  min-height: clamp(76px, 11dvh, 98px);
  font-size: clamp(24px, 3vw, 32px);
}

.hearing-heard,
.hearing-missed {
  border-color: var(--leaf);
  background: var(--mint);
  color: var(--leaf-dark);
  font-weight: 900;
}

.hearing-test-card {
  width: 100%;
  align-content: stretch;
  grid-template-rows: auto minmax(170px, 1fr) auto minmax(96px, auto) minmax(36px, auto);
}

.hearing-meter-row {
  align-self: center;
  display: grid;
  grid-template-columns: minmax(130px, 0.85fr) repeat(2, minmax(150px, 1fr));
  gap: 14px;
  width: 100%;
  align-items: stretch;
}

.hearing-stimulus-panel {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 138px;
  padding: 14px;
  border: 2px solid #d9e6de;
  border-radius: 12px;
  background: #fff;
}

.hearing-stimulus-panel span,
.hearing-summary-item span {
  color: var(--muted);
  font-size: 18px;
  font-weight: 950;
}

.hearing-stimulus-panel strong {
  color: var(--ink);
  font-size: clamp(30px, 4vw, 44px);
  font-weight: 1000;
  line-height: 1.05;
}

.hearing-message-slot {
  display: grid;
  min-height: 36px;
  place-items: center;
  text-align: center;
  visibility: hidden;
}

.hearing-message-slot.visible {
  visibility: visible;
}

.hearing-summary-card {
  position: relative;
  align-content: center;
  padding-bottom: clamp(54px, 8dvh, 78px);
}

.hearing-complete-animation {
  position: relative;
  display: grid;
  width: clamp(82px, 10vw, 118px);
  height: clamp(82px, 10vw, 118px);
  place-items: center;
}

.hearing-complete-ring {
  position: absolute;
  inset: 0;
  border: 6px solid rgba(34, 169, 107, 0.24);
  border-top-color: var(--leaf);
  border-radius: 999px;
  animation: hearingCompleteSpin 1.1s ease-out 1, hearingCompleteSettle 1.5s ease-in-out 1.1s infinite;
}

.hearing-complete-check {
  display: grid;
  width: 68%;
  height: 68%;
  place-items: center;
  border-radius: 999px;
  background: var(--leaf);
  box-shadow: 0 6px 0 var(--leaf-dark);
  color: #fff;
  font-size: clamp(38px, 5vw, 58px);
  font-weight: 1000;
  line-height: 1;
  transform: scale(0.74);
  animation: hearingCheckPop 0.55s cubic-bezier(0.18, 0.89, 0.32, 1.28) 0.35s forwards;
}

.hearing-result-panel {
  width: 100%;
  min-height: 210px;
}

.hearing-result-panel strong {
  font-size: clamp(48px, 8vw, 82px);
}

.hearing-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  width: min(860px, 100%);
}

.hearing-summary-item {
  display: grid;
  place-items: center;
  gap: 4px;
  min-height: auto;
  padding: 18px;
  border: 2px solid #d9e6de;
  border-radius: 12px;
  background: #fff;
  text-align: center;
}

.hearing-summary-item strong {
  color: var(--leaf-dark);
  font-size: clamp(36px, 5vw, 48px);
  font-weight: 1000;
}

.hearing-summary-item em {
  font-style: normal;
  color: var(--leaf);
  font-size: 18px;
  font-weight: 900;
}

.hearing-summary-actions {
  display: grid;
  place-items: center;
  width: 100%;
}

.hearing-continue-button {
  min-width: min(360px, 82vw);
  min-height: 92px;
  font-size: clamp(32px, 4vw, 44px);
}

.hearing-retest-link {
  position: absolute;
  right: 22px;
  bottom: 18px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  font-weight: 900;
  text-decoration: underline;
  cursor: pointer;
}

.task-footer .primary {
  min-width: 132px;
}

.option-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.option {
  position: relative;
  min-height: 86px;
  padding: 10px 14px;
  border: 2px solid #d9e6de;
  background: #fff;
  color: var(--ink);
  font-size: 26px;
  font-weight: 900;
}

.option.picked {
  border-color: var(--leaf);
  background: var(--leaf);
  color: #fff;
  box-shadow: 0 6px 20px rgba(34, 169, 107, 0.32);
}

.option.picked::before {
  content: none;
}

.task-warning {
  justify-self: center;
  margin: 0;
  font-size: 22px;
  font-weight: 950;
}

.task-warning {
  color: #d7392f;
}

.sound-button {
  min-width: 170px;
  min-height: 58px;
  font-size: 20px;
}

.circle-button {
  width: 160px;
  height: 160px;
  border-radius: 999px;
  font-size: 28px;
}

.sound-button {
  width: 160px;
  min-width: 160px;
  height: 160px;
  min-height: 160px;
  padding: 0;
  font-size: 28px;
}

@keyframes result-score-progress-slide {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(350%); }
}

.pulse {
  animation: pulse var(--attention-pulse-duration) ease-in-out infinite;
}

@keyframes bounceIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.82);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes floaty {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.04);
  }
}

@keyframes pulseGreen {
  0% {
    transform: scale(1);
    box-shadow: 0 5px 0 #4a7a4a, 0 0 0 0 rgba(34, 169, 107, 0.36);
  }
  70% {
    transform: scale(1.035);
    box-shadow: 0 5px 0 #4a7a4a, 0 0 0 12px rgba(34, 169, 107, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 5px 0 #4a7a4a, 0 0 0 0 rgba(34, 169, 107, 0);
  }
}

@keyframes hearingCompleteSpin {
  from {
    transform: rotate(-180deg) scale(0.78);
    opacity: 0.4;
  }
  to {
    transform: rotate(0deg) scale(1);
    opacity: 1;
  }
}

@keyframes hearingCompleteSettle {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.04);
  }
}

@keyframes hearingCheckPop {
  from {
    opacity: 0;
    transform: scale(0.74);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes toastInOut {
  0% {
    opacity: 0;
    transform: translate(-50%, 60px);
  }
  15%,
  85% {
    opacity: 1;
    transform: translate(-50%, 0);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -28px);
  }
}

@keyframes confirmNudge {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 5px 0 #4a7a4a;
  }
  50% {
    transform: scale(1.08);
    box-shadow: 0 8px 0 #4a7a4a, 0 12px 22px rgba(34,169,107,0.34);
  }
}

@keyframes wave {
  0%,
  100% {
    transform: scaleY(0.58);
  }
  50% {
    transform: scaleY(1.12);
  }
}

@keyframes confettiDrop {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
    opacity: 0.75;
  }
  50% {
    transform: translateY(14px) rotate(14deg);
    opacity: 1;
  }
}

@keyframes twinkle {
  0%,
  100% {
    transform: rotate(0deg) scale(0.92);
  }
  50% {
    transform: rotate(10deg) scale(1.08);
  }
}

@keyframes radarPulse {
  from {
    transform: scale(0.3);
    opacity: 0.78;
  }
  to {
    transform: scale(1.25);
    opacity: 0;
  }
}

@keyframes radarGrow {
  from {
    transform: scale(0.08);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes handPoint {
  0%,
  100% {
    transform: translate(-74%, -50%) rotate(-6deg);
  }
  50% {
    transform: translate(-54%, -50%) rotate(-6deg);
  }
}

@media (orientation: portrait) {
.setup-panel {
    width: min(900px, 94vw);
    padding: 24px;
  }

}

@media (max-width: 760px) {
.setup-panel {
    grid-template-columns: minmax(0, 1fr);
    width: min(620px, 94vw);
  }

.setup-play-zone {
    min-height: auto;
  }

.setup-start-button {
    width: min(210px, 48vw);
    height: min(210px, 48vw);
  }

}

@media (max-height: 820px) {
:root {
    --setup-control-height: 56px;
  }

.setup-screen {
    padding: 14px;
  }

.setup-panel {
    width: min(1020px, 94vw);
    padding: 22px;
  }

h1 {
    font-size: 42px;
  }

.setup-grid {
    gap: 10px;
  }

.field {
    gap: 6px;
    font-size: 18px;
  }

.field input,
.field select,
.segment-option {
    font-size: 21px;
  }

.big-button {
    min-height: 62px;
    font-size: 25px;
  }

.setup-start-button {
    width: clamp(160px, 19vw, 220px);
    height: clamp(160px, 19vw, 220px);
  }

.setup-start-button span {
    font-size: clamp(34px, 4.2vw, 48px);
  }

.setup-start-button small {
    font-size: clamp(34px, 4.2vw, 48px);
  }

}

@media (max-height: 720px) {
.icon-button {
    width: 48px;
    height: 48px;
  }

h2 {
    font-size: 23px;
  }

h3 {
    font-size: 28px;
  }

.option {
    min-height: 52px;
    font-size: 22px;
  }

.circle-button,
.sound-button {
    width: 116px;
    height: 116px;
    min-width: 116px;
    min-height: 116px;
  }

}

@media (max-width: 640px), (max-height: 560px) {
:root {
    --bottom-safe: max(10px, env(safe-area-inset-bottom));
    --setup-control-height: 52px;
  }

body {
    font-size: 18px;
  }

h1 {
    font-size: clamp(36px, 10vw, 44px);
  }

h2 {
    font-size: clamp(20px, 5.8vw, 26px);
  }

h3,
h4 {
    font-size: clamp(22px, 6vw, 28px);
  }

.setup-screen {
    place-items: stretch;
    padding: 10px;
    overflow: auto;
  }

.floating-stars i {
    width: 22px;
    height: 22px;
  }

.setup-panel {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(104px, 0.72fr);
    gap: 10px;
    align-self: stretch;
    width: 100%;
    min-height: 0;
    padding: 14px;
    overflow: hidden;
  }

.setup-panel::after {
    display: none;
  }

.setup-left {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    min-height: 0;
  }

.setup-grid {
    gap: 7px;
    min-height: 0;
  }

.field {
    gap: 4px;
    font-size: 17px;
  }

.field input,
.field select,
.segment-option {
    font-size: 19px;
  }

.segmented-options {
    gap: 8px;
  }

.setup-play-zone {
    min-height: 104px;
  }

.setup-start-button {
    width: clamp(112px, 34vw, 150px);
    height: clamp(112px, 34vw, 150px);
    border-width: 5px;
    box-shadow:
      0 7px 0 var(--leaf-dark),
      0 14px 26px rgba(18, 122, 73, 0.2);
  }

.setup-start-button span {
    font-size: clamp(28px, 8vw, 38px);
  }

.setup-start-button small {
    margin-top: 2px;
    font-size: clamp(28px, 8vw, 38px);
  }

.icon-button {
    width: 42px;
    height: 42px;
    font-size: 24px;
  }

.drawer-panel {
    width: min(320px, 88vw);
    gap: 7px;
    padding: 14px;
  }

.drawer-logo {
    width: 46px;
    height: 46px;
  }

.drawer-item {
    min-height: 42px;
    font-size: 18px;
  }

.drawer-score {
    min-height: 58px;
    font-size: 26px;
  }

.drawer-task {
    min-height: 42px;
    padding: 6px 9px;
  }

.option-grid {
    gap: 8px;
  }

.option {
    min-height: 52px;
    padding: 8px 10px;
    font-size: clamp(18px, 5vw, 22px);
  }

.circle-button,
.sound-button {
    width: 112px;
    height: 112px;
    min-width: 112px;
    min-height: 112px;
    font-size: 22px;
  }

.results-actions .primary,
.admin-toolbar .primary,
.admin-toolbar .secondary {
    min-height: 42px;
    padding: 8px 12px;
    font-size: 16px;
  }

}

@media (max-width: 430px) {
:root {
    --setup-control-height: 48px;
  }

.setup-screen {
    padding: 8px;
  }

.setup-panel {
    padding: 12px;
  }

.setup-grid {
    gap: 6px;
  }

.field {
    font-size: 16px;
  }

.field input,
.field select,
.segment-option {
    font-size: 18px;
  }

.option {
    min-height: 48px;
  }

.circle-button,
.sound-button {
    width: 100px;
    height: 100px;
    min-width: 100px;
    min-height: 100px;
  }

}

@media (max-height: 500px) and (orientation: landscape) {
:root {
    --setup-control-height: 44px;
  }

.setup-panel {
    grid-template-columns: minmax(0, 1fr) minmax(112px, 0.32fr);
    grid-template-rows: minmax(0, 1fr);
    gap: 12px;
  }

h1 {
    font-size: 32px;
  }

.setup-grid {
    gap: 5px;
  }

.field {
    font-size: 15px;
  }

.field input,
.field select,
.segment-option {
    font-size: 17px;
  }

.setup-start-button {
    width: 104px;
    height: 104px;
  }

.setup-start-button span {
    font-size: 27px;
  }

.setup-start-button small {
    font-size: 27px;
  }

.icon-button {
    width: 38px;
    height: 38px;
  }

.option {
    min-height: 42px;
  }

.circle-button,
.sound-button {
    width: 92px;
    height: 92px;
    min-width: 92px;
    min-height: 92px;
  }

}

@supports (height: 100svh) {
:root {
    --app-height: 100svh;
  }

}

html,
body,
#app,
.app-shell {
  min-width: 0;
}

.setup-panel,
.setup-left,
.setup-grid,
.field,
.segmented-options,
.edu-segment-options {
  min-width: 0;
}

.segment-option {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.setup-voice-button {
  max-width: 100%;
  white-space: normal;
}

#app {
  width: min(100vw, var(--app-width));
}

.single-page {
  min-width: 0;
}

@media (max-width: 1024px), (max-height: 760px) {
.option {
    min-height: clamp(48px, 8svh, 72px);
  }

}

@media (max-width: 1180px) and (orientation: portrait) {
:root {
    --bottom-safe: max(28px, env(safe-area-inset-bottom));
  }

.setup-screen {
    place-items: stretch;
    overflow-y: auto;
    padding: clamp(12px, 2.4vw, 24px);
  }

.setup-panel {
    align-self: center;
    max-height: calc(var(--app-height) - 24px);
    overflow-y: auto;
  }

}

@media (max-width: 820px) and (orientation: portrait) {
.setup-screen {
    place-items: stretch;
    padding: clamp(10px, 2.4vw, 20px);
    overflow-y: auto;
  }

.setup-panel {
    align-self: center;
    max-height: calc(var(--app-height) - 20px);
    overflow-y: auto;
  }

}

@media (max-width: 620px) and (orientation: portrait) {
.setup-panel {
    justify-self: center;
    width: min(360px, calc(100vw - 16px));
    max-width: calc(100vw - 16px);
    overflow-x: hidden;
  }

.edu-segment-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

.setup-voice-button {
    min-height: 58px;
    padding: 12px 20px;
    font-size: clamp(20px, 5.2vw, 24px);
  }

}

@media (orientation: landscape) and (max-height: 620px) {
:root {
    --bottom-safe: max(6px, env(safe-area-inset-bottom));
  }

.setup-screen {
    place-items: stretch;
    padding: 8px;
    overflow: hidden;
  }

.setup-panel {
    align-self: stretch;
    align-items: start;
    width: 100%;
    max-height: calc(var(--app-height) - 16px);
    overflow-y: auto;
    padding: clamp(8px, 2.4svh, 14px) clamp(12px, 2.8vw, 18px);
  }

.field {
    gap: 3px;
  }

.field > span {
    font-size: 16px;
  }

.field input,
.field select,
.segment-option {
    font-size: 17px;
  }

.setup-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
  }

.setup-grid .field:nth-child(4) {
    grid-column: 1 / -1;
  }

.segmented-options,
.edu-segment-options {
    gap: 7px;
  }

.edu-segment-options {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

.setup-voice-button {
    min-height: 42px;
    padding: 7px 16px;
    font-size: 18px;
  }

.circle-button,
.sound-button {
    width: clamp(82px, 24svh, 106px);
    height: clamp(82px, 24svh, 106px);
    min-width: clamp(82px, 24svh, 106px);
    min-height: clamp(82px, 24svh, 106px);
  }

.option {
    min-height: clamp(38px, 11svh, 52px);
    padding-block: 6px;
    font-size: clamp(17px, 5svh, 22px);
  }

}

@media (orientation: landscape) and (max-width: 1280px) and (max-height: 900px) {
:root {
    --setup-control-height: 56px;
  }

.setup-screen {
    place-items: stretch;
    padding: 12px;
    overflow-y: auto;
  }

.setup-panel {
    align-self: center;
    width: min(1100px, calc(100vw - 24px));
    max-height: calc(var(--app-height) - 24px);
    padding: clamp(18px, 3svh, 28px) clamp(24px, 3.2vw, 38px);
    overflow-y: auto;
  }

h1 {
    font-size: clamp(42px, 7svh, 54px);
  }

.setup-grid {
    gap: 10px;
  }

.field {
    gap: 6px;
  }

.field > span {
    font-size: 17px;
  }

.field input,
.field select,
.segment-option {
    font-size: 21px;
  }

.setup-voice-button {
    min-height: 54px;
    padding: 11px 28px;
    font-size: 22px;
  }

.setup-start-button {
    width: clamp(170px, 25svh, 220px);
    height: clamp(170px, 25svh, 220px);
  }

}

@media (orientation: landscape) and (max-height: 430px) {
.icon-button {
    width: 34px;
    height: 34px;
  }

}

.setup-screen {
  place-items: stretch;
  padding: 0;
  overflow: hidden;
}

.setup-panel {
  align-self: stretch;
  justify-self: stretch;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  grid-template-columns: minmax(0, 1.18fr) minmax(220px, 0.62fr);
  gap: clamp(28px, 4.8vw, 76px);
  padding: clamp(28px, 5.2dvh, 76px) clamp(44px, 7.2vw, 118px);
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: hidden;
}

.setup-panel::after {
  display: none;
}

.setup-left {
  align-self: center;
}

.setup-play-zone {
  align-self: center;
  transform: translateX(clamp(-108px, -7vw, -44px));
}

@media (orientation: portrait), (max-width: 760px) {
.setup-screen {
    overflow-y: auto;
  }

.setup-panel {
    width: 100%;
    max-width: none;
    min-height: 100%;
    height: auto;
    max-height: none;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(150px, auto);
    align-content: center;
    padding: clamp(22px, 4.6svh, 54px) clamp(20px, 6vw, 62px);
    overflow-y: auto;
  }

.setup-play-zone {
    min-height: auto;
    transform: none;
  }

}

@media (orientation: landscape) and (max-height: 620px) {
.setup-panel {
    height: 100%;
    min-height: 0;
    grid-template-columns: minmax(0, 1fr) minmax(116px, 0.34fr);
    grid-template-rows: minmax(0, 1fr);
    align-items: center;
    padding: clamp(10px, 3svh, 18px) clamp(18px, 5vw, 50px);
    overflow-y: auto;
  }

}

/* Login page polish */
.setup-panel {
  grid-template-columns: minmax(420px, 660px) minmax(0, 1fr);
  align-items: center;
  padding: clamp(28px, 5.2dvh, 70px) clamp(42px, 6.8vw, 112px);
}

.setup-left {
  display: grid;
  align-self: center;
  gap: clamp(18px, 2.2dvh, 26px);
  width: min(660px, 100%);
  padding: clamp(22px, 3.2dvh, 34px);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(255, 255, 255, 0.58));
  box-shadow: 0 22px 54px rgba(36, 52, 71, 0.14);
  backdrop-filter: blur(12px);
}

.setup-grid {
  gap: clamp(14px, 1.9dvh, 20px);
}

.field {
  gap: 10px;
}

.field > span {
  color: #4d6572;
  font-size: clamp(24px, 2.35vw, 30px);
  font-weight: 1000;
  line-height: 1.05;
}

.field input,
.field select {
  height: clamp(68px, 8dvh, 80px);
  min-height: clamp(68px, 8dvh, 80px);
  padding: 0 clamp(18px, 2vw, 24px);
  border: 2px solid rgba(189, 210, 204, 0.86);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.93);
  box-shadow:
    0 4px 0 rgba(174, 193, 184, 0.54),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  color: #243447;
  font-size: clamp(26px, 2.8vw, 32px);
  font-weight: 950;
}

.field input:focus,
.field select:focus {
  border-color: var(--leaf);
  box-shadow:
    0 4px 0 rgba(18, 122, 73, 0.22),
    0 0 0 5px rgba(34, 169, 107, 0.18);
}

.segmented-options {
  grid-auto-rows: clamp(68px, 8dvh, 80px);
  gap: 14px;
}

.edu-segment-options {
  gap: 12px;
}

.segment-option {
  height: clamp(68px, 8dvh, 80px);
  border: 2px solid rgba(189, 210, 204, 0.86);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.93);
  box-shadow:
    0 4px 0 rgba(174, 193, 184, 0.54),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  color: #263640;
  font-size: clamp(24px, 2.45vw, 30px);
}

.segment-option:hover:not(.picked) {
  border-color: rgba(34, 169, 107, 0.72);
  background: rgba(235, 250, 242, 0.96);
}

.segment-option.picked {
  border-color: var(--leaf-dark);
  background: linear-gradient(180deg, #34c982, var(--leaf));
  box-shadow: 0 4px 0 var(--leaf-dark);
}

.setup-voice-button {
  width: 100%;
  min-height: clamp(64px, 7.4dvh, 74px);
  padding: 12px 22px;
  border: 2px solid rgba(34, 169, 107, 0.76);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 5px 0 rgba(18, 122, 73, 0.18);
  color: var(--leaf-dark);
  font-size: clamp(24px, 2.5vw, 30px);
}

.setup-start-button {
  display: flex;
  width: 100%;
  height: clamp(76px, 9dvh, 92px);
  min-height: clamp(76px, 9dvh, 92px);
  align-items: center;
  justify-content: center;
  margin-top: 0;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(180deg, #6aaf67, #5b8c5a);
  box-shadow:
    0 7px 0 #4a7a4a,
    0 20px 34px rgba(18,122,73,0.18);
  color: #263640;
  text-align: center;
}

.setup-start-button span {
  font-size: clamp(30px, 3vw, 38px);
  line-height: 1;
}

.setup-start-button small {
  display: none;
}

.setup-start-button::after {
  content: "→";
  display: grid;
  width: clamp(42px, 4vw, 54px);
  height: clamp(42px, 4vw, 54px);
  place-items: center;
  margin-left: 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: #263640;
  font-size: clamp(28px, 2.7vw, 34px);
  font-weight: 1000;
  line-height: 1;
}

@media (orientation: landscape) and (max-width: 1280px) and (max-height: 900px) {
.setup-panel {
    grid-template-columns: minmax(380px, 610px) minmax(0, 1fr);
    padding: clamp(20px, 3.2svh, 34px) clamp(30px, 4.4vw, 56px);
  }

.setup-left {
    gap: 14px;
    padding: clamp(18px, 2.4svh, 24px);
  }

.setup-grid {
    gap: 11px;
  }

.field > span {
    font-size: clamp(24px, 3svh, 28px);
  }

.field input,
.field select,
.segment-option {
    height: clamp(58px, 8svh, 68px);
    min-height: clamp(58px, 8svh, 68px);
    font-size: clamp(26px, 3.4svh, 30px);
  }

.setup-voice-button {
    min-height: clamp(54px, 7svh, 64px);
    font-size: clamp(21px, 3svh, 25px);
  }

.setup-start-button {
    height: clamp(64px, 8svh, 76px);
    min-height: clamp(64px, 8svh, 76px);
  }

.setup-start-button span {
    font-size: clamp(26px, 3.6svh, 32px);
  }

}

@media (orientation: portrait), (max-width: 760px) {
.setup-screen {
    background-position: center, 48% center;
  }

.setup-panel {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto;
    align-content: start;
    align-items: start;
    padding: clamp(10px, 2svh, 18px) clamp(12px, 4vw, 24px) 48px;
    overflow-y: auto;
  }

.setup-left {
    align-self: start;
    width: 100%;
    gap: clamp(9px, 1.4svh, 13px);
    padding: clamp(12px, 3vw, 18px);
  }

.field > span {
    font-size: clamp(20px, 5.4vw, 26px);
  }

.field input,
.field select,
.segment-option {
    height: clamp(52px, 6.9svh, 62px);
    min-height: clamp(52px, 6.9svh, 62px);
    font-size: clamp(20px, 5.4vw, 26px);
  }

.edu-segment-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

.setup-voice-button,
.setup-start-button {
    min-height: clamp(54px, 6.8svh, 64px);
    font-size: clamp(20px, 5.2vw, 25px);
  }

.setup-start-button {
    height: clamp(56px, 7.2svh, 66px);
  }

.setup-start-button span {
    font-size: clamp(22px, 5.8vw, 28px);
  }

.setup-start-button::after {
    width: clamp(34px, 8.8vw, 42px);
    height: clamp(34px, 8.8vw, 42px);
    margin-left: 12px;
    font-size: clamp(22px, 5.8vw, 28px);
  }

}

/* Full-screen tuning */
.setup-screen {
  padding: 0;
  background-image: none;
  isolation: isolate;
}

.setup-screen::before {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: 0;
  background: none;
}

.setup-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(90deg, rgba(196, 236, 241, 0.48) 0 30%, rgba(196, 236, 241, 0.08) 56%, transparent 78%);
  pointer-events: none;
}

.setup-panel {
  z-index: 1;
  padding: clamp(20px, 4dvh, 56px) clamp(24px, 5vw, 72px);
}

.setup-left {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.70), rgba(255, 255, 255, 0.46));
}

@media (orientation: portrait), (max-width: 760px) {
.setup-screen::before {
    background-position: 54% center;
  }

.setup-screen::after {
    background: linear-gradient(180deg, rgba(196, 236, 241, 0.28), rgba(255, 250, 235, 0.10) 58%, rgba(255, 219, 150, 0.12));
  }

.setup-panel {
    width: 100%;
    max-width: none;
    padding: clamp(10px, 2svh, 18px) clamp(10px, 3vw, 16px) 42px;
  }

.setup-left {
    width: min(720px, 100%);
    margin: 0 auto;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.48));
  }

}

.setup-panel {
  padding-top: max(var(--login-edge-gap), env(safe-area-inset-top));
  padding-bottom: max(var(--login-edge-gap), env(safe-area-inset-bottom));
}

.setup-left {
  max-height: calc(var(--app-height) - (var(--login-edge-gap) * 2));
}

.final-results-actions .primary {
  min-width: min(360px, 70vw);
  min-height: clamp(62px, 8dvh, 78px);
  border-radius: 999px;
  font-size: clamp(24px, 3vw, 32px);
}

.final-results-actions .big-button {
  min-width: min(300px, 42vw);
  min-height: clamp(58px, 7.2dvh, 76px);
  border-radius: 999px;
  font-size: clamp(22px, 2.6vw, 30px);
}

@keyframes fireworkBurst {
  0% {
    transform: scale(0.15) rotate(0deg);
    opacity: 0;
  }
  18% {
    opacity: 1;
  }
  68% {
    transform: scale(1) rotate(24deg);
    opacity: 0.9;
  }
  100% {
    transform: scale(1.18) rotate(32deg);
    opacity: 0;
  }
}

@media (orientation: portrait), (max-width: 760px) {
:root {
    --login-edge-gap: clamp(14px, 1.9svh, 20px);
  }

.setup-panel {
    padding-top: max(var(--login-edge-gap), env(safe-area-inset-top));
    padding-bottom: max(var(--login-edge-gap), env(safe-area-inset-bottom));
  }

.setup-left {
    max-height: calc(var(--app-height) - (var(--login-edge-gap) * 2));
  }

}

.setup-screen {
  width: 100%;
  height: var(--app-height);
  min-height: var(--app-height);
  padding: var(--screen-edge-y) var(--screen-edge-x);
  place-items: stretch;
  overflow: hidden;
}

.setup-panel {
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: none;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: clamp(12px, 1.8vw, 28px);
  align-items: center;
  padding: 0;
  overflow: hidden;
}

.setup-left {
  align-self: center;
  display: grid;
  grid-template-rows: auto auto auto auto;
  gap: var(--login-gap);
  justify-self: stretch;
  width: 100%;
  max-height: 100%;
  min-height: 0;
  padding: var(--login-card-pad);
  overflow: hidden;
}

.setup-grid {
  gap: var(--login-gap);
  min-height: 0;
}

.field {
  gap: clamp(3px, 0.55svh, 7px);
}

.field > span {
  font-size: clamp(18px, 3svh, 28px);
  line-height: 1;
}

.field input,
.field select,
.segment-option {
  height: var(--login-control);
  min-height: var(--login-control);
  font-size: clamp(20px, 3.3svh, 30px);
}

.segmented-options,
.edu-segment-options {
  gap: clamp(6px, 1svh, 12px);
}

.segmented-options {
  grid-auto-rows: var(--login-control);
}

.setup-voice-button,
.setup-start-button {
  min-height: var(--login-button);
}

.setup-voice-button {
  font-size: clamp(20px, 3.2svh, 28px);
}

.setup-start-button {
  height: var(--login-button);
}

.setup-start-button span {
  font-size: clamp(24px, 4svh, 36px);
}

.setup-start-button::after {
  width: clamp(34px, 5.4svh, 50px);
  height: clamp(34px, 5.4svh, 50px);
  font-size: clamp(24px, 3.6svh, 32px);
}

.volume-setup-screen {
  display: grid;
  width: 100%;
  height: var(--app-height);
  min-height: var(--app-height);
  place-items: center;
  padding: var(--screen-edge-y) var(--screen-edge-x);
  overflow: hidden;
  background:
    linear-gradient(120deg, rgba(232, 249, 255, 0.86), rgba(255, 250, 235, 0.92)),
    url("./assets/village/login-hero-v3.webp") center / cover no-repeat;
}

.volume-setup-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.84fr);
  align-items: center;
  gap: clamp(22px, 4vw, 54px);
  width: min(1080px, 96vw);
  padding: clamp(24px, 5dvh, 58px);
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 22px 54px rgba(36, 52, 71, 0.14);
  backdrop-filter: blur(10px);
}

.volume-setup-copy {
  display: grid;
  gap: clamp(12px, 2dvh, 20px);
  min-width: 0;
}

.volume-setup-copy span {
  color: var(--leaf-dark);
  font-size: clamp(18px, 2vw, 24px);
  font-weight: 1000;
}

.volume-setup-copy h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(38px, 6vw, 72px);
  line-height: 1.08;
}

.volume-setup-copy p {
  max-width: 680px;
  margin: 0;
  color: #4d6572;
  font-size: clamp(20px, 2.4vw, 30px);
  font-weight: 850;
  line-height: 1.45;
}

.volume-slider-card {
  display: grid;
  gap: clamp(18px, 3dvh, 30px);
  min-width: 0;
  padding: clamp(22px, 3.2dvh, 34px);
  border: 2px solid rgba(189, 210, 204, 0.72);
  border-radius: 12px;
  background: #fffdf7;
}

.volume-level-value {
  color: var(--coral-dark);
  font-size: clamp(42px, 6vw, 76px);
  font-weight: 1000;
  line-height: 1;
  text-align: center;
}

.volume-slider {
  width: 100%;
  accent-color: var(--coral);
}

.volume-slider-scale,
.volume-setup-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.volume-slider-scale span {
  color: var(--muted);
  font-size: clamp(16px, 1.8vw, 22px);
  font-weight: 900;
}

.volume-setup-actions .big-button {
  flex: 1;
  min-width: 0;
}

.task-guide-actions .secondary.big-button:not(:disabled) {
  border: 3px solid var(--sky);
  background: #ffffff;
  color: var(--sky);
  box-shadow: 0 5px 0 rgba(63, 141, 243, 0.24), 0 12px 24px rgba(63, 141, 243, 0.12);
}

.task-guide-actions .big-button:disabled {
  background: #eef2ef;
  color: #89958e;
  box-shadow: 0 5px 0 #c9d2cd;
}

@media (orientation: portrait), (max-width: 760px) {
.volume-setup-panel {
    grid-template-columns: minmax(0, 1fr);
    width: min(680px, 100%);
    padding: clamp(18px, 4svh, 34px);
  }

.volume-setup-copy h2 {
    font-size: clamp(34px, 9vw, 52px);
  }

.volume-setup-actions {
    grid-template-columns: minmax(0, 1fr);
    flex-direction: column;
  }

}

.app-shell {
  display: grid;
  width: 100%;
  height: var(--app-height);
  padding: var(--screen-edge-y) var(--screen-edge-x);
  overflow: hidden;
}

@media (orientation: landscape) and (max-height: 720px) {
:root {
    --screen-edge-y: max(10px, env(safe-area-inset-top), env(safe-area-inset-bottom));
    --login-control: clamp(42px, 8.1svh, 58px);
    --login-button: clamp(44px, 8.2svh, 60px);
    --login-gap: clamp(4px, 0.9svh, 9px);
    --login-card-pad: clamp(9px, 1.8svh, 16px);
    --login-title: clamp(32px, 7.6svh, 50px);
  }

.setup-panel {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  }

.setup-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

.setup-grid .field:nth-child(4) {
    grid-column: 1 / -1;
  }

.edu-segment-options {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

.field > span {
    font-size: clamp(16px, 3.1svh, 22px);
  }

.field input,
.field select,
.segment-option {
    font-size: clamp(18px, 3.6svh, 24px);
  }

.setup-start-button::after {
    display: none;
  }

}

@media (orientation: portrait), (max-width: 760px) {
:root {
    --screen-edge-y: max(12px, env(safe-area-inset-top), env(safe-area-inset-bottom));
    --screen-edge-x: clamp(8px, 2.4vw, 14px);
    --login-control: clamp(46px, 6.4svh, 62px);
    --login-button: clamp(50px, 6.8svh, 64px);
    --login-gap: clamp(6px, 0.95svh, 10px);
    --login-card-pad: clamp(10px, 2.4vw, 16px);
    --login-title: clamp(36px, 6.8svh, 54px);
  }

.setup-panel {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }

.setup-left {
    align-self: start;
    width: min(720px, 100%);
    margin: 0 auto;
  }

.field > span {
    font-size: clamp(18px, 4.6vw, 24px);
  }

.field input,
.field select,
.segment-option {
    font-size: clamp(19px, 5vw, 25px);
  }

}

.app-shell {
  padding: var(--screen-edge-top) var(--screen-edge-x) var(--screen-edge-bottom);
}

@media (orientation: landscape) and (max-height: 620px) {
:root {
    --screen-edge-top: max(14px, env(safe-area-inset-top));
    --screen-edge-bottom: max(8px, env(safe-area-inset-bottom));
    --task-header-height: clamp(60px, 15svh, 76px);
  }

}

@media (orientation: portrait), (max-width: 760px) {
:root {
    --screen-edge-top: max(20px, env(safe-area-inset-top));
    --screen-edge-bottom: max(12px, env(safe-area-inset-bottom));
    --task-header-height: clamp(72px, 8.8svh, 96px);
  }

.final-results-actions .big-button {
    min-width: min(320px, 78vw);
  }

}

@media (orientation: portrait), (max-width: 760px) {
.hearing-page {
    place-items: stretch;
    padding: 12px 14px var(--bottom-safe);
  }

.hearing-card {
    width: 100%;
    min-height: 0;
    align-content: start;
    padding: clamp(16px, 2.4svh, 24px);
  }

.hearing-step-card {
    align-content: center;
  }

.hearing-intro-card,
.hearing-meter-row,
.hearing-summary-grid {
    grid-template-columns: minmax(0, 1fr);
  }

.hearing-intro-card {
    align-content: center;
  }

.hearing-intro-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: clamp(16px, 2.5svh, 24px);
    width: min(560px, 100%);
  }

.hearing-hero-icon {
    width: min(180px, 58vw);
  }

.hearing-ear-target,
.hearing-ear-target.compact {
    width: min(190px, 60vw);
    justify-self: center;
  }

.hearing-focus-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

.hearing-response-grid {
    grid-template-columns: minmax(0, 1fr);
  }

.hearing-response-slot {
    min-height: clamp(146px, 22svh, 176px);
  }

.hearing-response-grid .option {
    min-height: 70px;
  }

.hearing-play-button {
    width: clamp(132px, 36vw, 160px);
    min-width: clamp(132px, 36vw, 160px);
    height: clamp(132px, 36vw, 160px);
    min-height: clamp(132px, 36vw, 160px);
  }

.hearing-continue-button {
    min-height: 78px;
  }

}

@media (orientation: landscape) and (max-height: 620px) {
.hearing-page {
    padding: 8px 64px var(--bottom-safe);
  }

.hearing-card {
    min-height: 0;
    gap: 10px;
    padding: 14px 18px;
  }

.hearing-step-card {
    align-content: center;
  }

.hearing-test-card {
    align-content: stretch;
    grid-template-rows: auto minmax(0, 1fr) auto minmax(66px, auto) minmax(24px, auto);
  }

.hearing-intro-layout {
    grid-template-columns: 140px minmax(0, 1fr);
    gap: 24px;
    width: min(620px, 100%);
  }

.hearing-hero-icon {
    width: 132px;
  }

.hearing-copy h3 {
    margin-bottom: 6px;
    font-size: clamp(28px, 7svh, 42px);
  }

.hearing-instruction,
.hearing-summary-note {
    font-size: clamp(16px, 4svh, 20px);
  }

.hearing-ear-target {
    width: clamp(122px, 22svh, 150px);
  }

.hearing-ear-target.compact {
    width: clamp(102px, 20svh, 130px);
  }

.hearing-ear-target.compact .ear-illustration {
    width: min(82px, 70%);
  }

.hearing-ear-target.right .ear-illustration {
    margin-right: 16px;
  }

.hearing-ear-target.left .ear-illustration {
    margin-left: 16px;
  }

.hearing-stimulus-panel {
    min-height: 104px;
  }

.hearing-response-grid .option {
    min-height: 58px;
  }

.hearing-response-slot {
    min-height: 66px;
  }

.hearing-play-button {
    width: clamp(112px, 22svh, 136px);
    min-width: clamp(112px, 22svh, 136px);
    height: clamp(112px, 22svh, 136px);
    min-height: clamp(112px, 22svh, 136px);
    font-size: 24px;
  }

}

.setup-title-row {
  width: 100%;
  justify-content: center;
  gap: clamp(10px, 1.8vw, 18px);
  flex-wrap: nowrap;
}

.setup-title-row > div {
  min-width: 0;
}

.setup-title-row h1 {
  white-space: nowrap;
}

.setup-title-row .setup-voice-button {
  flex: 0 0 auto;
  width: auto;
  min-height: clamp(42px, 5.2dvh, 52px);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: clamp(16px, 1.7vw, 20px);
  line-height: 1.1;
  white-space: nowrap;
}

@media (max-width: 520px) {
.setup-title-row {
    gap: 8px;
  }

.setup-title-row h1 {
    font-size: clamp(34px, 10vw, 44px);
  }

.setup-title-row .setup-voice-button {
    min-height: 38px;
    padding: 7px 10px;
    font-size: 16px;
  }

}

.setup-grid {
  grid-template-columns: minmax(0, 1fr);
}

.sex-field .segmented-options {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (orientation: landscape) and (max-height: 620px) and (min-width: 720px) {
.setup-grid {
    grid-template-columns: minmax(0, 1.35fr) minmax(150px, 0.65fr);
  }

}

.hearing-copy h3 {
  display: grid;
  gap: 0.08em;
  justify-items: center;
}

.hearing-check-button {
  min-width: clamp(210px, 24vw, 280px);
  min-height: clamp(68px, 8dvh, 84px);
  border-radius: 12px;
  font-size: clamp(24px, 3vw, 34px);
}

.hearing-continue-button {
  min-width: min(460px, 88vw);
  min-height: clamp(96px, 13dvh, 124px);
  box-shadow:
    0 8px 0 var(--leaf-dark),
    0 18px 34px rgba(34, 169, 107, 0.22);
}

.final-results-actions .big-button:disabled {
  background: #d9dfdc;
  color: #7a8780;
  box-shadow: 0 4px 0 #b7c1bc;
  opacity: 0.86;
}

@media (max-width: 560px) {
.setup-grid {
    grid-template-columns: minmax(0, 1fr);
  }

}

.education-field .edu-segment-options {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.hearing-start-button {
  min-width: clamp(260px, 28vw, 360px);
  min-height: clamp(86px, 11dvh, 112px);
  box-shadow:
    0 8px 0 var(--leaf-dark),
    0 18px 34px rgba(34, 169, 107, 0.22);
}

.hearing-recheck-button {
  min-width: clamp(128px, 14vw, 170px);
  min-height: clamp(46px, 6dvh, 58px);
  padding-inline: 18px;
  border: 2px solid #d9e6de;
  background: #f6faf8;
  color: var(--muted);
  box-shadow: 0 3px 0 #cddbd2;
  font-size: clamp(17px, 2vw, 22px);
}

.drawer-panel {
  align-items: stretch;
}

.drawer-task-list {
  width: 100%;
  padding-right: 0;
}

.drawer-item,
.drawer-hearing-link,
.drawer-section-toggle,
.drawer-task {
  box-sizing: border-box;
  width: 100%;
}

.setup-skip-login {
  position: fixed;
  right: max(14px, env(safe-area-inset-right));
  bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 4;
  min-height: 32px;
  padding: 4px 6px;
  border: 0;
  background: transparent;
  color: rgba(87, 98, 110, 0.72);
  font-size: clamp(13px, 1.8vw, 16px);
  font-weight: 750;
  line-height: 1;
  box-shadow: none;
}

.setup-skip-login:hover {
  color: rgba(49, 60, 72, 0.9);
  text-decoration: underline;
}

.secondary.circle-button.sentence-retry-button {
  border: 4px solid var(--leaf);
  background: #fff;
  color: var(--leaf-dark);
  box-shadow: 0 6px 0 #9bcdae;
  animation: none;
}

@keyframes hintPulse {
  0%, 100% { opacity: 0.48; }
  50% { opacity: 0.86; }
}

.setup-welcome {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.setup-welcome-inner {
  display: grid;
  justify-items: center;
  gap: 12px;
}

.setup-welcome .guide-character {
  width: min(250px, 26vw);
  max-height: 360px;
}

.setup-welcome-bubble {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 16px 22px;
  border: 2px solid rgba(189, 210, 204, 0.82);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  font-size: 23px;
  font-weight: 850;
  line-height: 1.45;
  text-align: left;
  box-shadow: 0 6px 0 rgba(197, 213, 201, 0.9);
}

.setup-welcome-bubble::after {
  content: "";
  position: absolute;
  bottom: -12px;
  left: 50%;
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 12px solid rgba(189, 210, 204, 0.82);
  transform: translateX(-50%);
}

.hearing-intro-wrapper,
.hearing-summary-wrapper {
  display: flex;
  width: 100%;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  overflow-y: auto;
  padding: 12px;
}

.hearing-guide-character {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 18px;
}

.hearing-guide-character .guide-character {
  width: min(168px, 22vw);
  max-height: 230px;
}

.hearing-guide-bubble {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  max-width: 520px;
  padding: 16px 22px;
  border: 2px solid rgba(189, 210, 204, 0.82);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  font-size: 22px;
  font-weight: 800;
  line-height: 1.55;
  text-align: left;
  box-shadow: 0 6px 0 rgba(197, 213, 201, 0.9), 0 12px 26px rgba(36, 52, 71, 0.10);
}

.hearing-guide-bubble::before {
  content: "";
  position: absolute;
  left: -14px;
  bottom: 30px;
  width: 0;
  height: 0;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  border-right: 14px solid rgba(189, 210, 204, 0.82);
}

.hearing-guide-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(22, 32, 42, 0.28);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.hearing-guide-popup {
  display: grid;
  width: min(560px, 94vw);
  justify-items: center;
  gap: 18px;
  padding: 28px;
  border: 2px solid rgba(189, 210, 204, 0.82);
  border-radius: 12px;
  background: #fffdf7;
  box-shadow: 0 14px 44px rgba(36, 52, 71, 0.20);
}

.hearing-guide-popup-char .guide-character {
  width: min(170px, 30vw);
  max-height: 240px;
}

.hearing-guide-popup-bubble {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 16px 20px;
  border: 2px solid rgba(189, 210, 204, 0.82);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-size: 22px;
  font-weight: 800;
  line-height: 1.55;
  text-align: left;
}

.hearing-guide-popup-bubble p {
  margin: 0;
}

.character-dialog-screen {
  display: flex;
  width: min(1160px, 100%);
  height: min(100%, 720px);
  min-height: 0;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 0 auto;
  padding: clamp(12px, 2dvh, 24px);
}

.character-side {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: min(190px, 20vw);
}

.character-side .guide-character {
  width: min(190px, 20vw);
  max-height: 310px;
}

.character-dialog-bubble {
  position: relative;
  display: grid;
  flex: 1 1 auto;
  min-width: 0;
  justify-items: center;
  gap: 16px;
  padding: clamp(18px, 3dvh, 32px);
  border: 2px solid rgba(189, 210, 204, 0.82);
  border-radius: 12px;
  background: linear-gradient(180deg, #fffdf7, #eefbf4);
  box-shadow: 0 8px 0 rgba(197, 213, 201, 0.9), 0 18px 34px rgba(36, 52, 71, 0.12);
}

.character-dialog-bubble::before {
  content: "";
  position: absolute;
  left: -16px;
  top: 90px;
  width: 0;
  height: 0;
  border-top: 12px solid transparent;
  border-bottom: 12px solid transparent;
  border-right: 16px solid rgba(189, 210, 204, 0.82);
}

.character-dialog-btn {
  min-width: 190px;
}

@media (max-width: 760px) {
.character-dialog-screen,
.hearing-guide-character {
    flex-direction: column;
  }

.character-dialog-bubble::before,
.hearing-guide-bubble::before {
    display: none;
  }

.setup-welcome .guide-character,
.character-side .guide-character {
    width: min(180px, 46vw);
    max-height: 230px;
  }

.hearing-guide-bubble,
.hearing-guide-popup-bubble {
    font-size: 22px;
  }

.setup-welcome {
    display: none;
  }

}

.task-guide-page .character-dialog-screen {
  align-items: center;
  justify-content: center;
  height: 100%;
}

.task-guide-page .character-dialog-bubble {
  min-height: 0;
  align-content: center;
  justify-content: center;
  justify-items: stretch;
  border-color: rgba(107, 157, 128, 0.42);
  background: rgba(255, 253, 247, 0.96);
  box-shadow: 0 8px 0 rgba(198, 222, 205, 0.95), 0 18px 34px rgba(36, 52, 71, 0.12);
}

.typewriter-text {
  display: grid;
  white-space: pre-line;
}

.typewriter-measure,
.typewriter-live {
  grid-area: 1 / 1;
}

.typewriter-measure {
  visibility: hidden;
}

.typewriter-text:not(.typewriter-done) .typewriter-live::after {
  content: "";
  display: inline-block;
  width: 0.08em;
  height: 1em;
  margin-left: 3px;
  background: currentColor;
  vertical-align: -0.12em;
  animation: typewriterCaret 0.7s steps(1) infinite;
}

@keyframes typewriterCaret {
  0%, 45% { opacity: 1; }
  46%, 100% { opacity: 0; }
}

.task-guide-page .character-dialog-screen {
  width: min(1180px, 100%);
  height: 100%;
  padding: clamp(10px, 2dvh, 20px);
}

.task-guide-page .character-side .guide-character {
  width: min(210px, 18vw);
  max-height: 330px;
}

.task-guide-page .character-dialog-bubble {
  width: min(720px, 100%);
  min-height: 0;
  padding: clamp(18px, 3dvh, 32px);
  align-content: center;
  justify-items: stretch;
  border-color: rgba(107, 157, 128, 0.42);
  background: rgba(255, 253, 247, 0.96);
}

@media (max-width: 760px) {
.task-guide-page .character-dialog-screen {
    gap: 8px;
  }

.task-guide-page .character-side .guide-character {
    width: min(128px, 34vw);
  }

}

.page-shell.story-shell {
  grid-template-rows: minmax(0, 1fr);
}

.page-shell.story-shell .page-header {
  display: none;
}

.story-scene-screen {
  --story-dialog-left: clamp(200px, 26vw, 340px);
  --story-dialog-right: clamp(12px, 3vw, 40px);
  --story-character-left: clamp(12px, 3vw, 50px);
  --story-character-width: clamp(210px, 23vw, 320px);
  --story-dialog-fill: #FFFBF2;
  position: relative;
  display: grid;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  overscroll-behavior-x: none;
  padding: clamp(14px, 2dvh, 28px);
  background: #FFFBF5;
  cursor: default;
}

.story-scene-screen::before {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 34%;
  border-top: 2px solid rgba(34,169,107,0.12);
  background: linear-gradient(180deg, rgba(34,169,107,0.06), rgba(34,169,107,0.02));
  pointer-events: none;
}

.story-scene-screen[data-action] {
  cursor: pointer;
}

.story-dialogue-box {
  position: absolute;
  top: 50%;
  left: var(--story-dialog-left);
  right: var(--story-dialog-right);
  z-index: 3;
  display: grid;
  align-content: center;
  width: auto;
  height: min(50dvh, 420px);
  min-height: clamp(245px, 42dvh, 380px);
  padding: clamp(26px, 4dvh, 44px) clamp(30px, 5vw, 62px);
  border: 3px solid #d4c0a0;
  border-radius: 20px;
  outline: none;
  background: var(--story-dialog-fill);
  box-shadow:
    0 8px 0 #c0a880,
    0 24px 52px rgba(18,122,73,0.18);
  transform: translateY(-50%);
}

.story-dialogue-box::before,
.story-dialogue-box::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 0;
  height: 0;
  pointer-events: none;
  transform: translateY(-50%);
}

.story-dialogue-box::before {
  left: -18px;
  border-top: 14px solid transparent;
  border-bottom: 14px solid transparent;
  border-right: 18px solid #d4c0a0;
}

.story-dialogue-box::after {
  left: -14px;
  border-top: 11px solid transparent;
  border-bottom: 11px solid transparent;
  border-right: 15px solid var(--story-dialog-fill);
}

.story-dialogue-text {
  position: relative;
  z-index: 1;
  margin: 0;
  color: #000;
  font-size: var(--story-dialogue-font-size);
  font-weight: 1000;
  line-height: 1.2;
  text-align: left;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.story-dialogue-text .typewriter-text,
.story-dialogue-text .typewriter-text span {
  color: #000;
  font: inherit;
  line-height: inherit;
}

.story-next-triangle {
  position: absolute;
  left: 50%;
  bottom: clamp(13px, 2.2dvh, 22px);
  z-index: 2;
  width: 0;
  height: 0;
  border-right: 14px solid transparent;
  border-left: 14px solid transparent;
  border-top: 18px solid #d4c0a0;
  transform: translateX(-50%);
  animation: storyTriangleBounce 1.05s ease-in-out infinite;
}

.story-character-stage {
  position: absolute;
  top: 50%;
  left: var(--story-character-left);
  bottom: auto;
  z-index: 2;
  display: grid;
  justify-items: center;
  align-items: end;
  width: var(--story-character-width);
  pointer-events: none;
  transform: translateY(-50%);
}

.story-character-wrap {
  display: grid;
  justify-items: center;
  gap: clamp(8px, 1.3dvh, 14px);
  transform-origin: 50% 90%;
}

.story-character-wrap.nod .story-character,
.story-character-wrap.nod .character-container {
  animation: doctorNod 0.9s ease-in-out 0.25s 2;
}

.story-character-wrap.encourage .story-character,
.story-character-wrap.encourage .character-container {
  animation: doctorEncourage 1.45s ease-in-out infinite;
}

.story-character-stage .character-container {
  width: var(--story-character-width);
  max-height: min(46dvh, 390px);
  filter: drop-shadow(0 18px 24px rgba(41, 52, 43, 0.22));
}

.story-character-stage .character-container .character-base {
  width: 100%;
  height: auto;
  object-fit: contain;
}

.story-character-stage .guide-character {
  width: var(--story-character-width);
  max-height: min(46dvh, 390px);
  object-fit: contain;
  filter: drop-shadow(0 18px 24px rgba(41, 52, 43, 0.22));
}

.character-nameplate {
  display: inline-grid;
  min-height: clamp(44px, 6dvh, 58px);
  place-items: center;
  padding: 6px clamp(20px, 3vw, 34px);
  border: 2px solid #d4c0a0;
  border-radius: 999px;
  background: #FFFBF2;
  color: #3d2b1f;
  font-size: clamp(22px, 3vw, 34px);
  font-weight: 1000;
  line-height: 1;
  text-shadow: 0 2px 0 rgba(46, 38, 30, 0.28);
  box-shadow: 0 6px 0 rgba(63, 51, 37, 0.24);
}

.story-choice-row {
  position: absolute;
  left: var(--story-dialog-left);
  right: var(--story-dialog-right);
  bottom: clamp(24px, 6dvh, 60px);
  z-index: 4;
  display: flex;
  width: auto;
  justify-content: center;
  transform: none;
  pointer-events: none;
}

.story-action-bubble,
.story-status-bubble {
  min-width: min(360px, 82vw);
  min-height: clamp(72px, 10dvh, 92px);
  padding: 14px clamp(28px, 5vw, 52px);
  border-radius: 999px;
  font-size: var(--game-cta-font-size);
  font-weight: 1000;
  line-height: 1.05;
  text-align: center;
}

.story-action-bubble {
  border: 3px solid #5b8c5a;
  background: linear-gradient(180deg, #6aaf67, #5b8c5a);
  color: #fff;
  box-shadow: 0 7px 0 #4a7a4a, 0 14px 28px rgba(90,140,90,0.2);
  pointer-events: auto;
}

.story-status-bubble {
  border: 3px solid #c5d5c9;
  background: #e8f0ea;
  color: #5f6b63;
  box-shadow: 0 6px 0 #c5d5c9;
}

.story-action-bubble:disabled {
  border-color: #c5d5c9;
  background: #e8f0ea;
  color: #7e8a82;
  box-shadow: 0 6px 0 #c5d5c9;
}

.story-status-bubble {
  display: inline-grid;
  place-items: center;
  pointer-events: none;
}

.story-screen--task-guide .story-dialogue-box,
.story-screen--feedback .story-dialogue-box {
  width: auto;
}

.story-screen--feedback .story-dialogue-box {
  --story-dialog-fill: #FFFBF2;
}

.story-screen--task-guide .story-dialogue-text {
  font-size: clamp(32px, 4.2vw, 52px);
  line-height: 1.18;
}

@keyframes storyTriangleBounce {
  0%, 100% {
    transform: translate(-50%, 0);
  }
  50% {
    transform: translate(-50%, 7px);
  }
}

@keyframes doctorNod {
  0%, 100% {
    transform: rotate(0deg) translateY(0);
  }
  45% {
    transform: rotate(1.8deg) translateY(7px);
  }
}

@keyframes doctorEncourage {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-8px) rotate(-1deg);
  }
}

@media (max-width: 760px) {
.story-scene-screen {
    --story-dialog-left: 12px;
    --story-dialog-right: 12px;
    --story-character-left: 12px;
    --story-character-width: min(42vw, 190px);
  }

.story-dialogue-box {
    top: 12px;
    left: var(--story-dialog-left);
    right: var(--story-dialog-right);
    width: auto;
    height: 50dvh;
    min-height: 238px;
    padding: 24px 24px 40px;
    border-width: 3px;
    border-radius: 20px;
    transform: none;
  }

.story-dialogue-box::before,
.story-dialogue-box::after {
    top: auto;
    transform: none;
  }

.story-dialogue-box::before {
    left: clamp(70px, 22vw, 112px);
    bottom: -28px;
    border-top: 28px solid #6aaf67;
    border-right: 20px solid transparent;
    border-left: 20px solid transparent;
    border-bottom: 0;
  }

.story-dialogue-box::after {
    left: calc(clamp(70px, 22vw, 112px) + 5px);
    bottom: -20px;
    border-top: 21px solid var(--story-dialog-fill);
    border-right: 15px solid transparent;
    border-left: 15px solid transparent;
    border-bottom: 0;
  }

.story-dialogue-text {
    font-size: var(--story-dialogue-mobile-font-size);
    line-height: 1.2;
  }

.story-character-stage {
    top: auto;
    left: var(--story-character-left);
    bottom: clamp(82px, 13dvh, 108px);
    width: var(--story-character-width);
    transform: none;
  }

.story-character-stage .guide-character {
    width: var(--story-character-width);
    max-height: 34dvh;
  }

.character-nameplate {
    min-height: 40px;
    padding-inline: 16px;
    font-size: clamp(20px, 5.6vw, 27px);
  }

.story-choice-row {
    left: var(--story-dialog-left);
    right: var(--story-dialog-right);
    bottom: max(18px, env(safe-area-inset-bottom));
    width: auto;
  }

.story-action-bubble,
.story-status-bubble {
    min-width: min(330px, 92vw);
    min-height: 68px;
    padding: 12px 22px;
    font-size: var(--game-cta-mobile-font-size);
  }

}

.drawer-item,
.drawer-hearing-link,
.drawer-section-toggle,
.drawer-task {
  min-height: 62px;
}

.drawer-item,
.drawer-hearing-link,
.drawer-section-toggle {
  padding: 0 16px;
}

.drawer-task {
  padding: 0 16px;
}

.drawer-task span {
  width: 32px;
  height: 32px;
  font-size: 16px;
}

.drawer-task strong {
  font-size: 16px;
}

.hearing-intro-guide-page .story-extra-content {
  width: min(760px, calc(100vw - 32px));
}

.hearing-intro-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 2vw, 20px);
  flex-wrap: wrap;
  width: 100%;
}

.hearing-intro-action {
  min-width: min(300px, 82vw);
}

.hearing-page {
  background:
    linear-gradient(180deg, rgba(255, 253, 247, 0.94), rgba(238, 251, 244, 0.92)),
    radial-gradient(circle at 12% 18%, rgba(255, 216, 90, 0.18), transparent 30%),
    radial-gradient(circle at 88% 24%, rgba(63, 141, 243, 0.12), transparent 28%);
}

.hearing-card {
  border-color: rgba(189, 210, 204, 0.82);
  background: linear-gradient(180deg, #fffdf7, #eefbf4);
  box-shadow: 0 8px 0 rgba(197, 213, 201, 0.9), 0 18px 34px rgba(36, 52, 71, 0.12);
}

.hearing-test-card {
  grid-template-rows: auto minmax(170px, 1fr) auto minmax(96px, auto) minmax(36px, auto);
}

.hearing-auto-status {
  display: inline-grid;
  min-width: min(420px, 86vw);
  min-height: clamp(76px, 10dvh, 96px);
  grid-template-columns: auto auto;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px clamp(22px, 4vw, 42px);
  border: none;
  border-radius: 999px;
  background: linear-gradient(180deg, #6aaf67, #5b8c5a);
  color: #fff;
  font-size: clamp(28px, 3.8vw, 42px);
  font-weight: 1000;
  line-height: 1.05;
  text-align: center;
  box-shadow: 0 7px 0 #4a7a4a, 0 14px 28px rgba(18,122,73,0.2);
}

.hearing-auto-status strong {
  display: inline-grid;
  min-width: 1.4em;
  place-items: center;
  color: #fff;
  font-size: 1.25em;
}

.hearing-auto-status.playing,
.hearing-auto-status.ready {
  grid-template-columns: minmax(0, 1fr);
}

.hearing-auto-status.playing {
  background: #e7f5ff;
  color: #1a2e3f;
  box-shadow: 0 8px 0 #9fc8e8, 0 18px 34px rgba(63, 141, 243, 0.16);
}

.hearing-auto-status.ready {
  background: #e7f8ef;
  color: #1a2e3f;
  box-shadow: 0 8px 0 #9bcdae, 0 18px 34px rgba(34, 169, 107, 0.16);
}

.hearing-response-grid .option {
  border: 2px solid #d9e6de;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 4px 0 #cddbd2;
}

.hearing-response-grid .option:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.18);
}

@media (max-width: 760px) {
.hearing-intro-controls {
    flex-direction: column;
  }

.hearing-auto-status {
    grid-template-columns: minmax(0, 1fr);
    min-width: min(330px, 92vw);
    font-size: var(--game-cta-mobile-font-size);
  }

}

@media (max-height: 650px) and (orientation: landscape) {
.story-dialogue-box {
    min-height: 220px;
    padding-block: 22px 34px;
  }

.story-dialogue-text {
    font-size: clamp(30px, 4.2vw, 46px);
  }

.story-character-stage {
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
  }

.story-character-stage .guide-character {
    max-height: 39dvh;
  }

}

.setup-welcome-bubble,
.hearing-guide-bubble,
.hearing-guide-popup-bubble {
  font-size: var(--game-bubble-font-size);
  font-weight: 900;
  line-height: 1.4;
}

.story-action-bubble,
.story-status-bubble,
.hearing-continue-button {
  font-size: var(--game-cta-font-size);
  font-weight: 1000;
}

@media (max-width: 760px) {
.setup-welcome-bubble,
.hearing-guide-bubble,
.hearing-guide-popup-bubble {
    font-size: var(--game-bubble-mobile-font-size);
  }

.story-action-bubble,
.story-status-bubble,
.hearing-continue-button {
    font-size: var(--game-cta-mobile-font-size);
  }

}

@media (max-width: 520px) {
.education-field .segment-option {
    font-size: 20px;
  }

}

.setup-panel {
  grid-template-columns: minmax(0, 1fr);
  justify-items: start;
}

.setup-left {
  width: min(620px, 100%);
  justify-self: start;
}

@media (orientation: portrait), (max-width: 760px) {
.setup-panel {
    justify-items: center;
  }

.setup-left {
    justify-self: center;
  }

}

.story-scene-screen {
  --story-character-width: clamp(180px, 20vw, 260px);
  display: grid;
  grid-template-columns: auto minmax(0, max-content);
  grid-template-rows: auto auto auto;
  align-content: center;
  justify-content: center;
  align-items: center;
  gap: clamp(18px, 3dvh, 30px) clamp(18px, 3vw, 36px);
  padding: clamp(22px, 4dvh, 44px) clamp(18px, 4vw, 54px);
  background: #ffffff;
  background-image: none;
}

.story-scene-screen::before {
  display: none;
}

.story-dialogue-box {
  position: relative;
  top: auto;
  left: auto;
  right: auto;
  grid-column: 2;
  grid-row: 1;
  width: fit-content;
  max-width: min(720px, calc(100vw - 360px));
  height: auto;
  min-height: 0;
  padding: clamp(22px, 3.2dvh, 34px) clamp(28px, 4vw, 48px);
  align-self: center;
  justify-self: start;
  transform: none;
}

.story-dialogue-text {
  width: fit-content;
  max-width: 100%;
  font-size: clamp(30px, 3.6vw, 48px);
  line-height: 1.18;
}

.story-screen--task-guide .story-dialogue-text {
  font-size: clamp(28px, 3.2vw, 42px);
  line-height: 1.2;
}

.story-character-stage {
  position: relative;
  top: auto;
  left: auto;
  bottom: auto;
  grid-column: 1;
  grid-row: 1;
  width: var(--story-character-width);
  align-self: center;
  justify-self: end;
  transform: none;
}

.story-character-stage .guide-character {
  width: var(--story-character-width);
  max-height: min(40dvh, 300px);
}

.story-extra-content {
  grid-column: 1 / -1;
  grid-row: 2;
  justify-self: center;
  width: min(620px, calc(100vw - 32px));
}

.story-choice-row {
  position: relative;
  left: auto;
  right: auto;
  bottom: auto;
  grid-column: 1 / -1;
  grid-row: 3;
  width: auto;
  min-width: min(360px, 90vw);
  justify-self: center;
  transform: none;
}

.story-action-bubble,
.story-status-bubble {
  min-width: min(340px, 86vw);
}

.answer-confirm-button.secondary {
  background: #e8eaed;
  color: #5f6368;
  border: 2px solid #d0d3d6;
  box-shadow: 0 4px 0 #c4c7ca;
}

@media (max-width: 760px) {
.story-scene-screen {
    --story-character-width: min(38vw, 160px);
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto auto;
    align-content: center;
    justify-items: center;
    gap: clamp(12px, 2dvh, 18px);
    padding: 18px 12px;
  }

.story-dialogue-box {
    grid-column: 1;
    grid-row: 1;
    width: fit-content;
    max-width: calc(100vw - 28px);
    padding: 22px 24px 38px;
  }

.story-dialogue-text,
.story-screen--task-guide .story-dialogue-text {
    font-size: clamp(26px, 6.6vw, 36px);
    line-height: 1.2;
  }

.story-character-stage {
    grid-column: 1;
    grid-row: 2;
    justify-self: center;
    width: var(--story-character-width);
  }

.story-character-stage .guide-character {
    width: var(--story-character-width);
    max-height: 24dvh;
  }

.story-extra-content {
    grid-column: 1;
    grid-row: 3;
  }

.story-choice-row {
    grid-column: 1;
    grid-row: 4;
    min-width: min(330px, 92vw);
  }

}

/* ═══════════════════════════════════════════
   2.5D Layered Character (eyes + mouth overlay)
   ═══════════════════════════════════════════ */
.character-container {
  position: relative;
  width: min(280px, 38vw);
  aspect-ratio: 304 / 375;
  margin: 0 auto;
  user-select: none;
  -webkit-user-select: none;
}

.character-base {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.character-eyes {
  position: absolute;
  top: 23.5%;
  left: 50%;
  transform: translateX(-50%);
  width: 32%;
  pointer-events: none;
}

.character-eyes img {
  display: block;
  width: 100%;
  height: auto;
}

.character-mouth {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translateX(-50%);
  width: 15%;
  aspect-ratio: 52 / 28;
  pointer-events: none;
}

.character-mouth img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  transition: opacity 110ms ease-out;
}

.character-mouth .char-mouth-closed {
  opacity: 1;
}

.character-mouth .char-mouth-open {
  opacity: 0;
}

.character-mouth.is-open .char-mouth-closed {
  opacity: 0;
}

.character-mouth.is-open .char-mouth-open {
  opacity: 1;
}

/* ── Ambient + Geo + Welcome ── */
.setup-ambient-extra {
  position: absolute; inset: 0; pointer-events: none; overflow: hidden;
}

.setup-ambient-extra::before {
  content: "";
  position: absolute; width: 46vmin; height: 46vmin;
  top: 35%; left: 52%; border-radius: 50%; filter: blur(90px);
  background: radial-gradient(circle, rgba(175,215,230,0.58) 0%, rgba(175,215,230,0.18) 45%, transparent 70%);
  animation: ambientGlowC 9s ease-in-out infinite;
}

@keyframes ambientGlowC {
  0%,100% { transform: scale(0.9); opacity: 0.55; }
  50%     { transform: scale(1.10); opacity: 0.9; }
}

.setup-geo {
  position: absolute; display: block; pointer-events: none;
  border-radius: 50%; animation: geoFloat 8s ease-in-out infinite; z-index: 0;
}

.setup-geo--ring {
  background: transparent; border: 3.5px solid #a8d5c2;
  box-shadow: inset 0 4px 10px rgba(120,180,160,0.22), 0 8px 24px rgba(120,170,150,0.22);
}

.setup-geo--sphere {
  background: #c8e8d8;
  box-shadow: inset 0 -10px 22px rgba(120,185,158,0.40), inset 0 6px 14px rgba(255,255,255,0.72), 0 12px 32px rgba(120,165,145,0.22);
}

.setup-geo--pill {
  border-radius: 999px; background: #f0e8cc;
  box-shadow: inset 0 -6px 14px rgba(185,168,130,0.34), inset 0 5px 12px rgba(255,255,255,0.68), 0 10px 26px rgba(160,140,105,0.20);
}

.setup-geo-1 { width:110px; height:110px; top:7%; right:12%; animation-delay:0s; }

.setup-geo-2 { width:170px; height:64px; bottom:10%; left:5%; animation-delay:1.5s; }

.setup-geo-3 { width:78px; height:78px; top:52%; left:8%; animation-delay:2.8s; }

.setup-geo-4 { width:56px; height:56px; top:12%; right:26%; animation-delay:3.6s; opacity:0.70; }

@keyframes geoFloat {
  0%,100% { transform: translateY(0) rotate(0deg); }
  30%     { transform: translateY(-14px) rotate(5deg); }
  55%     { transform: translateY(8px) rotate(-3deg); }
  80%     { transform: translateY(-4px) rotate(2deg); }
}

.setup-welcome {
  grid-column: 2; grid-row: 1;
  display: flex; align-items: center; justify-content: center;
  z-index: 1; pointer-events: none; padding-bottom: 40px;
}

.setup-welcome-inner {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}

.setup-welcome .character-container {
  width: min(260px, 34vw); animation: none;
}

.setup-welcome-bubble {
  position: relative;
  background: rgba(250,248,243,0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 20px; padding: 20px 30px;
  font-size: clamp(20px, 2.6vw, 26px); font-weight: 800;
  color: var(--ink); text-align: center; line-height: 1.5;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.55), 0 0 0 1px rgba(160,150,130,0.10), 0 6px 28px rgba(100,80,50,0.07);
}

.setup-welcome-bubble::after {
  content: ""; position: absolute; bottom: -10px; left: 50%; transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 10px solid transparent; border-right: 10px solid transparent;
  border-top: 12px solid rgba(250,248,243,0.82);
}

/* ── Sentence page — larger for elderly readability ── */
.sentence-page .circle-button {
  width: 180px; height: 180px;
  font-size: 28px; font-weight: 900;
}

.sentence-page .task-warning {
  font-size: 24px; font-weight: 800;
}

/* Center character vertically in story screen */
.story-character-stage {
  align-self: center;
}

.hearing-summary-dialog {
  display: flex; align-items: center; justify-content: center;
  gap: clamp(24px, 4vw, 48px); width: 100%; max-width: 960px;
  margin: 0 auto; padding: 24px;
}

.hearing-summary-left {
  flex: 0 0 auto;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}

.hearing-summary-right {
  flex: 1 1 auto; min-width: 0;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
}

.hearing-summary-bubble {
  background: #fff; border: 2px solid #6aaf67; border-radius: 20px;
  padding: 16px 24px; font-size: 24px; font-weight: 800;
  text-align: center; line-height: 1.5;
}

@keyframes recPulse {
  0%,100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* Current task refinements */
.standalone-shell,
.standalone-page-shell {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  overscroll-behavior-x: none;
}

.global-menu-button {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  left: max(14px, env(safe-area-inset-left));
  z-index: 18;
}

.setup-screen {
  place-items: center;
  padding: max(18px, env(safe-area-inset-top), env(safe-area-inset-bottom)) clamp(18px, 3vw, 34px);
}

.setup-panel {
  width: min(1120px, calc(100vw - clamp(36px, 6vw, 68px)));
  height: auto;
  max-height: calc(var(--app-height) - 36px);
  grid-template-columns: minmax(420px, 1.45fr) minmax(280px, 0.85fr);
  align-self: center;
  justify-self: center;
  align-items: center;
}

.setup-left {
  justify-self: stretch;
}

.setup-welcome {
  justify-self: center;
}

.hearing-intro-guide-page .story-extra-content,
.hearing-guide-page .story-extra-content {
  width: min(760px, calc(100vw - 32px));
}

.hearing-stimulus-panel {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.hearing-auto-status.ready {
  min-height: auto;
  padding: 6px 8px;
  background: transparent;
  color: var(--ink);
  box-shadow: none;
}

.hearing-response-grid .option {
  border: 0;
}

.hearing-response-grid .option.picked,
.hearing-response-grid .option.picked:disabled {
  opacity: 1;
  color: #fff;
  transform: translateY(3px);
}

.hearing-response-grid .hearing-heard.picked,
.hearing-response-grid .hearing-heard.picked:disabled {
  background: #4a7a4a;
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.24), 0 2px 0 #315d35;
}

.hearing-response-grid .hearing-missed.picked,
.hearing-response-grid .hearing-missed.picked:disabled {
  background: #c65f4c;
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.24), 0 2px 0 #8f3f32;
}

@media (orientation: portrait), (max-width: 760px) {
.setup-panel {
    width: min(720px, calc(100vw - 24px));
    max-height: calc(var(--app-height) - 24px);
    grid-template-columns: minmax(0, 1fr);
    align-items: center;
  }

}

clearer hearing choices */
.setup-screen {
  padding: max(8px, env(safe-area-inset-top), env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left), env(safe-area-inset-right));
}

.setup-panel {
  width: min(1380px, calc(100vw - 16px));
  height: calc(var(--app-height) - 16px);
  max-height: calc(var(--app-height) - 16px);
  grid-template-columns: minmax(560px, 1.55fr) minmax(360px, 0.95fr);
  gap: clamp(20px, 3vw, 46px);
  padding: clamp(12px, 2dvh, 22px) clamp(16px, 2.5vw, 34px);
}

.setup-left {
  width: 100%;
  max-width: none;
  padding: clamp(18px, 3dvh, 36px);
}

.setup-grid {
  gap: clamp(12px, 1.8dvh, 20px);
}

.setup-welcome {
  width: 100%;
  padding-bottom: 0;
}

.setup-welcome-inner {
  gap: clamp(12px, 2dvh, 22px);
}

.setup-welcome .character-container {
  width: min(430px, 34vw);
  max-height: min(60dvh, 520px);
}

.setup-welcome-bubble {
  padding: clamp(18px, 2.8dvh, 28px) clamp(24px, 3.4vw, 42px);
  font-size: clamp(24px, 2.6vw, 34px);
}

.story-dialogue-box,
.story-screen--task-guide .story-dialogue-box,
.story-screen--feedback .story-dialogue-box {
  height: clamp(310px, 44dvh, 390px);
  min-height: clamp(310px, 44dvh, 390px);
  max-height: clamp(310px, 44dvh, 390px);
  align-content: center;
}

.story-dialogue-text {
  max-height: 100%;
}

.hearing-guide-page .story-extra-content {
  display: none;
}

.hearing-test-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: clamp(14px, 2dvh, 24px);
  align-content: stretch;
  justify-items: stretch;
  overflow: hidden;
}

.hearing-test-layout {
  display: grid;
  grid-template-columns: minmax(170px, 240px) minmax(0, 1fr);
  gap: clamp(18px, 3vw, 44px);
  width: 100%;
  height: 100%;
  min-height: 0;
  align-items: stretch;
}

.hearing-test-info-column {
  display: grid;
  grid-template-rows: minmax(120px, 1fr) repeat(2, minmax(92px, auto));
  gap: clamp(10px, 1.8dvh, 16px);
  min-width: 0;
  align-content: center;
}

.hearing-test-choice-column {
  display: grid;
  grid-template-rows: minmax(86px, auto) minmax(190px, 1fr) minmax(44px, auto);
  gap: clamp(18px, 3dvh, 34px);
  min-width: 0;
  min-height: 0;
  place-items: center stretch;
}

.hearing-test-card .hearing-stage-label {
  justify-self: center;
}

.hearing-test-card .hearing-ear-target.compact {
  width: 100%;
  min-height: 0;
  align-self: stretch;
}

.hearing-test-card .hearing-ear-target.compact .ear-illustration {
  width: min(138px, 100%);
}

.hearing-test-card .hearing-stimulus-panel {
  min-height: 92px;
  padding: 10px 8px;
}

.hearing-test-card .hearing-stimulus-panel span {
  font-size: clamp(17px, 1.7vw, 22px);
}

.hearing-test-card .hearing-stimulus-panel strong {
  font-size: clamp(25px, 2.7vw, 36px);
}

.hearing-test-choice-column .hearing-auto-status {
  justify-self: center;
}

.hearing-test-choice-column .hearing-response-slot {
  width: min(820px, 100%);
  min-height: clamp(190px, 32dvh, 280px);
}

.hearing-test-choice-column .hearing-response-grid {
  width: 100%;
  grid-template-columns: repeat(2, minmax(210px, 1fr));
  gap: clamp(20px, 3vw, 36px);
}

.hearing-test-choice-column .hearing-response-grid .option {
  min-height: clamp(150px, 24dvh, 230px);
  font-size: clamp(34px, 5vw, 58px);
  border: 0;
  border-radius: 18px;
  box-shadow: 0 8px 0 #cddbd2, 0 18px 34px rgba(36, 52, 71, 0.12);
  transform: none;
}

.hearing-response-grid .option:active,
.hearing-response-grid .option.picked,
.hearing-response-grid .option.picked:disabled {
  transform: none;
}

.hearing-response-grid .hearing-heard.picked,
.hearing-response-grid .hearing-heard.picked:disabled {
  box-shadow: 0 8px 0 #315d35, 0 18px 34px rgba(36, 52, 71, 0.12);
}

.hearing-response-grid .hearing-missed.picked,
.hearing-response-grid .hearing-missed.picked:disabled {
  box-shadow: 0 8px 0 #8f3f32, 0 18px 34px rgba(36, 52, 71, 0.12);
}

.hearing-message-slot {
  min-height: 44px;
}

@media (orientation: portrait), (max-width: 760px) {
.setup-panel {
    width: calc(100vw - 16px);
    height: calc(var(--app-height) - 16px);
    max-height: calc(var(--app-height) - 16px);
    padding: 10px;
  }

.setup-welcome .character-container {
    width: min(300px, 62vw);
  }

.story-dialogue-box,
.story-screen--task-guide .story-dialogue-box,
.story-screen--feedback .story-dialogue-box {
    height: clamp(250px, 42dvh, 330px);
    min-height: clamp(250px, 42dvh, 330px);
    max-height: clamp(250px, 42dvh, 330px);
  }

.hearing-test-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
  }

.hearing-test-info-column {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: auto;
  }

.hearing-test-choice-column .hearing-response-grid {
    grid-template-columns: minmax(0, 1fr);
  }

.hearing-test-choice-column .hearing-response-grid .option {
    min-height: clamp(104px, 17dvh, 142px);
    font-size: clamp(30px, 9vw, 44px);
  }

}

/* Final stability pass for the clinician QA list. */
.setup-panel {
  overflow: visible;
}

.setup-left {
  grid-template-rows: auto minmax(0, auto) auto;
  align-content: center;
  overflow: visible;
}

.setup-grid {
  align-content: center;
  overflow: visible;
}

.field input,
.field select,
.segment-option {
  border-radius: 12px;
}

.setup-start-button {
  flex-shrink: 0;
  position: relative;
  z-index: 5;
}

.hearing-card {
  overflow: hidden;
}

.hearing-test-card {
  width: min(1040px, 100%);
  justify-self: center;
  align-content: stretch;
}

.hearing-test-layout {
  grid-template-columns: minmax(150px, 220px) minmax(0, 1fr);
  align-items: stretch;
}

.hearing-test-info-column {
  grid-template-rows: minmax(110px, 1fr) repeat(2, minmax(84px, auto));
}

.hearing-test-choice-column {
  grid-template-rows: minmax(82px, auto) minmax(190px, 1fr) minmax(44px, auto);
}

.hearing-test-choice-column .hearing-response-slot {
  visibility: visible;
  pointer-events: auto;
}

.hearing-test-choice-column .hearing-response-slot:not(.ready) {
  opacity: 0;
  pointer-events: none;
}

.hearing-test-choice-column .hearing-response-grid .option:disabled {
  pointer-events: none;
}

@media (orientation: landscape) and (max-height: 720px) {
.setup-panel {
    grid-template-columns: minmax(430px, 1.45fr) minmax(260px, 0.9fr);
    gap: clamp(12px, 2vw, 26px);
    padding: clamp(8px, 1.4dvh, 14px) clamp(12px, 2vw, 22px);
  }

.setup-left {
    padding: clamp(10px, 1.8dvh, 18px);
    gap: clamp(7px, 1.05dvh, 12px);
  }

.field > span {
    font-size: clamp(16px, 3dvh, 22px);
  }

.field input,
.field select,
.segment-option {
    height: clamp(44px, 8.1dvh, 58px);
    min-height: clamp(44px, 8.1dvh, 58px);
    font-size: clamp(18px, 3.5dvh, 24px);
  }

.segmented-options,
.edu-segment-options {
    gap: clamp(6px, 1dvh, 10px);
  }

.setup-start-button {
    height: clamp(48px, 8.8dvh, 64px);
    min-height: clamp(48px, 8.8dvh, 64px);
  }

.setup-start-button span {
    font-size: clamp(24px, 4.7dvh, 34px);
  }

.setup-welcome .character-container {
    width: min(280px, 28vw);
    max-height: min(50dvh, 340px);
  }

}

@media (orientation: portrait), (max-width: 760px) {
.setup-panel {
    overflow: hidden;
  }

.setup-left {
    align-self: center;
    gap: clamp(8px, 1dvh, 12px);
  }

.setup-welcome {
    display: none;
  }

}

.setup-left,
.setup-grid,
.field,
.field input,
.field select,
.setup-start-button,
.segment-option,
.setup-voice-button {
  box-sizing: border-box;
  max-width: 100%;
}

@media (orientation: portrait), (max-width: 760px) {
.setup-screen {
    overflow-x: hidden;
  }

.setup-panel {
    width: 100%;
    height: auto;
    min-height: 0;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto;
    justify-items: center;
    padding-inline: clamp(12px, 4vw, 22px);
  }

.setup-left {
    width: 100%;
    min-width: 0;
    padding: clamp(12px, 3.2vw, 18px);
  }

.setup-grid,
.field {
    width: 100%;
    min-width: 0;
  }

.field input,
.field select {
    min-width: 0;
    width: 100%;
  }

.edu-segment-options {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

}

calmer login. */
.setup-screen::before,
.setup-screen::after,
.setup-ambient-extra,
.setup-geo {
  display: none;
}

.floating-stars.setup-stars {
  display: block;
}

.setup-stars i {
  width: clamp(22px, 3vw, 36px);
  height: clamp(22px, 3vw, 36px);
  opacity: 0.68;
  animation: none;
}

.setup-stars i:nth-child(1) {
  top: 9%;
  left: 11%;
  background: #ffd84d;
}

.setup-stars i:nth-child(2) {
  top: 15%;
  right: 14%;
  background: #ffb35c;
}

.setup-stars i:nth-child(3) {
  right: 12%;
  bottom: 18%;
  background: #7fcaa1;
}

.setup-stars i:nth-child(4) {
  left: 8%;
  bottom: 16%;
  background: #8eb8ff;
}

.setup-panel {
  align-items: stretch;
}

.setup-welcome {
  height: 100%;
  align-self: stretch;
  padding-bottom: 0;
}

.setup-welcome-inner {
  height: 100%;
  justify-content: center;
  gap: clamp(14px, 2dvh, 22px);
}

.setup-welcome-bubble {
  border: 3px solid #d4c0a0;
  border-radius: 20px;
  background: #fff8e8;
  box-shadow: 0 8px 0 #c0a880, 0 18px 36px rgba(18, 122, 73, 0.12);
  color: #000;
  text-align: left;
}

.setup-welcome-bubble::after {
  border-top-color: #d4c0a0;
}

.setup-skip-login {
  bottom: max(72px, calc(env(safe-area-inset-bottom) + 64px));
  z-index: 8;
}

.hearing-page {
  padding: 0;
}

.hearing-test-fullscreen {
  display: grid;
  width: 100%;
  height: 100%;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr);
  gap: clamp(18px, 3dvh, 32px);
  padding: clamp(18px, 3dvh, 34px) clamp(24px, 4vw, 56px);
  overflow: hidden;
}

.hearing-test-topbar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(8px, 1.4vw, 16px);
  width: min(720px, 100%);
  justify-self: center;
  padding: 6px 0;
}

.hearing-test-stat {
  display: grid;
  min-height: auto;
  place-items: center;
  gap: 2px;
  padding: 6px 10px;
  border: 1px solid rgba(100, 116, 139, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.56);
  box-shadow: none;
  text-align: center;
}

.hearing-test-stat span {
  color: var(--muted);
  font-size: clamp(12px, 1.25vw, 16px);
  font-weight: 500;
  line-height: 1.2;
}

.hearing-test-stat strong,
.hearing-test-stat-value {
  color: var(--ink);
  font-size: clamp(14px, 1.6vw, 20px);
  font-weight: 500;
  line-height: 1.2;
}

.hearing-test-fullscreen .hearing-test-choice-column {
  grid-template-rows: minmax(82px, auto) minmax(0, 1fr) minmax(34px, auto);
  gap: clamp(18px, 3dvh, 32px);
  align-content: stretch;
}

.hearing-test-fullscreen .hearing-response-slot {
  display: grid;
  width: min(880px, 100%);
  min-height: 0;
  justify-self: center;
  align-self: stretch;
  place-items: center;
}

.hearing-test-fullscreen .hearing-response-grid {
  width: 100%;
  height: min(100%, 360px);
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.hearing-test-fullscreen .hearing-response-grid .option {
  min-height: clamp(170px, 34dvh, 280px);
  font-size: clamp(36px, 5.6vw, 64px);
}

.hearing-summary-wrapper {
  display: grid;
  height: 100%;
  place-items: center;
}

.hearing-summary-dialog {
  display: grid;
  width: min(760px, 92vw);
  justify-items: center;
  gap: clamp(24px, 4dvh, 40px);
  padding: 0;
}

.hearing-summary-bubble {
  border: 3px solid #d4c0a0;
  border-radius: 20px;
  background: #fff8e8;
  box-shadow: 0 8px 0 #c0a880, 0 18px 36px rgba(18, 122, 73, 0.12);
  color: #000;
  font-size: clamp(42px, 6vw, 72px);
  font-weight: 1000;
}

.voice-finish-button.pulse {
  animation-delay: 3s;
}

@media (orientation: portrait), (max-width: 760px) {
.setup-panel {
    align-items: center;
  }

.setup-welcome {
    display: none;
  }

.hearing-test-fullscreen {
    padding: clamp(14px, 3dvh, 26px) clamp(14px, 4vw, 22px);
  }

.hearing-test-topbar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

.hearing-test-stat {
    min-height: auto;
    padding: 5px 6px;
  }

.hearing-test-fullscreen .hearing-response-grid {
    grid-template-columns: minmax(0, 1fr);
    height: min(100%, 420px);
  }

.hearing-test-fullscreen .hearing-response-grid .option {
    min-height: 132px;
  }

}

/* Final interaction and layout overrides for the clinician QA pass. */
.setup-screen {
  background:
    linear-gradient(90deg, rgba(198, 236, 241, 0.54) 0 32%, rgba(255, 250, 235, 0.18) 60%, rgba(255, 255, 255, 0.02) 100%),
    #fdfbf7;
}

.setup-screen::before,
.setup-screen::after,
.setup-ambient-extra,
.setup-geo {
  content: none;
  display: none !important;
}

.floating-stars.setup-stars {
  z-index: 0;
  display: block;
}

.setup-stars i {
  animation: none !important;
  transform: none !important;
}

.setup-panel {
  align-items: stretch;
}

.setup-left,
.setup-welcome {
  min-height: 0;
}

.setup-welcome {
  display: grid;
  height: min(100%, clamp(460px, 69dvh, 620px));
  align-self: center;
  place-items: center;
  padding-bottom: 0;
}

.setup-welcome-inner {
  display: flex;
  height: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(14px, 2dvh, 22px);
}

.setup-welcome .character-container {
  width: min(260px, 24vw);
  max-width: 100%;
  max-height: calc(100% - clamp(158px, 23dvh, 208px));
  align-self: center;
}

.setup-welcome-bubble {
  flex: 0 0 auto;
  align-self: center;
}

.setup-skip-login {
  bottom: max(90px, calc(env(safe-area-inset-bottom) + 84px));
}

@media (orientation: portrait), (max-width: 760px) {
.setup-screen {
    background:
      linear-gradient(180deg, rgba(198, 236, 241, 0.28), rgba(255, 250, 235, 0.18) 58%, rgba(255, 219, 150, 0.14)),
      #fdfbf7;
  }

.setup-welcome {
    display: none;
  }

.setup-skip-login {
    bottom: max(78px, calc(env(safe-area-inset-bottom) + 68px));
  }

}

and stabilize guide/keypad layouts. */
.character-nameplate {
  display: none !important;
}

.setup-screen {
  background:
    radial-gradient(circle at 18% 20%, rgba(131, 197, 255, 0.18), transparent 28%),
    radial-gradient(circle at 82% 18%, rgba(255, 214, 117, 0.18), transparent 24%),
    linear-gradient(135deg, #f7fbff 0%, #fffaf0 54%, #f5fff9 100%) !important;
}

.setup-screen::before,
.setup-screen::after,
.setup-ambient-extra,
.setup-geo {
  content: none !important;
  display: none !important;
}

.floating-stars.setup-stars {
  display: block;
}

.setup-stars i {
  opacity: 0.52;
  animation: none !important;
  transform: none !important;
}

.global-menu-button {
  top: calc(max(0px, env(safe-area-inset-top)) + clamp(54px, 7dvh, 68px));
  transform: translateY(-50%);
}

.hearing-intro-guide-page .story-dialogue-box {
  height: auto;
  min-height: clamp(132px, 24dvh, 210px);
  max-height: clamp(150px, 28dvh, 240px);
  padding-block: clamp(18px, 2.8dvh, 28px);
}

.hearing-intro-guide-page .story-dialogue-text {
  font-size: clamp(30px, 3.8vw, 48px);
  line-height: 1.16;
}

@media (orientation: portrait), (max-width: 900px) {
.hearing-intro-guide-page.story-scene-screen {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto;
    justify-items: center;
    align-content: center;
    gap: clamp(14px, 2dvh, 24px);
  }

.hearing-intro-guide-page .story-dialogue-box {
    position: relative;
    grid-column: 1;
    grid-row: 1;
    width: min(620px, calc(100vw - 36px));
    max-width: min(620px, calc(100vw - 36px));
    justify-self: center;
  }

.hearing-intro-guide-page .story-character-stage {
    position: relative;
    grid-column: 1;
    grid-row: 2;
    top: auto;
    left: auto;
    bottom: auto;
    width: min(220px, 42vw);
    justify-self: center;
    transform: none;
  }

.hearing-intro-guide-page .story-choice-row,
.hearing-intro-guide-page .story-extra-content {
    position: relative;
    grid-column: 1;
    inset: auto;
    transform: none;
  }

.hearing-intro-guide-page .story-extra-content {
    grid-row: 3;
  }

.hearing-intro-guide-page .story-choice-row {
    grid-row: 4;
  }

}

.hearing-test-fullscreen .hearing-response-slot {
  align-self: start;
}

.hearing-test-fullscreen .hearing-response-grid {
  width: min(760px, 100%);
  height: auto;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(14px, 2.4vw, 24px);
}

.hearing-test-fullscreen .hearing-response-grid .option {
  min-height: clamp(82px, 13dvh, 112px);
  border: 3px solid var(--line);
  border-left: 7px solid var(--leaf);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 4px 0 #cddbd2;
  color: var(--ink);
  font-size: clamp(28px, 3.4vw, 40px);
}

.hearing-test-fullscreen .hearing-response-grid .option:disabled {
  background: #f1f5f3;
  color: #9aa7a1;
  opacity: 0.76;
}

.hearing-summary-dialog {
  display: grid;
  width: min(980px, 94vw);
  grid-template-columns: minmax(160px, 0.72fr) minmax(0, 1fr);
  align-items: center;
  justify-items: center;
  gap: clamp(24px, 4vw, 54px);
}

.hearing-summary-character .character-container {
  width: clamp(180px, 22vw, 300px);
  filter: drop-shadow(0 18px 24px rgba(41, 52, 43, 0.2));
}

.hearing-summary-copy {
  display: grid;
  justify-items: center;
  gap: clamp(22px, 4dvh, 40px);
}

.hearing-summary-bubble {
  position: relative;
  padding: clamp(22px, 3.4dvh, 34px) clamp(30px, 5vw, 58px);
  font-size: clamp(34px, 5vw, 66px);
  line-height: 1.12;
  white-space: nowrap;
}

.hearing-summary-bubble::before,
.hearing-summary-bubble::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 0;
  height: 0;
  transform: translateY(-50%);
}

.hearing-summary-bubble::before {
  left: -18px;
  border-top: 14px solid transparent;
  border-bottom: 14px solid transparent;
  border-right: 18px solid #d4c0a0;
}

.hearing-summary-bubble::after {
  left: -14px;
  border-top: 11px solid transparent;
  border-bottom: 11px solid transparent;
  border-right: 15px solid #fff8e8;
}

@media (orientation: portrait), (max-width: 760px) {
.setup-screen {
    background:
      radial-gradient(circle at 18% 18%, rgba(131, 197, 255, 0.18), transparent 30%),
      linear-gradient(180deg, #f7fbff 0%, #fffaf0 58%, #f5fff9 100%) !important;
  }

.hearing-intro-guide-page .story-dialogue-box {
    min-height: clamp(118px, 18dvh, 170px);
    max-height: clamp(132px, 22dvh, 190px);
  }

.hearing-test-fullscreen .hearing-response-grid {
    grid-template-columns: minmax(0, 1fr);
    width: min(520px, 100%);
  }

.hearing-test-fullscreen .hearing-response-grid .option {
    min-height: clamp(72px, 12dvh, 98px);
  }

.hearing-summary-dialog {
    grid-template-columns: minmax(0, 1fr);
    gap: clamp(12px, 2.4dvh, 22px);
  }

.hearing-summary-character .character-container {
    width: min(160px, 34vw);
  }

}

and unified keypads. */
.story-scene-screen .story-dialogue-box,
.story-screen--task-guide .story-dialogue-box,
.hearing-intro-guide-page .story-dialogue-box,
.hearing-guide-page .story-dialogue-box {
  right: auto !important;
  width: min(960px, calc(100vw - var(--story-dialog-left) - 40px)) !important;
  max-width: min(960px, calc(100vw - var(--story-dialog-left) - 40px)) !important;
}

.hearing-intro-guide-page .story-dialogue-text {
  text-align: center !important;
  white-space: nowrap !important;
}

.typewriter-text.typewriter-done .typewriter-measure {
  visibility: visible;
}

.typewriter-text.typewriter-done .typewriter-live {
  visibility: hidden;
}

.story-dialogue-text .typewriter-text .guide-emphasis {
  color: #f08a24 !important;
}

.hearing-test-fullscreen {
  grid-template-rows: auto minmax(0, 1fr) !important;
  gap: clamp(26px, 5dvh, 62px) !important;
  padding-block: clamp(28px, 5dvh, 58px) !important;
}

.hearing-test-fullscreen .hearing-test-choice-column {
  display: grid !important;
  grid-template-rows: auto auto auto !important;
  align-content: center !important;
  justify-items: center !important;
  gap: clamp(24px, 5dvh, 56px) !important;
}

.hearing-test-fullscreen .hearing-response-slot {
  align-self: center !important;
}

.hearing-test-fullscreen .hearing-response-grid {
  width: min(820px, 100%) !important;
}

.hearing-test-fullscreen .hearing-response-grid .option {
  min-height: clamp(112px, 18dvh, 170px) !important;
}

@media (orientation: portrait), (max-width: 760px) {
.story-scene-screen .story-dialogue-box,
.story-screen--task-guide .story-dialogue-box,
.hearing-intro-guide-page .story-dialogue-box,
.hearing-guide-page .story-dialogue-box {
    right: auto !important;
    width: min(720px, calc(100vw - 28px)) !important;
    max-width: min(720px, calc(100vw - 28px)) !important;
  }

.hearing-intro-guide-page .story-dialogue-text {
    font-size: clamp(28px, 7vw, 44px) !important;
  }

.hearing-test-fullscreen {
    gap: clamp(18px, 3dvh, 34px) !important;
    padding-block: clamp(18px, 3dvh, 32px) !important;
  }

.hearing-test-fullscreen .hearing-test-choice-column {
    gap: clamp(16px, 3dvh, 30px) !important;
  }

}

and steadier answer surfaces. */
.story-scene-screen .story-dialogue-box,
.story-screen--task-guide .story-dialogue-box,
.story-screen--feedback .story-dialogue-box,
.hearing-intro-guide-page .story-dialogue-box,
.hearing-guide-page .story-dialogue-box {
  width: min(1152px, calc(100vw - var(--story-dialog-left) - 32px)) !important;
  max-width: min(1152px, calc(100vw - var(--story-dialog-left) - 32px)) !important;
}

.hearing-intro-guide-page .story-dialogue-text,
.hearing-intro-guide-page .typewriter-text {
  white-space: nowrap !important;
}

.hearing-intro-guide-page .story-dialogue-text {
  font-size: clamp(28px, 3.25vw, 44px) !important;
}

.hearing-test-fullscreen {
  min-height: 100% !important;
  grid-template-rows: minmax(74px, auto) minmax(0, 1fr) !important;
  align-content: center !important;
  gap: clamp(34px, 6dvh, 74px) !important;
  padding-block: clamp(36px, 7dvh, 88px) !important;
}

.hearing-test-fullscreen .hearing-test-topbar {
  align-self: end !important;
}

.hearing-test-fullscreen .hearing-test-choice-column {
  align-content: center !important;
  gap: clamp(28px, 5dvh, 58px) !important;
}

@media (orientation: portrait), (max-width: 760px) {
.story-scene-screen .story-dialogue-box,
.story-screen--task-guide .story-dialogue-box,
.story-screen--feedback .story-dialogue-box,
.hearing-intro-guide-page .story-dialogue-box,
.hearing-guide-page .story-dialogue-box {
    width: min(760px, calc(100vw - 24px)) !important;
    max-width: min(760px, calc(100vw - 24px)) !important;
  }

.hearing-intro-guide-page .story-dialogue-text {
    font-size: clamp(25px, 6.1vw, 38px) !important;
  }

.hearing-test-fullscreen {
    gap: clamp(22px, 4dvh, 42px) !important;
    padding-block: clamp(24px, 5dvh, 46px) !important;
  }

}

.story-screen--feedback .story-dialogue-box,
.hearing-intro-guide-page .story-dialogue-box,
.hearing-guide-page .story-dialogue-box {
  width: fit-content !important;
  min-width: min(340px, calc(100vw - var(--story-dialog-left) - var(--story-dialog-right))) !important;
  max-width: min(820px, calc(100vw - var(--story-dialog-left) - var(--story-dialog-right))) !important;
  height: auto !important;
  min-height: clamp(128px, 20dvh, 210px) !important;
  max-height: min(58dvh, 420px) !important;
  padding: clamp(22px, 3.4dvh, 38px) clamp(28px, 4vw, 50px) !important;
}

.hearing-summary-character {
  opacity: 0;
  transform: translateY(8px) scale(0.96);
  animation: hearingSummaryCharacterAppear 0.54s steps(2, end) 0.34s forwards;
}

@keyframes hearingSummaryCharacterAppear {
  0%, 56% {
    opacity: 0;
    transform: translateY(8px) scale(0.96);
  }
  57%, 100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.hearing-summary-copy {
  display: grid;
  justify-items: center;
  gap: clamp(18px, 3dvh, 30px);
}

.hearing-summary-wrapper .hearing-continue-button {
  min-width: min(360px, 82vw) !important;
}

/* Final QA pass: sidebar stays above task surfaces and all guide layouts center as one group. */
.global-menu-button {
  z-index: 11010 !important;
  pointer-events: auto !important;
}

.hidden-drawer {
  z-index: 11020 !important;
}

.story-scene-screen.story-screen--onboarding,
.story-scene-screen.story-screen--feedback {
  --story-character-width: clamp(138px, 15vw, 210px) !important;
  display: grid !important;
  grid-template-columns: minmax(118px, var(--story-character-width)) minmax(0, auto) !important;
  grid-template-rows: auto auto auto !important;
  align-content: center !important;
  align-items: center !important;
  justify-content: center !important;
  justify-items: stretch !important;
  gap: clamp(18px, 3dvh, 32px) clamp(18px, 3vw, 36px) !important;
  padding: clamp(18px, 3.2dvh, 34px) clamp(18px, 4vw, 48px) !important;
  overflow: hidden !important;
}

.story-scene-screen.story-screen--onboarding .story-character-stage,
.story-scene-screen.story-screen--feedback .story-character-stage,
.story-scene-screen.story-screen--onboarding .story-dialogue-box,
.story-scene-screen.story-screen--feedback .story-dialogue-box,
.story-scene-screen.story-screen--onboarding .story-extra-content,
.story-scene-screen.story-screen--feedback .story-extra-content,
.story-scene-screen.story-screen--onboarding .story-choice-row,
.story-scene-screen.story-screen--feedback .story-choice-row {
  position: static !important;
  inset: auto !important;
  transform: none !important;
}

.story-scene-screen.story-screen--onboarding .story-character-stage,
.story-scene-screen.story-screen--feedback .story-character-stage {
  grid-column: 1 !important;
  grid-row: 1 !important;
  width: var(--story-character-width) !important;
  align-self: center !important;
  justify-self: end !important;
}

.story-scene-screen.story-screen--onboarding .story-character-stage .guide-character,
.story-scene-screen.story-screen--feedback .story-character-stage .guide-character,
.story-scene-screen.story-screen--onboarding .story-character-stage .character-container,
.story-scene-screen.story-screen--feedback .story-character-stage .character-container {
  width: var(--story-character-width) !important;
  max-height: min(42dvh, 310px) !important;
}

.story-scene-screen.story-screen--onboarding .story-dialogue-box,
.story-scene-screen.story-screen--feedback .story-dialogue-box {
  grid-column: 2 !important;
  grid-row: 1 !important;
  width: fit-content !important;
  min-width: min(300px, 100%) !important;
  max-width: 100% !important;
  height: auto !important;
  min-height: clamp(112px, 18dvh, 186px) !important;
  max-height: min(56dvh, 390px) !important;
  align-self: center !important;
  justify-self: start !important;
  padding: clamp(20px, 3dvh, 34px) clamp(26px, 4vw, 46px) !important;
  overflow: visible !important;
}

.story-scene-screen.story-screen--onboarding .story-dialogue-text,
.story-scene-screen.story-screen--feedback .story-dialogue-text {
  width: max-content !important;
  max-width: min(18em, 100%) !important;
  font-size: clamp(28px, 3.25vw, 44px) !important;
  line-height: 1.18 !important;
}

.story-scene-screen.story-screen--onboarding .story-extra-content,
.story-scene-screen.story-screen--feedback .story-extra-content {
  grid-column: 1 / -1 !important;
  grid-row: 2 !important;
  width: min(620px, calc(100vw - 36px)) !important;
  justify-self: center !important;
  align-self: center !important;
  margin: 0 !important;
  z-index: 4 !important;
}

.story-scene-screen.story-screen--onboarding .story-choice-row,
.story-scene-screen.story-screen--feedback .story-choice-row {
  grid-column: 1 / -1 !important;
  grid-row: 3 !important;
  width: 100% !important;
  min-width: 0 !important;
  justify-content: center !important;
  justify-self: center !important;
  align-self: center !important;
  z-index: 5 !important;
}

.story-scene-screen.story-screen--onboarding .story-action-bubble,
.story-scene-screen.story-screen--feedback .story-action-bubble,
.story-scene-screen.story-screen--onboarding .story-status-bubble,
.story-scene-screen.story-screen--feedback .story-status-bubble {
  min-width: min(340px, 86vw) !important;
}

.hearing-summary-dialog {
  min-height: min(520px, calc(100dvh - 140px)) !important;
  align-items: center !important;
}

.hearing-summary-character {
  opacity: 0 !important;
  visibility: hidden !important;
  transform: translateY(8px) scale(0.98) !important;
  backface-visibility: hidden !important;
  will-change: opacity, transform !important;
  animation: hearingSummaryCharacterAppearStable 0.42s ease-out 0.32s forwards !important;
}

@keyframes hearingSummaryCharacterAppearStable {
  0% {
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px) scale(0.98);
  }
  1% {
    opacity: 0;
    visibility: visible;
    transform: translateY(8px) scale(0.98);
  }
  100% {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
  }
}

@media (orientation: portrait), (max-width: 760px) {
.story-scene-screen.story-screen--onboarding,
.story-scene-screen.story-screen--feedback {
    --story-character-width: min(132px, 30vw) !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: auto auto auto auto !important;
    align-content: center !important;
    justify-items: center !important;
    gap: clamp(10px, 2dvh, 18px) !important;
    padding: clamp(12px, 2dvh, 22px) 14px !important;
  }

.story-scene-screen.story-screen--onboarding .story-character-stage,
.story-scene-screen.story-screen--feedback .story-character-stage {
    grid-column: 1 !important;
    grid-row: 1 !important;
    width: var(--story-character-width) !important;
    justify-self: center !important;
  }

.story-scene-screen.story-screen--onboarding .story-dialogue-box,
.story-scene-screen.story-screen--feedback .story-dialogue-box {
    grid-column: 1 !important;
    grid-row: 2 !important;
    width: fit-content !important;
    min-width: min(292px, calc(100vw - 28px)) !important;
    max-width: calc(100vw - 28px) !important;
    justify-self: center !important;
    align-self: center !important;
    min-height: clamp(92px, 16dvh, 146px) !important;
    padding: clamp(18px, 2.6dvh, 26px) clamp(20px, 5vw, 30px) !important;
  }

.story-scene-screen.story-screen--onboarding .story-dialogue-box::before,
.story-scene-screen.story-screen--onboarding .story-dialogue-box::after,
.story-scene-screen.story-screen--feedback .story-dialogue-box::before,
.story-scene-screen.story-screen--feedback .story-dialogue-box::after {
    display: none !important;
  }

.story-scene-screen.story-screen--onboarding .story-dialogue-text,
.story-scene-screen.story-screen--feedback .story-dialogue-text {
    width: fit-content !important;
    max-width: 100% !important;
    font-size: clamp(25px, 6vw, 36px) !important;
  }

.story-scene-screen.story-screen--onboarding .story-extra-content,
.story-scene-screen.story-screen--feedback .story-extra-content {
    grid-column: 1 !important;
    grid-row: 3 !important;
    width: min(100%, calc(100vw - 28px)) !important;
  }

.story-scene-screen.story-screen--onboarding .story-choice-row,
.story-scene-screen.story-screen--feedback .story-choice-row {
    grid-column: 1 !important;
    grid-row: 4 !important;
  }

}

@media (orientation: landscape) and (max-height: 620px) {
.story-scene-screen.story-screen--onboarding,
.story-scene-screen.story-screen--feedback {
    --story-character-width: clamp(112px, 13vw, 160px) !important;
    grid-template-columns: minmax(104px, var(--story-character-width)) minmax(0, auto) !important;
    gap: clamp(10px, 2dvh, 18px) clamp(14px, 2.4vw, 28px) !important;
    padding-block: clamp(10px, 2dvh, 18px) !important;
  }

.story-scene-screen.story-screen--onboarding .story-dialogue-box,
.story-scene-screen.story-screen--feedback .story-dialogue-box {
    min-height: clamp(88px, 21dvh, 130px) !important;
    max-height: 48dvh !important;
    padding: clamp(14px, 2.4dvh, 22px) clamp(20px, 3vw, 32px) !important;
  }

.story-scene-screen.story-screen--onboarding .story-dialogue-text,
.story-scene-screen.story-screen--feedback .story-dialogue-text {
    font-size: clamp(24px, 3vw, 34px) !important;
  }

.story-action-bubble,
.story-status-bubble {
    min-height: clamp(58px, 10dvh, 72px) !important;
  }

}

.story-scene-screen.story-screen--feedback .story-dialogue-box {
  box-sizing: border-box !important;
  position: relative !important;
  width: fit-content !important;
  min-width: min(260px, calc(100vw - 40px)) !important;
  max-width: min(680px, calc(100vw - var(--story-character-width, 160px) - 112px)) !important;
  min-height: clamp(86px, 13dvh, 136px) !important;
  padding: clamp(16px, 2.3dvh, 28px) clamp(22px, 3.1vw, 38px) !important;
}

.story-scene-screen.story-screen--onboarding .story-dialogue-text,
.story-scene-screen.story-screen--feedback .story-dialogue-text {
  width: fit-content !important;
  max-width: min(15em, 100%) !important;
}

.story-dialogue-box .story-next-triangle,
.hearing-summary-bubble .story-next-triangle {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.hearing-summary-bubble {
  position: relative !important;
  padding-bottom: clamp(30px, 5dvh, 48px) !important;
}

.hearing-summary-bubble .story-next-triangle {
  bottom: clamp(10px, 1.8dvh, 16px) !important;
}

@media (orientation: portrait), (max-width: 760px) {
.story-scene-screen.story-screen--onboarding .story-dialogue-box,
.story-scene-screen.story-screen--feedback .story-dialogue-box {
    min-width: min(244px, calc(100vw - 28px)) !important;
    max-width: min(560px, calc(100vw - 28px)) !important;
    min-height: clamp(82px, 13dvh, 126px) !important;
    padding: clamp(15px, 2.2dvh, 24px) clamp(18px, 4.6vw, 28px) !important;
  }

.story-scene-screen.story-screen--onboarding .story-dialogue-text,
.story-scene-screen.story-screen--feedback .story-dialogue-text {
    max-width: min(13.5em, 100%) !important;
  }

}

@media (orientation: landscape) and (max-height: 620px) {
.story-scene-screen.story-screen--onboarding .story-dialogue-box,
.story-scene-screen.story-screen--feedback .story-dialogue-box {
    min-height: clamp(78px, 18dvh, 112px) !important;
    padding: clamp(13px, 2dvh, 20px) clamp(18px, 2.6vw, 30px) !important;
  }

}

.hearing-intro-guide-page.story-scene-screen.story-screen--task-guide .story-dialogue-box {
  min-height: clamp(106px, 15dvh, 156px) !important;
  padding-bottom: clamp(30px, 4.2dvh, 44px) !important;
}

.hearing-intro-guide-page .story-next-triangle {
  bottom: clamp(8px, 1.5dvh, 14px) !important;
}

@media (orientation: landscape) and (max-height: 620px) {
.hearing-intro-guide-page.story-scene-screen.story-screen--task-guide .story-dialogue-box {
    min-height: clamp(98px, 22dvh, 128px) !important;
    padding-bottom: clamp(28px, 5dvh, 38px) !important;
  }

}

/* Character stability: keep every person page visually still on tablets. */
.character-container--static {
  aspect-ratio: 641 / 900 !important;
  overflow: hidden !important;
  animation: none !important;
  contain: paint !important;
}

.character-container--static .character-static {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  pointer-events: none !important;
  user-select: none !important;
  -webkit-user-select: none !important;
  backface-visibility: hidden !important;
  transform: translateZ(0) !important;
}

.story-character-wrap,
.story-character-wrap.nod .character-container,
.story-character-wrap.encourage .character-container,
.story-character-wrap.nod .guide-character,
.story-character-wrap.encourage .guide-character,
.setup-welcome .character-container,
.hearing-summary-character .character-container {
  animation: none !important;
}

.setup-screen::before,
.setup-screen::after,
.setup-ambient-extra::before,
.setup-geo,
.floating-stars i {
  animation: none !important;
}

/* Current QA overrides */
.story-character-stage .character-container,
.hearing-summary-character .character-container,
.setup-welcome .character-container {
  isolation: isolate !important;
  contain: paint !important;
  overflow: visible !important;
  backface-visibility: hidden !important;
  transform: translateZ(0) !important;
}

.guide-character-animated .character-container {
  width: 100% !important;
  height: 100% !important;
  max-height: inherit !important;
  margin: 0 !important;
  filter: none !important;
  contain: paint !important;
}

.story-character-stage .character-container .character-base,
.setup-welcome .character-container .character-base,
.hearing-summary-character .character-container .character-base,
.guide-character-animated .character-container .character-base,
.character-eyes img,
.character-mouth img {
  backface-visibility: hidden !important;
  transform: translateZ(0) !important;
  will-change: auto !important;
}

.character-eyes {
  transform: translate3d(-50%, 0, 0) !important;
}

.character-mouth {
  transform: translate3d(-50%, 0, 0) !important;
}

synced prompt typing. */
.setup-screen {
  height: 100dvh !important;
  min-height: 100dvh !important;
  max-height: 100dvh !important;
  overflow: hidden !important;
}

.setup-standalone {
  padding: 0 !important;
}

.setup-standalone .standalone-page-shell {
  width: 100vw !important;
  height: 100dvh !important;
}

.setup-panel {
  grid-template-columns: minmax(300px, 0.86fr) minmax(520px, 1.46fr) !important;
  box-sizing: border-box !important;
  width: min(1380px, calc(100vw - 32px)) !important;
  height: min(760px, calc(100dvh - 32px), calc(var(--app-height) - 32px)) !important;
  max-height: min(760px, calc(100dvh - 32px), calc(var(--app-height) - 32px)) !important;
  overflow: visible !important;
}

.setup-welcome {
  grid-column: 1 !important;
  grid-row: 1 !important;
  display: grid !important;
  justify-self: stretch !important;
}

.setup-left {
  grid-column: 2 !important;
  grid-row: 1 !important;
}

.setup-welcome-bubble {
  min-width: min(300px, 100%) !important;
  max-width: min(380px, 100%) !important;
  text-align: left !important;
  white-space: pre-line !important;
}

.setup-welcome-bubble .typewriter-text,
.setup-welcome-bubble .typewriter-measure,
.setup-welcome-bubble .typewriter-live {
  white-space: pre-line !important;
}

.setup-skip-login {
  right: max(34px, calc(env(safe-area-inset-right) + 30px)) !important;
  bottom: max(78px, calc(env(safe-area-inset-bottom) + 70px)) !important;
  max-width: calc(100vw - 72px) !important;
}

@media (orientation: portrait), (max-width: 760px) {
.setup-panel {
    grid-template-columns: minmax(0, 1fr) !important;
  }

.setup-left {
    grid-column: 1 !important;
  }

.setup-welcome {
    display: none !important;
  }

.setup-skip-login {
    right: max(28px, calc(env(safe-area-inset-right) + 24px)) !important;
  }

}

@media (orientation: landscape) and (max-height: 620px) {
.setup-panel {
    grid-template-columns: minmax(240px, 0.78fr) minmax(500px, 1.5fr) !important;
  }

.setup-welcome .character-container {
    width: min(230px, 22vw) !important;
  }

.setup-welcome-bubble {
    max-width: min(340px, 100%) !important;
  }

}

.setup-duplicate-dialog {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
}

.setup-duplicate-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(24, 35, 48, 0.34);
}

.setup-duplicate-panel {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 20px;
  justify-items: center;
  width: min(560px, 94vw);
  padding: clamp(26px, 4vw, 38px);
  border: 3px solid var(--leaf);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 22px 56px rgba(24, 35, 48, 0.24);
  text-align: center;
}

.setup-duplicate-panel h3 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 1000;
  line-height: 1.16;
}

.setup-duplicate-panel p {
  margin: 0;
  color: var(--muted);
  font-size: clamp(20px, 2.4vw, 28px);
  font-weight: 900;
  line-height: 1.28;
}

.setup-duplicate-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  gap: 14px;
  width: min(420px, 100%);
}

.setup-duplicate-actions.single {
  grid-template-columns: minmax(180px, 1fr);
  width: min(260px, 100%);
}

.setup-panel .setup-action-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  width: 100%;
}

.setup-panel .setup-action-row .setup-start-button {
  width: 100%;
  min-width: 0;
}

.setup-panel .setup-skip-login {
  position: static !important;
  inset: auto !important;
  justify-self: end;
  z-index: 6 !important;
  width: auto !important;
  max-width: min(180px, calc(100vw - 44px)) !important;
  min-height: 36px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: rgba(49, 60, 72, 0.78);
  box-shadow: 0 6px 18px rgba(36, 52, 71, 0.12);
}

@media (max-width: 480px) {
.setup-panel .setup-action-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

}

.idle-answer-nudge .option:not(.picked),
.idle-answer-nudge .sound-button {
  animation: idleAnswerFlash var(--attention-pulse-duration) ease-in-out infinite;
}

.idle-dialog-open > :not(.task-idle-dialog) .pulse,
.idle-dialog-open > :not(.task-idle-dialog) .option,
.idle-dialog-open > :not(.task-idle-dialog) .sound-button {
  animation: none !important;
}

#app:has(> .task-idle-dialog) > :not(.task-idle-dialog) .pulse,
#app:has(> .task-idle-dialog) > :not(.task-idle-dialog) .answer-ready,
#app:has(> .task-idle-dialog) > :not(.task-idle-dialog) .attention-nudge,
#app:has(> .task-idle-dialog) > :not(.task-idle-dialog) .option,
#app:has(> .task-idle-dialog) > :not(.task-idle-dialog) .tap-button,
#app:has(> .task-idle-dialog) > :not(.task-idle-dialog) .sound-button {
  animation: none !important;
}

.standalone-page-shell:has(> .task-idle-dialog) > :not(.task-idle-dialog) .pulse,
.standalone-page-shell:has(> .task-idle-dialog) > :not(.task-idle-dialog) .answer-ready,
.standalone-page-shell:has(> .task-idle-dialog) > :not(.task-idle-dialog) .attention-nudge,
.standalone-page-shell:has(> .task-idle-dialog) > :not(.task-idle-dialog) .story-action-bubble {
  animation: none !important;
}

@keyframes orangeCanvasPulse {
  0%,
  100% {
    border-color: #f59e0b;
    box-shadow: inset 0 2px 12px rgba(245, 158, 11, 0.12), 0 0 0 0 rgba(245, 158, 11, 0.26);
  }
  50% {
    border-color: #fb923c;
    box-shadow: inset 0 2px 14px rgba(251, 146, 60, 0.22), 0 0 0 8px rgba(251, 146, 60, 0.14);
  }
}

@keyframes idleAnswerFlash {
  0%,
  100% {
    border-color: #f59e0b;
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.22);
  }
  50% {
    border-color: #fb923c;
    box-shadow: 0 0 0 8px rgba(251, 146, 60, 0.15);
  }
}

@keyframes idleButtonHandTap {
  0%,
  100% {
    transform: translate(-50%, 0) scale(1);
  }
  50% {
    transform: translate(-50%, 14%) scale(1.08);
  }
}

@keyframes idleCanvasHandTap {
  0%,
  100% {
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    transform: translate(-50%, -24%) scale(1.08);
  }
}

@media (orientation: portrait), (max-width: 760px) {
html,
body,
#app {
    max-width: 100%;
    overflow-x: hidden;
  }

.setup-grid {
    grid-template-columns: 1fr;
  }

}

/* User-test round 1: keep the layered guide visibly animated. */
.character-eyes {
  aspect-ratio: 1.9 / 1;
}

.character-eyes .char-eyes-open,
.character-eyes .char-eyes-close {
  position: absolute;
  inset: 0;
  width: 100%;
  opacity: 1;
}

.character-eyes .char-eyes-close {
  opacity: 0;
}

.character-eyes.eyes-closed .char-eyes-open {
  opacity: 0;
}

.character-eyes.eyes-closed .char-eyes-close {
  opacity: 1;
}

.hearing-summary-character {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
  animation: none !important;
}

but restore a gentler eye proportion. */
.task-answer-stage .task-question-side .character-eyes {
  width: 25.5% !important;
}

@media (orientation: portrait), (max-width: 760px) {
:root {
    --cognitive-body-size: clamp(23px, 5.6vw, 30px);
  }

}

.drawer-revision-notice {
  margin: 8px 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff4cf;
  color: #70510d;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.4;
}

.drawer-panel button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.task-answer-stage .task-question-side .guide-character-animated .character-container {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  aspect-ratio: 304 / 375 !important;
  margin: 0 !important;
}

.task-answer-stage .task-question-side .guide-character-animated .character-base {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
}

/* Use the same percentage anchors as the correctly scaling guide pages. */
.task-answer-stage .task-question-side .guide-character-animated .character-eyes {
  top: 23.5% !important;
  left: 50% !important;
  width: 32% !important;
  height: auto !important;
}

.task-answer-stage .task-question-side .guide-character-animated .character-mouth {
  top: 40% !important;
  left: 50% !important;
  width: 15% !important;
  height: auto !important;
  aspect-ratio: 52 / 28 !important;
}

/* Keep the restored character-left/form-right setup while supporting the new fields. */
.setup-screen .field-requirement {
  display: inline-block;
  margin-left: 0.4em;
  color: inherit;
  font-size: 0.68em;
  font-weight: 800;
  opacity: 0.72;
  vertical-align: middle;
}

.setup-screen .field-requirement.required {
  color: var(--leaf-dark);
  opacity: 1;
}

.setup-screen .participant-age-field select,
.setup-screen .participant-birth-year-field select {
  cursor: pointer;
}

.setup-screen .participant-name-field input::placeholder,
.setup-screen .field select.is-placeholder,
.setup-screen .field select option[value=""] {
  color: #9aa6b2;
  opacity: 1;
}

.setup-screen .field select option:not([value=""]) {
  color: #243447;
}

.setup-screen .field-error[aria-hidden="true"] {
  display: none;
}

.setup-screen .field.invalid .field-error {
  display: block;
  visibility: visible;
}

.setup-screen .setup-form-status {
  min-height: 1.2em;
  margin: 0;
}

@media (min-width: 761px) and (orientation: landscape) {
.setup-screen .setup-left {
    gap: clamp(8px, 1.2dvh, 14px);
  }

.setup-screen .setup-grid {
    grid-template-columns: minmax(0, 1fr) minmax(150px, 0.48fr);
    column-gap: clamp(10px, 1.2vw, 16px);
    row-gap: clamp(8px, 1.2dvh, 14px);
  }

.setup-screen .participant-case-field,
.setup-screen .education-field,
.setup-screen .participant-birth-year-field {
    grid-column: 1 / -1 !important;
  }

.setup-screen .participant-name-field {
    grid-column: 1 !important;
  }

.setup-screen .participant-age-field {
    grid-column: 2 !important;
  }

}

.audio-preparation-screen {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 100%;
  padding: clamp(20px, 4vw, 56px);
}

.audio-preparation-card {
  display: grid;
  justify-items: center;
  gap: clamp(14px, 2.2dvh, 24px);
  width: min(680px, 100%);
  padding: clamp(28px, 5vw, 58px);
  border: 3px solid #bfd4c8;
  border-radius: 32px;
  background: rgba(255, 253, 247, 0.98);
  box-shadow: 0 14px 0 rgba(111, 148, 128, 0.16);
  text-align: center;
}

.audio-preparation-icon {
  font-size: clamp(52px, 8vw, 82px);
  line-height: 1;
}

.audio-preparation-card h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(32px, 4vw, 48px);
}

.audio-preparation-card p {
  max-width: 560px;
  margin: 0;
  color: #46576a;
  font-size: clamp(21px, 2.4vw, 28px);
  line-height: 1.55;
}

.audio-preparation-progress {
  width: min(520px, 100%);
  height: clamp(24px, 3.5dvh, 34px);
  overflow: hidden;
  border: 3px solid #a8c9b8;
  border-radius: 999px;
  background: #edf3ef;
}

.audio-preparation-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #6caf6a, #f0ae45);
  transition: width 160ms ease-out;
}

.audio-preparation-percent {
  color: var(--leaf-dark);
  font-size: clamp(28px, 3.4vw, 38px);
}

.audio-preparation-count {
  min-height: 1.5em;
  color: #687887;
  font-size: clamp(18px, 2vw, 23px);
}

@media (orientation: portrait), (max-width: 760px) {
.audio-preparation-card {
    border-radius: 24px;
    padding: clamp(24px, 7vw, 38px) clamp(18px, 5vw, 30px);
  }

}
