:root[data-theme="dark"] .resource-card,:root[data-theme="dark"] .viewer-shell,:root[data-theme="dark"] .live-chat,:root[data-theme="dark"] .table-wrap{background:var(--surface);color:var(--ink)}
:root[data-theme="dark"] .resource-icon{background:#3a2424;color:#ffaaa0}
:root[data-theme="dark"] .viewer-toolbar,:root[data-theme="dark"] .test-layout,:root[data-theme="dark"] .viewer-note{background:var(--surface-muted);color:var(--muted)}
:root[data-theme="dark"] .test-answer-panel{background:var(--surface)}
:root[data-theme="dark"] .auth-wrap{background:radial-gradient(ellipse at 15% 0%,#153b35,var(--paper) 48%)}
:root[data-theme="dark"] .auth-card,:root[data-theme="dark"] .panel,:root[data-theme="dark"] .stat-card,:root[data-theme="dark"] .course-card,:root[data-theme="dark"] .exercise-card,:root[data-theme="dark"] .submission-card{background:var(--surface);color:var(--ink)}
:root[data-theme="dark"] .answer-box,:root[data-theme="dark"] .instructions,:root[data-theme="dark"] .message,:root[data-theme="dark"] .implementation-note{background:var(--surface-muted);color:var(--ink-soft)}
:root[data-theme="dark"] .date-tile{background:#153a34;color:#83e0c9}
:root[data-theme="dark"] .level-mark,:root[data-theme="dark"] .course-icon{background:#153a34;color:#83e0c9}
:root[data-theme="dark"] .course-icon-warm{background:#3a2c16;color:#f4c875}
:root[data-theme="dark"] .banner-icon,:root[data-theme="dark"] .status-pill{background:var(--surface-raised)}
:root[data-theme="dark"] .feedback{background:var(--success-bg);color:var(--success)}
:root[data-theme="dark"] .live-shell{background:#0e2029;color:#e2f1f0}
:root[data-theme="dark"] .live-chat{background:var(--surface);color:var(--ink)}
:root[data-theme="dark"] .stack-form label[style],:root[data-theme="dark"] .form-grid label[style]{color:var(--ink-soft)!important}
:root[data-theme="dark"] .stack-form label[style*="background:#fff"],:root[data-theme="dark"] .form-grid label[style*="background:#fff"]{background:var(--surface-raised)!important;border-color:var(--line)!important}
:root[data-theme="dark"] h4[style*="color:#175b50"]{color:var(--brand)!important}
:root[data-theme="dark"] .auth-card input,:root[data-theme="dark"] .auth-card select,:root[data-theme="dark"] .auth-card textarea{background:var(--surface-raised);color:var(--ink)}
.content{animation:soft-in .22s ease both}
.confirm-modal{width:min(420px,calc(100vw - 32px));padding:23px;border:1px solid var(--line);border-radius:17px;background:var(--surface);color:var(--ink);box-shadow:var(--shadow-lg)}
.confirm-modal::backdrop{background:rgba(10,18,28,.52);backdrop-filter:blur(3px)}
.confirm-modal form{display:grid;justify-items:start;gap:8px}
.confirm-modal h2{margin:4px 0 0;font-size:18px}
.confirm-modal p{margin:0;color:var(--muted);font-size:13px}
.confirm-mark{width:34px;height:34px;display:grid;place-items:center;border-radius:11px;background:var(--warning-bg);color:var(--warning);font-weight:800}
.confirm-actions{width:100%;display:flex;justify-content:flex-end;gap:8px;margin-top:12px}
.skeleton{position:relative;overflow:hidden;background:var(--surface-muted);border-radius:8px;color:transparent!important}
.skeleton::after{content:"";position:absolute;inset:0;transform:translateX(-100%);background:linear-gradient(90deg,transparent,color-mix(in srgb,var(--surface) 70%,transparent),transparent);animation:skeleton-sheen 1.25s infinite}
@keyframes skeleton-sheen{to{transform:translateX(100%)}}

@media(max-width:720px){.sidebar-collapsed .sidebar{width:min(310px,88vw)}.sidebar-collapsed .brand-copy,.sidebar-collapsed .profile-copy,.sidebar-collapsed .nav-label,.sidebar-collapsed .nav-text,.sidebar-collapsed .nav-count,.sidebar-collapsed .secure-note span:not(.secure-icon),.sidebar-collapsed .version{display:initial}.sidebar-collapsed .brand{justify-content:flex-start;padding:3px 6px}.sidebar-collapsed .profile-chip{justify-content:flex-start;padding:9px}.sidebar-collapsed .main-nav a{justify-content:flex-start;padding:7px 10px}.sidebar-collapsed .secure-note{justify-content:flex-start;padding:10px}.sidebar-collapsed .sidebar-head{justify-content:initial}}
.main-nav a.active{box-shadow:none;border-inline-start-color:#6bd8bd}
