/* Uncanny Listening — page layout on the darkstyle tokens (dark / light / paper) */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body { background: var(--ds-bg); color: var(--ds-txt); font: var(--ds-font-size) var(--ds-font-ui); background-image: var(--ds-grain); display: flex; flex-direction: column; overflow: hidden; }
.k { color: var(--ds-dim); }
.small { font-size: 11px; }
.dim { opacity: .8; }
.grow { flex: 1; }
b { color: var(--ds-txt-hi); font-weight: 600; }
h4 { color: var(--ds-dim); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; font-weight: normal; margin: 14px 0 6px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.dot.ring { box-shadow: 0 0 0 1.4px var(--ds-txt-hi); margin-right: 4px; }

/* header (as re-wilding's: the name, ⓘ, what there is, a status chip) */
#top { display: flex; align-items: center; gap: 12px; height: 46px; padding: 0 14px; background: var(--ds-panel); border-bottom: 1px solid var(--ds-line); flex: none; }
.brand { font-weight: 700; color: var(--ds-txt-hi); letter-spacing: .12em; }
.info-i { color: var(--ds-dim); text-decoration: none; font-size: 15px; } .info-i:hover { color: var(--ds-txt-hi); }
#count { font-size: 12px; }
#chip { font-size: 11px; padding: 3px 9px; border-radius: 11px; border: 1px solid var(--ds-ctl-line); display: flex; align-items: center; gap: 6px; max-width: 46ch; }
#chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ds-dim); flex: none; }
#chiptext { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#chip.wait { color: var(--ds-cur-txt); } #chip.wait::before { background: var(--ds-cur); }
#chip.ok { color: var(--ds-ok); } #chip.ok::before { background: var(--ds-ok); }
#chip.ready::before { background: var(--ds-ok-line); }

/* controls */
.btn { background: var(--ds-ctl); color: var(--ds-txt); border: 1px solid var(--ds-ctl-line); border-radius: 4px; padding: 5px 10px; font: inherit; cursor: pointer; }
.btn:hover:not(:disabled) { border-color: var(--ds-ctl-line-hi); background: var(--ds-ctl-hover); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.on { background: var(--ds-cur); color: var(--ds-on-cur); border-color: var(--ds-cur-line); }
.btn.sm { padding: 2px 7px; font-size: 12px; }
.btn.big { padding: 9px 18px; font-size: 14px; }
.seg { display: inline-flex; gap: 2px; flex-wrap: wrap; }
.seg.wide .btn { flex: 1; }
.seg.wide { display: flex; }
.ds-looks { display: inline-flex; gap: 2px; }
input[type=range] { accent-color: var(--ds-accent); width: 100%; }
input[type=number] { width: 4em; background: var(--ds-ctl); color: var(--ds-txt); border: 1px solid var(--ds-ctl-line); border-radius: 3px; font: inherit; padding: 1px 4px; }
.row { display: flex; gap: 8px; align-items: center; margin: 10px 0; flex-wrap: wrap; }

/* body: the perceptual legend (left) · the workspace · the controls (right) · the Live panel (far right) */
#app { flex: 1; display: flex; min-height: 0; position: relative; }
/* #side does not scroll (its edge tab sits outside its box and would be clipped, Miguel 10-28); #sidein scrolls */
#side { position: relative; width: 268px; flex: none; background: var(--ds-panel); border-left: 1px solid var(--ds-line); display: flex; flex-direction: column; min-height: 0; }
#sidein { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 12px 20px; }
body.side-closed #side { width: 0; border: 0; }
body.side-closed #sidein { display: none; }
/* edge tabs (re-wilding's idiom): vertical, on the panel's edge — hide · i on the controls, legend · L on the left */
.edgetab { writing-mode: vertical-rl; font: inherit; font-size: 10px; letter-spacing: .14em; color: var(--ds-dim); background: var(--ds-panel); cursor: pointer;
  border: 1px solid var(--ds-line); padding: 10px 3px; z-index: 6; }
.edgetab:hover, .edgetab.on { color: var(--ds-txt-hi); }
#sidetab { position: absolute; left: -21px; top: 50%; transform: translateY(-50%); border-right: 0; border-radius: 5px 0 0 5px; }
/* the INFORMATION section: pinned above the tabs, collapsible */
.sec-h { display: flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; padding: 2px 2px 8px; color: var(--ds-dim); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; }
.sec-h:hover { color: var(--ds-txt); }
.sec-chev { margin-left: auto; font-size: 10px; opacity: .7; transition: transform .18s ease; }
.sec.closed .sec-chev { transform: rotate(-90deg); } .sec.closed .sec-b { display: none; }
#infosec { border-bottom: 1px solid var(--ds-line); padding-bottom: 8px; }
#info { min-height: 60px; }
#info .title { color: var(--ds-txt-hi); font-weight: 600; margin-bottom: 6px; word-break: break-word; }
#info .kv { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; }
#strip { display: flex; flex-wrap: wrap; gap: 1px; margin-top: 4px; }
#strip i { width: 9px; height: 16px; cursor: pointer; border-radius: 1px; opacity: .9; }
#strip i:hover { outline: 1px solid var(--ds-ring); }
#strip i.on { outline: 2px solid var(--ds-ring); opacity: 1; }
/* the tab strip: VIEW · LENS · SOUND · TRACE, sticky (re-wilding's panel.js) */
#tabs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; position: sticky; top: -12px; z-index: 2; background: var(--ds-panel); padding: 10px 0; }
.stab { font: inherit; font-size: 10px; letter-spacing: .02em; padding: 5px 2px; cursor: pointer; border: 1px solid var(--ds-line); border-radius: 6px; background: var(--ds-panel); color: var(--ds-dim); text-align: center; white-space: nowrap; overflow: hidden; }
.stab:hover { color: var(--ds-txt); border-color: var(--ds-ctl-line-hi); }
.stab.on { color: var(--ds-cur-txt); border-color: var(--ds-cur-line); background: var(--ds-ctl); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; margin: 2px 0 4px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; }
.grid2 .btn, .grid3 .btn { padding: 4px 4px; }
select.wide { width: 100%; margin-bottom: 4px; background: var(--ds-ctl); color: var(--ds-txt); border: 1px solid var(--ds-ctl-line); border-radius: 4px; font: inherit; padding: 3px; }
#looks .btn { flex: 1; } #looks { display: flex; gap: 2px; }
.cls { display: flex; gap: 8px; align-items: baseline; padding: 3px 0; flex-wrap: wrap; }
#bar { height: 3px; background: var(--ds-line); margin: 6px 0; }
#bar i { display: block; height: 100%; width: 0; background: var(--ds-cur); transition: width .3s; }
#status { min-height: 1.4em; font-size: 12px; }
#errors { font-size: 11px; max-height: 120px; overflow: auto; }
#tracelist { padding-left: 22px; margin: 6px 0; font-size: 12px; }
#tracelist li { cursor: pointer; }
#tracelist li:hover { color: var(--ds-txt-hi); }

#work { flex: 1; position: relative; overflow: auto; padding: 12px 16px 24px; min-height: 0; }
.empty { max-width: 560px; margin: 12vh auto; text-align: center; }
.empty h1 { font-family: var(--ds-font-display); font-weight: var(--ds-display-weight); color: var(--ds-txt-hi); font-size: 22px; }
.empty p { line-height: 1.55; }
#maps { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; }
figure.map { margin: 0; background: var(--ds-panel); border: 1px solid var(--ds-line); border-radius: 4px; padding: 6px; }
figure.map figcaption { font-size: 12px; margin: 0 0 4px 4px; }
.mapsvg { display: block; }
.mapsvg .frame { fill: var(--ds-map-bg); stroke: var(--ds-line); }
.mapsvg .axes text { fill: var(--ds-label); font: 10px var(--ds-font-ui); }
.mapsvg .axes path, .mapsvg .axes line { stroke: var(--ds-axis); }
.mapsvg .axlabel { fill: var(--ds-dim); font-size: 10px; }
.mapsvg .pts circle { cursor: pointer; }
.mapsvg .trace, .mapsvg .top, .mapsvg .field { pointer-events: none; }
.mapsvg .trace path { fill: none; stroke: var(--ds-brush); stroke-width: 1.5; }
.mapsvg .trace text { fill: var(--ds-brush); font: 10px var(--ds-font-ui); }
.mapsvg .ring { fill: none; stroke: var(--ds-ring); stroke-width: 1.6; }
.mapsvg .ring.hov { stroke-dasharray: 2 2; }
.mapsvg .bound { fill: none; stroke: var(--ds-txt-hi); stroke-width: 1.4; }
.mapsvg .toolov { fill: transparent; pointer-events: none; }
.mapsvg.armed .toolov { pointer-events: all; cursor: crosshair; }
.mapsvg .trail { fill: none; stroke: var(--ds-brush); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.mapsvg .trail.closed { fill: var(--ds-brush); fill-opacity: .08; stroke-dasharray: 4 3; }
/* the minimal key under the maps (re-wilding's #axkey: one line, plain words) */
#workcol { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
#mapkey { flex: none; display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: center; padding: 6px 16px 8px; background: var(--ds-bg); font-size: 12px; color: var(--ds-label); border-top: 1px solid var(--ds-line); }
#mapkey .line { display: inline-block; width: 16px; height: 0; border-top: 1.5px solid var(--ds-txt-hi); margin-right: 6px; vertical-align: 3px; }
#tip { position: absolute; z-index: 6; pointer-events: none; background: var(--ds-pop); border: 1px solid var(--ds-pop-line); box-shadow: var(--ds-pop-shadow); border-radius: 4px; padding: 6px 9px; font-size: 12px; max-width: 260px; }

#live { width: 280px; flex: none; background: var(--ds-panel); border-left: 1px solid var(--ds-line); padding: 10px 14px; overflow-y: auto; }

/* the configuration dock: folders and analysis · features and processing · outputs */
#dock { flex: none; background: var(--ds-panel); border-top: 1px solid var(--ds-line); font-size: 12px; }
#dockbtn { background: none; border: 0; font: inherit; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; padding: 5px 14px; cursor: pointer; color: var(--ds-dim); }
#dockbtn:hover { color: var(--ds-txt); }
#dock:not(.open) #dockbtn .sec-chev { transform: rotate(180deg); }
#dockbody { display: grid; grid-template-columns: minmax(260px, 1.2fr) minmax(240px, 1fr) minmax(220px, .9fr); gap: 4px 28px; padding: 0 14px 10px; max-height: 42vh; overflow: auto; line-height: 1.55; }
.dcol h4:first-child { margin-top: 2px; }
/* the PERCEPTUAL LEGEND, docked on the left (re-wilding's legend.js) */
#left { width: 360px; flex: none; background: var(--ds-panel); border-right: 1px solid var(--ds-line); padding: 10px 16px 30px; overflow-y: auto; font-size: 12px; }
#ltabs { display: grid; grid-template-columns: 1fr 1fr auto; gap: 4px; position: sticky; top: -10px; z-index: 2; background: var(--ds-panel); padding: 0 0 10px; }
#leg { font-size: 12px; }
#setup h4.step { color: var(--ds-txt); font-size: 11.5px; margin-top: 16px; } #setup h4.step span:first-child { color: var(--ds-cur-txt); }
.clsrow { display: grid; grid-template-columns: auto 1fr auto; gap: 3px 6px; align-items: center; padding: 4px 0; border-bottom: 1px solid var(--ds-line); }
.clsrow .small { grid-column: 2 / 4; }
.clsname { min-width: 0; background: var(--ds-ctl); color: var(--ds-txt-hi); border: 1px solid var(--ds-ctl-line); border-radius: 4px; font: inherit; padding: 2px 6px; }
#trainknobs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 2px; margin: 8px 0; }
#features .k, #processing .k { margin-top: 3px; line-height: 1.5; }
.lg-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.lg-h b { letter-spacing: .14em; text-transform: uppercase; font-size: 12px; }
.lg-sec { border-top: 1px solid var(--ds-line); padding: 10px 0 6px; }
.lg-st { color: var(--ds-dim); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 8px; }
.lg-chips { display: flex; flex-wrap: wrap; gap: 5px; margin: 5px 0 2px; }
.lg-chip { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; background: var(--ds-chip); color: var(--ds-txt); border: 1px solid var(--ds-chip-line); border-radius: 5px; padding: 4px 8px; font: inherit; font-size: 12px; cursor: pointer; text-align: left; user-select: none; touch-action: none; }
.lg-chip .k { font-size: 10px; }
.lg-chip:hover:not(:disabled) { border-color: var(--ds-chip-line-hi); }
.lg-chip:disabled { opacity: .45; cursor: default; }
.lg-chip.held { background: var(--ds-chip-hold); border-color: var(--ds-cur-line); }
.lg-row { margin: 8px 0 10px; }
.lg-name { line-height: 1.4; }
.lg-i { background: none; border: 0; color: var(--ds-dim); cursor: pointer; font-size: 12px; padding: 0 2px; float: right; }
.lg-i:hover { color: var(--ds-txt-hi); }
.lg-ib { clear: both; background: var(--ds-tip); border-radius: 4px; padding: 6px 8px; margin: 4px 0; line-height: 1.5; color: var(--ds-txt); }
.lg-keys { display: flex; flex-wrap: wrap; gap: 3px 12px; margin-top: 4px; }
.lg-sym { display: inline-block; width: 16px; height: 10px; margin-right: 6px; vertical-align: -1px; }
.lg-sym.ring { width: 11px; height: 11px; border-radius: 50%; border: 1.6px solid var(--ds-ring); }
.lg-sym.ring.edited { border-color: var(--ds-cur-txt); }
.lg-sym.line { height: 0; border-top: 1.5px solid var(--ds-txt-hi); vertical-align: 3px; }
.lg-sym.trace { height: 0; border-top: 1.5px solid var(--ds-brush); vertical-align: 3px; }
.lg-sym.strip { background: linear-gradient(90deg, #e9cf84, #dba04a, #b85a4b, #4a2447); height: 9px; }

@media (max-width: 760px) {
  #side { position: absolute; right: 0; z-index: 4; height: 100%; }
  #leg { position: absolute; left: 0; z-index: 5; height: 100%; width: min(360px, 92vw); }
  #count, #chip { display: none; }
  #live { position: absolute; right: 0; z-index: 6; height: 100%; }
  #dockbody { grid-template-columns: 1fr; }
}

/* P2: knobs, chips, lists, bars, tables */
#knobs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 2px; margin: 8px 0 4px; }
.knob { display: flex; flex-direction: column; align-items: center; cursor: ns-resize; outline: none; user-select: none; touch-action: none; }
.knob[hidden] { display: none; }
.knob:focus-visible svg { filter: drop-shadow(0 0 2px var(--ds-ring)); }
.knob .kt { fill: none; stroke: var(--ds-ctl-line); stroke-width: 4; stroke-linecap: round; }
.knob .kv { fill: none; stroke: var(--ds-accent); stroke-width: 4; stroke-linecap: round; }
.knob .kp { stroke: var(--ds-txt-hi); stroke-width: 2; stroke-linecap: round; }
.knob svg { background: radial-gradient(circle at 50% 50%, var(--ds-ctl) 0 13px, transparent 14px); }
.knob.off .kp { stroke: var(--ds-dim); }
.knob .kl { font-size: 10px; text-align: center; line-height: 1.15; min-height: 2.35em; margin-bottom: 2px; color: var(--ds-txt); }
.knob .kn { font-size: 10px; color: var(--ds-dim); }
.chips { display: flex; flex-wrap: wrap; gap: 3px; }
.chip { padding: 1px 6px; }
.chip.on .dot { box-shadow: 0 0 0 1px var(--ds-on-cur); }
#strip2 { display: flex; flex-wrap: wrap; gap: 1px; margin-top: 2px; }
#strip2 i { width: 9px; height: 6px; cursor: pointer; border-radius: 1px; }
.scores > div { margin: 3px 0; }
.warn { color: var(--ds-danger); }
details.list { margin: 4px 0; }
details.list summary { cursor: pointer; display: flex; gap: 6px; align-items: center; }
details.list ol { margin: 4px 0; padding-left: 22px; font-size: 12px; max-height: 180px; overflow: auto; }
details.list li { cursor: pointer; } details.list li:hover { color: var(--ds-txt-hi); }
.bars > div { display: grid; grid-template-columns: 9em 1fr; gap: 6px; align-items: center; font-size: 12px; margin: 2px 0; }
.bars i { display: block; height: 8px; background: var(--ds-accent); border-radius: 1px; min-width: 1px; }
table.conf { border-collapse: collapse; font-size: 12px; margin: 4px 0; }
table.conf td, table.conf th { border: 1px solid var(--ds-line); padding: 3px 6px; text-align: right; font-weight: normal; }
table.conf td.diag { color: var(--ds-txt-hi); font-weight: 600; }
.edit { display: grid; grid-template-columns: 1fr auto; gap: 2px 6px; font-size: 12px; padding: 3px 0; border-bottom: 1px solid var(--ds-line); }
.edit .k { grid-column: 1; } .edit button { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
.dot.edited { background: transparent; box-shadow: 0 0 0 1.4px var(--ds-cur-txt); }

/* P3: workspace views, timeline, descriptor table */
.tlsvg .tl-line { fill: none; stroke-width: 1.6; }
.tlsvg .tl-lab { font: 10px var(--ds-font-ui); fill: var(--ds-label); }
.tlsvg .tl-thr { stroke: var(--ds-txt-hi); stroke-dasharray: 3 3; }
.tlsvg .tl-cross { stroke: var(--ds-txt-hi); stroke-width: 1; opacity: .45; }
.tlsvg .tl-head { stroke: var(--ds-ring); stroke-width: 1.6; }
.tlsvg .tl-hov { fill: var(--ds-brush); fill-opacity: .10; pointer-events: none; }
.tlsvg .axes text { fill: var(--ds-label); font: 10px var(--ds-font-ui); } .tlsvg .axes path, .tlsvg .axes line { stroke: var(--ds-axis); }
.tlhead { margin: 0 0 6px; }
table.cmp { border-collapse: collapse; font-size: 12px; }
table.cmp td, table.cmp th { padding: 3px 8px; border-bottom: 1px solid var(--ds-line); text-align: left; font-weight: normal; vertical-align: middle; }
table.cmp tbody tr { cursor: pointer; } table.cmp tbody tr:hover { background: var(--ds-ctl-hover); }
table.cmp td.ef { width: 150px; white-space: nowrap; } table.cmp .bar { display: inline-block; height: 8px; background: var(--ds-accent); margin-right: 6px; max-width: 90px; vertical-align: 0; }
table.cmp .bar.neg { background: var(--ds-label); }

/* P4: outputs */
.outs { display: flex; flex-wrap: wrap; gap: 4px; }
dialog#notebox { background: var(--ds-panel); color: var(--ds-txt); border: 1px solid var(--ds-line); border-radius: 6px; width: min(720px, 92vw); }
dialog#notebox::backdrop { background: var(--ds-overlay); opacity: .6; }
#notetext { width: 100%; height: 46vh; background: var(--ds-raised); color: var(--ds-txt); border: 1px solid var(--ds-line); font: 12px/1.55 var(--ds-font-ui); padding: 10px; resize: vertical; }

/* P5: the Live panel */
.light { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--ds-line); }
.light.on { background: var(--ds-ok); } .light.wait { background: var(--ds-cur); } .light.bad { background: var(--ds-danger); }
.kv2 { display: grid; grid-template-columns: auto 1fr; gap: 4px 8px; align-items: center; margin: 10px 0; }
#liveinfo > div { margin: 3px 0; }
a.btn { text-decoration: none; display: inline-block; }
/* minimal pairs (lab/LIVE_TEMPLATE.md §5.3b) */
#pairs { padding: 4px 8px; }
#pairs .lanes { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 4px 0; }
#pairs .pairline { stroke: var(--ds-dim); stroke-width: 1.2; opacity: 0.8; }
#pairs .pairline.on { stroke: var(--ds-txt-hi); stroke-width: 2.6; opacity: 1; }
table.conf.pairs td { text-align: left; }
table.conf.pairs td:nth-child(1), table.conf.pairs td:nth-child(4), table.conf.pairs td:nth-child(5) { text-align: right; }
table.conf.pairs tr.on td { background: var(--ds-line); color: var(--ds-txt-hi); }
#livefocus { font: inherit; font-size: 12px; }

/* P13: the classes card (centre; first open, and from the top bar), stacked left tabs, the link toast */
.empty.card { max-width: 620px; position: relative; }
body.card-open #empty { position: absolute; z-index: 8; left: 50%; top: 24px; transform: translateX(-50%); margin: 0; width: min(620px, 92%); background: var(--ds-panel); border: 1px solid var(--ds-line); border-radius: 8px; padding: 18px 22px; box-shadow: var(--ds-pop-shadow); }
#cardclose { position: absolute; top: 10px; right: 10px; }
#empty #classes { text-align: left; margin: 14px 0 6px; }
.row.center { justify-content: center; }
.ltab { position: absolute; left: 0; border-left: 0; border-radius: 0 5px 5px 0; transform: none; }
#setuptab { top: calc(50% - 96px); } #legtab { top: calc(50% + 6px); }
body.leg-open .ltab { left: 360px; }
.toast { position: fixed; bottom: 14px; left: 50%; transform: translateX(-50%); z-index: 9; background: var(--ds-pop); border: 1px solid var(--ds-pop-line); border-radius: 6px; padding: 6px 12px; }

/* the extras (setup ①): name + on/off on one line, the note below, the family's knobs or choices under it */
#extras { margin: 6px 0 10px; }
#extras .xrow { padding: 6px 0; border-top: 1px solid var(--line, rgba(127,127,127,.25)); }
#extras .xh { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 2px; }
#extras .xh .btn { min-width: 44px; }
#extras .xrow > .k { display: block; }
#extras .xk { margin-top: 4px; }
#extras .xm { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px; }
#extras .xm[hidden] { display: none; }
/* setup ②: each transformation and clustering on / off, the same rows as the extras */
#pipe { margin: 4px 0 10px; }
#pipe .xrow { padding: 5px 0; border-top: 1px solid var(--line, rgba(127,127,127,.25)); }
#pipe .xh { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
#pipe .xh .btn { min-width: 44px; }
#pipe .xrow > .k { display: block; }
#pipe .xm { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 4px; }

/* setup rows (Miguel 10-28): name + one-line note on the left; knobs, then on / off (or a fixed value), on the same line */
.srow { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-top: 1px solid var(--line, rgba(127,127,127,.25)); flex-wrap: wrap; }
.srow .sl { flex: 1 1 140px; min-width: 0; display: flex; flex-direction: column; }
.srow .sl .k { line-height: 1.25; }
.srow .sr { display: flex; align-items: center; gap: 6px; flex: none; margin-left: auto; }
.srow .sr .btn.tog { min-width: 40px; }
.srow .fixedv { font-size: 11px; color: var(--ds-dim); }
.srow .knob svg { width: 34px; height: 34px; }
.srow .knob .kl { min-height: 0; margin: 0; font-size: 9px; }
.srow .knob .kn { font-size: 9px; }
.srow.off .sl b { color: var(--ds-dim); }
.srow > .xm { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 4px; }
#setup .sub { margin: 10px 0 2px; text-transform: uppercase; letter-spacing: .12em; font-size: 10px; }
#presethead { margin: 2px 0 4px; } #presethead .changed { color: var(--ds-cur-txt, #c80); }

/* the legend's walks (Miguel 10-29): one row per list, ▶ plays it as a walk, the names open under it */
.lg-walk summary { display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; }
.lg-walk summary::-webkit-details-marker { display: none; }
.lg-walk summary .lg-chip { margin-left: auto; }
.lg-walk ol { margin: 4px 0 2px 18px; padding: 0; max-height: 160px; overflow: auto; font-size: 11px; }
.lg-walk li { cursor: pointer; } .lg-walk li:hover { color: var(--ds-txt-hi); }
/* the language toggle in the top bar */
#langbtn span { opacity: .45; } #langbtn span.on { opacity: 1; font-weight: 700; }
/* the maps (Miguel 10-29): main map fills the display; a strip of thumbnails at the bottom; the proposed map as a thumbnail
   top right; a click on a thumbnail splits the display half and half */
#maps.mlayout { display: flex; flex-direction: column; gap: 12px; height: 100%; min-height: 0; }
#maps.mlayout[hidden] { display: none; }
.mstage { flex: 1; min-height: 0; display: flex; gap: 12px; justify-content: center; align-items: flex-start; position: relative; }
.mpip { position: absolute; top: 0; right: 0; z-index: 3; box-shadow: var(--ds-pop-shadow, 0 2px 10px rgba(0,0,0,.18)); border-radius: 4px; }
.mstrip { flex: none; display: flex; gap: 10px; overflow-x: auto; padding-bottom: 2px; }
figure.map { position: relative; }
figure.map.mthumb { cursor: pointer; padding: 4px; }
figure.map.mthumb svg { pointer-events: none; display: block; }
figure.map.mthumb figcaption { font-size: 10px; max-width: 118px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 0 0 2px 2px; }
.mpip figure.map.mthumb figcaption { max-width: 150px; }
figure.map.mthumb figcaption button { display: none; }
figure.map.mthumb:hover { border-color: var(--ds-accent); }
.mclose { position: absolute; top: 4px; right: 4px; }

/* minimal pairs (Miguel 10-29): named rows, numbered pairs, room between the rows */
#pairs .pairsvg .lane { stroke: var(--ds-line); stroke-width: 1; }
#pairs .pairsvg .lanename { font-size: 12px; }
#pairs .pairsvg .pairend { fill: var(--ds-panel); stroke: var(--ds-dim); stroke-width: 1.2; }
#pairs .pairsvg .pairno { font-size: 10px; fill: var(--ds-txt-hi); paint-order: stroke; stroke: var(--ds-bg); stroke-width: 3px; }
#pairs .pairg.on .pairend { stroke: var(--ds-txt-hi); stroke-width: 2; }
#pairs .pairg.on .pairline { stroke: var(--ds-txt-hi); stroke-width: 2.6; opacity: 1; }
#pairs .pairg:hover .pairline { stroke: var(--ds-txt); opacity: 1; }
/* the tabs size to their words (selection / selección is the longest) */
#tabs { display: flex; gap: 3px; }
#tabs .stab { flex: 1 1 auto; white-space: nowrap; padding: 5px 4px; }

/* minimal pairs over time + the two stripes (Miguel 10-29) */
#pairs .pairsvg .lanebox { fill: none; stroke: var(--ds-line); }
#pairs .pairsvg .laneline { fill: none; stroke-width: 1.4; opacity: .75; }
#pairs .stripes { margin-top: 6px; }
#pairs .stripes .sdiff { fill: var(--ds-accent); opacity: .8; }
#pairs .stripes .ssame { fill: var(--ds-dim); opacity: .55; }
#pairs .stripes .pairg.on .sdiff, #pairs .stripes .pairg.on .ssame { opacity: 1; stroke: var(--ds-txt-hi); stroke-width: 1.5; }
#pairs .stripes .pairg:hover .sdiff { opacity: 1; }
