.sp-player-layout { 
    display: flex;
    gap: 20px; 
    font-family: sans-serif; 
    color: #fff; 
    max-width: 100%; 
    box-sizing: border-box; 
    align-items: stretch; 
    background: #0b0b0d; 
    padding: 20px; 
    border-radius: 16px;
    margin: 10px auto; 
    outline: none; 
}

.student-sidebar { 
    width: 240px;
    min-width: 240px; 
    background: #111113;
    border: 2px solid #222; 
    border-radius: 12px; 
    padding: 15px; 
    box-sizing: border-box; 
    display: flex; 
    flex-direction: column;
    position: relative;
    transition: width 0.3s ease, min-width 0.3s ease, padding 0.3s ease;
}

.student-sidebar.collapsed {
    width: 40px;
    min-width: 40px;
    padding: 15px 0;
    align-items: center;
}

.student-sidebar.collapsed .sidebar-title,
.student-sidebar.collapsed .lessons-menu-container {
    display: none !important;
}

.sidebar-toggle-btn {
    position: absolute;
    right: -12px;
    top: 20px;
    width: 24px;
    height: 24px;
    background: #ff6600;
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transform: rotate(180deg);
    transition: transform 0.3s ease, background 0.2s;
    box-shadow: 0 0 6px rgba(0,0,0,0.5);
    padding: 0;
}
.sidebar-toggle-btn:hover {
    background: #e05500;
}
.student-sidebar.collapsed .sidebar-toggle-btn {
    transform: rotate(0deg);
    right: auto;
    left: 8px;
}

.sidebar-title { font-size: 11px; font-weight: bold; color: #ff6600; letter-spacing: 1px; margin-bottom: 15px; text-transform: uppercase; border-bottom: 1px solid #222; padding-bottom: 5px; text-align: center; }
.lessons-menu-container { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.lesson-menu-btn { background: #1c1c1c; color: #aaa; border: 1px solid #252525; padding: 10px 12px; border-radius: 6px; text-align: left; font-size: 13px; font-weight: bold; cursor: pointer; transition: all 0.2s; white-space: normal; word-wrap: break-word; width: 100%; box-sizing: border-box; }
.lesson-menu-btn:hover { background: #252525; color: #fff; border-color: #ff6600; }
.lesson-menu-btn.active { background: #ff6600; color: #fff; border-color: #ff6600; }
.loading-stub { font-size: 12px; color: #888; text-align: center; padding: 10px; font-weight: bold; }

.sp-player-container { flex: 1; background: #111113; border: 2px solid #ff6600; border-radius: 12px; padding: 25px; box-sizing: border-box; min-width: 0; }
.player-header-block { margin-bottom: 20px; border-bottom: 1px solid #222; padding-bottom: 15px; }
.st-lesson-title { color: #ff6600; font-size: 1.3rem; margin: 0; font-weight: bold; line-height: 1.2; }
.student-controls-panel { display: flex; align-items: center; gap: 20px; background: #090909; padding: 10px 20px; border-radius: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.btn-st-player { border: none; padding: 12px 28px; border-radius: 6px; font-weight: bold; cursor: pointer; text-transform: uppercase; min-width: 120px; font-size: 14px; letter-spacing: 1px; transition: background 0.2s; }
.btn-st-player.play { background: #ff6600; color: #fff; }
.btn-st-player.play:hover { background: #e05500; }
.btn-st-player.stop { background: #ff3333; color: #fff; }
.btn-st-player:disabled { background: #444 !important; color: #888 !important; cursor: not-allowed; }

.btn-st-action { background: #222; color: #ff6600; border: 1px solid #ff6600; padding: 12px 18px; border-radius: 6px; font-weight: bold; cursor: pointer; text-transform: uppercase; font-size: 13px; letter-spacing: 1px; transition: all 0.2s; }
.btn-st-action:hover { background: #ff6600; color: #fff; }

.st-bpm-block { display: flex; align-items: center; gap: 12px; font-size: 14px; font-weight: bold; color: #aaa; flex: 1; min-width: 200px; }
#st-bpm { background: #222; border: 1px solid #444; color: #fff; width: 65px; min-width: 65px; text-align: center; padding: 8px; border-radius: 6px; font-weight: bold; font-size: 14px; }
#st-bpm:focus { border-color: #ff6600; outline: none; }
.st-bpm-range { flex: 1; accent-color: #ff6600; cursor: pointer; height: 6px; background: #222; border-radius: 3px; outline: none; }

.metronome-options-block { display: flex; gap: 15px; align-items: center; }
.metro-checkbox-label { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: bold; color: #aaa; cursor: pointer; user-select: none; }
.metro-checkbox-label input { display: none; }
.custom-checkbox { width: 16px; height: 16px; border: 2px solid #444; border-radius: 4px; background: #141414; display: inline-block; position: relative; transition: all 0.15s; }
.metro-checkbox-label:hover .custom-checkbox { border-color: #ff6600; }
.metro-checkbox-label input:checked + .custom-checkbox { background: #ff6600; border-color: #ff6600; }
.metro-checkbox-label input:checked + .custom-checkbox::after { content: ""; position: absolute; left: 4px; top: 1px; width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }

.st-volume-controls { display: flex; align-items: center; gap: 15px; }
.st-volume-block { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: bold; color: #aaa; }
.st-volume-block input[type=range] { width: 70px; accent-color: #ff6600; cursor: pointer; height: 4px; background: #222; border-radius: 2px; outline: none; }

.st-grid-badge { margin-left: auto; background: #1c1c1c; border: 1px solid #333; padding: 6px 15px; border-radius: 4px; font-size: 11px; font-weight: bold; color: #ff6600; text-transform: uppercase; }

.daw-sequencer.student-view { 
    background: #090909; 
    border: 1px solid #1c1c1c; 
    border-radius: 8px; 
    padding: 12px; 
    overflow-x: hidden; 
    width: 100%;
    box-sizing: border-box;
}
.daw-header-row { 
    display: flex; 
    align-items: center; 
    margin-bottom: 4px; 
    padding-left: 100px; 
    width: 100%;
    box-sizing: border-box;
}
.daw-step-num { 
    flex: 1;
    text-align: center; 
    font-size: 10px; 
    color: #666; 
    font-weight: bold; 
}
.daw-step-num.playing-now { color: #ff6600; font-size: 12px; }

.daw-track-row { 
    display: flex; 
    align-items: center; 
    margin-bottom: 2px; 
    width: 100%;
    box-sizing: border-box;
}
.daw-track-info { 
    width: 100px; 
    min-width: 100px; 
    font-size: 10px; 
    font-weight: bold; 
    color: #aaa; 
    text-transform: uppercase; 
}
.daw-grid-cells { 
    display: flex; 
    flex: 1;
    width: calc(100% - 100px);
}
.daw-cell { 
    flex: 1;
    height: 18px; 
    margin: 0 1px; 
    background: #141414; 
    border: 1px solid #1c1c1c; 
    border-radius: 3px; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center; 
    position: relative; 
    cursor: pointer; 
    user-select: none;
    transition: background 0.1s ease;
}
.daw-cell:hover {
    border-color: #ff6600;
}
.cell-group-accent { background: #0d0d0f; }
.cell-beat-divider { border-left: 2px dashed #444446 !important; }
.cell-bar-divider { border-left: 2px solid #ff6600 !important; }

.daw-cell.playing-now { border-color: #ff6600 !important; box-shadow: inset 0 0 5px #ff6600; }
.daw-cell.note-regular { background: #ff6600 !important; }
.daw-cell.note-accent { background: #ff3333 !important; }
.daw-cell.note-ghost { background: #3399ff !important; }
.art-mark { font-size: 8px; font-weight: 900; color: #fff; margin-bottom: 0px; }
.stick-badge { font-family: monospace; font-size: 8px; font-weight: bold; background: rgba(0,0,0,0.6); color: #fff; padding: 0px 3px; border-radius: 2px; }

@media (max-width: 768px) {
    .sp-player-layout { flex-direction: column; align-items: stretch; gap: 8px; padding: 4px; margin: 0; }
    .sp-player-container { padding: 8px; border-width: 1px; }
    
    .student-sidebar { width: 100% !important; min-width: 100% !important; border-color: #222; padding: 8px !important; }
    .sidebar-toggle-btn { display: none !important; }
    .student-sidebar.collapsed .sidebar-title, .student-sidebar.collapsed .lessons-menu-container { display: flex !important; }
    .sidebar-title { margin-bottom: 6px; padding-bottom: 4px; }
    .lessons-menu-container { flex-direction: row; overflow-x: auto; padding-bottom: 4px; gap: 4px; -webkit-overflow-scrolling: touch; }
    .lesson-menu-btn { flex-shrink: 0; min-width: 130px; max-width: 180px; text-align: center; padding: 6px 8px; font-size: 11px; }
    
    .student-controls-panel { gap: 8px; padding: 8px; }
    .btn-st-player { min-width: 85px; padding: 8px 12px; font-size: 12px; }
    .btn-st-action { padding: 8px 12px; font-size: 11px; }
    .st-bpm-block { min-width: 100%; order: 3; margin-top: 4px; }
    .metronome-options-block { gap: 8px; }
    .st-volume-controls { width: 100%; justify-content: space-between; order: 4; margin-top: 4px; }
    .st-volume-block input[type=range] { width: 60px; }
    .st-grid-badge { margin-left: auto; width: auto; font-size: 10px; padding: 3px 6px; }

    .daw-sequencer.student-view { padding: 6px 0px; overflow-x: auto; -webkit-overflow-scrolling: touch; } 
    .daw-header-row { padding-left: 45px; margin-bottom: 4px; width: max-content; } 
    .daw-track-row { width: max-content; }
    .daw-grid-cells { flex: none; width: auto; }
    
    .daw-track-info { width: 45px; min-width: 45px; font-size: 8px; line-height: 1.1; word-break: break-all; padding-right: 2px; letter-spacing: -0.5px; }
    .daw-step-num { min-width: 22px; font-size: 8px; flex: none; }
    .daw-cell { min-width: 22px; height: 26px; margin: 0 0.5px; flex: none; }
    
    .art-mark { font-size: 7px; margin-bottom: 1px; }
    .stick-badge { font-size: 6px; padding: 0 1px; }
}