@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&family=Space+Mono:wght@400;700&display=swap');

:root {
    /* @tweakable theme colors */
    --primary-color: #6200ea;
    --secondary-color: #03dac6;
    --background-color: #121212;
    --surface-color: #1e1e1e;
    --surface-color-light: #2d2d2d;
    --accent-color: #bb86fc;
    --error-color: #cf6679;
    --success-color: #4caf50;
    --text-primary: rgba(255, 255, 255, 0.87);
    --text-secondary: rgba(255, 255, 255, 0.6);
    
    /* @tweakable instrument colors */
    --synth-color: #bb86fc;
    --piano-color: #03dac6;
    --bass-color: #ff4081;
    --drums-color: #ffab40;
    
    /* @tweakable active note colors/gradients */
    --synth-active: linear-gradient(135deg, #bb86fc, #9942fa);
    --piano-active: linear-gradient(135deg, #03dac6, #018786);
    --bass-active: linear-gradient(135deg, #ff4081, #c51162);
    --drums-active: linear-gradient(135deg, #ffab40, #ff6d00);
    
    /* @tweakable hover colors */
    --synth-hover: rgba(187, 134, 252, 0.3);
    --piano-hover: rgba(3, 218, 198, 0.3);
    --bass-hover: rgba(255, 64, 129, 0.3);
    --drums-hover: rgba(255, 171, 64, 0.3);
    
    /* @tweakable layout dimensions */
    --header-height: 80px;
    --chat-height: 180px;
    --board-gap: 12px;
    --visualizer-height: 40px;
    --note-labels-width: 40px;
    
    /* @tweakable cell appearance */
    --cell-border-radius: 4px;
    --cell-inactive-opacity: 0.2;
    --cell-active-shadow: 0 0 10px;
    
    /* @tweakable animation timings */
    --transition-fast: 0.15s;
    --transition-medium: 0.3s;
    --beat-pulse-duration: 0.3s;
    
    /* @tweakable 32-step pattern features */
    --measure-divider-color: rgba(255, 255, 255, 0.4);
    --measure-divider-width: 2px;
    --step-number-size: 9px;
    --board-scroll-speed: 300ms;
    --board-scroll-behavior: smooth;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: 1.6;
    height: 100vh;
    overflow: hidden;
}

.container {
    display: grid;
    grid-template-rows: auto 1fr auto;
    height: 100vh;
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem;
    gap: 1rem;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid var(--accent-color);
    height: var(--header-height);
    background-color: var(--surface-color);
    border-radius: 8px;
}

.title-area {
    display: flex;
    align-items: center;
    gap: 1rem;
}

h1 {
    font-family: 'Space Mono', monospace;
    color: var(--accent-color);
    font-size: 2.5rem;
    margin: 0;
    text-shadow: 0 0 15px rgba(187, 134, 252, 0.4);
}

.help-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color var(--transition-fast);
}

.help-btn:hover {
    color: var(--text-primary);
}

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

button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Space Mono', monospace;
    transition: all var(--transition-medium);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
}

button:hover {
    background-color: #7c4dff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.play-btn {
    background-color: var(--primary-color);
    min-width: 80px;
    justify-content: center;
}

.play-btn.playing {
    background-color: var(--secondary-color);
}

.stop-btn {
    background-color: var(--error-color);
    min-width: 80px;
    justify-content: center;
}

.stop-btn:hover {
    background-color: #e57373;
}

.reset-btn {
    background-color: #ff6b6b;
    min-width: 80px;
    justify-content: center;
}

.reset-btn:hover {
    background-color: #ff8787;
}

.tempo-control, .volume-control {
    display: flex;
    flex-direction: column;
    min-width: 150px;
    background-color: var(--surface-color-light);
    padding: 0.5rem;
    border-radius: 4px;
}

.tempo-control label, .volume-control label {
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
    display: flex;
    justify-content: space-between;
}

input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 5px;
    background: var(--surface-color);
    border-radius: 5px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: var(--secondary-color);
    cursor: pointer;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
    transition: all var(--transition-fast);
}

input[type="range"]::-webkit-slider-thumb:hover {
    width: 18px;
    height: 18px;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.5);
}

select {
    background-color: var(--surface-color);
    color: var(--text-primary);
    border: 1px solid var(--accent-color);
    padding: 0.5rem;
    border-radius: 4px;
    outline: none;
    cursor: pointer;
}

.instruments-container {
    display: grid;
    grid-template-rows: repeat(2, 1fr);
    grid-template-columns: repeat(2, 1fr);
    gap: var(--board-gap);
    height: calc(100vh - var(--header-height) - var(--chat-height) - 3rem);
    min-height: 300px;
    max-height: 600px;
    overflow: visible;
}

.instrument-section {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--surface-color);
    border-radius: 8px;
    background-color: var(--surface-color);
    overflow: hidden;
    min-height: 120px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: box-shadow var(--transition-medium), transform var(--transition-medium);
}

.instrument-section:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}

.instrument-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    background-color: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.instrument-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.instrument-title i {
    font-size: 1.1rem;
    opacity: 0.7;
}

.instrument-header h3 {
    margin: 0;
    font-family: 'Space Mono', monospace;
    font-size: 1.1rem;
}

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

.instrument-volume {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.instrument-volume label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.inst-volume {
    width: 80px;
}

.toggle {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.2);
    transition: .4s;
    border-radius: 20px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: var(--accent-color);
}

input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

.board-container {
    position: relative;
    overflow: hidden;
    height: 100%;
    flex: 1;
    display: flex;
}

.note-labels {
    width: var(--note-labels-width);
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    background-color: rgba(0, 0, 0, 0.3);
    padding: 0.25rem 0;
    font-family: 'Space Mono', monospace;
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.note-label {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.board-wrapper {
    flex: 1;
    position: relative;
    overflow: auto;
}

.beat-board {
    display: grid;
    grid-template-columns: repeat(32, 1fr);
    gap: 3px;
    padding: 0.5rem;
    min-height: 100%;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-color) var(--surface-color);
}

.beat-board::-webkit-scrollbar {
    height: 6px;
}

.beat-board::-webkit-scrollbar-track {
    background: var(--surface-color);
}

.beat-board::-webkit-scrollbar-thumb {
    background-color: var(--accent-color);
    border-radius: 6px;
}

.cell {
    background-color: rgba(255, 255, 255, var(--cell-inactive-opacity));
    border-radius: var(--cell-border-radius);
    aspect-ratio: 1;
    cursor: pointer;
    transition: all var(--transition-fast);
}

#synthBoard .cell:hover {
    background-color: var(--synth-hover);
}

#pianoBoard .cell:hover {
    background-color: var(--piano-hover);
}

#bassBoard .cell:hover {
    background-color: var(--bass-hover);
}

#drumsBoard .cell:hover {
    background-color: var(--drums-hover);
}

#synthBoard .cell.active {
    background: var(--synth-active);
    box-shadow: var(--cell-active-shadow) var(--synth-color);
}

#pianoBoard .cell.active {
    background: var(--piano-active);
    box-shadow: var(--cell-active-shadow) var(--piano-color);
}

#bassBoard .cell.active {
    background: var(--bass-active);
    box-shadow: var(--cell-active-shadow) var(--bass-color);
}

#drumsBoard .cell.active {
    background: var(--drums-active);
    box-shadow: var(--cell-active-shadow) var(--drums-color);
}

.cell.playing {
    animation: beat-pulse var(--beat-pulse-duration) ease-out;
}

@keyframes beat-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.timeline {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 2px;
    background-color: var(--secondary-color);
    z-index: 10;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
    box-shadow: 0 0 8px var(--secondary-color);
}

.timeline.visible {
    opacity: 1;
}

.visualizer-container {
    height: var(--visualizer-height);
    width: 100%;
    background-color: rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.visualizer {
    width: 100%;
    height: 100%;
}

.user-section {
    display: grid;
    grid-template-columns: 1fr 3fr;
    gap: 1rem;
    background-color: var(--surface-color);
    border-radius: 8px;
    padding: 1rem;
    height: var(--chat-height);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--surface-color-light);
    padding: 1rem;
    border-radius: 8px;
}

.avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent-color);
    box-shadow: 0 0 10px rgba(187, 134, 252, 0.3);
}

.messages-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    background-color: var(--surface-color-light);
    padding: 0.8rem;
    border-radius: 8px;
}

.messages-container h3 {
    margin-bottom: 0.5rem;
    color: var(--accent-color);
    font-size: 1rem;
}

.user-list {
    list-style: none;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.user-list li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: rgba(255, 255, 255, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 15px;
    font-size: 0.8rem;
    transition: all var(--transition-fast);
}

.user-list li:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.user-list img {
    width: 20px;
    height: 20px;
    border-radius: 50%;
}

.messages {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.message {
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    animation: message-appear 0.3s ease-out;
}

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

.message .user {
    font-weight: bold;
    color: var(--accent-color);
}

.message-input {
    display: flex;
    gap: 0.5rem;
}

.message-input input {
    flex: 1;
    padding: 0.5rem 0.8rem;
    border: none;
    border-radius: 20px;
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.message-input input:focus {
    outline: none;
    background-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 5px rgba(187, 134, 252, 0.3);
}

.message-input button {
    background-color: var(--accent-color);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.message-input button:hover {
    background-color: #9442fa;
}

/* Settings Button */
.settings-btn {
    background-color: transparent;
    color: var(--accent-color);
    font-size: 1rem;
    padding: 0.3rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
}

.settings-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: rotate(30deg);
    box-shadow: none;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    overflow: auto;
    animation: modal-appear 0.3s ease-out;
}

@keyframes modal-appear {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: var(--surface-color);
    margin: 5% auto;
    padding: 25px;
    border-radius: 8px;
    width: 80%;
    max-width: 800px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    position: relative;
    color: var(--text-primary);
    max-height: 85vh;
    overflow-y: auto;
    animation: modal-content-appear 0.3s ease-out;
}

@keyframes modal-content-appear {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}

.close-modal {
    color: var(--accent-color);
    position: absolute;
    right: 15px;
    top: 10px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.close-modal:hover {
    color: var(--secondary-color);
    transform: rotate(90deg);
}

.settings-section {
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 15px;
}

.settings-section h3 {
    margin-bottom: 10px;
    color: var(--accent-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.settings-section h3 i {
    font-size: 0.9rem;
    opacity: 0.8;
}

.control-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
}

.control-item {
    display: flex;
    flex-direction: column;
    min-width: 150px;
    flex: 1;
    background-color: var(--surface-color-light);
    padding: 10px;
    border-radius: 8px;
    transition: all var(--transition-fast);
}

.control-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.control-item label {
    margin-bottom: 5px;
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
}

.control-item label span {
    color: var(--accent-color);
}

.effect-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    background-color: var(--surface-color-light);
    padding: 8px 12px;
    border-radius: 8px;
    transition: all var(--transition-fast);
}

.effect-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.effect-controls {
    padding-left: 20px;
    margin-top: 5px;
    animation: control-appear 0.3s ease-out;
}

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

select.effect-select {
    width: 100%;
    padding: 8px;
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: 1px solid var(--accent-color);
    border-radius: 4px;
    transition: all var(--transition-fast);
}

select.effect-select:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 5px rgba(3, 218, 198, 0.3);
}

/* Help content styling */
.help-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
}

.help-section {
    background-color: var(--surface-color-light);
    padding: 1rem;
    border-radius: 8px;
}

.help-section h3 {
    color: var(--accent-color);
    margin-bottom: 0.8rem;
    font-size: 1.1rem;
}

.help-section ul {
    list-style: none;
    padding-left: 0.5rem;
}

.help-section li {
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.help-section i {
    color: var(--secondary-color);
    width: 16px;
    text-align: center;
}

/* Make instrument sections distinct */
.synth-section {
    border-left: 4px solid var(--synth-color);
}

.piano-section {
    border-left: 4px solid var(--piano-color);
}

.bass-section {
    border-left: 4px solid var(--bass-color);
}

.drums-section {
    border-left: 4px solid var(--drums-color);
}

/* Enhanced preset styles */
.preset-btn {
    background-color: var(--secondary-color);
    color: var(--background-color);
    font-weight: bold;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all var(--transition-medium);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.preset-btn:hover {
    background-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.presets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.preset-card {
    position: relative;
    background-color: var(--surface-color-light);
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    transition: all var(--transition-medium);
    text-align: center;
    border-left: 3px solid var(--accent-color);
    animation: preset-appear 0.3s ease-out;
}

@keyframes preset-appear {
    0% { 
        opacity: 0;
        transform: scale(0.8);
    }
    100% { 
        opacity: 1;
        transform: scale(1);
    }
}

.preset-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    background-color: rgba(255, 255, 255, 0.1);
}

.preset-card h3 {
    color: var(--accent-color);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.preset-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.save-preset-card {
    border-left: 3px solid var(--success-color);
    background-color: rgba(76, 175, 80, 0.1);
}

.save-preset-card h3 {
    color: var(--success-color);
}

.user-preset {
    border-left: 3px solid var(--secondary-color);
}

.user-preset h3 {
    padding-right: 20px; /* Make room for the delete button */
}

.delete-preset-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: none;
    border: none;
    color: var(--error-color);
    font-size: 1rem;
    cursor: pointer;
    padding: 0.3rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.delete-preset-btn:hover {
    background-color: rgba(207, 102, 121, 0.2);
    transform: scale(1.1);
    box-shadow: none;
}

/* Preset categories */
.preset-category {
    grid-column: 1 / -1;
    padding: 0.5rem 1rem;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    font-weight: bold;
    color: var(--accent-color);
    margin-top: 0.5rem;
}

/* Tooltip styles */
[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    white-space: nowrap;
    z-index: 10;
    pointer-events: none;
    opacity: 0;
    animation: tooltip-appear 0.2s forwards 0.5s;
}

[title]:hover {
    position: relative;
}

@keyframes tooltip-appear {
    to { opacity: 1; }
}

/* Step labels */
.step-labels {
    display: grid;
    grid-template-columns: repeat(32, 1fr);
    padding: 0 0.5rem;
    font-family: 'Space Mono', monospace;
    font-size: var(--step-number-size);
    color: var(--text-secondary);
    overflow-x: auto;
    scrollbar-width: none;
}

.step-label {
    text-align: center;
    padding: 2px 0;
}

/* Current beat indicator */
.current-beat {
    font-weight: bold;
    color: var(--secondary-color);
    border-radius: 50%;
    background-color: rgba(3, 218, 198, 0.2);
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

/* Pattern navigation controls */
.pattern-nav-controls {
    display: flex;
    justify-content: space-between;
    margin-top: 5px;
}

.pattern-nav-btn {
    background-color: var(--surface-color-light);
    color: var(--text-secondary);
    border: none;
    border-radius: 4px;
    padding: 2px 5px;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.pattern-nav-btn:hover {
    background-color: var(--accent-color);
    color: var(--background-color);
}

/* Highlight measure start */
.cell[data-col="0"],
.cell[data-col="16"] {
    border-left: var(--measure-divider-width) solid var(--measure-divider-color) !important;
}

@media (max-width: 768px) {
    .container {
        grid-template-rows: auto auto 1fr auto;
        padding: 0.5rem;
    }
    
    header {
        flex-direction: column;
        align-items: flex-start;
        height: auto;
        padding: 0.8rem;
    }
    
    .title-area {
        width: 100%;
        justify-content: space-between;
        margin-bottom: 0.8rem;
    }
    
    .controls {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }
    
    .tempo-control, .volume-control {
        min-width: initial;
    }
    
    .user-section {
        grid-template-columns: 1fr;
        height: auto;
        max-height: 250px;
    }
    
    .user-info {
        flex-direction: row;
    }
    
    .instruments-container {
        grid-template-rows: repeat(4, 150px);
        grid-template-columns: 1fr;
        height: auto;
        min-height: auto;
        max-height: none;
        overflow: auto;
    }
    
    .instrument-section {
        min-height: 100px;
    }
    
    .modal-content {
        width: 95%;
        margin: 3% auto;
    }
    
    .control-group {
        flex-direction: column;
    }
    
    .help-content {
        grid-template-columns: 1fr;
    }
    
    .note-labels {
        width: 30px;
    }
    
    .visualizer-container {
        height: 30px;
    }
    
    .presets-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .preset-card {
        padding: 0.8rem;
    }
}