@font-face { font-family: "Neue Haas Display"; src: url("NeueHaasDisplay-Roman.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Neue Haas Display"; src: url("NeueHaasDisplay-Medium.woff2") format("woff2"); font-weight: 500 600; font-display: swap; }
@font-face { font-family: "Neue Haas Display"; src: url("NeueHaasDisplay-Bold.woff2") format("woff2"); font-weight: 700 800; font-display: swap; }
/* the Text cut of the same family: made for small sizes and long lines, so it carries what is there to be read
   rather than glanced at (the tooltips, the MPE page and the change log) */
@font-face { font-family: "Neue Haas Text"; src: url("NHaasGroteskTXStd-55Rg.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Neue Haas Text"; src: url("NHaasGroteskTXStd-65Md.woff2") format("woff2"); font-weight: 500 600; font-display: swap; }
@font-face { font-family: "Neue Haas Text"; src: url("NHaasGroteskTXStd-75Bd.woff2") format("woff2"); font-weight: 700 800; font-display: swap; }
/* ECHON 6 Controller - Copyright (c) 2026 Morphor - Author: Eli Clement - SPDX-License-Identifier: AGPL-3.0-or-later
   Panel styles shared with docs/mockup/index.html: keep the two in step. */

  :root {
    --panel: #1b1b1b;
    --panel-2: #222222;
    --panel-3: #2b2b2b;
    --chrome: #111111;
    --ink: #e6e6e2;
    --ink-2: #b9b9b4;
    --ink-3: #7a7a76;
    --line: #3a3a3a;
    --line-2: #4d4d4d;
    --cap: #141414;
    --cap-ring: #3d3d3d;
    --cap-white: #f4f4f2;
    --led-off: #4b5563;
    --led-red: #e2173d;
    --led-blue: #2b8fe6;
    --led-white: #f7f7f5;
    --accent: var(--led-red);                 /* the chrome's accent: red like the LEDs, or blue (Settings, Configurator) */
    --accent-dim: rgba(226, 23, 61, .10);
    --accent-dim2: rgba(226, 23, 61, .14);
    --ok: #3ddc84;
    --font: "Neue Haas Display", "Helvetica Neue", Helvetica, Arial, sans-serif;
    --font-text: "Neue Haas Text", "Neue Haas Display", "Helvetica Neue", Helvetica, Arial, sans-serif;   /* for what is read, not glanced at */
    --mono: "IBM Plex Mono", "SF Mono", Menlo, Consolas, monospace;
    color-scheme: dark;
  }
  :root[data-accent="blue"] { --accent: var(--led-blue); --accent-dim: rgba(43, 143, 230, .12); --accent-dim2: rgba(43, 143, 230, .17); }
  * { box-sizing: border-box; }
  body {
    margin: 0;
    -webkit-user-select: none; user-select: none; cursor: default;
    background: var(--chrome);
    color: var(--ink);
    font-family: var(--font);
    font-size: 13px;
    padding-inline: 16px;
    padding-block: 4px 32px;
  }
  button { font: inherit; color: inherit; cursor: pointer; }
  .panel button:focus, .panel svg:focus, .panel [tabindex]:focus { outline: none; }
  .label { font-size: 9.5px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--ink); white-space: nowrap; }
  .label.dim { color: var(--ink-2); }
  .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

  /* ---------- app chrome ---------- */
  .app { max-width: 1440px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }
  .topbar { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 18px; padding: 0 4px; }   /* the panel sits the same distance below it as the sections do from each other */   /* the preset bar in the middle of the window */
  .topbar .presetbar, .topbar .tools { align-self: start; margin-top: 9px; }   /* centred on the mark: (mark 40 - button 22) / 2 */
  .topbar .wordmark { justify-self: start; }
  .topbar .presetbar { justify-self: center; }
  .topbar .tools { justify-self: end; }
  .topbar .status { grid-column: 1; justify-self: start; margin-top: -2px; }   /* the second line, under the wordmark */
  .topbar .presetname { grid-column: 2; justify-self: center; display: flex; align-items: center; gap: 10px; margin-top: -2px; }
  .topbar .presetname .slot { font-size: 14px; font-weight: 500; letter-spacing: .06em; color: var(--ink-2); }
  .topbar .presetname .name { font-size: 14px; font-weight: 600; }
  .topbar .presetname .meta { font-size: 12px; color: var(--ink-3); white-space: nowrap; }   /* category, author, description: optional, dimmer */
  .topbar .presetname .meta.desc { max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
  .dialog .row .pair label { display: inline-flex; align-items: center; gap: 4px; margin-left: 10px; }
  /* the question mark that opens a page of its own, beside the setting it explains */
  .qbtn { background: none; border: 1px solid var(--line-2); border-radius: 50%; width: 14px; height: 14px; padding: 0; margin-left: 5px; font-size: 9px; font-weight: 700; line-height: 1; color: var(--ink-3); vertical-align: 1px; }
  .qbtn:hover { border-color: var(--ink-3); color: var(--ink); }
  /* a narrow window: the rows wrap instead of squeezing into each other. The class comes from the page, not from a
     media query, because the zoom sits on the body and a media query knows nothing of it: at 150 % a 1400 px
     window lays out as 933, and the top bar's columns overlapped, the tools block swallowing the MPE button. */
  body.narrow .topbar { display: flex; flex-wrap: wrap; }
  body.narrow .topbar .status { width: 100%; }
  .wordmark { display: flex; flex-direction: column; align-items: flex-start; gap: 0; }   /* the Morphor mark, the app's name under it */
  .wordmark img { height: 40px; width: auto; display: block; margin-left: -9px; opacity: .84; }   /* as bright as the panel's print, not white */   /* the file carries 7px of air at this height, and the M's first stroke leans away from its foot: a little overhang puts the mark's mass over the name's first letter */
  .wordmark .appname { display: flex; align-items: baseline; gap: 7px; white-space: nowrap; }
  .wordmark .appname b { font-size: 15px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-2); }
  .wordmark .appname i { font-size: 9.5px; font-style: normal; font-weight: 500; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); }
  .tools .ver { position: absolute; right: 0; top: 100%; margin-top: 3px; font-size: 9.5px; color: var(--ink-3); opacity: .7; line-height: 1; white-space: nowrap; }
  .status .hint { color: var(--ink-3); }
  .status .hint[hidden] { display: none; }
  /* typing a value: a small field over a knob or a matrix cell */
  .numentry { position: absolute; z-index: 6; width: 52px; text-align: center; font-family: var(--mono); font-size: 11px; padding: 2px 4px; }
  .knob .numentry { left: 50%; top: 50%; transform: translate(-50%, -50%); }
  table.matrix td { position: relative; }
  /* a cell a roll leaves alone: a mark in its corner, so a locked routing is visible at a glance */
  table.matrix td.locked::before { content: ""; position: absolute; left: 2px; top: 2px; width: 4px; height: 4px; border-radius: 50%; background: var(--ink-2); }
  table.matrix td .numentry { left: 50%; top: 50%; transform: translate(-50%, -50%); width: 46px; }
  .presetbar { display: flex; align-items: center; gap: 6px; }   /* the tools' spacing */
  .presetbar .slot { font-family: var(--mono); font-size: 15px; font-weight: 500; letter-spacing: .12em; }
  .presetbar .name { font-size: 14px; font-weight: 600; }
  .presetbar .cat { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); padding: 2px 6px; border: 1px solid var(--line-2); border-radius: 2px; }
  .presetbar .dirty { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); opacity: 0; transition: opacity .2s; }
  .presetbar .dirty.on { opacity: 1; }
  .pbtn { background: transparent; border: 1px solid var(--line-2); border-radius: 2px; padding: 5px 9px 4px; line-height: 1; font-family: var(--font); font-size: 10px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: rgba(230, 230, 226, .8); display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; }   /* the Display cut even where the text around it is the Text cut, whose taller em box
     would drop the label below the middle; its capitals then sit 1px high in the em box, which the padding answers */
  .pbtn:hover { background: var(--panel-3); border-color: var(--ink-3); color: var(--ink); }
  .pbtn.danger { border-color: rgba(226, 23, 61, .6); color: rgba(226, 23, 61, .9); }
  .pbtn.danger:hover { background: rgba(226, 23, 61, .12); border-color: var(--led-red); color: var(--led-red); }
  .pbtn.zoom { padding: 4px 7px 3px; font-size: 12px; font-weight: 500; min-width: 26px; }
  .dialog .sub { margin: 18px 0 6px; font-size: 10.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-2); }
  .dialog ul { margin: 0; padding-left: 18px; }
  .dialog li { margin: 6px 0; line-height: 1.5; }
  /* an explanation to read rather than a form to fill in: wider, with air between its parts and a way out at the
     top as well, so a long one does not have to be scrolled to the end to be closed */
  .dialog.reading { padding-top: 14px; font-family: var(--font-text); font-size: 13px; }
  .dialog.reading p { margin: 10px 0; }
  .dialog.reading ul { padding-left: 20px; }
  .dialog.reading li { margin: 9px 0; }
  /* a rule and room above every section: the page is read from top to bottom, not looked things up in */
  .dialog.reading .sub { margin: 30px 0 12px; padding-top: 18px; border-top: 1px solid var(--line); }
  .dialog.reading p.small { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
  .dialog.reading .top { position: sticky; top: -14px; display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
                         margin: 0 0 4px; padding: 10px 0 8px; background: var(--panel); border-bottom: 1px solid var(--line); z-index: 1; }
  .dialog.reading .top h2 { margin: 0; }
  .pbtn.on { background: var(--ink); color: var(--chrome); border-color: var(--ink); }
  .spacer { flex: 1; }
  .status { display: flex; align-items: center; gap: 10px; font-size: 11px; color: var(--ink-2); }
  .tools { position: relative; display: flex; gap: 6px; }   /* the version hangs below without moving the row */
  .toolrow { display: flex; gap: 6px; }
  .tip { font-family: var(--font-text); position: fixed; z-index: 40; pointer-events: none; background: #141414; color: var(--ink); border: 1px solid var(--line-2); border-radius: 2px; padding: 6px 9px; font-size: 11px; line-height: 1.45; max-width: 340px; white-space: pre-line; box-shadow: 0 4px 14px rgba(0,0,0,.5); }
  .tip .tipline + .tipline { margin-top: 3px; }        /* the points of a long tip stand apart, rather than running together */
  .tip .tipline b { font-weight: 600; color: #fff; }   /* the title it opens with, or the lead a line explains */
  /* the preset menu: categories, with their presets beside them */
  .presetmenu { position: fixed; z-index: 33; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 2px; box-shadow: 0 6px 18px rgba(0,0,0,.55); padding: 4px 0; min-width: 220px; max-height: 70vh; overflow-y: auto; overflow-x: visible; font-size: 12px; }
  .presetmenu[hidden] { display: none; }
  .presetmenu .item { position: relative; padding: 5px 12px; white-space: nowrap; cursor: pointer; color: var(--ink); }
  .presetmenu .item:hover { background: var(--panel-3); }
  .presetmenu .item.off { color: var(--ink-3); cursor: default; }
  .presetmenu .item.off:hover { background: none; }
  .presetmenu .item.cur { color: var(--accent); }
  .presetmenu .item.has::after { content: "\203A"; position: absolute; right: 8px; color: var(--ink-3); }
  .presetmenu .item.has { padding-right: 24px; }
  .presetmenu .item .cnt { color: var(--ink-3); font-variant-numeric: tabular-nums; }   /* how many presets a line holds */
  /* the presets of a category: placed by the page (fixed), so the menu's own scrolling does not cut them off */
  .presetmenu .sub { display: none; position: fixed; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 2px; box-shadow: 0 6px 18px rgba(0,0,0,.55); padding: 4px 0; min-width: 260px; max-height: 70vh; overflow-y: auto; z-index: 34; }
  .presetmenu .item.has.open > .sub { display: block; }
  /* a preset reads like the categories and the banks do; its slot keeps a column of its own */
  .presetmenu .sub .item .slot { display: inline-block; min-width: 42px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
  .presetmenu .item.free { color: var(--ink-3); }
  .pbtn.pick .caret { display: inline-block; margin-left: 7px; border: 4px solid transparent; border-top-color: currentColor; transform: translateY(2px); }
  /* the preset's own name, in its own case: a name is not a label */
  .pbtn.pick { max-width: 330px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-transform: none; letter-spacing: .01em; font-size: 11.5px; }
  .modal { position: fixed; inset: 0; z-index: 30; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; }
  .modal[hidden] { display: none; }
  /* the two pages opened from another dialog: the settings and the firmware window are children of the body,
     these of .app, so equal z-indexes would leave them behind the dialog that opened them */
  #mpeinfo, #changelog { z-index: 34; }
  #progress { z-index: 35; }                                               /* a backup or a restore is started from the settings and stands in front of them */
  #lib-confirm { z-index: 36; }                                            /* a confirmation always sits above the dialog that asked */
  .dialog { background: var(--panel); border: 1px solid var(--line-2); border-radius: 3px; padding: 18px 22px; max-width: 560px; max-height: 80vh; overflow: auto; font-size: 12.5px; line-height: 1.45; }
  .dialog h2 { margin: 0 0 8px; font-size: 18px; }
  .dialog h2 span { font-weight: 400; color: var(--ink-2); font-size: 13px; margin-left: 8px; }
  .dialog p { margin: 8px 0; }
  .dialog p.small { font-size: 11px; color: var(--ink-2); }
  .dialog.wide { width: 520px; }
  #settings .dialog.wide { width: 580px; max-width: 580px; }   /* its longest setting's name on one line */
  /* the two windows that are read rather than filled in are the same width, and wide enough for the text to
     breathe: three quarters of the application window (a percentage, so the zoom carries it) */
  .dialog.reading, .dialog.changelog { width: 75%; max-width: 75%; }
  .tabs { display: flex; gap: 4px; margin: 4px 0 12px; border-bottom: 1px solid var(--line); }
  .tab { background: none; border: 0; color: var(--ink-2); font: inherit; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 6px 10px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
  .tab.on { color: var(--ink); border-bottom-color: var(--accent); }
  .tabs.sub { margin: 0 0 8px; }
  .tabs.sub .tab { padding: 5px 9px; font-size: 10.5px; }
  .pane .row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 5px 0; border-bottom: 1px solid var(--line); }
  .pane .row > span:first-child { color: var(--ink-2); }
  .pane .row b.mono { font-weight: 500; font-size: 12px; }
  .pane .row b.small { font-size: 10.5px; }
  .pane select, .pane input[type=number] { font-size: 11.5px; }
  .pane input[type=number] { width: 70px; }
  .pane .chs { display: flex; gap: 4px; }
  .pane .chs select { width: 52px; }
  .dialog a { color: var(--ink); cursor: pointer; }
  .dialog.about { text-align: center; width: 440px; padding: 26px 30px 20px; }
  .dialog.about .mark { width: 54px; height: 54px; display: block; margin: 0 auto 12px; opacity: .95; }
  .dialog.about h2 { font-size: 20px; letter-spacing: -.01em; margin-bottom: 2px; }
  .dialog.about .version { margin: 0 0 14px; font-size: 11px; color: var(--ink-2); letter-spacing: .04em; }
  .dialog.about .links { display: flex; justify-content: center; gap: 18px; margin: 12px 0; }
  .dialog.about .links a { text-decoration: none; border-bottom: 1px solid var(--line-2); padding-bottom: 1px; font-size: 12px; }
  .dialog.about .links a:hover { border-bottom-color: var(--ink); }
  .dialog.about p.small { max-width: 360px; margin: 10px auto; }
  .dialog.about p:last-child { margin-top: 16px; }
  input, select, textarea { -webkit-user-select: text; user-select: text; cursor: auto; }
  /* ---------- form controls drawn by the page, the same on every platform and in the browser ---------- */
  select { appearance: none; -webkit-appearance: none; background-color: var(--panel-3); color: var(--ink); border: 1px solid var(--line-2); border-radius: 2px; padding: 3px 22px 3px 7px; font: inherit; font-size: 11.5px; line-height: 1.3; cursor: pointer;
           background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23b9b9b4' stroke-width='1.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 7px center; }
  select:hover { border-color: var(--ink-3); }
  select:focus { outline: none; border-color: var(--ink-2); }
  select:disabled { opacity: .45; cursor: default; pointer-events: none; }
  select option { background: var(--panel-3); color: var(--ink); }
  input[type=checkbox] { appearance: none; -webkit-appearance: none; width: 14px; height: 14px; margin: 0; border: 1px solid var(--line-2); border-radius: 2px; background: var(--panel-3); position: relative; cursor: pointer; vertical-align: middle; flex: none; }
  input[type=checkbox]:hover { border-color: var(--ink-3); }
  input[type=checkbox]:checked { background: var(--ink); border-color: var(--ink); }
  input[type=checkbox]:checked::after { content: ""; position: absolute; left: 4px; top: 1px; width: 4px; height: 8px; border: solid var(--chrome); border-width: 0 2px 2px 0; transform: rotate(45deg); }
  input[type=checkbox]:focus-visible { outline: 1px solid var(--ink-2); outline-offset: 1px; }
  input[type=checkbox]:disabled { opacity: .45; cursor: default; }
  input[type=number], input[type=text], input[type=search], input[type=password], textarea { appearance: none; -webkit-appearance: none; background: var(--panel-3); color: var(--ink); border: 1px solid var(--line-2); border-radius: 2px; padding: 3px 7px; font: inherit; font-size: 11.5px; }
  input:focus, textarea:focus { outline: none; border-color: var(--ink-2); }
  input[type=search]::-webkit-search-cancel-button { -webkit-appearance: none; }
  input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { opacity: 1; }
  .sel { -webkit-user-select: text; user-select: text; cursor: text; }   /* the device's identity and the preset name can be copied */
  body.dragging, body.dragging .sel { -webkit-user-select: none; user-select: none; }   /* while a control is dragged, nothing is picked up as text */
  svg, img { -webkit-user-select: none; user-select: none; -webkit-user-drag: none; }
  button, .pbtn, .tab, .vg, .knob, .dbtn, .tog, .rbtn, .sqbtn, .sw { cursor: pointer; }
  /* a transfer or slot operation taking longer than 1 s: body.loading, set by the page */
  .spin { display: none; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--ink); animation: spin .8s linear infinite; flex: none; }
  body.loading .spin { display: inline-block; }
  @keyframes spin { to { transform: rotate(360deg); } }
  /* it keeps turning under "reduce motion" too: a 12 px ring is the one thing that must show movement */
  .status .dot { flex: 0 0 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px var(--ok); }   /* flex: 0 0: a flex item shrinks by default, which squashed the dot into an ellipse when the text wrapped */
  .status select { font-size: 11px; }

  /* no device: the panel, strip, matrix and keyboard are shown but greyed and inert */
  body.offline .panelwrap, body.offline .vgstrip, body.offline #matrixbody, body.offline .keys { opacity: .32; pointer-events: none; filter: grayscale(.5); }
  body.offline .secthead { opacity: .32; }
  body.resetting .topbar .pbtn:not(#b-about):not(#b-manual), body.resetting .topbar select, body.resetting .library, body.resetting .modal:not(#about) { pointer-events: none; opacity: .4; }
  /* ---------- the keyboard at the bottom: pitch bend and modwheel, C1 to C7 ---------- */
  .keys { display: flex; gap: 8px; align-items: stretch; height: 78px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; user-select: none; -webkit-user-select: none; }
  .card.sect .keys { flex-direction: column; height: auto; gap: 6px; }
  .keys .kbrow { display: flex; gap: 8px; height: 66px; }
  .wheels { display: flex; gap: 5px; }
  .wheel { position: relative; width: 20px; background: linear-gradient(180deg, #2e2e2e, #1a1a1a); border: 1px solid var(--line-2); border-radius: 2px; cursor: ns-resize; touch-action: none; }
  .wheel::before { content: ""; position: absolute; left: 3px; right: 3px; top: 50%; height: 1px; background: var(--line-2); }
  .wthumb { position: absolute; left: 2px; right: 2px; height: 7px; margin-top: -3px; background: var(--ink); border-radius: 2px; box-shadow: 0 1px 2px rgba(0,0,0,.6); pointer-events: none; }
  .kb { position: relative; flex: 1; display: flex; gap: 1px; touch-action: none; }
  .wk { flex: 1; background: linear-gradient(180deg, #fbfbfa 0 6%, #f1f1ef 55%, #d8d8d4 92%, #c3c3bf); border: 1px solid #2a2a2a; border-top: 0; border-radius: 0 0 3px 3px; position: relative; min-width: 0;
        box-shadow: inset 0 1px 0 #fff, inset -1px 0 0 rgba(0,0,0,.10), inset 1px 0 0 rgba(255,255,255,.65), 0 2px 3px rgba(0,0,0,.45); }
  .wk.c::after { content: attr(data-name); position: absolute; left: 0; right: 0; bottom: 3px; text-align: center; font-size: 8px; color: #6a6a66; letter-spacing: .04em; }
  .bk { position: absolute; top: 0; height: 58%; background: linear-gradient(180deg, #3a3a3a 0 8%, #232323 60%, #0b0b0b); border: 1px solid #000; border-top: 0; border-radius: 0 0 2px 2px; z-index: 1;
        box-shadow: inset 0 1px 0 rgba(255,255,255,.22), inset -1px 0 0 rgba(255,255,255,.06), 0 3px 4px rgba(0,0,0,.6); }
  .wk.on { background: linear-gradient(180deg, #ff9fb0, #ef5c78); }
  .bk.on { background: linear-gradient(180deg, #b31a38, #7a1026); }
  .sessionbar { display: flex; align-items: center; gap: 10px; background: var(--panel); border: 1px solid var(--accent); border-radius: 3px; padding: 7px 12px; font-size: 11.5px; }
  .sessionbar[hidden] { display: none; }   /* display: flex above would otherwise beat the hidden attribute */
  .sessionbar span { flex: 1; }
  /* ---------- the parameters section: values of every group as a table ---------- */
  table.params { border-collapse: collapse; font-size: 11px; width: 100%; user-select: none; }
  table.params th { font-size: 9.5px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-2); padding: 6px 8px; text-align: center; border-bottom: 1px solid var(--line-2); }
  table.params th.rowh, table.params td.rowh { text-align: left; width: 22%; color: var(--ink-2); padding-left: 8px; }
  table.params th.tgt { color: var(--accent); }
  table.params td { text-align: center; padding: 3px 8px; height: 24px; border-bottom: 1px solid var(--line); font-family: var(--mono); font-variant-numeric: tabular-nums; cursor: ns-resize; position: relative; }
  table.params td.rowh { font-family: var(--font); cursor: default; }
  table.params td.tgt { background: var(--accent-dim); }
  table.params td.empty { color: var(--ink-3); cursor: default; }
  table.params td.flag { cursor: pointer; font-family: var(--font); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; }
  table.params td.flag.on { color: var(--ink); } table.params td.flag.off { color: var(--ink-3); }
  table.params td:hover:not(.rowh):not(.empty) { background: rgba(255, 255, 255, .04); }
  table.params td .numentry { left: 50%; top: 50%; transform: translate(-50%, -50%); width: 52px; }
  #paramsbody .tabs.sub { margin: 2px 0 8px; }
  /* ---------- the randomizer under the matrix ---------- */
  .card h3.secthead.sub { margin: 10px -12px 0; padding: 8px 12px 10px; border-top: 1px solid var(--line); font-size: 10.5px; }
  .card h3.secthead.sub.first { margin-top: 4px; padding-top: 4px; border-top: 0; }
  .card h3.secthead.sub.closed { margin-bottom: -10px; }
  .rand { display: flex; gap: 24px; flex-wrap: wrap; padding: 10px 0 2px; }
  .rand[hidden] { display: none; }
  .randcol { min-width: 260px; }
  .rand .randcol:not(.ranges) { flex: 1 1 420px; }   /* the pickers take the width that is left, the ranges keep theirs */
  .randcol.ranges { flex: 0 0 440px; }   /* wide enough for the three buttons on one line */
  .rand .label { margin-bottom: 5px; }
  .chips { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
  /* the pickers: one section per line, its name in a column of their own, a hairline between them, the count at the end */
  .chiprows { display: grid; grid-template-columns: auto 1fr auto; align-items: baseline; column-gap: 12px; }
  .chiprows > * { padding: 8px 0; border-top: 1px solid var(--line); }
  .chiprows > :nth-child(-n+3) { border-top: 0; }
  .chiprows .rlabel { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
  .chiprows .rname { background: none; border: 0; padding: 0; font: inherit; font-size: 9.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
  .chiprows .rname:hover { color: var(--ink); }
  .chiprows .rname.all { color: var(--ink-2); }
  .chiprows .rchips { display: flex; flex-wrap: wrap; gap: 4px; }
  .chiprows .count { font-family: var(--mono); font-size: 10px; color: var(--ink-3); text-align: right; }
  .scope { display: inline-flex; gap: 2px; }
  /* picked is quiet, with a red edge, and what is left out is the faint one: the eye reads the line, not a wall of blocks */
  .chip { font: inherit; font-size: 9px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; padding: 3px 7px; border: 1px solid transparent; border-radius: 2px; background: var(--panel-3); color: var(--ink-3); opacity: .55; line-height: 1; cursor: pointer; }
  .chip:hover { border-color: var(--line-2); color: var(--ink); opacity: 1; }
  .chip.on { border-color: var(--line-2); color: var(--ink); opacity: 1; box-shadow: inset 2px 0 0 var(--accent); }
  .chip.mid { border-color: var(--line); color: var(--ink-2); opacity: 1; box-shadow: inset 2px 0 0 var(--line-2); }   /* picked for some of the LFOs the line covers */
  .chip.num { padding: 3px 5px; }
  .randcol .row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0; border-bottom: 1px solid var(--line); font-size: 11.5px; }
  .randcol .row > span:first-child { color: var(--ink-2); }
  .randcol .pair { display: flex; align-items: center; gap: 6px; color: var(--ink-2); }
  .randcol input[type=number] { width: 58px; }
  .randcol .btns { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; margin-top: 10px; }
  .randcol .btns .pbtn { white-space: nowrap; }
  /* range rules: a full-width block under the columns, one line per rule */
  .randrules { flex: 1 0 100%; }
  /* the three buttons close the pane, under everything that feeds them, across its whole width */
  .rand .btns.randgo { flex: 1 0 100%; display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 6px; margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--line); }
  .rand .btns.randgo .pbtn { white-space: nowrap; }
  .rules { display: flex; flex-direction: column; margin-bottom: 8px; }
  .rules:empty::before { content: "No rules yet: the ranges above apply to everything."; font-size: 11px; color: var(--ink-3); display: block; padding: 4px 0; }
  .rule { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--ink-2); padding: 3px 0; border-bottom: 1px solid var(--line); }
  .rule select.target { min-width: 200px; }
  .rule .pair { display: flex; align-items: center; gap: 6px; }
  .rule .x { margin-left: auto; }
  .dice { font-size: 20px; line-height: 0; vertical-align: middle; position: relative; top: -1px; margin-right: 4px; }
  body.offline .rand { opacity: .32; pointer-events: none; }
  /* a transfer the user waits for (load, write, init, reload, sync): the window is inert at once and greys out with the spinner after 300 ms */
  body.busy .app > :not(.topbar), body.busy .presetbar, body.busy #b-library, body.busy .library .libbody, body.busy .library .libhead .pbtn, body.busy .library .libhead select, body.busy .library .libhead input { pointer-events: none; }
  body.busyshow .app > :not(.topbar), body.busyshow .presetbar, body.busyshow .presetname, body.busyshow #b-library, body.busyshow .library .libbody { opacity: .32; filter: grayscale(.5); }
  body.busyshow .status .spin { display: inline-block; }
  /* ---------- collapsible sections: a header line with a chevron ---------- */
  .secthead { display: flex; align-items: center; gap: 10px; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); cursor: pointer; padding: 10px 12px; margin: -10px -12px 0; }
  .secthead:hover { color: var(--ink); }
  .secthead i { margin-left: auto; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translate(-2px, -2px); transition: transform .15s; background: none !important; border-radius: 0 !important; }
  .secthead.closed i { transform: rotate(-45deg) translate(-1px, 1px); }
  .card h3.secthead { color: var(--ink); margin: -10px -12px 8px; }   /* beats .card h3's own margin: the bar reaches the card's edges */

  .card h3.secthead.closed { margin-bottom: -10px; }   /* nothing below it: the bar ends at the card's edge */
  .vgstrip[hidden], .keys[hidden] { display: none; }   /* their display: flex would otherwise beat the hidden attribute */
  .card.sect .keys { border: 0; padding: 0; background: none; border-radius: 0; }
  /* ---------- voice group strip ---------- */
  .vgstrip { display: flex; align-items: stretch; gap: 6px; flex-wrap: wrap; }
  .vg { flex: 1 1 0; min-width: 150px; display: flex; flex-direction: column; gap: 5px; background: var(--panel); border: 1px solid var(--line); border-radius: 3px; padding: 7px 10px; text-align: left; position: relative; }
  .vg:hover { border-color: var(--line-2); }
  .vg .row { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
  .vg .t { font-size: 11px; font-weight: 700; letter-spacing: .08em; }
  .vg .ch { font-family: var(--mono); font-size: 10px; color: var(--ink-3); white-space: nowrap; }
  .vg .voices { display: flex; gap: 4px; }
  /* at the foot of the card: what the exciter is making, and the envelope that plays it */
  .vg .plots { gap: 8px; margin-top: 1px; }
  .vg .plotbox { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; }
  .vg .plot { width: 100%; height: 30px; }
  .vg .plotcap { font-size: 8px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); text-align: center; margin-top: 1px; }
  .vg .plot .curve { fill: none; stroke: var(--ink-2); stroke-width: 1.2px; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
  .vg .plot .axis { stroke: var(--line); stroke-width: 1px; vector-effect: non-scaling-stroke; }
  .vg.sel .plot .curve { stroke: var(--ink); }
  .vg.empty .plot { opacity: .45; }
  .vg .voices i { width: 14.75px; height: 14.75px; border-radius: 50%; border: 1px solid var(--line-2); background: transparent; display: inline-grid; place-items: center; font-style: normal; font-size: 8.5px; color: var(--ink-3); }
  .vg .voices i { cursor: pointer; }
  .vg .voices i.on { background: var(--ink); color: var(--chrome); border-color: var(--ink); }
  .vg .voices i.free { border-style: dashed; }
  .vg .voices i:hover { border-color: var(--ink); }
  .vg .flags { display: flex; gap: 3px; }
  /* ---------- the service page shares the library's frame ---------- */
  .svcbody { padding: 12px; }
  .svcgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 12px; align-items: start; }
  .svcgrid .card .row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 5px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; }
  .svcgrid .card .row > span:first-child { color: var(--ink-2); }
  .svcgrid .card input[type=number], .svcgrid .card input[type=text], .svcgrid .card select { font-size: 11.5px; }
  .svcgrid .card input[type=number] { width: 90px; }
  .svcgrid .card input[type=text] { width: 220px; }
  .svcgrid .card .btns { display: flex; justify-content: flex-end; gap: 6px; margin-top: 10px; }
  .svcgrid .card p.small { font-size: 11px; color: var(--ink-2); margin: 6px 0; }
  .svcgrid .card progress { width: 100%; height: 8px; appearance: none; -webkit-appearance: none; border: 1px solid var(--line-2); border-radius: 2px; background: var(--panel-3); overflow: hidden; margin-top: 6px; }
  .svcgrid .card progress::-webkit-progress-bar { background: var(--panel-3); }
  .svcgrid .card progress::-webkit-progress-value { background: var(--accent); }
  /* ---------- preset library: the whole window, above the panel ---------- */
  .library { position: fixed; inset: 0; z-index: 25; background: var(--chrome); display: flex; flex-direction: column; gap: 10px; padding: 12px 16px; }
  .library[hidden] { display: none; }
  .libhead { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
  .libhead h2 { margin: 0 8px 0 0; font-size: 18px; }
  .libhead h2 span { font-weight: 400; color: var(--ink-2); font-size: 12px; margin-left: 8px; font-family: var(--mono); }
  .libtabs { display: flex; gap: 2px; border-bottom: 0; }
  .libtabs .tab { padding: 6px 8px; }
  .libhead input { padding: 4px 8px; }
  .libhead select { padding: 4px 24px 4px 8px; }   /* room for the chevron after the text */
  .libhead input { width: 220px; }
  .libstatus { flex: 1; text-align: right; font-size: 11px; color: var(--ink-2); min-width: 120px; }
  .libstatus.err { color: var(--led-red); }
  .libbody { flex: 1; min-height: 0; overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 3px; }
  .libfoot { margin: 0; font-size: 11px; color: var(--ink-3); }
  table.lib { width: 100%; border-collapse: collapse; font-size: 12px; }
  table.lib th { text-align: left; font-size: 9.5px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-2); padding: 7px 8px; position: sticky; top: 0; z-index: 1; background: var(--panel); border-bottom: 1px solid var(--line-2); }
  table.lib td { padding: 3px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; height: 30px; }
  table.lib tr.sub td { background: var(--panel-2); font-size: 9.5px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-2); height: 24px; }
  table.lib td.slot { font-family: var(--mono); font-variant-numeric: tabular-nums; width: 64px; color: var(--ink-2); }
  table.lib td.name { font-weight: 600; min-width: 160px; }
  table.lib tr.empty td.name { color: var(--ink-3); font-weight: 400; }
  table.lib td.cat { min-width: 90px; color: var(--ink-2); white-space: nowrap; }
  table.lib td.author { min-width: 90px; color: var(--ink-2); white-space: nowrap; }
  table.lib td.desc { color: var(--ink-2); width: 100%; max-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }   /* takes what is left, shrinks first */
  table.lib td.acts { white-space: nowrap; text-align: right; width: 1%; }
  table.lib th.sel, table.lib td.sel { width: 22px; padding-right: 0; }   /* the tick column: choose several presets, then Delete selected */
  table.lib tr.selected td { background: var(--panel-3); }
  table.lib tr.sub td { cursor: pointer; }   /* a sub-bank line ticks or unticks its presets */
  table.lib tr.cur td { background: var(--accent-dim); }
  table.lib tr.cur td.slot { color: var(--accent); font-weight: 500; }
  table.lib tr.row:hover td { background: rgba(255, 255, 255, .03); }
  table.lib tr.cur:hover td { background: var(--accent-dim2); }
  table.lib tr[draggable=true] { cursor: grab; }
  table.lib tr.drop td { box-shadow: inset 0 0 0 1px var(--ink); }
  .pbtn.mini { padding: 4px 6px 3px; font-size: 9px; letter-spacing: .08em; margin-left: 3px; }
  .library.busy .pbtn.mini, .library.busy tr[draggable=true] { opacity: .45; pointer-events: none; }
  .library.reading .libbody, .library.reading .libtabs, .library.reading #lib-search, .library.reading #lib-cat { opacity: .35; pointer-events: none; }
  .library.reading .libstatus { color: var(--ink); }                         /* the waiting line and its spinner stay bright */
  .library.reading .spin { display: inline-block; border-color: var(--ink-3); border-top-color: #fff; }   /* shown at once here, not after the usual second */
  .dialog .field { display: flex; flex-direction: column; gap: 3px; margin: 8px 0; }
  .dialog ol.importplan { list-style: none; margin: 4px 0 8px; padding: 0; font-size: 11px; color: var(--ink-2); font-family: var(--mono); max-height: 14em; overflow: auto; }
  .dialog ol.importplan li { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 1px 0; }
  .dialog ol.importplan li.more { font-family: var(--font); }
  .dialog .field span { font-size: 9.5px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-2); }
  .dialog input[type=text], .dialog input[type=password], .dialog textarea { width: 100%; padding: 5px 7px; font-size: 12.5px; resize: vertical; }
  .dialog .btns { display: flex; justify-content: flex-end; gap: 6px; margin-top: 12px; }
  .dialog p.right { text-align: right; }
  .dialog .warn { color: var(--led-red); font-size: 11.5px; margin: 6px 0; }
  .dialog .subtitle { font-size: 12px; color: var(--ink-2); margin: -2px 0 8px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }   /* which preset the tab belongs to: a caption, not a setting */
  .dialog .subtitle b { color: var(--ink); font-weight: 600; margin-left: 5px; }
  .dialog .subtitle span { color: var(--ink); font-weight: 600; margin-left: 8px; }
  .dialog .subtitle span.sep { color: var(--ink-2); font-weight: 400; margin-left: 6px; }
  .dialog .row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 5px 0; }
  .dialog .row[hidden] { display: none; }   /* its display: flex would otherwise beat the hidden attribute */
  .dialog progress { width: 100%; height: 10px; appearance: none; -webkit-appearance: none; border: 1px solid var(--line-2); border-radius: 2px; background: var(--panel-3); overflow: hidden; }
  .dialog progress::-webkit-progress-bar { background: var(--panel-3); }
  .dialog progress::-webkit-progress-value { background: var(--accent); transition: width .2s; }
  .dialog progress::-moz-progress-bar { background: var(--accent); }
  .dialog #fw-stage { font-size: 13px; font-weight: 600; margin: 10px 0 6px; }
  .pane input[type=text] { width: 260px; }
  .dialog .row > span:first-child { color: var(--ink-2); }
  .ctxmenu { position: fixed; z-index: 45; background: var(--panel-3); border: 1px solid var(--line-2); border-radius: 2px; padding: 4px 0; font-size: 11px; min-width: 130px; box-shadow: 0 6px 18px rgba(0,0,0,.5); }
  .ctxmenu div { padding: 4px 10px; cursor: pointer; }
  .ctxmenu div:hover { background: var(--panel-2); }
  .ctxmenu div.off { color: var(--ink-3); cursor: default; }
  .vg .menu { position: absolute; right: 8px; top: 24px; z-index: 5; background: var(--panel-3); border: 1px solid var(--line-2); border-radius: 2px; padding: 4px 0; font-size: 11px; min-width: 170px; }
  .vg .menu div { padding: 4px 10px; cursor: pointer; }
  .vg .menu div:hover { background: var(--panel-2); }
  .vg .menu div.off { color: var(--ink-3); cursor: default; }
  .vg .flags b { font-size: 7.5px; line-height: 1; letter-spacing: .06em; padding: 1.9px 3px 1.55px; display: inline-flex; align-items: center; justify-content: center;   /* built from its padding, the extra above centring the capitals in the em box */ white-space: nowrap; border: 1px solid var(--line-2); border-radius: 2px; color: var(--ink-3); cursor: pointer; font-weight: 700; }
  .vg .flags b.blocked { opacity: .45; }   /* its channel is the preset's: ECHON 6 reads unison there as the preset's own */
  .vg .flags b:hover { border-color: var(--ink); color: var(--ink); }
  .vg .flags b.on { background: var(--accent); border-color: var(--accent); color: #fff; }
  .vg.empty { opacity: .45; }
  .vg.sel { border-color: var(--ink-2); }
  .vg.sel .t::after { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-left: 6px; vertical-align: 1px; }
  .vg.aux { border-style: dashed; }
  .vg.aux.sel { border-style: solid; }
  .vgstrip .link { flex: 0 0 auto; display: flex; flex-direction: column; justify-content: center; gap: 4px; padding: 7px 12px; }
  .vgstrip .link .pbtn { width: 100%; }
  .targetline { font-size: 11px; color: var(--ink-2); padding: 0 4px; min-height: 16px; }
  .targetline b { color: var(--ink); font-weight: 600; }


  /* ---------- the panel: artwork with an exact overlay (positions in % of the artwork) ---------- */
  .panelwrap { overflow-x: auto; }
  /* the panel waits for its drawing and its controls, then fades in as one (see panelPiece in app.js) */
  .panel { opacity: 0; }
  body.panelready .panel { opacity: 1; transition: opacity .2s ease; }
  .panel { position: relative; width: 100%; min-width: 1100px; margin: 0 auto; aspect-ratio: 422 / 162;   /* the SVG's viewBox in mm (tools/gen_panel_svg.py prints it), until the SVG arrives and app.js sets it from there */ container-type: inline-size; background: #222; user-select: none; -webkit-user-select: none; }
  .panel .art { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }   /* the drawing, inline SVG: laid out and zoomed with the controls, not scaled as an image */
  .panel .art svg { display: block; width: 100%; height: 100%; }
  .overlay { position: absolute; inset: 0; }
  .ctl { position: absolute; transform: translate(-50%, -50%); }
  /* pots */
  .knob { cursor: ns-resize; touch-action: none; }
  .knob svg { width: 100%; height: 100%; display: block; overflow: visible; }
  /* the knob front is art from ui/art: the page turns it with the value and draws the pointer, the arcs, the
     original-value tick and the readout around it (ui/art/README.md) */
  .knob .face { transform-box: fill-box; transform-origin: 50% 50%; transform: rotate(calc(var(--art-knob-turn, 1) * var(--knob-angle, 0deg))); }
  .knob .ptr { stroke: #f5f5f2; stroke-width: 3.5px; stroke-linecap: round; vector-effect: non-scaling-stroke; }   /* one screen width on every knob size */
  .knob .tick { stroke: var(--accent); stroke-width: 3.5px; stroke-linecap: round; vector-effect: non-scaling-stroke; }   /* original value: a radial mark outside the printed ring, drawn like the pointer */
  .knob.white .ptr { stroke: #161616; }
  .knob .marc, .knob .rest { display: none; }   /* the arcs of every source at rest stay off: the destination buttons carry the state */
  .knob .marc { fill: none; stroke-linecap: round; opacity: 0; }   /* on the printed ring and as wide as its line (the width is set per knob in app.js), drawn under the cap */
  .knob .mbed { display: none; fill: none; stroke: #222; stroke-linecap: butt; }   /* the panel's colour (ui/panel.svg) under a painted depth, so its edges never meet the white ring */
  .modmode .knob.dest .mbed { display: block; }
  .knob .marc.pos { stroke: var(--led-red); }
  .knob .marc.neg { stroke: var(--led-blue); }
  .knob .ghost { display: none; stroke: #8a8a86; stroke-width: 3; stroke-dasharray: 3 3; stroke-linecap: round; }
  .knob .rest { fill: none; stroke-width: 3; opacity: .9; }
  .knob .rest.pos { stroke: var(--led-red); }
  .knob .rest.neg { stroke: var(--led-blue); }
  .knob .readout { font-family: var(--mono); font-size: 16px; fill: #f2f2f0; text-anchor: middle; opacity: 0; transition: opacity .12s; pointer-events: none; }
  .knob .shape { fill: none; stroke: #f2f2f0; stroke-width: 1.3px; stroke-linejoin: round; stroke-linecap: round; opacity: 0; transition: opacity .12s; pointer-events: none; }   /* the mix the knob makes, drawn in the cap */
  .knob.white .shape { stroke: #111; }
  .knob:hover .readout, .knob.dragging .readout, .knob.showvalue .readout,
  .knob:hover .shape, .knob.dragging .shape, .knob.showvalue .shape { opacity: 1; }   /* showvalue: it moved on ECHON 6 or in the table, and says what it is for a moment */
  .knob.white .readout { fill: #111; font-weight: 500; }   /* the light aluminium caps: dark text reads better */
  .knob.inert { cursor: default; opacity: .9; }
  .modmode .knob.dest .marc { display: block; opacity: 1; }   /* painting: the latched source's depth as an arc on the ring, red or blue */
  .modmode .knob:not(.dest):not(.white) { opacity: .35; pointer-events: none; }
  /* destination buttons: light translucent caps; a painted depth tints the whole cap */
  /* translucent white caps: a brighter inner disc inside a slightly darker rim, as in the photo */
  .dbtn { border-radius: 50%; border: 0; padding: 0; background: var(--art-button-dest) center / 100% 100% no-repeat; cursor: pointer; position: relative; box-shadow: 0 0 2px rgba(0,0,0,.6); }
  .dbtn.press, .dbtn.down { transform: translate(-50%, -50%) translateY(2px); box-shadow: 0 0 1px rgba(0,0,0,.6), inset 0 1px 3px rgba(0,0,0,.35); }   /* pressed: down and slightly shaded */
  .dbtn::after { content: ""; position: absolute; inset: 0; border-radius: 50%; opacity: 0; transition: opacity .1s; }
  .dbtn.pos::after { background: radial-gradient(circle at 50% 45%, var(--led-red) 0%, rgba(226,23,61,.85) 55%, rgba(226,23,61,.25) 100%); opacity: var(--lvl, 1); box-shadow: 0 0 10px rgba(226,23,61,.6); }
  .dbtn.neg::after { background: radial-gradient(circle at 50% 45%, var(--led-blue) 0%, rgba(43,143,230,.85) 55%, rgba(43,143,230,.25) 100%); opacity: var(--lvl, 1); box-shadow: 0 0 10px rgba(43,143,230,.6); }
  body.blinkoff .dbtn.muted::after { opacity: 0; }                       /* a muted routing blinks its painted colour, like the panel LED */
  /* round translucent toggle buttons: same cap, lit white when on */
  /* the round buttons sit in the print's white discs, so whatever lifts them stays centred: an offset edge under
     the button read as the button sitting high in its ring */
  :root { --tog-rest: 0 0 0 1px rgba(0,0,0,.35), 0 0 4px rgba(0,0,0,.5); }
  .tog { border-radius: 50%; border: 0; padding: 0; position: relative; background: var(--art-button-func-off) center / 100% 100% no-repeat; cursor: pointer; box-shadow: var(--tog-rest); transition: transform .06s, box-shadow .06s; }
  /* pressed: a little smaller and shaded, staying in the middle of its printed disc. The position is an inline
     transform (place() in app.js), which a class's transform cannot add to; the separate scale property combines
     with it, and about the box's top left corner, which that translate has put on the button's centre */
  .tog { transform-origin: 0 0; }
  .tog.press, .tog.down { scale: .96; box-shadow: inset 0 0 5px rgba(0,0,0,.4); }
  .tog.mid { background-image: var(--art-button-func-mid); box-shadow: 0 0 7px rgba(255,255,255,.3), var(--tog-rest); }   /* the middle of a three-step switch (ENV RANGE medium) */
  .tog.on { background-image: var(--art-button-func-on); box-shadow: 0 0 14px rgba(255,255,255,.55), var(--tog-rest); }
  /* the second function (HOLD, LOOP, SINGLE) blinks the button's light, like the hardware */
  .tog.alt { background-image: var(--art-button-func-on); box-shadow: 0 0 14px rgba(255,255,255,.55), var(--tog-rest); }
  body.blinkoff .tog.alt { background-image: var(--art-button-func-off); box-shadow: var(--tog-rest); }
  /* the dark keys' depth, shared by the rectangular, square and upright keys: the dark edge under a key at rest and
     the travel of a press, which lands it on that edge. 2 px since the designer's art (3 px before). */
  :root { --key-travel: 2px; --key-lift: 0 var(--key-travel) 0 #0a0a0a, 0 3px 4px rgba(0,0,0,.45); --key-pressed: 0 0 0 #0a0a0a, 0 1px 2px rgba(0,0,0,.5); }
  /* rectangular keys: dark bevelled body with a raised pill on top; source keys carry a light pill */
  .rbtn { border-radius: 2px; border: 0; padding: 0; position: relative; background: var(--art-key-function) center / 100% 100% no-repeat; cursor: pointer; box-shadow: var(--key-lift); transition: transform .06s, box-shadow .06s; }
  .rbtn.light { background-image: var(--art-key-modsource); }                   /* source keys: a lighter pill than the function keys */
  .rbtn.picked { background-image: var(--art-key-modsource-selected); }                 /* the source ECHON 6 has selected: the key sits up, a shade brighter than the rest */
  .rbtn.press, .rbtn.on, .rbtn.down { transform: translate(-50%, -50%) translateY(var(--key-travel)); box-shadow: var(--key-pressed); }
  .rbtn.inert { cursor: default; }
  /* square numpad keys: dark bevelled body with a raised dome */
  .sqbtn { border-radius: 2px; border: 0; padding: 0; position: relative; background: var(--art-key-numbers) center / 100% 100% no-repeat; cursor: pointer; box-shadow: var(--key-lift); transition: transform .06s, box-shadow .06s; }
  .sqbtn.press, .sqbtn.held, .sqbtn.down { transform: translate(-50%, -50%) translateY(var(--key-travel)); box-shadow: var(--key-pressed); }
  /* SELECT / WAVE rockers */
  .sw { border-radius: 2px; border: 0; padding: 0; position: relative; background: var(--art-key-lfo) center / 100% 100% no-repeat; cursor: pointer; box-shadow: var(--key-lift); transition: transform .06s, box-shadow .06s; }
  .sw.press, .sw.down { transform: translate(-50%, -50%) translateY(var(--key-travel)); box-shadow: var(--key-pressed); }
  /* LEDs: slate rectangles, red when lit */
  .led { border-radius: 10% / 22%; background: #454a52; opacity: .85; box-shadow: inset 0 1px 1px rgba(255,255,255,.25), 0 1px 1px rgba(0,0,0,.5); }
  .led.on { background: var(--led-red); opacity: 1; box-shadow: 0 0 8px var(--led-red); }
  .led.white.on { background: #f4f4f2; box-shadow: 0 0 8px #f4f4f2; }
  .led.dim { background: var(--led-red); opacity: .4; box-shadow: none; }
  .led.white.dim { background: #f4f4f2; opacity: .62; box-shadow: none; }   /* dim white must stay clearly lighter than an unlit LED */
  .led.dim.flash, .led.dim.steady { opacity: 1; }                        /* a synced LFO's wave LED flashes on every beat of the host clock, as the device does on MIDI clock */
  .led.blink { background: var(--led-red); opacity: 1; }                 /* blink phase: body.blinkoff, toggled at 5 Hz by the page */
  body.blinkoff .led.blink { opacity: .15; box-shadow: none; }
  .led.blinkdim { background: var(--led-red); opacity: .4; box-shadow: none; }   /* blinks between dim and off */
  body.blinkoff .led.blinkdim { opacity: .12; }

  /* hint bar */

  /* lower area */
  .lower { display: grid; grid-template-columns: 1fr 360px; gap: 10px; }
  @media (max-width: 1000px) { .lower { grid-template-columns: 1fr; } }
  .card { background: #222; border: 0; border-radius: 3px; padding: 10px 12px; }   /* sections without outlines, the front panel's grey */
  .card.panelcard { padding: 0; overflow: hidden; }   /* the front panel fills its section */
  .card h3 { margin: 0 0 8px; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; display: flex; align-items: center; gap: 10px; }
  .card h3 .sub { font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--ink-3); font-size: 11px; }
  .matrixwrap { overflow-x: auto; }
  table.matrix { border-collapse: collapse; font-family: var(--mono); font-size: 10px; table-layout: fixed; width: 100%; }   /* equal columns across the panel's width */
  table.matrix th, table.matrix td { border: 1px solid #2e2e2e; padding: 0; text-align: center; }
  table.matrix th { font-family: var(--font); font-weight: 600; font-size: 7.5px; line-height: 1.2; letter-spacing: 0; text-transform: uppercase; color: var(--ink-2); padding: 3px 1px; white-space: normal; overflow-wrap: normal; hyphens: manual; vertical-align: bottom; background: var(--panel-2); }
  table.matrix th.rowh { text-align: left; width: 7%; padding-left: 6px; vertical-align: middle; }
  table.matrix th.grp { color: var(--ink); letter-spacing: .08em; padding: 5px 2px; border-bottom: 1px solid #3a3a3a; }
  table.matrix td { height: 24px; cursor: ns-resize; user-select: none; color: var(--ink-3); }
  table.matrix td.pos { color: #fff; background: rgba(226,23,61, calc(.12 + .75 * var(--lvl))); }
  table.matrix td.neg { color: #fff; background: rgba(43,143,230, calc(.12 + .75 * var(--lvl))); }
  table.matrix td.muted { text-decoration: line-through; opacity: .6; }
  table.matrix tr.active th.rowh { color: var(--accent); }
  table.matrix td.hl { outline: 1px solid var(--ink-2); outline-offset: -1px; }
  .log { font-family: var(--mono); font-size: 10.5px; line-height: 1.5; color: var(--ink-2); max-height: 260px; overflow-y: auto; }
  .log .l { display: grid; grid-template-columns: 78px 1fr; gap: 8px; }
  .log .hex { color: var(--ink-3); }
  .log .l.sx .hex { color: #9ad; }
  .log .l:first-child { color: var(--ink); }
  .legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 10.5px; color: var(--ink-2); margin-top: 8px; }
  .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: -1px; margin-right: 4px; }

  /* ---------- plugin additions ---------- */
  .logo { height: 18px; width: auto; margin-right: 6px; vertical-align: -3px; opacity: .92; }
  .status .dot.off { background: var(--ink-3); box-shadow: none; }
  .status .dot.wait { background: #e0a83a; box-shadow: 0 0 8px #e0a83a; }
  .slotpick { display: flex; align-items: center; gap: 6px; }
  .slotpick select + select { margin-left: -2px; }   /* the three slot numbers sit a little closer together */
  .slotpick select { height: 22px; padding: 0 20px 0 6px; line-height: 20px; font-size: 11px; background-position: right 5px center; }   /* the buttons' height */
  /* above the cards, folding away with them: the preset's channel and the Link switch */
  .vgbar { flex: 1 1 100%; display: flex; align-items: center; gap: 8px; padding: 0 2px 1px; }
  .vgbar .ch { font-family: var(--mono); font-size: 10px; color: var(--ink-3); }
  .pbtn:disabled { opacity: .4; cursor: default; pointer-events: none; }   /* out of the pointer's way, so its tooltip is still found: a disabled control sends no events of its own */

/* change log dialog (its width is set with the MPE page's, above) */
.clpane { max-height: 56vh; overflow: auto; padding-right: 4px; font-family: var(--font-text); font-size: 12.5px; line-height: 1.5; }
.clver { border-bottom: 1px solid var(--line); padding: 5px 0; }
.clver:last-child { border-bottom: 0; }
.clver summary { cursor: pointer; list-style: revert; }
.clver summary .date { font-weight: 400; color: var(--ink-2); margin-left: 8px; }
.clver summary .tag { font-size: 9.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-left: 8px; }
.clver h4 { margin: 8px 0 2px; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.clver ul { margin: 2px 0 6px 16px; padding: 0; }
.clver li { margin: 2px 0; }
.clver code { font-size: 11px; }
