/* SPDX-License-Identifier: MPL-2.0
 * Copyright (C) 2026 Styves Goupil
 * FRASIL SOURCE, building from scratch (card #249): CONNECT's starts, the tempo in the transport (its ‹ › and its field,
 * and the harmony beside it: card #268), the STRIPS (strips.js)
 * and THE KEYS at their foot (keys.js). The phone (under 760 px wide): a strip a row, the keys held at the bottom.
 * A track's strips in its parts (card #256), along past the screen's width, its index in the tabs' row. A window too short
 * for the strips' columns (160 px at the least): the view taller, scrolled down, THE KEYS held at its foot. */

/* ------------------------------------------------------------ CONNECT's starts; the tempo */
.c-starts { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
.c-btns .c-starts .alt { border-color: var(--slate); color: var(--fog); box-shadow: none; }
.c-btns .c-starts .alt:hover { border-color: var(--fog); }
.bpm { display: flex; align-items: baseline; gap: 5px; height: 100%; padding: 13px 10px 0 8px; font: 600 15px/1 var(--f-ui); color: var(--fog); font-variant-numeric: tabular-nums;
  white-space: nowrap; cursor: ns-resize; touch-action: none; user-select: none; -webkit-user-select: none; }
.bpm small { font-size: 9.5px; letter-spacing: .2em; color: var(--mist); }
.bpm.ro { cursor: default; }
.bpm:focus-visible { outline-offset: -4px; border-radius: 8px; }
.bpm-w { display: flex; align-items: center; height: 100%; }
.bpm-w .bst + .bpm { padding: 13px 4px 0; }
.trs .bst { padding: 0 5px; font: 600 16px/1 var(--f-ui); letter-spacing: 0; color: var(--mist); }
.trs .bst:hover { color: var(--fog); }
.bpm.ed b { display: none; }
.bpm-in { width: 3.4ch; height: 24px; margin-top: -6px; padding: 0 3px; border: 0; border-radius: 6px; background: #1b2430; font: inherit; color: var(--white);
  text-align: center; }
/* the harmony (card #268): its key and scale, a tap its panel under it */
.hm-w { position: relative; display: flex; height: 100%; }
.trs .hm { gap: 9px; padding: 0 10px 0 9px; white-space: nowrap; }
.hm b { font: inherit; }
.hd.tight .trs .hm { gap: 7px; padding: 0 7px; }
.hd.tight .trs .bst { padding: 0 3px; }
.hm em { width: 6px; height: 6px; margin-top: -4px; border: solid var(--mist); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
.hm[aria-expanded="true"] em { margin-top: 3px; transform: rotate(225deg); }
.hm-pop { position: absolute; top: calc(100% + 10px); right: 0; z-index: 6; display: grid; gap: 8px; width: 270px; padding: 14px 14px 12px;
  border: 1.5px solid var(--steel); border-radius: 12px; background: rgba(10, 13, 18, .97); box-shadow: 0 16px 40px rgba(0, 0, 0, .55); }
.hm-t { display: flex; align-items: center; gap: 10px; margin-bottom: 2px; font: 600 10.5px/1 var(--f-ui); letter-spacing: .22em; color: var(--mist); }
.hm-r { display: grid; grid-template-columns: 62px 32px minmax(0, 1fr) 32px; align-items: center; gap: 8px; }
.hm-pop.ro .hm-r { grid-template-columns: 62px minmax(0, 1fr); }
.hm-r > span { font: 600 11px/1 var(--f-ui); letter-spacing: .16em; color: var(--mist); }
.hm-r > b { overflow: hidden; font: 600 15px/1 var(--f-ui); letter-spacing: .1em; color: var(--white); text-align: center; white-space: nowrap; text-overflow: ellipsis; }
.hm-pop.ro .hm-r > b { text-align: left; }
.trs .hm-pop button { display: grid; place-items: center; width: 32px; height: 28px; padding: 0; border: 1px solid var(--steel); border-radius: 7px;
  font: 600 16px/1 var(--f-ui); letter-spacing: 0; color: var(--fog); }
.trs .hm-pop button:hover { border-color: var(--fog); }

/* ------------------------------------------------------------ STRIPS: the sources above, a strip a setting */
.S { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(min-content, 1fr) auto; padding: 0 32px 22px;
  overflow: hidden auto; scrollbar-width: thin; scrollbar-color: var(--steel) transparent; }   /* (the strips' row never under its columns'
                                                                * floor: the view down past the window's foot) */
.S > canvas { position: absolute; inset: 0; width: 100%; height: 100%; -webkit-mask-image: linear-gradient(#000 0 74%, transparent 88%); mask-image: linear-gradient(#000 0 74%, transparent 88%); }
.S > .veil { position: absolute; inset: 0; background: linear-gradient(rgba(7, 9, 13, .78), rgba(7, 9, 13, .62) 70%, rgba(7, 9, 13, .4)); }
.S > .hd { padding: 26px 4px 0; }
.sb-src { position: relative; z-index: 2; display: flex; align-items: center; gap: 18px; margin-top: 24px; }
.sb-grp { flex: none; }
.sb-grp button { padding: 9px 7px; font-size: 11px; letter-spacing: .15em; }   /* (ROOM AUDIO, ROOM VIDEO, card #267: the row as long as it was) */
.sb-chips { display: flex; gap: 8px; flex: 1; min-width: 0; }
.sb-ch { position: relative; flex: 1; max-width: 156px; min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: end; gap: 7px 8px; padding: 10px 12px 9px;
  border: 1.5px solid var(--steel); border-radius: 11px; background: rgba(10, 13, 18, .74); cursor: grab; touch-action: pan-x; user-select: none; -webkit-user-select: none;
  transition: border-color .2s, box-shadow .2s; }
.sb-ch:hover { border-color: var(--slate); }
.sb-ch .n { grid-column: 1 / -1; }
.sb-ch .v { font-size: 16px; }
.sb-ch { container: ch / inline-size; }
.sb-ch [data-mini] { justify-self: end; width: 100%; max-width: 58px; }   /* (the value whole, its day in what is left: card #261's nine) */
@container ch (max-width: 112px) { .sb-ch [data-mini] { grid-column: 1 / -1; justify-self: stretch; max-width: none; } }   /* (no room beside
                                                                               * the value: its day under it, never hidden) */
.sb-ch [data-mini] svg { display: block; width: 100%; height: 18px; }
.sb-ch .stn { grid-column: 1 / -1; display: flex; min-width: 0; margin-top: -3px; font: 600 8.5px/1.1 var(--f-ui); letter-spacing: .1em; color: var(--slate);
  white-space: nowrap; }   /* (card #261: a station's source, where it reads; its distance kept whole) */
.sb-ch .stn span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.sb-ch .stn b { flex: none; font-weight: inherit; }
.sb-ch .stn:empty { display: none; }
@container scr (min-width: 761px) and (max-width: 1400px) {   /* (nine groups: the chips under them, whole, once both no
                                                               * longer hold a row) */
  .sb-src { flex-wrap: wrap; row-gap: 12px; }
  .sb-chips { flex: 1 0 100%; }
}
.sb-src:has(.ly-bar.open) { z-index: 20; }   /* (card #266: the layer's choices over the strips) */
.sb-ch.used .n { color: var(--fog); }
.sb-ch.used::after { content: ""; position: absolute; top: 9px; right: 10px; width: 5px; height: 5px; border-radius: 50%; background: var(--fog); opacity: .6; }
.sb-ch.armed { border-color: var(--ice); box-shadow: 0 0 22px -6px var(--ice); }
.S.ask .sb-ch { border-color: rgba(110, 208, 255, .55); }
.sb-ghost { position: fixed; z-index: 99; transform: translate(-50%, -130%); padding: 7px 11px; border: 1.5px solid var(--ice); border-radius: 9px; background: rgba(10, 13, 18, .95);
  font: 600 11px/1 var(--f-ui); letter-spacing: .16em; color: var(--white); pointer-events: none; }
.sb-st { position: relative; z-index: 2; display: flex; flex-direction: column; min-width: 0; min-height: 0; margin: 20px 0 14px; }
.sb-tabs { display: flex; align-items: center; margin: 0 0 12px -10px; }
.sb-tabs [role=tablist] { display: flex; gap: 2px; }
.sb-tabs [role=tab] { padding: 6px 10px; font: 700 12.5px/1 var(--f-ui); letter-spacing: .28em; color: var(--slate); }
.sb-tabs [role=tab]:hover { color: var(--mist); }
.sb-tabs [role=tab].on { color: var(--c); text-shadow: 0 0 16px color-mix(in srgb, var(--c) 45%, transparent); }
.sb-tabs .fill { flex: 1; }
/* the index: a part a name, its strips a mark each (lit: a source on it; hollow: not on this device), on screen lit */
.sb-idx { --c: var(--fog); display: flex; gap: 2px; min-width: 0; margin-left: 26px; padding-left: 20px; border-left: 1px solid var(--rule); overflow-x: auto; scrollbar-width: none; }
.sb-idx::-webkit-scrollbar { display: none; }
.sb-idx button { flex: none; display: flex; flex-direction: column; gap: 6px; padding: 6px 9px 5px; border-radius: 7px; font: 600 9.5px/1 var(--f-ui); letter-spacing: .22em;
  color: var(--slate); transition: color .25s, background .25s; }
.sb-idx button:hover { color: var(--white); }
.sb-idx button.in { color: var(--fog); background: rgba(17, 24, 33, .7); }
.sb-idx b { display: flex; gap: 2px; height: 3px; }
.sb-idx b i { width: 5px; border-radius: 1px; background: #1d2630; transition: background .25s; }
.sb-idx button.in b i { background: #34404e; }
.sb-idx b i.on, .sb-idx button.in b i.on { background: var(--c); box-shadow: 0 0 6px color-mix(in srgb, var(--c) 70%, transparent); }
.sb-idx b i.na { background: none; box-shadow: inset 0 0 0 1px #26303c; }
.sb-clear { height: 28px; padding: 0 12px; border: 1.5px solid var(--steel); border-radius: 8px; font: 600 10.5px/1 var(--f-ui); letter-spacing: .22em; color: var(--mist); }
.sb-clear:hover { border-color: var(--fog); color: var(--fog); }
.sb-row { --fl: 0px; --fr: 0px; position: relative; flex: 1; min-height: 0; display: flex; gap: 20px; margin: 0 -32px; padding: 0 32px; overflow-x: auto; overflow-y: hidden;
  overscroll-behavior-x: contain; scrollbar-width: none; scroll-padding: 0 32px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 var(--fl), #000 calc(100% - var(--fr)), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 var(--fl), #000 calc(100% - var(--fr)), transparent); }
.sb-row::-webkit-scrollbar { display: none; }
.sb-row::after { content: ""; flex: none; width: 12px; }   /* (the last part's room past the padding) */
.sb-pt { flex: var(--k) 0 auto; display: flex; flex-direction: column; min-height: 0; }
.sb-pt h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 9px; padding-left: 3px; font: 600 9.5px/1 var(--f-ui); letter-spacing: .3em; color: var(--mist); white-space: nowrap; }
.sb-pt h3::after { content: ""; flex: 1; min-width: 12px; height: 1px; background: linear-gradient(90deg, var(--steel), transparent); }
.sb-ps { flex: 1; min-height: 0; display: flex; gap: 6px; }
.sb-ps > .st { flex: 1 0 94px; }
.sb-ps > .st.note { flex-basis: 112px; }

/* a strip: its name and NOW; its column (BASE, NOW, the push between, its day's bracket) and its fader; its source;
   LIVE | DAY; THE DAY under it */
.st { position: relative; display: flex; flex-direction: column; gap: 9px; min-width: 0; padding: 12px 8px 10px; border: 1.5px solid var(--rule); border-radius: 12px;
  background: rgba(10, 13, 18, .55); transition: opacity .3s, border-color .3s, box-shadow .3s; }
.st.linked { border-color: var(--steel); background: rgba(10, 13, 18, .72); }
.st.over { border-color: var(--ice); box-shadow: 0 0 30px -8px var(--ice); }
.st.no { border-color: var(--rose); }
.st.turned { border-color: var(--c); box-shadow: 0 0 30px -8px var(--c); }   /* (turned on the device a moment ago: card #280) */
.st header { display: flex; flex-direction: column; align-items: center; gap: 7px; cursor: pointer; user-select: none; -webkit-user-select: none; touch-action: manipulation; border-radius: 6px; }
.st header b { max-width: 100%; overflow: hidden; text-overflow: ellipsis; font: 600 10px/1 var(--f-ui); letter-spacing: .12em; color: var(--mist); white-space: nowrap; }
.st header:hover b, .st.linked header b { color: var(--white); }
.st-v { min-height: 20px; font: 600 20px/1 var(--f-ui); color: var(--fog); font-variant-numeric: tabular-nums; white-space: nowrap; }
.st.note .st-v { font-size: 15px; letter-spacing: .06em; line-height: 20px; }
.st-body { position: relative; flex: 1; min-height: 184px; display: flex; justify-content: center; gap: 12px; padding: 4px 0 20px; }   /* (a column
                                                                * and its fader 160 px at the least) */
.st-col { position: relative; width: 26px; border-radius: 6px; background: repeating-linear-gradient(0deg, rgba(38, 48, 60, .5) 0 1px, transparent 1px 9px); box-shadow: inset 0 0 0 1px #1a222c;
  cursor: ns-resize; touch-action: none; }
.st-col.ro { cursor: default; }
.st-fill { position: absolute; left: 0; right: 0; bottom: 0; height: calc(var(--v, 0) * 100%); border-radius: 0 0 6px 6px;
  background: linear-gradient(to top, color-mix(in srgb, var(--c) 8%, transparent), color-mix(in srgb, var(--c) 30%, transparent)); opacity: calc(.4 + var(--lv, 0) * .6); }
.st-push { position: absolute; left: 0; right: 0; bottom: calc(var(--p0, 0) * 100%); height: calc((var(--p1, 0) - var(--p0, 0)) * 100%); background: color-mix(in srgb, var(--c) 55%, transparent); }
.st-now { position: absolute; left: -5px; right: -5px; bottom: calc(var(--v, 0) * 100%); height: 2px; margin-bottom: -1px; border-radius: 1px; background: var(--c);
  box-shadow: 0 0 calc(4px + var(--lv, 0) * 14px) var(--c); opacity: calc(.45 + var(--lv, 0) * .55); }
.st-base { position: absolute; left: -9px; width: 7px; height: 11px; bottom: calc(var(--b, 0) * 100%); margin-bottom: -5.5px; border: 1.5px solid var(--fog); border-radius: 2px; background: var(--night); }
.st-range { display: none; position: absolute; right: -8px; width: 4px; bottom: calc(var(--lo, 0) * 100%); height: calc((var(--hi, 0) - var(--lo, 0)) * 100%); min-height: 2px;
  border: 1px solid var(--c); border-left: 0; opacity: .75; }
.st.has-range .st-range { display: block; }
.st-time { position: absolute; left: calc(100% + 12px); bottom: calc(var(--v, 0) * 100%); transform: translateY(50%); font: 600 9.5px/1 var(--f-ui); font-style: normal;
  letter-spacing: .1em; color: var(--white); white-space: nowrap; pointer-events: none; }
.st-time:empty { display: none; }
.st.linked .st-time { left: calc(100% + 30px); }
.st-fd { position: relative; width: 14px; cursor: ns-resize; touch-action: none; }
.st-fd.off { visibility: hidden; }
.st-fd .tr { position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; margin-left: -1px; border-radius: 1px; background: var(--rule); }
.st-fd .tr::after { content: ""; position: absolute; left: 0; right: 0; bottom: calc(var(--f0, .5) * 100%); height: calc((var(--f1, .5) - var(--f0, .5)) * 100%); background: var(--lamp); opacity: .7; }
.st-fd .z { position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--mist); }
.st-fd .h { position: absolute; left: -2px; right: -2px; height: 5px; bottom: calc(50% + var(--w, 0) * 50%); margin-bottom: -2.5px; border-radius: 2px; background: var(--lamp); box-shadow: 0 0 9px rgba(242, 166, 90, .55); }
.st-fd em { position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%); font: 600 11px/1 var(--f-ui); font-style: normal; color: var(--lamp); font-variant-numeric: tabular-nums; }
.st-sock { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; height: 46px; border: 1.5px dashed #2a3441; border-radius: 9px; }
button.st-sock:hover { border-color: var(--slate); }
.st-sock i { position: relative; width: 12px; height: 12px; }
.st-sock i::before, .st-sock i::after { content: ""; position: absolute; left: 5.25px; top: 0; width: 1.5px; height: 12px; background: var(--slate); }
.st-sock i::after { transform: rotate(90deg); }
.st-sock.on { border-style: solid; border-color: color-mix(in srgb, var(--c) 40%, var(--steel)); background: rgba(14, 19, 25, .8); }
.st-sock b { max-width: calc(100% - 8px); overflow: hidden; text-overflow: ellipsis; font: 600 10px/1 var(--f-ui); letter-spacing: .14em; color: var(--white); white-space: nowrap; }
.st-sock .v { font-size: 12.5px; color: var(--text-2); }
.st-sock .v .tr { display: none; }
.st-x, .st-more { position: absolute; top: 2px; display: grid; place-items: center; height: 16px; min-width: 16px; padding: 0 3px; border-radius: 5px; font: 600 11px/1 var(--f-ui); color: var(--slate); }
.st-x { right: 2px; }
.st-more { left: 2px; font-size: 9.5px; letter-spacing: .04em; color: var(--mist); }
.st-x:hover { color: var(--rose); }
.st-more:hover { color: var(--white); }
.S.arming .st-sock:not(.on) { border-color: var(--ice); }
.st-mode { display: flex; padding: 2px; border-radius: 7px; background: #111821; }
.st-mode.off { visibility: hidden; }
.st-mode button { flex: 1; padding: 5px 0; border-radius: 5px; font: 600 9.5px/1 var(--f-ui); letter-spacing: .14em; color: var(--slate); }
.st-mode button.on { background: var(--steel); color: var(--fog); }
.st-mode button:disabled { opacity: .35; cursor: default; }
.st-seq { position: relative; height: 30px; display: flex; align-items: flex-end; gap: 1px; }
.st-seq.off, .st-loop.off { visibility: hidden; }   /* (every column as long: LIVE or DAY) */
.st-loop.off { height: 9px; }
.st-seq i { flex: 1; border-radius: 1px; background: color-mix(in srgb, var(--c) 42%, transparent); }
.st-seq i.on { background: var(--white); box-shadow: 0 0 8px var(--c); }
.st-seq svg { width: 100%; height: 100%; overflow: visible; }
.st-loop { display: flex; justify-content: space-between; align-items: center; gap: 4px; margin-top: -3px; }
.st-loop button { font: 600 9px/1 var(--f-ui); letter-spacing: .14em; color: var(--mist); white-space: nowrap; }
.st-loop button:hover { color: var(--white); }
.st-loop span { font: 600 8.5px/1 var(--f-ui); letter-spacing: .12em; color: var(--lamp); white-space: nowrap; }
.st-loop.zm { justify-content: center; }   /* (LIVE: its ZOOM, card #271) */
.st-loop.zm button.on { color: var(--lamp); }
.st-lad { flex: 1; display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; border-radius: 6px; box-shadow: inset 0 0 0 1px #1a222c;
  overflow: hidden auto; scrollbar-width: none; }   /* (more chords than its height holds: along it, never one over another) */
.st-lad::-webkit-scrollbar { display: none; }
.st-lad li { flex: 1 0 16px; display: grid; place-items: center; font: 600 9.5px/1 var(--f-ui); letter-spacing: .08em; color: var(--slate); white-space: nowrap; border-top: 1px solid #161d26; }
.st-lad li:first-child { border-top: 0; }
.st-lad li.on { color: var(--white); background: color-mix(in srgb, var(--c) 16%, transparent); box-shadow: inset 2px 0 var(--c); text-shadow: 0 0 10px var(--c); }
.st.note .st-body { gap: 8px; }
.st.note .st-fd { flex: none; }
/* a setting of a few values: its word, its column a notch a step; one this device does not take: empty, why said */
.st.stepped .st-v { max-width: 100%; overflow: hidden; text-overflow: ellipsis; font-size: 12.5px; letter-spacing: .1em; line-height: 20px; }
.st.stepped .st-col { background: repeating-linear-gradient(0deg, rgba(52, 64, 78, .8) 0 1px, transparent 1px calc(100% / var(--k))); background-position: 0 100%; }
.st.na { border-color: #161d26; background: rgba(10, 13, 18, .35); }
.st.na header { cursor: default; }
.st.na header b, .st.na .st-v { color: var(--slate); }
.st.na .st-col { background: none; box-shadow: none; border: 1.5px dashed #232c37; cursor: default; }
.st.na .st-col > i { display: none; }
.st.na .st-fd { opacity: .3; pointer-events: none; }
.st-na { font: 600 8.5px/1 var(--f-ui); font-style: normal; letter-spacing: .22em; color: var(--lamp); }
.st-sock.na { border-color: #1b232d; }
.st.na.linked .st-sock { opacity: .45; }
.S.arming .st.na .st-sock { border-color: #1b232d; }
.S.solo .st:not(.is-solo) { opacity: .26; }
.st.is-solo { border-color: var(--fog); box-shadow: 0 0 44px -14px var(--c); }
.st.is-solo header::after { content: "SOLO"; font: 600 9px/1 var(--f-ui); letter-spacing: .24em; color: var(--ice); }
.st.is-aud { border-color: color-mix(in srgb, var(--c) 70%, transparent); box-shadow: 0 0 40px -12px var(--c); }

/* ------------------------------------------------------------ THE KEYS: the track you play, at the foot */
.kb-box { position: relative; z-index: 6; }
@container scr (min-width: 761px) {   /* (the view taller than the window: the keys at its foot over the strips, in their place
                                         * once down there) */
  .S.long { padding-bottom: 0; }
  .S.long .kb-box { position: sticky; bottom: 0; margin: -18px -32px 0; padding: 18px 32px 22px;
    background: linear-gradient(rgba(10, 13, 18, 0), rgba(10, 13, 18, .97) 18px); }
}
.kb { --c: var(--fog); display: grid; grid-template-columns: 108px 140px minmax(0, 1fr) 84px; gap: 16px; align-items: stretch; height: 100px; padding: 10px 14px 12px;
  border: 1.5px solid var(--steel); border-radius: 14px; background: rgba(9, 12, 17, .88); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.kb-trk { display: flex; flex-direction: column; justify-content: center; gap: 3px; }
.kb-trk button { padding: 6px 10px; border-radius: 7px; text-align: left; font: 600 11.5px/1 var(--f-ui); letter-spacing: .2em; color: var(--slate); }
.kb-trk button:hover { color: var(--fog); }
.kb-trk button.on { color: var(--c); background: #121a23; box-shadow: inset 2px 0 var(--c); }
/* the track's own (card #259): LATCH, lit in its colour; SINGLE | CHORD (a device's drone: its own, shown); GLINT's and
 * the BASS's ARP beside LATCH (card #265; a device's latch or a 3.4's PLAYS: its own, shown), the BASS's SINGLE | CHORD
 * on ARP alone (its place kept) */
.kb-md { display: flex; flex-direction: column; justify-content: center; gap: 6px; }
.kb-ls { display: flex; gap: 6px; }
.kb-ls .kb-lt { flex: 1 1 0; min-width: 0; }
.kb-lt { display: flex; align-items: center; justify-content: center; gap: 8px; height: 30px; border: 1.5px solid var(--steel); border-radius: 8px;
  font: 600 11px/1 var(--f-ui); letter-spacing: .16em; color: var(--mist); }
.kb-ls .kb-lt + .kb-lt { gap: 6px; letter-spacing: .12em; }
.kb-lt i { width: 7px; height: 7px; border: 1.5px solid var(--slate); border-radius: 50%; }
.kb-lt:hover { border-color: var(--fog); color: var(--fog); }
.kb-lt[aria-pressed="true"] { border-color: color-mix(in srgb, var(--c) 55%, var(--steel)); color: var(--c); }
.kb-lt[aria-pressed="true"] i { border-color: var(--c); background: var(--c); box-shadow: 0 0 8px var(--c); }
.kb-lt.ro { cursor: default; border-style: dashed; }
.kb-lt.ro:hover { border-color: var(--steel); color: var(--mist); }
.kb-lt.ro[aria-pressed="true"], .kb-lt.ro[aria-pressed="true"]:hover { border-color: color-mix(in srgb, var(--c) 40%, var(--steel)); color: var(--c); }
.kb-gap { visibility: hidden; }
.kb-nc { display: flex; height: 30px; padding: 2px; border-radius: 8px; background: #111821; }
.kb-nc button { flex: 1; border-radius: 6px; font: 600 9.5px/1 var(--f-ui); letter-spacing: .14em; color: var(--slate); }
.kb-nc button:hover { color: var(--fog); }
.kb-nc button.on { background: var(--steel); color: var(--fog); }
.kb-nc.ro button { cursor: default; }
.kb-nc.ro button:hover { color: var(--slate); }
.kb-nc.ro button.on, .kb-nc.ro button.on:hover { background: #18202a; color: var(--mist); }
.kb-keys { position: relative; display: flex; gap: 2px; touch-action: none; user-select: none; -webkit-user-select: none; }
.kb-keys::before { content: ""; position: absolute; z-index: 3; left: 0; right: 0; top: -1px; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, rgba(110, 208, 255, 0), rgba(110, 208, 255, .4) 25%, rgba(220, 227, 234, .55) 50%, rgba(110, 208, 255, .4) 75%, rgba(110, 208, 255, 0)); }
.k { position: relative; display: block; }
.k.w { flex: 1; min-width: 0; border: 1px solid #1d2630; border-top: 0; border-radius: 0 0 6px 6px; background: linear-gradient(#111821, #0d131a); }
.k.w:hover { background: linear-gradient(#151d27, #10161e); }
.k.b { position: absolute; z-index: 2; top: 0; left: calc((var(--i) + 1) * (100% + 2px) / var(--nw) - 1px); width: calc(100% / var(--nw) * .6); height: 58%;
  transform: translateX(-50%); border: 1px solid #222b36; border-top: 0; border-radius: 0 0 4px 4px; background: #05070a; }
.k em, .k b { position: absolute; left: 0; right: 0; bottom: 7px; text-align: center; font: 600 9px/1 var(--f-ui); font-style: normal; letter-spacing: .1em; color: var(--slate); }
.k b { display: none; color: var(--white); font-size: 10px; }
.k.on { background: linear-gradient(#1b2531, #121a23); box-shadow: inset 0 -3px 0 var(--c), 0 0 30px -6px var(--c); }
.k.b.on { background: #18212c; }
.k.on b { display: block; text-shadow: 0 0 10px var(--c); }
.k.on em { display: none; }
.k.snd { box-shadow: inset 0 -2px 0 color-mix(in srgb, var(--c) 45%, transparent); }
.kb-side { display: flex; flex-direction: column; justify-content: center; gap: 6px; }
.kb-side button { height: 30px; border: 1.5px solid var(--steel); border-radius: 8px; font: 600 11px/1 var(--f-ui); letter-spacing: .16em; color: var(--mist); }
.kb-side button:hover { border-color: var(--fog); color: var(--fog); }
.kb-side .kb-fold { height: 24px; border: 0; font-size: 16px; }
.kb-side:has(.kb-fold) { display: grid; grid-template-columns: 1fr 1fr; align-content: center; }   /* (a device's: three in the
                                                                * box, OCT− and OCT+ side by side) */
.kb-side:has(.kb-fold) button { letter-spacing: .06em; }
.kb-side:has(.kb-fold) .kb-fold { grid-column: 1 / -1; }
/* a device linked: its own keys; what they hold (the drone sounding, dimmer); KEYS opens the page's */
.kb.kb-dev { display: flex; align-items: center; gap: 18px; height: 50px; padding: 0 16px; }
.kb-dn { display: flex; align-items: center; gap: 9px; font: 600 12.5px/1 var(--f-ui); letter-spacing: .18em; color: var(--fog); white-space: nowrap; }
.kb-dn i { width: 6px; height: 6px; border-radius: 50%; background: var(--ice); box-shadow: 0 0 8px var(--ice); }
.kb-dt { min-width: 44px; font: 600 10px/1 var(--f-ui); letter-spacing: .2em; color: var(--mist); }
.kb-mini { flex: none; width: 168px; height: 22px; }
.kb-mini rect { fill: #111821; stroke: #222b36; stroke-width: .6; }
.kb-mini rect.bk { fill: #05070a; }
.kb-mini rect.on { fill: var(--fog); stroke: var(--fog); filter: drop-shadow(0 0 3px var(--fog)); }
.kb-mini rect.snd { fill: #3a4654; stroke: var(--mist); }
.kb-held { display: flex; gap: 6px; min-width: 0; overflow: hidden; }
.kb-held b { font: 600 13px/1 var(--f-ui); letter-spacing: .08em; color: var(--white); }
.kb-dev .fill { flex: 1; }
.kb-show { height: 30px; padding: 0 14px; border: 1.5px solid var(--steel); border-radius: 8px; font: 600 11px/1 var(--f-ui); letter-spacing: .2em; color: var(--mist); }
.kb-show:hover { border-color: var(--fog); color: var(--fog); }

@container scr (max-width: 760px) {
  .bpm { padding: 11px 4px 0 4px; font-size: 13px; }
  .bpm small { font-size: 8px; letter-spacing: .14em; }
  .trs { flex-wrap: wrap; height: auto; }   /* (card #268: the tracks a row, the tempo and the harmony under) */
  .trs > button { height: 34px; }
  .trs > .rule:nth-of-type(2) { display: none; }
  .bpm-w { flex: 1 0 50%; height: 34px; }
  .hm-w { flex: 1 1 auto; height: 34px; justify-content: flex-end; }
  .trs > .rule:nth-of-type(3) { display: none; }
  .trs .hm { font-size: 11px; padding: 0 8px; }
  .S { display: block; padding: 0 14px; overflow: visible; }
  .S > .hd { padding: 18px 0 0; }
  .sb-src { flex-direction: column; align-items: stretch; gap: 10px; margin-top: 18px; }
  .sb-grp button { flex: 1; padding: 8px 0; font-size: 9.5px; letter-spacing: .12em; }
  .sb-chips { overflow-x: auto; scrollbar-width: none; margin: 0 -14px; padding: 0 14px; }
  .sb-chips::-webkit-scrollbar { display: none; }
  .sb-ch { flex: none; width: 116px; }
  .sb-chips:has(.ly-bar) { flex-wrap: wrap; overflow: visible; row-gap: 8px; }   /* (LAYER's: its three, the layer whole under them) */
  .sb-chips:has(.ly-bar) .sb-ch { flex: 1 1 0; width: auto; }
  .sb-chips .ly-bar { flex: 1 0 100%; grid-template-columns: minmax(0, 1fr) 118px; }
  .ly-pop { left: 0; width: auto; }
  .sb-st { margin: 18px 0 12px; }
  .sb-tabs { position: sticky; top: 0; z-index: 15; margin: 0 -14px 8px; padding: 8px 14px 8px 4px; background: rgba(8, 10, 14, .94);
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }   /* (the parts in reach, down the list) */
  .sb-tabs [role=tab] { font-size: 11px; letter-spacing: .22em; }
  .sb-idx { order: 3; flex: 0 0 100%; margin: 8px 0 0; padding: 0 0 0 2px; border-left: 0; }
  .sb-idx button { padding: 6px 8px 5px; letter-spacing: .18em; }
  .sb-tabs { flex-wrap: wrap; }
  .sb-row { display: block; margin: 0; padding: 0; overflow: visible; -webkit-mask-image: none; mask-image: none; }
  .sb-row::after { display: none; }
  .sb-pt { scroll-margin-top: 104px; }
  .sb-pt + .sb-pt { margin-top: 18px; }
  .sb-pt h3 { margin-bottom: 8px; }
  .sb-ps { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .st { display: grid; grid-template-columns: 78px minmax(0, 1fr) 76px; align-items: center; gap: 8px 12px; padding: 10px 10px; }
  .st header { grid-column: 1; grid-row: 1; align-items: flex-start; gap: 6px; }
  .st header b { font-size: 9.5px; }
  .st-v { min-height: 16px; font-size: 16px; }
  .st.note .st-v { font-size: 12px; line-height: 16px; }
  .st-body { grid-column: 2; grid-row: 1; flex-direction: column; justify-content: center; gap: 12px; min-height: 0; padding: 4px 0; }
  .st-col { width: auto; height: 14px; background: repeating-linear-gradient(90deg, rgba(38, 48, 60, .5) 0 1px, transparent 1px 9px); cursor: ew-resize; }
  .st.stepped .st-col { background: repeating-linear-gradient(90deg, rgba(52, 64, 78, .8) 0 1px, transparent 1px calc(100% / var(--k))); background-position: 0 0; }
  .st.na .st-col { background: none; }
  .st-na { font-size: 8px; }
  .st-fill { top: 0; bottom: 0; height: auto; width: calc(var(--v, 0) * 100%); border-radius: 6px 0 0 6px; background: linear-gradient(to right, color-mix(in srgb, var(--c) 8%, transparent), color-mix(in srgb, var(--c) 30%, transparent)); }
  .st-push { top: 0; bottom: 0; height: auto; left: calc(var(--p0, 0) * 100%); width: calc((var(--p1, 0) - var(--p0, 0)) * 100%); }
  .st-now { top: -5px; bottom: -5px; left: calc(var(--v, 0) * 100%); right: auto; width: 2px; height: auto; margin: 0 0 0 -1px; }
  .st-base { top: auto; bottom: -11px; left: calc(var(--b, 0) * 100%); width: 11px; height: 7px; margin: 0 0 0 -5.5px; }
  .st-range { top: -8px; bottom: auto; right: auto; left: calc(var(--lo, 0) * 100%); width: calc((var(--hi, 0) - var(--lo, 0)) * 100%); height: 4px; min-width: 2px; border: 1px solid var(--c); border-bottom: 0; }
  .st-time, .st.linked .st-time { left: calc(var(--v, 0) * 100%); bottom: auto; top: -22px; transform: translateX(-50%); }
  .st-fd { width: auto; height: 12px; cursor: ew-resize; }
  .st-fd.off { display: none; }
  .st-fd .tr { left: 0; right: 0; top: 50%; bottom: auto; width: auto; height: 2px; margin: -1px 0 0; }
  .st-fd .tr::after { top: 0; bottom: 0; height: auto; left: calc(var(--f0, .5) * 100%); width: calc((var(--f1, .5) - var(--f0, .5)) * 100%); }
  .st-fd .z { left: 50%; right: auto; top: 1px; bottom: 1px; width: 1px; height: auto; }
  .st-fd .h { top: -1px; bottom: -1px; left: calc(50% + var(--w, 0) * 50%); right: auto; width: 5px; height: auto; margin: 0 0 0 -2.5px; }
  .st-fd em { top: 50%; left: auto; right: -34px; transform: translateY(-50%); }
  .st.linked .st-body { padding-right: 36px; }
  .st-sock { grid-column: 3; grid-row: 1; height: 42px; }
  .st-mode, .st-seq, .st-loop { grid-column: 1 / -1; }
  .st-mode.off, .st-seq.off, .st-loop.off { display: none; }
  .st-seq { height: 26px; margin-top: 14px; }
  .st-lad { flex: none; flex-direction: row; height: 26px; overflow: auto hidden; }
  .st-lad li { flex: 1 1 0; border-top: 0; border-left: 1px solid #161d26; font-size: 8px; letter-spacing: 0; }
  .st-lad li:first-child { border-left: 0; }
  .st-lad li.on { box-shadow: inset 0 -2px var(--c); }
  .kb-box { position: sticky; z-index: 20; bottom: 0; margin: 0 -14px; padding: 8px 8px calc(10px + env(safe-area-inset-bottom)); background: rgba(8, 10, 14, .96);
    border-top: 1px solid var(--rule); }
  .kb { grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: 30px 28px 82px; gap: 8px; height: auto; padding: 0; border: 0; border-radius: 0; background: none;
    backdrop-filter: none; -webkit-backdrop-filter: none; }
  .kb-trk { flex-direction: row; justify-content: flex-start; gap: 2px; }
  .kb-trk button { padding: 0 9px; font-size: 10.5px; }
  .kb-trk button.on { box-shadow: inset 0 -2px var(--c); }
  .kb-md { grid-column: 1 / -1; grid-row: 2; flex-direction: row; justify-content: flex-start; }
  .kb-lt { height: 28px; padding: 0 11px; font-size: 10px; gap: 7px; }
  .kb-ls .kb-lt { flex: none; }
  .kb-ls .kb-lt + .kb-lt { gap: 7px; letter-spacing: .16em; }
  .kb-gap { display: none; }
  .kb-nc { height: 28px; }
  .kb-nc button { flex: none; padding: 0 11px; }
  .kb-keys { grid-column: 1 / -1; grid-row: 3; }
  .kb-side, .kb-side:has(.kb-fold) { display: flex; flex-direction: row; gap: 6px; }
  .kb-side button, .kb-side:has(.kb-fold) button { height: 30px; padding: 0 9px; font-size: 10px; letter-spacing: .16em; }
  .kb.kb-dev { height: 44px; gap: 10px; padding: 0 6px; }
  .kb-dt { display: none; }
  .kb-mini { width: 112px; }
}
