/* ============================================================================
 * Audiology at Home — styles.css
 * ==========================================================================*/
:root {
  --bg: #0a0f1c;
  --bg-2: #0e1626;
  --panel: #111c30;
  --panel-2: #16243b;
  --line: rgba(148, 163, 184, 0.16);
  --line-strong: rgba(148, 163, 184, 0.32);
  --text: #e8eefb;
  --muted: #93a4c0;
  --muted-2: #6b7a96;
  --accent: #2dd4bf;
  --accent-2: #38bdf8;
  --accent-ink: #042f2a;
  --right: #ef4444;
  --left: #3b82f6;
  --warn: #fbbf24;
  --good: #36d399;
  --danger: #f87171;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --maxw: 1100px;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: radial-gradient(1200px 700px at 80% -10%, #16263f 0%, transparent 60%),
              radial-gradient(900px 600px at -10% 10%, #102033 0%, transparent 55%),
              var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .4em; }

/* ---- header ------------------------------------------------------------- */
#app-header {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px clamp(14px, 4vw, 36px);
  background: rgba(10, 15, 28, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.hd-left, .hd-right { display: flex; align-items: center; gap: 10px; }
.hd-title { display: flex; flex-direction: column; line-height: 1.05; }
.hd-app { font-weight: 800; letter-spacing: .2px; font-size: 15px; }
.hd-sub { font-size: 12px; color: var(--muted); }
.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px;
  border-radius: 10px; border: 1px solid var(--line); background: var(--panel);
  color: var(--text); cursor: pointer; transition: .15s;
}
.icon-btn:hover { border-color: var(--line-strong); background: var(--panel-2); }
.ic svg { width: 18px; height: 18px; display: block; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--panel);
  color: var(--text); font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.chip .ic svg { width: 15px; height: 15px; }
.chip-ok { border-color: rgba(54, 211, 153, .4); color: #aef0d2; }
.chip-warn { border-color: rgba(251, 191, 36, .4); color: #fde29a; }

/* ---- layout ------------------------------------------------------------- */
#app-main { max-width: var(--maxw); margin: 0 auto; padding: clamp(18px, 4vw, 40px) clamp(14px, 4vw, 36px) 80px; }
.page-head { margin-bottom: 22px; }
.page-title { font-size: clamp(24px, 4vw, 34px); font-weight: 800; }
.page-sub { color: var(--muted); font-size: 15.5px; max-width: 70ch; margin: 0; }
.page-body { display: flex; flex-direction: column; gap: 18px; }
.row { display: flex; flex-wrap: wrap; align-items: center; }
.row.gap { gap: 12px; }
.row.center { justify-content: center; }
.center { text-align: center; }

/* ---- cards -------------------------------------------------------------- */
.card {
  background: linear-gradient(180deg, var(--panel) 0%, var(--bg-2) 100%);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(16px, 3vw, 24px); box-shadow: var(--shadow);
}
.card h3 { font-size: 18px; }
.card h4 { font-size: 15px; color: var(--text); margin-bottom: 8px; }
.muted { color: var(--muted); }
.tiny { font-size: 12.5px; }
.field { margin-bottom: 16px; }
.field > label { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 7px; text-transform: uppercase; letter-spacing: .4px; }

/* ---- buttons ------------------------------------------------------------ */
.btn {
  appearance: none; border: 1px solid var(--line-strong); background: var(--panel-2);
  color: var(--text); font: inherit; font-weight: 650; padding: 11px 18px;
  border-radius: 12px; cursor: pointer; transition: .15s; line-height: 1;
}
.btn:hover { transform: translateY(-1px); border-color: var(--accent); }
.btn:active { transform: translateY(0); }
.btn.primary { background: linear-gradient(180deg, var(--accent) 0%, #14b8a6 100%); color: var(--accent-ink); border-color: transparent; font-weight: 750; }
.btn.primary:hover { box-shadow: 0 10px 26px rgba(45, 212, 191, .35); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); border-color: rgba(248, 113, 113, .4); }
.btn.danger:hover { border-color: var(--danger); }
.btn.big { padding: 15px 26px; font-size: 16px; border-radius: 14px; }

/* ---- hero --------------------------------------------------------------- */
.hero {
  display: grid; grid-template-columns: 1.1fr .9fr; gap: 28px; align-items: center;
  padding: clamp(20px, 4vw, 36px);
  background: linear-gradient(135deg, rgba(45, 212, 191, .08), rgba(56, 189, 248, .05));
  border: 1px solid var(--line); border-radius: 22px; margin-bottom: 22px;
}
.hero-text h1 { font-size: clamp(28px, 5vw, 44px); font-weight: 850; letter-spacing: -.5px; }
.hero-text h1 .accent { background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-text p { color: var(--muted); font-size: 16px; max-width: 56ch; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 20px 0 14px; }
.hero-status { display: flex; gap: 10px; flex-wrap: wrap; }
.status-chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.status-chip.clickable { cursor: pointer; color: var(--text); }
.status-chip.clickable:hover { border-color: var(--accent); }
.hero-art { display: grid; place-items: center; }
.hero-audiogram { width: 100%; max-width: 420px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 16px; padding: 8px; }

/* ---- mode grid ---------------------------------------------------------- */
.mode-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.mode-card {
  display: flex; gap: 14px; align-items: flex-start; text-align: left;
  padding: 18px; border-radius: var(--radius); border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel), var(--bg-2)); color: var(--text);
  cursor: pointer; transition: .18s; position: relative; overflow: hidden;
}
.mode-card:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: 0 16px 40px rgba(0,0,0,.4); }
.mode-icon { font-size: 30px; line-height: 1; flex-shrink: 0; filter: drop-shadow(0 4px 8px rgba(0,0,0,.4)); }
.mode-body { flex: 1; min-width: 0; }
.mode-tag { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--accent); font-weight: 700; }
.mode-title { font-size: 16.5px; font-weight: 750; margin: 2px 0 5px; }
.mode-desc { font-size: 13px; color: var(--muted); }
.mode-arrow { color: var(--muted-2); font-size: 20px; align-self: center; transition: .18s; }
.mode-card:hover .mode-arrow { color: var(--accent); transform: translateX(3px); }

/* ---- disclaimer --------------------------------------------------------- */
.disclaimer-banner { font-size: 13px; color: var(--muted); background: rgba(251, 191, 36, .06); border: 1px solid rgba(251, 191, 36, .22); border-radius: 12px; padding: 14px 16px; }
.disclaimer-banner strong { color: #fde29a; }
.notice { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--muted); background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.notice .ic { color: var(--accent); flex-shrink: 0; margin-top: 1px; }
.notice.ok { border-color: rgba(54,211,153,.3); }
.notice.warn { border-color: rgba(251,191,36,.3); }

/* ---- segmented / select / slider / switch ------------------------------- */
.seg { display: inline-flex; background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 4px; gap: 4px; flex-wrap: wrap; }
.seg-btn { border: none; background: transparent; color: var(--muted); padding: 9px 16px; border-radius: 9px; cursor: pointer; font: inherit; font-weight: 600; font-size: 14px; display: flex; flex-direction: column; align-items: center; line-height: 1.15; transition: .12s; }
.seg-btn small { font-weight: 500; font-size: 11px; opacity: .8; }
.seg-btn.active { background: var(--accent); color: var(--accent-ink); }
.sel { width: 100%; background: var(--bg-2); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; font: inherit; font-size: 15px; }
.slider { -webkit-appearance: none; appearance: none; width: 100%; height: 8px; border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); outline: none; margin: 10px 0 4px; }
.slider::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; border-radius: 50%; background: #fff; border: 3px solid var(--accent); cursor: pointer; box-shadow: 0 3px 10px rgba(0,0,0,.4); }
.slider::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 3px solid var(--accent); cursor: pointer; }
.level-val { font-size: 20px; font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; }
.level-val.over { color: var(--warn); }
.level-marks { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted-2); }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; margin: 6px 0; }
.switch input { display: none; }
.switch-track { width: 44px; height: 25px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--line); position: relative; transition: .15s; }
.switch-thumb { position: absolute; top: 2px; left: 2px; width: 19px; height: 19px; border-radius: 50%; background: var(--muted); transition: .15s; }
.switch input:checked + .switch-track { background: var(--accent); border-color: transparent; }
.switch input:checked + .switch-track .switch-thumb { left: 21px; background: #fff; }
.num { width: 90px; background: var(--bg-2); color: var(--text); border: 1px solid var(--line); border-radius: 9px; padding: 9px 10px; font: inherit; font-size: 15px; }

/* ---- onboarding --------------------------------------------------------- */
.onboard { min-height: 70vh; display: grid; place-items: center; }
.onboard-card { width: min(560px, 94vw); }
.onboard-inner { background: linear-gradient(180deg, var(--panel), var(--bg-2)); border: 1px solid var(--line); border-radius: 22px; padding: clamp(24px, 5vw, 40px); text-align: center; box-shadow: var(--shadow); }
.ob-emoji { font-size: 54px; margin-bottom: 8px; }
.onboard-inner h2 { font-size: 24px; }
.ob-lead { color: var(--muted); font-size: 15.5px; }
.ob-list { text-align: left; color: var(--muted); font-size: 14.5px; margin: 16px auto; max-width: 44ch; display: grid; gap: 9px; }
.ob-list li b, .ob-lead b { color: var(--text); }
.ob-lr { display: flex; gap: 14px; justify-content: center; margin: 18px 0; flex-wrap: wrap; }
.ob-hint { font-size: 13.5px; color: var(--muted); }
.ob-actions { display: flex; gap: 12px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }

/* ---- setup / calibration ------------------------------------------------ */
.cal-status { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cal-pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; font-weight: 700; font-size: 13.5px; border: 1px solid var(--line); }
.cal-pill.ok { color: #aef0d2; border-color: rgba(54,211,153,.4); background: rgba(54,211,153,.08); }
.cal-pill.warn { color: #fde29a; border-color: rgba(251,191,36,.4); background: rgba(251,191,36,.07); }
.cal-saved { font-size: 12px; color: var(--muted-2); }
.cal-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.cal-cols > div { display: flex; flex-direction: column; gap: 18px; }
.cal-sec h3 { display: flex; align-items: center; gap: 8px; }
.best { font-size: 11px; background: var(--accent); color: var(--accent-ink); padding: 2px 8px; border-radius: 999px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; }
.cal-grid { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: end; margin: 14px 0; }
.cal-grid label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.cal-play { display: grid; place-items: center; }
.range-info { background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 10px 0; }
.range-row { display: flex; justify-content: space-between; padding: 4px 0; font-size: 14px; border-bottom: 1px solid var(--line); }
.range-row:last-child { border-bottom: none; }
.about-cal { font-size: 13.5px; color: var(--muted); background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; }
.about-cal h4 { color: var(--text); }

/* ---- quiet meter -------------------------------------------------------- */
.meter-wrap { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.meter-track { flex: 1; height: 26px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.meter-fill { height: 100%; width: 0; border-radius: 999px; transition: width .12s linear, background .2s; }
.meter-fill.good { background: var(--good); }
.meter-fill.ok { background: var(--warn); }
.meter-fill.bad { background: var(--danger); }
.meter-val { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--muted); min-width: 110px; text-align: right; }
.quiet-verdict { font-size: 15px; margin-bottom: 16px; min-height: 24px; }
.lead { font-size: 15.5px; color: var(--muted); }

/* ---- run (auto test) ---------------------------------------------------- */
.run-layout { display: grid; grid-template-columns: 1fr 380px; gap: 22px; align-items: start; }
.run-left { display: flex; flex-direction: column; align-items: center; gap: 14px; background: linear-gradient(180deg, var(--panel), var(--bg-2)); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.run-meta { text-align: center; }
.run-ear { font-size: 13px; font-weight: 800; letter-spacing: 1.5px; }
.run-freq { font-size: 30px; font-weight: 800; }
.hear-btn { position: relative; width: 220px; height: 220px; border-radius: 50%; border: none; cursor: pointer; background: radial-gradient(circle at 50% 40%, var(--panel-2), var(--bg)); color: var(--text); font-weight: 800; font-size: 19px; letter-spacing: .5px; box-shadow: inset 0 0 0 2px var(--line-strong), 0 18px 40px rgba(0,0,0,.45); transition: .12s; }
.hear-btn:hover { box-shadow: inset 0 0 0 2px var(--accent), 0 18px 40px rgba(0,0,0,.45); }
.hear-btn.pressed { transform: scale(.96); background: radial-gradient(circle at 50% 40%, var(--accent), #0f766e); color: var(--accent-ink); }
.hear-ring { position: absolute; inset: 14px; border-radius: 50%; border: 2px solid transparent; }
.hear-btn.armed .hear-ring { border-color: var(--accent); animation: pulse 1.1s ease-out infinite; }
@keyframes pulse { 0% { transform: scale(.9); opacity: .9; } 100% { transform: scale(1.12); opacity: 0; } }
.hear-label { position: relative; z-index: 1; }
.run-hint { color: var(--muted); font-size: 14px; text-align: center; }
.run-progress { width: 100%; max-width: 320px; }
.prog-track, .prog-fill, .step-meter { }
.prog-track { height: 8px; background: var(--bg-2); border-radius: 999px; overflow: hidden; border: 1px solid var(--line); }
.prog-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .3s; }
.prog-label { text-align: center; font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.run-right { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.run-right h4 { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .5px; }
.mini-audiogram, .audiogram-host { width: 100%; }
.audiogram-svg { width: 100%; height: auto; display: block; font-family: inherit; }

/* ---- custom test -------------------------------------------------------- */
.custom-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.fine-step { display: flex; gap: 10px; justify-content: center; margin: 8px 0; }
.play-big { width: 100%; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 18px; border-radius: 14px; border: 1px solid var(--line-strong); background: var(--panel-2); color: var(--text); font: inherit; font-weight: 750; font-size: 17px; cursor: pointer; transition: .15s; margin: 8px 0 14px; }
.play-big:hover { border-color: var(--accent); }
.play-big.on { background: linear-gradient(180deg, var(--accent), #14b8a6); color: var(--accent-ink); }
.pb-ic { font-size: 22px; }
.heard-row { display: flex; gap: 12px; flex-wrap: wrap; }
.heard-row .btn { flex: 1; }
.recorded-list { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; min-height: 40px; }
.rec-ear { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.rec-ear-label { font-weight: 700; font-size: 13px; }
.rec-chip { font-size: 12px; padding: 4px 9px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--line); color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---- masking ------------------------------------------------------------ */
.mask-grid, .tin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.btn.on, .play-big.on { box-shadow: 0 0 0 2px var(--accent); }

/* ---- subtest grid ------------------------------------------------------- */
.subtest-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.subtest-card { text-align: left; padding: 20px; border-radius: var(--radius); border: 1px solid var(--line); background: linear-gradient(180deg, var(--panel), var(--bg-2)); color: var(--text); cursor: pointer; transition: .18s; }
.subtest-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.st-icon { font-size: 28px; margin-bottom: 8px; }
.st-title { font-weight: 750; font-size: 16px; margin-bottom: 5px; }
.st-desc { font-size: 13px; color: var(--muted); }

/* ---- speech ------------------------------------------------------------- */
.speech-prompt { color: var(--muted); margin-bottom: 14px; font-size: 15px; }
.speech-input { width: 100%; font-size: 22px; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--bg-2); color: var(--text); margin: 14px 0; text-align: center; }
.speech-input:focus { outline: none; border-color: var(--accent); }
.speech-feedback { min-height: 24px; font-size: 15px; font-weight: 600; margin-bottom: 12px; }
.speech-feedback.good { color: var(--good); }
.speech-feedback.bad { color: var(--danger); }
.wrs-counter, .din-snr, .snr-badge { font-size: 13px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.step-meter { display: flex; align-items: center; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.step-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--bg-2); border: 1px solid var(--line); }
.step-dot.done { background: var(--accent); opacity: .5; }
.step-dot.cur { background: var(--accent); box-shadow: 0 0 0 4px rgba(45,212,191,.2); }
.step-cap { font-size: 12px; color: var(--muted); margin-left: 8px; }

/* ---- digits-in-noise ---------------------------------------------------- */
.din-display { font-size: 48px; font-weight: 800; text-align: center; letter-spacing: 10px; margin: 10px 0 18px; font-variant-numeric: tabular-nums; color: var(--accent); }
.din-pads { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-top: 14px; }
.din-key { padding: 18px 0; font-size: 22px; font-weight: 700; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--panel-2); color: var(--text); cursor: pointer; transition: .12s; }
.din-key:hover { border-color: var(--accent); background: var(--panel); }
.din-key.wide { grid-column: span 5; }
.din-key.clear { color: var(--danger); }

/* ---- results ------------------------------------------------------------ */
.results-top { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.results-meta { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; font-size: 13px; color: var(--muted); }
.rm-date { font-weight: 700; color: var(--text); }
.rm-cal { padding: 3px 9px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--line); }
.rating { display: flex; align-items: center; gap: 14px; }
.gauge { width: 76px; height: 76px; }
.gauge-num { fill: var(--text); font-size: 26px; font-weight: 800; }
.rating-grade { font-size: 18px; font-weight: 800; }
.rating-cap { font-size: 12px; color: var(--muted); }
.audiogram-card { padding: 18px; }
.ag-toggles { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; justify-content: center; }
.toggle-chip { font-size: 12.5px; padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg-2); color: var(--muted); cursor: pointer; font-weight: 600; }
.toggle-chip.on { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.ear-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.ear-card { background: linear-gradient(180deg, var(--panel), var(--bg-2)); border: 1px solid var(--line); border-left: 3px solid var(--ear, var(--line)); border-radius: var(--radius); padding: 20px; }
.ear-card.empty { opacity: .6; }
.ear-head { display: flex; align-items: center; gap: 9px; }
.ear-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--ear); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ear) 25%, transparent); }
.ear-degree { font-size: 20px; margin: 4px 0 12px; }
.ear-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.stat { background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px; text-align: center; }
.stat-val { font-size: 15px; font-weight: 750; }
.stat-label { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; margin-top: 2px; }
.ear-blurb { font-size: 13.5px; color: var(--muted); }
.speech-est { background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-top: 10px; }
.se-head { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 700; }
.se-score { font-size: 22px; font-weight: 800; color: var(--accent); }
.se-est p, .speech-est p { font-size: 13px; color: var(--muted); margin: 4px 0 0; }
.summary-card p { color: var(--muted); font-size: 14.5px; }
.recs-card ul { color: var(--muted); font-size: 14px; padding-left: 18px; margin: 0; display: grid; gap: 7px; }
.recs-card li b { color: var(--text); }
.results-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.history { display: flex; flex-direction: column; gap: 6px; }
.hist-row { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-2); color: var(--text); cursor: pointer; text-align: left; }
.hist-row.active { border-color: var(--accent); }
.hist-row:hover { border-color: var(--line-strong); }
.hist-date { font-size: 13px; }
.hist-score { font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; }
.hist-deg { font-size: 12px; color: var(--muted); }
.big-result { text-align: center; margin: 8px 0 16px; }
.br-num { font-size: 46px; font-weight: 850; color: var(--accent); line-height: 1; }
.br-cap { font-size: 13.5px; color: var(--muted); margin-top: 6px; }
.score-band { background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.score-band b { display: block; font-size: 16px; margin-bottom: 4px; }
.score-band span { font-size: 13.5px; color: var(--muted); }
.result-card { max-width: 620px; margin: 0 auto; }
.empty-card { text-align: center; max-width: 520px; margin: 0 auto; }
.empty-emoji { font-size: 50px; }
.center-card { text-align: center; max-width: 480px; margin: 0 auto; }
.range-freq { font-size: 40px; font-weight: 850; color: var(--accent); margin: 6px 0 16px; }
.gap-status { color: var(--muted); margin-bottom: 14px; }
.sin-log { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
.sin-row { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 12px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line); }
.sin-snr { font-size: 10px; color: var(--muted); text-transform: uppercase; }
.sin-score { font-weight: 800; }
.sin-score.good { color: var(--good); } .sin-score.bad { color: var(--danger); }
.ucl-out, .tinnitus-result { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.ucl-row { display: flex; justify-content: space-between; padding: 8px 12px; background: var(--bg-2); border-radius: 10px; border: 1px solid var(--line); }

/* ---- accordion (learn) -------------------------------------------------- */
.accordion { display: flex; flex-direction: column; gap: 10px; }
.acc-item { background: linear-gradient(180deg, var(--panel), var(--bg-2)); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.acc-item summary { cursor: pointer; padding: 16px 20px; font-weight: 700; font-size: 15.5px; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.acc-item summary::-webkit-details-marker { display: none; }
.acc-item summary::after { content: '+'; color: var(--accent); font-size: 22px; font-weight: 400; }
.acc-item[open] summary::after { content: '−'; }
.acc-body { padding: 0 20px 18px; color: var(--muted); font-size: 14.5px; }
.acc-body b { color: var(--text); }

/* ---- footer ------------------------------------------------------------- */
.app-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted-2); }
.foot-links { display: flex; gap: 16px; }
.foot-links a { color: var(--muted); }

/* ---- toast -------------------------------------------------------------- */
#toast-host { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--panel-2); border: 1px solid var(--line-strong); color: var(--text); padding: 12px 18px; border-radius: 12px; font-size: 14px; box-shadow: var(--shadow); opacity: 0; transform: translateY(12px); transition: .25s; max-width: 90vw; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.ok { border-color: rgba(54,211,153,.5); }
.toast.warn { border-color: rgba(251,191,36,.5); }

/* ---- responsive --------------------------------------------------------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .hero-art { order: -1; }
  .cal-cols, .ear-cards, .results-cols, .custom-grid, .mask-grid, .tin-grid { grid-template-columns: 1fr; }
  .run-layout { grid-template-columns: 1fr; }
  .run-right { order: -1; }
}
@media (max-width: 520px) {
  .cal-grid { grid-template-columns: 1fr; }
  .ear-stats { grid-template-columns: 1fr; }
  .din-display { font-size: 38px; letter-spacing: 6px; }
  .hear-btn { width: 180px; height: 180px; }
}
@media (max-width: 480px) {
  #app-header { padding-left: 12px; padding-right: 12px; gap: 8px; }
  .hd-left, .hd-right { gap: 7px; }
  .hd-app { font-size: 14px; }
  .hd-sub { display: none; }
  .chip span { display: none; }      /* icon-only calibration status to save room */
  .chip { padding: 8px 9px; }
}

/* ---- print -------------------------------------------------------------- */
@media print {
  body { background: #fff; color: #000; }
  #app-header, .ag-toggles, .btn, .hero-actions, .results-cols, .toggle-chip, #toast-host { display: none !important; }
  .card, .ear-card { box-shadow: none; border-color: #ccc; background: #fff; break-inside: avoid; }
  .audiogram-svg { filter: invert(0); }
  .accent, .br-num, .se-score { color: #000 !important; }
}
