.voice-lab{--vl-teal:#28635f;--vl-copper:#965023;--vl-rule:#ded7ca;max-width:1100px;margin:auto;clear:both;padding:0;color:var(--color-ink)}

.voice-lab [hidden]{display:none!important}
.voice-lab button,.voice-lab input{font:inherit}
.voice-lab button{cursor:pointer}
.voice-lab button:disabled{cursor:default;opacity:.45}
.vl-icon-defs{position:absolute;width:0;height:0;overflow:hidden}
.vl-icon{display:block;width:24px;height:24px;flex:none;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;direction:ltr}
.vl-sr-only{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}
.voice-lab .vl-icon-button{display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;padding:0;flex:none}
.voice-lab .vl-example{display:inline-flex;align-items:center;gap:.55rem}
.voice-lab :is(button,input,summary):focus-visible{outline:3px solid var(--vl-copper);outline-offset:4px}
.voice-lab button{min-height:44px;border-radius:9px;padding:.55rem 1rem;font-weight:650}
.voice-lab input[type=range]{width:100%;accent-color:var(--vl-teal);height:36px;margin:.3rem 0}
.voice-lab input[type=number]{width:100%;padding:.4rem;border:1px solid var(--vl-rule);border-radius:6px;background:#fff}
.voice-lab :is(h1,h3,h4,p,figure){margin-top:0}
.voice-lab h3{font-size:clamp(1.35rem,2vw,1.8rem);line-height:1.3}
.voice-lab h4{font-size:1.2rem}
.voice-lab p{line-height:1.7}
.vl-eyebrow{font-weight:700;font-size:.85rem;letter-spacing:.04em;color:var(--vl-copper);margin-bottom:.6rem}

.vl-card{border:1px solid var(--vl-rule);border-radius:18px;background:#fffcf7;padding:1.5rem}
.vl-capture{display:grid;grid-template-columns:1.35fr 1fr;gap:2rem;background:linear-gradient(125deg,#f1f2e9,#fffcf7 65%);margin-bottom:2rem}
.vl-capture p{margin-bottom:1rem}
.vl-capture-aside{border-inline-start:1px solid var(--vl-rule);padding-inline-start:2rem;display:flex;flex-direction:column;justify-content:center}
.vl-welcome-wave{width:100%;max-height:90px;margin-bottom:.75rem}
.vl-welcome-wave path{fill:none;stroke:var(--vl-teal);stroke-width:1.8}
.vl-welcome-wave path+path{stroke:var(--vl-copper);opacity:.45}
.vl-actions{display:flex;flex-wrap:wrap;gap:.6rem;align-items:center}
.vl-private{font-size:.9rem;color:var(--color-muted);margin-top:.9rem}
.vl-secondary{border:1px solid var(--vl-rule);background:#fffaf2;color:var(--color-ink)}
.vl-text-button{border:1px solid transparent;background:transparent;color:var(--vl-copper);text-decoration:underline;text-underline-offset:4px}
.voice-lab progress{width:100%;accent-color:var(--vl-teal)}

.vl-source{display:grid;grid-template-columns:1fr auto;gap:1rem;align-items:start;margin:1rem 0 2rem}
.vl-source h3{margin-bottom:.4rem}
.vl-source p{color:var(--color-muted);margin-bottom:0}
.vl-f0{border-inline-start:1px solid var(--vl-rule);padding-inline-start:2rem;display:grid;gap:.2rem}
.vl-f0 span{font-size:.9rem;color:var(--color-muted)}
.vl-f0 strong{font-size:2rem;line-height:1.25;color:var(--vl-teal);font-weight:600;white-space:nowrap}
.vl-recording-strip{grid-column:1/-1}
.vl-recording-strip svg{display:block;width:100%;height:64px;direction:ltr;background:#f1eee5;border-radius:8px}
.vl-recording-strip p{font-size:.85rem;margin-top:.4rem}
#vl-sample-credit{grid-column:1/-1;font-size:.85rem}
.vl-step-switch{display:flex;border-bottom:1px solid var(--vl-rule);margin-bottom:1.8rem;gap:.5rem}
.vl-step-switch button{flex:1;border:0;border-radius:9px 9px 0 0;background:transparent;color:var(--color-muted);padding:1rem}
.vl-step-switch button[aria-pressed=true]{background:var(--vl-teal);color:white}
.vl-step-switch span{font-size:.8rem;opacity:.8;margin-inline-end:.4rem;display:inline-block;direction:ltr}
.vl-step-intro{display:grid;grid-template-columns:1fr 1fr;gap:1.5rem;align-items:start}
.vl-step-intro p:not(.vl-eyebrow){font-size:1rem;color:var(--color-muted)}
.vl-readout{display:flex;justify-content:space-between;align-items:center;gap:.5rem}
.vl-readout output{font-variant-numeric:tabular-nums;font-weight:650;color:var(--vl-teal)}
.vl-harmonic-control{--vl-harmonics:20;--vl-row-height:20px;--vl-stack-height:calc(var(--vl-row-height)*var(--vl-harmonics));max-width:900px;margin:0 auto 1rem}
.vl-stack-toolbar{display:flex;flex-wrap:wrap;gap:.6rem 1.2rem;align-items:center;justify-content:space-between}
.vl-stack-toolbar .vl-readout{flex:1;min-width:220px}
.vl-stack-toolbar output{white-space:nowrap;flex:none}
.vl-stack-toolbar button{font-size:.9rem}
.vl-motion-note{margin:.4rem 0 1.4rem;font-size:.85rem}
.vl-stack-grid{display:grid;grid-template-columns:52px minmax(0,1fr) 44px;gap:.5rem;direction:ltr;align-items:start}
.vl-stack-grid canvas{display:block;width:100%;height:calc(144px + var(--vl-stack-height));min-width:0;direction:ltr}
.vl-wave-labels{position:relative;padding-top:12px;direction:ltr;font-size:12px;color:var(--vl-teal);font-variant-numeric:tabular-nums}
#vl-wave-labels span{height:var(--vl-row-height);display:flex;align-items:center;justify-content:flex-end;white-space:nowrap}
#vl-wave-labels .is-muted{color:var(--color-muted)}
.vl-sum-label{position:absolute;top:calc(var(--vl-stack-height) + 64px);inset-inline:0;text-align:center;line-height:1.2;font-size:12px;font-weight:600;direction:rtl}
.vl-cutoff{position:relative;padding-top:12px;display:flex;align-items:center;flex-direction:column;font-size:12px;color:var(--color-muted)}
.vl-cutoff>span:first-child{position:absolute;top:-8px}
.voice-lab #vl-count{writing-mode:vertical-lr;direction:rtl;width:44px;height:var(--vl-stack-height);margin:0;touch-action:none}
.vl-cutoff>span:last-child{margin-top:.3rem;direction:ltr}
.vl-scale-switch{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap;font-size:.9rem;margin:.5rem 0 .8rem}
.vl-scale-switch button{padding:.35rem .7rem;min-height:44px;background:transparent;color:var(--vl-teal);border:1px solid var(--vl-rule)}
.vl-scale-switch button[aria-pressed=true]{color:#fffdf7;background:var(--vl-teal);border-color:var(--vl-teal)}
#vl-scale-note{color:var(--color-muted);font-size:.85rem}
.vl-range-labels{display:flex;justify-content:space-between;direction:ltr;font-size:.85rem;color:var(--color-muted);margin-bottom:.8rem}
.vl-details{border-block:1px solid var(--vl-rule,#ded7ca);padding:1rem 0;margin:1.2rem 0}
.vl-details summary{cursor:pointer;font-weight:650;min-height:44px;padding:.4rem 0}
.vl-details p{font-size:.95rem}
.vl-harmonic-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:.6rem;margin:.8rem 0;direction:ltr}
.vl-harmonic{border:1px solid var(--vl-rule);border-radius:10px;padding:.65rem .7rem;background:#fffcf7;min-width:0;cursor:pointer}
.vl-harmonic input{width:20px;height:20px;accent-color:var(--vl-teal);vertical-align:middle;margin:0 .4rem 0 0}
.vl-harmonic strong{font-size:.95rem}
.vl-harmonic small{display:block;margin-top:.2rem;color:var(--color-muted)}
.vl-harmonic:has(input:not(:checked)){background:#eeebe4}
.vl-band-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.8rem}
.vl-band{padding:1.1rem}
.vl-band h4{margin-bottom:1rem}
.vl-band label{font-size:.9rem}
.vl-band .vl-readout{margin-top:.65rem}
.vl-formant-space{--vl-depth-width:88px;--vl-depth-angle:70deg;max-width:780px;margin:auto;padding:1.25rem 1.5rem .5rem}
.vl-formant-readouts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));direction:ltr;border-bottom:1px solid var(--vl-rule);padding-bottom:.9rem;gap:.5rem}
.vl-formant-readouts>div{display:flex;flex-direction:column;gap:.15rem}
.vl-formant-readouts span{font-size:.85rem;color:var(--color-muted)}
.vl-formant-readouts output{color:var(--vl-teal);font-weight:650;font-size:clamp(1rem,2.5vw,1.4rem);font-variant-numeric:tabular-nums;white-space:nowrap}
.vl-formant-toolbar,.vl-formant-footer{display:flex;justify-content:space-between;align-items:center;gap:.5rem;flex-wrap:wrap}
.vl-formant-toolbar{margin:.4rem 0}
.vl-formant-toolbar .vl-scale-switch{margin:0}
.vl-formant-toolbar .vl-scale-switch button{font-size:.85rem;padding:.3rem .6rem}
.vl-formant-legend{display:flex;gap:.8rem;font-size:.85rem}
.vl-formant-legend i{display:inline-block;width:10px;height:10px;background:var(--vl-teal);border-radius:50%;margin-inline-end:.3rem}
.vl-formant-legend span+span i{background:transparent;border:2px solid #938879}
.vl-formant-layout{display:grid;grid-template-columns:minmax(0,1fr) var(--vl-depth-width);gap:.25rem;direction:ltr}
.vl-formant-plane{position:relative;min-width:0;height:clamp(250px,32vw,350px);touch-action:none;cursor:crosshair}
.vl-formant-plane svg{display:block;width:100%;height:100%;overflow:visible}
.vl-formant-tick{font:12px Arial,sans-serif;fill:#625b50}
.vl-formant-axis{font:600 12px Arial,sans-serif;fill:#28635f}
.vl-formant-travel{stroke:#a9aaa0;stroke-width:1.5;stroke-dasharray:4 4}
.vl-formant-original{fill:#fffcf7;stroke:#938879;stroke-width:2}
.voice-lab .vl-formant-point{position:absolute;display:flex;align-items:center;justify-content:center;transform:translate(-50%,-50%);border:0;background:transparent;width:44px;height:44px;min-height:44px;padding:0;border-radius:50%;cursor:grab;touch-action:none}
.vl-formant-point span{width:20px;height:20px;border-radius:50%;background:var(--vl-teal);border:3px solid #fffcf7;box-shadow:0 0 0 1px var(--vl-teal);pointer-events:none}
.vl-formant-point:active{cursor:grabbing}
.vl-formant-depth{position:relative;width:var(--vl-depth-width);min-width:0;direction:ltr}
.vl-formant-depth label{position:absolute;top:0;left:0;right:0;text-align:center;font-weight:650;color:var(--vl-teal);font-size:.95rem}
.voice-lab #vl-depth{position:absolute;left:50%;top:50%;width:140px;height:44px;margin:0;transform:translate(-50%,-50%) rotate(calc(-1 * var(--vl-depth-angle)));appearance:none;-webkit-appearance:none;background:transparent;touch-action:none;cursor:grab}
#vl-depth::-webkit-slider-runnable-track{height:3px;background:#b9c9c4;border-radius:2px}
#vl-depth::-webkit-slider-thumb{-webkit-appearance:none;width:16px;height:16px;border:2px solid #fffcf7;border-radius:50%;background:var(--vl-teal);box-shadow:0 0 0 1px var(--vl-teal);margin-top:-6.5px}
#vl-depth::-moz-range-track{height:3px;background:#b9c9c4;border-radius:2px}
#vl-depth::-moz-range-thumb{width:12px;height:12px;border:2px solid #fffcf7;border-radius:50%;background:var(--vl-teal);box-shadow:0 0 0 1px var(--vl-teal)}
.vl-depth-original{position:absolute;width:22px;height:22px;border:2px solid #938879;border-radius:50%;transform:translate(-50%,-50%);pointer-events:none}
.vl-depth-arrow{position:absolute;left:calc(50% + 21px);top:calc(50% - 89px);font-size:24px;color:var(--vl-teal);pointer-events:none}
.vl-depth-limit{position:absolute;font:12px Arial,sans-serif;color:#625b50;pointer-events:none}
.vl-depth-high{right:0;top:calc(50% - 111px)}
.vl-depth-low{left:0;top:calc(50% + 88px)}
.vl-formant-footer{margin-top:.3rem;font-size:.8rem;color:var(--color-muted)}
.vl-formant-footer button{font-size:.9rem}
.vl-formant-space .vl-small{font-size:.85rem;margin-top:.3rem}
.vl-small{font-size:.9rem;color:var(--color-muted);margin-top:.7rem}
.vl-plots{margin-top:1.4rem;padding:1.2rem 1.5rem 1rem;overflow:hidden}
.vl-plot-header{display:flex;gap:.5rem;align-items:center;justify-content:space-between;flex-wrap:wrap}
.vl-plot-header h3{font-size:1.2rem;margin-bottom:.5rem}
.vl-legend{display:flex;gap:1rem;font-size:.85rem;flex-wrap:wrap}
.vl-legend i{display:inline-block;width:12px;height:3px;background:var(--vl-teal);vertical-align:middle;margin-inline-end:.4rem}
.vl-legend span+span i{background:#938879}
.vl-plots figure{margin:1rem 0 0}
.vl-plots svg{display:block;width:100%;height:auto;direction:ltr;overflow:visible}
.vl-plots figcaption{font-size:.85rem;color:var(--color-muted);line-height:1.55;margin-top:.2rem}
.vl-axis-label{font:13px Arial,sans-serif;fill:#625b50}
.vl-grid-line{stroke:#ded7ca;stroke-width:1}
.vl-spectrum-bar{stroke:var(--vl-teal);stroke-width:3}
.vl-envelope-original{fill:none;stroke:#938879;stroke-width:2;stroke-dasharray:6 5}
.vl-envelope-edited{fill:none;stroke:var(--vl-teal);stroke-width:2}
.vl-wave-line{fill:none;stroke:var(--vl-teal);stroke-width:2}

.vl-player{position:sticky;inset-inline:0;width:min(340px,calc(100% - 2rem));bottom:.7rem;z-index:5;background:#203f3d;color:#fffdf7;border:1px solid #203f3d;border-radius:14px;padding:.6rem .75rem;margin:0 auto;box-shadow:0 8px 30px #203f3d24;display:grid;grid-template-columns:auto minmax(80px,1fr);gap:.4rem 1rem;align-items:center}
.vl-player button{display:flex;align-items:center;justify-content:center;width:44px;height:44px;flex:none;border:1px solid #ffffff4a;background:transparent;color:inherit;padding:0}
.vl-player #vl-stop{background:#fffdf7;color:#203f3d}
.vl-player :is(button,input):focus-visible{outline-color:#f5c795}
.vl-volume{display:flex;gap:.35rem;align-items:center;font-size:.85rem;min-width:0}
.vl-volume input{min-width:24px;accent-color:#f5c795!important}
.vl-volume .vl-icon{width:20px;height:20px}
.vl-volume output{min-width:4ch;direction:ltr}
.vl-player p{grid-column:1/-1;font-size:.8rem;line-height:1.4;margin:0;color:#e4e6df}

@media(max-width:700px){
.vl-harmonic-control{--vl-row-height:18px;padding:1rem .65rem}
.vl-stack-toolbar{gap:.5rem;flex-wrap:nowrap}
.vl-stack-toolbar .vl-readout{min-width:0;font-size:.95rem}
.vl-stack-toolbar button{padding:.4rem .65rem}
.vl-stack-grid{grid-template-columns:44px minmax(0,1fr) 44px;gap:.25rem}
.vl-motion-note{font-size:.8rem;margin-bottom:1.25rem}
.vl-capture{grid-template-columns:1fr;gap:.5rem;padding:1.2rem}
.vl-capture-aside{border-inline-start:0;border-top:1px solid var(--vl-rule);padding:1rem 0 0}
.vl-welcome-wave{max-height:55px}
.vl-source{gap:1rem}
.vl-f0{padding-inline-start:1rem}
.vl-f0 strong{font-size:1.5rem}
.vl-step-intro{grid-template-columns:1fr;gap:0}
.vl-step-intro h3{margin-bottom:.6rem}
.vl-band-grid{grid-template-columns:1fr}
.vl-band{padding:1rem}
.vl-band h4{margin-bottom:.5rem}
.vl-formant-space{padding:1rem .65rem .5rem}
.vl-formant-plane{height:270px}
.vl-harmonic-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
.vl-plots{padding:1rem}
.vl-plots #vl-spectrum{min-height:175px}
.vl-player{bottom:.35rem;padding:.5rem .65rem;gap:.4rem .6rem;margin:0 auto}
.vl-volume{width:100%}
.vl-volume input{height:25px!important}
.vl-step-switch button{padding:.8rem .4rem;font-size:.95rem}
}

@media(max-width:360px){.vl-harmonic-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
.vl-source{grid-template-columns:1fr}
.vl-f0{padding:0;border:0;display:flex;align-items:center;gap:1rem}
}

@media(max-width:400px){
.vl-formant-space{--vl-depth-width:64px;--vl-depth-angle:80deg;margin-inline:-.5rem;max-width:none}
.vl-formant-plane{height:240px}
.vl-depth-arrow{left:calc(50% + 10px);font-size:22px}
.vl-depth-high{left:0;right:auto;top:calc(50% - 70px)}
}

@media(prefers-reduced-motion:reduce){.voice-lab *{scroll-behavior:auto;transition:none!important;animation:none!important}
}


html:has(.voice-lab){scroll-padding-bottom:11rem}

.voice-lab :is(button,input,summary){scroll-margin-bottom:11rem}

.article-content:has(.voice-lab){max-width:none}
.article-content:has(.voice-lab)>:not(.voice-lab){max-width:70ch}
.voice-lab :is(h3,h4){margin-top:0}
.vl-player{bottom:max(.7rem,env(safe-area-inset-bottom))}
.vl-player[data-active="true"]{position:fixed}
.vl-player:has(#vl-stop:disabled):not([data-active="true"]){display:none}
.voice-lab :is(input,button,output){min-width:0}
@media(scripting:none){.voice-lab .vl-capture,.voice-lab .vl-player{display:none}}
.voice-lab #vl-next{margin-block:1rem}
.voice-lab [data-stage]{scroll-margin-top:9rem}
.voice-lab .vl-private{margin-top:.9rem}
@media(max-width:700px){
  .vl-capture .vl-actions{display:grid;grid-template-columns:1fr 1fr}
  .vl-capture .vl-actions button{padding:.5rem;justify-content:center}
  #vl-vowel{grid-column:1/-1}
}
/* A backdrop filter would anchor the active stop button to the article. */
.post:has(.voice-lab){backdrop-filter:none}
