body.study-page {
    --bg: #142033;
    --bg-color: #142033;
    --bg-secondary: #1c2c43;
    --bg-card: #1c2c43;
    --card-bg: #1c2c43;
    --text: #f4f3ed;
    --text-primary: #f4f3ed;
    --text-muted: #b8c6d9;
    --text-secondary: #d0dae7;
    --primary: #a5b4fc;
    --primary-light: #c7d2fe;
    --primary-dark: #4f46e5;
    --border: #40516a;
    --border-color: #40516a;
    --study-nav: #19283e;
    --study-selection: #34446a;
    --study-accent: #5eead4;
    background: var(--bg);
    color: var(--text);
}
html.light-mode body.study-page {
    --bg: #f5f7fb !important;
    --bg-color: #f5f7fb;
    --bg-secondary: #edf2fa !important;
    --bg-card: #ffffff !important;
    --card-bg: #ffffff !important;
    --text: #17243b !important;
    --text-primary: #17243b !important;
    --text-secondary: #334155 !important;
    --text-muted: #52627a !important;
    --primary: #4f46e5;
    --primary-light: #4338ca;
    --primary-dark: #3730a3;
    --border: #dce3ee !important;
    --border-color: #dce3ee;
    --study-nav: #edf2fa;
    --study-selection: #e9e7ff;
    --study-accent: #0f766e;
    background: #f5f7fb !important;
    color: #17243b !important;
}
body.study-page .explorer-nav { background: var(--study-nav); }
body.study-page .exercise-preview,
body.study-page .exe-card,
body.study-page .exe-editor-panel,
body.study-page .exe-chat-panel {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: 0 6px 24px rgba(23,36,59,.04);
}
body.study-page .exercise-leaf[aria-current=true] {
    background: var(--study-selection);
    color: var(--primary-light);
    box-shadow: inset 3px 0 var(--primary);
}
body.study-page .exercise-text,
body.study-page .exe-quote { font-size: 18px; line-height: 1.85; }
body.study-page .exe-quote { border-left-color: var(--primary); color: var(--text); }
body.study-page .exe-analysis { color: var(--text-muted) !important; line-height: 1.8; }
body.study-page .exe-title {
    color: var(--text) !important;
    background: none !important;
    -webkit-text-fill-color: var(--text) !important;
}
body.study-page .exercise-start,
body.study-page .exe-chat-input button,
body.study-page .btn-primary {
    background: #4f46e5;
    color: #fff !important;
}
body.study-page .exercise-start:hover { background: #3730a3; }
body.study-page .exe-send-code-btn { background: #0f766e; color: #fff; }
body.study-page .exe-code-editor { background: var(--card-bg); color: var(--text); font-size: 16px; }
body.study-page .exe-chat-header { background: var(--study-nav); color: var(--text); }
body.study-page .exe-msg.user { background: var(--study-selection) !important; color: var(--text); }
body.study-page .exe-msg.tutor { background: var(--card-bg) !important; color: var(--text); }
body.study-page .exe-msg.tutor strong { color: var(--study-accent); }
body.study-page .exe-msg.system { background: #fef3c7; color: #713f12; border-color: #fbbf24; }
body.study-page .exe-badge { background: #4f46e5 !important; color: #fff; }
body.study-page .exe-floating-badge { background: #0f766e; color: #fff; }
body.study-page .socratico-sidebar { background: var(--study-nav) !important; border-color: var(--border) !important; }
body.study-page .socratico-sidebar a { color: var(--text-secondary) !important; }
body.study-page .socratico-sidebar a.active { background: var(--study-selection) !important; color: var(--primary-light) !important; }
body.study-page :focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }
