/* ==========================================================================
   Hardware panel kit — faceplate rendering
   Panels are designed at a fixed width and scaled with `zoom` by host.mjs.
   Skin tokens (--hw-*) come from the panel definition; see PANELS.md.
   ========================================================================== */

.hw-panel {
  --hw-body: #1c1d20; --hw-body-2: #101113; --hw-face: #24262a; --hw-face-2: transparent;
  --hw-silk: #ecebe6; --hw-silk-dim: color-mix(in srgb, var(--hw-silk) 58%, transparent);
  --hw-accent: #62e3c8; --hw-accent-2: var(--hw-accent);
  --hw-led: #ff4a2a; --hw-led-off: color-mix(in srgb, var(--hw-led) 18%, #000);
  --hw-cap: #2b2d31; --hw-cap-2: #0e0f11; --hw-pointer: #f4f1e8;
  --hw-ring: var(--hw-accent); --hw-ring-track: rgba(255,255,255,.09);
  --hw-screen: #030507; --hw-screen-ink: #9ff4ff; --hw-screen-dim: color-mix(in srgb, var(--hw-screen-ink) 45%, transparent);
  --hw-line: rgba(255,255,255,.08); --hw-section: transparent; --hw-section-line: color-mix(in srgb, var(--hw-silk) 22%, transparent);
  --hw-button: #2c2f34; --hw-button-ink: var(--hw-silk);
  --hw-cheek: #5a321b; --hw-cheek-2: #2c160a; --hw-keys: #f4f1ea;
  --hw-font: Bahnschrift, "DIN Alternate", "DIN Condensed", "Roboto Condensed", "Arial Narrow", sans-serif;
  --hw-radius: 14px;
  --hw-black-width: calc(100% / var(--hw-white-count, 22) * .62);
  position: relative; display: flex; align-items: stretch; box-sizing: border-box;
  font-family: var(--hw-font); font-stretch: 87.5%; color: var(--hw-silk);
  border-radius: var(--hw-radius);
  background: var(--hw-body-2);
  box-shadow: 0 1px 0 rgba(255,255,255,.08) inset, 0 40px 80px -30px rgba(0,0,0,.85), 0 18px 30px -18px rgba(0,0,0,.8), 0 0 0 1px rgba(0,0,0,.6);
  user-select: none; -webkit-user-select: none;
  isolation: isolate;
}
.hw-panel *, .hw-panel *::before, .hw-panel *::after { box-sizing: border-box; }
.hw-body {
  position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px;
  padding: 18px 22px 22px; border-radius: inherit;
  background:
    radial-gradient(120% 80% at 50% -20%, rgba(255,255,255,.10), transparent 55%),
    linear-gradient(180deg, var(--hw-face), var(--hw-body) 60%, var(--hw-body-2));
}
.hw-panel[data-texture="brushed"] .hw-body {
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.035) 0 1px, rgba(0,0,0,.02) 1px 3px),
    radial-gradient(140% 90% at 30% -30%, rgba(255,255,255,.35), transparent 60%),
    linear-gradient(180deg, var(--hw-face), var(--hw-body) 55%, var(--hw-body-2));
}
.hw-panel[data-texture="matte"] .hw-body::before,
.hw-panel[data-texture="powder"] .hw-body::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: .5; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .5 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}
.hw-panel[data-texture="gloss"] .hw-body { background: linear-gradient(180deg, color-mix(in srgb, var(--hw-face) 80%, #fff 20%) 0%, var(--hw-face) 6%, var(--hw-body) 70%, var(--hw-body-2)); }
.hw-panel[data-texture="carbon"] .hw-body { background: repeating-linear-gradient(45deg, rgba(255,255,255,.025) 0 2px, transparent 2px 4px), linear-gradient(180deg, var(--hw-face), var(--hw-body-2)); }

/* chassis forms */
.hw-panel.form-keyboard .hw-body { border-radius: 6px; }
.hw-panel.form-rack { border-radius: 4px; }
.hw-panel.form-rack .hw-body { border-radius: 4px; padding-inline: 74px; }
.hw-rack-ear { position: absolute; top: 0; bottom: 0; width: 52px; background: linear-gradient(90deg, #2a2b2e, #46484c 45%, #2a2b2e); box-shadow: inset 0 0 0 1px rgba(0,0,0,.6); }
.hw-rack-ear-left { left: 0; border-radius: 4px 0 0 4px; } .hw-rack-ear-right { right: 0; border-radius: 0 4px 4px 0; }
.hw-rack-ear::before, .hw-rack-ear::after { content: ""; position: absolute; left: 50%; width: 22px; height: 12px; margin-left: -11px; border-radius: 6px; background: #0c0c0d; box-shadow: inset 0 2px 3px rgba(0,0,0,.9), 0 1px 0 rgba(255,255,255,.15); }
.hw-rack-ear::before { top: 18px; } .hw-rack-ear::after { bottom: 18px; }
.hw-panel.form-boutique { border-radius: 10px; }
.hw-panel.form-boutique .hw-body { border-radius: 10px; }
.hw-panel.form-eurorack .hw-body { border-radius: 2px; }
.hw-cheek { flex: 0 0 34px; border-radius: 10px; position: relative; z-index: 1; }
.hw-cheek-left { margin-right: -6px; } .hw-cheek-right { margin-left: -6px; }
.hw-cheek.cheek-wood { background: repeating-linear-gradient(97deg, rgba(0,0,0,.18) 0 2px, transparent 2px 7px), repeating-linear-gradient(92deg, rgba(255,220,170,.08) 0 1px, transparent 1px 11px), linear-gradient(90deg, var(--hw-cheek-2), var(--hw-cheek) 40%, color-mix(in srgb, var(--hw-cheek) 70%, #000)); box-shadow: inset 0 0 0 1px rgba(0,0,0,.5), inset 3px 0 6px rgba(255,255,255,.1); }
.hw-cheek.cheek-metal { background: linear-gradient(90deg, #1b1c1e, #55585d 38%, #2b2c2f 70%, #141516); box-shadow: inset 0 0 0 1px rgba(0,0,0,.6); }
.hw-cheek.cheek-black { background: linear-gradient(90deg, #0b0b0c, #26272a 40%, #0d0d0e); box-shadow: inset 0 0 0 1px rgba(0,0,0,.6); }

/* header strip */
.hw-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding: 0 4px 4px; min-height: 36px; }
.hw-header.align-right { flex-direction: row-reverse; }
.hw-brand { display: flex; align-items: center; gap: 10px; }
.hw-brand-name { font-weight: 800; letter-spacing: .32em; font-size: 15px; color: var(--hw-silk); }
.hw-logo { display: inline-flex; align-items: center; color: var(--hw-silk); } .hw-logo svg { height: 28px; width: auto; display: block; }
.hw-model { display: flex; align-items: baseline; gap: 10px; text-align: right; }
.hw-model strong { font-size: 26px; font-weight: 300; letter-spacing: .14em; text-transform: uppercase; line-height: 1; }
.hw-badge { font-size: 11px; font-weight: 700; letter-spacing: .14em; padding: 3px 7px; border-radius: 4px; color: var(--hw-body-2); background: var(--hw-accent); }
.hw-model small { font-size: 10px; letter-spacing: .2em; color: var(--hw-silk-dim); text-transform: uppercase; }

/* rows / sections */
.hw-rows { display: flex; flex-direction: column; gap: 10px; }
.hw-row { display: flex; gap: 10px; align-items: stretch; }
.hw-section { position: relative; min-width: 0; display: flex; flex-direction: column; gap: 8px; padding: 10px 12px 12px; border-radius: 10px; background: var(--hw-section); box-shadow: inset 0 0 0 1px var(--hw-line); }
.hw-section.tone-plain { box-shadow: none; background: transparent; }
.hw-section.tone-inset { background: rgba(0,0,0,.18); box-shadow: inset 0 2px 8px rgba(0,0,0,.35), inset 0 0 0 1px rgba(255,255,255,.04); }
.hw-section.tone-raised { background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.01)); box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 1px 0 rgba(0,0,0,.4); }
.hw-section.tone-outline { background: transparent; box-shadow: inset 0 0 0 1.5px var(--hw-section-line); }
.hw-section.tone-bracket { box-shadow: none; background: transparent; border-top: 1.5px solid var(--hw-section-line); border-radius: 0; padding-top: 12px; }
.hw-section.tone-accent { background: color-mix(in srgb, var(--hw-accent) 16%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--hw-accent) 40%, transparent); }
.hw-section-title { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 700; letter-spacing: .22em; color: var(--hw-silk); text-transform: uppercase; white-space: nowrap; }
.hw-section-title::after { content: ""; flex: 1; height: 1px; background: var(--hw-section-line); }
.hw-section-title small { order: 3; font-size: 9px; letter-spacing: .14em; color: var(--hw-silk-dim); font-weight: 500; }
.hw-section.tone-bracket .hw-section-title { position: absolute; top: -8px; left: 50%; transform: translateX(-50%); padding: 0 8px; background: var(--hw-body); }
.hw-section.tone-bracket .hw-section-title::after { display: none; }
.hw-grid { display: grid; gap: 10px 8px; align-items: start; justify-items: center; }
.hw-ctl { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.hw-ctl-label { font-size: 9.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--hw-silk); text-align: center; line-height: 1.15; max-width: 100%; overflow-wrap: anywhere; }
.hw-ctl-value { font: 600 9px/1 "Cascadia Mono", "JetBrains Mono", Consolas, monospace; letter-spacing: 0; color: var(--hw-silk-dim); min-height: 9px; opacity: 0; transition: opacity .15s; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.hw-panel:hover .hw-ctl-value, .hw-ctl.hw-focus .hw-ctl-value, .hw-ctl.dragging .hw-ctl-value { opacity: 1; }
.hw-group { width: 100%; align-items: stretch; }
.hw-group-title { font-size: 9px; letter-spacing: .2em; font-weight: 700; color: var(--hw-silk-dim); text-align: center; margin-bottom: 2px; text-transform: uppercase; }
.hw-label { justify-content: center; }
.hw-label.style-silk span { font-size: 10px; letter-spacing: .16em; font-weight: 600; color: var(--hw-silk-dim); text-transform: uppercase; }
.hw-label.style-title span { font-size: 13px; letter-spacing: .24em; font-weight: 800; color: var(--hw-silk); }
.hw-label.style-logo span { font-size: 30px; letter-spacing: .08em; font-weight: 300; color: var(--hw-silk); text-transform: uppercase; }
.hw-label.style-badge span { font-size: 10px; letter-spacing: .16em; font-weight: 800; padding: 3px 8px; border-radius: 4px; background: var(--hw-accent); color: var(--hw-body-2); }
.hw-art { display: contents; } .hw-art svg { display: block; max-width: 100%; }

/* unbound / unread / focus */
.hw-ctl.hw-unbound { opacity: .5; filter: saturate(.4); pointer-events: none; }
.hw-ctl.hw-unbound .hw-ctl-label::after { content: " ·"; }
.hw-ctl.hw-readonly { opacity: .62; }
.hw-ctl.hw-readonly :is(.hw-dial, .hw-fader-slot, .hw-btn, .hw-sel-opt) { cursor: not-allowed; }
.hw-ctl.hw-readonly .hw-ctl-label::before { content: "⊘ "; color: var(--hw-silk-dim); }
.hw-ctl.hw-focus .hw-ctl-label { color: var(--hw-accent); }
.hw-panel.is-searching .hw-ctl[data-param]:not(.search-hit) { opacity: .28; }
.hw-ctl.search-hit { outline: 2px solid var(--hw-accent); outline-offset: 4px; border-radius: 8px; }
.hw-host.show-unread .hw-ctl.hw-unread::before { content: ""; position: absolute; top: -3px; right: 2px; width: 6px; height: 6px; border-radius: 50%; background: #ffb547; box-shadow: 0 0 6px #ffb547; z-index: 3; }

/* ── knobs ─────────────────────────────────────────────────────────────── */
.hw-knob, .hw-rotary { --d: 50px; }
.hw-ctl.size-xs { --d: 28px; } .hw-ctl.size-s { --d: 38px; } .hw-ctl.size-m { --d: 50px; } .hw-ctl.size-l { --d: 64px; } .hw-ctl.size-xl { --d: 84px; } .hw-ctl.size-xxl { --d: 108px; }
.hw-dial { position: relative; width: var(--d); height: var(--d); border-radius: 50%; cursor: ns-resize; touch-action: none; outline: none; }
.hw-dial:focus-visible { box-shadow: 0 0 0 2px var(--hw-accent); }
.hw-ring { position: absolute; inset: -14%; width: 128%; height: 128%; overflow: visible; pointer-events: none; }
.hw-ring-track { fill: none; stroke: var(--hw-ring-track); stroke-width: 5; stroke-linecap: round; }
.hw-ring-arc { fill: none; stroke: var(--hw-ring); stroke-width: 5; stroke-linecap: round; stroke-dasharray: 0 100; filter: drop-shadow(0 0 3px color-mix(in srgb, var(--hw-ring) 60%, transparent)); transition: stroke-dasharray .05s linear; }
.hw-ctl.hw-unread .hw-ring-arc { stroke-opacity: .35; filter: none; }
.hw-ring-dot { fill: color-mix(in srgb, var(--hw-ring) 14%, #000); transition: fill .06s; }
.hw-ring-dot.on { fill: var(--hw-ring); filter: drop-shadow(0 0 2.5px var(--hw-ring)); }
.hw-ring-tick { stroke: var(--hw-silk-dim); stroke-width: 1.6; }
.hw-cap {
  position: absolute; inset: 14%; border-radius: 50%;
  transform: rotate(var(--turn, -135deg));
  background:
    radial-gradient(circle at 50% 22%, rgba(255,255,255,.22), transparent 42%),
    radial-gradient(circle at 50% 50%, var(--hw-cap) 0 58%, var(--hw-cap-2) 100%);
  box-shadow: 0 calc(var(--d) * .08) calc(var(--d) * .16) rgba(0,0,0,.65), 0 1px 0 rgba(255,255,255,.12) inset, 0 -2px 3px rgba(0,0,0,.45) inset, 0 0 0 1px rgba(0,0,0,.7);
}
.hw-cap-pointer { position: absolute; left: 50%; top: 7%; width: max(2px, calc(var(--d) * .055)); height: 34%; margin-left: calc(max(2px, calc(var(--d) * .055)) / -2); border-radius: 2px; background: var(--hw-pointer); box-shadow: 0 0 2px rgba(0,0,0,.6); }
/* caps — set per control (cap:) or panel-wide (skin.knob) */
:is(.hw-ctl[data-cap="chrome"], .hw-panel[data-knob="chrome"] .hw-ctl:not([data-cap])) .hw-cap {
  background: radial-gradient(circle at 50% 50%, #e9ebee 0 30%, transparent 31%), repeating-conic-gradient(from 0deg, #8d9196 0 4deg, #c9ccd1 4deg 8deg), #9a9ea3;
  box-shadow: 0 calc(var(--d) * .08) calc(var(--d) * .16) rgba(0,0,0,.6), 0 0 0 1px rgba(0,0,0,.6), inset 0 0 0 calc(var(--d) * .05) #6f7378;
}
:is(.hw-ctl[data-cap="chrome"], .hw-panel[data-knob="chrome"] .hw-ctl:not([data-cap])) .hw-cap-pointer { background: #1a1a1a; height: 28%; top: 6%; }
:is(.hw-ctl[data-cap="cream"], .hw-panel[data-knob="cream"] .hw-ctl:not([data-cap])) .hw-cap {
  background: radial-gradient(circle at 40% 28%, #ffffff, #e9e4d6 45%, #b9b2a2 100%);
  box-shadow: 0 calc(var(--d) * .08) calc(var(--d) * .16) rgba(0,0,0,.55), 0 0 0 1px rgba(0,0,0,.45), inset 0 -3px 4px rgba(0,0,0,.18);
}
:is(.hw-ctl[data-cap="cream"], .hw-panel[data-knob="cream"] .hw-ctl:not([data-cap])) .hw-cap-pointer { background: #151515; }
:is(.hw-ctl[data-cap="rubber"], .hw-panel[data-knob="rubber"] .hw-ctl:not([data-cap])) .hw-cap {
  background: radial-gradient(circle at 50% 25%, color-mix(in srgb, var(--hw-ctl-color, var(--hw-cap)) 70%, #fff), var(--hw-ctl-color, var(--hw-cap)) 55%, color-mix(in srgb, var(--hw-ctl-color, var(--hw-cap)) 60%, #000));
}
:is(.hw-ctl[data-cap="soft"], .hw-panel[data-knob="soft"] .hw-ctl:not([data-cap])) .hw-cap {
  background: radial-gradient(circle at 50% 50%, var(--hw-cap) 0 62%, color-mix(in srgb, var(--hw-ctl-color, var(--hw-ring)) 85%, #000) 64% 70%, var(--hw-cap-2) 72%);
}
:is(.hw-ctl[data-cap="soft"], .hw-panel[data-knob="soft"] .hw-ctl:not([data-cap])) .hw-cap-pointer { background: var(--hw-ctl-color, var(--hw-ring)); box-shadow: 0 0 4px var(--hw-ctl-color, var(--hw-ring)); }
:is(.hw-ctl[data-cap="skirt"], .hw-panel[data-knob="skirt"] .hw-ctl:not([data-cap])) .hw-cap {
  inset: 8%;
  background: radial-gradient(circle at 50% 50%, #3a3b3e 0 46%, #0f0f10 47% 49%, #202123 50% 100%);
}
:is(.hw-ctl[data-cap="skirt"], .hw-panel[data-knob="skirt"] .hw-ctl:not([data-cap])) .hw-cap-pointer { top: 2%; height: 46%; background: var(--hw-ctl-color, #f3f0e8); }
:is(.hw-ctl[data-cap="nord"], .hw-panel[data-knob="nord"] .hw-ctl:not([data-cap])) .hw-cap {
  background: radial-gradient(circle at 50% 30%, #6a6b6f, #3a3b3e 50%, #18191b);
  box-shadow: 0 calc(var(--d) * .08) calc(var(--d) * .16) rgba(0,0,0,.6), 0 0 0 1px rgba(0,0,0,.7), inset 0 0 0 calc(var(--d) * .06) #2a2b2d;
}
:is(.hw-ctl[data-cap="nord"], .hw-panel[data-knob="nord"] .hw-ctl:not([data-cap])) .hw-cap-pointer { background: #fff; top: 4%; height: 40%; }
:is(.hw-ctl[data-cap="encoder"], .hw-panel[data-knob="encoder"] .hw-ctl:not([data-cap])) .hw-cap {
  inset: 18%;
  background: radial-gradient(circle at 50% 50%, #34363b 0 46%, transparent 47%), repeating-conic-gradient(#121315 0 6deg, #2b2d31 6deg 12deg);
}
:is(.hw-ctl[data-cap="encoder"], .hw-panel[data-knob="encoder"] .hw-ctl:not([data-cap])) .hw-cap-pointer { width: 18%; height: 18%; top: 12%; margin-left: -9%; border-radius: 50%; background: var(--hw-ring); box-shadow: 0 0 5px var(--hw-ring); }
:is(.hw-ctl[data-cap="davies"], .hw-panel[data-knob="davies"] .hw-ctl:not([data-cap])) .hw-cap {
  background: radial-gradient(circle at 50% 50%, #c7cacf 0 26%, #2a2a2b 27% 30%, transparent 31%), repeating-conic-gradient(#0d0d0e 0 7deg, #1f1f21 7deg 14deg);
}
:is(.hw-ctl[data-cap="davies"], .hw-panel[data-knob="davies"] .hw-ctl:not([data-cap])) .hw-cap-pointer { background: #f5f5f5; top: 3%; height: 24%; }
:is(.hw-ctl[data-cap="flat"], .hw-panel[data-knob="flat"] .hw-ctl:not([data-cap])) .hw-cap { background: var(--hw-ctl-color, var(--hw-cap)); box-shadow: 0 2px 6px rgba(0,0,0,.5), 0 0 0 1px rgba(0,0,0,.5); }
.hw-ctl.dragging .hw-cap { filter: brightness(1.12); }
/* rotary legends */
.hw-rotary.has-legends { --d: 46px; padding: 12px 22px 0; }
.hw-legends { position: absolute; inset: 0; pointer-events: none; }
.hw-legend { position: absolute; transform: translate(-50%, -50%); pointer-events: auto; border: 0; background: none; padding: 1px 2px; font: 600 8px/1 var(--hw-font); letter-spacing: .04em; color: var(--hw-silk-dim); white-space: nowrap; cursor: pointer; text-transform: uppercase; }
.hw-legend.on { color: var(--hw-accent); text-shadow: 0 0 6px color-mix(in srgb, var(--hw-accent) 70%, transparent); }

/* ── faders / wheels / ribbons ─────────────────────────────────────────── */
.hw-fader, .hw-ribbon { --hw-fader-length: 124px; }
.hw-fader-slot { position: relative; width: 30px; height: var(--hw-fader-length); cursor: ns-resize; touch-action: none; outline: none; }
.hw-fader.horizontal .hw-fader-slot, .hw-ribbon .hw-fader-slot { width: var(--hw-fader-length); height: 30px; cursor: ew-resize; }
.hw-fader-slot:focus-visible { box-shadow: 0 0 0 2px var(--hw-accent); border-radius: 6px; }
.hw-fader-groove { position: absolute; left: 50%; top: 6px; bottom: 6px; width: 6px; margin-left: -3px; border-radius: 3px; background: #050506; box-shadow: inset 0 1px 2px rgba(0,0,0,.9), 0 1px 0 rgba(255,255,255,.08); }
.hw-fader-fill { position: absolute; left: 50%; bottom: 6px; width: 2px; margin-left: -1px; height: calc((100% - 12px) * var(--level, 0)); background: var(--hw-ring); box-shadow: 0 0 6px var(--hw-ring); border-radius: 1px; }
.hw-fader.bipolar .hw-fader-fill { bottom: auto; top: calc(6px + (100% - 12px) * (1 - max(var(--level, .5), .5))); height: calc((100% - 12px) * max(var(--level, .5) - .5, .5 - var(--level, .5))); }
.hw-fader-scale { position: absolute; top: 6px; bottom: 6px; right: 0; width: 6px; display: flex; flex-direction: column; justify-content: space-between; }
.hw-fader-scale i { display: block; height: 1px; background: var(--hw-silk-dim); }
.hw-fader-scale::before { content: ""; position: absolute; top: 0; bottom: 0; left: -24px; width: 6px; display: none; }
.hw-fader-cap { position: absolute; left: 50%; width: 30px; height: 18px; margin-left: -15px; bottom: calc(6px + (100% - 12px) * var(--level, 0) - 9px); border-radius: 3px;
  background: linear-gradient(180deg, #5a5d63, #2a2c30 45%, #1a1b1e 55%, #3b3e43); box-shadow: 0 4px 8px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.25), 0 0 0 1px rgba(0,0,0,.7); }
.hw-fader-cap::after { content: ""; position: absolute; left: 3px; right: 3px; top: 50%; height: 2px; margin-top: -1px; background: var(--hw-ctl-color, var(--hw-pointer)); border-radius: 1px; }
.hw-fader.horizontal .hw-fader-groove, .hw-ribbon .hw-fader-groove { left: 6px; right: 6px; top: 50%; bottom: auto; width: auto; height: 6px; margin: -3px 0 0; }
.hw-fader.horizontal .hw-fader-fill, .hw-ribbon .hw-fader-fill { left: 6px; top: 50%; bottom: auto; height: 2px; margin: -1px 0 0; width: calc((100% - 12px) * var(--level, 0)); }
.hw-fader.horizontal .hw-fader-cap { left: calc(6px + (100% - 12px) * var(--level, 0) - 9px); bottom: auto; top: 50%; margin: -15px 0 0; width: 18px; height: 30px; }
.hw-fader.horizontal .hw-fader-cap::after { left: 50%; right: auto; top: 3px; bottom: 3px; width: 2px; height: auto; margin: 0 0 0 -1px; }
.hw-fader.horizontal .hw-fader-scale, .hw-ribbon .hw-fader-scale { display: none; }
.hw-ribbon .hw-fader-slot { height: 22px; border-radius: 11px; background: linear-gradient(180deg, #0b0b0c, #1b1c1f); box-shadow: inset 0 2px 4px rgba(0,0,0,.8), 0 1px 0 rgba(255,255,255,.08); }
.hw-ribbon .hw-fader-groove { display: none; }
.hw-ribbon .hw-fader-fill { height: 100%; top: 0; margin: 0; border-radius: 11px; opacity: .35; }
.hw-ribbon .hw-fader-cap { display: block; left: calc(6px + (100% - 12px) * var(--level, 0) - 6px); top: 3px; bottom: 3px; width: 12px; height: auto; margin: 0; border-radius: 6px; background: var(--hw-ring); box-shadow: 0 0 10px var(--hw-ring); }
.hw-ribbon .hw-fader-cap::after { display: none; }
.hw-fader-led { position: absolute; left: 50%; top: -8px; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: var(--hw-led); opacity: calc(.15 + var(--level, 0) * .85); box-shadow: 0 0 6px var(--hw-led); }
.hw-wheel-well { position: relative; width: 34px; height: 120px; border-radius: 6px; background: #050506; box-shadow: inset 0 2px 6px rgba(0,0,0,.95), 0 1px 0 rgba(255,255,255,.1); overflow: hidden; cursor: ns-resize; touch-action: none; outline: none; }
.hw-wheel-body { position: absolute; left: 4px; right: 4px; top: 6px; bottom: 6px; border-radius: 4px;
  background: linear-gradient(90deg, rgba(0,0,0,.6), transparent 30%, transparent 70%, rgba(0,0,0,.6)),
              repeating-linear-gradient(180deg, #2c2d30 0 3px, #161719 3px 6px);
  background-position: 0 0, 0 calc(var(--level, .5) * -60px);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.6); }
.hw-wheel-body::after { content: ""; position: absolute; left: 0; right: 0; height: 4px; top: calc((1 - var(--level, .5)) * (100% - 4px)); background: var(--hw-ctl-color, var(--hw-pointer)); opacity: .8; }
.hw-wheels { display: flex; gap: 10px; padding: 10px 14px; align-items: center; }

/* ── buttons & LEDs ────────────────────────────────────────────────────── */
.hw-btn-wrap { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.hw-btn-wrap.led-left { flex-direction: row; } .hw-btn-wrap.led-right { flex-direction: row-reverse; } .hw-btn-wrap.led-bottom { flex-direction: column-reverse; }
.hw-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; min-width: 32px; height: 20px; padding: 0 8px; border: 0; border-radius: 4px; cursor: pointer;
  background: linear-gradient(180deg, color-mix(in srgb, var(--hw-ctl-color, var(--hw-button)) 80%, #fff 20%), var(--hw-ctl-color, var(--hw-button)) 40%, color-mix(in srgb, var(--hw-ctl-color, var(--hw-button)) 75%, #000));
  box-shadow: 0 3px 0 color-mix(in srgb, var(--hw-ctl-color, var(--hw-button)) 45%, #000), 0 5px 8px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.18);
  color: var(--hw-button-ink); font: 700 8.5px/1 var(--hw-font); letter-spacing: .1em; text-transform: uppercase; transition: transform .05s, box-shadow .05s; }
.hw-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 color-mix(in srgb, var(--hw-ctl-color, var(--hw-button)) 45%, #000), 0 2px 4px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.12); }
.hw-btn:focus-visible { outline: 2px solid var(--hw-accent); outline-offset: 2px; }
.hw-btn.shape-round { width: 26px; min-width: 26px; height: 26px; padding: 0; border-radius: 50%; }
.hw-btn.shape-square { width: 26px; min-width: 26px; height: 26px; padding: 0; border-radius: 5px; }
.hw-btn.shape-pill { border-radius: 10px; }
.hw-btn.shape-wide { min-width: 52px; }
.hw-btn.shape-tall { width: 22px; min-width: 22px; height: 34px; padding: 0; }
.hw-led { display: inline-block; width: 7px; height: 7px; border-radius: 50%; flex: none;
  background: radial-gradient(circle at 40% 35%, color-mix(in srgb, var(--hw-led) 30%, #222), var(--hw-led-off)); box-shadow: inset 0 1px 1px rgba(0,0,0,.6), 0 1px 0 rgba(255,255,255,.08); transition: background .06s, box-shadow .06s; }
.hw-led.on { background: radial-gradient(circle at 40% 35%, #fff, var(--hw-led) 55%); box-shadow: 0 0 6px var(--hw-led), 0 0 14px color-mix(in srgb, var(--hw-led) 60%, transparent); }
.hw-led.led-inside { position: absolute; top: 3px; right: 3px; width: 5px; height: 5px; }
.hw-btn .hw-led.led-inside.on + .hw-btn-text, .hw-toggle.on .hw-btn-text { color: #fff; }
.hw-ctl[data-cap="lit"] .hw-btn, .hw-toggle.style-lit .hw-btn { transition: background .08s, box-shadow .08s; }
.hw-toggle.style-lit.on .hw-btn { background: radial-gradient(circle at 50% 40%, #fff, var(--hw-led) 70%); box-shadow: 0 0 10px var(--hw-led), 0 3px 0 color-mix(in srgb, var(--hw-led) 40%, #000); color: #111; }
.hw-led-ctl { }
.hw-ctl.hw-led > .hw-led { width: 9px; height: 9px; }

/* selector */
.hw-sel-body { display: flex; align-items: center; gap: 8px; }
.hw-sel-list { display: flex; flex-direction: column; gap: 3px; }
.hw-sel-list.dir-row { flex-direction: row; gap: 8px; }
.hw-selector .hw-sel-body:has(.dir-row) { flex-direction: column; }
.hw-sel-opt { display: flex; align-items: center; gap: 5px; border: 0; background: none; padding: 1px 2px; cursor: pointer; color: var(--hw-silk-dim); font: 600 8.5px/1 var(--hw-font); letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.hw-sel-list.dir-row .hw-sel-opt { flex-direction: column; gap: 4px; }
.hw-sel-opt .hw-led { width: 6px; height: 6px; }
.hw-sel-opt.on { color: var(--hw-silk); } .hw-sel-opt.on .hw-led { background: radial-gradient(circle at 40% 35%, #fff, var(--hw-led) 55%); box-shadow: 0 0 6px var(--hw-led); }
.hw-sel-opt:hover { color: var(--hw-silk); }

/* ── screens ───────────────────────────────────────────────────────────── */
.hw-screen { width: 230px; height: 110px; padding: 7px; border-radius: 8px; background: linear-gradient(180deg, #050505, #1a1b1d); box-shadow: inset 0 0 0 1px rgba(0,0,0,.8), 0 1px 0 rgba(255,255,255,.08); }
.hw-screen-glass { position: relative; height: 100%; display: grid; grid-template-rows: auto auto 1fr auto auto; gap: 2px; padding: 7px 10px; border-radius: 4px; overflow: hidden;
  background: radial-gradient(120% 140% at 50% 0%, color-mix(in srgb, var(--hw-screen-ink) 7%, var(--hw-screen)), var(--hw-screen) 70%);
  color: var(--hw-screen-ink); font-family: "Cascadia Mono", "JetBrains Mono", Consolas, monospace; text-shadow: 0 0 6px color-mix(in srgb, var(--hw-screen-ink) 55%, transparent);
  box-shadow: inset 0 0 18px rgba(0,0,0,.9); }
.hw-screen-glass::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(160deg, rgba(255,255,255,.07), transparent 40%), repeating-linear-gradient(0deg, rgba(0,0,0,.18) 0 1px, transparent 1px 3px); }
.hw-screen-top { display: flex; justify-content: space-between; font-size: 8px; letter-spacing: .14em; color: var(--hw-screen-dim); text-shadow: none; }
.hw-screen-title { font-size: 11px; font-weight: 700; letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hw-screen-value { align-self: center; font-size: 25px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.05; }
.hw-screen-bar { position: relative; height: 5px; border-radius: 3px; background: color-mix(in srgb, var(--hw-screen-ink) 12%, transparent); overflow: hidden; }
.hw-screen-bar i { position: absolute; inset: 0 auto 0 0; width: calc(var(--level, 0) * 100%); background: var(--hw-screen-ink); box-shadow: 0 0 6px var(--hw-screen-ink); }
.hw-screen.bipolar .hw-screen-bar i { left: calc(min(var(--level, .5), .5) * 100%); width: calc(max(var(--level, .5) - .5, .5 - var(--level, .5)) * 100%); }
.hw-screen-foot { font-size: 8px; letter-spacing: .08em; color: var(--hw-screen-dim); text-shadow: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hw-screen.style-oled { --hw-screen: #010203; }
.hw-screen.style-oled-blue { --hw-screen: #01040a; --hw-screen-ink: #79c8ff; }
.hw-screen.style-oled-amber { --hw-screen: #050200; --hw-screen-ink: #ffb43a; }
.hw-screen.style-oled-white { --hw-screen: #020202; --hw-screen-ink: #f2f4f7; }
.hw-screen.style-lcd .hw-screen-glass, .hw-screen.style-lcd-green .hw-screen-glass { --hw-screen-ink: #142007; background: linear-gradient(180deg, #a9c94a, #8fb33a); text-shadow: none; box-shadow: inset 0 0 14px rgba(0,0,0,.45); }
.hw-screen.style-lcd .hw-screen-top, .hw-screen.style-lcd .hw-screen-foot { color: rgba(20,32,7,.7); }
.hw-screen.style-lcd-blue .hw-screen-glass { --hw-screen-ink: #e9f6ff; background: linear-gradient(180deg, #2d63d6, #1d47ab); text-shadow: 0 0 2px rgba(255,255,255,.5); }
.hw-screen.style-lcd-amber .hw-screen-glass { --hw-screen-ink: #2a1300; background: linear-gradient(180deg, #ffb93f, #e69a22); text-shadow: none; }
.hw-screen.style-vfd { --hw-screen: #020807; --hw-screen-ink: #5fffd8; }
.hw-screen:is(.style-seg7, .style-seg7-red, .style-seg7-green, .style-seg7-amber) { width: 120px; height: 64px; }
.hw-screen:is(.style-seg7, .style-seg7-red, .style-seg7-green, .style-seg7-amber) .hw-screen-glass { --hw-screen-ink: #ff3b24; --hw-screen: #120202; grid-template-rows: 1fr auto; padding: 4px 8px; }
.hw-screen.style-seg7-green .hw-screen-glass { --hw-screen-ink: #39ff6a; --hw-screen: #021005; }
.hw-screen.style-seg7-amber .hw-screen-glass { --hw-screen-ink: #ffa41c; --hw-screen: #120700; }
.hw-screen:is(.style-seg7, .style-seg7-red, .style-seg7-green, .style-seg7-amber) :is(.hw-screen-top, .hw-screen-title, .hw-screen-bar) { display: none; }
.hw-screen:is(.style-seg7, .style-seg7-red, .style-seg7-green, .style-seg7-amber) .hw-screen-value { font: 700 26px/1 "Cascadia Mono", Consolas, monospace; font-style: italic; letter-spacing: .06em; text-align: right; transform: skewX(-6deg); }
.hw-screen:is(.style-seg7, .style-seg7-red, .style-seg7-green, .style-seg7-amber) .hw-screen-foot { font-size: 7px; text-align: right; }
.hw-screen.style-dotmatrix .hw-screen-glass { --hw-screen-ink: #b8ff4f; background: radial-gradient(circle, rgba(184,255,79,.06) 1px, transparent 1.4px) 0 0/3px 3px, #0b1402; }

/* ── envelope graph ────────────────────────────────────────────────────── */
.hw-envelope { width: 100%; }
.hw-env-svg { width: 100%; height: 74px; display: block; border-radius: 6px; overflow: visible; background: radial-gradient(120% 140% at 50% 0%, color-mix(in srgb, var(--hw-screen-ink) 8%, var(--hw-screen)), var(--hw-screen) 70%); box-shadow: inset 0 0 0 1px rgba(0,0,0,.8), inset 0 0 12px rgba(0,0,0,.9), 0 1px 0 rgba(255,255,255,.08); }
.hw-envelope.style-silk .hw-env-svg { background: transparent; box-shadow: inset 0 0 0 1px var(--hw-section-line); }
.hw-env-grid { stroke: color-mix(in srgb, var(--hw-screen-ink) 10%, transparent); stroke-width: 1; fill: none; vector-effect: non-scaling-stroke; }
.hw-env-line { fill: none; stroke: var(--hw-screen-ink); stroke-width: 2; stroke-linejoin: round; vector-effect: non-scaling-stroke; filter: drop-shadow(0 0 3px var(--hw-screen-ink)); }
.hw-env-fill { fill: color-mix(in srgb, var(--hw-screen-ink) 13%, transparent); }
.hw-env-handle { fill: var(--hw-screen); stroke: var(--hw-screen-ink); stroke-width: 2; cursor: grab; vector-effect: non-scaling-stroke; }
.hw-env-handle:hover { fill: var(--hw-screen-ink); }
.hw-envelope.hw-unread .hw-env-line { stroke-dasharray: 4 4; opacity: .6; }

/* XY pad */
.hw-xy-pad { position: relative; width: 120px; height: 120px; border-radius: 8px; cursor: crosshair; touch-action: none;
  background: radial-gradient(circle, color-mix(in srgb, var(--hw-screen-ink) 10%, transparent) 1px, transparent 1.4px) 0 0/12px 12px, var(--hw-screen); box-shadow: inset 0 0 0 1px rgba(0,0,0,.8), inset 0 0 14px rgba(0,0,0,.9); }
.hw-xy-cross { position: absolute; inset: 0; background: linear-gradient(var(--hw-screen-dim), var(--hw-screen-dim)) calc(var(--x, .5) * 100%) 0/1px 100% no-repeat, linear-gradient(var(--hw-screen-dim), var(--hw-screen-dim)) 0 calc((1 - var(--y, .5)) * 100%)/100% 1px no-repeat; opacity: .5; }
.hw-xy-dot { position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px; left: calc(var(--x, .5) * 100%); top: calc((1 - var(--y, .5)) * 100%); border-radius: 50%; background: var(--hw-screen-ink); box-shadow: 0 0 12px var(--hw-screen-ink); }

/* jacks */
.hw-jack-socket { width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(circle, #000 0 30%, #9b9ea3 32% 44%, #3a3c40 46% 62%, #c8cbd0 64% 72%, #2b2c2f 74%); box-shadow: 0 2px 3px rgba(0,0,0,.6); }

/* ── keyboard ──────────────────────────────────────────────────────────── */
.hw-keybed { display: flex; gap: 12px; align-items: stretch; padding: 12px 10px 0; margin: 4px -10px -10px; background: linear-gradient(180deg, #0a0a0b, #141416); border-radius: 0 0 8px 8px; box-shadow: inset 0 6px 10px rgba(0,0,0,.8); }
.hw-keys { position: relative; flex: 1; height: 150px; }
.hw-key { position: absolute; top: 0; padding: 0; border: 0; cursor: pointer; }
.hw-key.white { width: calc(100% / var(--hw-white-count) - 2px); height: 100%; border-radius: 0 0 5px 5px; background: linear-gradient(180deg, #d9d6cf, var(--hw-keys) 12%, #fffdf7 88%, #d8d4cb); box-shadow: inset 0 -6px 0 #cfcac0, 0 2px 3px rgba(0,0,0,.55), inset -1px 0 0 rgba(0,0,0,.12); display: flex; align-items: flex-end; justify-content: center; }
.hw-key.white small { font: 600 8px/1 var(--hw-font); color: #8b877e; margin-bottom: 10px; }
.hw-key.black { z-index: 2; width: var(--hw-black-width); height: 62%; border-radius: 0 0 4px 4px; background: linear-gradient(180deg, #2a2a2c, #0f0f10 80%, #2c2c2f); box-shadow: inset 0 -5px 0 #050505, inset 1px 0 0 rgba(255,255,255,.12), 0 3px 4px rgba(0,0,0,.6); }
.hw-key.white.down { background: linear-gradient(180deg, #c8c4bb, #ebe7de 20%, #f6f2e9); box-shadow: inset 0 -2px 0 #cfcac0, 0 1px 1px rgba(0,0,0,.55); }
.hw-key.black.down { background: linear-gradient(180deg, #1a1a1b, #050505); box-shadow: inset 0 -2px 0 #050505; }

/* ── deep-control module ───────────────────────────────────────────────── */
.hw-deep { margin-top: 6px; padding: 12px 14px 14px; border-radius: 10px; background: linear-gradient(180deg, rgba(0,0,0,.34), rgba(0,0,0,.2)); box-shadow: inset 0 0 0 1px rgba(255,255,255,.05), inset 0 2px 10px rgba(0,0,0,.4);
  --hw-silk: #e6f3f0; --hw-silk-dim: rgba(214,236,230,.55); --hw-section-line: rgba(120,230,210,.22); --hw-line: rgba(120,230,210,.10); }
.hw-deep-title { display: flex; align-items: baseline; gap: 14px; margin-bottom: 10px; font-size: 11px; font-weight: 800; letter-spacing: .26em; color: #77ecd6; }
.hw-deep-title small { font-size: 9px; letter-spacing: .12em; font-weight: 500; color: rgba(214,236,230,.55); }
.hw-deep-row { display: flex; flex-wrap: wrap; gap: 10px; }
.hw-deep-row > .hw-section { flex-basis: 220px; }
.hw-panel.hide-deep .hw-deep { display: none; }

/* thumbnails */
.hw-thumbnail { pointer-events: none; }
.hw-thumbnail .hw-ctl-value { display: none; }

/* ── host chrome (app-side, not part of the faceplate) ──────────────────── */
.hw-host { --chrome-bg: var(--surface-1, #121417); --chrome-line: var(--line, rgba(255,255,255,.08)); --chrome-ink: var(--ink, #e8eaed); --chrome-dim: var(--ink-dim, #8b9198); --chrome-accent: var(--accent, #62e3c8);
  display: flex; flex-direction: column; border-radius: 16px; overflow: hidden; background: var(--chrome-bg); box-shadow: 0 0 0 1px var(--chrome-line), 0 24px 60px -30px rgba(0,0,0,.8); margin-bottom: 18px; }
.hw-host-bar { display: flex; align-items: center; gap: 14px; padding: 10px 14px; border-bottom: 1px solid var(--chrome-line); background: linear-gradient(180deg, rgba(255,255,255,.03), transparent); }
.hw-host-title { display: flex; flex-direction: column; min-width: 0; margin-right: auto; }
.hw-host-kicker { font: 600 9px/1.2 var(--font-mono, Consolas, monospace); letter-spacing: .18em; color: var(--chrome-accent); }
.hw-host-title strong { font-size: 15px; font-weight: 600; color: var(--chrome-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hw-host-search { width: 220px; height: 32px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--chrome-line); background: rgba(0,0,0,.25); color: var(--chrome-ink); font: inherit; font-size: 13px; }
.hw-host-search:focus { outline: none; border-color: var(--chrome-accent); }
.hw-host-tools { display: flex; gap: 4px; }
.hw-tool { height: 32px; min-width: 32px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--chrome-line); background: rgba(255,255,255,.03); color: var(--chrome-ink); font: 500 12px/1 inherit; font-family: inherit; cursor: pointer; }
.hw-tool:hover:not(:disabled) { background: rgba(255,255,255,.08); }
.hw-tool[aria-pressed="true"] { border-color: color-mix(in srgb, var(--chrome-accent) 60%, transparent); color: var(--chrome-accent); background: color-mix(in srgb, var(--chrome-accent) 10%, transparent); }
.hw-tool:disabled { opacity: .4; cursor: default; }
.hw-host-stage { position: relative; overflow: auto; padding: 26px 12px 30px; background: radial-gradient(90% 70% at 50% 0%, rgba(255,255,255,.05), transparent 70%), repeating-linear-gradient(0deg, rgba(255,255,255,.012) 0 1px, transparent 1px 28px), repeating-linear-gradient(90deg, rgba(255,255,255,.012) 0 1px, transparent 1px 28px), #0b0c0e; max-height: min(78vh, 980px); }
.hw-host-frame { display: flex; justify-content: center; min-width: min-content; }
.hw-host.is-fullscreen { border-radius: 0; height: 100vh; }
.hw-host.is-fullscreen .hw-host-stage { flex: 1; max-height: none; }
.hw-host-info { display: flex; align-items: center; gap: 14px; padding: 8px 14px; border-top: 1px solid var(--chrome-line); font-size: 12px; color: var(--chrome-dim); min-height: 46px; flex-wrap: wrap; }
.hw-info-led { width: 8px; height: 8px; border-radius: 50%; background: #3b4046; }
.hw-host.is-live .hw-info-led { background: #ff4d3a; box-shadow: 0 0 8px #ff4d3a; }
.hw-info-name { color: var(--chrome-ink); font-weight: 600; font-size: 13px; }
.hw-info-value { font: 600 13px/1 var(--font-mono, Consolas, monospace); color: var(--chrome-accent); }
.hw-host-info.unread .hw-info-value { color: #ffb547; }
.hw-info-route, .hw-info-state { font: 500 11px/1 var(--font-mono, Consolas, monospace); padding: 4px 7px; border-radius: 6px; background: rgba(255,255,255,.05); }
.hw-info-gate { margin-left: auto; font: 600 10px/1 var(--font-mono, Consolas, monospace); letter-spacing: .1em; }
.hw-host.is-live .hw-info-gate { color: #ff7a66; }
.hw-tip { position: fixed; z-index: 9999; transform: translate(-50%, -100%); pointer-events: none; display: grid; gap: 2px; padding: 7px 10px; border-radius: 8px; background: rgba(12,13,15,.94); color: #eef1f3; box-shadow: 0 10px 28px rgba(0,0,0,.6), 0 0 0 1px rgba(255,255,255,.08); font: 12px/1.25 system-ui, sans-serif; white-space: nowrap; }
.hw-tip strong { font-weight: 600; } .hw-tip span { font: 700 14px/1.1 "Cascadia Mono", Consolas, monospace; color: #74ead3; } .hw-tip small { color: #8d949b; font-size: 10px; }
@media (prefers-reduced-motion: reduce) { .hw-ring-arc, .hw-btn, .hw-led, .hw-ctl-value { transition: none; } }

/* Unit logo images that replace a panel's text wordmark (panels/logo.mjs). */
[data-logo].has-logo { background: none !important; -webkit-text-fill-color: initial; -webkit-text-stroke: 0; }
[data-logo] .logo-img { display: block; width: auto; max-width: 100%; object-fit: contain; pointer-events: none; user-select: none; }
