* {
    box-sizing: border-box;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

body {
    margin: 0;
    padding: 0;
    background: #000000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #e0e0e0;
    overflow: hidden;
    animation: fadeIn 0.6s ease-out forwards;
}

/* Enhanced synth panel styling */
.synth-panel {
    display: flex;
    height: 100vh;
    background: linear-gradient(135deg, #1a1a1a 0%, #0f0f0f 100%);
}

.side-panel {
    width: 25px;
   background-image: url(https://www.transparenttextures.com/patterns/wood-pattern.png), linear-gradient(to right, #6b4f34, #8c6f4e);
     background-size: auto, cover;
}

.side-panel.right {
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #1a1a1a;
}

/* Compact header styling */
.synth-header {
    background: linear-gradient(135deg, #1f1f1f 0%, #141414 100%);
    border-bottom: 1px solid rgba(201, 120, 89, 0.2);
    padding: 0.5rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.4);
    height: 60px;
}

.brand {
    font-size: 1.2rem;
    font-weight: 300;
    letter-spacing: 0.1em;
    color: #c97859;
    text-shadow: 0 0 6px rgba(201, 120, 89, 0.3);
}

.nav-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.nav-controls > div {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
}

.nav-controls label {
    font-size: 0.65rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

.nav-controls select {
    padding: 0.3rem 0.5rem;
    font-size: 0.65rem;
    background: linear-gradient(135deg, #2a2a2a 0%, #1f1f1f 100%);
    border: 1px solid #333;
    border-radius: 4px;
    color: #e0e0e0;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.3);
    transition: all 0.2s ease;
}

.nav-controls select:focus {
    outline: none;
    border-color: #c97859;
    box-shadow: 0 0 6px rgba(201, 120, 89, 0.3);
}

.midi-status {
    font-size: 0.65rem;
    padding: 0.3rem 0.6rem;
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    border: 1px solid #374151;
    border-radius: 4px;
    min-width: 180px;
    text-align: center;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.2);
}

/* Mode Toggle (Single/Multi) */
.mode-toggle-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
}

.mode-label {
    font-size: 0.65rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

.mode-toggle {
    display: flex;
    background: linear-gradient(135deg, #1f1f1f 0%, #141414 100%);
    border: 1px solid #333;
    border-radius: 4px;
    overflow: hidden;
}

.mode-btn {
    padding: 0.3rem 0.6rem;
    font-size: 0.65rem;
    font-weight: 500;
    background: transparent;
    border: none;
    color: #888;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mode-btn:hover {
    color: #c97859;
    background: rgba(201, 120, 89, 0.1);
}

.mode-btn.active {
    background: linear-gradient(135deg, #c97859 0%, #a85d40 100%);
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.mode-btn:first-child {
    border-right: 1px solid #333;
}

/* Part Tabs (Multi Mode) */
.part-tabs-container {
    display: none;
    background: linear-gradient(135deg, #1a1a1a 0%, #141414 100%);
    border-bottom: 1px solid rgba(201, 120, 89, 0.2);
    padding: 0.5rem 1rem;
}

.part-tabs-container.visible {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.part-tabs {
    display: flex;
    gap: 0.25rem;
}

.part-tab {
    padding: 0.4rem 1rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: linear-gradient(135deg, #2a2a2a 0%, #1f1f1f 100%);
    border: 1px solid #333;
    border-radius: 4px;
    color: #888;
    cursor: pointer;
    transition: all 0.2s ease;
}

.part-tab:hover {
    border-color: #555;
    color: #bbb;
}

.part-tab.active {
    background: linear-gradient(135deg, #c97859 0%, #a85d40 100%);
    border-color: #c97859;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    box-shadow: 0 2px 4px rgba(201, 120, 89, 0.3);
}

.part-indicator {
    font-size: 0.6rem;
    color: #666;
    margin-left: auto;
}

.part-actions {
    display: flex;
    gap: 0.5rem;
    margin-left: 1rem;
}

/* Preset Type Toggle (Single/Multi in sidebar) */
.preset-type-toggle {
    display: flex;
    background: linear-gradient(135deg, #1f1f1f 0%, #141414 100%);
    border: 1px solid #333;
    border-radius: 4px;
    overflow: hidden;
}

.preset-type-btn {
    flex: 1;
    padding: 0.3rem 0.5rem;
    font-size: 0.65rem;
    font-weight: 500;
    background: transparent;
    border: none;
    color: #888;
    cursor: pointer;
    transition: all 0.2s ease;
}

.preset-type-btn:hover {
    color: #c97859;
    background: rgba(201, 120, 89, 0.1);
}

.preset-type-btn.active {
    background: linear-gradient(135deg, #c97859 0%, #a85d40 100%);
    color: #fff;
}

.preset-type-btn:first-child {
    border-right: 1px solid #333;
}

/* Compact program sidebar */
.program-sidebar {
    width: 280px;
    background: linear-gradient(135deg, #1f1f1f 0%, #171717 100%);
    border-right: 1px solid rgba(201, 120, 89, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 2px 0 6px rgba(0,0,0,0.3);
}

.sidebar-section {
    padding: 0.8rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    background: linear-gradient(135deg, rgba(255,255,255,0.02) 0%, rgba(255,255,255,0.01) 100%);
}

.sidebar-section h3 {
    margin: 0 0 0.6rem 0;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #c97859;
    text-shadow: 0 0 4px rgba(201, 120, 89, 0.2);
}

/* Compact input styling */
input[type="number"], input[type="text"] {
    background: linear-gradient(135deg, #2a2a2a 0%, #1f1f1f 100%);
    border: 1px solid #333;
    border-radius: 4px;
    color: #e0e0e0;
    padding: 0.4rem 0.6rem;
    font-size: 0.7rem;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.3);
    transition: all 0.2s ease;
}

input[type="number"]:focus, input[type="text"]:focus {
    outline: none;
    border-color: #c97859;
    box-shadow: 0 0 6px rgba(201, 120, 89, 0.3);
}

/* Compact select styling */
select {
    background: linear-gradient(135deg, #2a2a2a 0%, #1f1f1f 100%);
    border: 1px solid #333;
    border-radius: 4px;
    color: #e0e0e0;
    padding: 0.4rem 0.6rem;
    font-size: 0.7rem;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.3);
    transition: all 0.2s ease;
}

select:focus {
    outline: none;
    border-color: #c97859;
    box-shadow: 0 0 6px rgba(201, 120, 89, 0.3);
}

/* Fix dropdown option styling */
select option {
    background: #2a2a2a;
    color: #e0e0e0;
    padding: 0.4rem;
}

select option:checked {
    background: #c97859;
    color: #ffffff;
}

/* Compact button styling */
.synth-button {
    cursor: pointer;
    padding: 0.4rem 0.8rem;
    font-size: 0.7rem;
    font-weight: 500;
    border-radius: 4px;
    border: 1px solid;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.synth-button.primary {
    background: linear-gradient(135deg, #c97859 0%, #b86749 100%);
    border-color: #c97859;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.synth-button.primary:hover {
    background: linear-gradient(135deg, #d48569 0%, #c97859 100%);
    box-shadow: 0 3px 8px rgba(201, 120, 89, 0.3);
}

.synth-button.secondary {
    background: linear-gradient(135deg, #4a4a4a 0%, #3a3a3a 100%);
    border-color: #555;
    color: #e0e0e0;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.synth-button.secondary:hover {
    background: linear-gradient(135deg, #555 0%, #444 100%);
    box-shadow: 0 3px 6px rgba(255,255,255,0.1);
}

/* Compact and fixed synth checkbox styling */
.synth-checkbox {
    cursor: pointer;
    padding: 0.3rem 0.6rem;
    font-size: 0.65rem;
    font-weight: 500;
    border-radius: 4px;
    border: 1px solid #333;
    background: linear-gradient(135deg, #2a2a2a 0%, #1f1f1f 100%);
    color: #e0e0e0;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    min-width: 40px;
    text-align: center;
    display: inline-block;
}

.synth-checkbox:hover {
    background: linear-gradient(135deg, #333 0%, #262626 100%);
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.synth-checkbox.checked {
    background: linear-gradient(135deg, #c97859 0%, #b86749 100%);
    border-color: #c97859;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    box-shadow: 0 0 8px rgba(201, 120, 89, 0.4);
}

.synth-checkbox input {
    display: none !important;
}

/* Compact preset list styling */
#synthPresetList {
    background: linear-gradient(135deg, #151515 0%, #0f0f0f 100%);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 6px;
}

.preset-item-loader {
    display: flex;
    align-items: center;
    padding: 0.4rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    cursor: pointer;
    transition: background-color 0.2s ease;
    gap: 0.5rem;
}

.preset-item-loader:hover {
    background: rgba(255,255,255,0.03);
}

.preset-item-loader.selected {
    background: rgba(201, 120, 89, 0.1);
    border-left: 3px solid #c97859;
}

.preset-item-loader.loaded {
    background: rgba(201, 120, 89, 0.15);
    border-left: 3px solid #c97859;
    box-shadow: 0 0 8px rgba(201, 120, 89, 0.2);
}

.preset-item-loader .drag-handle {
    font-size: 0.6rem;
    color: #666;
    cursor: grab;
    width: 12px;
    text-align: center;
}

.preset-item-loader .preset-number {
    font-size: 0.7rem;
    color: #888;
    min-width: 20px;
    text-align: center;
}

.preset-item-loader .preset-name {
    flex: 1;
    font-size: 0.7rem;
    color: #e0e0e0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.preset-item-loader .icon-button {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 2px;
    transition: all 0.2s ease;
}

.preset-item-loader .icon-button:hover {
    background: rgba(255,255,255,0.1);
}

.preset-item-loader .icon-button svg {
    width: 12px;
    height: 12px;
    color: #888;
}

.preset-item-loader .icon-button:hover svg {
    color: #c97859;
}

.preset-item-loader .delete-button:hover svg {
    color: #ef4444;
}

.import-controls {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.import-controls .import-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.8rem;
    font-size: 0.7rem;
    font-weight: 500;
    border-radius: 4px;
    border: 1px solid;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    background: linear-gradient(135deg, #37373d 0%, #222228 100%);
    border-color: #444;
    color: #e0e0e0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.import-controls .import-button:not(:disabled):hover {
    background: linear-gradient(135deg, #424248 0%, #2d2d33 100%);
    border-color: #c97859;
    box-shadow: 0 0 8px rgba(201, 120, 89, 0.3);
}

.import-controls .import-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.import-controls .import-button svg {
    width: 14px;
    height: 14px;
}

#importBankSelect {
    background: linear-gradient(135deg, #2a2a2a 0%, #1f1f1f 100%);
    border: 1px solid #333;
    border-radius: 4px;
    color: #e0e0e0;
    padding: 0.4rem 0.6rem;
    font-size: 0.7rem;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.3);
    transition: all 0.2s ease;
}

#importBankSelect:focus {
    outline: none;
    border-color: #c97859;
    box-shadow: 0 0 6px rgba(201, 120, 89, 0.3);
}

.empty-state {
    padding: 2rem;
    text-align: center;
    color: #666;
    font-size: 0.7rem;
    font-style: normal;
}

/* Very compact control panels styling */
.control-panels {
    flex: 1;
    padding: 0.6rem;
    overflow-y: auto;
    background: linear-gradient(135deg, #1a1a1a 0%, #111 100%);
}

.control-row {
    display: flex;
    gap: 0.8rem;
    margin-bottom: 0.6rem;
    align-items: flex-start;
    flex-wrap: wrap;
}

/* Specific spacing for dropdown pairs that tend to overlap */
.control-row select + select {
    margin-left: 0.4rem;
}

/* Ensure shape and mode dropdowns have enough space */
select[data-cc="53"] + select[data-cc="60"], /* LFO1 Shape + Mode */
select[data-cc="61"] + select[data-cc="70"], /* LFO2 Shape + Mode */
select[data-cc="14"] + select[data-cc="3"],  /* OSC1 Shape + Transpose */
select[data-cc="34"] + select[data-cc="30"] { /* OSC2 Shape + Transpose */
    margin-left: 0.6rem;
}

/* Make control groups more flexible to prevent cramping */
.control-group {
    flex: 0 0 auto;
    min-width: 70px;
    max-width: 120px;
    margin-right: 0.2rem;
}

.sections-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 0.8rem;
    max-width: none;
}

.section {
    background: linear-gradient(135deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0.01) 100%);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 6px;
    padding: 0.8rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    backdrop-filter: blur(5px);
    min-width: 250px;
    opacity: 0;
    animation: fadeInUp 0.5s ease-out forwards;
}

.section:nth-child(1) { animation-delay: 0.1s; }
.section:nth-child(2) { animation-delay: 0.15s; }
.section:nth-child(3) { animation-delay: 0.2s; }
.section:nth-child(4) { animation-delay: 0.25s; }
.section:nth-child(5) { animation-delay: 0.3s; }
.section:nth-child(6) { animation-delay: 0.35s; }
.section:nth-child(7) { animation-delay: 0.4s; }
.section:nth-child(8) { animation-delay: 0.45s; }
.section:nth-child(9) { animation-delay: 0.5s; }
.section:nth-child(10) { animation-delay: 0.55s; }
.section:nth-child(n+11) { animation-delay: 0.6s; }

.section-header {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #c97859;
    margin-bottom: 0.6rem;
    padding-bottom: 0.2rem;
    border-bottom: 1px solid rgba(201, 120, 89, 0.2);
    text-shadow: 0 0 4px rgba(201, 120, 89, 0.2);
    cursor: grab;
    user-select: none;
}

.section-header:active {
    cursor: grabbing;
}

.control-label {
    font-size: 0.6rem;
    color: #999;
    margin-bottom: 0.3rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

/* Compact loader panel */
.loader-panel {
    width: 300px;
    background: linear-gradient(135deg, #1f1f1f 0%, #171717 100%);
    border-right: 1px solid rgba(201, 120, 89, 0.1);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    height: 100%;
    overflow: hidden;
    box-shadow: 2px 0 6px rgba(0,0,0,0.3);
}

.loader-panel.hidden {
    transform: translateX(-100%);
    position: absolute;
    z-index: -1;
}

.load-syx-button {
    background: linear-gradient(135deg, #c97859 0%, #b86749 100%);
    border: 1px solid #c97859;
    color: #fff;
    padding: 0.6rem 1rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(201, 120, 89, 0.2);
}

.load-syx-button:hover {
    background: linear-gradient(135deg, #d48569 0%, #c97859 100%);
    box-shadow: 0 4px 12px rgba(201, 120, 89, 0.3);
}

/* Smaller knob styling */
.knob-placeholder-div {
    margin: 0.2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 45px;
    max-width: 60px;
}

/* Modal styling */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
}

.modal-content {
    background: linear-gradient(135deg, #2a2a2a 0%, #1f1f1f 100%);
    margin: 10% auto;
    padding: 1.5rem;
    border: 1px solid rgba(201, 120, 89, 0.3);
    border-radius: 8px;
    width: 90%;
    max-width: 400px;
    color: #e0e0e0;
    box-shadow: 0 6px 24px rgba(0,0,0,0.5);
}

.modal-content p {
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

/* Modal button container */
#modalButtons {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

/* Typography refinements */
label {
    font-size: 0.65rem;
    color: #aaa;
    font-weight: 500;
}

/* Compact spacing and layout */
.flex {
    display: flex;
}

.gap-2 {
    gap: 0.3rem;
}

.gap-4 {
    gap: 0.6rem;
}

.mb-2 {
    margin-bottom: 0.3rem;
}

.mb-3 {
    margin-bottom: 0.5rem;
}

.w-full {
    width: 100%;
}

.text-xs {
    font-size: 0.65rem;
}

/* Special Global panel - full width */
.global-panel {
    background: linear-gradient(135deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0.01) 100%);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 6px;
    padding: 0.6rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    backdrop-filter: blur(5px);
    margin-bottom: 0.6rem;
    width: 100%;
}

.global-panel .control-row {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 0.6rem;
    align-items: flex-start;
    flex-wrap: wrap;
    justify-content: flex-start;
}

.global-panel .control-group {
    flex: 0 0 auto;
    min-width: 60px;
    max-width: 100px;
}

/* Top effects row layout */
.top-effects-row {
    display: flex;
    gap: 0.6rem;
    margin-bottom: 0.6rem;
}

.top-effect-panel {
    background: linear-gradient(135deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0.01) 100%);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 6px;
    padding: 0.6rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    backdrop-filter: blur(5px);
    min-width: 200px;
}

.top-effect-panel .control-row {
    display: flex;
    gap: 0.4rem;
    align-items: flex-start;
    flex-wrap: wrap;
}

/* Compact dropdown styles - match header select styling */
.compact-dropdown {
    width: fit-content;
    max-width: max-content;
    padding: 0.3rem 0.5rem !important;
    font-size: 0.65rem !important;
}

/* Transpose dropdowns - very narrow for 3-character values */
.transpose-dropdown,
select[data-cc="3"],   /* OSC1 Transpose */
select[data-cc="30"],  /* OSC2 Transpose */
select[id="globalTranspose"] { /* Global Transpose */
    width: fit-content;
    max-width: max-content;
    min-width: 50px; /* Just enough for "+24" */
    padding: 0.3rem 0.4rem !important;
    font-size: 0.65rem !important;
}

/* Parameter dropdowns - auto-size to content */
.section select {
    width: fit-content;
    max-width: max-content;
    min-width: 80px; /* Minimum for usability */
    padding: 0.4rem 0.6rem;
    font-size: 0.7rem;
}

/* Remove specific hard-coded widths for shape and mode dropdowns */
select[data-cc="14"], /* OSC1 Shape */
select[data-cc="34"], /* OSC2 Shape */
select[data-cc="53"], /* LFO1 Shape */
select[data-cc="61"], /* LFO2 Shape */
select[data-cc="72"], /* LFO3 Shape */
select[data-cc="60"], /* LFO1 Mode */
select[data-cc="70"] { /* LFO2 Mode */
    width: fit-content;
    max-width: max-content;
    min-width: 90px; /* Slightly larger minimum for these complex options */
}

/* Coffee button - maintain aspect ratio and prevent stretching */
.h-9 {
    height: 2.25rem; /* 36px */
    width: auto; /* Maintain aspect ratio */
    max-width: none;
    flex-shrink: 0; /* Prevent shrinking */
}

/* Ensure coffee button container doesn't stretch */
a[href*="buymeacoffee"] {
    flex-shrink: 0;
    display: inline-block;
}

/* Ensure dropdown options are properly styled */
.section select option {
    background: #2a2a2a;
    color: #e0e0e0;
    padding: 0.5rem;
    font-size: 0.7rem;
}

.section select option:checked,
.section select option:hover {
    background: #c97859;
    color: #ffffff;
}

/* Panel drag/drop styling */
.draggable-panel {
    transition: all 0.2s ease;
}

.draggable-panel .section-header {
    cursor: grab;
    user-select: none;
}

.draggable-panel .section-header:hover {
    background: rgba(201, 120, 89, 0.1);
    border-radius: 4px;
    padding: 2px 4px;
    margin: -2px -4px;
}

/* Ghost/placeholder showing where panel will drop */
.sortable-ghost {
    opacity: 0.3;
    background: rgba(201, 120, 89, 0.15);
    border: 2px dashed #c97859;
    box-shadow: 0 0 12px rgba(201, 120, 89, 0.4);
}

/* Knob-specific styling */
.knob-row {
    justify-content: flex-start;
    flex-wrap: wrap;
}

.knob-control-group {
    flex: 0 0 auto;
    min-width: 60px;
    max-width: 100px;
}

.single-section-row {
    display: flex;
    justify-content: center;
    margin-bottom: 0.6rem;
}

.vertical-dual-section {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-bottom: 0.6rem;
    max-width: 300px;
}

/* ===== PART SETTINGS PANEL (Multi Mode) ===== */
.part-settings-panel {
    display: none;
    background: linear-gradient(135deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0.01) 100%);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 6px;
    padding: 0.6rem;
    margin-bottom: 0.6rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    backdrop-filter: blur(5px);
}

.part-settings-panel.visible {
    display: block;
}

.part-settings-panel .section-header {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #c97859;
    margin-bottom: 0.5rem;
    padding-bottom: 0.2rem;
    border-bottom: 1px solid rgba(201, 120, 89, 0.2);
    text-shadow: 0 0 4px rgba(201, 120, 89, 0.2);
}

.part-settings-controls {
    display: flex;
    gap: 1.5rem;
    align-items: flex-end;
    padding-bottom: 1rem; /* Room for hint text below controls */
}

.part-setting-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    position: relative;
}

/* Position hints below controls without affecting alignment */
.part-setting-group .midi-learn-hint {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 0.15rem;
    white-space: nowrap;
}

.part-setting-label {
    font-size: 0.6rem;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

.part-setting-select,
.part-setting-input {
    background: linear-gradient(135deg, #2a2a2a 0%, #1f1f1f 100%);
    border: 1px solid #333;
    border-radius: 4px;
    color: #e0e0e0;
    padding: 0.35rem 0.5rem;
    font-size: 0.7rem;
    width: 80px;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.3);
    transition: all 0.2s ease;
}

.part-setting-select:focus,
.part-setting-input:focus {
    outline: none;
    border-color: #c97859;
    box-shadow: 0 0 6px rgba(201, 120, 89, 0.3);
}

/* Part Synth Parameters row (PB Range, Glide, Mode, Voices) */
.part-synth-params {
    display: flex;
    gap: 1.5rem;
    align-items: flex-end;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255,255,255,0.05);
}

/* MIDI Learn styling */
.midi-learn-hint {
    font-size: 0.55rem;
    color: #666;
    height: 1em;
    margin-top: 0.1rem;
}

.note-select.listening {
    border-color: #22c55e;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.4);
    animation: pulse-green 1s infinite;
}

@keyframes pulse-green {
    0%, 100% {
        box-shadow: 0 0 8px rgba(34, 197, 94, 0.4);
    }
    50% {
        box-shadow: 0 0 12px rgba(34, 197, 94, 0.6);
    }
}

.midi-learn-hint.listening {
    color: #22c55e;
}

/* Zone save hint - always visible warning for parameters that require save */
.zone-save-hint {
    font-size: 0.5rem;
    color: #f59e0b;
    margin-top: 0.15rem;
    white-space: nowrap;
}

/* Part disabled state (channel = OFF) */
.part-tab.disabled {
    opacity: 0.5;
}

.part-tab.disabled::after {
    content: ' (OFF)';
    font-size: 0.55rem;
    color: #888;
}