/* The engine rack under the sketch (2026-11-25; engine-rack.module.mjs, granular-v2-panel.module.mjs). */

#engineRack {
    --er-bg: #ffffff;
    --er-bg-alt: #f5f8fc;
    --er-line: #dce6f0;
    --er-line-strong: #c8d8e8;
    --er-ink: #172132;
    --er-navy: #1a3a5c;
    --er-muted: #4f6478;
    --er-teal: #2f7f9c;
    --er-teal-soft: #8cc4d8;
    --er-teal-bg: #eef6fa;
    --er-orange: #d9731a;
    --er-orange-ink: #a85a12;
    --er-wave: #9fb9d4;
    --er-knob: #1e2d3d;
    /* the names the grain visuals read */
    --sm-teal: var(--er-teal); --sm-muted: var(--er-muted); --sm-border: var(--er-line); --sm-text: var(--er-ink); --sm-red: #b83030;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 900;
    display: flex; flex-direction: column;
    background: var(--er-bg); color: var(--er-ink);
    border-top: 1px solid var(--er-line-strong);
    box-shadow: 0 -6px 24px rgba(26, 58, 92, 0.10);
    font-family: Inter, system-ui, sans-serif;
}
:root[data-theme="dark"] #engineRack {
    --er-bg: #161c24; --er-bg-alt: #1d2530; --er-line: #2a3646; --er-line-strong: #364457; --er-ink: #dbe6f0; --er-navy: #cfe0ef;
    --er-muted: #9fb2c4; --er-teal: #5ab0ca; --er-teal-soft: #3d7d93; --er-teal-bg: #1d3340; --er-orange: #f0a04a; --er-orange-ink: #f3b46a;
    --er-wave: #4f6a86; --er-knob: #0e141b;
}
#engineRack[hidden] { display: none; }
#engineRack button, #engineRack select, #engineRack input { font-family: inherit; }
.er-grip { position: absolute; left: 0; right: 0; top: -4px; height: 8px; cursor: ns-resize; z-index: 2; }
.er-grip::after { content: ""; position: absolute; left: 50%; top: 2px; width: 42px; height: 4px; margin-left: -21px; border-radius: 2px; background: var(--er-line-strong); }
.er-head { display: flex; align-items: center; gap: 10px; padding: 7px 14px; min-height: 46px; box-sizing: border-box; background: var(--er-bg-alt); border-bottom: 1px solid var(--er-line); flex-wrap: wrap; }
.er-tabs { display: flex; gap: 3px; }
.er-tab { height: 30px; padding: 0 10px; border: 1px solid var(--er-line-strong); border-radius: 6px; background: var(--er-bg); color: var(--er-navy); font-size: 11.5px; font-weight: 700; letter-spacing: 0.04em; cursor: pointer; position: relative; }
.er-tab.is-current { background: var(--er-navy); border-color: var(--er-navy); color: var(--er-bg); }
.er-tab.is-armed::after { content: ""; position: absolute; top: -3px; right: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--er-orange); box-shadow: 0 0 0 2px var(--er-bg-alt); }
.er-sep { width: 1px; height: 24px; background: var(--er-line); }
.er-who { display: flex; align-items: center; gap: 7px; }
.er-arm { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--er-line-strong); background: transparent; cursor: pointer; padding: 0; }
.er-arm.is-armed { border-color: var(--er-orange); background: var(--er-orange); box-shadow: 0 0 0 3px rgba(217, 115, 26, 0.18); }
.er-name { font-size: 14px; color: var(--er-navy); }
.er-armed-note { font-size: 12px; color: var(--er-muted); }
.er-head-extra { flex: 1; display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.er-fold { height: 30px; padding: 0 10px; border: 1px solid var(--er-line-strong); border-radius: 6px; background: var(--er-bg); color: var(--er-navy); font-size: 12.5px; cursor: pointer; }
.er-body { flex: 1; min-height: 0; overflow: auto; position: relative; }
#engineRack.is-folded .er-body { display: none; }
/* the notes and tips in the corner stay above the rack */
body.has-engine-rack #ssNotes, body.has-engine-rack .ss-notes { bottom: calc(var(--engine-rack-h, 0px) + 12px) !important; }
body.has-engine-rack .tour-toast:not(.ss-note) { bottom: calc(var(--engine-rack-h, 0px) + 12px) !important; }
body.has-engine-rack .rc-launch { bottom: calc(var(--engine-rack-h, 0px) + 12px) !important; }   /* the team's comments (2026-11-26: it sat on ▶ with the bar folded) */

/* ── the granular device ── */
.rk-device { display: flex; flex-direction: column; min-height: 100%; }
.rk-device.is-off .rk-panel { opacity: 0.55; }
.rk-head-label { font-size: 11.5px; color: var(--er-muted); }
.rk-input { height: 28px; border: 1px solid var(--er-line-strong); border-radius: 6px; background: var(--er-bg); color: var(--er-ink); font-size: 12.5px; padding: 0 6px; max-width: 100%; min-width: 0; }
.rk-preset { width: 170px; }
.rk-num { width: 70px; }
.rk-level { width: 100px; accent-color: var(--er-teal); }
.rk-btn { height: 28px; padding: 0 10px; border: 1px solid var(--er-line-strong); border-radius: 6px; background: var(--er-bg); color: var(--er-navy); font-size: 12.5px; cursor: pointer; white-space: nowrap; }
.rk-btn:hover { border-color: var(--er-teal); }
.rk-btn:disabled { opacity: 0.45; cursor: default; }
.rk-btn--icon { width: 28px; padding: 0; }
.rk-btn--add { align-self: flex-start; border-style: dashed; border-color: var(--er-teal-soft); background: var(--er-teal-bg); color: var(--er-teal); font-weight: 600; }
.rk-btn.is-recording { border-color: #b83030; color: #b83030; }
.rk-pop-wrap { position: relative; }
.rk-pop { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; min-width: 220px; display: flex; flex-direction: column; gap: 2px; padding: 6px; border: 1px solid var(--er-line-strong); border-radius: 8px; background: var(--er-bg); box-shadow: 0 8px 24px rgba(26, 58, 92, 0.16); }
.rk-box--sample .rk-pop { left: 0; right: auto; }
.rk-pop[hidden] { display: none; }
.rk-pop__item { text-align: left; height: 30px; padding: 0 10px; border: 0; border-radius: 5px; background: transparent; color: var(--er-ink); font-size: 13px; cursor: pointer; }
.rk-pop__item:hover:not(:disabled) { background: var(--er-teal-bg); }
.rk-pop__item:disabled { opacity: 0.45; cursor: default; }
.rk-check { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--er-ink); padding: 4px 6px; cursor: pointer; }
.rk-check input { accent-color: var(--er-teal); }
.rk-views { display: flex; gap: 2px; padding: 0 14px; border-bottom: 1px solid var(--er-line); position: sticky; top: 0; background: var(--er-bg); z-index: 5; }
.rk-view { height: 36px; padding: 0 14px; border: 0; border-bottom: 3px solid transparent; background: transparent; color: var(--er-muted); font-size: 13px; font-weight: 600; cursor: pointer; }
.rk-view.is-current { color: var(--er-navy); border-bottom-color: var(--er-teal); }
.rk-panel { padding: 12px 14px 14px; }
.rk-panel[hidden] { display: none; }
.rk-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr) minmax(0, 0.8fr) minmax(0, 0.8fr); gap: 10px; align-items: start; }
.rk-grid--motion { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
@media (max-width: 1100px) { .rk-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .rk-grid, .rk-grid--motion { grid-template-columns: minmax(0, 1fr); } }
.rk-box { border: 1px solid var(--er-line); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; min-width: 0; background: var(--er-bg); }
.rk-box__head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.rk-box__title { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; color: var(--er-navy); }
.rk-box__sub { font-size: 12px; color: var(--er-muted); flex: 1; }
.rk-q { width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--er-line-strong); background: var(--er-bg); color: var(--er-muted); font-size: 11px; font-weight: 700; cursor: pointer; padding: 0; }
.rk-q:hover { border-color: var(--er-teal); color: var(--er-teal); }
.rk-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rk-row--controls { align-items: flex-end; gap: 14px; }
.rk-grow { flex: 1; }
.rk-sample-name { font-size: 12.5px; font-weight: 600; color: var(--er-ink); max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rk-region { font-size: 11.5px; color: var(--er-muted); }
.rk-status { font-size: 11.5px; color: var(--er-muted); }
.rk-status:empty { display: none; }
.rk-wave { position: relative; height: 104px; border-radius: 8px; background: var(--er-bg-alt); border: 1px solid var(--er-line); overflow: hidden; cursor: crosshair; touch-action: none; }
.rk-wave__base { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.rk-wave .gv-overlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.rk-rhythm .gv-cell, .rk-mini .gv-cell { margin: 0; border: 0; padding: 0; background: transparent; }
.rk-rhythm .gv-caption, .rk-mini .gv-caption { font-size: 10.5px; color: var(--er-muted); }
.rk-mini { background: var(--er-bg-alt); border-radius: 6px; padding: 4px 6px 2px; }
.rk-seg-cell { display: flex; flex-direction: column; gap: 5px; }
.rk-seg { display: flex; border: 1px solid var(--er-line-strong); border-radius: 7px; overflow: hidden; }
.rk-seg__btn { height: 30px; padding: 0 10px; border: 0; border-left: 1px solid var(--er-line-strong); background: var(--er-bg); color: var(--er-navy); font-size: 12px; cursor: pointer; }
.rk-seg__btn:first-child { border-left: 0; }
.rk-seg__btn.is-current { background: var(--er-navy); color: var(--er-bg); }
.rk-knobs { display: flex; gap: 6px; justify-content: space-around; flex-wrap: wrap; }
.rk-knobs--small { justify-content: flex-start; }
.rk { display: flex; flex-direction: column; align-items: center; gap: 1px; width: 82px; }
.rk[hidden] { display: none; }
.rk--small { width: 70px; }
.rk-label { font-size: 12px; font-weight: 600; color: var(--er-navy); white-space: nowrap; }
.rk--small .rk-label { font-size: 11px; }
.rk-host { width: 60px; height: 60px; cursor: ns-resize; touch-action: none; border-radius: 50%; }
.rk--small .rk-host { width: 46px; height: 46px; }
.rk-host:focus-visible { outline: 2px solid var(--er-teal); outline-offset: 2px; }
.rk-host svg { width: 100%; height: 100%; display: block; }
.rk-track { fill: none; stroke: var(--er-line); stroke-width: 5; stroke-linecap: round; }
.rk-ring { fill: none; stroke: var(--er-teal-soft); stroke-width: 5; stroke-linecap: round; }
.rk-val { fill: none; stroke: var(--er-teal); stroke-width: 5; stroke-linecap: round; }
.rk-body { fill: var(--er-knob); }
.rk-ind { stroke: #e6eef6; stroke-width: 2.5; stroke-linecap: round; }
.rk.is-automated .rk-val { stroke: var(--er-orange); }
.rk.is-automated .rk-host { cursor: default; }
.rk.is-automated .rk-value, .rk.is-automated .rk-badge { color: var(--er-orange-ink); }
.rk-value { font-size: 12px; color: var(--er-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rk-badge { font-size: 10.5px; color: var(--er-teal); min-height: 13px; white-space: nowrap; }
.rk-device.is-assigning .rk-host { cursor: copy; box-shadow: 0 0 0 2px var(--er-teal-soft); }
.rk-assign { position: sticky; bottom: 0; margin: 0 14px 10px; padding: 6px 10px; border-radius: 6px; background: var(--er-navy); color: var(--er-bg); font-size: 12.5px; align-self: flex-start; }
.rk-assign[hidden] { display: none; }
.rk-more { align-self: flex-start; height: 24px; padding: 0 4px; border: 0; background: transparent; color: var(--er-teal); font-size: 12px; font-weight: 600; cursor: pointer; }
.rk-more__area { display: flex; flex-direction: column; gap: 8px; border-top: 1px dashed var(--er-line); padding-top: 8px; }
.rk-more__area[hidden] { display: none; }
.rk-select { display: flex; flex-direction: column; gap: 4px; }
.rk-hint { margin: 0; font-size: 12px; color: var(--er-muted); line-height: 1.5; }
.rk-menu { position: fixed; z-index: 3000; min-width: 230px; display: flex; flex-direction: column; padding: 4px; border: 1px solid var(--er-line-strong, #c8d8e8); border-radius: 8px; background: #ffffff; box-shadow: 0 8px 24px rgba(26, 58, 92, 0.18); font-family: Inter, system-ui, sans-serif; }
:root[data-theme="dark"] .rk-menu { background: #161c24; border-color: #364457; }
.rk-menu__item { text-align: left; height: 32px; padding: 0 10px; border: 0; border-radius: 5px; background: transparent; color: inherit; font: inherit; font-size: 13px; cursor: pointer; }
.rk-menu__item:hover, .rk-menu__item:focus { background: #eef6fa; outline: none; }
:root[data-theme="dark"] .rk-menu__item:hover, :root[data-theme="dark"] .rk-menu__item:focus { background: #1d3340; }
.rk-menu__sep { height: 1px; background: #e3eaf2; margin: 4px 6px; }
.rk-help { position: absolute; right: 14px; top: 44px; z-index: 30; width: min(520px, calc(100% - 28px)); max-height: calc(100% - 56px); overflow: auto; display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border: 1px solid var(--er-teal); border-radius: 10px; background: var(--er-bg); box-shadow: 0 10px 30px rgba(26, 58, 92, 0.2); }
.rk-help__head { display: flex; align-items: baseline; gap: 8px; }
.rk-help__head strong { font-size: 13px; color: var(--er-navy); }
.rk-help__sub { flex: 1; font-size: 12px; color: var(--er-muted); }
.rk-help__x { border: 0; background: none; color: var(--er-muted); cursor: pointer; font-size: 14px; }
.rk-help__text { margin: 0; font-size: 12.5px; line-height: 1.45; }
.rk-help .lw { background: var(--er-bg-alt); border-radius: 6px; padding: 6px; }
.rk-help > .rk-btn { align-self: flex-start; }
.rk-picker { border: 1px solid var(--er-line); border-radius: 8px; padding: 6px; background: var(--er-bg); }
.rk-picker[hidden] { display: none; }
.rk-picker__search { width: 100%; box-sizing: border-box; }
.rk-picker__list { max-height: 160px; overflow-y: auto; margin-top: 4px; display: flex; flex-direction: column; }
.rk-picker__item { text-align: left; border: 0; background: transparent; color: var(--er-ink); font-size: 12.5px; padding: 4px 6px; border-radius: 4px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rk-picker__item:hover { background: var(--er-teal-bg); }
.rk-routes { display: flex; flex-direction: column; gap: 4px; }
.rk-route { display: grid; grid-template-columns: minmax(0, 1.1fr) 18px minmax(0, 1fr) minmax(0, 1.3fr) 28px; gap: 8px; align-items: center; padding: 5px 6px; border-radius: 6px; background: var(--er-bg-alt); font-size: 12.5px; }
.rk-route--head { background: transparent; font-size: 11px; color: var(--er-muted); padding-top: 0; padding-bottom: 0; }
.rk-src { display: flex; align-items: center; gap: 6px; min-width: 0; }
.rk-src .rk-input { flex: 1; }
.rk-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; }
.rk-arrow { color: var(--er-muted); text-align: center; }
.rk-amt-wrap { display: flex; align-items: center; gap: 6px; }
.rk-amt { flex: 1; min-width: 0; accent-color: var(--er-teal); }
.rk-amt-val { width: 40px; text-align: right; color: var(--er-muted); font-variant-numeric: tabular-nums; }
.rk-lfos { display: flex; flex-direction: column; gap: 10px; }
.rk-scope { width: 100%; height: 44px; display: block; background: var(--er-bg-alt); border-radius: 6px; }
.rk-map { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 18px; margin-top: 8px; }
@media (max-width: 900px) { .rk-map { grid-template-columns: minmax(0, 1fr); } }
.rk-map__row { display: grid; grid-template-columns: minmax(0, 0.9fr) 18px minmax(0, 1fr) minmax(0, 1.2fr); gap: 8px; align-items: center; padding: 6px 8px; border: 1px solid var(--er-line); border-radius: 8px; }
.rk-map__row.is-off { background: var(--er-bg-alt); }
.rk-map__row.is-off .rk-map__dst { color: var(--er-muted); }
.rk-map__prop { font-size: 12.5px; font-weight: 600; }
.rk-map__dst { font-size: 12px; color: var(--er-navy); }
.rk-modal-note { margin: 10px 0 6px; font-size: 13px; }
/* the LFO's dot on a knob, and Alt+drag (how much the source moves it) */
.rk-live { fill: #f28c28; stroke: var(--er-bg); stroke-width: 1.2; }
.rk.is-depth .rk-ring { stroke: var(--er-teal); }
.rk.is-depth .rk-badge { font-weight: 700; }
.rk.is-depth .rk-host { cursor: ns-resize; }
/* the browser's own colours never over the rack's (2026-11-25: the Library list showed white titles
   in the user's browser): one colour scheme with the app's theme, no native look on its buttons,
   and the list's and menus' colours stated with fallbacks */
#engineRack { color-scheme: light; }
:root[data-theme="dark"] #engineRack { color-scheme: dark; }
.rk-menu { color-scheme: light; color: #172132; }
:root[data-theme="dark"] .rk-menu { color-scheme: dark; color: #dbe6f0; }
#engineRack .rk-picker, #engineRack .rk-picker__list, #engineRack .rk-pop { background-color: var(--er-bg, #ffffff); color: var(--er-ink, #172132); }
#engineRack .rk-picker__item, #engineRack .rk-pop__item, .rk-menu__item {
    -webkit-appearance: none; appearance: none;
    background-color: transparent; color: var(--er-ink, #172132); -webkit-text-fill-color: currentColor; opacity: 1;
}
#engineRack .rk-picker__item:hover, #engineRack .rk-pop__item:hover:not(:disabled) { background-color: var(--er-teal-bg, #eef6fa); }
#engineRack .rk-btn, #engineRack .rk-seg__btn, #engineRack .rk-view, #engineRack .er-tab, #engineRack .er-fold { -webkit-appearance: none; appearance: none; }
/* rows of a scrolling list never shrink (2026-11-25: with a large Library the titles were squeezed
   to nothing, still clickable: a flex item with overflow:hidden may shrink below its content) */
#engineRack .rk-picker__item, #engineRack .rk-pop__item, #engineRack .rk-route, #engineRack .rk-map__row, .rk-menu__item { flex: none; }
#engineRack .rk-picker__item { min-height: 26px; line-height: 18px; }
/* everything in view without scrolling inside the rack (2026-11-25, the user's request):
   the Sample box in two columns (waveform + rhythm | Spray, Scan), the region as a chip on the
   waveform, "⋯ More" as a popover from the box's title, captions over the small diagrams,
   compact LFO cards; the rack's height follows the view (engine-rack.module.mjs fit()) */
.rk-box { position: relative; gap: 6px; }
.rk-box__slot:empty { display: none; }
.rk-box__slot .rk-more { height: 20px; padding: 0 2px; font-size: 11.5px; }
.rk-sample-body { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: start; }
.rk-wave-col { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.rk-knob-col { display: flex; flex-direction: column; gap: 2px; }
.rk-knob-col .rk { width: 74px; }
.rk-knob-col .rk-host { width: 48px; height: 48px; }
.rk-knob-col .rk-badge:empty { min-height: 0; }
.rk-wave { height: 96px; }
.rk-region--chip { position: absolute; left: 6px; top: 5px; z-index: 2; padding: 1px 7px; border-radius: 10px; background: var(--er-bg); border: 1px solid var(--er-line); font-size: 11px; pointer-events: none; max-width: calc(100% - 12px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rk-region--chip:empty { display: none; }
.rk-rhythm .gv-cell { display: flex; align-items: center; gap: 6px; }
.rk-rhythm .gv-cell canvas { flex: 1; min-width: 0; }
.rk-rhythm .gv-caption { order: -1; white-space: nowrap; }
.rk-mini { padding: 2px 6px 3px; }
.rk-mini .gv-cell { display: flex; flex-direction: column-reverse; gap: 1px; }
.rk-mini .gv-caption { font-size: 10px; line-height: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rk-box--sample .rk-seg-cell { flex-direction: row; align-items: center; gap: 8px; }
.rk-more__pop { position: absolute; z-index: 25; left: 8px; right: 8px; top: 30px; border: 1px solid var(--er-teal); border-top: 1px solid var(--er-teal); border-radius: 10px; padding: 10px; background: var(--er-bg, #ffffff); box-shadow: 0 10px 30px rgba(26, 58, 92, 0.2); max-height: 70vh; overflow: auto; }
.rk-lfos { gap: 6px; }
.rk-lfo { gap: 4px; padding: 6px 10px; }
.rk-scope { height: 30px; }
.rk-panel { padding: 8px 12px 10px; }
.rk-box__head { flex-wrap: nowrap; min-width: 0; }
.rk-box__title { white-space: nowrap; }
.rk-box__sub { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rk-box__slot .rk-more { white-space: nowrap; }
/* the assign note floats over the views (it never adds to the rack's height) */
.rk-device { position: relative; }
.rk-assign { position: absolute; left: 50%; transform: translateX(-50%); bottom: 10px; margin: 0; z-index: 20; white-space: nowrap; box-shadow: 0 6px 18px rgba(26, 58, 92, 0.25); }
/* the other engines' devices (engine-rack-devices.module.mjs, 2026-11-25): the same boxes and knobs,
   their own columns, small pictures with a caption under them, and "Listen" with the engine's card */
.rk-grid--dev { grid-template-columns: var(--rk-cols, repeat(3, minmax(0, 1fr))); }
@media (max-width: 1100px) { .rk-grid--dev { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .rk-grid--dev { grid-template-columns: minmax(0, 1fr); } }
.rk-mini--dev { margin: 0; display: flex; flex-direction: column; gap: 1px; }
.rk-mini__canvas { display: block; width: 100%; }
.rk-mini__cap { font-size: 10px; line-height: 13px; color: var(--er-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rk-mini__cap:empty { display: none; }
.rk-seg--waves { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.rk-seg--waves .rk-wave-btn { height: auto; padding: 4px 2px 3px; display: flex; flex-direction: column; align-items: center; gap: 1px; font-size: 10.5px; min-width: 0; }
.rk-seg--waves .rk-wave-btn span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rk-hint--small { font-size: 11.5px; }
.rk-box--listen .engine-help { margin: 0; padding: 0; border: 0; background: transparent; }
.rk-box--listen .engine-help__text { display: none; }
.rk-box--listen .engine-help__picture { height: 92px; }
.rk-box--listen .engine-help__captions { margin: 2px 0 6px; }
.rk-box--listen .rk-capsub { display: block; margin-top: 1px; font-size: 10px; font-weight: 500; letter-spacing: 0; text-transform: none; opacity: 0.85; }
.rk-box--listen .engine-help__listen { gap: 4px; }
.rk-box--listen .engine-help__example { min-height: 24px; padding: 0 8px; font-size: 11.5px; }
.rk-map__row--dev { grid-template-columns: minmax(0, 0.8fr) 18px minmax(0, 2fr); }
.rk-device--engine .rk-panel--map > .rk-hint { max-width: 980px; }
/* phase A of the other engines (engine-rack-devices + engine-mods, 2026-11-25): the STROKE box's six
   small knobs, the live spectrum over Listen's picture while the engine plays, the strokes that glow
   on the sketch, Sketch → sound's "+" to add a connection */
.rk-knobs--grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px 4px; justify-items: center; }
.rk-box--stroke .rk--small { width: 66px; }
.rk-box--stroke .rk-badge:empty { min-height: 4px; }
.rk-livewrap { position: relative; }
.rk-livecanvas { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 6px; background: var(--er-bg, #ffffff); display: none; }
.rk-livecap { position: absolute; left: 8px; top: 5px; font-size: 10.5px; font-weight: 600; color: var(--er-teal); display: none; pointer-events: none; }
.rk-box--listen.is-live .rk-livecanvas, .rk-box--listen.is-live .rk-livecap { display: block; }
/* still while nothing plays (2026-11-28): a little quieter, so that it does not look as if it played */
.rk-box--listen .engine-help__picture { transition: opacity 0.25s ease; }
.rk-box--listen .engine-help.is-still .engine-help__picture { opacity: 0.72; }
.er-sketch-dot { fill: #2f9fbf; opacity: 0.85; transform-box: fill-box; transform-origin: center; animation: gv-pop 0.7s ease-out forwards; }
@media (prefers-reduced-motion: reduce) { .er-sketch-dot { animation-duration: 0.35s; } }
.rk-map__row--dev { grid-template-columns: minmax(0, 0.8fr) 18px minmax(0, 2fr) 92px; }
.rk-map__row--dev[data-prop="span"] { grid-template-columns: minmax(0, 0.8fr) 18px minmax(0, 2fr); }
.rk-map__add { width: 92px; }
/* Sketch → sound: each connection on a line of its own, with its ✕ (2026-11-28) */
.rk-map__dst { display: flex; flex-direction: column; gap: 3px; }
.rk-map__added { display: flex; align-items: center; gap: 6px; color: var(--er-teal); }
.rk-map__x { width: 20px; height: 20px; min-width: 20px; padding: 0; font-size: 11px; }
.rk-device--engine.is-assigning .rk-host { cursor: copy; box-shadow: 0 0 0 2px var(--er-teal-soft); }
/* the new FM engine (phase B1, 2026-11-25): the switch, the eight algorithms, the operators' cards */
.rk-v2switch { font-size: 12px; font-weight: 600; color: var(--er-navy); margin-right: 6px; white-space: nowrap; }
.rk--tiny { width: 50px; gap: 0; }
.rk--tiny .rk-label { font-size: 10px; font-weight: 600; }
.rk--tiny .rk-host { width: 32px; height: 32px; }
.rk--tiny .rk-value { font-size: 10px; }
.rk--tiny .rk-badge { font-size: 9px; min-height: 0; }
.rk-algs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3px; }
.rk-alg { padding: 1px; border: 1px solid var(--er-line); border-radius: 6px; background: var(--er-bg); cursor: pointer; display: flex; justify-content: center; -webkit-appearance: none; appearance: none; }
.rk-alg:hover { border-color: var(--er-teal); }
.rk-alg.is-current { border-color: var(--er-navy); background: var(--er-teal-bg, #eef6fa); box-shadow: inset 0 0 0 1px var(--er-navy); }
.rk-alg svg { display: block; }
.rk-alg__wire { stroke: var(--er-muted); stroke-width: 1; fill: none; }
.rk-alg__fb { stroke-dasharray: 2 1.5; }
.rk-alg__op { fill: var(--er-bg); stroke: var(--er-teal); stroke-width: 1.2; }
.rk-alg__op.is-carrier { fill: var(--er-navy); stroke: var(--er-navy); }
.rk-alg__num { font: 700 7px Inter, system-ui, sans-serif; text-anchor: middle; fill: var(--er-teal); }
.rk-alg__op.is-carrier + .rk-alg__num { fill: #ffffff; }
.rk-box--ops .rk-ops { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.rk-op { border: 1px solid var(--er-line); border-left: 3px solid var(--er-teal); border-radius: 7px; padding: 3px 5px 2px; }
.rk-op.is-carrier { border-left-color: var(--er-navy); }
.rk-op.is-silent { opacity: 0.55; }
.rk-op__head { display: flex; align-items: baseline; gap: 6px; font-size: 11px; }
.rk-op__head strong { color: var(--er-navy); }
.rk-op__role { color: var(--er-muted); font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rk-op__knobs { display: flex; justify-content: space-between; }
/* the new Oscillator engine (phase B2, 2026-11-26): wave icons, the oscillators' and filter's rows */
.rk-seg--waveicons { display: inline-flex; margin-left: auto; }
.rk-seg--waveicons .rk-seg__btn { height: 20px; padding: 0 3px; display: flex; align-items: center; }
.rk-seg--waveicons svg { width: 20px; height: 10px; }
.rk-seg--small .rk-seg__btn { height: 22px; padding: 0 8px; font-size: 11px; font-weight: 600; }
.rk-check--small { font-size: 11px; }
.rk-row--tight { gap: 8px; }
.rk-op__knobs--left { justify-content: flex-start; gap: 4px; }
.rk-op__knobs--line { display: flex; justify-content: space-around; margin-top: 2px; }
.rk-row--envpic { flex-wrap: nowrap; align-items: center; gap: 6px; }
.rk-row--envpic .rk-op__knobs { flex: none; display: flex; }
.rk-row--envpic .rk-mini { flex: 1; min-width: 0; }
.rk-box--oscs .rk-op__head { align-items: center; }
.rk-box--oscs .rk-ops { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.rk-box--oscs .rk-op__head strong { white-space: nowrap; }
/* the new Spectral engine (phase B4, 2026-11-26): the curve you drag */
.rk-curve { display: flex; flex-direction: column; gap: 2px; }
.rk-curve__canvas { width: 100%; height: 96px; display: block; background: var(--er-bg-alt); border-radius: 6px; cursor: ns-resize; touch-action: none; }
.rk-btn--tiny { height: 20px; padding: 0 8px; font-size: 11px; margin-left: auto; }
/* the new Modal engine (phase B5, 2026-11-26): the seven objects, four a row */
.rk-seg--grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.rk-seg--grid4 .rk-seg__btn { height: 20px; padding: 0 2px; font-size: 10.5px; font-weight: 600; border-top: 1px solid var(--er-line-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rk-seg--grid4 .rk-seg__btn:nth-child(-n+4) { border-top: 0; }
.rk-seg--grid4 .rk-seg__btn:nth-child(4n+1) { border-left: 0; }
/* playing live (live-play.module.mjs, 2026-11-26): 🎹 in the rack's head, its panel, the little keyboard */
.er-tools { display: flex; align-items: center; gap: 6px; }
.er-keys-wrap { position: relative; }
.er-keys { height: 30px; padding: 0 10px; border: 1px solid var(--er-line-strong, #c8d8e8); border-radius: 6px; background: var(--er-bg, #fff); color: var(--er-navy, #1a3a5c); font: 600 12.5px Inter, system-ui, sans-serif; cursor: pointer; white-space: nowrap; }
.er-keys.is-on { background: var(--er-navy, #1a3a5c); color: #fff; border-color: var(--er-navy, #1a3a5c); }
.er-keys-pop { position: absolute; right: 0; bottom: calc(100% + 8px); z-index: 3000; width: 440px; display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border: 1px solid var(--er-teal, #2f7f9c); border-radius: 10px; background: var(--er-bg, #fff); color: var(--er-ink, #172132); box-shadow: 0 10px 30px rgba(26, 58, 92, 0.22); font: 12.5px Inter, system-ui, sans-serif; }
.er-keys-pop[hidden] { display: none; }
.er-keys-pop__head { display: flex; align-items: center; gap: 10px; }
.er-keys-pop__engine { margin-left: auto; font-weight: 700; color: var(--er-navy, #1a3a5c); }
.er-keys-pop__row, .er-keys-pop__pen { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.er-keys-pop__val { min-width: 54px; text-align: center; font-variant-numeric: tabular-nums; font-weight: 600; }
.er-keys-pop__label { font-weight: 600; color: var(--er-navy, #1a3a5c); width: 100%; }
.er-keys-pop__slider { display: flex; flex-direction: column; gap: 2px; font-size: 11px; color: var(--er-muted, #4f6478); flex: 1; min-width: 110px; }
.er-keys-pop__midi { font-size: 11.5px; color: var(--er-muted, #4f6478); }
.er-keys-pop__midi:empty { display: none; }
.er-keys-pop__help { margin: 0; font-size: 11.5px; color: var(--er-muted, #4f6478); line-height: 1.45; }
.er-piano { position: relative; display: flex; height: 70px; }
.er-piano__key { flex: 1; position: relative; border: 1px solid var(--er-line-strong, #c8d8e8); border-radius: 0 0 5px 5px; background: #fff; display: flex; align-items: flex-end; justify-content: center; padding: 0 0 4px; cursor: pointer; -webkit-appearance: none; appearance: none; margin-left: -1px; }
.er-piano__key.is-black { flex: 0 0 0; width: 0; padding: 0; border: 0; z-index: 2; }
.er-piano__key.is-black::before { content: ""; position: absolute; left: -11px; top: 0; width: 22px; height: 42px; background: #1e2d3d; border-radius: 0 0 4px 4px; }
.er-piano__key.is-black .er-piano__letter { position: absolute; left: -11px; width: 22px; top: 26px; color: #fff; text-align: center; z-index: 3; }
.er-piano__key.is-down { background: #8cc4d8; }
.er-piano__key.is-black.is-down::before { background: #2f7f9c; }
.er-piano__letter { font: 700 10px Inter, system-ui, sans-serif; color: var(--er-muted, #4f6478); pointer-events: none; }
/* recording into the sketch (live-play, step 2, 2026-11-26): the record button, the notes growing on the sketch */
.er-keys.is-rec { box-shadow: 0 0 0 2px #d94040; }
.er-keys.is-rec::after { content: ""; display: inline-block; width: 8px; height: 8px; margin-left: 6px; border-radius: 50%; background: #e24a4a; animation: lp-blink 1s steps(2) infinite; }
@keyframes lp-blink { 50% { opacity: 0.2; } }
.er-rec { font-weight: 700; color: #c23030; }
.er-rec.is-rec { background: #c23030; color: #fff; border-color: #c23030; }
.er-keys-pop__recnote { font-size: 11.5px; color: #c23030; }
.lp-rec-preview { stroke: #e24a4a; stroke-opacity: 0.7; stroke-linecap: round; }
/* the ghost: a key held, nothing recording, the stroke it would write (2026-11-28) */
.lp-ghost { opacity: 0.42; transition: opacity 0.6s ease; }
.lp-ghost.is-gone { opacity: 0; }
@media (prefers-reduced-motion: reduce) { .er-keys.is-rec::after { animation: none; } }
.lp-rec-head { stroke: #e24a4a; stroke-width: 2; }
/* recording automation (live-play, step 3, 2026-11-26): "A●" in the rack's head */
.er-autorec { height: 30px; padding: 0 10px; border: 1px solid var(--er-line-strong, #c8d8e8); border-radius: 6px; background: var(--er-bg, #fff); color: #c23030; font: 700 12.5px Inter, system-ui, sans-serif; cursor: pointer; white-space: nowrap; }
.er-autorec.is-armed { background: #c23030; color: #fff; border-color: #c23030; }
/* a narrower window: the head on one line (the labels are the controls' tips too) */
@media (max-width: 1400px) {
    #engineRack .er-head .rk-head-label { display: none; }
    #engineRack .er-head .rk-level { width: 80px; }
    #engineRack .er-head .rk-preset { max-width: 150px; }
    #engineRack .er-head .rk-v2switch span { display: inline-block; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
}
/* the sound below (sound-dock.module.mjs, 2026-11-26; docs/SOUND_DOCK_PLAN_EL.md): one bar on top of the
   rack, always in view; the moved controls (▶ ■, Loop, speed, scan, what plays) keep their ids */
.sd-away { display: none !important; }
.sd-bar { display: flex; align-items: center; gap: 10px; height: 52px; flex: none; padding: 0 14px; box-sizing: border-box; background: var(--er-bg-alt); border-bottom: 1px solid var(--er-line); white-space: nowrap; }
#engineRack.has-bar { border-top: 2px solid var(--er-line-strong); }
#engineRack.has-bar .er-grip { top: -5px; }
#engineRack.has-bar.is-folded .er-head { display: none; }
#engineRack.has-bar .er-head { min-height: 44px; padding-top: 6px; padding-bottom: 6px; }
.sd-group { display: flex; align-items: center; gap: 6px; }
.sd-sep { width: 1px; height: 28px; background: var(--er-line); flex: none; }
.sd-gap { flex: 1; min-width: 4px; }
.sd-slot { display: flex; align-items: center; gap: 6px; }
.sd-slot .er-tools { gap: 6px; }
/* ▶ ■ */
.sd-transport .play-armed-wrap { gap: 6px; }
.sd-bar #playStopButtonHeader { width: 40px; height: 36px; min-height: 36px; border-radius: 8px; border: 1px solid var(--er-navy); background: var(--er-navy); display: inline-flex; align-items: center; justify-content: center; }
.sd-bar #playStopButtonHeader img { width: 16px; height: 16px; filter: brightness(0) invert(1); }
.sd-bar #playStopButtonHeader.is-playing { background: #1f8a4c; border-color: #1f8a4c; box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.25); border-radius: 8px; }
.sd-bar #playStopButtonHeader.is-playing img { filter: brightness(0) invert(1); }
.sd-bar #stopButtonHeader { width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--er-line-strong); background: var(--er-bg); color: var(--er-navy); display: inline-flex; align-items: center; justify-content: center; margin: 0; opacity: 1; }
/* the time */
.sd-time { display: flex; flex-direction: column; justify-content: center; line-height: 1.1; min-width: 78px; padding: 0 4px; font-variant-numeric: tabular-nums; cursor: default; }
.sd-time__s { font-size: 17px; font-weight: 700; color: var(--er-navy); }
.sd-time__bars { font-size: 10.5px; color: var(--er-muted); }
.sd-bar.is-playing .sd-time__s { color: #1f8a4c; }
/* Loop, speed, scan (their labels are their tips here) */
.sd-bar .scan-direction-label { display: none; }
.sd-bar .scan-direction-row, .sd-bar .playback-speed-row { display: flex; align-items: center; gap: 0; margin: 0; padding: 0; }
.sd-bar .playback-speed-row { border: 1px solid var(--er-line-strong); border-radius: 7px; overflow: hidden; }
.sd-bar .playback-speed-row .scan-dir-btn { height: 30px; min-width: 34px; padding: 0 6px; border: 0; border-left: 1px solid var(--er-line-strong); border-radius: 0; background: var(--er-bg); color: var(--er-navy); font-size: 12.5px; font-weight: 600; cursor: pointer; }
.sd-bar .playback-speed-row .scan-dir-btn:first-of-type { border-left: 0; }
.sd-bar .playback-speed-row .scan-dir-btn.is-active { background: var(--er-navy); color: var(--er-bg); }
.sd-bar .scan-direction-row { gap: 3px; }
.sd-bar .scan-direction-row .scan-dir-btn { height: 32px; min-width: 34px; padding: 0 8px; border: 1px solid var(--er-line-strong); border-radius: 7px; background: var(--er-bg); color: var(--er-navy); font-size: 14px; font-weight: 700; cursor: pointer; }
.sd-bar .scan-direction-row .scan-dir-btn.is-active { border-color: var(--er-teal); background: var(--er-teal-bg); color: var(--er-teal); }
.sd-bar .transport-extra-btn { height: 32px; padding: 0 10px; border: 1px solid var(--er-line-strong); border-radius: 7px; background: var(--er-bg); color: var(--er-navy); font-size: 12.5px; font-weight: 600; cursor: pointer; }
.sd-bar .transport-extra-btn.is-active { border-color: var(--er-teal); background: var(--er-teal-bg); color: var(--er-teal); }
/* what plays, tempo, WAV */
.sd-bar .listen-source { height: 32px; background: var(--er-bg); color: var(--er-ink); border-color: var(--er-line-strong); }
.sd-bpm { display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 4px 0 8px; border: 1px solid var(--er-line-strong); border-radius: 7px; background: var(--er-bg); cursor: default; }
.sd-bpm__note { color: var(--er-muted); font-size: 14px; }
.sd-bpm__input { width: 44px; height: 26px; border: 0; background: transparent; color: var(--er-navy); font: 700 13px Inter, system-ui, sans-serif; font-variant-numeric: tabular-nums; -moz-appearance: textfield; appearance: textfield; }
.sd-bpm__input::-webkit-inner-spin-button, .sd-bpm__input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.sd-btn { height: 32px; padding: 0 10px; border: 1px solid var(--er-line-strong); border-radius: 7px; background: var(--er-bg); color: var(--er-navy); font-size: 12.5px; font-weight: 600; cursor: pointer; }
.sd-wav { color: #c23030; font-weight: 700; }
.sd-bar #sketchToolbarSonification { height: 32px; padding: 0 10px; border: 1px solid var(--er-line-strong); border-radius: 7px; background: var(--er-bg); color: var(--er-navy); font-size: 12.5px; font-weight: 600; cursor: pointer; }
.sd-bar #sketchToolbarSonification.is-active { border-color: var(--er-teal); background: var(--er-teal-bg); color: var(--er-teal); }
/* the drawer's tabs */
.sd-tabs { display: flex; gap: 2px; padding: 3px; border-radius: 9px; background: var(--er-line); }
.sd-tab { height: 30px; padding: 0 14px; border: 0; border-radius: 7px; background: transparent; color: var(--er-muted); font-size: 13px; font-weight: 600; cursor: pointer; -webkit-appearance: none; appearance: none; }
.sd-tab.is-current { background: var(--er-bg); color: var(--er-navy); font-weight: 700; box-shadow: 0 1px 3px rgba(26, 58, 92, 0.15); }
.sd-tab.is-open { color: var(--er-teal); box-shadow: inset 0 -2px 0 var(--er-teal); }
/* a first visit: the folded drawer's tabs glow twice (2026-11-28) */
.sd-tabs.sd-hint { animation: sd-hint 1.4s ease-in-out 1.5s 2; }
@keyframes sd-hint { 0%, 100% { box-shadow: 0 0 0 0 rgba(47, 127, 156, 0); } 50% { box-shadow: 0 0 0 4px rgba(47, 127, 156, 0.45); } }
@media (prefers-reduced-motion: reduce) { .sd-tabs.sd-hint { animation-duration: 0.01s; } }
.sd-bar button:focus-visible, .sd-bpm__input:focus-visible { outline: 2px solid var(--er-teal); outline-offset: 1px; }
/* the drawer's panes (step 2, 2026-11-27): Mixer at the rack's height; the rack's head and body step aside */
#engineRack.has-pane .er-head, #engineRack.has-pane .er-body { display: none; }
.sd-pane { flex: 1; min-height: 0; overflow: auto; position: relative; background: var(--er-bg); }
.sd-pane[hidden], #engineRack.is-folded .sd-pane { display: none; }
.sd-pane--mixer #controls { min-height: 100%; box-sizing: border-box; justify-content: flex-start; align-items: flex-start; padding: 10px 14px; }
.sd-pane--mixer .mixer-subcontainer { display: flex; justify-content: flex-start; padding: 0; }
.sd-pane--mixer #mixer { background: transparent; border: 0; box-shadow: none; padding: 0; gap: 6px; }
/* the Effects pane (step 3, 2026-11-27): the chain's rows as devices in a row, in the order the sound goes */
.sd-pane__head { display: flex; align-items: baseline; gap: 12px; padding: 10px 14px 0; }
.sd-pane__title { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--er-navy); }
.sd-pane__hint { font-size: 12px; color: var(--er-muted); }
#soundDockEffects .effects-chain-list { display: flex !important; flex-direction: row; align-items: stretch; gap: 22px; padding: 10px 14px 14px; overflow-x: auto; }
#soundDockEffects .effect-row { position: relative; flex: none; min-width: 150px; display: grid; grid-template-columns: auto 1fr; grid-template-areas: "handle label" "params params" "move move"; align-content: start; gap: 8px 6px; padding: 10px 12px; border: 1px solid var(--er-line); border-radius: 10px; background: var(--er-bg); transition: border-color 0.1s, background 0.1s; }
#soundDockEffects .effect-row:not(:last-child)::after { content: "›"; position: absolute; right: -16px; top: 50%; transform: translateY(-50%); color: var(--er-muted); font-size: 18px; pointer-events: none; }
#soundDockEffects .effect-row.drag-over { border-color: var(--er-teal); background: var(--er-teal-bg); }
#soundDockEffects .effect-row.is-dragging { opacity: 0.4; }
#soundDockEffects .drag-handle { grid-area: handle; align-self: center; color: var(--er-muted); font-size: 14px; line-height: 1; cursor: grab; user-select: none; }
#soundDockEffects .drag-handle:hover { color: var(--er-teal); }
#soundDockEffects .drag-handle--fixed { cursor: default; opacity: 0.35; }
#soundDockEffects .effect-enable-label { grid-area: label; display: flex; align-items: center; gap: 6px; cursor: pointer; }
#soundDockEffects .effect-enable-cb { accent-color: var(--er-teal); cursor: pointer; margin: 0; }
#soundDockEffects .effect-name { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--er-navy); }
#soundDockEffects .effect-params-row { grid-area: params; display: flex; align-items: flex-start; justify-content: space-around; gap: 6px; }
#soundDockEffects .effect-row:has(.effect-enable-cb:not(:checked)) .effect-params-row { opacity: 0.5; }
#soundDockEffects .effect-row:has(.effect-enable-cb:not(:checked)) .effect-name { color: var(--er-muted); }
#soundDockEffects .fx-param-cell { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 58px; }
#soundDockEffects .fx-param-label { font-size: 10.5px; font-weight: 600; color: var(--er-navy); text-align: center; }
#soundDockEffects .effect-row--fixed .fx-param-label { max-width: 130px; font-weight: 400; color: var(--er-muted); line-height: 1.35; }
#soundDockEffects .fx-knob-host { display: flex; flex-direction: column; align-items: center; }
#soundDockEffects .fx-param-cell--select { justify-content: flex-start; }
#soundDockEffects .fx-type-select { height: 28px; margin-top: 10px; padding: 0 6px; border: 1px solid var(--er-line-strong); border-radius: 6px; background: var(--er-bg); color: var(--er-navy); font: 600 11.5px Inter, system-ui, sans-serif; cursor: pointer; }
#soundDockEffects .fx-move { grid-area: move; }
#soundDockEffects .fx-param-cell { padding: 0 8px; }
#soundDockEffects .fx-auto-btn { top: -1px; right: -6px; }
/* ♩ Tempo and ♯ Scale: small panels above the bar (2026-11-27); the grids' own controls moved in */
.sd-popwrap { position: relative; }
.sd-pop-btn { display: inline-flex; align-items: center; gap: 6px; }
.sd-pop-btn__glyph { color: var(--er-muted); font-size: 14px; }
.sd-pop-btn__value { font-weight: 700; color: var(--er-navy); font-variant-numeric: tabular-nums; }
.sd-pop-btn[aria-expanded="true"] { border-color: var(--er-teal); background: var(--er-teal-bg); }
.sd-scale .sd-pop-btn.is-on { border-color: var(--er-teal); }
.sd-scale .sd-pop-btn.is-on .sd-pop-btn__glyph { color: var(--er-teal); }
.sd-pop { position: absolute; left: 0; bottom: calc(100% + 10px); z-index: 3000; min-width: 260px; display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; border: 1px solid var(--er-teal); border-radius: 10px; background: var(--er-bg); box-shadow: 0 10px 30px rgba(26, 58, 92, 0.2); white-space: normal; }
.sd-pop[hidden] { display: none; }
.sd-pop__title { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--er-navy); }
.sd-pop__body { display: flex; flex-direction: column; gap: 10px; }
.sd-pop__slider { width: 100%; accent-color: var(--er-teal); margin: 0; }
.sd-pop .pitch-grid-controls { display: flex; flex-direction: column; gap: 8px; }
.sd-pop .pq-row { display: flex; align-items: center; gap: 8px; }
.sd-pop .pq-label { width: 78px; flex: none; font-size: 12px; color: var(--er-muted); }
.sd-pop .pq-select, .sd-pop .pq-input-number { height: 28px; padding: 0 6px; border: 1px solid var(--er-line-strong); border-radius: 6px; background: var(--er-bg); color: var(--er-navy); font: 600 12.5px Inter, system-ui, sans-serif; }
.sd-pop .pq-input-number { width: 64px; }
.sd-pop .pq-select--wide { flex: 1; min-width: 0; }
.sd-pop .pitch-grid-enable-label { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; color: var(--er-navy); cursor: pointer; }
.sd-pop .pitch-grid-enable-cb { accent-color: var(--er-teal); margin: 0; }
/* one ● for recording into the sketch (2026-11-27) */
.sd-rec { width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--er-line-strong); background: var(--er-bg); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.sd-rec::before { content: ""; width: 14px; height: 14px; border-radius: 50%; background: #d63b3b; }
.sd-rec.is-rec { background: #d63b3b; border-color: #d63b3b; }
.sd-rec.is-rec::before { background: #fff; animation: lp-blink 1s steps(2) infinite; }
@media (prefers-reduced-motion: reduce) { .sd-rec.is-rec::before { animation: none; } }
/* with the bar, A arms the automation (no red dot of its own) and the keys' panel has no ● */
body.has-sound-dock .er-autorec { color: var(--er-navy, #1a3a5c); min-width: 34px; }
body.has-sound-dock .er-autorec.is-armed { background: #d9731a; border-color: #d9731a; color: #fff; }
body.has-sound-dock #erKeysRec { display: none; }
/* the live WAV recording (File → Export) is on */
.sd-wavrec { display: none; height: 26px; padding: 0 9px; border-radius: 13px; background: #d63b3b; color: #fff; font-size: 11.5px; font-weight: 700; align-items: center; }
.sd-bar.is-wavrec .sd-wavrec { display: inline-flex; }
/* the microphone, as a microphone (it makes a new sketch from a sound) */
.rec-circle-btn.sd-mic:not(.is-recording) { background: #ffffff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%231a3a5c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='2' width='6' height='12' rx='3'/%3E%3Cpath d='M19 10v1a7 7 0 0 1-14 0v-1'/%3E%3Cpath d='M12 18v4'/%3E%3C/svg%3E") center / 18px 18px no-repeat; border: 1px solid #c8d8e8; border-radius: 8px; box-shadow: none; }
:root[data-theme="dark"] .rec-circle-btn.sd-mic:not(.is-recording) { background-color: #1d2530; border-color: #364457; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23cfe0ef' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='2' width='6' height='12' rx='3'/%3E%3Cpath d='M19 10v1a7 7 0 0 1-14 0v-1'/%3E%3Cpath d='M12 18v4'/%3E%3C/svg%3E"); }
/* «⋯» (step 4, 2026-11-27): what does not fit a narrow window, least used first; on a phone two lines */
.sd-home { display: none; }
.sd-bar.no-bars .sd-time__bars { display: none; }
.sd-more .sd-pop-btn { min-width: 36px; justify-content: center; font-size: 16px; }
.sd-more .sd-pop-btn__glyph { color: var(--er-navy); }
.sd-more .sd-pop { left: auto; right: 0; min-width: 240px; max-height: 70vh; overflow: auto; }
.sd-more-pop .sd-pop__body { gap: 12px; }
.sd-more-pop .sd-group { flex-wrap: wrap; }
.sd-more-pop .scan-direction-label { display: inline; width: 70px; font-size: 12px; color: var(--er-muted); }
.sd-more-pop .scan-direction-row, .sd-more-pop .playback-speed-row { gap: 6px; }
.sd-more-pop .playback-speed-row { border: 0; overflow: visible; }
.sd-more-pop .playback-speed-row .scan-dir-btn { border: 1px solid var(--er-line-strong); border-radius: 6px; }
.sd-more-pop .sd-popwrap { width: 100%; }
.sd-more-pop .sd-pop { position: static; min-width: 0; margin-top: 8px; padding: 10px 0 0; border: 0; border-top: 1px solid var(--er-line); border-radius: 0; box-shadow: none; }
@media (max-width: 600px) {
    /* line 1: ▶ ■ ●, the time, what plays, «⋯»; line 2: the tabs, then A, 🎹, fold */
    .sd-bar { flex-wrap: wrap; height: auto; row-gap: 6px; column-gap: 6px; padding: 6px 8px; }
    .sd-bar::after { content: ""; order: 9; flex: 0 0 100%; height: 0; }
    .sd-bar .sd-sep, .sd-bar .sd-gap { display: none; }
    .sd-tabs { order: 10; flex: 1 1 0; min-width: 0; }
    .sd-tab { flex: 1; padding: 0 6px; }
    .sd-bar .sd-slot { order: 11; }
    /* (line 1 in 390 px: smaller transport, time and what plays) */
    .sd-bar .listen-source { max-width: 96px; }
    .sd-bar #playStopButtonHeader { width: 36px; }
    .sd-bar #stopButtonHeader, .sd-rec { width: 32px; }
    .sd-time { min-width: 62px; padding: 0 2px; }
    .sd-time__s { font-size: 15px; }
}
/* the frame alone (everyone without the engines, 2026-11-27): the bar, Mixer and Effects; no rack head
   or devices, and no ● / 🎹 / A (nothing to record into the sketch without them) */
#engineRack.frame-only .er-head, #engineRack.frame-only .er-body, #engineRack.frame-only .er-grip-hint,
#engineRack.frame-only #sdRec, #engineRack.frame-only .er-tools { display: none !important; }
/* the "now hear it" hint (start-paths) above ▶ when ▶ is at the bottom: its arrow points down */
.play-hint.is-above::before { top: auto; bottom: -7px; border-bottom: 0; border-top: 7px solid #4a8fa8; }
/* the switch in Settings */
.sd-switch { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; padding: 8px 10px; border: 1px dashed #8cc4d8; border-radius: 8px; font-size: 12.5px; cursor: pointer; }
/* a narrower window: tighter (step 4 decides what goes where on small screens) */
@media (max-width: 1400px) {
    .sd-bar { gap: 6px; padding: 0 10px; }
    .sd-tab { padding: 0 10px; }
    .sd-bar .listen-source { max-width: 120px; }
}
/* small screens (mobile-shell's COMPACT): the tools are a dock at the bottom (mobile.css, z-index 1900);
   the rack and its bar sit above it, not under it (2026-11-27) */
@media (max-width: 760px), (max-height: 520px) {
    #engineRack { bottom: var(--dock-h, 56px); }
    /* the notes, tips and the team's comments above the rack AND the dock (2026-11-27: they sat on the bar) */
    body.has-engine-rack #ssNotes, body.has-engine-rack .ss-notes,
    body.has-engine-rack .tour-toast:not(.ss-note), body.has-engine-rack .rc-launch { bottom: calc(var(--engine-rack-h, 0px) + var(--dock-h, 56px) + 12px) !important; }
}
/* Roughness in a picture under the STROKE knobs (2026-11-28): a thin strip, so the rack keeps its height */
.rk-box--stroke .rk-mini--rough { margin-top: 2px; padding: 2px 4px; }
