/* JHC Hearing Screener */
.jhchs-app {
	--jhchs-brand: #027727;
	--jhchs-ink: #1d2a24;
	--jhchs-muted: #5b6762;
	--jhchs-line: #dfe5e2;
	--jhchs-soft: #f3f7f5;
	--jhchs-warn: #9a5b00;
	--jhchs-bad: #b2412e;
	max-width: 760px;
	margin: 0 auto;
	color: var(--jhchs-ink);
	font-size: 18px;
	line-height: 1.55;
	scroll-margin-top: 100px;
}
.jhchs-app *, .jhchs-app *::before, .jhchs-app *::after { box-sizing: border-box; }

.jhchs-card {
	background: #fff;
	border: 1px solid var(--jhchs-line);
	border-radius: 18px;
	box-shadow: 0 10px 30px rgba(16, 40, 28, .08);
	overflow: hidden;
}
.jhchs-progress { height: 6px; background: var(--jhchs-soft); }
.jhchs-progress span { display: block; height: 100%; background: var(--jhchs-brand); transition: width .4s ease; }
.jhchs-body { padding: clamp(22px, 5vw, 44px); outline: none; }

.jhchs-app h2 { font-size: clamp(26px, 4.4vw, 34px); line-height: 1.2; margin: 0 0 14px; color: var(--jhchs-ink); }
.jhchs-app h3 { font-size: 20px; margin: 0 0 10px; }
.jhchs-app p { margin: 0 0 16px; }
.jhchs-eyebrow { font-size: 14px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--jhchs-brand); margin-bottom: 8px; }
.jhchs-lead { font-size: 19px; color: var(--jhchs-ink); }
.jhchs-fine { font-size: 14px; color: var(--jhchs-muted); margin-top: 18px !important; }
.jhchs-hint { font-size: 14px; color: var(--jhchs-muted); margin: -6px 0 14px !important; }

.jhchs-checklist, .jhchs-steps { margin: 0 0 24px; padding: 0; list-style: none; }
.jhchs-checklist li, .jhchs-steps li { position: relative; padding: 10px 0 10px 40px; border-bottom: 1px solid var(--jhchs-line); }
.jhchs-checklist li:last-child, .jhchs-steps li:last-child { border-bottom: 0; }
.jhchs-checklist li::before { content: "\2713"; position: absolute; left: 4px; top: 9px; width: 26px; height: 26px; border-radius: 50%; background: var(--jhchs-soft); color: var(--jhchs-brand); font-weight: 700; text-align: center; line-height: 26px; font-size: 15px; }
.jhchs-steps { counter-reset: s; }
.jhchs-steps li::before { counter-increment: s; content: counter(s); position: absolute; left: 4px; top: 9px; width: 26px; height: 26px; border-radius: 50%; background: var(--jhchs-brand); color: #fff; font-weight: 700; text-align: center; line-height: 26px; font-size: 15px; }

/* Buttons */
.jhchs-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 56px; padding: 12px 26px; border-radius: 12px;
	font: inherit; font-size: 18px; font-weight: 700; line-height: 1.2; text-decoration: none !important;
	border: 2px solid var(--jhchs-brand); cursor: pointer;
	transition: transform .08s ease, background .2s ease, opacity .2s ease;
}
.jhchs-btn:active { transform: translateY(1px); }
.jhchs-btn:disabled { opacity: .45; cursor: not-allowed; }
.jhchs-btn:focus-visible, .jhchs-link:focus-visible, .jhchs-app input:focus-visible { outline: 3px solid rgba(2, 119, 39, .35); outline-offset: 2px; }
.jhchs-btn-primary { background: var(--jhchs-brand); color: #fff !important; }
.jhchs-btn-primary:hover:not(:disabled) { filter: brightness(1.08); }
.jhchs-btn-outline { background: #fff; color: var(--jhchs-brand) !important; }
.jhchs-btn-outline:hover:not(:disabled) { background: var(--jhchs-soft); }
.jhchs-btn-choice { background: #fff; color: var(--jhchs-ink); border-color: var(--jhchs-line); font-weight: 600; }
.jhchs-btn-choice[aria-pressed="true"] { border-color: var(--jhchs-brand); background: var(--jhchs-soft); color: var(--jhchs-brand); }
.jhchs-body > .jhchs-btn-primary, .jhchs-form > .jhchs-btn-primary { width: 100%; margin-top: 8px; }
.jhchs-play { width: 100%; margin-bottom: 18px; }
.jhchs-link { background: none; border: 0; padding: 8px 4px; color: var(--jhchs-brand); font: inherit; font-size: 16px; font-weight: 600; text-decoration: underline; cursor: pointer; }
.jhchs-form .jhchs-link { display: block; margin: 10px auto 0; }

.jhchs-note { background: #fff8e8; border-left: 4px solid #e2a400; border-radius: 8px; padding: 12px 16px; font-size: 16px; margin: 0 0 20px; }
.jhchs-msg:empty { display: none; }
.jhchs-msg-warn { background: #fff4ef; border-left: 4px solid var(--jhchs-bad); border-radius: 8px; padding: 12px 16px; font-size: 16px; margin: 0 0 16px; }

.jhchs-choices { display: grid; gap: 10px; margin-bottom: 16px; }
@media (min-width: 560px) { .jhchs-choices { grid-template-columns: repeat(3, 1fr); } }

/* Listening */
.jhchs-listen { display: flex; flex-direction: column; align-items: center; padding: 26px 0 22px; text-align: center; }
.jhchs-ear-badge {
	width: 96px; height: 96px; border-radius: 50%;
	background: var(--jhchs-soft); color: var(--jhchs-brand);
	display: flex; align-items: center; justify-content: center;
	font-size: 40px; font-weight: 800; margin-bottom: 16px;
	box-shadow: 0 0 0 0 rgba(2, 119, 39, .25);
}
.jhchs-listen.is-listening .jhchs-ear-badge { animation: jhchs-pulse 2s ease-in-out infinite; }
@keyframes jhchs-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(2, 119, 39, .2); } 50% { box-shadow: 0 0 0 16px rgba(2, 119, 39, 0); } }
@media (prefers-reduced-motion: reduce) { .jhchs-listen.is-listening .jhchs-ear-badge { animation: none; } }
.jhchs-status { font-size: 22px; font-weight: 700; margin: 0 !important; min-height: 1.5em; }
.jhchs-answer { display: grid; gap: 12px; }
@media (min-width: 560px) { .jhchs-answer { grid-template-columns: 1fr 1fr; } }

/* Questions */
.jhchs-q { border: 0; padding: 0; margin: 0 0 18px; }
.jhchs-q legend { font-weight: 600; margin-bottom: 8px; padding: 0; }
.jhchs-yn { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* Form */
.jhchs-row { display: grid; gap: 14px; }
@media (min-width: 560px) { .jhchs-row { grid-template-columns: 1fr 1fr; } }
.jhchs-field { display: block; margin: 0 0 14px; border: 0; padding: 0; }
.jhchs-field > span, .jhchs-field legend { display: block; font-size: 15px; font-weight: 700; margin-bottom: 6px; padding: 0; }
.jhchs-field input {
	width: 100%; min-height: 54px; padding: 12px 14px; font: inherit; font-size: 18px;
	border: 2px solid var(--jhchs-line); border-radius: 10px; background: #fff; color: var(--jhchs-ink);
}
.jhchs-field input:focus { border-color: var(--jhchs-brand); outline: none; }
.jhchs-loc-pick { display: grid; gap: 10px; }
@media (min-width: 560px) { .jhchs-loc-pick { grid-template-columns: 1fr 1fr; } }
.jhchs-radio { display: flex; gap: 10px; align-items: flex-start; padding: 14px; border: 2px solid var(--jhchs-line); border-radius: 12px; cursor: pointer; }
.jhchs-radio:has(input:checked) { border-color: var(--jhchs-brand); background: var(--jhchs-soft); }
.jhchs-radio input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--jhchs-brand); }
.jhchs-radio small { display: block; color: var(--jhchs-muted); font-size: 14px; }
.jhchs-consent { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--jhchs-muted); margin: 6px 0 16px; }
.jhchs-consent input { width: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: var(--jhchs-brand); }
.jhchs-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* Results */
.jhchs-results--mild .jhchs-eyebrow { color: var(--jhchs-warn); }
.jhchs-results--check .jhchs-eyebrow { color: var(--jhchs-bad); }
.jhchs-notes { margin: 0 0 20px; padding: 14px 18px 14px 36px; background: var(--jhchs-soft); border-radius: 12px; font-size: 16px; }
.jhchs-notes li { margin: 4px 0; }
.jhchs-code {
	text-align: center; border: 2px dashed var(--jhchs-brand); border-radius: 16px;
	padding: 22px 16px; margin: 6px 0 20px; background: #fff;
}
.jhchs-code span { display: block; font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--jhchs-muted); }
.jhchs-code strong { display: block; font-size: clamp(30px, 7vw, 42px); letter-spacing: .08em; color: var(--jhchs-brand); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; margin: 6px 0; }
.jhchs-code small { display: block; font-size: 15px; color: var(--jhchs-muted); }
.jhchs-code--none { border-color: var(--jhchs-line); }
.jhchs-closing { font-weight: 600; }

.jhchs-locs { display: grid; gap: 14px; margin-bottom: 22px; }
@media (min-width: 620px) { .jhchs-locs { grid-template-columns: 1fr 1fr; } }
.jhchs-loc { border: 1px solid var(--jhchs-line); border-radius: 14px; padding: 18px; }
.jhchs-loc.is-pref { border: 2px solid var(--jhchs-brand); }
.jhchs-loc h4 { margin: 0 0 4px; font-size: 19px; }
.jhchs-loc h4 span { font-size: 12px; font-weight: 700; text-transform: uppercase; background: var(--jhchs-brand); color: #fff; padding: 2px 8px; border-radius: 99px; vertical-align: middle; margin-left: 4px; }
.jhchs-loc p { font-size: 15px; color: var(--jhchs-muted); margin: 0 0 12px; }
.jhchs-loc-actions { display: grid; gap: 8px; }
.jhchs-loc-actions .jhchs-btn { width: 100%; font-size: 16px; min-height: 50px; padding: 10px 14px; }
.jhchs-print-only { display: none; }

.jhchs-detail { border-top: 1px solid var(--jhchs-line); padding-top: 14px; margin-bottom: 8px; }
.jhchs-detail summary { cursor: pointer; font-weight: 700; color: var(--jhchs-brand); font-size: 16px; }
.jhchs-ears { display: grid; gap: 16px; margin-top: 10px; }
@media (min-width: 620px) { .jhchs-ears { grid-template-columns: 1fr 1fr; } }
.jhchs-ear { background: var(--jhchs-soft); border-radius: 12px; padding: 14px 16px; }
.jhchs-ear ul { list-style: none; margin: 0; padding: 0; }
.jhchs-ear li { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "f w" "m m"; gap: 4px 8px; padding: 8px 0; border-bottom: 1px solid var(--jhchs-line); font-size: 15px; }
.jhchs-ear li:last-child { border-bottom: 0; }
.jhchs-f { grid-area: f; font-weight: 600; }
.jhchs-f small { color: var(--jhchs-muted); font-weight: 400; }
.jhchs-w { grid-area: w; font-weight: 700; }
.jhchs-meter { grid-area: m; display: grid; grid-template-columns: repeat(6, 1fr); gap: 3px; }
.jhchs-meter i { height: 8px; border-radius: 3px; background: #d6ddda; }
.jhchs-t-good .jhchs-meter i.on { background: var(--jhchs-brand); }
.jhchs-t-good .jhchs-w { color: var(--jhchs-brand); }
.jhchs-t-fair .jhchs-meter i.on { background: #d99a00; }
.jhchs-t-fair .jhchs-w { color: var(--jhchs-warn); }
.jhchs-t-poor .jhchs-meter i.on { background: var(--jhchs-bad); }
.jhchs-t-poor .jhchs-w { color: var(--jhchs-bad); }
.jhchs-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 10px; }

/* Print just the results */
@media print {
	body.jhchs-printing * { visibility: hidden; }
	body.jhchs-printing .jhchs-app, body.jhchs-printing .jhchs-app * { visibility: visible; }
	body.jhchs-printing .jhchs-app { position: absolute; left: 0; top: 0; width: 100%; max-width: none; }
	body.jhchs-printing .jhchs-card { box-shadow: none; border: 0; }
	body.jhchs-printing .jhchs-progress, body.jhchs-printing .jhchs-noprint { display: none !important; }
	body.jhchs-printing .jhchs-print-only { display: block; }
}
