/* ============================================================
   RESET
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
    background: #08090d;
    color: #b0bcd0;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 10px;
    padding: 4px;
    min-width: 1100px;
    user-select: none;
}

/* ============================================================
   CSS VARIABLES
   ============================================================ */
:root {
    --bg:        #0d0f16;
    --bg-sec:    #0a0c12;
    --bg-dark:   #07080e;
    --brd:       #1c2035;
    --brd2:      #242840;
    --txt:       #b0bcd0;
    --lbl:       #5870a0;
    --hdr:       #6878a8;
    --grn:       #00cc44;
    --orn:       #dd8800;
    --blu:       #4488ee;
    --k-hi:      #304068;
    --k-lo:      #070a18;
    --dot:       #d8e4ff;
    --lcd-bg:    #030810;
    --lcd-txt:   #30cc50;
}

/* ============================================================
   EDITOR CONTAINER
   ============================================================ */
.editor {
    background: var(--bg);
    border: 1px solid var(--brd2);
    border-radius: 3px;
    display: flex;
    flex-direction: column;
}

/* ============================================================
   SECTION LABEL (bottom label bar)
   ============================================================ */
.sec-lbl {
    font-size: 7.5px;
    font-weight: bold;
    color: var(--hdr);
    text-transform: uppercase;
    letter-spacing: .14em;
    text-align: center;
    padding: 2px 0;
    border-top: 1px solid var(--brd);
    background: var(--bg-dark);
}

/* ============================================================
   KNOB COMPONENT
   ============================================================ */
.knob-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    cursor: ns-resize;
}
.knob {
    border-radius: 50%;
    background: radial-gradient(circle at 38% 30%, var(--k-hi), var(--k-lo));
    border: 1px solid #1c2840;
    box-shadow: 0 0 6px rgba(40,80,200,.3), inset 0 1px 0 rgba(80,120,255,.1), 0 2px 5px rgba(0,0,0,.8);
    position: relative;
    flex-shrink: 0;
}
.knob:hover { border-color: #304090; }
.knob-dot {
    position: absolute;
    background: var(--dot);
    border-radius: 50%;
    pointer-events: none;
}
/* Sizes */
.kn-xl { width: 38px; height: 38px; }
.kn-lg { width: 32px; height: 32px; }
.kn-md { width: 26px; height: 26px; }
.kn-sm { width: 20px; height: 20px; }
.kn-xs { width: 16px; height: 16px; }

/* Dot sizes and transform-origins */
.kn-xl .knob-dot { width:4px; height:4px; top:3px; left:calc(50% - 2px); transform-origin:50% 16px; }
.kn-lg .knob-dot { width:4px; height:4px; top:3px; left:calc(50% - 2px); transform-origin:50% 13px; }
.kn-md .knob-dot { width:3px; height:3px; top:2px; left:calc(50% - 1.5px); transform-origin:50% 11px; }
.kn-sm .knob-dot { width:3px; height:3px; top:2px; left:calc(50% - 1.5px); transform-origin:50% 8px; }
.kn-xs .knob-dot { width:2px; height:2px; top:2px; left:calc(50% - 1px);   transform-origin:50% 6px; }

.knob-val {
    font-size: 11px; color: var(--txt);
    min-width: 20px; text-align: center; line-height: 1;
}
.knob-lbl {
    font-size: 6.5px; color: var(--lbl);
    text-transform: uppercase; letter-spacing: .06em;
    text-align: center; line-height: 1.1;
}
.knob-row { display: flex; gap: 5px; align-items: flex-start; justify-content: center; }

/* Vari knob — blue tint */
.knob.k-vari {
    background: radial-gradient(circle at 38% 30%, #183878, #030a1c);
    border-color: #183070;
    box-shadow: 0 0 8px rgba(30,80,255,.5), inset 0 1px 0 rgba(80,140,255,.2), 0 2px 5px rgba(0,0,0,.8);
}
.knob.k-vari .knob-dot { background: #88aaff; }
/* Green tint for main vol */
.knob.k-vol {
    background: radial-gradient(circle at 38% 30%, #305030, #08100a);
    border-color: #205030;
    box-shadow: 0 0 8px rgba(30,200,60,.3), inset 0 1px 0 rgba(60,200,80,.1), 0 2px 5px rgba(0,0,0,.8);
}
.knob.k-vol .knob-dot { background: #70ee90; }

/* ============================================================
   LED BUTTONS
   ============================================================ */
.lb {
    font: bold 7.5px Arial, sans-serif;
    text-transform: uppercase;
    letter-spacing: .05em;
    padding: 2px 5px;
    border: 1px solid #1c2438;
    background: #09090e;
    color: var(--lbl);
    border-radius: 1px;
    cursor: pointer;
    white-space: nowrap;
}
.lb:hover { border-color: #304090; color: var(--txt); }
.lb.on   { background:#002a10; border-color:#008830; color:var(--grn);
            box-shadow:0 0 4px rgba(0,180,50,.4); }
.lb.mute { background:#200c00; border-color:#885500; color:var(--orn); }
.lb.sel  { background:#080e28; border-color:#2848a0; color:var(--blu); }
.lb.act  { background:#060818; border-color:#202c60; color:#8090c0; }

/* ============================================================
   SELECTS + INPUTS
   ============================================================ */
.cs2x-sel {
    background: #040608; border: 1px solid #1a2038; color: var(--txt);
    font-size: 9px; font-family: inherit; padding: 1px 3px; border-radius: 1px;
    appearance: none; -webkit-appearance: none; cursor: pointer;
}
.cs2x-sel:focus { outline: none; border-color: #304090; }

/* ============================================================
   PAN SLIDER (horizontal)
   ============================================================ */
.pan-box { padding: 5px 6px 3px; }
.pan-lbl { font-size: 6.5px; color: var(--lbl); text-transform: uppercase;
            letter-spacing: .07em; margin-bottom: 3px; }
.pan-track {
    position: relative; height: 12px;
    display: flex; align-items: center;
}
.pan-track::after {
    content: ''; position: absolute;
    left: 50%; top: 2px; bottom: 2px;
    width: 1px; background: #383850; pointer-events: none;
}
input.pan-sl {
    width: 100%; height: 3px; margin: 0;
    -webkit-appearance: none; appearance: none;
    background: #0d1020; border-radius: 2px; cursor: ew-resize;
    position: relative;
}
input.pan-sl::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 7px; height: 13px;
    background: #c0cce0; border: 1px solid #8090b0;
    border-radius: 1px; cursor: ew-resize;
}

/* ============================================================
   VERTICAL SLIDER (layer volume)
   ============================================================ */
input.vsl {
    writing-mode: vertical-lr; direction: rtl;
    -webkit-appearance: slider-vertical; appearance: slider-vertical;
    width: 14px; height: 54px; cursor: ns-resize;
    accent-color: #4488ee;
}
.vsl-wrap { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.vsl-lbl  { font-size: 6.5px; color: var(--lbl); }

/* ============================================================
   FX TYPE BADGE
   ============================================================ */
.fx-badge {
    background: #030608; border: 1px solid #101828;
    color: #6888b8; font-size: 8.5px; padding: 1px 5px;
    border-radius: 1px; white-space: nowrap;
}

/* ============================================================
   TOP ROW (LFO | OSCILLATOR | L.P.FILTER | AMPLIFIER | LAYERS)
   ============================================================ */
.top-row {
    border-bottom: 2px solid var(--brd2);
    flex-shrink: 0;
}
.top-sec {
    display: flex; flex-direction: column;
    border-right: 1px solid var(--brd);
    background: var(--bg-sec);
}
.top-sec:last-child { border-right: none; }
.tsb { flex: 1; padding: 5px 6px 3px; display: flex; flex-direction: column; gap: 4px; }

/* ============================================================
   MIDDLE ROW (layers + performance common)
   ============================================================ */
.mid-row { flex: 1; border-bottom: 1px solid var(--brd2); }

/* ============================================================
   LAYER COLUMNS
   ============================================================ */
.layers-area {
    border-right: 2px solid var(--brd2);
    overflow: hidden;
}
.lc {
    border-right: 1px solid var(--brd);
    background: var(--bg-sec);
    display: flex; flex-direction: column;
}
.lc:last-child { border-right: none; }
.lc.inactive { opacity: .3; pointer-events: none; }

.lbody { flex: 1; display: flex; flex-direction: column; }
.lsec  { border-bottom: 1px solid var(--brd); padding: 4px 5px 3px; }
.lsec:last-child { border-bottom: none; }

.lfooter {
    background: var(--bg-dark); border-top: 1px solid var(--brd);
    padding: 4px 5px; display: flex; flex-direction: column;
    align-items: center; gap: 3px;
}
.lname { font-size: 8px; font-weight: bold; color: var(--hdr);
          text-transform: uppercase; letter-spacing: .1em; }

.eq-val { font-size: 8.5px; color: var(--txt); }

/* ============================================================
   PERFORMANCE COMMON (right panel)
   ============================================================ */
.pc {
    display: flex; flex-direction: column;
    background: var(--bg-sec); min-width: 0; overflow: hidden;
}
.pc-head {
    background: var(--bg-dark); border-bottom: 1px solid var(--brd);
    padding: 3px 8px; display: flex; align-items: center; gap: 6px; flex-shrink: 0;
}
.pc-title {
    font-size: 9px; font-weight: bold; color: var(--txt);
    letter-spacing: .07em; text-transform: uppercase; margin-left: auto;
}
.pc-body { flex: 1; overflow: hidden; }
.pc-left { display: flex; flex-direction: column; overflow-y: auto; min-width: 0; }
.pc-right {
    border-left: 1px solid var(--brd);
    display: flex; flex-direction: column; overflow-y: auto;
}
.pcs { border-bottom: 1px solid var(--brd); padding: 4px 7px; }
.pcs:last-child { border-bottom: none; flex: 1; }
.prow { display: flex; align-items: center; gap: 5px; padding: 1px 0; }
.pk   { font-size: 7px; color: var(--lbl); text-transform: uppercase;
         letter-spacing: .06em; min-width: 28px; flex-shrink: 0; }
.pv   { font-size: 9px; color: var(--txt); }
.sub-lbl {
    font-size: 6.5px; font-weight: bold; color: var(--hdr);
    text-transform: uppercase; letter-spacing: .12em; text-align: center;
    border-top: 1px solid var(--brd); border-bottom: 1px solid var(--brd);
    padding: 1px 0; margin: 3px -7px; background: var(--bg-dark);
}

/* ============================================================
   CONTROL BAR
   ============================================================ */
.ctrl-bar {
    background: var(--bg-dark); border-top: 1px solid var(--brd2);
    padding: 5px 8px; display: flex; align-items: center; gap: 8px;
    flex-shrink: 0; flex-wrap: wrap; min-height: 44px;
}
.logo { display: flex; flex-direction: column; gap: 0; margin-right: 3px; }
.logo-top   { font-size: 7.5px; color: #6878a0; letter-spacing: .09em; font-weight: bold; }
.logo-brand { font-size: 12px;  color: #c0ccd8; letter-spacing: .04em; font-weight: bold; }
.logo-model { font-size: 10px;  color: #f0a000; letter-spacing: .06em; font-weight: bold; }
.ctrl-sep { width: 1px; height: 26px; background: var(--brd); flex-shrink: 0; }
.ctrl-btn {
    font: bold 7.5px Arial, sans-serif; text-transform: uppercase; letter-spacing: .07em;
    padding: 3px 7px; border: 1px solid #1c2438; background: #0b0c14;
    color: #5870a0; border-radius: 1px; cursor: pointer;
}
.ctrl-btn:hover { border-color: #304090; color: var(--txt); }
.lcd-name {
    background: var(--lcd-bg); border: 1px solid #0a1810;
    padding: 2px 8px; font-family: 'Courier New', monospace;
    font-size: 11px; color: var(--lcd-txt); border-radius: 1px;
    min-width: 92px;
}
.ctrl-sp { flex: 1; }

/* ============================================================
   KEYBOARD AREA
   ============================================================ */
.kb-area {
    background: var(--bg-dark);
    padding: 6px 8px 6px;
    flex-shrink: 0;
    overflow-x: auto;
}
/* Layer volume sliders — shown in ctrl-bar */
.ctrl-sliders { display: flex; gap: 5px; align-items: flex-end; flex-shrink: 0; }

/* ============================================================
   TOP ROW COMPONENT STYLES
   ============================================================ */

/* Subsection header (FILTER-EG, MODULATION, AMP-EG) */
.ts-sublbl { font-size: 6.5px; color: var(--lbl); text-align: center; letter-spacing: .1em; text-transform: uppercase; }

/* tsb modifiers */
.tsb-sm { gap: 3px; }

/* LFO */
.sel-68   { width: 68px; font-size: 8px; }
.wv-lg    { font-size: 11px; color: #6080a0; }
.wv-sm    { font-size:  9px; color: #6080a0; }
.lb-wave  { padding: 1px 4px; font-size: 9px; }
.lb-xs    { padding: 1px 3px; }
.lbl-sm   { font-size: 7px; color: var(--lbl); }
.lb-start { align-self: flex-start; }

/* OSCILLATOR */
.lbl-key     { font-size: 7px; color: var(--lbl); min-width: 26px; flex-shrink: 0; }
.sel-74      { width: 74px; }
.val-sm      { font-size: 8px; color: var(--txt); }
.lb-sm       { padding: 1px 6px; }
.lbl-ml      { font-size: 7px; color: var(--lbl); margin-left: 3px; }
.note-lim-kn { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.lbl-xs      { font-size: 6.5px; color: var(--lbl); }
.pb-px       { padding-bottom: 1px; }
.knob-wrap-ml{ margin-left: 2px; }
.knob-val-sm { font-size: 7px; }
.knob-lbl-xs { font-size: 5.5px; }
.mode-wrap   { display: flex; flex-direction: column; gap: 1px; }
.sel-44      { width: 44px; font-size: 8px; }

/* Knob row gap variants */
.knob-row-xs { gap: 2px; }
.knob-row-sm { gap: 4px; }
.knob-row-md { gap: 6px; }
.knob-row-lg { gap: 10px; }

/* AMPLIFIER / LAYER SELECTOR */
.layer-sel  { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; width: 100%; }
.lb-full    { width: 100%; padding: 2px 0; text-align: center; }
.lbl-micro  { font-size: 6px; color: var(--lbl); letter-spacing: .09em; text-transform: uppercase; }

/* ============================================================
   MIDDLE ROW COMPONENT STYLES
   ============================================================ */

/* Layer section */
.lsec-grow   { flex: 1; }
.lsec-center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; }
.ctb-val     { font-size: 9px; color: var(--txt); padding-bottom: 14px; }
.lb-w38      { width: 38px; }

/* LED dots */
.led     { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.led-on  { background: var(--grn); }
.led-off { background: #151c30; border: 1px solid #1c2440; }

/* PC buttons */
.lb-md   { padding: 2px 8px; }
.lb-sm2  { padding: 2px 6px; }
.lb-sm3  { padding: 2px 5px; }
.lb-send { padding: 1px 3px; min-width: 26px; }
.lb-tiny { padding: 0 3px; font-size: 6px; }

/* Values */
.tempo-val   { font-size: 11px; font-weight: bold; color: var(--txt); }
.fx-val      { font-size: 8.5px; color: var(--txt); font-family: monospace; }
.val-sm2     { font-size: 7.5px; color: var(--txt); }
.send-item   { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.knob-lbl-mw { max-width: 28px; }

/* Ctrl bar */
.lbl-ctrl    { font-size: 5.5px; color: var(--lbl); letter-spacing: .07em; }
.lcd-sm      { min-width: 60px; font-size: 9px; }
.sel-92      { width: 92px; }
.sel-65      { width: 65px; font-size: 8px; }

/* Sub-label modifier */
.sub-lbl-nt  { border-top: none; }
