/* Audapter Playground. The audit report's visual language: one serif (Charis SIL), paper and ink,
   input grey, expected = hollow ink, observed blue, discrepancy orange. Light and dark are chosen separately. */
@font-face { font-family: "Charis SIL"; src: url(fonts/charis-400-normal.woff2) format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Charis SIL"; src: url(fonts/charis-400-italic.woff2) format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Charis SIL"; src: url(fonts/charis-700-normal.woff2) format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Charis SIL"; src: url(fonts/charis-700-italic.woff2) format("woff2"); font-weight: 700; font-style: italic; font-display: swap; }

:root {
  color-scheme: light;
  --paper: #ffffff; --surface: #fcfcfb; --tint: #f3f5f7;
  --ink: #1d2530; --ink-2: #4a5563; --ink-3: #6f7985; --rule: #dde2e7; --rule-2: #c3cad2;
  --input: #aab2bb; --observed: #2a78d6; --on-observed: #ffffff; --context: #e8ebee;
  --disc: #eb6834; --disc-fill: rgba(235, 104, 52, 0.16); --disc-line: rgba(235, 104, 52, 0.55);
  --warn-bg: #fdf1ec; --err: #c62f2f;
  --serif: "Charis SIL", Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace;
  --r: 3px;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --paper: #15181c; --surface: #1a1d21; --tint: #20252b;
    --ink: #e7eaee; --ink-2: #b9c1ca; --ink-3: #8f99a4; --rule: #2e353d; --rule-2: #414a54;
    --input: #6b747e; --observed: #3987e5; --on-observed: #ffffff; --context: #2a3037;
    --disc: #d95926; --disc-fill: rgba(217, 89, 38, 0.24); --disc-line: rgba(217, 89, 38, 0.7);
    --warn-bg: #2a1d17; --err: #f06a6a;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #15181c; --surface: #1a1d21; --tint: #20252b;
  --ink: #e7eaee; --ink-2: #b9c1ca; --ink-3: #8f99a4; --rule: #2e353d; --rule-2: #414a54;
  --input: #6b747e; --observed: #3987e5; --on-observed: #ffffff; --context: #2a3037;
  --disc: #d95926; --disc-fill: rgba(217, 89, 38, 0.24); --disc-line: rgba(217, 89, 38, 0.7);
  --warn-bg: #2a1d17; --err: #f06a6a;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { font-size: 15px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--serif); line-height: 1.45; }
a { color: inherit; text-decoration-color: var(--observed); text-decoration-thickness: 1.5px; text-underline-offset: 2px; }
a:hover { color: var(--observed); }
:focus-visible { outline: 3px solid var(--observed); outline-offset: 2px; border-radius: 2px; }
code, .code { font-family: var(--mono); font-size: 0.84em; }
code { background: var(--tint); padding: 0.05em 0.3em; border-radius: var(--r); }
h1, h2, h3 { line-height: 1.2; margin: 0; }
.muted { color: var(--ink-3); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; background: var(--paper); padding: 6px 10px; z-index: 50; }
button, input, select, textarea { font: inherit; color: inherit; }

/* ---------- header */
.top { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: end; gap: 10px 28px; padding: 18px 24px 0; border-bottom: 1px solid var(--rule); }
.brand h1 { font-size: 1.7rem; letter-spacing: -0.012em; }
.dek { margin: 4px 0 12px; color: var(--ink-2); max-width: 66ch; }
.tabs { display: flex; gap: 2px; align-self: end; }
.tabs button, .viewtabs button[role=tab] { background: none; border: 0; border-bottom: 2px solid transparent; padding: 8px 12px 9px; cursor: pointer; color: var(--ink-2); font-size: 1rem; }
.tabs button[aria-selected=true], .viewtabs button[aria-selected=true] { color: var(--ink); border-bottom-color: var(--ink); font-weight: 700; }
.top-tools { display: flex; gap: 14px; align-items: center; padding-bottom: 10px; font-size: 0.87rem; }

/* ---------- three-column workbench */
.explore { display: grid; grid-template-columns: minmax(300px, 370px) minmax(0, 1fr) minmax(260px, 310px); align-items: start; }
.settings-col { border-right: 1px solid var(--rule); padding: 8px 20px 60px; }
.results-col { padding: 14px 24px 60px; min-width: 0; }
.trials-col { border-left: 1px solid var(--rule); padding: 14px 18px 60px; position: sticky; top: 0; max-height: 100vh; overflow: auto; }
@media (max-width: 1320px) {
  .explore { grid-template-columns: minmax(290px, 350px) minmax(0, 1fr); }
  .trials-col { grid-column: 2; border-left: 0; border-top: 1px solid var(--rule); position: static; max-height: none; padding: 14px 24px 60px; }
}
@media (max-width: 860px) {
  .top { grid-template-columns: 1fr; padding: 14px 14px 0; gap: 4px; }
  .top-tools { padding-bottom: 6px; flex-wrap: wrap; gap: 6px 14px; }
  #case-pick { flex: 1 1 100%; } #case-pick select { width: 100%; }
  .explore { grid-template-columns: minmax(0, 1fr); }
  .results-col { order: 1; padding: 12px 14px 20px; }
  .settings-col { order: 2; border-right: 0; border-top: 1px solid var(--rule); padding: 8px 14px 30px; }
  .trials-col { order: 3; grid-column: 1; padding: 12px 14px 40px; }
  .tabs button { padding: 6px 8px 8px; }
}

/* ---------- groups, cards, controls */
.grp { padding: 16px 0 14px; border-bottom: 1px solid var(--rule); }
.grp:last-child { border-bottom: 0; }
.grp-title { font-size: 1.12rem; font-weight: 700; margin: 0 0 2px; }
.grp-blurb { margin: 0 0 10px; color: var(--ink-2); font-size: 0.93rem; }
.presetrow { padding: 14px 0 12px; border-bottom: 1px solid var(--rule); }
.presetrow .grp-title { margin-bottom: 8px; }
.preset-note { margin: 8px 0 0; font-size: 0.87rem; color: var(--ink-2); }
.card { border-top: 1px solid var(--rule); padding: 9px 0 8px; }
.card:first-of-type { border-top: 0; }
.card-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.card-title { font-weight: 700; cursor: pointer; }
.card-sum { font-size: 0.87rem; color: var(--ink-3); text-align: right; font-variant-numeric: tabular-nums; }
.card.on .card-sum { color: var(--observed); }
.card-blurb { margin: 2px 0 0 44px; font-size: 0.87rem; color: var(--ink-3); }
.card.on .card-blurb { color: var(--ink-2); }
.card-body { margin: 6px 0 2px 44px; }
.ctl { padding: 6px 0; }
.ctl.changed .ctl-label::after { content: " (changed)"; color: var(--ink-3); font-weight: 400; font-size: 0.85em; }
.ctl-row { display: grid; grid-template-columns: minmax(96px, 128px) minmax(0, 1fr) auto; gap: 6px 10px; align-items: center; }
.ctl-row > :only-child, .ctl-row > .ctl-w:first-child { grid-column: 1 / -1; }
.ctl-label { font-size: 0.93rem; font-weight: 600; }
.ctl-w { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ctl-extra { display: flex; gap: 8px; font-size: 0.82rem; white-space: nowrap; }
.ctl-desc { margin: 3px 0 0; font-size: 0.84rem; color: var(--ink-3); line-height: 1.4; }
.unit { color: var(--ink-3); font-size: 0.87rem; white-space: nowrap; }
.slider { flex: 1; min-width: 60px; accent-color: var(--observed); }
input.num { width: 5.8em; padding: 3px 6px; border: 1px solid var(--rule-2); border-radius: var(--r); background: var(--paper); font-variant-numeric: tabular-nums; }
input.num.narrow { width: 3.8em; } input.num.wide { width: 12em; }
input[aria-invalid=true] { border-color: var(--err); }
select, input[type=text], input[type=search], textarea { padding: 4px 6px; border: 1px solid var(--rule-2); border-radius: var(--r); background: var(--paper); max-width: 100%; }
textarea.code { width: 100%; font-family: var(--mono); font-size: 0.82rem; }
.switch { appearance: none; -webkit-appearance: none; width: 34px; height: 20px; border-radius: 10px; background: var(--rule-2); position: relative; cursor: pointer; margin: 0; flex: none; transition: background 0.12s; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--paper); transition: left 0.12s; }
.switch:checked { background: var(--observed); }
.switch:checked::after { left: 16px; }
@media (prefers-reduced-motion: reduce) { .switch, .switch::after { transition: none; } }
.seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--rule-2); border-radius: var(--r); overflow: hidden; }
.seg button { border: 0; border-right: 1px solid var(--rule-2); background: var(--paper); padding: 4px 10px; cursor: pointer; color: var(--ink-2); }
.seg button:last-child { border-right: 0; }
.seg button[aria-checked=true], .seg button[aria-selected=true] { background: var(--ink); color: var(--paper); }
.presets { display: flex; } .presets button { flex: 1 1 auto; }
.choices { display: grid; gap: 4px; }
.choice { display: grid; grid-template-columns: auto 1fr; gap: 0 8px; align-items: baseline; cursor: pointer; padding: 3px 0; }
.choice input { margin: 0; accent-color: var(--ink); }
.choice-t { font-weight: 600; } .choice-d { grid-column: 2; font-size: 0.84rem; color: var(--ink-3); }
.region { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; }
.rg { display: flex; align-items: center; gap: 6px; } .rlab { min-width: 4em; font-size: 0.87rem; color: var(--ink-2); }
table.mini { border-collapse: collapse; font-size: 0.87rem; } table.mini th { text-align: left; font-weight: 600; color: var(--ink-2); padding: 2px 6px 2px 0; } table.mini td { padding: 2px 6px 2px 0; }
.painter-ctl { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.derived { font-size: 0.87rem; color: var(--ink-2); background: var(--tint); padding: 6px 9px; border-radius: var(--r); margin: 4px 0; }
.ostlink { margin-top: 6px; } .ostlink summary { cursor: pointer; font-size: 0.9rem; color: var(--ink-2); }
.ost-preview { font-family: var(--mono); font-size: 0.78rem; background: var(--tint); padding: 8px; border-radius: var(--r); overflow: auto; max-height: 240px; }
.sweep-box { display: grid; grid-template-columns: auto 1fr auto; gap: 6px 8px; align-items: center; margin: 6px 0 2px; padding: 8px; background: var(--tint); border-radius: var(--r); font-size: 0.9rem; }
.sweep-box .ctl-desc { grid-column: 1 / -1; }
.sweep-vals { min-width: 0; }
.grp-foot .btnrow { margin-top: 8px; }

/* buttons */
.btn { border: 1px solid var(--rule-2); background: var(--paper); border-radius: var(--r); padding: 4px 11px; cursor: pointer; color: var(--ink); white-space: nowrap; }
.btn:hover { border-color: var(--ink-3); }
.btn.primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn.primary:hover { background: var(--ink-2); }
.btn.big { padding: 6px 22px; font-size: 1.05rem; font-weight: 700; }
.btn[disabled], .linkish[disabled] { opacity: 0.45; cursor: default; }
.btn[aria-pressed=true] { box-shadow: inset 0 -3px 0 var(--observed); }
.linkish { background: none; border: 0; padding: 0; cursor: pointer; color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--rule-2); text-underline-offset: 2px; }
.linkish:hover { color: var(--observed); text-decoration-color: var(--observed); }
.btnrow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.icon { border: 1px solid var(--rule-2); background: var(--paper); border-radius: var(--r); width: 30px; height: 28px; cursor: pointer; font-size: 1.05rem; line-height: 1; }
.icon.wide { width: auto; padding: 0 9px; font-size: 0.9rem; }

/* warnings: glyph + word, never colour alone */
.warns:empty { display: none; }
.warns { display: grid; gap: 6px; margin: 8px 0 2px; }
.warn { display: grid; grid-template-columns: 12px auto auto 1fr; gap: 2px 7px; align-items: baseline; font-size: 0.85rem; line-height: 1.4; padding: 6px 9px; border-radius: var(--r); background: var(--tint); }
.warn .w-text { grid-column: 2 / -1; color: var(--ink); }
.w-lvl { font-weight: 700; } .w-id { font-family: var(--mono); font-size: 0.8rem; color: var(--ink-2); }
.w-glyph { width: 9px; height: 9px; display: inline-block; align-self: center; }
.w-info .w-glyph { border-radius: 50%; border: 1.5px solid var(--ink-3); }
.w-warn { background: var(--warn-bg); box-shadow: inset 3px 0 0 var(--disc); }
.w-warn .w-glyph { background: var(--disc); transform: rotate(45deg) scale(0.85); }
.w-error { background: var(--warn-bg); box-shadow: inset 3px 0 0 var(--err); }
.w-error .w-glyph { background: var(--err); clip-path: polygon(50% 0, 100% 100%, 0 100%); }

/* ---------- input + run */
.input-panel { padding-bottom: 10px; border-bottom: 1px solid var(--rule); }
.src-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-bottom: 8px; }
.src-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.src-row select { max-width: 100%; }
.input-info { margin: 8px 0 0; font-size: 0.9rem; color: var(--ink-2); }
.syn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px 16px; margin-bottom: 8px; }
.syn { display: flex; align-items: center; gap: 8px; font-size: 0.93rem; } .syn > span:first-child { min-width: 5.5em; color: var(--ink-2); }
.meter { width: 140px; height: 8px; background: var(--tint); border-radius: 4px; overflow: hidden; }
.meter-fill { height: 100%; width: 0; background: var(--observed); }
.rec { min-width: 6em; }
.runbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 12px 0 6px; }
.auto { font-size: 0.93rem; display: flex; align-items: center; gap: 6px; }
.progress { width: 140px; height: 6px; background: var(--tint); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: var(--observed); }
#run-status { font-size: 0.9rem; }
.sticky-tools { position: sticky; top: 0; z-index: 5; background: var(--paper); border-bottom: 1px solid var(--rule); padding-top: 6px; }
.transport { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 4px 0 8px; }
.tp-opt { font-size: 0.9rem; display: flex; align-items: center; gap: 5px; }
.tp-note { flex-basis: 100%; margin: 0; font-size: 0.84rem; }
.tp-note:empty { display: none; }
.tp-loud { flex-basis: 100%; }
.viewtabs { display: flex; flex-wrap: wrap; align-items: end; gap: 2px; }
.viewtabs .zoom { margin-left: auto; display: flex; gap: 4px; padding-bottom: 5px; }
.view { padding-top: 12px; }
.trial-title { margin: 0 0 8px; font-size: 0.95rem; }
.hint { font-size: 0.84rem; color: var(--ink-3); margin: 6px 0 0; }
.empty { color: var(--ink-2); padding: 30px 0; max-width: 56ch; }
.numbers details { margin-top: 14px; font-size: 0.9rem; }
.numbers summary { cursor: pointer; color: var(--ink-2); }
table.plain { border-collapse: collapse; font-size: 0.9rem; font-variant-numeric: tabular-nums; }
table.plain th, table.plain td { text-align: left; vertical-align: top; padding: 5px 14px 5px 0; border-bottom: 1px solid var(--rule); }
table.plain th { font-weight: 600; }
.tscroll { overflow-x: auto; }

/* ---------- tiers (TextGrid style) */
.tiers { position: relative; }
.tiers-plot { position: relative; touch-action: pan-y; cursor: crosshair; user-select: none; -webkit-user-select: none; }
.tier { display: grid; grid-template-columns: var(--lw) minmax(0, 1fr); border-top: 1px solid var(--rule); }
.tier:first-child { border-top: 1px solid var(--rule-2); }
.tier-lab { padding: 4px 10px 4px 0; overflow: hidden; }
.tl-name { font-weight: 700; font-size: 0.9rem; line-height: 1.2; }
.tl-sub { font-size: 0.78rem; color: var(--ink-3); line-height: 1.25; }
.tl-keys { display: flex; flex-direction: column; gap: 1px; margin-top: 3px; font-size: 0.76rem; color: var(--ink-2); }
.tier-c { display: block; }
.tiers.narrow .tier { grid-template-columns: minmax(0, 1fr); position: relative; }
.tiers.narrow .tier-lab { position: absolute; left: 0; top: 0; z-index: 2; background: color-mix(in srgb, var(--paper) 82%, transparent); padding: 2px 6px; border-radius: 0 0 var(--r) 0; pointer-events: none; }
.tiers.narrow .tl-sub, .tiers.narrow .tl-keys { display: none; }
.hair, .cursor, .playhead { position: absolute; top: 0; bottom: 0; width: 0; pointer-events: none; }
.hair { border-left: 1px solid var(--ink-3); opacity: 0.7; }
.cursor { border-left: 1.5px solid var(--ink); }
.playhead { border-left: 2px solid var(--observed); }
.axis-row { display: grid; grid-template-columns: var(--lw) minmax(0, 1fr); align-items: start; }
.axis-lab { font-size: 0.78rem; color: var(--ink-3); padding-top: 4px; }
.tiers.narrow .axis-row { grid-template-columns: minmax(0, 1fr); } .tiers.narrow .axis-lab { display: none; }
canvas.axis { display: block; }
.tip { position: absolute; z-index: 20; background: var(--paper); border: 1px solid var(--rule-2); border-radius: var(--r); padding: 6px 9px; font-size: 0.82rem; pointer-events: none; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12); min-width: 170px; font-variant-numeric: tabular-nums; }
.tip-t { color: var(--ink-3); margin-bottom: 2px; }
.tip-r { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.tip-r b { font-weight: 700; }
/* legend keys: the mark, not the text, carries the colour */
.lk { display: inline-flex; align-items: center; gap: 5px; margin-right: 12px; white-space: nowrap; }
.key { display: inline-block; width: 16px; height: 8px; flex: none; }
.k-obs { border-top: 2px solid var(--observed); height: 0; margin-top: 2px; }
.k-in { border-top: 2px solid var(--input); height: 0; }
.k-ref { border-top: 1px solid var(--ink-2); height: 0; }
.k-exp { height: 6px; border: 1.5px solid var(--ink); border-radius: 3px; background: var(--paper); }
.k-obsdot { width: 7px; height: 7px; border-radius: 50%; background: var(--observed); }
.k-indot, .k-input { width: 7px; height: 7px; border-radius: 50%; background: var(--input); }
.k-arrow { border-top: 1px solid var(--ink-3); height: 0; position: relative; }
.k-arrow::after { content: ""; position: absolute; right: -1px; top: -4px; border: 3.5px solid transparent; border-left: 5px solid var(--ink-3); }
.k-none { width: 0; }
.legend-row { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; font-size: 0.84rem; margin: 0 0 8px; color: var(--ink-2); }

/* ---------- vowel space */
.vs-wrap { position: relative; }
svg.vspace { display: block; max-width: 100%; height: auto; font-family: var(--serif); background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r); }
svg.vspace .grid { stroke: var(--rule); stroke-width: 1; }
svg.vspace text { fill: var(--ink-3); font-size: 12px; }
svg.vspace .ax-lab { fill: var(--ink-2); font-size: 13px; }
svg.vspace .vs-ipa { font-size: 19px; fill: var(--ink-3); cursor: pointer; opacity: 0.8; }
svg.vspace .vs-ipa:hover, svg.vspace .vs-ipa:focus { fill: var(--ink); opacity: 1; }
.vs-arrow { stroke: var(--ink-3); stroke-width: 1.1; fill: none; opacity: 0.75; }
.vs-cell { fill: var(--context); stroke: var(--rule-2); stroke-width: 0.5; }
.vs-in { fill: var(--input); }
.vs-out { fill: var(--observed); }
.vs-tgt { fill: var(--paper); stroke: var(--ink); stroke-width: 1.3; }
.vs-in.m, .vs-out.m { stroke: var(--paper); stroke-width: 2; }
.vs-tgt.m { stroke-width: 2.5; }
.vs-mean-arrow { stroke: var(--ink); stroke-width: 2; fill: none; }
.vs-headring { fill: none; stroke: var(--ink); stroke-width: 2; }
svg.vspace .vs-empty { font-size: 15px; fill: var(--ink-2); }
svg.vspace.painting { cursor: cell; touch-action: none; }
.paint-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 0 0 10px; padding: 8px; background: var(--tint); border-radius: var(--r); }
.paint-tools .syn > span:first-child { min-width: 0; }

/* ---------- compare */
.cmp-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-bottom: 10px; }
.cmp-head p { margin: 0; flex-basis: 100%; }
.ab { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 10px; background: var(--tint); border-radius: var(--r); margin-bottom: 10px; font-size: 0.93rem; }
.ab-lab { font-weight: 700; } .ab select { max-width: 16em; } .ab .muted { flex-basis: 100%; font-size: 0.84rem; }
details.diff { margin: 4px 0 14px; } details.diff summary { cursor: pointer; font-weight: 600; margin-bottom: 4px; }
.diff-t td, .diff-t th { white-space: nowrap; }
.smult { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px 22px; }
figure.sm { margin: 0; min-width: 0; }
figure.sm figcaption { font-size: 0.87rem; margin-bottom: 4px; line-height: 1.3; }
.timeline-note { font-size: 0.93rem; color: var(--ink-2); max-width: 70ch; }

/* ---------- trials list */
.tl-head { display: grid; grid-template-columns: 1fr; gap: 6px; }
.count { font-weight: 400; color: var(--ink-3); font-size: 0.95rem; }
.filter { width: 100%; }
.tl-actions { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin: 8px 0; font-size: 0.9rem; }
.tl-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.tl-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: start; padding: 7px 0; border-bottom: 1px solid var(--rule); }
.tl-item input { margin-top: 4px; accent-color: var(--ink); }
.tl-item.current { box-shadow: inset 3px 0 0 var(--observed); padding-left: 6px; background: var(--tint); }
.tl-open { all: unset; cursor: pointer; display: flex; flex-wrap: wrap; gap: 2px 6px; align-items: baseline; min-width: 0; }
.tl-open:focus-visible { outline: 3px solid var(--observed); }
.tl-name { font-weight: 700; }
.tl-sum { flex-basis: 100%; font-size: 0.87rem; color: var(--ink-2); }
.tl-inp { flex-basis: 100%; font-size: 0.8rem; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge { font-size: 0.74rem; border: 1px solid var(--rule-2); border-radius: 8px; padding: 0 6px; color: var(--ink-2); }
.badge.draft { border-style: dashed; }
.badge.err { border-color: var(--err); color: var(--err); }
.badge.val { background: var(--tint); }
.keep { font-size: 0.87rem; }
.tl-edit { margin: 10px 0; font-size: 0.9rem; } .tl-edit summary { cursor: pointer; color: var(--ink-2); }
.tl-edit-grid { display: grid; gap: 6px; margin: 8px 0; } .tl-edit-grid textarea { width: 100%; }
.tl-io { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 0.87rem; margin-top: 10px; }
.tl-io .muted { flex-basis: 100%; }

/* ---------- parameters tab */
.params-panel { max-width: 1280px; margin: 0 auto; padding: 8px 24px 80px; }
.pt-tools { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin: 8px 0; font-size: 0.93rem; }
.pt-tools .filter { width: 18em; }
table.params { width: 100%; }
table.params td { font-size: 0.87rem; }
table.params tr.changed td:first-child { box-shadow: inset 3px 0 0 var(--observed); padding-left: 6px; }
.p-val { font-family: var(--mono); font-size: 0.8rem !important; max-width: 18em; word-break: break-word; }
.p-err { color: var(--err); font-size: 0.82rem; } .p-err:empty { display: none; }
.p-help { max-width: 46ch; } .p-note { margin-top: 3px; font-size: 0.84rem; box-shadow: inset 3px 0 0 var(--disc); padding-left: 8px; }
.ost-ed h3 { font-size: 1rem; margin: 16px 0 6px; }
.ost-dwrap { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r); padding: 4px; }
svg.ost-diagram { display: block; font-family: var(--serif); }
.ost-edge { stroke: var(--ink-2); stroke-width: 1.4; fill: none; } .ost-edge.ioi { stroke-dasharray: 0; stroke: var(--ink-3); }
.ah { fill: var(--ink-2); }
.ost-elab { fill: var(--ink-2); font-size: 12px; }
.ost-node { fill: var(--paper); stroke: var(--ink); stroke-width: 1.5; }
.ost-node.pert { stroke-width: 3.5; }
.ost-node.missing { stroke: var(--disc); stroke-width: 2.5; }
.ost-nlab { fill: var(--ink); font-size: 14px; font-weight: 700; }
.ost-plab { fill: var(--ink); font-size: 12px; } .ost-plab.bad { fill: var(--disc); }
table.rules select { max-width: 17em; }
.rule-d { font-size: 0.84rem; max-width: 40ch; }
table.pcf tr.missing td { background: var(--disc-fill); }
.ost-text summary { cursor: pointer; margin: 14px 0 6px; font-weight: 600; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 860px) { .two { grid-template-columns: 1fr; } .params-panel { padding: 8px 14px 60px; } }

/* ---------- about, toasts */
.about { padding: 10px 24px 80px; }
.prose { max-width: 70ch; } .prose h2 { font-size: 1.25rem; margin: 1.6rem 0 0.4rem; } .prose p, .prose li { line-height: 1.55; }
.toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 100; max-width: min(460px, calc(100vw - 32px)); }
.toast { background: var(--ink); color: var(--paper); padding: 9px 13px; border-radius: var(--r); font-size: 0.92rem; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2); }
.toast.t-error { background: var(--paper); color: var(--ink); border: 1px solid var(--err); box-shadow: inset 4px 0 0 var(--err), 0 4px 16px rgba(0, 0, 0, 0.2); }
.noscript { padding: 20px; }
@media (forced-colors: active) { .switch:checked { background: Highlight; } .w-warn, .w-error { border: 1px solid CanvasText; } }
@media print { .settings-col, .trials-col, .transport, .runbar, .top-tools { display: none; } .explore { display: block; } }
/* control rows: label | widget; description with sweep / reset links underneath */
.ctl-row { grid-template-columns: minmax(96px, 124px) minmax(0, 1fr); }
.ctl.stacked .ctl-row { grid-template-columns: 1fr; }
.ctl-foot { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.ctl-foot .ctl-desc { flex: 1; }
.seg { flex-wrap: nowrap; }
.seg button { padding: 4px 8px; white-space: nowrap; }
.presets { display: grid; grid-template-columns: 1fr 1fr; }
.presets button { border-bottom: 1px solid var(--rule-2); }
.presets button:nth-child(2n) { border-right: 0; }
.presets button:nth-last-child(-n+2) { border-bottom: 0; }
.ctl-row { grid-template-columns: minmax(90px, 112px) minmax(0, 1fr); }
.ctl-w input.num { width: 4.8em; }
.trials-col { min-width: 0; }
.trials-col select, .trials-col input[type=search] { width: 100%; min-width: 0; }
.vs-arrow { opacity: 0.5; }
.vs-line { fill: none; stroke: var(--input); stroke-width: 1.5; stroke-linejoin: round; }

/* ---------- Timing & design tab */
.design-panel { max-width: 1180px; margin: 0 auto; padding: 8px 24px 80px; }
.dz-head { padding: 16px 0 8px; }
.dz-title { font-size: 1.35rem; margin-bottom: 4px; }
.dz-status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 0.93rem; padding: 7px 10px; border-radius: var(--r); background: var(--tint); }
.dz-status.on { box-shadow: inset 3px 0 0 var(--observed); }
.dz-sec { padding: 14px 0; border-top: 1px solid var(--rule); }
.dz-sec h3 { font-size: 1.05rem; margin: 0 0 8px; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.tpl { display: grid; grid-template-rows: auto auto; gap: 4px; justify-items: start; text-align: left; border: 1px solid var(--rule-2); border-radius: var(--r); background: var(--paper); padding: 8px 10px; cursor: pointer; }
.tpl:hover { border-color: var(--ink-3); }
.tpl[aria-pressed=true] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.tpl-l { font-size: 0.92rem; font-weight: 600; line-height: 1.25; }
.tpl-sk { width: 64px; height: 22px; }
.sk-voice { fill: var(--input); }
.sk-on { fill: var(--paper); stroke: var(--ink); stroke-width: 1.4; }
.tpl-ctl { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 8px; }
.tpl-ctl .syn > span:first-child { min-width: 0; }
.dz-timeline .tiers { margin-top: 4px; }
.k-disc { width: 14px; height: 10px; background: var(--disc-fill); border-top: 2px solid var(--disc); }
ol.blocks { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
li.block { border: 1px solid var(--rule); border-radius: var(--r); padding: 8px 10px; display: grid; gap: 6px; }
.b-when { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: 0.93rem; }
.b-what { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; font-size: 0.93rem; }
.b-what .syn > span:first-child { min-width: 0; }
.refsel { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.refsel select { max-width: 17em; }
.dz-det summary, .dz-adv summary { cursor: pointer; font-weight: 600; }
.dz-adv .grp { border-bottom: 0; }
.sch-clips { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 2px 12px; font-size: 0.87rem; margin: 4px 0 8px; max-height: 180px; overflow: auto; border: 1px solid var(--rule); padding: 6px; border-radius: var(--r); }
.sched .btnrow { margin: 6px 0; }
svg.sched-svg { display: block; width: 100%; height: auto; font-family: var(--serif); background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r); }
.sched-svg .grid { stroke: var(--rule); }
.sched-svg .ax { fill: var(--ink-3); font-size: 11px; }
.sched-svg .sp-on { fill: var(--paper); stroke: var(--ink); stroke-width: 1.2; }
.sched-svg .sp-off { fill: var(--context); }
.sched-svg .sp-lab { fill: var(--ink); font-size: 12px; }
.sched-svg .sp-div { stroke: var(--rule-2); }
.sd-prod { fill: var(--input); }
.sd-heard { fill: var(--paper); stroke: var(--ink); stroke-width: 1.5; }
.sd-meas { fill: var(--observed); stroke: var(--paper); stroke-width: 1; }
.expert-link { margin: 14px 0 0; font-size: 0.9rem; }
dialog.expert { width: min(1200px, 96vw); max-height: 92vh; border: 1px solid var(--rule-2); border-radius: var(--r); background: var(--paper); color: var(--ink); padding: 8px 20px 20px; }
dialog.expert::backdrop { background: rgba(0, 0, 0, 0.35); }
.dlg-head { position: sticky; top: 0; display: flex; justify-content: flex-end; background: var(--paper); padding: 6px 0; z-index: 2; }
@media (max-width: 860px) { .design-panel { padding: 8px 14px 60px; } .tpl-grid { grid-template-columns: 1fr 1fr; } }
/* vowel variability: centre, tokens, ellipses, stairs */
.vs-cross { stroke: var(--ink); stroke-width: 2; }
svg.vspace .vs-clab { fill: var(--ink); font-size: 12px; }
.vs-region { fill: none; stroke: var(--rule-2); stroke-width: 1; }
.vs-ell-s { fill: var(--input); fill-opacity: 0.18; stroke: var(--input); stroke-width: 1.5; }
.vs-ell-h { fill: none; stroke: var(--ink); stroke-width: 1.5; }
.vs-ell-m { fill: none; stroke: var(--observed); stroke-width: 1.5; }
.vs-tok-line { stroke: var(--ink-3); stroke-width: 1; }
figure.stairs { margin: 12px 0 0; font-size: 0.87rem; color: var(--ink-2); max-width: 600px; }
svg.vs-stairs { display: block; font-family: var(--serif); background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r); margin-top: 4px; }
.vs-stairs text { fill: var(--ink-3); font-size: 11px; }
.vs-stairs .grid { stroke: var(--rule); }
.st-applied { fill: none; stroke: var(--observed); stroke-width: 2; }
.st-intended { fill: none; stroke: var(--ink); stroke-width: 1; }
table.tok-num { margin-top: 10px; }
details.cloud { margin: 10px 0 4px; border-top: 1px solid var(--rule); padding-top: 8px; }
details.cloud summary { cursor: pointer; font-weight: 600; }
svg.vspace .vs-clab { paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round; }
.card.ext .ctl:not([data-path='shift.formant.units']) { display: none; }
.ext-note { margin: 4px 0; }

/* ---------- Test cases tab */
ul.case-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px 16px; }
.case-item { border: 1px solid var(--rule); border-radius: var(--r); padding: 8px 10px; display: grid; gap: 3px; font-size: 0.92rem; }
.case-item.current { border-color: var(--ink); box-shadow: inset 3px 0 0 var(--observed); }
.ci-head { display: flex; align-items: center; gap: 10px; }
.ci-id { font-weight: 700; font-size: 0.9rem; }
.ci-card { margin-left: auto; font-size: 0.85rem; }
.ci-t { font-weight: 600; } .ci-s { color: var(--ink-2); font-size: 0.87rem; }
.case-view h4 { margin: 16px 0 6px; font-size: 1rem; }
.setsum { display: grid; grid-template-columns: max-content 1fr; gap: 3px 14px; font-size: 0.9rem; margin: 6px 0; }
.setsum dt { color: var(--ink-3); } .setsum dd { margin: 0; }
td.case-ops { font-family: var(--mono); font-size: 0.75rem; color: var(--ink-3); max-width: 28em; }
table.case-cmp tr.bad td { background: var(--disc-fill); }
.res-pass { color: var(--pass, #0a7d0a); } .res-fail { color: var(--err); }

/* ---------- test case banner (Explore) */
.case-banner { border: 1px solid var(--ink); border-radius: var(--r); padding: 10px 12px; margin: 0 0 12px; background: var(--surface); box-shadow: inset 4px 0 0 var(--observed); }
.cb-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.cb-id { font-family: var(--mono); font-weight: 700; font-size: 0.9rem; }
.cb-card { margin-left: auto; font-size: 0.9rem; }
.cb-key { margin: 4px 0 8px; font-size: 0.93rem; color: var(--ink-2); }
.cb-trial { margin: 8px 0 0; font-size: 0.86rem; color: var(--ink-2); }
.cb-trial.varies { box-shadow: inset 3px 0 0 var(--disc); padding-left: 8px; }
.cb-edit { margin-top: 8px; font-size: 0.9rem; } .cb-edit summary { cursor: pointer; color: var(--ink-2); }
#case-pick select { max-width: 17em; font-size: 0.87rem; }
.case-summary { border-bottom: 1px solid var(--rule); padding-bottom: 12px; margin-bottom: 14px; }
.case-summary h3 { font-size: 1.05rem; margin: 4px 0; }
@media (max-width: 860px) { .cb-card { margin-left: 0; } #case-pick select { max-width: 100%; } }
.card-head { grid-template-columns: auto auto minmax(0, 1fr); }
.card-sum { overflow-wrap: anywhere; line-height: 1.3; }
/* test cases in the trial list and the side-by-side view */
.case-head { list-style: none; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 10px; padding: 10px 0 4px; border-bottom: 1px solid var(--ink); font-size: 0.9rem; }
.case-head .muted { font-size: 0.84rem; overflow-wrap: anywhere; }
.case-row .tl-open { min-width: 0; }
.case-k { font-family: var(--mono); font-size: 0.82rem; color: var(--ink-2); }
.case-tog { align-self: center; }
.case-tog button { font-size: 0.8rem; padding: 3px 7px; }
.badge.key { border-color: var(--disc); color: var(--ink); }
.cb-means { margin: 0 0 8px; font-size: 0.88rem; color: var(--ink-2); }
.pair-head { margin: 0 0 8px; }
.pair-title { font-size: 1.02rem; margin: 2px 0 6px; font-weight: 600; }
.pair-title .cb-id { margin-right: 6px; }
.pair-callout { margin: 0 0 8px; padding: 6px 10px; border-left: 4px solid var(--disc); background: var(--disc-fill); display: flex; gap: 8px; align-items: baseline; }
.pair-means { font-size: 0.86rem; margin: 6px 0 4px; }
.pair-play { margin: 0; }
@media (max-width: 860px) { .case-row { grid-template-columns: auto minmax(0, 1fr); } .case-row .case-tog { grid-column: 2; justify-self: start; } }
details.cb-trial summary { cursor: pointer; }
.pair-callout.same { border-left-color: var(--rule-2); background: var(--tint); }
.cb-sets { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 4px 0 2px; font-size: 0.9rem; }
.cb-input { font-size: 0.84rem; }
.cb-sets .seg { flex-wrap: wrap; }
.cb-sets .seg button { border-bottom: 1px solid var(--rule-2); margin-bottom: -1px; }
