/* lab.css - Wave 3 rows 1-3, 18, 19: T9 overtone analyzer (ot-*), T10 formant analyzer (fm-*), T11 compare
   spectrum (cs-*), T27 window function explorer (wn-*), T38 Fourier playground (fp-*). Loaded after tool.css;
   reuses the tool frame (.sa) and the components of site.css. */

/* ---------- T9 overtone analyzer (/overtone-analyzer) ---------- */
.ot-charts,.fm-charts,.cs-charts{position:relative;display:flex;flex-direction:column;gap:10px;flex:1 1 auto;min-height:240px}
.ot-charts>.sa-over,.fm-charts>.sa-over,.cs-charts>.sa-over{border-radius:14px}
.ot .sa-graph,.fm .sa-graph,.cs .sa-graph{min-height:110px}
.ot-g1{flex:1.3 1 0}
.ot-g1 canvas{cursor:default}
.ot-g2{flex:1 1 0}
html:not(.is-app) .ot-charts,html:not(.is-app) .fm-charts,html:not(.is-app) .cs-charts{flex:0 0 auto}
html:not(.is-app) .ot .ot-g1{flex:0 0 auto;height:clamp(220px,30vh,320px)}
html:not(.is-app) .ot .ot-g2{flex:0 0 auto;height:clamp(160px,20vh,220px)}
.ot .sa-read,.fm .sa-read,.cs .sa-read{grid-template-columns:repeat(4,minmax(0,1fr))}
.ot .readout-label,.fm .readout-label,.cs .readout-label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ot .readout-value,.fm .readout-value,.cs .readout-value{font-size:clamp(13px,9cqi,22px);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ot-sub{display:block;margin-top:2px;font:500 11.5px/1.3 var(--f-mono);color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ot-moment{display:flex;align-items:center;gap:10px;min-width:0;font-size:14px;font-weight:600}
.ot-moment .range{flex:1 1 auto;min-width:60px;height:36px}
.ot-moment .btn{min-height:36px;padding:0 12px;font-size:14px}
.ot-moment[hidden]{display:none}
.ot-diff{color:var(--fg)}
.ot-diff:empty{display:none}
.ot-fig-ice rect{fill:var(--ice);opacity:.85}
html.is-app .ot .sa-stage,html.is-app .fm .sa-stage,html.is-app .cs .sa-stage{gap:6px}
html.is-app .ot-charts,html.is-app .fm-charts,html.is-app .cs-charts{gap:6px;min-height:200px}
html.is-app .ot .ot-g1{min-height:110px}
html.is-app .ot .ot-g2{min-height:80px}
html.is-app .ot .sa-read,html.is-app .fm .sa-read,html.is-app .cs .sa-read{gap:6px}
html.is-app .ot .readout,html.is-app .fm .readout,html.is-app .cs .readout{padding:3px 8px}
html.is-app .ot .readout-value,html.is-app .fm .readout-value,html.is-app .cs .readout-value{font-size:14px}
html.is-app .ot-sub{display:none}
html.is-app .ot .sa-status,html.is-app .fm .sa-status,html.is-app .cs .sa-status{font-size:12.5px;max-height:2.8em;overflow:auto}
html.is-app .ot .sa-presets .chip{flex:1 1 0}
html.is-app .ot-moment{font-size:13px;gap:6px}
@media (max-width:559.98px){.ot .sa-read,.fm .sa-read,.cs .sa-read{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (pointer:coarse){.ot-moment .btn{min-height:44px}.ot-moment .range{height:44px}}

/* ---------- T10 formant analyzer (/formant-analyzer); shares the chart/readout rules above ---------- */
.fm-g1{flex:1.5 1 0}
.fm-g1 canvas{cursor:default}
.fm-g2{flex:1 1 0}
html:not(.is-app) .fm .fm-g1{flex:0 0 auto;height:clamp(260px,36vh,380px)}
html:not(.is-app) .fm .fm-g2{flex:0 0 auto;height:clamp(140px,18vh,200px)}
html.is-app .fm .fm-g1{min-height:150px}
html.is-app .fm .fm-g2{min-height:76px}
html.is-app .fm-charts{min-height:232px}
@media (max-width:559.98px){.fm .sa-read,.cs .sa-read{grid-template-columns:repeat(4,minmax(0,1fr))}html.is-app .fm .readout,html.is-app .cs .readout{padding:3px 6px}}
html.is-app .fm .sa-presets .chip{flex:1 1 0;padding:0 8px}
.fm-pt{grid-template-columns:minmax(0,1fr) auto!important}
.fm-pt .rec-t{font-size:13px;line-height:1.35;color:var(--fg-2)}
.fm-pt .rec-t b{color:var(--fg);font-weight:600}
.fm-pt button{min-height:36px;padding:0 10px;border:1px solid var(--line-2);border-radius:8px;background:none;color:var(--fg);font-size:13px;font-weight:600;cursor:pointer}
.fm-fig-area ellipse{fill:var(--ice);fill-opacity:.12;stroke:var(--ice);stroke-opacity:.55}
.fm-fig-trail circle{fill:var(--amber);opacity:.45}
.fm-fig-dot{fill:var(--amber);stroke:var(--screen);stroke-width:2}
@media (pointer:coarse){.fm-pt button{min-height:44px}}

/* ---------- T11 compare two audio spectra (/compare-spectrum) ---------- */
.cs-g1{flex:1.3 1 0}
.cs-g2{flex:1 1 0}
html:not(.is-app) .cs .cs-g1{flex:0 0 auto;height:clamp(220px,30vh,320px)}
html:not(.is-app) .cs .cs-g2{flex:0 0 auto;height:clamp(150px,19vh,210px)}
html.is-app .cs .cs-g1{min-height:110px}
html.is-app .cs .cs-g2{min-height:80px}
.cs-openb{min-height:48px}
html.is-app .cs-openb{min-height:44px;padding:0 14px}
html.is-app .cs .sa-presets .chip{flex:1 1 0;padding:0 8px}
.cs-nextb{align-self:flex-start;min-height:40px;font-size:14px}
.cs-nextb[hidden]{display:none}
.cs-row{display:grid;gap:8px;padding:10px;border:1px solid var(--line);border-radius:12px;background:var(--bg-2)}
.cs-row.is-empty{opacity:.85}
.cs-row-h{display:grid;grid-template-columns:auto minmax(0,1fr) auto auto;align-items:center;gap:8px}
.cs-row-h .btn{min-height:38px;padding:0 10px;font-size:13.5px}
.cs-row-h .icon-btn{width:38px;height:38px}
.cs-row.is-empty .icon-btn{display:none}
.cs-sw{display:grid;place-items:center;width:26px;height:26px;border-radius:7px;font:700 13px var(--f-mono);color:#0b0f14}
.cs-sw-a{background:var(--amber)}
.cs-sw-b{background:var(--ice)}
.cs-who{display:grid;min-width:0;font-size:13px;line-height:1.35;color:var(--fg-2)}
.cs-who b{color:var(--fg);font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cs-sec{display:grid;gap:8px}
.cs-sec[hidden]{display:none}
.cs-tl{display:block;width:100%;height:44px;border:1px solid var(--line);border-radius:8px;cursor:crosshair;touch-action:none}
.cs-tl:focus-visible{outline:2px solid var(--ice);outline-offset:2px}
.cs-sec .btn{justify-self:start;min-height:38px;font-size:13.5px}
.rta-table .cs-big td,.rta-table .cs-big th{color:var(--coral-ink);font-weight:700}
.cs-fig-band{fill:var(--ok);opacity:.12}
.cs-fig-a{fill:none;stroke:var(--amber);stroke-width:2;stroke-linejoin:round}
.cs-fig-b{fill:none;stroke:var(--ice);stroke-width:2;stroke-linejoin:round}
.cs-fig-d{fill:none;stroke:var(--coral);stroke-width:2;stroke-linejoin:round}
@media (pointer:coarse){.cs-row-h .btn,.cs-sec .btn,.cs-nextb{min-height:44px}.cs-row-h .icon-btn{width:44px;height:44px}}

/* ---------- T27 window function explorer (/window-functions): a card, no app frame ---------- */
.wn{position:relative;border:1px solid var(--line-2);border-radius:24px;background:var(--bg-3);box-shadow:var(--shadow);overflow:hidden}
.wn-top{padding:14px 16px 12px;border-bottom:1px solid var(--line)}
.wn-pick{gap:6px}
.wn-pick .chip{min-height:38px;padding:0 12px;font-size:14px;position:relative}
.wn-pick .chip[aria-pressed="true"]{border-color:var(--ice);background:color-mix(in srgb,var(--ice) 12%,transparent)}
.wn-pick .chip.is-main{border-color:var(--amber);background:color-mix(in srgb,var(--amber) 16%,transparent);color:var(--fg)}
.wn-hint{margin:8px 0 0;font-size:13px;color:var(--muted)}
.wn-params{display:flex;flex-wrap:wrap;gap:0 14px}
.wn-params .field{margin-top:10px;width:150px}
.wn-params .field[hidden]{display:none}
.wn-params .input{height:42px}
.wn-grid{display:grid;grid-template-columns:minmax(0,1fr);gap:0}
@media (min-width:1100px){.wn-grid{grid-template-columns:minmax(0,1.15fr) minmax(0,1fr)}.wn-side{border-left:1px solid var(--line)}}
.wn-charts,.wn-side{min-width:0;padding:4px 16px 16px}
.wn-box{margin-top:12px}
.wn-h{margin:0 0 6px;font:500 11.5px var(--f-mono);letter-spacing:.14em;text-transform:uppercase;color:var(--muted)}
.wn-hrow{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:6px}
.wn-hrow .wn-h{margin:0}
.wn-zoom button{min-height:32px;padding:0 10px;font-size:13px}
.wn-g{position:relative;height:clamp(200px,28vh,280px);border:1px solid var(--line);border-radius:14px;background:var(--screen);overflow:hidden}
.wn-g-t{height:clamp(130px,16vh,170px)}
.wn-g canvas{position:absolute;inset:0;display:block;width:100%;height:100%}
.wn-read{margin-top:12px;grid-template-columns:repeat(4,minmax(0,1fr))}
.wn-read3{margin-top:10px;grid-template-columns:repeat(3,minmax(0,1fr))}
.wn .readout{overflow:hidden;padding:8px 10px}
.wn .readout-label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.wn .readout-value{font-size:clamp(14px,10cqi,22px);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.wn-sub{display:block;margin-top:2px;font:500 11.5px/1.3 var(--f-mono);color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.wn-side .field{margin-top:10px}
.wn-row2{align-items:end}
.wn-job{padding:12px 14px 14px;border:1px solid var(--line);border-radius:12px;background:var(--bg-2)}
.wn-job .chips{gap:6px}
.wn-job .chip{min-height:36px;padding:0 10px;font-size:13.5px}
.wn-pickname{margin:10px 0 0;font-size:15px}
.wn-jobtxt{margin:4px 0 0;font-size:14.5px;color:var(--fg-2)}
.wn-job .btn-row{margin-top:10px;gap:8px}
.wn-job .btn{min-height:42px;padding:0 14px;font-size:14.5px}
.wn-job .btn[hidden]{display:none}
.wn-tablewrap{padding:4px 16px 16px;border-top:1px solid var(--line)}
.wn-tablewrap .wn-h{margin-top:14px}
.wn-table th,.wn-table td{padding:7px 10px;white-space:nowrap;font-variant-numeric:tabular-nums;text-align:right}
.wn-table th:first-child{text-align:left}
.wn-table tbody th{font-weight:400;background:none}
.wn-table tr[aria-current] th,.wn-table tr[aria-current] td{background:color-mix(in srgb,var(--amber) 11%,transparent)}
.wn-rowbtn{padding:0;border:0;background:none;color:var(--amber);font:600 14.5px var(--f-body);text-decoration:underline;text-underline-offset:3px;cursor:pointer}
.wn-foot{margin-top:12px;gap:8px}
.wn-foot .btn{min-height:42px;padding:0 14px;font-size:14.5px}
@media (max-width:599.98px){.wn-read{grid-template-columns:repeat(2,minmax(0,1fr))}.wn-read3{grid-template-columns:repeat(3,minmax(0,1fr))}.wn-read3 .wn-sub{display:none}.wn-top,.wn-charts,.wn-side,.wn-tablewrap{padding-left:12px;padding-right:12px}}
@media (pointer:coarse){.wn-pick .chip,.wn-job .chip,.wn-zoom button,.wn-job .btn,.wn-foot .btn{min-height:44px}.wn-rowbtn{padding:14px 0;margin:-14px 0;min-width:44px;text-align:left}}
@media (max-width:599.98px){.wn-pick{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;padding-bottom:2px}.wn-pick::-webkit-scrollbar{display:none}.wn-pick .chip{flex:0 0 auto}.wn-hint{font-size:12.5px}}

/* ---------- T38 Fourier playground (/fourier-playground): a card, no app frame ---------- */
.fp{--fp-c0:var(--amber);--fp-c1:var(--ice);--fp-c2:var(--coral);--fp-c3:var(--ok);--fp-c4:#c58cff;--fp-c5:#ff9ec7;--fp-c6:#8fd3c1;--fp-c7:#e6d36a;position:relative;border:1px solid var(--line-2);border-radius:24px;background:var(--bg-3);box-shadow:var(--shadow);overflow:hidden}
.fp-top{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:10px;padding:12px 16px;border-bottom:1px solid var(--line)}
.fp-presets{gap:6px;min-width:0}
.fp-presets .chip{min-height:38px;padding:0 12px;font-size:14px}
.fp-acts{display:flex;align-items:center;gap:10px}
.fp-acts .seg button{min-height:38px}
.fp-listen{min-height:44px;padding:0 16px}
.fp-listen[aria-pressed="true"]{background:var(--coral);border-color:var(--coral)}
.fp-grid{display:grid;grid-template-columns:minmax(0,1fr)}
@media (min-width:1100px){.fp-grid{grid-template-columns:minmax(0,1.4fr) minmax(330px,1fr)}.fp-side{border-left:1px solid var(--line)}}
.fp-charts,.fp-side{min-width:0;padding:6px 16px 16px}
.fp-box{margin-top:10px}
.fp-box[hidden]{display:none}
.fp-h{margin:0;font:500 11.5px var(--f-mono);letter-spacing:.14em;text-transform:uppercase;color:var(--muted)}
.fp-hrow{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:6px 10px;min-height:40px;margin-bottom:4px}
.fp-hrow .seg button{min-height:32px;padding:0 10px;font-size:13px}
.fp-sw2{min-height:36px;font-size:13.5px}
.fp-cb{display:flex;gap:6px}
.fp-cb .btn{min-height:34px;padding:0 10px;font-size:13.5px}
.fp-g{position:relative;height:clamp(180px,26vh,260px);border:1px solid var(--line);border-radius:14px;background:var(--screen);overflow:hidden}
.fp-g canvas{position:absolute;inset:0;display:block;width:100%;height:100%}
#fp-wave{cursor:default}
.fp-peaks{margin:6px 0 0;font:500 12.5px/1.4 var(--f-mono);color:var(--fg-2)}
.fp-explain-box{margin-top:12px;padding:12px 14px;border:1px solid var(--line);border-left:3px solid var(--amber);border-radius:12px;background:var(--bg-2)}
.fp-explain{margin:6px 0 0;font-size:15px;line-height:1.5;color:var(--fg)}
.fp-count{font:500 12.5px var(--f-mono);color:var(--muted)}
.fp-list{display:grid;gap:8px;margin:4px 0 0;padding:0;list-style:none}
.fp-row{padding:8px 10px 10px;border:1px solid var(--line);border-radius:12px;background:var(--bg-2)}
.fp-rh{display:flex;align-items:center;gap:8px;font-size:14px}
.fp-rh b{flex:1;font-weight:600}
.fp-rh .icon-btn{width:34px;height:34px}
.fp-sw{width:12px;height:12px;border-radius:3px;background:var(--c)}
.fp-knobs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin-top:6px;--knob-size:54px}
.fp-knobs .knob{min-width:0}
.fp-knobs .knob-input{width:72px;height:38px;font-size:13px}
.fp-knobs .knob-label{font-size:10px;letter-spacing:.08em}
.fp-addrow{margin-top:10px}
.fp-side .field{margin-top:12px}
.fp-foot{padding:12px 16px 16px;border-top:1px solid var(--line)}
.fp-foot .btn-row{margin:0;gap:8px}
.fp-foot .btn{min-height:42px;padding:0 14px;font-size:14.5px}
.fp-fig-part{fill:none;stroke:var(--ice);stroke-width:1.5;stroke-dasharray:4 4;opacity:.8}
@media (max-width:599.98px){.fp-presets{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;padding-bottom:2px;width:100%}.fp-presets::-webkit-scrollbar{display:none}.fp-presets .chip{flex:0 0 auto}.fp-acts{width:100%;justify-content:space-between}.fp-top,.fp-charts,.fp-side,.fp-foot{padding-left:12px;padding-right:12px}.fp-knobs .knob-input{width:62px}}
@media (pointer:coarse){.fp-presets .chip,.fp-hrow .seg button,.fp-acts .seg button,.fp-cb .btn,.fp-foot .btn,.fp-sw2{min-height:44px}.fp-rh .icon-btn{width:44px;height:44px}.fp-knobs .knob-input{height:44px}}
