.audio-test-page {
    --spk-ink: #fbf6f4;
    --spk-muted: #cbbab8;
    --spk-accent: #adf1d9;
    --spk-warm: #f5ba9e;
    --spk-line: #544146;
    --spk-surface: #2a2024;
    --spk-base: #21191d;
    width: min(1296px, calc(100% - 48px));
    margin-inline: auto;
    padding-bottom: clamp(24px, 5vw, 56px);
    color: var(--spk-ink);
    color-scheme: dark;
}
.audio-test-page :is(h1, h2, h3, p) { margin: 0; }
.audio-test-page .audio-test-crumb { margin-bottom: 16px; }
.audio-test-link { display: inline-flex; align-items: center; gap: 7px; color: var(--spk-accent); font-size: .85rem; font-weight: 710; text-decoration: none; }
.audio-test-link:hover { color: #d1f8e9; text-decoration: underline; text-underline-offset: 3px; }
.audio-test-link i { font-size: .84em; }
.audio-test-intro { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 9px 16px; margin-bottom: 16px; }
.audio-test-intro h1 { font-size: clamp(2.18rem, 4.55vw, 4.25rem); line-height: 1.04; letter-spacing: -.061em; font-weight: 800; }
.audio-test-intro p { margin-top: 7px; color: var(--spk-muted); font-size: clamp(.9rem, 1.5vw, 1.05rem); line-height: 1.53; }
.audio-test-intro > a { margin-bottom: 3px; }
.audio-test-page :is(button, select, input, a, summary, [tabindex]):focus-visible { outline: 2px solid var(--spk-accent); outline-offset: 2px; }

.spk-lab { overflow: clip; border: 1px solid #6d5354; border-radius: 20px; background: radial-gradient(ellipse at 8% 0, #3b292e, transparent 64%), var(--spk-base); }
.spk-lab [hidden] { display: none !important; }
.spk-toolbar {
    position: relative; z-index: 4; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
    gap: 8px 15px; padding: 10px clamp(11px, 2.1vw, 24px); border-bottom: 1px solid var(--spk-line); background: #392a2e;
}
.spk-toolbar-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.spk-toolbar-icon { display: grid; place-items: center; flex: 0 0 39px; width: 39px; aspect-ratio: 1; border: 1px solid #886765; border-radius: 11px; background: #553d3e; color: #ffd5c4; }
.spk-toolbar h2 { font-size: .99rem; font-weight: 780; line-height: 1.2; }
.spk-toolbar .spk-status { display: flex; align-items: center; gap: 6px; margin-top: 3px; color: #e1cbc9; font-size: .73rem; }
.spk-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #b69a97; }
.spk-status:is([data-state="ready"], [data-state="playing"], [data-state="finished"])::before { background: var(--spk-accent); box-shadow: 0 0 0 3px #a9f1db28; }
.spk-status:is([data-state="loading"], [data-state="error"], [data-state="unsupported"])::before { background: #f1c593; }
.spk-actions, .spk-result-actions, .spk-settings-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.spk-control, .spk-tab, .spk-channel, .spk-phase-card {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 41px;
    padding: 7px 11px; border: 1px solid #70575c; border-radius: 8px; color: var(--spk-ink); background: #433338;
    font-size: .81rem; font-weight: 715; line-height: 1.18; text-align: center; touch-action: manipulation;
}
.spk-lab button:disabled { opacity: .54; cursor: default; }
.spk-lab :is(.spk-control, .spk-tab, .spk-channel, .spk-phase-card):not(:disabled):hover { background: #554047; border-color: #aa817b; }
.spk-lab .spk-control--primary, .spk-lab .spk-control--primary:not(:disabled):hover { color: #16332a; background: var(--spk-accent); border-color: transparent; }
.spk-lab .spk-control--primary:not(:disabled):hover { background: #cbf7e9; }
.spk-control--finish:not(:disabled), .spk-control[aria-pressed="true"] { background: #344743; border-color: #659a8b; color: #ddfaf0; }
.spk-body { padding: clamp(10px, 1.65vw, 20px) clamp(10px, 2.1vw, 24px); }
.spk-settings { display: grid; grid-template-columns: minmax(0, 1.36fr) auto minmax(0, 1fr); gap: 7px; align-items: end; }
.spk-lab label { display: grid; align-content: start; gap: 4px; min-width: 0; color: #e0cdcd; font-size: .75rem; font-weight: 680; line-height: 1.25; }
.spk-lab select, .spk-range { width: 100%; min-width: 0; min-height: 38px; padding: 6px 8px; border: 1px solid #735b5f; border-radius: 7px; color: var(--spk-ink); background: #3d2f34; font-size: .8rem; font-weight: 510; text-overflow: ellipsis; }
.spk-lab select:disabled, .spk-range:has(input:disabled) { opacity: .65; }
.spk-settings-buttons .spk-control { min-height: 38px; }
.spk-range { display: flex; align-items: center; gap: 7px; }
.spk-range input, .spk-lab input[type="range"] { width: 100%; min-width: 0; accent-color: var(--spk-accent); }
.spk-range output { min-width: 3em; text-align: right; font-variant-numeric: tabular-nums; }
.audio-test-page .spk-note { color: var(--spk-muted); font-size: .8rem; line-height: 1.46; }
.audio-test-page .spk-output-note { margin: 4px 0 10px; }
.audio-test-page .spk-expanded-note, .audio-test-page .spk-error { margin-bottom: 8px; padding: 6px 8px; border-left: 2px solid #a8d4c6; border-radius: 3px; background: #334640; color: #d9ede5; font-size: .78rem; }
.audio-test-page .spk-error { border-left-color: #eab09d; background: #56373b; color: #fce4dc; }
.spk-tabs { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }
.spk-tab { color: #e4d4d5; border-color: #60494f; background: #35282e; }
.spk-tab i { color: #d8aaaa; }
.spk-tab[aria-selected="true"] { color: #fff0e9; border-color: #ba8c7c; background: #563b3d; }
.spk-tab[aria-selected="true"] i { color: var(--spk-warm); }
.spk-main { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(284px, 1fr); align-items: start; gap: 8px; }
.spk-surface, .spk-result { min-width: 0; padding: 12px; border: 1px solid var(--spk-line); border-radius: 11px; background: var(--spk-surface); }
.spk-section-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; }
.spk-section-head h3, .spk-result h3 { font-size: .99rem; font-weight: 770; letter-spacing: -.01em; }
.spk-section-head label { width: min(100%, 150px); }
.spk-section-head select { min-height: 34px; }
.spk-tag { display: inline-block; padding: 4px 7px; border: 1px solid #786061; border-radius: 999px; background: #48363a; color: #f2d6cd; font-size: .71rem; font-weight: 700; line-height: 1.12; }
.spk-tag[data-state="playing"] { border-color: #77aa98; background: #354d45; color: #d4faec; }
.spk-tag[data-state="error"] { border-color: #b98371; background: #593934; color: #ffe5dc; }
.spk-stage {
    --spk-stage-height: clamp(176px, 19vw, 254px);
    display: grid; grid-template-columns: 1fr minmax(0, 1.32fr) 1fr; place-items: center;
    min-height: var(--spk-stage-height); padding: 8px; margin: 8px 0; overflow: hidden;
    border: 1px solid #62494d; border-radius: 9px;
    background: radial-gradient(ellipse at 50% 45%, #4b3035 0%, #302327 49%, transparent 80%), radial-gradient(circle at 1px 1px, #e5b2a335 1px, transparent 0) 0 0 / 20px 20px, #251b20;
}
.spk-stage img { width: auto; height: min(calc(var(--spk-stage-height) - 20px), 247px); max-width: 100%; object-fit: contain; filter: drop-shadow(8px 10px 16px #130c0ccc) drop-shadow(-4px 0 7px #ecae9763); }
.spk-stage-indicator { display: grid; gap: 5px; justify-items: center; color: #c3aaa7; font-size: .75rem; }
.spk-stage-indicator.is-playing { color: var(--spk-accent); }
.spk-stage-indicator > div { display: flex; align-items: center; gap: 3px; height: 32px; }
.spk-stage-indicator i {
    display: block; width: 3px; height: var(--spk-bar, 18px); border-radius: 2px;
    background: #a88280; transform: scaleY(.48); opacity: .68;
}
.spk-stage-indicator i:nth-child(2), .spk-stage-indicator i:nth-child(4) { --spk-bar: 24px; animation-delay: -.19s; }
.spk-stage-indicator i:nth-child(3) { --spk-bar: 30px; animation-delay: -.31s; }
.spk-stage-indicator.is-playing i { background: var(--spk-accent); opacity: 1; animation: spk-playing .72s ease-in-out infinite alternate; }
@keyframes spk-playing { 0% { transform: scaleY(.5); } 100% { transform: scaleY(1); } }
.spk-channel-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
.spk-channel { display: grid; grid-template-columns: auto minmax(0, 1fr); justify-items: start; text-align: left; gap: 2px 6px; min-height: 52px; padding: 6px 8px; background: #3a2d33; }
.spk-channel i { grid-row: 1 / 3; align-self: center; color: #d9ad9f; }
.spk-channel small { color: #cdb6b4; font-size: .71rem; font-weight: 580; overflow-wrap: anywhere; }
.spk-channel[aria-pressed="true"], .spk-phase-card[aria-pressed="true"] { border-color: #91bcae; background: #364742; }
.spk-channel[aria-pressed="true"] i { color: var(--spk-accent); }
.spk-test-views .spk-note { margin-top: 6px; }

.spk-side { display: grid; min-width: 0; gap: 7px; }
.spk-timing { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; margin: 8px 0; }
.spk-timing strong { font-size: clamp(1.65rem, 4vw, 2.7rem); font-weight: 790; letter-spacing: -.053em; line-height: 1; font-variant-numeric: tabular-nums; }
.spk-timing span { color: #cdb7b7; font-size: .8rem; font-variant-numeric: tabular-nums; }
.spk-playback progress { display: block; width: 100%; height: 5px; margin: 7px 0 9px; border: 0; border-radius: 5px; background: #5e474c; accent-color: var(--spk-warm); }
.spk-playback progress::-webkit-progress-bar { border-radius: 5px; background: #5e474c; }
.spk-playback progress::-webkit-progress-value { border-radius: 5px; background: var(--spk-warm); }
.spk-playback progress::-moz-progress-bar { border-radius: 5px; background: var(--spk-warm); }
.spk-seek-label { margin: 5px 0; }
.spk-review .spk-review-question { margin: 7px 0 5px; color: #eddede; font-size: .81rem; font-weight: 685; }
.spk-report-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
.spk-report-options button { min-height: 34px; font-size: .74rem; }
.spk-review .spk-note { margin-top: 5px; font-size: .74rem; }
.spk-check-list { display: grid; gap: 3px; margin: 7px 0 0; padding: 0; list-style: none; }
.spk-check-list li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px; padding: 4px 5px; border-top: 1px solid var(--spk-line); font-size: .76rem; }
.spk-check-list strong { color: #caafae; font-weight: 690; }
.spk-check-list strong[data-state="success"] { color: var(--spk-accent); }
.spk-check-list strong[data-state="review"] { color: #f7c1a4; }

.spk-frequency-stage {
    margin-top: 8px; padding: 14px 12px 9px; border: 1px solid #65494f; border-radius: 8px;
    background: radial-gradient(ellipse at 20% 0%, #4b333b, #2b2127 79%);
}
.spk-frequency-stage > div:first-child { display: flex; align-items: baseline; gap: 7px; margin-bottom: 13px; color: var(--spk-warm); }
.spk-frequency-stage strong { font-size: clamp(2.2rem, 5vw, 4rem); font-weight: 820; line-height: 1; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.spk-frequency-stage > div:first-child > span { color: #e3bfb2; font-size: .87rem; font-weight: 700; }
.spk-frequency-axis { position: relative; height: 8px; border: 1px solid #886469; border-radius: 5px; background: linear-gradient(90deg, #976e7d, #bd8b92 34%, #e2aa9a 67%, #f3cbb1); }
.spk-frequency-axis i { position: absolute; inset-block: -4px; left: var(--spk-frequency-pos, 43.5%); width: 3px; transform: translateX(-50%); border-radius: 2px; background: #f9fbf7; box-shadow: 0 0 7px #fff; }
.spk-frequency-scale { position: relative; height: 18px; margin-top: 5px; color: #d8bcba; font-size: .66rem; white-space: nowrap; }
.spk-frequency-scale span { position: absolute; left: var(--spk-tick, 0%); transform: translateX(-50%); }
.spk-frequency-scale span:nth-child(2) { --spk-tick: 23.3%; }
.spk-frequency-scale span:nth-child(3) { --spk-tick: 56.6%; }
.spk-frequency-scale span:nth-child(4) { --spk-tick: 80%; }
.spk-frequency-scale span:first-child { transform: none; }
.spk-frequency-scale span:last-child { left: auto; right: 0; transform: none; }
.spk-mode-controls { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 7px; margin-top: 8px; }
.spk-lab .spk-frequency-selection { margin-top: 10px; }
.spk-frequency-selection input { min-height: 26px; }
.spk-mode-actions { margin-top: 8px; }

.spk-phase-list { display: grid; gap: 6px; margin-top: 8px; }
.spk-phase-card {
    display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: center;
    gap: 8px; min-height: 78px; text-align: left; background: #3b2d34;
}
.spk-phase-card > span { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: baseline; gap: 4px 5px; }
.spk-phase-card i { color: var(--spk-warm); }
.spk-phase-card small { grid-column: 1 / -1; color: #dbc3c3; font-size: .75rem; font-weight: 570; overflow-wrap: anywhere; }
.spk-phase-card svg { width: 100%; max-height: 54px; overflow: visible; }
.spk-phase-card path { fill: none; stroke-width: 1.6; }
.spk-phase-card .spk-phase-guide { stroke: #b58e92; stroke-opacity: .56; stroke-dasharray: 3 3; }
.spk-phase-left { stroke: var(--spk-warm); }
.spk-phase-right { stroke: var(--spk-accent); stroke-dasharray: 5 4; }

.spk-result-actions { margin-top: 8px; }
.spk-result { margin-top: 8px; scroll-margin-top: 120px; }
.spk-result[data-state="success"] { border-color: #699d8f; background: #2b403b; }
.spk-result[data-state="review"] { border-color: #a88268; background: #493438; }
.spk-result p { margin-top: 5px; font-size: .84rem; line-height: 1.5; }
.spk-result .spk-actions { margin-top: 6px; }
.spk-result small { color: #cff0e5; font-size: .76rem; }
.spk-guide { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: clamp(20px, 4vw, 45px); scroll-margin-top: 16px; }
.spk-guide section, .spk-faq-section { padding: clamp(13px, 2.7vw, 24px); border: 1px solid var(--spk-line); border-radius: 13px; background: #241b20; }
.spk-guide h2, .spk-faq-section h2 { margin-bottom: 8px; font-size: clamp(1.16rem, 2.24vw, 1.58rem); letter-spacing: -.027em; font-weight: 780; }
.spk-guide ol { margin: 0; padding-left: 1.15rem; }
.spk-guide :is(li, p), .spk-faq-section p { color: var(--spk-muted); font-size: .86rem; line-height: 1.55; }
.spk-guide-links { display: flex; flex-wrap: wrap; gap: 8px 13px; }
.spk-faq-section { margin-top: 8px; }
.spk-faq-section details { padding: 7px 0; border-top: 1px solid var(--spk-line); }
.spk-faq-section summary { cursor: pointer; font-weight: 710; font-size: .86rem; }
.spk-faq-section p { margin-top: 4px; }
.audio-test-page summary::marker { color: var(--spk-warm); }

.spk-lab:is(:fullscreen, .is-expanded) {
    width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; overflow: auto; overscroll-behavior: contain;
    border: 0; border-radius: 0; background: radial-gradient(ellipse at 49% 0, #3d2b31, var(--spk-base) 70%);
}
.spk-lab:-webkit-full-screen { width: 100%; height: 100%; margin: 0; overflow: auto; border: 0; border-radius: 0; background: var(--spk-base); }
.spk-lab.is-expanded { position: fixed; z-index: 3000; inset: 0; height: 100vh; height: 100dvh; }
.spk-viewport-expanded { overflow: hidden; }
.spk-lab:is(:fullscreen, .is-expanded) .spk-toolbar { position: sticky; top: 0; }
.spk-lab:-webkit-full-screen .spk-toolbar { position: sticky; top: 0; }
.spk-lab:is(:fullscreen, .is-expanded) .spk-body { width: min(100%, 1470px); margin-inline: auto; }
.spk-lab:is(:fullscreen, .is-expanded) .spk-stage { --spk-stage-height: clamp(160px, calc(100dvh - 452px), 318px); }
@media (max-width: 760px) {
    .audio-test-page { width: calc(100% - 24px); }
    .audio-test-page .audio-test-crumb, .audio-test-intro { margin-bottom: 12px; }
    .spk-main, .spk-guide { grid-template-columns: minmax(0, 1fr); }
    .spk-settings { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .spk-settings > label:last-child { grid-column: 1 / -1; }
    .spk-surface, .spk-result { padding: 9px; }
    .spk-stage, .spk-lab:is(:fullscreen, .is-expanded) .spk-stage { --spk-stage-height: clamp(143px, 36vw, 216px); }
}
@media (max-width: 420px) {
    .spk-channel { padding-inline: 5px; }
    .spk-tab { flex: 1 1 auto; padding-inline: 6px; font-size: .74rem; }
}
@media (max-width: 360px) { .spk-toolbar { padding-inline: 9px; } .spk-actions .spk-control { padding-inline: 7px; } }
@media (prefers-reduced-motion: reduce) { .spk-stage-indicator.is-playing i { animation: none; transform: none; } }
