#piano-container { 
    height: var(--piano-height); 
    width: 100%; 
    background: transparent;
    position: relative; 
    z-index: 900;
    display: flex;
    flex-direction: column;
}

/* Pedal-Status Zeile */
.pedal-status-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 15px;
    background: transparent;
    height: 35px;
}

.pedal-status-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pedal-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-color);
    letter-spacing: 1px;
    opacity: 0.3;
}

.sustain-indicator {
    width: 16px;
    height: 16px;
    background-color: #ff0000;
    border: 2px solid #000000;
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
}

.sustain-indicator.sustain-active {
    opacity: 1;
}

.btn-toggle-suggest {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.6);
    border-radius: 4px;
    font-size: 0.75rem;
    padding: 3px 10px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
}

.btn-toggle-suggest:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.theme-light .btn-toggle-suggest {
    background: rgba(0, 0, 0, 0.1);
    border-color: rgba(0, 0, 0, 0.2);
    color: rgba(0, 0, 0, 0.6);
}

.theme-light .btn-toggle-suggest:hover {
    background: rgba(0, 0, 0, 0.2);
    color: #000;
}

.btn-toggle-suggest.active {
    background: rgba(56, 189, 248, 0.2);
    color: #38bdf8;
    border-color: #38bdf8;
}

.theme-light .btn-toggle-suggest.active {
    background: rgba(2, 132, 199, 0.15);
    color: var(--accent-color);
    border-color: var(--accent-color);
}

/* Keyboard HTML Struktur */
.keyboard { 
    display: flex; 
    position: relative;
    height: calc(100% - 35px); 
    width: 100%; 
}

.key {
    flex: 1; 
    height: 100%; 
    background: white;
    border: 1px solid #333;
    border-width: 0 1px 1px 0;
    box-sizing: border-box; 
    position: relative;
    transition: background var(--fade-duration) ease-out var(--fade-delay);
}

.key.black {
    width: 1.5%; 
    height: 60%; 
    background: #334155; /* Etwas helleres Schwarz/Dunkelgrau für besseren Kontrast zur Schraffur (vorher '#2e2e2e') */
    position: absolute;
    transform: translateX(-50%);
    z-index: 10;
    border: 1px solid #111;
}

/* Beschriftung der C-Tasten */
.key-label {
    position: absolute;
    bottom: 5px;
    left: 0;
    width: 100%;
    text-align: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: rgba(0,0,0,0.3);
    pointer-events: none;
}

/* --- Vorschlags-Status (Einheitlicher Pastell-Farbton für alle Tasten) --- */

.key.key-suggest-left:not(.key-pressed):not(.key-pressed-left):not(.key-pressed-right) {
    background: color-mix(in srgb, var(--left-hand-color) 35%, white) !important; 
    transition: background 0.2s !important;
}

.key.key-suggest-right:not(.key-pressed):not(.key-pressed-left):not(.key-pressed-right) {
    background: color-mix(in srgb, var(--right-hand-color) 35%, white) !important;
    transition: background 0.2s !important;
}

/* Pressed State */
.key.key-pressed { 
    background: var(--chordbox-color) !important;
    transition: background 0s !important;
}

/* Hand-Anzeige (Aktive Tasten) */
.key.key-pressed-left { 
    background: var(--left-hand-color) !important;
    transition: background 0s !important;
}

.key.key-pressed-right { 
    background: var(--right-hand-color) !important;
    transition: background 0s !important;
}

/* --- Stretch Funktionalität --- */
.key.hidden-key {
    display: none !important;
}

/* --- Out-of-Range Status --- */
.key.out-of-range:not(.black):not(.key-pressed):not(.key-pressed-left):not(.key-pressed-right):not(.key-suggest-left):not(.key-suggest-right):not(.hidden-key) {
    background: #e8e8e8; 
    border-color: #ddd; 
}
.key.black.out-of-range:not(.key-pressed):not(.key-pressed-left):not(.key-pressed-right):not(.key-suggest-left):not(.key-suggest-right):not(.hidden-key) {
    background: #888888;
    border-color: transparent;
}

/* Anpassung für die dunklen Themes im Progression Trainer */
.theme-dark .key.out-of-range:not(.black):not(.key-pressed):not(.key-pressed-left):not(.key-pressed-right):not(.key-suggest-left):not(.key-suggest-right):not(.hidden-key),
.theme-oceanblue .key.out-of-range:not(.black):not(.key-pressed):not(.key-pressed-left):not(.key-pressed-right):not(.key-suggest-left):not(.key-suggest-right):not(.hidden-key),
.theme-jungle .key.out-of-range:not(.black):not(.key-pressed):not(.key-pressed-left):not(.key-pressed-right):not(.key-suggest-left):not(.key-suggest-right):not(.hidden-key) {
    background: #7a7a7a;
    border-color: #666;
}
.theme-dark .key.black.out-of-range:not(.key-pressed):not(.key-pressed-left):not(.key-pressed-right):not(.key-suggest-left):not(.key-suggest-right):not(.hidden-key),
.theme-oceanblue .key.black.out-of-range:not(.black):not(.key-pressed):not(.key-pressed-left):not(.key-pressed-right):not(.key-suggest-left):not(.key-suggest-right):not(.hidden-key),
.theme-jungle .key.black.out-of-range:not(.key-pressed):not(.key-pressed-left):not(.key-pressed-right):not(.key-suggest-left):not(.key-suggest-right):not(.hidden-key) {
    background: #555555;
}

/* --- Chord Range Mask & Edit Mode --- */
.range-edit-active .key.range-dimmed::after,
.range-mask-active .key.range-dimmed::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: repeating-linear-gradient(
        45deg,
        rgba(0,0,0,0.075),
        rgba(0,0,0,0.075) 8px,
        rgba(0,0,0,0.125) 8px,
        rgba(0,0,0,0.125) 16px
    );
    pointer-events: none;
    z-index: 5;
}

.theme-dark .range-edit-active .key.range-dimmed::after,
.theme-oceanblue .range-edit-active .key.range-dimmed::after,
.theme-jungle .range-edit-active .key.range-dimmed::after,
.theme-dark .range-mask-active .key.range-dimmed::after,
.theme-oceanblue .range-mask-active .key.range-dimmed::after,
.theme-jungle .range-mask-active .key.range-dimmed::after {
    background: repeating-linear-gradient(
        45deg,
        rgba(0,0,0,0.2),
        rgba(0,0,0,0.2) 8px,
        rgba(0,0,0,0.3) 8px,
        rgba(0,0,0,0.3) 16px
    );
}

.range-edit-active .keyboard {
    cursor: col-resize;
}

#range-done-container {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: none;
    background: var(--card-bg);
    padding: 10px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
}