/*
   Glottodelta — demographically weighted distribution of IPA symbols.
   Copyright (C) 2026 Andrea Benetton

   This program is free software: you can redistribute it and/or modify it under
   the terms of the GNU Affero General Public License as published by the Free
   Software Foundation, either version 3 of the License, or (at your option) any
   later version. This program is distributed WITHOUT ANY WARRANTY; without even
   the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
   See the GNU Affero General Public License <https://www.gnu.org/licenses/> and
   the LICENSE file distributed with this program for details.
*/
/* ===== base ===== */
:root{--bg:#f7f7f8;--panel:#fff;--text:#18181b;--muted:#666;--line:#d7d7dc;--accent:#5b4cc4;--accent2:#eeecff;
/* Speaker-magnitude meter: heat ramp yellow → orange → red → purple. Multi-hue by
   design, so the order is carried by lightness: the steps are validated monotone
   light→dark with visible gaps between neighbours. The yellow end cannot clear
   2:1 against every tile tint, so lit segments carry a thin dark ring that
   delimits them on any background. */
--meter-1:#f0c552;--meter-2:#ee9440;--meter-3:#e2645c;--meter-4:#a955bd;--meter-5:#6a44b0;--meter-off:#e8e8ee}
*{box-sizing:border-box} body{margin:0;background:var(--bg);color:var(--text);font-family:system-ui,-apple-system,"Segoe UI",sans-serif}
header{padding:24px clamp(16px,4vw,48px);background:var(--panel);border-bottom:1px solid var(--line)}
h1{font-size:clamp(1.4rem,3vw,2rem);margin:0 0 8px} p{line-height:1.5} .sub{color:var(--muted);width:100%;max-width:none;margin:0}
main{padding:22px clamp(12px,3vw,40px) 60px;max-width:1600px;margin:auto}
.controls{display:flex;gap:10px;flex-wrap:wrap;margin:0 0 18px;align-items:flex-end} input{min-width:250px;flex:1;padding:10px 12px;border:1px solid var(--line);border-radius:10px;background:var(--panel);font-size:1rem}
.language-picker{display:grid;grid-template-columns:minmax(220px,1fr) minmax(220px,1fr) auto;gap:8px;align-items:end;flex:1 1 720px;padding:12px;border:2px solid var(--accent);border-radius:12px;background:var(--accent2)}.language-picker label{grid-column:1/-1;font-size:.95rem;font-weight:750;color:var(--text)}.language-picker input,.language-picker select{width:100%;min-width:0;padding:10px 12px;border:1px solid var(--line);border-radius:10px;background:var(--panel);color:var(--text);font-size:1rem}.language-picker .language-help{grid-column:1/-1;margin:0;font-size:.78rem;color:var(--muted)}.clear-language{padding:10px 13px;border:1px solid var(--line);border-radius:10px;background:var(--panel);font-size:.95rem;cursor:pointer}.clear-language:hover,.clear-language:focus{border-color:var(--accent)}@media(max-width:720px){.language-picker{grid-template-columns:1fr}.language-picker label,.language-picker .language-help{grid-column:1}.clear-language{width:100%}}
.language-mode{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:-4px 0 18px;padding:10px 12px;border:1px solid var(--line);border-radius:12px;background:var(--panel);font-size:.88rem}.language-mode[hidden]{display:none}.language-mode strong{font-weight:700}.legend-item{display:inline-flex;align-items:center;gap:6px}.legend-swatch{width:16px;height:16px;border-radius:4px;border:1px solid var(--line)}.legend-present{background:#e5f5e7;border-color:#8abf91}.legend-variant{background:#fff3cd;border-color:#d5aa43}.legend-attested{background:#e7f0fb;border-color:#7da5d2}.legend-absent{background:#fbe8e8;border-color:#d49a9a}
.badge{padding:8px 10px;border-radius:999px;background:var(--accent2);color:var(--accent);font-size:.9rem}
.section{margin:24px 0} h2{font-size:1.2rem;margin:0 0 10px} h3{font-size:1rem;margin:0 0 10px}
.table-wrap{overflow:auto;border:1px solid var(--line);border-radius:14px;background:var(--panel)} table{border-collapse:collapse;width:100%;min-width:1050px} th,td{border-right:1px solid var(--line);border-bottom:1px solid var(--line);padding:7px;text-align:center} th{background:#f0f0f3;font-size:.83rem} tbody th{text-align:left;position:sticky;left:0;z-index:2} tr:last-child td,tr:last-child th{border-bottom:0} td:last-child,th:last-child{border-right:0} .na{background:#ededf0}
.pair{display:flex;justify-content:center;gap:4px;min-height:54px;align-items:center}
.sym{border:1px solid var(--line);background:var(--panel);border-radius:9px;padding:5px 7px;min-width:42px;cursor:pointer;color:var(--text);transition:background .15s,border-color .15s} .sym:hover,.sym:focus{border-color:var(--accent);outline:2px solid var(--accent2)} .sym span{display:block;font:600 1.35rem "Noto Sans",sans-serif} .sym small{display:block;color:var(--muted);font-size:.7rem;white-space:nowrap}.sym .speaker-count{color:var(--accent);font-weight:650}.sym .language-count{color:var(--muted)} .sym.hidden{opacity:.12;pointer-events:none}.sym.lang-present{background:#e5f5e7;border-color:#78b782}.sym.lang-variant{background:#fff3cd;border-color:#d5aa43}.sym.lang-attested{background:#e7f0fb;border-color:#7da5d2}.sym.lang-absent{background:#fbe8e8;border-color:#cf9292}.sym.lang-present:hover,.sym.lang-present:focus{border-color:#3f8750;outline-color:#d6efda}.sym.lang-variant:hover,.sym.lang-variant:focus{border-color:#ad7c12;outline-color:#ffedb0}.sym.lang-attested:hover,.sym.lang-attested:focus{border-color:#4f79a8;outline-color:#d5e5f7}.sym.lang-absent:hover,.sym.lang-absent:focus{border-color:#a95e5e;outline-color:#f5d5d5}.sym .selected-grapheme{margin-top:3px;padding-top:3px;border-top:1px solid #0002;font-weight:750;font-size:.86rem;color:#245e31;max-width:120px;overflow:hidden;text-overflow:ellipsis}.sym .selected-grapheme.no-spelling{font-size:.62rem;font-weight:600;color:#476b4e}.sym .selected-grapheme.variant-spelling{font-size:.68rem;font-weight:700;color:#795b09;white-space:normal;line-height:1.15}.sym .selected-grapheme.attested-spelling{font-size:.62rem;font-weight:650;color:#315f8d;white-space:normal;line-height:1.15}.sym .selected-grapheme.not-present{font-size:.62rem;font-weight:600;color:#8c4646}
/* ---- speaker-magnitude meter ---- */
.speaker-meter{display:flex;gap:2px;justify-content:center;margin:3px auto 0;width:max-content}
/* .sym span sets display:block and a 1.35rem font — outrank both inside a tile. */
.sym .speaker-meter{display:flex;font-size:0;line-height:0}
.speaker-meter .led{display:block;width:7px;height:4px;border-radius:1.5px;background:var(--meter-off);box-shadow:inset 0 0 0 1px #00000010}
/* Each position keeps its own colour as it lights up, so the strip reads like a
   meter: the count gives the magnitude and the highest lit segment names the tier. */
.speaker-meter .led:nth-child(1).on{background:var(--meter-1)}
.speaker-meter .led:nth-child(2).on{background:var(--meter-2)}
.speaker-meter .led:nth-child(3).on{background:var(--meter-3)}
.speaker-meter .led:nth-child(4).on{background:var(--meter-4)}
.speaker-meter .led:nth-child(5).on{background:var(--meter-5)}
.speaker-meter .led.on{box-shadow:inset 0 0 0 1px #00000045}
.speaker-meter.is-pending{opacity:.45}
body.comparison-mode .speaker-meter,body.comparison-mode .meter-legend{display:none}
body.large-symbols .speaker-meter .led{width:10px;height:5px}
/* Non-colour cues: lit segments also gain a solid outline, so the meter is
   readable from shape alone. */
body.noncolor-cues .speaker-meter .led.on{box-shadow:inset 0 0 0 1px #000000cc}
body.high-contrast .speaker-meter .led{box-shadow:inset 0 0 0 1px #000}
.meter-legend{display:inline-flex;align-items:center;gap:7px;margin:0;padding:8px 10px;border-radius:999px;background:var(--accent2);color:var(--accent);font-size:.82rem}
.meter-legend .speaker-meter{margin:0}
@media print{.speaker-meter .led{box-shadow:inset 0 0 0 1px #000}}
.vowels table{min-width:620px} .groups{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:14px} .group{background:var(--panel);border:1px solid var(--line);border-radius:14px;padding:14px} .symbol-grid{display:flex;flex-wrap:wrap;gap:7px}
.drawer{position:fixed;inset:0 0 0 auto;width:min(520px,100%);background:var(--panel);border-left:1px solid var(--line);box-shadow:-12px 0 35px #0002;transform:translateX(105%);transition:.2s;z-index:20;display:flex;flex-direction:column} .drawer.open{transform:none} .drawer-head{padding:18px;border-bottom:1px solid var(--line);display:flex;justify-content:space-between;gap:16px} .drawer-head h2{font-size:2.2rem;margin:0} .close{border:1px solid var(--line);background:var(--panel);border-radius:8px;padding:7px 10px;cursor:pointer} .stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(105px,1fr));gap:8px;padding:14px} .stat{background:var(--accent2);padding:10px;border-radius:10px} .stat b{display:block;font-size:1.15rem;color:var(--accent)} .stat small{color:var(--muted)} .lang-search{margin:0 14px 10px;width:calc(100% - 28px);min-width:0;flex:none} .list{overflow:auto;padding:0 14px 18px} .lang{padding:10px 2px;border-bottom:1px solid var(--line)} .lang small{color:var(--muted)}.speaker-line{margin-top:4px;font-size:.82rem;color:var(--accent);font-weight:600}
.orthography{margin-top:5px;display:flex;gap:7px;align-items:baseline;flex-wrap:wrap}.orthography .label{font-size:.76rem;color:var(--muted)}.orthography .grapheme{font-size:1.15rem;font-weight:650;background:var(--accent2);color:var(--accent);padding:2px 7px;border-radius:7px}.orthography .missing{font-size:.82rem;color:var(--muted);font-style:italic}.coverage{margin:0 14px 10px;padding:9px 10px;border:1px solid var(--line);border-radius:10px;color:var(--muted);font-size:.82rem;background:#fafafa}
.note{background:var(--panel);border:1px solid var(--line);border-radius:14px;padding:14px;color:var(--muted);font-size:.92rem}
@media(max-width:640px){header{padding:18px 14px} main{padding:16px 8px 45px} .stats{grid-template-columns:1fr}}

.orthography-coverage .summary-line{display:flex;gap:10px;flex-wrap:wrap;align-items:center;margin:0 0 12px;color:var(--muted)}
.orthography-coverage .verified-total{background:#e5f5e7;border:1px solid #78b782;color:#245e31;border-radius:999px;padding:4px 9px;font-weight:750}
.orthography-coverage table{min-width:780px}.orthography-coverage td:first-child{font-size:1.55rem;font-weight:750;text-align:center}.orthography-coverage code{font-size:1rem}.coverage-ok,.coverage-composite{display:inline-block;border-radius:999px;padding:3px 7px;font-size:.72rem;font-weight:750}.coverage-ok{background:#e5f5e7;color:#245e31;border:1px solid #78b782}.coverage-composite{background:#fff3cd;color:#795b09;border:1px solid #d5aa43}.orthography-coverage .source-note{font-size:.78rem;color:var(--muted)}.orthography-coverage[hidden]{display:none}.coverage-ambiguous{display:inline-block;border-radius:999px;padding:3px 7px;font-size:.72rem;font-weight:750;background:#e7f0fb;color:#315f8d;border:1px solid #7da5d2}.coverage-neutral{display:inline-block;border-radius:999px;padding:3px 7px;font-size:.72rem;font-weight:750;background:#f0f0f3;color:#555;border:1px solid var(--line)}.coverage-grapheme-name{display:block;margin-top:2px;font-size:.72rem;font-weight:500;color:var(--muted)}.coverage-phonemes{display:flex;gap:4px;justify-content:center;flex-wrap:wrap}.coverage-phonemes code{white-space:nowrap}.verification-level{display:inline-block;border-radius:999px;padding:4px 9px;font-size:.75rem;font-weight:750;background:#e7f0fb;color:#315f8d;border:1px solid #7da5d2}.verification-profile{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:8px;margin:0 0 12px}.verification-profile>div{border:1px solid var(--line);border-radius:10px;padding:8px 10px;background:var(--panel)}.verification-profile b{display:block;font-size:.72rem;color:var(--muted);margin-bottom:3px}.coverage-role{display:block;font-size:.68rem;color:var(--muted);margin-top:2px;text-transform:uppercase;letter-spacing:.04em}.coverage-sources{margin-top:8px}.coverage-sources a{margin-right:10px}.coverage-unmapped{display:inline-block;border-radius:999px;padding:3px 7px;font-size:.72rem;font-weight:750;background:#f5e7e7;color:#7c3434;border:1px solid #c98e8e}

.audio-panel{margin:14px;border:1px solid var(--line);border-radius:12px;padding:12px;background:var(--accent2)}
.audio-panel h3{margin:0 0 9px;font-size:.95rem}.audio-samples{display:grid;gap:7px}.audio-sample{display:grid;grid-template-columns:34px minmax(0,1fr);align-items:center;gap:9px;padding:7px 8px;border:1px solid var(--line);border-radius:10px;background:var(--panel)}.audio-play{display:inline-grid;place-items:center;width:34px;height:34px;border:0;border-radius:50%;background:var(--accent);color:white;padding:0;font-weight:800;cursor:pointer;line-height:1}.audio-play:hover,.audio-play:focus{outline:2px solid var(--accent);outline-offset:2px}.audio-play:disabled{opacity:.45;cursor:not-allowed}.audio-sample-meta{min-width:0;line-height:1.3}.audio-sample-name{display:block;font-size:.82rem;font-weight:750;color:var(--text)}.audio-sample-source{display:block;font-size:.73rem;color:var(--muted)}.audio-sample-source a{color:var(--accent)}.audio-status{font-size:.82rem;color:var(--muted);margin-top:8px}.audio-status.error{color:#b3261e;font-weight:650}.audio-source{font-size:.72rem;color:var(--muted);margin-top:7px;line-height:1.4}.audio-source a{color:var(--accent)}.audio-panel audio{display:none}
.population-included{color:#245e31;font-weight:700}.population-excluded{color:#315f8d;font-weight:700}

/* ===== pulmonic-layout-overrides ===== */
:root{
  --phoneme-box-width:94px;
  --phoneme-box-min-height:122px;
  --pulmonic-column-width:210px;
  --pulmonic-manner-width:105px;
  --impossible-grey:#aaa;
}
/* All phoneme controls reserve enough room for language-specific grapheme and mapping labels. */
.sym{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  width:var(--phoneme-box-width);
  min-width:var(--phoneme-box-width);
  min-height:var(--phoneme-box-min-height);
  height:auto;
  padding:8px 6px;
}
.sym .selected-grapheme{
  width:100%;
  max-width:none;
  overflow:visible;
  text-overflow:clip;
  white-space:normal !important;
  overflow-wrap:anywhere;
  word-break:normal;
}
.pulmonic-table{
  table-layout:fixed;
  width:2415px;
  min-width:2415px;
}
.pulmonic-table col:first-child,
.pulmonic-table thead th:first-child,
.pulmonic-table .manner-heading{
  width:var(--pulmonic-manner-width);
  min-width:var(--pulmonic-manner-width);
  max-width:var(--pulmonic-manner-width);
}
.pulmonic-table col:not(:first-child),
.pulmonic-table thead th:not(:first-child),
.pulmonic-table tbody td{
  width:var(--pulmonic-column-width);
  min-width:var(--pulmonic-column-width);
  max-width:var(--pulmonic-column-width);
}
.pulmonic-table th,
.pulmonic-table td{
  padding:8px;
  vertical-align:middle;
}
.pulmonic-table thead th{
  overflow-wrap:anywhere;
  hyphens:auto;
}
.pulmonic-table .manner-heading{
  white-space:normal;
  overflow-wrap:normal;
  word-break:normal;
  line-height:1.15;
}
.pulmonic-table .voicing-pair{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px;
  align-items:stretch;
  min-height:var(--phoneme-box-min-height);
  height:100%;
}
.pulmonic-table .phoneme-slot{
  min-width:0;
  min-height:var(--phoneme-box-min-height);
  display:flex;
  align-items:stretch;
  justify-content:center;
  border-radius:9px;
}
.pulmonic-table .phoneme-slot .sym{
  width:100%;
  min-width:0;
  min-height:100%;
  height:100%;
}
.pulmonic-table .empty-slot{
  background:transparent;
}
.pulmonic-table .impossible-cell,
.pulmonic-table .impossible-slot{
  background:var(--impossible-grey) !important;
}
.pulmonic-table .impossible-cell{
  position:relative;
}
/* A half-impossible cell (only Plosive/Glottal: ʔ is possible, its voiced
   counterpart is not) shades the underlying cell, not a floating box — the grey
   bleeds through the cell padding and half the pair gutter to the cell edges, so
   it reads exactly like the whole-cell shading elsewhere in the chart. */
.pulmonic-table td.has-impossible-slot .impossible-slot{
  margin:-7px -7px -7px -4px;
  border-radius:0;
}
.pulmonic-table .impossible-label{
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap;
  border:0;
}
.pulmonic-chart-note{
  display:flex;
  gap:14px 24px;
  flex-wrap:wrap;
  align-items:center;
  margin-top:10px;
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:12px;
  background:var(--panel);
  color:var(--muted);
  font-size:.86rem;
}
.pulmonic-chart-note .convention-item{
  display:flex;
  align-items:center;
  gap:8px;
  flex:1 1 360px;
}
.voice-demo{
  display:grid;
  grid-template-columns:repeat(2,30px);
  border:1px solid var(--line);
  border-radius:7px;
  overflow:hidden;
  background:var(--panel);
  color:var(--text);
  flex:none;
}
.voice-demo b{
  padding:4px 5px;
  text-align:center;
  font-size:1.05rem;
}
.voice-demo b+ b{border-left:1px solid var(--line)}
.grey-demo{
  width:62px;
  height:30px;
  border:1px solid #777;
  border-radius:7px;
  background:var(--impossible-grey);
  flex:none;
}
@media(max-width:640px){
  :root{
    --phoneme-box-width:90px;
    --phoneme-box-min-height:118px;
  }
}

/* Fixed, uniform vowel chart geometry. */
:root{
  --vowel-height-width:105px;
  --vowel-column-width:210px;
}
.vowels .table-wrap{
  background:#fff;
}
.vowels .vowel-table{
  table-layout:fixed;
  width:1155px;
  min-width:1155px;
  background:#fff;
}
.vowels .vowel-table col:first-child,
.vowels .vowel-table thead th:first-child,
.vowels .vowel-table tbody th{
  width:var(--vowel-height-width);
  min-width:var(--vowel-height-width);
  max-width:var(--vowel-height-width);
}
.vowels .vowel-table col:not(:first-child),
.vowels .vowel-table thead th:not(:first-child),
.vowels .vowel-table tbody td{
  width:var(--vowel-column-width);
  min-width:var(--vowel-column-width);
  max-width:var(--vowel-column-width);
}
.vowels .vowel-table th,
.vowels .vowel-table td{
  padding:8px;
  vertical-align:middle;
}
.vowels .vowel-table tbody td,
.vowels .vowel-table tbody td.na{
  background:#fff;
}
.vowels .vowel-pair{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px;
  align-items:stretch;
  min-height:var(--phoneme-box-min-height);
  width:100%;
}
.vowels .vowel-slot{
  min-width:0;
  min-height:var(--phoneme-box-min-height);
  display:flex;
  align-items:stretch;
  justify-content:center;
}
.vowels .vowel-slot .sym{
  width:100%;
  min-width:0;
  min-height:100%;
  height:100%;
}
.vowels .vowel-slot.single-centred{
  grid-column:1 / -1;
}
.vowels .vowel-slot.single-centred .sym{
  width:var(--phoneme-box-width);
  min-width:var(--phoneme-box-width);
}
.vowels .vowel-empty{
  background:transparent;
}
.vowel-chart-note{
  display:flex;
  gap:14px 24px;
  flex-wrap:wrap;
  align-items:center;
  margin-top:10px;
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:12px;
  background:var(--panel);
  color:var(--muted);
  font-size:.86rem;
}
.vowel-chart-note .convention-item{
  display:flex;
  align-items:center;
  gap:8px;
  flex:1 1 360px;
}
.rounding-demo{
  display:grid;
  grid-template-columns:repeat(2,38px);
  gap:4px;
  padding:4px;
  border:1px solid #d6bd55;
  border-radius:7px;
  background:#fff4b8;
  color:var(--text);
  flex:none;
}
.rounding-demo b{
  display:grid;
  place-items:center;
  min-height:30px;
  background:#fff;
  border-radius:5px;
  padding:4px 5px;
  text-align:center;
  font-size:1.05rem;
}
.rounding-demo b + b{
  border-left:1px solid var(--line);
}

/* ===== ipa-standard-alignment-overrides ===== */
/* Compact IPA vowel chart geometry with fixed phoneme columns. */
:root{
  --vowel-height-width:105px;
  --vowel-position-width:calc(var(--phoneme-box-width) + 10px);
  --vowel-position-count:11;
}
.vowels .table-wrap{background:#fff;}
.vowels .ipa-vowel-grid{
  table-layout:fixed;
  margin-right:auto;
  width:calc(var(--vowel-height-width) + (var(--vowel-position-count) * var(--vowel-position-width)));
  min-width:calc(var(--vowel-height-width) + (var(--vowel-position-count) * var(--vowel-position-width)));
  max-width:calc(var(--vowel-height-width) + (var(--vowel-position-count) * var(--vowel-position-width)));
  background:#fff;
}
.vowels .ipa-vowel-grid col.vowel-height-col{
  width:var(--vowel-height-width);
}
.vowels .ipa-vowel-grid col.vowel-position-col{
  width:var(--vowel-position-width);
}
.vowels .ipa-vowel-grid thead th:first-child,
.vowels .ipa-vowel-grid tbody th{
  width:var(--vowel-height-width);
  min-width:var(--vowel-height-width);
  max-width:var(--vowel-height-width);
}
.vowels .ipa-vowel-grid thead th[colspan="2"]{
  width:calc(var(--vowel-position-width) * 2);
  min-width:calc(var(--vowel-position-width) * 2);
  max-width:calc(var(--vowel-position-width) * 2);
}
.vowels .ipa-vowel-grid thead th[colspan="3"]{
  width:calc(var(--vowel-position-width) * 3);
  min-width:calc(var(--vowel-position-width) * 3);
  max-width:calc(var(--vowel-position-width) * 3);
}
.vowels .ipa-vowel-grid th,
.vowels .ipa-vowel-grid td{
  padding:5px;
  height:calc(var(--phoneme-box-min-height) + 12px);
  vertical-align:middle;
  background:#fff;
}
.vowels .ipa-vowel-grid thead th,
.vowels .ipa-vowel-grid tbody th{
  background:#f0f0f3;
}
.vowels .ipa-vowel-grid td.vowel-symbol-cell,
.vowels .ipa-vowel-grid td.vowel-separator-cell,
.vowels .ipa-vowel-grid td.vowel-empty-cell{
  width:var(--vowel-position-width);
  min-width:var(--vowel-position-width);
  max-width:var(--vowel-position-width);
}
.vowels .ipa-vowel-grid td.vowel-symbol-cell .sym{
  width:var(--phoneme-box-width);
  min-width:var(--phoneme-box-width);
  max-width:var(--phoneme-box-width);
  min-height:var(--phoneme-box-min-height);
  margin:auto;
}
.vowels .ipa-vowel-grid td.vowel-separator-cell{
  font-size:1.25rem;
  font-weight:700;
  color:var(--muted);
}
.vowels .ipa-vowel-grid .vowel-pair-dot{
  display:inline-block;
  line-height:1;
}
.vowels .ipa-vowel-grid td.vowel-empty-cell{
  background:#fff !important;
}

<style id="sources-license-styles">
.vowels .ipa-vowel-grid td.vowel-separator-cell{
  background:#fff !important;
  color:transparent;
}
.vowels .ipa-vowel-grid .vowel-pair-dot{display:none !important;}
.sources-license{
  max-width:1600px;
  margin:0 auto;
  padding:0 clamp(12px,3vw,40px) 48px;
}
.sources-license-inner{
  border:1px solid var(--line);
  border-radius:16px;
  background:var(--panel);
  padding:20px;
}
.sources-license h2{margin:0 0 10px;font-size:1.18rem;}
.sources-license h3{margin:18px 0 8px;font-size:1rem;}
.sources-license ul{margin:8px 0 0;padding-left:22px;}
.sources-license li{margin:8px 0;line-height:1.45;}
.sources-license a{color:var(--accent);text-decoration-thickness:1px;text-underline-offset:2px;}
.license-notice{
  margin-top:16px;
  padding:14px 16px;
  border-left:4px solid var(--accent);
  border-radius:10px;
  background:var(--accent2);
  line-height:1.5;
}
.source-caveat{color:var(--muted);font-size:.9rem;line-height:1.5;}

/* ===== vowel-five-header-sizing-fix ===== */
/* Five semantic headers; twelve narrow symbol columns. */
.vowels .ipa-vowel-grid{
  table-layout:fixed !important;
  width:calc(var(--vowel-height-width) + (12 * var(--vowel-position-width))) !important;
  min-width:calc(var(--vowel-height-width) + (12 * var(--vowel-position-width))) !important;
  max-width:calc(var(--vowel-height-width) + (12 * var(--vowel-position-width))) !important;
}
.vowels .ipa-vowel-grid col.vowel-position-col,
.vowels .ipa-vowel-grid tbody td{
  width:var(--vowel-position-width) !important;
  min-width:var(--vowel-position-width) !important;
  max-width:var(--vowel-position-width) !important;
}
.vowels .ipa-vowel-grid thead th[colspan="3"]{
  width:calc(var(--vowel-position-width) * 3) !important;
  min-width:calc(var(--vowel-position-width) * 3) !important;
  max-width:calc(var(--vowel-position-width) * 3) !important;
  white-space:normal;
  overflow-wrap:anywhere;
}
.vowels .ipa-vowel-grid td.vowel-symbol-cell{
  padding-left:5px !important;
  padding-right:5px !important;
}

/* ===== vowel-twelve-column-fix ===== */
/* Empty vowel columns 2, 4 (table numbering after Height), and 14 removed: 12 equal symbol columns remain. */
.vowels .ipa-vowel-grid{
  width:calc(var(--vowel-height-width) + (12 * var(--vowel-position-width))) !important;
  min-width:calc(var(--vowel-height-width) + (12 * var(--vowel-position-width))) !important;
  max-width:calc(var(--vowel-height-width) + (12 * var(--vowel-position-width))) !important;
}
.vowels .ipa-vowel-grid thead th[colspan="2"]{
  width:calc(var(--vowel-position-width) * 2) !important;
  min-width:calc(var(--vowel-position-width) * 2) !important;
  max-width:calc(var(--vowel-position-width) * 2) !important;
  white-space:normal;
  overflow-wrap:anywhere;
}

/* ===== vowel-rounding-guide-cell-styles ===== */
/* Light-yellow cell backgrounds clarify unrounded/rounded vowel pairing.
   The phoneme buttons retain their own state colours. */
.vowels .ipa-vowel-grid td.vowel-rounding-guide-cell {
  background: #fff4b8 !important;
}

/* ===== final-vowel-width-and-audio-fix ===== */
/* Final sizing authority: 11 actual vowel columns plus the Height column.
   The wrapper shrinks to the table instead of stretching across the section. */
:root{
  --vowel-position-count:11;
}
.vowels .table-wrap{
  display:block;
  width:fit-content;
  max-width:100%;
  overflow-x:auto;
  background:transparent;
}
.vowels .ipa-vowel-grid{
  table-layout:fixed !important;
  width:calc(var(--vowel-height-width) + (var(--vowel-position-count) * var(--vowel-position-width))) !important;
  min-width:calc(var(--vowel-height-width) + (var(--vowel-position-count) * var(--vowel-position-width))) !important;
  max-width:calc(var(--vowel-height-width) + (var(--vowel-position-count) * var(--vowel-position-width))) !important;
  margin:0 !important;
}
.vowels .ipa-vowel-grid thead th:not(:first-child){
  width:auto !important;
  min-width:0 !important;
  max-width:none !important;
  white-space:normal;
  overflow-wrap:anywhere;
}
.vowels .ipa-vowel-grid col.vowel-position-col,
.vowels .ipa-vowel-grid tbody td{
  width:var(--vowel-position-width) !important;
  min-width:var(--vowel-position-width) !important;
  max-width:var(--vowel-position-width) !important;
}

/* ===== priority-feature-styles ===== */
/* High-priority exploration features: evidence filtering, language comparison,
   differences-only mode, and transparent L/P audit controls. */
.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}
.priority-controls{align-items:stretch}
.priority-controls .language-picker{flex:1 1 560px}
.primary-language-picker{border-color:var(--accent)}
.comparison-language-picker{border-color:#b66d12;background:#fff6e9}
.comparison-language-picker label{color:#754406}
.comparison-language-picker.is-disabled{opacity:.62}
.evidence-controls{display:grid;grid-template-columns:minmax(220px,1fr) auto;gap:8px;align-content:start;flex:1 1 420px;padding:12px;border:1px solid var(--line);border-radius:12px;background:var(--panel)}
.evidence-controls>label:first-child{grid-column:1/-1;font-weight:750;font-size:.95rem}
.evidence-controls select{width:100%;min-width:0;padding:10px 12px;border:1px solid var(--line);border-radius:10px;background:var(--panel);font-size:.95rem;color:var(--text)}
.difference-toggle{display:flex;align-items:center;gap:8px;padding:8px 10px;border:1px solid var(--line);border-radius:10px;background:#fafafa;font-size:.9rem;white-space:nowrap}
.difference-toggle input{min-width:0;flex:none;width:18px;height:18px;margin:0}
.evidence-help{grid-column:1/-1;margin:0;font-size:.78rem;color:var(--muted)}
.mode-summary{display:flex;gap:8px;align-items:baseline;flex-wrap:wrap;flex:1 1 100%}
.mode-legend{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.mode-legend[hidden]{display:none}
.legend-shared{background:#eee8ff;border-color:#7457c5}
.legend-only-a{background:#dff4f0;border-color:#3b8f7d}
.legend-only-b{background:#fff0dd;border-color:#c77a19}
.legend-neither{background:#f1f1f3;border-color:#9d9da5}
.sym.evidence-filtered{opacity:.12;filter:grayscale(1);pointer-events:none}
.sym.compare-shared{background:#eee8ff!important;border-color:#7457c5!important}
.sym.compare-only-a{background:#dff4f0!important;border-color:#3b8f7d!important}
.sym.compare-only-b{background:#fff0dd!important;border-color:#c77a19!important}
.sym.compare-neither{background:#f1f1f3!important;border-color:#9d9da5!important;color:#686870}
.sym.compare-suppressed{visibility:hidden;pointer-events:none}
.sym .comparison-state{width:100%;margin-top:4px;padding-top:4px;border-top:1px solid #0002;font-size:.66rem;font-weight:800;line-height:1.15;white-space:normal;overflow-wrap:anywhere}
.sym.compare-shared .comparison-state{color:#4e3890}
.sym.compare-only-a .comparison-state{color:#206957}
.sym.compare-only-b .comparison-state{color:#8b500b}
.sym.compare-neither .comparison-state{color:#686870}
.audit-panel{margin:0 14px 12px;padding:12px;border:1px solid var(--line);border-radius:12px;background:#fafafa}
.audit-panel h3{margin:0 0 8px;font-size:.95rem}
.audit-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;margin-bottom:10px}
.audit-summary-item{padding:8px;border-radius:9px;border:1px solid var(--line);font-size:.75rem;line-height:1.35}
.audit-summary-item b{display:block;font-size:.82rem;margin-bottom:2px}
.audit-summary-item.mapped{background:#e5f5e7;border-color:#78b782;color:#245e31}
.audit-summary-item.variant{background:#fff3cd;border-color:#d5aa43;color:#795b09}
.audit-summary-item.attested{background:#e7f0fb;border-color:#7da5d2;color:#315f8d}
.audit-explanation{margin:0 0 9px;font-size:.78rem;color:var(--muted)}
.audit-filter-row{display:flex;gap:6px;flex-wrap:wrap}
.audit-filter{border:1px solid var(--line);border-radius:999px;background:var(--panel);padding:6px 9px;font-size:.75rem;cursor:pointer;color:var(--text)}
.audit-filter:hover,.audit-filter:focus{border-color:var(--accent)}
.audit-filter[aria-pressed="true"]{background:var(--accent);border-color:var(--accent);color:#fff}
.stat-action{border:0;text-align:left;font:inherit;cursor:pointer;color:inherit}
.stat-action:hover,.stat-action:focus{outline:2px solid var(--accent);outline-offset:1px}
.sym .phonetic-plus{display:none;color:#6a44b0;font-weight:750}
body.phonetic-view .sym .phonetic-plus{display:block}
body.comparison-mode .sym .phonetic-plus{display:none}
.curated-drawer-section{margin-top:16px;padding-top:10px;border-top:2px dashed var(--line)}
.curated-drawer-section h4{margin:0 0 4px;font-size:.85rem;letter-spacing:.04em;text-transform:uppercase;color:var(--muted)}
.curated-drawer-note{margin:0 0 6px;font-size:.78rem;color:var(--muted)}
.curated-lang{border-left:3px solid var(--line);padding-left:8px}
.evidence-badge{display:inline-block;margin-top:5px;border-radius:999px;padding:3px 7px;font-size:.7rem;font-weight:800;border:1px solid var(--line)}
.evidence-badge.mapped{background:#e5f5e7;border-color:#78b782;color:#245e31}
.evidence-badge.variant{background:#fff3cd;border-color:#d5aa43;color:#795b09}
.evidence-badge.attested{background:#e7f0fb;border-color:#7da5d2;color:#315f8d}
.evidence-badge.absent{background:#fbe8e8;border-color:#cf9292;color:#8c4646}
@media(max-width:760px){.evidence-controls{grid-template-columns:1fr}.evidence-controls>label:first-child,.evidence-help{grid-column:1}.difference-toggle{white-space:normal}.audit-summary{grid-template-columns:1fr}}

/* ===== single-language-combo-layout-fix ===== */
/* One visible language combobox per language. The hidden selects remain as
   internal state mirrors so the existing application logic is unchanged. */
.priority-controls .language-picker{
  grid-template-columns:minmax(0,1fr) auto;
  flex:1 1 330px;
}
.priority-controls .language-picker>label,
.priority-controls .language-picker>.language-help{grid-column:1/-1}
.priority-controls .language-picker>input{grid-column:1}
.priority-controls .language-picker>.clear-language{grid-column:2}
.priority-controls .language-picker select[hidden]{display:none!important}
.priority-controls .evidence-controls{
  grid-template-columns:1fr 1fr;
  align-items:center;
  align-content:start;
  flex:1 1 390px;
}
.priority-controls .evidence-controls>label:first-child{
  grid-column:1/-1;
  white-space:nowrap;
  margin:0;
}
.priority-controls .evidence-controls>select{grid-column:1/-1}
.priority-controls .evidence-controls>.difference-toggle{grid-column:auto;justify-content:flex-start}
.priority-controls .evidence-controls>.evidence-help{grid-column:1/-1}
@media(max-width:760px){.priority-controls .evidence-controls{grid-template-columns:1fr}.priority-controls .evidence-controls>.difference-toggle{grid-column:1}}
@media(max-width:1180px){
  .priority-controls .evidence-controls{grid-template-columns:auto minmax(200px,1fr)}
  .priority-controls .evidence-controls>.difference-toggle{grid-column:1/-1}
}
@media(max-width:760px){
  .priority-controls .language-picker,
  .priority-controls .evidence-controls{grid-template-columns:1fr}
  .priority-controls .language-picker>label,
  .priority-controls .language-picker>input,
  .priority-controls .language-picker>.clear-language,
  .priority-controls .language-picker>.language-help,
  .priority-controls .evidence-controls>label:first-child,
  .priority-controls .evidence-controls>select,
  .priority-controls .evidence-controls>.difference-toggle,
  .priority-controls .evidence-controls>.evidence-help{grid-column:1}
}

/* ===== technical-features-style ===== */
.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}
.unified-search{position:relative;flex:1 1 430px;min-width:min(100%,320px);z-index:9}
.unified-search>input{width:100%;box-sizing:border-box}
.unified-search-results{position:absolute;left:0;right:0;top:calc(100% + 5px);max-height:420px;overflow:auto;background:var(--panel);border:1px solid var(--line);border-radius:10px;box-shadow:0 16px 35px #0003;padding:6px;z-index:50}
.search-result{width:100%;display:grid;grid-template-columns:minmax(64px,auto) 1fr;gap:10px;text-align:left;align-items:center;border:0;border-radius:8px;background:transparent;color:var(--text);padding:9px 10px;cursor:pointer}
.search-result:hover,.search-result[aria-selected="true"]{background:var(--accent2);outline:2px solid var(--accent)}
.search-result strong{font-size:1.08rem}.search-result small{display:block;color:var(--muted);line-height:1.3}.search-result .result-type{font-size:.68rem;text-transform:uppercase;letter-spacing:.06em;color:var(--accent);font-weight:800}
.search-result-empty{padding:14px;color:var(--muted)}
.sym.search-match{outline:4px solid #d17500!important;outline-offset:3px;box-shadow:0 0 0 7px #ffd66b88}
.technical-toolbar{flex:1 0 100%;display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;padding-top:10px;border-top:1px solid var(--line)}
.technical-group{display:flex;gap:7px;flex-wrap:wrap}.technical-group button,.provenance-dialog button{border:1px solid var(--line);background:var(--panel);color:var(--text);border-radius:8px;padding:8px 11px;cursor:pointer;font-weight:650}.technical-group button:hover,.technical-group button:focus-visible,.provenance-dialog button:hover,.provenance-dialog button:focus-visible{border-color:var(--accent);outline:2px solid var(--accent2)}
.accessibility-options{display:flex;gap:12px;align-items:center;flex-wrap:wrap;border:1px solid var(--line);border-radius:9px;padding:7px 10px}.accessibility-options legend{font-size:.72rem;font-weight:800;color:var(--muted);padding:0 4px}.accessibility-options label{display:flex;gap:5px;align-items:center;font-size:.82rem;white-space:nowrap}.accessibility-options input[type=checkbox]{min-width:0;flex:none;width:18px;height:18px;margin:0}.technical-status{min-height:1.2em;color:var(--accent);font-size:.82rem;font-weight:650}
.provenance-dialog{width:min(960px,calc(100% - 28px));max-height:calc(100vh - 28px);border:1px solid var(--line);border-radius:14px;background:var(--panel);color:var(--text);padding:0;box-shadow:0 24px 70px #0006}.provenance-dialog::backdrop{background:#0008}.provenance-dialog form{padding:20px}.dialog-head{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;border-bottom:1px solid var(--line);padding-bottom:14px}.dialog-head h2{margin:0 0 5px}.dialog-head p{margin:0;color:var(--muted)}.provenance-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin-top:16px}.provenance-grid section{border:1px solid var(--line);border-radius:10px;padding:14px}.provenance-grid h3{margin:0 0 10px}.provenance-grid dl{display:grid;grid-template-columns:minmax(120px,.8fr) 1.6fr;gap:7px 12px;margin:0}.provenance-grid dt{font-weight:750}.provenance-grid dd{margin:0;color:var(--muted);overflow-wrap:anywhere}.provenance-grid code{font-size:.72rem;word-break:break-all}.provenance-note{color:var(--muted);font-size:.82rem}
body.high-contrast{--panel:#fff;--text:#000;--muted:#222;--line:#000;--accent:#000;--accent2:#fff}
body.high-contrast .sym{border-width:2px}body.high-contrast .sym.lang-present{background:#fff!important;border:4px solid #006400!important}body.high-contrast .sym.lang-variant{background:#fff!important;border:4px dashed #8a5100!important}body.high-contrast .sym.lang-attested{background:#fff!important;border:4px dotted #004d99!important}body.high-contrast .sym.lang-absent{background:#fff!important;border:4px double #8b0000!important}
body.large-symbols .sym span{font-size:1.85rem!important;line-height:1.1}body.large-symbols .sym{min-height:136px!important}
body.noncolor-cues .sym.lang-present::after,body.noncolor-cues .sym.lang-variant::after,body.noncolor-cues .sym.lang-attested::after,body.noncolor-cues .sym.lang-absent::after,body.noncolor-cues .sym.compare-shared::after,body.noncolor-cues .sym.compare-only-a::after,body.noncolor-cues .sym.compare-only-b::after,body.noncolor-cues .sym.compare-neither::after{position:absolute;top:3px;right:4px;font-size:.68rem;font-weight:900;line-height:1;background:var(--panel);border:1px solid currentColor;border-radius:4px;padding:2px 3px;z-index:2}
body.noncolor-cues .sym{position:relative}body.noncolor-cues .sym.lang-present::after{content:"G ✓"}body.noncolor-cues .sym.lang-variant::after{content:"A ~"}body.noncolor-cues .sym.lang-attested::after{content:"B ?"}body.noncolor-cues .sym.lang-absent::after{content:"R ×"}body.noncolor-cues .sym.compare-shared::after{content:"BOTH"}body.noncolor-cues .sym.compare-only-a::after{content:"1"}body.noncolor-cues .sym.compare-only-b::after{content:"2"}body.noncolor-cues .sym.compare-neither::after{content:"NONE"}
@media(max-width:760px){.provenance-grid{grid-template-columns:1fr}.provenance-grid dl{grid-template-columns:1fr}.technical-toolbar{align-items:stretch}.accessibility-options{width:100%}}
@media print{.technical-toolbar,.unified-search-results,.provenance-dialog{display:none!important}}

/* ===== drawer-scroll-quality-styles ===== */
/* The header (title + Close) stays fixed; everything below it scrolls in
   .drawer-body, so the scrollbar starts under the header, not beside it. */
.drawer{
  overflow:hidden !important;
}
.drawer-head{
  flex:none;
  background:var(--panel);
}
.drawer-body{
  flex:1;
  min-height:0;
  overflow-y:auto;
  overflow-x:hidden;
  overscroll-behavior:contain;
  scrollbar-gutter:stable;
  display:flex;
  flex-direction:column;
}
.drawer-body>.list{
  overflow:visible !important;
  flex:none !important;
  min-height:auto !important;
}
.quality-panel{margin:0 14px 14px;padding:12px;border:1px solid var(--line);border-radius:12px;background:var(--panel)}
.quality-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px}
.quality-head h3{margin:0;font-size:1rem}
.quality-grade{display:inline-flex;align-items:center;justify-content:center;min-width:72px;padding:5px 9px;border-radius:999px;font-size:.76rem;font-weight:800;border:1px solid var(--line);background:#f3f4f6;color:var(--text)}
.quality-grade.high{background:#e8f5eb;color:#245e31;border-color:#a8d5b1}
.quality-grade.medium{background:#fff4d8;color:#7a5200;border-color:#e8c46a}
.quality-grade.limited{background:#edf3fb;color:#315f8d;border-color:#b6cce6}
.quality-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.quality-metric{padding:9px;border:1px solid var(--line);border-radius:10px;background:var(--accent2);min-width:0}
.quality-metric b{display:block;color:var(--accent);font-size:1.02rem;overflow-wrap:anywhere}
.quality-metric small{display:block;color:var(--muted);font-size:.73rem;line-height:1.25;margin-top:2px}
.quality-details{margin:10px 0 0;color:var(--muted);font-size:.76rem;line-height:1.45}
@media (max-width:430px){.quality-grid{grid-template-columns:1fr}}

