/* Participant surfaces use larger type without changing the research dashboard. */
:root {
  color-scheme: light;
  --text: #171b1a;
  --text-dim: #48534f;
  --bg: #f4f6f5;
  --surface: #fff;
  --surface-strong: #fff;
  --surface-weak: #edf2ef;
  --hairline: #b9c6bf;
  --shadow: none;
}
body { background: var(--bg) !important; font-size: 20px; line-height: 1.5; }
h1, h2, h3, .brand, .large-title, #ok.keypad-button { letter-spacing: 0; }
h1, .large-title { font-size: 30px; line-height: 1.25; }
.topbar { position: static; background: #fff; padding: 10px 20px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 20px; line-height: 1.2; }
.brand img { width: 32px; height: 32px; }
.lang-switch select { min-width: 120px; width: auto; min-height: 48px; }
.container { max-width: 800px; border: 0; border-radius: 8px !important; box-shadow: none; margin: 24px auto; }
p { line-height: 1.55; }
input[type="text"], input[type="number"], select { font: inherit; color: var(--text); min-height: 56px; border-radius: 8px; }
button, a, input, select, summary { touch-action: manipulation; }
:focus-visible { outline: 3px solid #125dc2; outline-offset: 3px; }
.primary, .secondary { min-height: 56px; border-radius: 8px !important; white-space: normal; text-align: center; box-shadow: none; }
.primary:active, .keypad-button:active { transform: none; }
.small, .numeric-field { font-size: 18px; }
.hero-actions { align-items: center; flex-direction: column; }
.action-button { width: min(100%, 360px); }
.hero-actions .secondary { background: transparent !important; border-color: transparent !important; }
.setup-card { border-radius: 8px; background: #fff; padding: 16px; }
.condition-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
.condition-option, .readiness-option, .toggle-row, .calibration-confirmation { min-height: 56px; border-radius: 8px; }
.condition-option input, .readiness-option input, .toggle-row input, .calibration-confirmation input { width: 24px; height: 24px; margin: 3px 0 0; }
.calibration-actions { display: grid; grid-template-columns: 1fr 1fr; }
.calibration-status { min-height: 86px; border-radius: 8px; }
.calibration-progress { height: 8px; }
.calibration-progress span { background: var(--ios-blue); }
#noiseGain { display: block; width: 100%; height: 48px; margin: 12px 0; accent-color: var(--ios-blue); cursor: pointer; }
#noiseGain { appearance: none; background: transparent; }
#noiseGain::-webkit-slider-runnable-track { height: 8px; background: #b9c6bf; border-radius: 4px; }
#noiseGain::-webkit-slider-thumb { appearance: none; width: 30px; height: 30px; margin-top: -11px; border: 2px solid white; border-radius: 50%; background: #0f766e; box-shadow: 0 0 0 1px #0f766e; }
#noiseGain::-moz-range-track { height: 8px; background: #b9c6bf; border-radius: 4px; }
#noiseGain::-moz-range-thumb { width: 28px; height: 28px; border: 2px solid white; border-radius: 50%; background: #0f766e; box-shadow: 0 0 0 1px #0f766e; }
.volume-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.calibration-fine { margin-top: 20px; border-top: 1px solid var(--hairline); padding-top: 12px; }
.calibration-fine summary { cursor: pointer; padding: 8px 0; font-size: 18px; font-weight: 700; }
.calibration-controls { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
.numeric-field { grid-column: auto; order: 0; }
.calibration-confirmation { margin-top: 20px; }
#confirmCalib { width: 100%; }
.test-page { width: calc(100% - 32px); max-width: 720px; row-gap: 8px; padding: 16px !important; }
.test-page > * { min-width: 0; max-width: 100%; }
.test-page #condTitle { font-size: 24px; min-height: 30px; margin: 0; }
.test-page #condText { font-size: 20px; line-height: 1.35; min-height: 54px; display: flex; align-items: center; justify-content: center; }
.progress-row { width: 100%; gap: 8px; min-height: 32px; }
.phase-badge, #progress { font-size: 18px; line-height: 1.3; border: 0; background: transparent; padding: 0; min-height: 24px; text-transform: none; }
.test-state-badge { display: none; }
.status-panel { min-height: 81px; font-size: 20px; line-height: 1.35; align-items: center; }
.test-page .audiocontrol { min-height: 56px; }
#playTrial { min-width: 160px; }
#playHint { display: none; }
.display.center { min-height: 60px; width: 100%; }
#input.display-box { width: min(100%, 440px) !important; max-width: 100% !important; min-height: 56px !important; margin: 0 !important; gap: 8px !important; }
#input.display-box .digit-box { flex: 1 1 0; min-width: 0; max-width: 72px; width: auto; height: 56px; border-radius: 8px; font-size: 32px; box-shadow: none; }
.test-page .keypad { width: min(100%, 440px); max-width: 440px !important; display: grid; gap: 8px; }
.kp-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0 !important; }
.keypad-button { width: 100%; height: 64px; font-size: 32px; border-radius: 8px; box-shadow: none; }
#ok.keypad-button { font-size: 22px; }
#clear.keypad-button { flex-direction: column; gap: 2px; font-size: 16px; }
#clear.keypad-button svg { width: 24px; height: 24px; }
.keypad.disabled .keypad-button, .keypad-button:disabled { opacity: 1; color: #56615c; background: #e9eeeb; filter: none; }
.keypad-button.primary:disabled { background: #e9eeeb !important; color: #56615c !important; }
.table { display: block; overflow-x: auto; box-shadow: none; }
.result-upload-panel { flex-wrap: wrap; }
@media (max-width: 560px) {
  .topbar { padding: 8px 12px; }
  .container { margin: 12px; padding: 20px !important; }
  .test-page { width: calc(100% - 16px); margin: 8px; padding: 12px !important; }
  .test-page #condTitle { font-size: 22px; }
  .test-page #condText { font-size: 18px; min-height: 49px; }
  .phase-badge, #progress { font-size: 16px; }
  .status-panel { font-size: 18px; min-height: 73px; }
  .lang-switch select { font-size: 18px; min-width: 112px; }
}
@media (min-width: 600px) and (min-height: 900px) {
  .keypad-button { height: 80px; font-size: 36px; }
}
@media (max-width: 560px) and (max-height: 740px) {
  body:has(.test-page) .topbar { padding: 4px 12px; }
  body:has(.test-page) .lang-switch select { min-height: 44px; }
  .test-page { row-gap: 4px; padding: 8px 12px !important; margin: 4px 8px; }
  .test-page #condText { min-height: 44px; }
  .test-page .audiocontrol { min-height: 48px; }
  .test-page #playTrial { min-height: 48px; padding: 8px 16px !important; }
  .test-page .keypad-button { height: 56px; }
  .test-page .display.center { min-height: 56px; }
}
