/* MidiQ — Hardware & Component Styles
   Layout utilities are handled by Tailwind CDN.
   This file contains only hardware-specific visuals and
   stateful transitions that Tailwind can't easily express. */

/* Fonts loaded via <link> in HTML head */

html {
    overflow-y: scroll;
    /* always reserve scrollbar so it never overlaps content */
    scrollbar-gutter: stable;
}

/* Shared marketing-site nav (rendered by /js/nav.js into #nav-root) */
#nav-root {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.75rem;
    min-height: 60px;
    background: rgba(12, 12, 15, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--bcr-border);
}

#nav-root .nav-logo-link img {
    margin: 16px 0;
}

:root {
    --log-h: 130px;
    --header-h: 60px;
    --status-h: 24px;

    /* ── Base palette ── */
    --bcr-bg: rgba(9, 9, 11, 1);
    --bcr-text: rgba(232, 232, 232, 1);
    --bcr-input: rgba(24, 24, 27, 1);
    --bcr-border: rgba(57, 57, 63, 1);
    --bcr-panel: rgba(12, 12, 15, 1);
    --bcr-editor: rgba(24, 24, 27, 1);
    --bcr-element-bg: rgba(39, 39, 42, 1);
    --bcr-strip: rgba(200, 204, 208, 1);
    --bcr-dim: rgba(161, 161, 170, 1);
    --bcr-accent: var(--accent);

    /* ── Status / feedback colors ── */
    --bcr-ok: rgba(46, 213, 115, 1);
    --bcr-warn: rgba(255, 165, 2, 1);
    --bcr-err: rgba(255, 71, 87, 1);

    /* ── Hardware body ── */
    --bcr-body: rgba(30, 48, 80, 1);
    --bcr-body-light: rgba(42, 68, 104, 1);
    --bcr-body-dark: rgba(21, 34, 56, 1);
    --bcr-body-border: rgba(58, 80, 112, 1);

    /* ── Encoder hardware ── */
    --enc-ring-bg: rgba(26, 26, 30, 1);
    --enc-led: rgba(255, 48, 48, 1);
    --enc-led-rgb: 255, 48, 48;
    --enc-led-unlit: rgba(74, 32, 32, 1);
    --enc-knob-center: rgba(68, 68, 68, 1);
    --enc-knob-edge: var(--enc-ring-bg);

    /* ── Hardware buttons ── */
    --btn-hw: rgba(30, 30, 34, 1);
    --btn-hw-border: var(--bcr-border);
    --btn-hw-hover: rgba(46, 46, 54, 1);

    /* ── MIDI status indicators ── */
    --midi-in: var(--bcr-ok);
    --midi-out: var(--bcr-warn);

    /* ── LED display ── */
    --led-bg: rgba(10, 10, 10, 1);
    --led-border: rgba(51, 51, 51, 1);

    /* ── Accent / brand ── */
    --accent: rgba(233, 69, 96, 1);
    --accent-light: rgba(255, 107, 129, 1);
    --accent-rgb: 233, 69, 96;

    /* ── Text hierarchy ── */
    --text-secondary: rgba(153, 168, 184, 1);
    --text-muted: rgba(90, 106, 122, 1);
    --text-dim: rgba(122, 138, 154, 1);

    /* ── UI semantic colors ── */
    --color-pressed: rgba(255, 209, 102, 1);
    --color-info: rgba(59, 158, 255, 1);
    --color-model-bcr: rgba(96, 165, 250, 1);
    --color-model-bcf: rgba(192, 132, 252, 1);

    /* ── Monitor filter panel ── */
    --bcr-monitor: rgba(22, 32, 48, 1);
    --bcr-monitor-border: rgba(42, 58, 74, 1);

    /* ── Type scale ── */
    --fs-xs: 9px;
    /* tiny hardware annotations */
    --fs-sm: 11px;
    /* buttons, form labels, most UI chrome */
    --fs-base: 13px;
    /* titles, sidebar headers */
    --fs-lg: 15px;
    /* app name */
}

/* ═══════════ GLOBAL FORM DARK THEME ═══════════ */

input,
select,
textarea {
    background: var(--bcr-input);
    color: var(--text-secondary);
    border: 1px solid var(--bcr-border);
    border-radius: 3px;
    padding: 4px 6px;
    font-family: 'Montserrat', system-ui, -apple-system, sans-serif !important;
    font-size: 12px !important;
    line-height: normal;
    vertical-align: middle;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent);
    outline: none;
}

#edit-sysex-tx {
    font-family: 'Courier New', Courier, monospace !important;
}

input[type="checkbox"] {
    accent-color: var(--accent);
}

/* ═══════════ SWITCH TOGGLE ═══════════ */

.switch-toggle {
    display: inline-flex;
    cursor: pointer;
    position: relative;
    align-items: center;
    flex-shrink: 0;
}

/* Visually hide the native checkbox while keeping it accessible */
.switch-toggle input[type="checkbox"] {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    background: transparent;
    border: none;
    padding: 0;
}

.switch-track {
    display: inline-block;
    width: 34px;
    height: 18px;
    background: var(--bcr-border);
    border-radius: 9px;
    position: relative;
    transition: background .2s;
}

.switch-track::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: transform .2s, background .2s;
}

.switch-toggle input:checked~.switch-track {
    background: var(--accent);
}

.switch-toggle input:checked~.switch-track::after {
    transform: translateX(16px);
    background: white;
}

/* Indeterminate = "keep as-is" in bulk editor — thumb sits in the middle */
.switch-toggle input:indeterminate~.switch-track {
    background: rgba(var(--accent-rgb), 0.3);
}

.switch-toggle input:indeterminate~.switch-track::after {
    transform: translateX(8px);
    background: var(--bcr-text);
}

/* ═══════════ EDITOR FORM UTILITIES ═══════════ */

.field-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 9px;
}

/* Textarea and color-picker fields: stack label above content */
.field-group:has(textarea),
.field-group:has(.color-picker-row) {
    flex-direction: column;
    align-items: stretch;
}

.field-section {
    border-top: 1px solid var(--bcr-border);
    padding-top: 9px;
    margin-bottom: 0;
}

.field-half {
    flex: 1;
    margin-bottom: 9px;
}

.field-pair {
    display: flex;
    gap: 6px;
}

.btn-close-x {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.125rem;
    line-height: 1.75rem;
    cursor: pointer;
    padding: 2px 6px;
}

.btn-close-x:hover {
    color: var(--bcr-text);
}

.toggle-label {
    font-size: var(--fs-sm);
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

/* Subtle grey hover — used for collapsed sidebar strips and log panel toggle */
.hover-grey {
    /*background: var(--bcr-element-bg);*/
    transition: background .15s;
}

.hover-grey:hover {
    background: var(--bcr-element-bg);
    /*background: var(--bcr-editor);*/
}

/* Lighten strip labels on hover */
.hover-grey:hover .editor-strip-label {
    color: var(--bcr-text);
}

/* Editor form input — compact with right-aligned numbers */
.input-field {
    height: 2em;
    padding: 0 8px;
    text-align: right;
    color: var(--text-secondary);
    border-radius: 3px;
    -moz-appearance: textfield;
}

/* Fixed widths so all inputs/selects align uniformly */
input[type="number"].input-field {
    width: 72px;
    flex-shrink: 0;
}

select.input-field {
    width: 140px;
    flex-shrink: 0;
    text-align: right;
}

input[type="text"].input-field {
    width: 140px;
    flex-shrink: 0;
    text-align: left;
}

textarea.input-field {
    text-align: left;
    height: auto;
    width: 100%;
}

.input-field::-webkit-outer-spin-button,
.input-field::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.gs-field {
    width: auto;
    min-width: 36px;
    max-width: 64px;
    text-align: center;
    cursor: default;
    color: var(--bcr-dim);
}

/* ═══════════ BCR2000 FRAME ═══════════ */
.bcr2000 {
    background: linear-gradient(170deg, var(--bcr-body-light) 0%, var(--bcr-body) 30%, var(--bcr-body-dark) 100%);
    border: 2px solid var(--bcr-body-border);
    border-radius: 14px;
    padding: 12px;
    max-width: 960px;
    min-width: 800px;
    width: 100%;
    margin-top: 2em;
    box-shadow: 0 8px 32px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .06);
}

.device-body {
    display: flex;
    gap: 10px;
}

.main-area {
    flex: 1;
    min-width: 0;
}

/* Push encoder labels */
.push-encoder-labels {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 4px;
    margin-bottom: 2px;
}

.push-encoder-labels span {
    font-size: 7px;
    color: var(--text-dim);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: .5px;
}

/* ═══════════ ENCODER ROW ═══════════ */
.encoder-row {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 4px;
    margin-bottom: 4px;
}

.push-enc-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    justify-content: space-between;
    width: 100%;
    position: relative;
}

.push-enc-cell .element {
    flex: 1;
    justify-content: flex-start;
    padding-top: 2px;
    width: 100%;
}

/* ═══════════ DEDICATED ENCODER CELL ═══════════ */
.dedicated-enc-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    position: relative;
}

.dedicated-enc-cell .element {
    width: 100%;
}

/* ═══════════ BUTTON GRID ROW ═══════════ */
.button-grid-row {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 4px;
    margin-bottom: 3px;
}

.button-grid-row .hw-button {
    width: 100%;
    box-sizing: border-box;
}

/* ─── Button drag-and-drop ─── */
.hw-button[draggable="true"],
.hw-btn[draggable="true"] {
    cursor: grab;
}

.hw-button[draggable="true"]:active,
.hw-btn[draggable="true"]:active {
    cursor: grabbing;
}

.hw-button.drag-over,
.hw-btn.drag-over {
    outline: 2px dashed var(--accent);
    outline-offset: -2px;
    background: rgba(var(--accent-rgb), .1);
}

.hw-button.drag-insert-before::before,
.hw-btn.drag-insert-before::before,
.hw-button.drag-insert-after::after,
.hw-btn.drag-insert-after::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--accent);
    border-radius: 2px;
    z-index: 10;
    box-shadow: 0 0 8px rgba(var(--accent-rgb), .9);
}

.hw-button.drag-insert-before::before,
.hw-btn.drag-insert-before::before {
    left: -2px;
}

.hw-button.drag-insert-after::after,
.hw-btn.drag-insert-after::after {
    right: -2px;
}

.hw-button.dragging,
.hw-btn.dragging {
    opacity: 0.35;
}

/* Lock chassis height so switching BCR ↔ BCF only swaps the contents of the
 * dedicated area (3 rows of encoders vs 1 row of faders). Everything outside
 * #dedicated-area — push encoders, button rows, side panel, B49-B52 — stays
 * pinned at the same vertical position regardless of mode. The fixed height
 * is derived from the taller (fader) layout; BCR encoder rows top-align
 * inside the box and any spare pixels appear below the bottom row.
 */
#dedicated-area {
    height: 282px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

/* ═══════════ STRIP DIVIDER ═══════════ */
.strip-divider {
    background: var(--bcr-strip);
    height: 16px;
    margin: 6px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 7px;
    font-weight: 700;
    color: var(--enc-knob-center);
    letter-spacing: 2px;
    text-transform: uppercase;
    border-radius: 2px;
}

/* ═══════════ ENCODER ELEMENT ═══════════ */
.element {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all .12s;
    border: 2px solid transparent;
    border-radius: 6px;
    padding: 2px;
    width: 100%;
    box-sizing: border-box;
}

.element:hover {
    border-color: rgba(var(--accent-rgb), .35);
    background: rgba(var(--accent-rgb), .04);
}

.element.selected {
    border-color: var(--accent);
    background: rgba(var(--accent-rgb), .1);
    box-shadow: 0 0 10px rgba(var(--accent-rgb), .2);
}

/* For encoder/fader cells: lift hover/select outline to the full cell so it
   encompasses the element + label */
.push-enc-cell:has(.element:hover),
.dedicated-enc-cell:has(.element:hover) {
    outline: 2px solid rgba(var(--accent-rgb), .1);
    outline-offset: -2px;
    background: rgba(var(--accent-rgb), .02);
    border-radius: 6px;
}

.push-enc-cell:has(.element:hover) .element:hover,
.dedicated-enc-cell:has(.element:hover) .element:hover {
    border-color: transparent;
    background: transparent;
}

.push-enc-cell:has(.element.selected),
.dedicated-enc-cell:has(.element.selected) {
    outline: 2px solid rgba(var(--accent-rgb), .4);
    outline-offset: -2px;
    background: rgba(var(--accent-rgb), .02);
    border-radius: 6px;
    box-shadow: 0 0 10px rgba(var(--accent-rgb), .2);
}

.push-enc-cell:has(.element.selected) .element.selected,
.dedicated-enc-cell:has(.element.selected) .element.selected {
    border-color: transparent;
    background: transparent;
    box-shadow: none;
}

.element.configured .element-label {
    color: var(--accent-light);
}

/* Drag-and-drop encoder swap */
.push-enc-cell[draggable="true"],
.dedicated-enc-cell[draggable="true"] {
    cursor: grab;
}

.push-enc-cell[draggable="true"]:active,
.dedicated-enc-cell[draggable="true"]:active {
    cursor: grabbing;
}

.push-enc-cell.drag-over,
.dedicated-enc-cell.drag-over {
    outline: 2px dashed var(--accent);
    outline-offset: -2px;
    background: rgba(var(--accent-rgb), .1);
    border-radius: 6px;
}

/* Insert-between indicator: vertical accent line on cell edge */
.push-enc-cell.drag-insert-before::before,
.dedicated-enc-cell.drag-insert-before::before,
.push-enc-cell.drag-insert-after::after,
.dedicated-enc-cell.drag-insert-after::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--accent);
    border-radius: 2px;
    z-index: 10;
    box-shadow: 0 0 8px rgba(var(--accent-rgb), .9);
}

.push-enc-cell.drag-insert-before::before,
.dedicated-enc-cell.drag-insert-before::before {
    left: -2px;
}

.push-enc-cell.drag-insert-after::after,
.dedicated-enc-cell.drag-insert-after::after {
    right: -2px;
}

.push-enc-cell.dragging,
.dedicated-enc-cell.dragging {
    opacity: 0.35;
}

/* Encoder ring */
.enc-ring {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Two distinct rings: outer light grey (LED zone 51–90%) + inner dark (0–51%) + dark outer rim (90–100%) */
    background: radial-gradient(circle,
            #111111 0% 51%,
            #1b1b1b 51% 90%,
            #1a1a20 90% 100%);
    box-shadow: 0 0px 5px rgba(0, 0, 0, .4);
}

/* Inner dark ring inset — creates the recessed well the knob sits in */
.enc-ring::before {
    content: '';
    position: absolute;
    inset: 22%;
    border-radius: 50%;
    background: radial-gradient(circle, #0d0d0d 60%, #1a1a1e 100%);
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, .9), 0 0 0 1px rgba(0, 0, 0, .5);
    z-index: 0;
}

.enc-ring svg.led-ring {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: visible;
}

.enc-ring svg.led-ring circle {
    fill: var(--enc-led-unlit);
}

.enc-ring svg.led-ring circle.lit {
    fill: var(--enc-led);
    filter: drop-shadow(0 0 2px var(--enc-led));
}

.enc-ring.small svg.led-ring circle {
    r: 4.5;
}

.enc-ring.large svg.led-ring circle {
    r: 5;
}

.enc-knob {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, var(--enc-knob-center), var(--enc-knob-edge));
    box-shadow: 0 1px 5px rgba(0, 0, 0, .6);
    position: relative;
    z-index: 1;
    transition: transform 0.05s ease-out;
    cursor: grab;
    user-select: none;
}

.enc-knob::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 50%;
    width: 2px;
    height: 8px;
    transform: translateX(-50%);
    background: #999;
    border-radius: 1px;
}

/* Inline value editor overlay on encoder */
.enc-value-input {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 22px;
    z-index: 20;
    background: var(--bcr-bg);
    color: var(--bcr-text);
    border: 1px solid var(--bcr-border);
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    font-family: 'Inter', system-ui, sans-serif;
    text-align: center;
    padding: 0 2px;
    outline: none;
    box-shadow: 0 0 12px rgba(var(--accent-rgb), .4);
    -moz-appearance: textfield;
}

.enc-value-input::-webkit-inner-spin-button,
.enc-value-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.element-label {
    font-size: 9px;
    text-align: center;
    color: var(--text-secondary);
    line-height: 1.2;
    max-width: 72px;
    overflow: hidden;
    margin-top: 1px;
    word-break: break-all;
}

/* Colored label box under encoders */
.enc-label-box {
    width: 100%;
    min-height: 14px;
    padding: 2px 3px;
    margin-top: 5px;
    border-radius: 2px;
    font-size: 8px;
    font-weight: 600;
    text-align: center;
    color: #111;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    box-sizing: border-box;
}

#midi-input,
#midi-output,
#device-id,
#edit-type {
    height: 2em;
}

/* ═══════════ COLOR PICKER ═══════════ */
.color-picker-row {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.color-swatch {
    width: 18px;
    height: 18px;
    border-radius: 3px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: border-color .1s, transform .1s;
}

.color-swatch:hover {
    transform: scale(1.15);
}

.color-swatch.active {
    border-color: #fff;
    box-shadow: 0 0 4px rgba(255, 255, 255, 0.4);
}

.color-swatch.no-color {
    background: var(--bcr-monitor-border);
    position: relative;
}

.color-swatch.no-color::after {
    content: '✕';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    color: var(--text-muted);
}

/* ═══════════ LABEL COLOR OVERRIDES ═══════════ */
.push-button-cell.has-label-color .element-label,
.hw-button.has-label-color .element-label,
.hw-btn.has-label-color .element-label {
    color: #fff;
}

/* ═══════════ HARDWARE BUTTONS ═══════════ */
.hw-button,
.hw-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    background: var(--btn-hw);
    border: 1px solid var(--btn-hw-border);
    color: var(--text-muted);
    font-size: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all .12s;
    text-transform: uppercase;
    letter-spacing: .3px;
}

.hw-button.has-label-color,
.hw-btn.has-label-color {
    background: color-mix(in srgb, var(--label-color) 45%, #000);
}

.hw-button {
    height: 26px;
}

.hw-btn {
    height: 28px;
}

.hw-button:hover,
.hw-btn:hover {
    background: var(--btn-hw-hover);
    border-color: #555;
    color: var(--bcr-text);
}

.hw-button.has-label-color:hover,
.hw-btn.has-label-color:hover {
    background: color-mix(in srgb, var(--label-color) 65%, #000);
}

.hw-button.selected,
.hw-btn.selected {
    border-color: var(--accent);
    box-shadow: 0 0 6px rgba(var(--accent-rgb), .3);
}

.hw-button.pressed,
.hw-btn.pressed {
    background: var(--color-pressed);
    color: #000;
    box-shadow: 0 0 8px rgba(255, 209, 102, .5);
}

.hw-btn.bc-function-active {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 0 8px rgba(230, 57, 70, .6);
}

.hw-button.has-label-color.pressed,
.hw-btn.has-label-color.pressed {
    background: var(--label-color);
}

.hw-button .element-label {
    margin: 0;
}

.hw-button.configured .element-label,
.hw-btn.configured {
    color: #fff;
}

/* Push button (tiny, under push encoder) */
.push-button-cell {
    width: 100%;
    height: 16px;
    background: var(--btn-hw);
    border: 1px solid var(--btn-hw-border);
    box-sizing: border-box;
    border-radius: 2px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .1s;
}

.push-button-cell.has-label-color {
    background: color-mix(in srgb, var(--label-color) 55%, #000);
}

.push-button-cell:hover {
    background: var(--btn-hw-hover);
}

.push-button-cell.selected {
    border-color: var(--accent);
}

.push-button-cell.pressed {
    background: var(--color-pressed);
}

.push-button-cell.has-label-color.pressed {
    background: var(--label-color);
}

.push-button-cell .element-label {
    font-size: 7px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .3px;
    margin: 0;
    color: var(--text-muted);
}

.push-button-cell.configured .element-label {
    color: #fff;
}

/* ═══════════ SIDE PANEL ═══════════ */
.side-panel {
    width: 150px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding-top: 17px;
}

/* LED Display */
.led-display {
    background: var(--led-bg);
    border: 2px solid var(--led-border);
    border-radius: 4px;
    padding: 8px 4px;
    text-align: center;
    width: 100%;
}

.led-text,
.led-info,
.led-value {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    color: var(--enc-led);
}

.led-text {
    font-size: 30px;
    text-shadow: 0 0 10px rgba(var(--enc-led-rgb), .6);
    letter-spacing: 3px;
}

.led-info {
    font-size: 10px;
    text-shadow: 0 0 6px rgba(var(--enc-led-rgb), .4);
    letter-spacing: 1px;
    margin-top: 2px;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.led-value {
    font-size: 10px;
    text-shadow: 0 0 8px rgba(var(--enc-led-rgb), .5);
    letter-spacing: 2px;
    margin-top: 4px;
    min-height: 18px;
}

.panel-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-top: 4px;
    text-align: center;
    width: 100%;
}

#user-buttons {
    margin-top: auto;
}

/* 2x2 grid for side panel groups */
.side-grid-2x2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    width: 100%;
}

.group-btn.active {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 0 6px rgba(var(--accent-rgb), .3);
}

/* Status LEDs */
.status-leds {
    display: flex;
    gap: 7px;
    justify-content: center;
    margin-top: 2px;
}

.led-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

.led-col span:last-child {
    font-size: 6px;
    color: var(--text-muted);
    text-align: center;
}

.led-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: none;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, .6), inset 0 1px 2px rgba(0, 0, 0, .5);
    transition: background 80ms, box-shadow 80ms;
}

/* red LEDs: A, B */
.led-dot.red {
    background: radial-gradient(circle at 50% 60%, #3a0808, #1a0303);
}

.led-dot.red.active {
    background: radial-gradient(circle at 50% 60%, #ff4040, #cc1010);
    box-shadow: inset 0 2px 3px rgba(0, 0, 0, .3), 0 0 6px var(--enc-led);
}

/* yellow LEDs: SW1, SW2 */
.led-dot.yellow {
    background: radial-gradient(circle at 50% 60%, #3a2e04, #181202);
}

.led-dot.yellow.active {
    background: radial-gradient(circle at 50% 60%, #ffe040, #c89000);
    box-shadow: inset 0 2px 3px rgba(0, 0, 0, .3), 0 0 6px #d4a800;
}

/* green LEDs: IN, MODE */
.led-dot.green {
    background: radial-gradient(circle at 50% 60%, #0a2a0a, #030d03);
}

.led-dot.green.active {
    background: radial-gradient(circle at 50% 60%, #60ff80, #10c030);
    box-shadow: inset 0 2px 3px rgba(0, 0, 0, .3), 0 0 6px var(--bcr-ok);
}

/* Branding */
.branding {
    text-align: center;
    margin: 6px 0;
    user-select: none;
}

.brand-line {
    font-size: 10px;
    letter-spacing: 3px;
    color: var(--text-secondary);
    font-weight: 700;
}

.brand-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 4px 0 12px 0;
}

.brand-toggle-label {
    font-size: 8px;
    letter-spacing: 1.5px;
    font-weight: 600;
    color: var(--text-muted);
    transition: color .2s;
}

.brand-toggle-label.active {
    color: var(--accent);
}

.brand-switch .switch-track {
    width: 28px;
    height: 14px;
    border-radius: 7px;
    background: var(--bcr-border);
    border: 1px solid var(--accent);
    transition: none;
}

.brand-switch .switch-track::after {
    width: 10px;
    height: 10px;
    top: 1px;
    left: 1px;
    background: white;
    transition: transform .2s;
}

.brand-switch input:checked~.switch-track {
    background: var(--bcr-border);
}

.brand-switch input:checked~.switch-track::after {
    transform: translateX(14px);
    background: white;
}

.brand-logo {
    display: block;
    margin: 4px auto 0;
    width: 60px;
    opacity: 0.70;
}

/* Preset nav */
.preset-nav-hw {
    display: flex;
    align-items: center;
    gap: 4px;
    width: 100%;
    justify-content: center;
    margin-top: 2px;
}

.preset-label {
    font-size: 7px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.preset-hw-btn {
    width: 34px;
}

/* ═══════════ EDITOR PANEL TRANSITION ═══════════ */
.main-layout {
    height: calc(100vh - var(--header-h) - var(--status-h) - var(--log-h));
}

.editor-panel {
    width: 0;
    background: var(--bcr-editor);
    border-left: 1px solid var(--bcr-border);
    overflow-y: auto;
    transition: width .2s;
    flex-shrink: 0;
    position: relative;
}

.editor-panel.open {
    width: var(--editor-w, 240px);
}

/* Element editor: always visible as 24px strip when collapsed */
#element-editor {
    width: 24px;
    min-width: 24px;
    overflow: hidden;
    display: flex;
    flex-direction: row;
}

#element-editor.open {
    width: var(--editor-w, 255px);
    min-width: unset;
}

/* Hide content and resize handle when not open */
#element-editor:not(.open) .editor-panel-content,
#element-editor:not(.open) .sidebar-resize-handle {
    display: none;
}

/* When bulk editor is open, hide element-editor entirely */
#element-editor.bulk-active {
    width: 0;
    min-width: 0;
}

/* Editor strip — always visible on left side, toggles panel */
.editor-strip {
    width: 24px;
    min-width: 24px;
    flex-shrink: 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 10px;
    user-select: none;
    cursor: pointer;
    align-self: stretch;
    border-right: 1px solid var(--bcr-border);
}

.editor-panel-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
}

/* hover handled by .hover-grey */

.editor-strip-label {
    writing-mode: vertical-rl;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* Don't show resize handles on collapsed sidebar */
.side-panel-container.collapsed .sidebar-resize-handle {
    display: none;
}

/* Sidebar resize handles */
.sidebar-resize-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 5px;
    cursor: ew-resize;
    z-index: 10;
    background: transparent;
    transition: background .15s;
}

.sidebar-resize-handle:hover,
.sidebar-resize-handle.dragging {
    background: rgba(var(--accent-rgb), 0.4);
}

.side-panel-container {
    position: relative;
}

.side-panel-container .sidebar-resize-handle {
    right: -3px;
}

.editor-panel .sidebar-resize-handle {
    left: -3px;
}

/* ═══════════ ICON RAIL ═══════════ */

.icon-rail {
    width: 52px;
    min-width: 52px;
    background: var(--bcr-editor);
    border-right: 1px solid var(--bcr-border);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-shrink: 0;
    overflow: hidden;
    padding: 12px 0;
}

.icon-rail-top,
.icon-rail-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.icon-rail-bottom {
    padding-bottom: 20px;
}

.icon-rail-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    width: 46px;
    height: 40px;
    margin: 2px 0;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all .15s;
}

.icon-rail-btn:hover {
    color: var(--bcr-text);
    background: var(--bcr-editor);
}

.icon-rail-btn.active {
    color: var(--bcr-text);
    border-color: transparent;
}

.icon-rail-label {
    font-size: 8px;
    font-weight: 600;
    letter-spacing: .8px;
    text-transform: uppercase;
    line-height: 1;
}

/* ═══════════ SIDE PANEL CONTAINER ═══════════ */

.side-panel-container {
    width: var(--side-panel-w, 220px);
    min-width: 180px;
    background: var(--bcr-editor);
    border-right: 1px solid var(--bcr-border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow: hidden;
    transition: width .2s, min-width .2s;
    position: relative;
}

.side-panel-container.collapsed {
    width: 0;
    min-width: 0;
    border-right: none;
}

.side-panel-container.collapsed .side-panel-view,
.side-panel-container.collapsed .sidebar-resize-handle {
    display: none;
}

.side-panel-container .sidebar-resize-handle {
    right: -3px;
}

.side-panel-view {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

.side-panel-header {
    padding: 0.75em 0.75em;
    border-bottom: 1px solid var(--bcr-border);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.side-panel-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

/* ═══════════ HELP OVERLAY ═══════════ */

/* ═══════════ HELP TOC sidebar ═══════════ */

.help-toc {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.help-toc-link {
    display: block;
    padding: 4px 8px;
    font-size: 11px;
    color: var(--text-dim);
    text-decoration: none;
    border-radius: 4px;
    border-left: 2px solid transparent;
    transition: color .15s, background .15s, border-color .15s;
}

.help-toc-link:hover {
    color: var(--bcr-text);
    background: rgba(255, 255, 255, 0.04);
}

.help-toc-link.active {
    color: var(--accent);
    border-left-color: var(--accent);
    background: rgba(59, 130, 246, 0.08);
}

/* ═══════════ HELP content view ═══════════ */

#view-help .help-section {
    scroll-margin-top: 20px;
}

#view-help kbd {
    background: var(--bcr-editor);
    border: 1px solid var(--bcr-border);
    border-radius: 3px;
    padding: 1px 5px;
    font-size: 11px;
    font-family: inherit;
}

/* ═══════════ LIBRARY content view ═══════════ */

#view-library .model-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 3px;
    text-transform: uppercase;
}

#view-library .model-bcr {
    background: rgba(59, 130, 246, 0.15);
    color: var(--color-model-bcr);
}

#view-library .model-bcf {
    background: rgba(168, 85, 247, 0.15);
    color: var(--color-model-bcf);
}

#view-library .library-download-btn {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    padding: 2px 4px;
    transition: color .15s;
}

#view-library .library-download-btn:hover {
    color: var(--accent-light);
}

/* ═══════════ VIEW CONTENT PANEL (help/library) ═══════════ */

.view-content-panel {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    min-width: 0;
}

.view-content-inner {
    margin: 0 auto;
    width: 100%;
}

/* ═══════════ MIDI STATUS BAR ═══════════ */

.midi-status-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--status-h);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0;
    padding: 0 12px;
    background: var(--bcr-body-light);
    border-top: 1px solid var(--bcr-border);
    font-size: 11px;
    color: var(--text-dim);
    z-index: 89;
}

.midi-status-item {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    padding: 2px 8px;
    border-radius: 3px;
    transition: background .15s;
}

.midi-status-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.midi-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
    opacity: 0.4;
}

.midi-status-dot.connected {
    opacity: 1;
}

.midi-status-sep {
    width: 1px;
    height: 12px;
    background: var(--bcr-border);
    margin: 0 4px;
}

/* ═══════════ CONFIG (Settings panel) ═══════════ */

.config-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.config-group select {
    width: 100%;
    max-width: 100%;
}

/* Narrow + right-aligned fields in the Device field-section */
#panel-settings .field-section input.input-field {
    width: 80px;
    text-align: right;
}

/* ═══════════ BCL VIEWER ═══════════ */
.bcl-toggle-btn {
    background: none;
    border: 1px solid var(--bcr-border);
    border-radius: 3px;
    width: 22px;
    height: 22px;
    color: var(--bcr-warn);
    cursor: pointer;
    padding: 3px 5px;
    display: flex;
    align-items: center;
    transition: all .15s;
}

.bcl-toggle-btn:hover,
.btn-warn-hover:hover {
    border-color: var(--bcr-warn);
}

.bcl-toggle-btn.active,
.btn-warn-hover:active {
    border-color: var(--bcr-warn);
    background: rgba(255, 165, 2, .12);
}

.btn-editor-reset {
    background: none;
    border: 1px solid var(--bcr-border);
    border-radius: 3px;
    color: var(--bcr-warn);
    cursor: pointer;
    padding: 3px 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    transition: all .15s;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .05em;
}

.btn-editor-reset:hover {
    border-color: var(--bcr-warn);
    background: var(--btn-hw-hover);
}

.btn-editor-reset:active {
    border-color: var(--bcr-warn);
    background: rgba(255, 165, 2, .12);
}

.bcl-editor {
    position: relative;
    display: flex;
    align-items: stretch;
    width: 100%;
    height: calc(100vh - 240px);
    min-height: 300px;
    background: var(--bcr-bg);
    border: 1px solid var(--bcr-border);
    border-radius: 4px;
    overflow: hidden;
    font-family: 'Courier New', Courier, monospace;
    font-size: 11px;
    line-height: 1.5;
}

.bcl-editor.is-invalid {
    border-color: #d04848;
    box-shadow: inset 0 0 0 1px #d04848;
}

.bcl-editor.is-valid {
    border-color: #2ea043;
}

.bcl-editor-gutter {
    flex: 0 0 auto;
    width: 38px;
    padding: 8px 4px 8px 0;
    color: var(--bcr-dim);
    background: rgba(255, 255, 255, 0.03);
    border-right: 1px solid var(--bcr-border);
    text-align: right;
    overflow: hidden;
    user-select: none;
    pointer-events: none;
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
}

.bcl-editor-gutter .gutter-line {
    display: block;
    padding-right: 6px;
}

.bcl-editor-gutter .gutter-line.has-error {
    color: #fff;
    background: #d04848;
    border-radius: 2px 0 0 2px;
}

.bcl-viewer-textarea {
    flex: 1 1 auto;
    width: 100%;
    height: 100%;
    background: transparent;
    color: var(--bcr-text);
    border: none;
    border-radius: 0;
    padding: 8px;
    font-family: inherit !important;
    font-size: inherit;
    line-height: inherit;
    resize: none;
    white-space: pre;
    overflow: auto;
    tab-size: 4;
}

.bcl-viewer-textarea:focus {
    outline: none;
}

.bcl-editor-status {
    margin-top: 6px;
    font-size: 11px;
    line-height: 1.4;
    color: var(--bcr-dim);
}

.bcl-editor-status-line {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.bcl-editor-status-icon {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--bcr-dim);
    flex: 0 0 auto;
}

.bcl-editor-status.is-valid .bcl-editor-status-icon {
    background: #2ea043;
}

.bcl-editor-status.is-invalid .bcl-editor-status-icon {
    background: #d04848;
}

.bcl-editor-status.is-valid #bcl-editor-status-text {
    color: #2ea043;
}

.bcl-editor-status.is-invalid #bcl-editor-status-text {
    color: #d04848;
}

.bcl-editor-errors {
    list-style: none;
    margin: 4px 0 0 0;
    padding: 0;
    max-height: 120px;
    overflow-y: auto;
}

.bcl-editor-errors li {
    padding: 2px 6px;
    color: #d04848;
    font-family: 'Courier New', Courier, monospace;
}

.bcl-editor-errors li .err-line {
    display: inline-block;
    min-width: 28px;
    color: var(--bcr-dim);
    margin-right: 4px;
}

/* ═══════════ LOG PANEL TRANSITION ═══════════ */
.log-panel {
    height: 130px;
    bottom: var(--status-h) !important;
    transition: height .2s;
}

.log-panel.resizing {
    transition: none;
}

.log-panel.collapsed {
    height: 24px;
}

.log-resize-handle {
    height: 3px;
    cursor: ns-resize;
    flex-shrink: 0;
    background: transparent;
    transition: background .15s;
}

.log-resize-handle:hover,
.log-resize-handle.dragging {
    background: rgba(var(--accent-rgb), 0.4);
}

.log-panel.collapsed .log-resize-handle {
    display: none;
}

/* Log / MIDI Monitor tabs */
.log-tab {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    cursor: pointer;
    padding: 2px 2px 4px 8px;
    border-radius: 3px;
    transition: all .1s;
}

.log-tab:hover {
    color: var(--bcr-text);
}

.log-tab.active {
    /*background: rgba(var(--accent-rgb), .15);*/
    color: var(--accent-light);
    font-weight: 600;
}

.log-header-btn {
    background: transparent;
    border: 1px solid var(--bcr-border);
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1;
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    cursor: pointer;
    transition: all .15s;
}

.log-header-btn:hover {
    color: var(--bcr-text);
    border-color: var(--bcr-text);
}

/* MIDI connection LED */
.midi-led {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: background .15s, box-shadow .15s;
}

.midi-led.connected {
    background: var(--bcr-ok);
    box-shadow: 0 0 6px rgba(46, 213, 115, .6);
}

.midi-led.active {
    background: #fff;
    box-shadow: 0 0 8px rgba(255, 255, 255, .8);
}

/* ═══════════ UI BUTTONS ═══════════ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 24px;
    text-transform: uppercase;
    padding: 0 10px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all .1s;
    white-space: nowrap;
}

.btn:hover {
    filter: brightness(1.2);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .08);
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent-light);
}

.btn-outline-primary {
    background: transparent;
    color: #fff;
    border: 1.5px solid var(--accent) !important;
    box-shadow: 0 0 6px rgba(var(--accent-rgb), .3);
}

.btn-outline-primary:hover {
    background: rgba(var(--accent-rgb), .12);
    box-shadow: 0 0 10px rgba(var(--accent-rgb), .5);
}

.btn-default {
    background: var(--bcr-element-bg);
    color: #d4d4d8;
}

.btn-default:hover {
    background: #3f3f46;
}

.btn-ghost {
    background: transparent;
    color: var(--bcr-dim);
    border: 1px solid #3f3f46 !important;
}

.btn-ghost:hover {
    background: var(--bcr-element-bg);
    color: var(--bcr-text);
    border-color: #52525b !important;
}

.btn-success {
    background: var(--bcr-ok);
    color: #111;
}

.btn-danger {
    background: var(--accent);
    color: #fff;
    font-size: 14px;
    height: auto;
    padding: 5px 16px;
}

.btn-danger:hover {
    background: var(--accent-light);
}

.btn-disabled,
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn:disabled:hover {
    filter: brightness(1);
}

.btn:disabled:active {
    transform: scale(1);
}

/* ═══════════ BANKS / SIDEBAR CONTENT ═══════════ */

/* editor-strip-label — used by element editor strip */
.editor-strip-label {
    writing-mode: vertical-rl;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    text-transform: uppercase;
    transition: color .15s;
}

/* Fixed UI label typography — consolidated into .type-label; .ui-label kept as alias */
.ui-label {
    font-size: 10px;
    font-weight: 300;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    text-transform: uppercase;
    line-height: 1;
}

.banks-sidebar-title {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.banks-title-count {
    background: var(--bcr-border);
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 500;
    border-radius: 8px;
    padding: 0 5px;
    min-width: 16px;
    text-align: center;
}

.btn-sm {
    height: 20px;
    padding: 0 6px;
    font-size: var(--fs-sm);
    line-height: 1;
}

/* Individual bank */
.bank-item {
    border-bottom: 1px solid rgba(42, 58, 74, 0.5);
}

.bank-item-header {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 8px;
    cursor: pointer;
    transition: background .1s;
    user-select: none;
}

.bank-item-header:hover {
    background: rgba(255, 255, 255, .03);
}

.bank-item-header.active {
    /*background: rgba(var(--accent-rgb), .08);*/
    background: var(--bcr-element-bg);
    /*var(--bcr-element-bg);*/
}

.bank-item-chevron {
    font-size: 8px;
    color: var(--text-muted);
    flex-shrink: 0;
    transition: transform .15s;
    display: inline-block;
}

.bank-item-chevron.open {
    transform: rotate(90deg);
}

.bank-item-name {
    font-size: 12px;
    font-weight: 500;
    color: var(--bcr-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
    cursor: text;
}

.bank-item-name:hover {
    text-decoration: underline;
    text-decoration-style: dotted;
}

.inline-editing {
    border-bottom: 1px solid var(--accent);
    outline: none;
    cursor: text;
    min-width: 20px;
}

.bank-item-count {
    font-size: 9px;
    color: var(--text-muted);
    flex-shrink: 0;
    white-space: nowrap;
}

/* Small icon buttons for bank/slot actions */
.bank-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 2px;
    font-size: 10px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    flex-shrink: 0;
    padding: 0;
    transition: color .1s, background .1s;
    opacity: 0;
}

.bank-item-header:hover .bank-icon-btn,
.bank-slot:hover .bank-icon-btn {
    opacity: 1;
}

.bank-icon-btn:hover {
    color: var(--bcr-text);
    background: rgba(255, 255, 255, .08);
}

.bank-icon-btn.bank-icon-delete:hover {
    color: var(--bcr-err);
    background: rgba(255, 71, 87, .1);
}

.bank-icon-btn.bank-icon-recv:hover {
    color: var(--bcr-ok);
    background: rgba(46, 213, 115, .1);
}

.bank-icon-btn.bank-icon-send:hover {
    color: var(--bcr-warn);
    background: rgba(255, 165, 2, .1);
}

.bank-icon-btn.bank-icon-export:hover {
    color: var(--bcr-warn);
    background: rgba(255, 165, 2, .1);
}

.bank-icon-btn.bank-icon-save:hover {
    color: var(--bcr-ok);
    background: rgba(46, 213, 115, .1);
}

.btn.btn-import:hover {
    color: var(--bcr-ok);
    background: rgba(46, 213, 115, .1);
}

.bank-item-header.has-active-preset .bank-item-name {
    color: var(--accent);
}

/* Bank slot list */
.bank-slots {
    background: rgba(0, 0, 0, .15);
}

.bank-slot {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px 2px 14px;
    cursor: pointer;
    transition: background .1s;
    border-bottom: 1px solid rgba(42, 58, 74, .2);
    min-height: 22px;
}

.bank-slot:hover {
    background: rgba(255, 255, 255, .04);
}

.bank-slot.loaded {
    /*background: rgba(var(--accent-rgb), .07);*/
}

.bank-slot-num {
    font-size: 9px;
    color: var(--text-muted);
    min-width: 16px;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

.bank-slot-name {
    flex: 1;
    font-size: 11px;
    color: var(--bcr-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.bank-slot-name:not(.empty) {
    cursor: text;
}

.bank-slot-name:not(.empty):hover {
    text-decoration: underline;
    text-decoration-style: dotted;
}

.bank-slot-name.empty {
    color: #3a4a5a;
    font-style: italic;
    font-size: 10px;
}

.empty-slot {
    opacity: 0.6;
    transition: opacity .1s;
}

.empty-slot:hover {
    opacity: 1;
    background: rgba(var(--accent-rgb), .04);
}

/* ─── Bank slot drag-and-drop ─── */
.bank-slot.slot-dragging {
    opacity: 0.4;
    cursor: grabbing;
}

.bank-slot.slot-drag-over {
    background: rgba(46, 213, 115, .14);
    outline: 1px dashed var(--bcr-accent);
    outline-offset: -1px;
}

.bank-slot.slot-drag-over-copy {
    background: rgba(46, 213, 115, .14);
    outline: 1px dashed var(--bcr-ok);
    outline-offset: -1px;
}

.bank-slot-check {
    font-size: 10px;
    color: #3a4a5a;
    flex-shrink: 0;
    cursor: pointer;
    transition: color .1s;
}

.bank-slot.loaded .bank-slot-check {
    color: var(--bcr-err);
}

.bank-slot:not(.loaded):not(.empty-slot):hover .bank-slot-check,
.empty-slot:hover .bank-slot-check {
    color: var(--text-muted);
}

/* ═══════════ TOPBAR BRAND + DEVICE TOGGLE ═══════════ */
.topbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
    flex-shrink: 0;
}

.topbar-appname {
    font-family: 'MuseoModerno', system-ui, -apple-system, sans-serif !important;
    font-size: 28px;
    font-weight: 500;
    color: #ffffff;
    letter-spacing: .3px;
}

/* Auth navigation links */
.auth-nav-link {
    font-size: 13px;
    font-weight: 400;
    color: #a1a1aa;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0;
    transition: color .15s;
}

.auth-nav-link:hover {
    color: #e8e8e8;
}

.auth-nav-link.active {
    color: #e8e8e8;
    font-weight: 600;
}

/* ═══════════ AVATAR & DROPDOWN ═══════════ */

.avatar-wrapper {
    position: relative;
}

.avatar-circle {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid var(--bcr-border);
    background: var(--bcr-element-bg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 0;
    transition: border-color .15s;
}

.avatar-circle:hover {
    border-color: var(--accent);
}

.avatar-circle .avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.avatar-circle .avatar-initials {
    font-size: 12px;
    font-weight: 600;
    color: var(--bcr-text);
    line-height: 1;
    letter-spacing: .5px;
}

.avatar-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    width: 240px;
    background: var(--bcr-panel);
    border: 1px solid var(--bcr-border);
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, .5);
    z-index: 200;
    display: none;
    padding: 4px 0;
}

.avatar-dropdown.open {
    display: block;
}

.avatar-dropdown-header {
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.avatar-dropdown-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--bcr-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.avatar-dropdown-email {
    font-size: 11px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.avatar-dropdown-sep {
    height: 1px;
    background: var(--bcr-border);
    margin: 2px 0;
}

.avatar-dropdown-rating {
    padding: 8px 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.avatar-dropdown-rating-label {
    font-size: 10px;
    color: var(--text-muted);
}

.avatar-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 14px;
    background: none;
    border: none;
    color: var(--bcr-text);
    font-size: 13px;
    cursor: pointer;
    transition: background .1s;
    text-align: left;
}

.avatar-dropdown-item:hover {
    background: rgba(255, 255, 255, .05);
}

.avatar-dropdown-logout {
    color: var(--bcr-err);
}

.avatar-dropdown-logout:hover {
    background: rgba(255, 71, 87, .08);
}

/* ═══════════ PROFILE MODAL ═══════════ */

.profile-avatar-preview {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--bcr-element-bg);
    border: 2px solid var(--bcr-border);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.profile-avatar-preview-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.profile-avatar-preview-initials {
    font-size: 20px;
    font-weight: 600;
    color: var(--bcr-text);
    letter-spacing: 1px;
}

/* ═══════════ BCF2000 FADERS ═══════════ */

.fader-element {
    justify-content: center;
    padding: 4px 0;
}

/* Vertical separator lines between fader cells and on outer edges */
.fader-row .dedicated-enc-cell::before {
    content: '';
    position: absolute;
    left: -3px;
    /* centred within the 4px grid gap */
    top: 0;
    width: 2px;
    height: calc(100% - 19px);
    /* stop at bottom of .fader-number, above .enc-label-box */
    background: rgba(200, 204, 208, 0.7);
    z-index: 1;
}

.fader-row .dedicated-enc-cell:first-child::before {
    left: 0;
    /* outer left edge of fader 1 */
}

.fader-row .dedicated-enc-cell:last-child::after {
    content: '';
    position: absolute;
    right: 0;
    /* outer right edge of fader 8 */
    top: 0;
    width: 2px;
    height: calc(100% - 19px);
    background: rgba(200, 204, 208, 0.7);
    z-index: 1;
}

/* Outer fader channel wrapper — positions tick SVG + groove + annotations */
.fader-channel {
    position: relative;
    width: 60px;
    height: 230px;
}

/* The SVG tick layer covers the full channel area */
.fader-ticks {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: visible;
}

.fader-ticks line {
    stroke: rgba(255, 255, 255, .5);
}

/* SVG text annotations (+, −, ▲, ▼) */
.fader-ticks .fader-ann {
    fill: rgba(255, 255, 255, .5);
    font-size: 7px;
    font-family: sans-serif;
    dominant-baseline: middle;
}

/* Central groove */
.fader-groove {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    transform: translateX(-50%);
    width: 8px;
    background: #0d0d12;
    border-radius: 4px;
    border-left: 1px solid #111;
    border-right: 1px solid #333;
    box-shadow: inset 0 0 4px rgba(0, 0, 0, .9);
    z-index: 1;
}

.fader-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(var(--accent-rgb), .6), rgba(var(--accent-rgb), .15));
    border-radius: 0 0 2px 2px;
    transition: height .05s ease-out;
    z-index: 2;
}

/* Fader knob — capsule shape matching encoder dark palette */
.fader-thumb {
    position: absolute;
    left: 50%;
    transform: translate(-50%, 50%);
    width: 34px;
    height: 62px;
    border-radius: 15px;
    cursor: grab;
    transition: bottom .05s ease-out;
    z-index: 3;
    /* Dark outer shell matching encoder ring tones */
    background: linear-gradient(180deg,
            #2a2a2e 0%, #1e1e22 12%,
            #1a1a1e 50%,
            #1e1e22 88%, #2a2a2e 100%);
    border: 1px solid #222222;
    box-shadow:
        0px 3px rgba(0, 0, 0, .08),
        inset 0 5px 0 rgba(255, 255, 255, .03),
        inset 0 -5px 0 rgba(0, 0, 0, .3)
}

/* Dark ridged inner surface */
.fader-thumb::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 5px;
    right: 5px;
    bottom: 8px;
    border-radius: 6px;
    background:
        repeating-linear-gradient(180deg,
            #2e2e32 0px, #222226 2px,
            #1a1a1e 2px, #222226 4px);
    box-shadow: inset 0 1px 4px rgba(0, 0, 0, .7);
}

/* Bright center line on the ridged area */
.fader-thumb::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 7px;
    right: 7px;
    height: 2px;
    background: #ccc;
    transform: translateY(-50%);
    border-radius: 1px;
    box-shadow: 0 1px 0 rgba(0, 0, 0, .4);
    z-index: 1;
}

.fader-number {
    font-size: 8px;
    font-weight: 600;
    color: #fff;
    /*color: var(--text-muted);*/
    text-transform: uppercase;
    letter-spacing: .3px;
    width: 100%;
    text-align: left;
    padding-left: 12px;
    margin-top: 3px;
    box-sizing: border-box;
}

/* ═══════════ RESPONSIVE ═══════════ */
@media (max-width: 800px) {
    .device-body {
        flex-direction: column;
    }

    .side-panel {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }

    .side-panel>* {
        flex-shrink: 0;
    }

    .side-grid-2x2 {
        width: auto;
        min-width: 120px;
    }

    .led-display {
        width: auto;
        min-width: 100px;
    }

    .enc-ring {
        width: 50px;
        height: 50px;
    }

    .enc-knob {
        width: 26px;
        height: 26px;
    }

    .enc-knob::after {
        height: 6px;
    }
}

/* ═══════════ MODAL ═══════════ */

.app-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.app-modal-box {
    background: var(--bcr-bg);
    border: 1px solid var(--bcr-border);
    border-radius: 6px;
    padding: 24px 28px;
    min-width: 320px;
    max-width: 480px;
    font-family: 'Google Sans', 'Inter', system-ui, sans-serif;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7);
}

.app-modal-msg {
    margin: 0 0 18px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-muted);
    line-height: 1;
}

.app-modal-detail {
    display: grid;
    grid-template-columns: max-content 1fr;
    column-gap: 14px;
    row-gap: 8px;
    margin-bottom: 22px;
    align-items: baseline;
}

.app-modal-detail-label {
    font-size: var(--fs-base);
    text-align: right;
    color: var(--text-muted);
    white-space: nowrap;
}

.app-modal-detail-value {
    font-family: 'Google Sans', 'Inter', system-ui, sans-serif;
    font-size: 13px;
    color: var(--bcr-text);
    font-weight: 400;
}

.app-modal-input {
    display: block;
    width: 100%;
    margin-bottom: 18px;
    box-sizing: border-box;
}

.app-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 4px;
}

/* ═══════════ SCROLLBAR ═══════════ */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bcr-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--bcr-border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #445;
}

/* ─── MIDI Monitor Filter Panel ─────────────────────────────────── */
.monitor-filter-panel {
    position: absolute;
    bottom: calc(100% + 6px);
    right: 0;
    z-index: 200;
    background: var(--bcr-monitor);
    border: 1px solid var(--bcr-monitor-border);
    border-radius: 6px;
    padding: 12px 14px;
    box-shadow: 0 -6px 20px rgba(0, 0, 0, .5);
    font-size: 11px;
    white-space: nowrap;
}

.mf-col {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mf-divider {
    margin: 5px 0;
    border-top: 1px solid var(--bcr-monitor-border);
}

.mf-row {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--bcr-text);
    cursor: pointer;
    user-select: none;
    line-height: 1.4;
}

.mf-parent {
    font-weight: 600;
}

.mf-child {
    padding-left: 14px;
    color: var(--text-secondary);
}

.monitor-filter-panel input[type="radio"] {
    accent-color: var(--accent);
    width: 12px;
    height: 12px;
    cursor: pointer;
    flex-shrink: 0;
    margin: 0;
}

/* Toggle switch */
.mf-toggle-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.mf-toggle {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.mf-toggle-track {
    width: 26px;
    height: 14px;
    border-radius: 7px;
    background: #3a4a5a;
    display: flex;
    align-items: center;
    padding: 2px;
    transition: background .15s;
    cursor: pointer;
}

.mf-toggle:checked+.mf-toggle-track {
    background: var(--accent);
}

.mf-toggle-thumb {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #fff;
    transition: transform .15s;
}

.mf-toggle:checked+.mf-toggle-track .mf-toggle-thumb {
    transform: translateX(12px);
}

.mf-num-input {
    width: 36px;
    background: #0f1923;
    border: 1px solid var(--bcr-monitor-border);
    border-radius: 3px;
    padding: 1px 4px;
    color: var(--bcr-text);
    font-size: 11px;
    text-align: center;
    -moz-appearance: textfield;
}

.mf-num-input::-webkit-outer-spin-button,
.mf-num-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

#btn-monitor-filter.active {
    color: var(--accent);
    border-color: var(--accent);
}

/* Apply MIDI icon in monitor rows */
.monitor-apply-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    cursor: pointer;
    border-radius: 3px;
    transition: opacity .15s, background .15s;
}

.monitor-apply-btn svg {
    stroke: var(--accent) !important;
}

.monitor-apply-btn:hover {
    background: rgba(var(--accent-rgb), 0.15);
}

.monitor-apply-btn.muted {
    opacity: 0.6;
    cursor: default;
    pointer-events: none;
}

/* ─── MIDI monitor column grid ─── */

/* Global IN / OUT color utility classes */
.midi-in {
    color: var(--midi-in);
}

.midi-out {
    color: var(--midi-out);
}

#midi-monitor-messages {
    display: grid;
    grid-template-columns: 20px repeat(8, max-content);
    min-width: max-content;
}

.monitor-hcell {
    position: sticky;
    top: 0;
    background: var(--bcr-panel);
    border-bottom: 1px solid var(--bcr-border);
    padding: 2px 8px;
    white-space: nowrap;
    z-index: 1;
}

.monitor-row {
    display: contents;
}

.monitor-col {
    padding: 1px 1px 1px 8px;
    white-space: nowrap;
}

/* ── Public preset indicator ── */
.bank-icon-public {
    color: var(--color-info);
    opacity: 1 !important;
}

/* ─── Studio License: upgrade modal ─────────────────────── */
.upgrade-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 24px;
    backdrop-filter: blur(4px);
}

.upgrade-modal-backdrop[hidden] {
    display: none;
}

.upgrade-modal {
    position: relative;
    background: var(--bcr-panel, #0c0c0f);
    border: 1px solid var(--bcr-border, #1e1e22);
    border-radius: 12px;
    padding: 32px 28px 24px;
    width: 100%;
    max-width: 460px;
    color: var(--bcr-text, #e8e8e8);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.upgrade-modal-close {
    position: absolute;
    top: 8px;
    right: 12px;
    background: transparent;
    border: none;
    color: var(--bcr-dim, #a1a1aa);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
}

.upgrade-modal-close:hover {
    color: var(--bcr-text, #e8e8e8);
}

.upgrade-modal-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--bcr-accent, #e94560);
    background: rgba(233, 69, 96, 0.12);
    border: 1px solid rgba(233, 69, 96, 0.4);
    padding: 4px 10px;
    border-radius: 4px;
    margin-bottom: 14px;
}

.upgrade-modal-title {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 10px;
    color: var(--bcr-text, #e8e8e8);
}

.upgrade-modal-reason {
    font-size: 13px;
    color: var(--bcr-dim, #a1a1aa);
    margin: 0 0 18px;
    line-height: 1.5;
}

.upgrade-modal-benefits {
    list-style: none;
    padding: 0;
    margin: 0 0 20px;
    border-top: 1px solid var(--bcr-border, #1e1e22);
    border-bottom: 1px solid var(--bcr-border, #1e1e22);
    padding: 14px 0;
}

.upgrade-modal-benefits li {
    font-size: 13px;
    padding: 6px 0;
    color: var(--bcr-text, #e8e8e8);
}

.upgrade-modal-benefits li::before {
    content: '✓';
    color: var(--bcr-ok, #2ed573);
    font-weight: 700;
    margin-right: 10px;
}

.upgrade-modal-price {
    text-align: center;
    margin: 18px 0 16px;
}

.upgrade-modal-price-amount {
    font-size: 40px;
    font-weight: 700;
    color: var(--bcr-accent, #e94560);
}

.upgrade-modal-price-note {
    display: block;
    font-size: 11px;
    color: var(--bcr-dim, #a1a1aa);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 4px;
}

.upgrade-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-bottom: 14px;
}

.upgrade-modal-fineprint {
    font-size: 11px;
    color: var(--bcr-muted, #52525b);
    text-align: center;
    margin: 0;
    line-height: 1.4;
}

/* ─── Signature badge for verified authors ──────────────── */
.signature-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--bcr-accent, #e94560);
    vertical-align: middle;
    margin-left: 4px;
}

.signature-badge svg {
    width: 14px;
    height: 14px;
}

/* ─── Banks panel — guest / logged-out CTA ───────────────── */
.banks-guest-cta {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 16px 12px;
    padding: 14px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--bcr-border);
    border-radius: 6px;
}

.banks-guest-cta-text {
    font-size: 12px;
    color: var(--bcr-dim);
    line-height: 1.55;
}

.banks-guest-cta-text strong {
    color: var(--bcr-text);
    font-weight: 600;
}

.banks-guest-cta-btn {
    width: 100%;
    justify-content: center;
}

.banks-guest-cta-login {
    font-size: 11px;
    color: var(--bcr-dim);
    text-align: center;
    text-decoration: none;
    transition: color 0.15s;
}

.banks-guest-cta-login:hover {
    color: var(--bcr-text);
}

/* ─── Sidebar Studio License CTA ────────────────────────── */
.studio-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 8px 12px;
    padding: 10px 12px;
    background: linear-gradient(135deg, rgba(233, 69, 96, 0.18), rgba(233, 69, 96, 0.05));
    border: 1px solid rgba(233, 69, 96, 0.4);
    border-radius: 6px;
    color: var(--bcr-text, #e8e8e8);
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s;
}

.studio-cta:hover {
    background: linear-gradient(135deg, rgba(233, 69, 96, 0.28), rgba(233, 69, 96, 0.1));
}

.studio-cta-label {
    font-weight: 600;
}

.studio-cta-price {
    font-size: 11px;
    color: var(--bcr-accent, #e94560);
    font-weight: 700;
}

.studio-cta-active {
    color: var(--bcr-ok, #2ed573);
    border-color: rgba(46, 213, 115, 0.4);
    background: rgba(46, 213, 115, 0.06);
    cursor: default;
}

.studio-cta-active:hover {
    background: rgba(46, 213, 115, 0.06);
}

/* ═══════════ MARKETING PAGES — SHARED ═══════════ */

/* Applied to all marketing pages (index, about, pricing, library, help, terms) */
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

/* ═══════════ INDEX PAGE ═══════════ */

.hero-headline {
    font-family: 'MuseoModerno', sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.05;
}

.demo-frame {
    position: relative;
    border: 1px solid #1e1e22;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.03);
    background: var(--bcr-panel);
    max-width: 100%;
}

.demo-frame::before {
    content: "";
    position: absolute;
    inset: -40px;
    background: radial-gradient(circle at 50% 30%, rgba(233, 69, 96, 0.18), transparent 60%);
    z-index: -1;
    pointer-events: none;
}

.demo-video {
    display: block;
    width: 100%;
    height: auto;
    background: var(--bcr-panel);
}

/* ═══════════ ABOUT (FEATURES) PAGE ═══════════ */

.feature-card {
    transition: transform .2s, box-shadow .2s;
}

.feature-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, .3);
}

.feature-section:nth-child(even) .feature-row {
    flex-direction: row-reverse;
}

.media-placeholder {
    background: linear-gradient(135deg, #0e0e12 0%, #1a1a24 100%);
    border: 1px dashed #2a2a34;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 220px;
    color: #52525b;
    font-size: 0.8rem;
}

.media-placeholder img,
.media-placeholder video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0.75rem;
}

.tier-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ═══════════ PRICING PAGE ═══════════ */

.plan-card {
    transition: transform .2s, box-shadow .2s;
}

.plan-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, .4);
}

.check-icon {
    color: var(--bcr-ok);
    flex-shrink: 0;
}

.cross-icon {
    color: #5a6a7a;
    flex-shrink: 0;
}

/* ═══════════ LIBRARY PAGE ═══════════ */

.library-table {
    border-collapse: separate;
    border-spacing: 0;
}

.star-btn {
    cursor: pointer;
    transition: color .15s, transform .15s;
    background: none;
    border: none;
    padding: 0 1px;
}

.star-btn:hover {
    transform: scale(1.2);
}

.star-btn.filled {
    color: var(--bcr-warn);
}

.star-btn.empty {
    color: #52525b;
}

.preset-row {
    transition: background-color .15s;
}

.preset-row:hover {
    background-color: rgba(255, 255, 255, .03);
}

.model-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 3px;
    border: 1px solid;
}

.model-bcr {
    color: #60a5fa;
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.4);
}

.model-bcf {
    color: #c084fc;
    background: rgba(168, 85, 247, 0.12);
    border-color: rgba(168, 85, 247, 0.4);
}

.avg-stars {
    display: inline-flex;
    align-items: center;
    gap: 1px;
}

/* ═══════════ HELP PAGE ═══════════ */

.toc a {
    transition: color .15s;
}

.toc a:hover {
    color: var(--bcr-text);
}

.help-section {
    scroll-margin-top: 80px;
}

kbd {
    background: var(--bcr-input);
    border: 1px solid #1e1e22;
    border-radius: 3px;
    padding: 1px 5px;
    font-size: 11px;
    font-family: inherit;
}

/* ═══════════ TERMS PAGE ═══════════ */

.legal-section {
    scroll-margin-top: 80px;
}

/* ═══════════ HARDWARE TEST PAGE ═══════════ */

.badge-auto {
    background: #1e1e22;
    color: #a1a1aa;
}

.badge-interact {
    background: #2d1f00;
    color: var(--bcr-warn);
}

.badge-visual {
    background: #0d1f2d;
    color: #3b82f6;
}

.badge-pass {
    background: #0d2818;
    color: var(--bcr-ok);
}

.badge-fail {
    background: #2d0a0a;
    color: #ff4757;
}

.badge-skip {
    background: #1a1a1a;
    color: #52525b;
}

.badge-running {
    background: #1a1200;
    color: var(--bcr-warn);
}

.badge-pending {
    background: #14141a;
    color: #52525b;
}

@keyframes pulse-ring {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

.pulse {
    animation: pulse-ring 1s ease-in-out infinite;
}