/**
 * Course Shell UI
 * Dedicated layout and chrome for shell-rendered courses.
 */

body[data-course-shell] {
    --course-shell-drawer-width: 320px;
    --course-shell-topbar-height: 88px;
    --course-shell-surface: rgba(255, 255, 255, 0.82);
    --course-shell-surface-strong: rgba(255, 255, 255, 0.93);
    --course-shell-border: rgba(148, 163, 184, 0.22);
    --course-shell-shadow: 0 24px 55px -30px rgba(15, 23, 42, 0.42);
    --course-shell-shadow-soft: 0 18px 34px -28px rgba(15, 23, 42, 0.2);
    --course-shell-muted: #64748b;
    background:
        radial-gradient(920px 520px at -8% -5%, rgba(20, 184, 166, 0.13), transparent 58%),
        radial-gradient(760px 420px at 108% 8%, rgba(37, 99, 235, 0.12), transparent 56%),
        linear-gradient(180deg, #f4f8f7 0%, #eef4fb 44%, #f8fafc 100%);
}

html[data-theme="dark"] body[data-course-shell] {
    --course-shell-surface: rgba(15, 23, 42, 0.8);
    --course-shell-surface-strong: rgba(15, 23, 42, 0.93);
    --course-shell-border: rgba(71, 85, 105, 0.54);
    --course-shell-shadow: 0 28px 60px -34px rgba(2, 6, 23, 0.8);
    --course-shell-shadow-soft: 0 18px 36px -28px rgba(2, 6, 23, 0.48);
    --course-shell-muted: #94a3b8;
    background:
        radial-gradient(900px 520px at -8% -5%, rgba(20, 184, 166, 0.16), transparent 58%),
        radial-gradient(760px 420px at 108% 8%, rgba(37, 99, 235, 0.14), transparent 56%),
        linear-gradient(180deg, #07111e 0%, #0f172a 42%, #132138 100%);
}

body[data-course-shell].shell-overlay-open {
    overflow: hidden;
}

body[data-course-shell] .course-shell-app {
    position: relative;
    min-height: 100vh;
    isolation: isolate;
}

body[data-course-shell] .course-shell-app::before,
body[data-course-shell] .course-shell-app::after {
    content: "";
    position: fixed;
    inset: auto;
    pointer-events: none;
    z-index: 0;
    border-radius: 999px;
    filter: blur(52px);
    opacity: 0.6;
}

body[data-course-shell] .course-shell-app::before {
    top: 112px;
    left: max(14px, env(safe-area-inset-left));
    width: 280px;
    height: 280px;
    background: rgba(20, 184, 166, 0.12);
}

body[data-course-shell] .course-shell-app::after {
    right: max(12px, env(safe-area-inset-right));
    bottom: 10vh;
    width: 320px;
    height: 320px;
    background: rgba(59, 130, 246, 0.1);
}

body[data-course-shell] .course-shell-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

body[data-course-shell] .course-shell-main {
    position: relative;
    z-index: 1;
}

body[data-course-shell] .course-shell-stage {
    padding-top: calc(var(--course-shell-topbar-height) + 1rem);
    transition: padding-left 0.28s ease;
}

body[data-course-shell] .course-shell-stage .slide {
    min-height: calc(100vh - var(--course-shell-topbar-height));
    align-items: flex-start;
    padding-top: 1.5rem;
    padding-bottom: calc(var(--space-3xl) + 3.5rem);
}

body[data-course-shell] .course-shell-stage .container {
    width: min(1120px, 100%);
}

body[data-course-shell] .course-shell-topbar {
    position: fixed;
    top: max(14px, env(safe-area-inset-top));
    left: 16px;
    right: 16px;
    z-index: 1100;
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.8rem 1rem;
    border-radius: 1.25rem;
    border: 1px solid var(--course-shell-border);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 250, 252, 0.82) 100%);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: var(--course-shell-shadow);
    transition: left 0.28s ease, right 0.28s ease, transform 0.28s ease, background 0.28s ease;
}

html[data-theme="dark"] body[data-course-shell] .course-shell-topbar {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.92) 0%, rgba(15, 23, 42, 0.8) 100%);
}

body[data-course-shell] .course-shell-topbar__cluster {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    flex-shrink: 0;
}

body[data-course-shell] .course-shell-topbar__cluster--meta {
    margin-left: auto;
    justify-content: flex-end;
    flex-wrap: wrap;
    min-width: 0;
}

body[data-course-shell] .course-shell-topbar__cluster--meta::-webkit-scrollbar {
    display: none;
}

body[data-course-shell] .course-shell-topbar__center {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

body[data-course-shell] .course-shell-topbar__eyebrow {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--course-shell-muted);
}

body[data-course-shell] .course-shell-topbar__title {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body[data-course-shell] .course-shell-topbar__section {
    font-size: 0.88rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body[data-course-shell] .course-shell-icon-btn,
body[data-course-shell] .course-shell-back-link,
body[data-course-shell] .course-shell-review-btn,
body[data-course-shell] .course-shell-notes-btn,
body[data-course-shell] .course-shell-bookmark-btn,
body[data-course-shell] .course-shell-focus-btn,
body[data-course-shell] .course-shell-theme-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 44px;
    padding: 0 0.95rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(255, 255, 255, 0.16);
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 650;
    box-shadow: var(--course-shell-shadow-soft);
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

html[data-theme="dark"] body[data-course-shell] .course-shell-icon-btn,
html[data-theme="dark"] body[data-course-shell] .course-shell-back-link,
html[data-theme="dark"] body[data-course-shell] .course-shell-review-btn,
html[data-theme="dark"] body[data-course-shell] .course-shell-notes-btn,
html[data-theme="dark"] body[data-course-shell] .course-shell-bookmark-btn,
html[data-theme="dark"] body[data-course-shell] .course-shell-focus-btn,
html[data-theme="dark"] body[data-course-shell] .course-shell-theme-btn {
    background: rgba(15, 23, 42, 0.36);
    border-color: rgba(71, 85, 105, 0.52);
}

body[data-course-shell] .course-shell-icon-btn {
    width: 44px;
    padding: 0;
}

body[data-course-shell] .course-shell-topbar .theme-toggle-btn.course-shell-theme-btn {
    position: relative;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    width: 44px;
    min-width: 44px;
    height: 44px;
    margin: 0;
    padding: 0;
    font-size: 1rem;
    border-radius: 999px;
    box-shadow: var(--course-shell-shadow-soft);
}

body[data-course-shell] .course-shell-icon-btn:hover,
body[data-course-shell] .course-shell-back-link:hover,
body[data-course-shell] .course-shell-review-btn:hover,
body[data-course-shell] .course-shell-notes-btn:hover,
body[data-course-shell] .course-shell-bookmark-btn:hover,
body[data-course-shell] .course-shell-focus-btn:hover,
body[data-course-shell] .course-shell-theme-btn:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(99, 102, 241, 0.18);
    box-shadow: 0 16px 30px -24px rgba(15, 23, 42, 0.24);
}

html[data-theme="dark"] body[data-course-shell] .course-shell-icon-btn:hover,
html[data-theme="dark"] body[data-course-shell] .course-shell-back-link:hover,
html[data-theme="dark"] body[data-course-shell] .course-shell-review-btn:hover,
html[data-theme="dark"] body[data-course-shell] .course-shell-notes-btn:hover,
html[data-theme="dark"] body[data-course-shell] .course-shell-bookmark-btn:hover,
html[data-theme="dark"] body[data-course-shell] .course-shell-focus-btn:hover,
html[data-theme="dark"] body[data-course-shell] .course-shell-theme-btn:hover {
    background: rgba(30, 41, 59, 0.58);
}

body[data-course-shell] .course-shell-icon-btn:focus-visible,
body[data-course-shell] .course-shell-back-link:focus-visible,
body[data-course-shell] .course-shell-review-btn:focus-visible,
body[data-course-shell] .course-shell-notes-btn:focus-visible,
body[data-course-shell] .course-shell-bookmark-btn:focus-visible,
body[data-course-shell] .course-shell-focus-btn:focus-visible,
body[data-course-shell] .course-shell-theme-btn:focus-visible,
body[data-course-shell] .course-shell-flashcard:focus-visible,
body[data-course-shell] .course-shell-microcheck__option:focus-visible,
body[data-course-shell] .course-shell-drawer__item:focus-visible,
body[data-course-shell] .quiz-option:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.48);
    outline-offset: 3px;
}

html[data-theme="dark"] body[data-course-shell] .course-shell-icon-btn:focus-visible,
html[data-theme="dark"] body[data-course-shell] .course-shell-back-link:focus-visible,
html[data-theme="dark"] body[data-course-shell] .course-shell-review-btn:focus-visible,
html[data-theme="dark"] body[data-course-shell] .course-shell-notes-btn:focus-visible,
html[data-theme="dark"] body[data-course-shell] .course-shell-bookmark-btn:focus-visible,
html[data-theme="dark"] body[data-course-shell] .course-shell-focus-btn:focus-visible,
html[data-theme="dark"] body[data-course-shell] .course-shell-theme-btn:focus-visible,
html[data-theme="dark"] body[data-course-shell] .course-shell-flashcard:focus-visible,
html[data-theme="dark"] body[data-course-shell] .course-shell-microcheck__option:focus-visible,
html[data-theme="dark"] body[data-course-shell] .course-shell-drawer__item:focus-visible,
html[data-theme="dark"] body[data-course-shell] .quiz-option:focus-visible {
    outline-color: rgba(125, 211, 252, 0.82);
}

body[data-course-shell] .course-shell-flashcards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

body[data-course-shell] .course-shell-review-btn {
    border-color: rgba(14, 116, 144, 0.16);
}

html[data-theme="dark"] body[data-course-shell] .course-shell-review-btn {
    border-color: rgba(34, 211, 238, 0.18);
}

body[data-course-shell] .course-shell-review-btn i {
    color: #0f766e;
}

html[data-theme="dark"] body[data-course-shell] .course-shell-review-btn i {
    color: #67e8f9;
}

body[data-course-shell] .course-shell-review-btn.is-active {
    color: #ecfeff;
    background: linear-gradient(135deg, #0f766e 0%, #0284c7 100%);
    border-color: rgba(6, 182, 212, 0.52);
    box-shadow: 0 16px 32px -22px rgba(14, 116, 144, 0.55);
}

html[data-theme="dark"] body[data-course-shell] .course-shell-review-btn.is-active {
    color: #f8fafc;
    background: linear-gradient(135deg, #0f766e 0%, #1d4ed8 100%);
    border-color: rgba(125, 211, 252, 0.44);
}

body[data-course-shell] .course-shell-notes-btn {
    border-color: rgba(168, 85, 247, 0.16);
}

html[data-theme="dark"] body[data-course-shell] .course-shell-notes-btn {
    border-color: rgba(192, 132, 252, 0.18);
}

body[data-course-shell] .course-shell-notes-btn i {
    color: #7c3aed;
}

html[data-theme="dark"] body[data-course-shell] .course-shell-notes-btn i {
    color: #d8b4fe;
}

body[data-course-shell] .course-shell-notes-btn.has-note {
    color: #be185d;
    border-color: rgba(236, 72, 153, 0.26);
    box-shadow: 0 14px 30px -22px rgba(236, 72, 153, 0.42);
}

html[data-theme="dark"] body[data-course-shell] .course-shell-notes-btn.has-note {
    color: #f9a8d4;
    border-color: rgba(244, 114, 182, 0.28);
}

body[data-course-shell] .course-shell-notes-btn.is-active {
    color: #ffffff;
    background: linear-gradient(135deg, #be185d 0%, #7c3aed 100%);
    border-color: rgba(244, 114, 182, 0.44);
    box-shadow: 0 18px 34px -24px rgba(168, 85, 247, 0.56);
}

html[data-theme="dark"] body[data-course-shell] .course-shell-notes-btn.is-active {
    color: #fdf4ff;
    background: linear-gradient(135deg, #be185d 0%, #4f46e5 100%);
    border-color: rgba(216, 180, 254, 0.38);
}

body[data-course-shell] .course-shell-notes-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1125;
    background: rgba(15, 23, 42, 0.42);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.24s ease;
}

body[data-course-shell].shell-notes-open .course-shell-notes-backdrop {
    opacity: 1;
    pointer-events: auto;
}

body[data-course-shell] .course-shell-notes-sheet {
    position: fixed;
    top: calc(max(14px, env(safe-area-inset-top)) + var(--course-shell-topbar-height) + 0.45rem);
    right: 16px;
    bottom: 16px;
    width: min(390px, calc(100vw - 32px));
    z-index: 1130;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.1rem;
    border-radius: 1.4rem;
    border: 1px solid var(--course-shell-border);
    background: linear-gradient(180deg, var(--course-shell-surface-strong) 0%, var(--course-shell-surface) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 26px 60px -34px rgba(15, 23, 42, 0.42);
    transform: translateX(calc(100% + 30px));
    opacity: 0;
    pointer-events: none;
    transition: transform 0.28s ease, opacity 0.22s ease;
}

body[data-course-shell].shell-notes-open .course-shell-notes-sheet {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
}

body[data-course-shell] .course-shell-notes-sheet__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

body[data-course-shell] .course-shell-notes-sheet__copy h2 {
    margin: 0.25rem 0 0;
    font-size: 1.18rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
}

body[data-course-shell] .course-shell-notes-sheet__eyebrow {
    margin: 0;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--course-shell-muted);
}

body[data-course-shell] .course-shell-notes-sheet__context {
    margin: 0.55rem 0 0;
    color: var(--text-secondary);
    line-height: 1.55;
}

body[data-course-shell] .course-shell-notes-sheet__header-actions {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

body[data-course-shell] .course-shell-notes-sheet__link,
body[data-course-shell] .course-shell-notes-sheet__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 40px;
    padding: 0 0.8rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(255, 255, 255, 0.44);
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.88rem;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

body[data-course-shell] .course-shell-notes-sheet__close {
    width: 40px;
    padding: 0;
}

html[data-theme="dark"] body[data-course-shell] .course-shell-notes-sheet__link,
html[data-theme="dark"] body[data-course-shell] .course-shell-notes-sheet__close {
    background: rgba(30, 41, 59, 0.68);
    border-color: rgba(71, 85, 105, 0.66);
}

body[data-course-shell] .course-shell-notes-sheet__link:hover,
body[data-course-shell] .course-shell-notes-sheet__close:hover {
    transform: translateY(-1px);
    border-color: rgba(168, 85, 247, 0.28);
    background: rgba(255, 255, 255, 0.62);
}

html[data-theme="dark"] body[data-course-shell] .course-shell-notes-sheet__link:hover,
html[data-theme="dark"] body[data-course-shell] .course-shell-notes-sheet__close:hover {
    background: rgba(30, 41, 59, 0.92);
}

body[data-course-shell] .course-shell-notes-scope {
    display: inline-grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
}

body[data-course-shell] .course-shell-notes-scope__btn {
    min-height: 42px;
    padding: 0.75rem 0.9rem;
    border-radius: 1rem;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(255, 255, 255, 0.64);
    color: var(--text-primary);
    font: inherit;
    font-weight: 700;
    transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

html[data-theme="dark"] body[data-course-shell] .course-shell-notes-scope__btn {
    background: rgba(30, 41, 59, 0.74);
    border-color: rgba(71, 85, 105, 0.62);
}

body[data-course-shell] .course-shell-notes-scope__btn:hover {
    transform: translateY(-1px);
    border-color: rgba(168, 85, 247, 0.26);
}

body[data-course-shell] .course-shell-notes-scope__btn.is-active {
    color: #ffffff;
    border-color: transparent;
    background: linear-gradient(135deg, #0f766e 0%, #2563eb 100%);
    box-shadow: 0 14px 30px -24px rgba(37, 99, 235, 0.55);
}

body[data-course-shell] .course-shell-notes-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-height: 0;
}

body[data-course-shell] .course-shell-notes-textarea {
    width: 100%;
    min-height: 240px;
    flex: 1;
    resize: vertical;
    padding: 1rem 1.05rem;
    border-radius: 1.15rem;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(255, 255, 255, 0.78);
    color: var(--text-primary);
    font: inherit;
    line-height: 1.7;
}

html[data-theme="dark"] body[data-course-shell] .course-shell-notes-textarea {
    background: rgba(15, 23, 42, 0.82);
    border-color: rgba(71, 85, 105, 0.66);
    color: #f8fafc;
}

body[data-course-shell] .course-shell-notes-textarea::placeholder {
    color: var(--course-shell-muted);
}

body[data-course-shell] .course-shell-notes-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

body[data-course-shell] .course-shell-notes-status {
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.55;
    color: var(--text-secondary);
}

body[data-course-shell] .course-shell-notes-status.is-success {
    color: #047857;
}

body[data-course-shell] .course-shell-notes-status.is-danger {
    color: #dc2626;
}

body[data-course-shell] .course-shell-notes-status.is-muted {
    color: var(--course-shell-muted);
}

html[data-theme="dark"] body[data-course-shell] .course-shell-notes-status.is-success {
    color: #6ee7b7;
}

html[data-theme="dark"] body[data-course-shell] .course-shell-notes-status.is-danger {
    color: #fca5a5;
}

body[data-course-shell] .course-shell-notes-count {
    flex-shrink: 0;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--course-shell-muted);
}

body[data-course-shell] .course-shell-notes-count.is-near-limit {
    color: #d97706;
}

body[data-course-shell] .course-shell-notes-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

body[data-course-shell] .course-shell-notes-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    min-height: 44px;
    padding: 0.85rem 1rem;
    border-radius: 1rem;
    border: 1px solid rgba(148, 163, 184, 0.18);
    font: inherit;
    font-weight: 700;
    transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, opacity 0.18s ease;
}

body[data-course-shell] .course-shell-notes-action:hover {
    transform: translateY(-1px);
}

body[data-course-shell] .course-shell-notes-action:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

body[data-course-shell] .course-shell-notes-action--secondary {
    background: rgba(255, 255, 255, 0.72);
    color: var(--text-primary);
}

body[data-course-shell] .course-shell-notes-action--primary {
    margin-left: auto;
    background: linear-gradient(135deg, #059669 0%, #2563eb 100%);
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 18px 32px -24px rgba(37, 99, 235, 0.48);
}

html[data-theme="dark"] body[data-course-shell] .course-shell-notes-action--secondary {
    background: rgba(30, 41, 59, 0.84);
    border-color: rgba(71, 85, 105, 0.66);
    color: #f8fafc;
}

body[data-course-shell] .course-shell-flashcard {
    --course-shell-flashcard-accent: var(--primary);
    --course-shell-flashcard-glow: rgba(37, 99, 235, 0.18);
    --course-shell-flashcard-surface: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(241, 245, 249, 0.96) 100%);
    position: relative;
    display: block;
    width: 100%;
    min-height: 236px;
    padding: 0;
    border: 0;
    appearance: none;
    background: transparent;
    font: inherit;
    text-align: left;
    perspective: 1400px;
    cursor: pointer;
}

html[data-theme="dark"] body[data-course-shell] .course-shell-flashcard {
    --course-shell-flashcard-surface: linear-gradient(180deg, rgba(15, 23, 42, 0.98) 0%, rgba(30, 41, 59, 0.98) 100%);
}

body[data-course-shell] .course-shell-flashcard--info {
    --course-shell-flashcard-accent: var(--info);
    --course-shell-flashcard-glow: rgba(14, 165, 233, 0.22);
}

body[data-course-shell] .course-shell-flashcard--success {
    --course-shell-flashcard-accent: var(--success);
    --course-shell-flashcard-glow: rgba(34, 197, 94, 0.2);
}

body[data-course-shell] .course-shell-flashcard--warning {
    --course-shell-flashcard-accent: var(--warning);
    --course-shell-flashcard-glow: rgba(245, 158, 11, 0.22);
}

body[data-course-shell] .course-shell-flashcard--danger {
    --course-shell-flashcard-accent: var(--danger);
    --course-shell-flashcard-glow: rgba(239, 68, 68, 0.2);
}

body[data-course-shell] .course-shell-flashcard__inner {
    position: relative;
    display: block;
    min-height: 236px;
    transform-style: preserve-3d;
    transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}

body[data-course-shell] .course-shell-flashcard.is-flipped .course-shell-flashcard__inner {
    transform: rotateY(180deg);
}

body[data-course-shell] .course-shell-flashcard__face {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-height: 236px;
    padding: 1.1rem;
    border-radius: 1.35rem;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-top: 4px solid var(--course-shell-flashcard-accent);
    background: var(--course-shell-flashcard-surface);
    box-shadow: 0 24px 44px -34px var(--course-shell-flashcard-glow);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

body[data-course-shell] .course-shell-flashcard__face--back {
    transform: rotateY(180deg);
}

body[data-course-shell] .course-shell-flashcard__eyebrow {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--course-shell-muted);
}

body[data-course-shell] .course-shell-flashcard__title {
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1.35;
    color: var(--text-primary);
}

body[data-course-shell] .course-shell-flashcard__body {
    font-size: 0.96rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

body[data-course-shell] .course-shell-flashcard__action {
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--course-shell-flashcard-accent);
}

body[data-course-shell] .course-shell-flashcard:hover .course-shell-flashcard__face {
    border-color: rgba(99, 102, 241, 0.28);
}

body[data-course-shell] .course-shell-microcheck {
    --course-shell-microcheck-accent: var(--primary);
    position: relative;
    padding: 1.1rem;
    border-radius: 1.35rem;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-top: 4px solid var(--course-shell-microcheck-accent);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.94) 0%, rgba(248, 250, 252, 0.94) 100%);
    box-shadow: 0 24px 44px -34px rgba(15, 23, 42, 0.26);
}

html[data-theme="dark"] body[data-course-shell] .course-shell-microcheck {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.98) 0%, rgba(30, 41, 59, 0.98) 100%);
}

body[data-course-shell] .course-shell-microcheck--info {
    --course-shell-microcheck-accent: var(--info);
}

body[data-course-shell] .course-shell-microcheck--success {
    --course-shell-microcheck-accent: var(--success);
}

body[data-course-shell] .course-shell-microcheck--warning {
    --course-shell-microcheck-accent: var(--warning);
}

body[data-course-shell] .course-shell-microcheck--danger {
    --course-shell-microcheck-accent: var(--danger);
}

body[data-course-shell] .course-shell-microcheck__header {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    margin-bottom: 0.7rem;
}

body[data-course-shell] .course-shell-microcheck__eyebrow {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--course-shell-muted);
}

body[data-course-shell] .course-shell-microcheck__title {
    margin: 0;
    font-size: 1.02rem;
    font-weight: 800;
    color: var(--text-primary);
}

body[data-course-shell] .course-shell-microcheck__prompt {
    margin: 0 0 1rem;
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.75;
}

body[data-course-shell] .course-shell-microcheck__options {
    display: grid;
    gap: 0.75rem;
}

body[data-course-shell] .course-shell-microcheck__option {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 0.8rem;
    align-items: center;
    width: 100%;
    padding: 0.9rem 1rem;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.72);
    color: var(--text-primary);
    text-align: left;
    font: inherit;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

html[data-theme="dark"] body[data-course-shell] .course-shell-microcheck__option {
    background: rgba(30, 41, 59, 0.72);
    border-color: rgba(71, 85, 105, 0.62);
}

body[data-course-shell] .course-shell-microcheck__option:hover {
    transform: translateY(-1px);
    border-color: rgba(99, 102, 241, 0.34);
}

body[data-course-shell] .course-shell-microcheck__option.is-disabled {
    cursor: default;
}

body[data-course-shell] .course-shell-microcheck__option.is-correct {
    border-color: rgba(34, 197, 94, 0.5);
    background: rgba(34, 197, 94, 0.12);
}

body[data-course-shell] .course-shell-microcheck__option.is-incorrect {
    border-color: rgba(239, 68, 68, 0.42);
    background: rgba(239, 68, 68, 0.12);
}

body[data-course-shell] .course-shell-microcheck__option-key {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.12);
    color: var(--course-shell-microcheck-accent);
    font-weight: 800;
}

body[data-course-shell] .course-shell-microcheck__option-text {
    line-height: 1.55;
}

body[data-course-shell] .course-shell-microcheck__feedback {
    margin-top: 1rem;
}

body[data-course-shell] .course-shell-microcheck__explanation {
    margin-top: 1rem;
    padding: 0.95rem 1rem;
    border-radius: 1rem;
    background: rgba(148, 163, 184, 0.08);
}

body[data-course-shell] .course-shell-microcheck__explanation h4 {
    margin: 0 0 0.55rem;
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-primary);
}

body[data-course-shell] .course-shell-microcheck__explanation p {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.7;
}

body[data-course-shell] .quiz-feedback {
    margin-top: 1rem;
}

body[data-course-shell] .quiz-feedback .highlight-box {
    margin: 0;
}

body[data-course-shell] .quiz-explanation {
    box-shadow: 0 16px 34px -30px rgba(37, 99, 235, 0.18);
}

body[data-course-shell] .quiz-explanation[data-state="correct"] {
    background: linear-gradient(135deg, rgba(236, 253, 245, 0.92) 0%, rgba(240, 253, 250, 0.96) 100%);
    border-left-color: #10b981;
}

body[data-course-shell] .quiz-explanation[data-state="incorrect"] {
    background: linear-gradient(135deg, rgba(255, 251, 235, 0.94) 0%, rgba(255, 247, 237, 0.98) 100%);
    border-left-color: #f59e0b;
}

html[data-theme="dark"] body[data-course-shell] .quiz-explanation[data-state="correct"] {
    background: linear-gradient(135deg, rgba(6, 78, 59, 0.34) 0%, rgba(15, 118, 110, 0.2) 100%);
}

html[data-theme="dark"] body[data-course-shell] .quiz-explanation[data-state="incorrect"] {
    background: linear-gradient(135deg, rgba(120, 53, 15, 0.34) 0%, rgba(146, 64, 14, 0.2) 100%);
}

body[data-course-shell] .quiz-explanation__summary {
    display: grid;
    gap: 0.35rem;
    margin-bottom: 0.85rem;
    padding: 0.85rem 1rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.54);
    border: 1px solid rgba(148, 163, 184, 0.16);
}

html[data-theme="dark"] body[data-course-shell] .quiz-explanation__summary {
    background: rgba(15, 23, 42, 0.44);
    border-color: rgba(71, 85, 105, 0.42);
}

body[data-course-shell] .quiz-explanation__summary-label {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--course-shell-muted);
}

body[data-course-shell] .quiz-explanation__summary strong {
    color: var(--text-primary);
    line-height: 1.5;
}

body[data-course-shell] .course-shell-bookmark-btn.is-saved {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--text-inverse);
    border-color: transparent;
}

body[data-course-shell] .course-shell-bookmark-btn.is-pending {
    opacity: 0.78;
    cursor: progress;
}

body[data-course-shell] .course-shell-bookmark-btn:disabled {
    cursor: not-allowed;
}

body[data-course-shell] .course-shell-focus-btn[aria-pressed="true"] {
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    color: var(--text-inverse);
    border-color: transparent;
}

body[data-course-shell] .course-shell-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 40px;
    padding: 0 0.9rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(148, 163, 184, 0.16);
    color: var(--text-primary);
    font-size: 0.88rem;
    font-weight: 600;
}

html[data-theme="dark"] body[data-course-shell] .course-shell-chip {
    background: rgba(15, 23, 42, 0.34);
    border-color: rgba(71, 85, 105, 0.5);
}

body[data-course-shell] .course-shell-chip--accent {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.09), rgba(14, 165, 233, 0.1));
    color: var(--primary-dark);
}

html[data-theme="dark"] body[data-course-shell] .course-shell-chip--accent {
    color: #dbeafe;
}

body[data-course-shell] .course-shell-drawer {
    position: fixed;
    top: max(14px, env(safe-area-inset-top));
    bottom: 16px;
    left: 16px;
    width: min(92vw, var(--course-shell-drawer-width));
    z-index: 1090;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    padding: 0.95rem;
    border-radius: 1.5rem;
    border: 1px solid var(--course-shell-border);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(248, 250, 252, 0.84) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: var(--course-shell-shadow);
    transform: translateX(calc(-100% - 28px));
    transition: transform 0.28s ease;
}

html[data-theme="dark"] body[data-course-shell] .course-shell-drawer {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.94) 0%, rgba(15, 23, 42, 0.84) 100%);
}

body[data-course-shell].shell-drawer-open .course-shell-drawer {
    transform: translateX(0);
}

body[data-course-shell] .course-shell-drawer__header {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-bottom: 0.9rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

body[data-course-shell] .course-shell-drawer__eyebrow {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--course-shell-muted);
}

body[data-course-shell] .course-shell-drawer__title {
    font-size: 1.08rem;
    font-weight: 800;
    color: var(--text-primary);
}

body[data-course-shell] .course-shell-drawer__subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

body[data-course-shell] .course-shell-drawer__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

body[data-course-shell] .course-shell-drawer__nav {
    display: flex;
    flex-direction: column;
    gap: 0.48rem;
    overflow-y: auto;
    padding-top: 0.25rem;
    padding-right: 0.15rem;
}

body[data-course-shell] .course-shell-drawer__item {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 0.85rem;
    align-items: center;
    width: 100%;
    padding: 0.8rem 0.9rem;
    border: 1px solid rgba(148, 163, 184, 0.1);
    border-radius: 1.15rem;
    background: rgba(255, 255, 255, 0.18);
    color: var(--text-primary);
    text-align: left;
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

html[data-theme="dark"] body[data-course-shell] .course-shell-drawer__item {
    background: rgba(15, 23, 42, 0.3);
    border-color: rgba(71, 85, 105, 0.22);
}

body[data-course-shell] .course-shell-drawer__item:hover {
    border-color: rgba(99, 102, 241, 0.18);
    background: rgba(255, 255, 255, 0.28);
    box-shadow: var(--course-shell-shadow-soft);
}

html[data-theme="dark"] body[data-course-shell] .course-shell-drawer__item:hover {
    background: rgba(30, 41, 59, 0.5);
}

body[data-course-shell] .course-shell-drawer__item.is-active,
body[data-course-shell] .course-shell-drawer__item[aria-current="true"] {
    border-color: rgba(37, 99, 235, 0.28);
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(20, 184, 166, 0.12));
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1), 0 14px 28px -26px rgba(37, 99, 235, 0.4);
}

body[data-course-shell] .course-shell-drawer__item-index {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 1rem;
    background: linear-gradient(135deg, rgba(226, 232, 240, 0.9), rgba(203, 213, 225, 0.92));
    color: #334155;
    font-weight: 800;
    letter-spacing: 0.04em;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.46);
}

html[data-theme="dark"] body[data-course-shell] .course-shell-drawer__item-index {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.92), rgba(51, 65, 85, 0.94));
    color: #e2e8f0;
}

body[data-course-shell] .course-shell-drawer__item.is-active .course-shell-drawer__item-index,
body[data-course-shell] .course-shell-drawer__item[aria-current="true"] .course-shell-drawer__item-index {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--text-inverse);
    box-shadow: 0 12px 24px -18px var(--primary-glow);
}

body[data-course-shell] .course-shell-drawer__item-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

body[data-course-shell] .course-shell-drawer__item-kind {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--course-shell-muted);
}

body[data-course-shell] .course-shell-drawer__item-label {
    font-size: 0.94rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
}

body[data-course-shell] .course-shell-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1050;
    border: 0;
    background: rgba(15, 23, 42, 0.44);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

body[data-course-shell].shell-overlay-open .course-shell-backdrop {
    opacity: 1;
    pointer-events: auto;
}

body[data-course-shell].shell-focus-mode .course-shell-topbar {
    background: rgba(255, 255, 255, 0.74);
}

html[data-theme="dark"] body[data-course-shell].shell-focus-mode .course-shell-topbar {
    background: rgba(15, 23, 42, 0.74);
}

body[data-course-shell].shell-focus-mode .course-shell-topbar__eyebrow,
body[data-course-shell].shell-focus-mode .course-shell-topbar__title {
    display: none;
}

body[data-course-shell].shell-focus-mode .course-shell-topbar__section {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

body[data-course-shell].shell-focus-mode .course-shell-back-link,
body[data-course-shell].shell-focus-mode .course-shell-review-btn,
body[data-course-shell].shell-focus-mode .course-shell-notes-btn,
body[data-course-shell].shell-focus-mode [data-shell-meta="time"] {
    display: none;
}

body[data-course-shell].shell-topbar-compact {
    --course-shell-topbar-height: 134px;
}

body[data-course-shell].shell-topbar-compact .course-shell-stage {
    padding-top: calc(var(--course-shell-topbar-height) + 1rem);
}

body[data-course-shell].shell-topbar-compact .course-shell-topbar {
    flex-wrap: wrap;
    align-items: flex-start;
    row-gap: 0.65rem;
}

body[data-course-shell].shell-topbar-compact .course-shell-topbar__center {
    flex: 1 1 240px;
    min-width: min(280px, 100%);
}

body[data-course-shell].shell-topbar-compact .course-shell-topbar__eyebrow {
    font-size: 0.68rem;
}

body[data-course-shell].shell-topbar-compact .course-shell-topbar__title {
    font-size: 0.96rem;
}

body[data-course-shell].shell-topbar-compact .course-shell-topbar__section {
    font-size: 0.83rem;
}

body[data-course-shell].shell-topbar-compact .course-shell-topbar__cluster--meta {
    order: 3;
    width: 100%;
    flex: 1 1 100%;
    margin-left: 0;
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 0.1rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
}

body[data-course-shell].shell-topbar-compact .course-shell-topbar__cluster--meta::-webkit-scrollbar {
    display: none;
}

body[data-course-shell].shell-topbar-compact .course-shell-topbar__cluster--meta > * {
    flex: 0 0 auto;
    scroll-snap-align: start;
}

body[data-course-shell].shell-topbar-compact .course-shell-chip,
body[data-course-shell].shell-topbar-compact .course-shell-review-btn,
body[data-course-shell].shell-topbar-compact .course-shell-notes-btn,
body[data-course-shell].shell-topbar-compact .course-shell-bookmark-btn,
body[data-course-shell].shell-topbar-compact .course-shell-focus-btn,
body[data-course-shell].shell-topbar-compact .course-shell-theme-btn {
    white-space: nowrap;
}

body.course-completion-open {
    overflow: hidden;
}

body[data-course-shell] .course-shell-completion-panel {
    display: grid;
    gap: 1rem;
    padding: clamp(1.25rem, 3vw, 1.6rem);
    border-radius: 1.5rem;
    border: 1px solid rgba(16, 185, 129, 0.18);
    background:
        linear-gradient(180deg, rgba(236, 253, 245, 0.92) 0%, rgba(248, 250, 252, 0.98) 100%);
    box-shadow: 0 26px 48px -36px rgba(15, 23, 42, 0.22);
}

html[data-theme="dark"] body[data-course-shell] .course-shell-completion-panel {
    border-color: rgba(45, 212, 191, 0.2);
    background:
        linear-gradient(180deg, rgba(8, 47, 73, 0.7) 0%, rgba(15, 23, 42, 0.94) 100%);
    box-shadow: 0 32px 56px -40px rgba(2, 6, 23, 0.64);
}

body[data-course-shell] .course-shell-completion-panel__hero {
    display: grid;
    gap: 0.8rem;
    justify-items: center;
    text-align: center;
}

body[data-course-shell] .course-shell-completion-panel__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.62);
    border: 1px solid rgba(16, 185, 129, 0.14);
    color: var(--success-dark);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

html[data-theme="dark"] body[data-course-shell] .course-shell-completion-panel__eyebrow {
    background: rgba(15, 23, 42, 0.48);
    color: #b7f7dc;
}

body[data-course-shell] .course-shell-completion-panel__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 4.4rem;
    height: 4.4rem;
    border-radius: 1.4rem;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.16), rgba(59, 130, 246, 0.14));
    color: var(--success);
    font-size: 1.75rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

html[data-theme="dark"] body[data-course-shell] .course-shell-completion-panel__icon {
    color: #7dd3fc;
}

body[data-course-shell] .course-shell-completion-panel__hero h3 {
    margin: 0;
    font-size: clamp(1.45rem, 3vw, 1.9rem);
    letter-spacing: -0.03em;
}

body[data-course-shell] .course-shell-completion-panel__hero p {
    margin: 0;
    max-width: 58ch;
    color: var(--text-secondary);
}

body[data-course-shell] .course-shell-completion-panel__benefits {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.9rem;
}

body[data-course-shell] .course-shell-completion-panel__benefit {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.9rem 1rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(148, 163, 184, 0.16);
    color: var(--text-primary);
    font-weight: 700;
    justify-content: center;
}

html[data-theme="dark"] body[data-course-shell] .course-shell-completion-panel__benefit {
    background: rgba(15, 23, 42, 0.56);
    border-color: rgba(71, 85, 105, 0.48);
}

body[data-course-shell] .course-shell-completion-panel__benefit i {
    color: var(--primary);
}

body[data-course-shell] .course-shell-completion-panel__hint {
    margin: 0;
    color: var(--text-tertiary);
    font-size: 0.95rem;
}

body[data-course-shell] .course-shell-complete-btn {
    justify-self: center;
    min-width: min(100%, 320px);
}

body[data-course-shell] .course-shell-completion-inline-status {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.95rem;
    align-items: center;
    padding: 1rem 1.05rem;
    border-radius: 1.2rem;
    border: 1px solid rgba(16, 185, 129, 0.18);
    background: rgba(255, 255, 255, 0.84);
    text-align: left;
}

html[data-theme="dark"] body[data-course-shell] .course-shell-completion-inline-status {
    background: rgba(15, 23, 42, 0.72);
    border-color: rgba(45, 212, 191, 0.2);
}

body[data-course-shell] .course-shell-completion-inline-status__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.9rem;
    height: 2.9rem;
    border-radius: 0.9rem;
    background: rgba(16, 185, 129, 0.12);
    color: var(--success);
    font-size: 1.15rem;
}

body[data-course-shell] .course-shell-completion-inline-status__copy h3,
body[data-course-shell] .course-shell-completion-inline-status__copy p {
    margin: 0;
}

body[data-course-shell] .course-shell-completion-inline-status__copy h3 {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-primary);
}

body[data-course-shell] .course-shell-completion-inline-status__copy p {
    margin-top: 0.2rem;
    color: var(--text-secondary);
}

body[data-course-shell] .course-shell-completion-inline-status__actions {
    display: inline-flex;
    gap: 0.55rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

body[data-course-shell] .course-shell-completion-inline-status__link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 40px;
    padding: 0.65rem 0.9rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(255, 255, 255, 0.82);
    color: var(--text-primary);
    font-weight: 700;
    text-decoration: none;
}

html[data-theme="dark"] body[data-course-shell] .course-shell-completion-inline-status__link {
    background: rgba(15, 23, 42, 0.56);
    border-color: rgba(71, 85, 105, 0.48);
}

body[data-course-shell] .complete-btn.is-completed,
body[data-course-shell] .js-complete-btn.is-completed {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.95), rgba(37, 99, 235, 0.9)) !important;
    border-color: rgba(16, 185, 129, 0.24) !important;
    color: #fff !important;
    opacity: 1 !important;
}

body[data-course-shell] .complete-btn.is-pending,
body[data-course-shell] .js-complete-btn.is-pending {
    cursor: progress;
}

.edu-course-completion-dialog {
    position: fixed;
    inset: 0;
    z-index: 2200;
    display: grid;
    place-items: center;
    padding: max(1.2rem, env(safe-area-inset-top)) 1rem max(1.2rem, env(safe-area-inset-bottom));
}

.edu-course-completion-dialog__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.58);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.edu-course-completion-dialog__panel {
    position: relative;
    width: min(760px, 100%);
    display: grid;
    gap: 1.1rem;
    padding: clamp(1.25rem, 3vw, 1.7rem);
    border-radius: 1.65rem;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background:
        radial-gradient(560px 280px at top right, rgba(20, 184, 166, 0.12), transparent 62%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.98) 100%);
    box-shadow: 0 42px 80px -52px rgba(15, 23, 42, 0.48);
}

html[data-theme="dark"] .edu-course-completion-dialog__panel {
    border-color: rgba(71, 85, 105, 0.52);
    background:
        radial-gradient(560px 280px at top right, rgba(20, 184, 166, 0.16), transparent 62%),
        linear-gradient(180deg, rgba(15, 23, 42, 0.98) 0%, rgba(17, 24, 39, 0.98) 100%);
    box-shadow: 0 44px 84px -54px rgba(2, 6, 23, 0.82);
}

.edu-course-completion-dialog__close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(255, 255, 255, 0.72);
    color: var(--text-primary);
    cursor: pointer;
}

html[data-theme="dark"] .edu-course-completion-dialog__close {
    background: rgba(15, 23, 42, 0.66);
    border-color: rgba(71, 85, 105, 0.48);
}

.edu-course-completion-dialog__hero {
    display: grid;
    gap: 0.85rem;
    padding-right: 2.6rem;
}

.edu-course-completion-dialog__eyebrow {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-secondary);
    background: rgba(148, 163, 184, 0.12);
}

.edu-course-completion-dialog__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 4.3rem;
    height: 4.3rem;
    border-radius: 1.35rem;
    font-size: 1.7rem;
    color: #fff;
    background: linear-gradient(135deg, #10b981, #2563eb);
    box-shadow: 0 22px 40px -30px rgba(37, 99, 235, 0.55);
}

.edu-course-completion-dialog--error .edu-course-completion-dialog__icon {
    background: linear-gradient(135deg, #f59e0b, #ef4444);
}

.edu-course-completion-dialog__hero h2,
.edu-course-completion-dialog__hero p {
    margin: 0;
}

.edu-course-completion-dialog__hero h2 {
    font-size: clamp(1.55rem, 3vw, 2.2rem);
    line-height: 1.06;
    letter-spacing: -0.035em;
    color: var(--text-primary);
}

.edu-course-completion-dialog__hero p {
    max-width: 60ch;
    color: var(--text-secondary);
    line-height: 1.72;
}

.edu-course-completion-dialog__metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.9rem;
}

.edu-course-completion-dialog__metric {
    display: grid;
    gap: 0.25rem;
    padding: 0.95rem 1rem;
    border-radius: 1.15rem;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(255, 255, 255, 0.72);
}

html[data-theme="dark"] .edu-course-completion-dialog__metric {
    background: rgba(15, 23, 42, 0.58);
    border-color: rgba(71, 85, 105, 0.48);
}

.edu-course-completion-dialog__metric-label {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-tertiary);
}

.edu-course-completion-dialog__metric strong {
    font-size: 1.08rem;
    color: var(--text-primary);
}

.edu-course-completion-dialog__tips {
    display: grid;
    gap: 0.7rem;
    padding: 1rem 1.05rem;
    border-radius: 1.15rem;
    background: rgba(15, 23, 42, 0.04);
    border: 1px solid rgba(148, 163, 184, 0.14);
}

html[data-theme="dark"] .edu-course-completion-dialog__tips {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(71, 85, 105, 0.46);
}

.edu-course-completion-dialog__tip {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    color: var(--text-secondary);
}

.edu-course-completion-dialog__tip i {
    margin-top: 0.15rem;
    color: var(--success);
}

.edu-course-completion-dialog--error .edu-course-completion-dialog__tip i {
    color: var(--warning);
}

.edu-course-completion-dialog__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.edu-course-completion-dialog__action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    min-height: 48px;
    padding: 0.85rem 1.15rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    text-decoration: none;
    font-weight: 750;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.edu-course-completion-dialog__action:hover {
    transform: translateY(-1px);
}

.edu-course-completion-dialog__action--primary {
    background: linear-gradient(135deg, #10b981, #2563eb);
    color: #fff;
    box-shadow: 0 18px 32px -26px rgba(37, 99, 235, 0.5);
}

.edu-course-completion-dialog__action--secondary {
    background: rgba(37, 99, 235, 0.08);
    color: var(--text-primary);
}

.edu-course-completion-dialog__action--accent {
    background: rgba(124, 58, 237, 0.1);
    color: var(--text-primary);
}

.edu-course-completion-dialog__action--ghost {
    background: rgba(255, 255, 255, 0.68);
    color: var(--text-primary);
}

html[data-theme="dark"] .edu-course-completion-dialog__action--secondary {
    background: rgba(37, 99, 235, 0.16);
}

html[data-theme="dark"] .edu-course-completion-dialog__action--accent {
    background: rgba(124, 58, 237, 0.16);
}

html[data-theme="dark"] .edu-course-completion-dialog__action--ghost {
    background: rgba(15, 23, 42, 0.62);
}

/*
 * Shared polish layer for shell + preserve-first courses.
 * This intentionally uses high specificity so it can refine older per-course inline styles.
 */
body[data-course-shell] .course-shell-stage .container {
    position: relative;
    width: min(1140px, 100%);
    border-radius: 1.9rem !important;
    border: 1px solid rgba(148, 163, 184, 0.16) !important;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(248, 250, 252, 0.94) 100%) !important;
    box-shadow: 0 34px 80px -48px rgba(15, 23, 42, 0.36) !important;
    overflow: hidden !important;
}

html[data-theme="dark"] body[data-course-shell] .course-shell-stage .container {
    border-color: rgba(71, 85, 105, 0.42) !important;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.98) 0%, rgba(22, 30, 48, 0.98) 100%) !important;
    box-shadow: 0 40px 84px -52px rgba(2, 6, 23, 0.72) !important;
}

body[data-course-shell] .course-shell-stage .container::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0%, transparent 20%);
    z-index: 0;
}

body[data-course-shell] .course-shell-stage .container > * {
    position: relative;
    z-index: 1;
}

body[data-course-shell] .course-shell-stage .header,
body[data-course-shell] .course-shell-stage .course-header,
body[data-course-shell] .course-shell-stage .slide-title-banner {
    position: relative;
    margin: 0.9rem !important;
    border-radius: 1.6rem !important;
    overflow: hidden;
    padding: clamp(2rem, 4vw, 2.9rem) clamp(1.4rem, 4vw, 2.6rem) !important;
    box-shadow: 0 28px 60px -38px rgba(15, 23, 42, 0.32);
}

body[data-course-shell] .course-shell-stage .header::after,
body[data-course-shell] .course-shell-stage .course-header::after,
body[data-course-shell] .course-shell-stage .slide-title-banner::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(120deg, rgba(255, 255, 255, 0.16) 0%, transparent 34%, rgba(255, 255, 255, 0.08) 64%, transparent 100%);
}

body[data-course-shell] .course-shell-stage .header h1,
body[data-course-shell] .course-shell-stage .course-header h1,
body[data-course-shell] .course-shell-stage .slide-title,
body[data-course-shell] .course-shell-stage .header .course-title {
    letter-spacing: -0.03em;
    line-height: 1.04;
    max-width: 16ch;
    margin-inline: auto;
    text-wrap: balance;
}

body[data-course-shell] .course-shell-stage .header p,
body[data-course-shell] .course-shell-stage .course-header p,
body[data-course-shell] .course-shell-stage .slide-subtitle,
body[data-course-shell] .course-shell-stage .header .course-subtitle {
    max-width: 60ch;
    margin-inline: auto;
    opacity: 0.92;
}

body[data-course-shell] .course-shell-stage .content,
body[data-course-shell] .course-shell-stage .slide-content {
    padding: clamp(1.4rem, 3vw, 2.3rem) !important;
}

body[data-course-shell] .course-shell-stage .section-title {
    margin-bottom: 1.35rem !important;
    border-left-width: 4px !important;
    padding-left: 0.95rem !important;
    font-size: clamp(1.55rem, 3vw, 2.1rem) !important;
    font-weight: 800 !important;
    letter-spacing: -0.03em;
    line-height: 1.08;
}

body[data-course-shell] .course-shell-stage .content p,
body[data-course-shell] .course-shell-stage .slide-content p,
body[data-course-shell] .course-shell-stage .content li,
body[data-course-shell] .course-shell-stage .slide-content li {
    line-height: 1.78;
}

body[data-course-shell] .course-shell-stage .icon-container,
body[data-course-shell] .course-shell-stage .grid-2,
body[data-course-shell] .course-shell-stage .grid-3 {
    gap: 1.15rem !important;
}

body[data-course-shell] .course-shell-stage .icon-card,
body[data-course-shell] .course-shell-stage .card,
body[data-course-shell] .course-shell-stage .highlight-box,
body[data-course-shell] .course-shell-stage .question-box,
body[data-course-shell] .course-shell-stage .quiz-question {
    border-radius: 1.35rem !important;
    border: 1px solid rgba(148, 163, 184, 0.14) !important;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 250, 252, 0.92) 100%) !important;
    box-shadow: 0 24px 48px -36px rgba(15, 23, 42, 0.28) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

html[data-theme="dark"] body[data-course-shell] .course-shell-stage .icon-card,
html[data-theme="dark"] body[data-course-shell] .course-shell-stage .card,
html[data-theme="dark"] body[data-course-shell] .course-shell-stage .highlight-box,
html[data-theme="dark"] body[data-course-shell] .course-shell-stage .question-box,
html[data-theme="dark"] body[data-course-shell] .course-shell-stage .quiz-question {
    border-color: rgba(71, 85, 105, 0.42) !important;
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.92) 0%, rgba(15, 23, 42, 0.96) 100%) !important;
    box-shadow: 0 28px 56px -40px rgba(2, 6, 23, 0.58) !important;
}

body[data-course-shell] .course-shell-stage .icon-card,
body[data-course-shell] .course-shell-stage .card {
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

body[data-course-shell] .course-shell-stage .icon-card:hover,
body[data-course-shell] .course-shell-stage .card:hover {
    transform: translateY(-2px);
    border-color: rgba(20, 184, 166, 0.24) !important;
    box-shadow: 0 30px 56px -36px rgba(13, 148, 136, 0.2) !important;
}

body[data-course-shell] .course-shell-stage .icon-card i {
    text-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

body[data-course-shell] .course-shell-stage .quiz-option {
    border-radius: 1.15rem !important;
    border-width: 1px !important;
    border-color: rgba(148, 163, 184, 0.2) !important;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(248, 250, 252, 0.94) 100%) !important;
    box-shadow: 0 14px 30px -28px rgba(15, 23, 42, 0.24);
}

html[data-theme="dark"] body[data-course-shell] .course-shell-stage .quiz-option {
    border-color: rgba(71, 85, 105, 0.52) !important;
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.92) 0%, rgba(15, 23, 42, 0.95) 100%) !important;
}

body[data-course-shell] .course-shell-stage .quiz-option:hover {
    transform: translateY(-1px);
    border-color: rgba(20, 184, 166, 0.34) !important;
    box-shadow: 0 20px 34px -28px rgba(13, 148, 136, 0.22);
}

body[data-course-shell] .course-shell-stage .option-letter {
    border-radius: 0.85rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

body[data-course-shell] .course-shell-stage .btn,
body[data-course-shell] .course-shell-stage .quiz-submit-btn {
    border-radius: 999px !important;
    padding-inline: 1.25rem !important;
    font-weight: 700 !important;
    box-shadow: 0 16px 30px -24px rgba(15, 23, 42, 0.26);
}

body[data-course-shell] .course-shell-stage .nav-buttons {
    gap: 0.85rem;
    flex-wrap: wrap;
}

body[data-course-shell] .course-shell-stage table {
    overflow: hidden;
    border-radius: 1.1rem;
    border-collapse: separate;
    border-spacing: 0;
    box-shadow: 0 20px 42px -34px rgba(15, 23, 42, 0.24);
}

@media (min-width: 1200px) {
    body[data-course-shell] .course-shell-backdrop {
        display: none !important;
    }

    body[data-course-shell].shell-drawer-open .course-shell-stage {
        padding-left: calc(var(--course-shell-drawer-width) + 2rem);
    }

    body[data-course-shell].shell-drawer-open .course-shell-topbar {
        left: calc(var(--course-shell-drawer-width) + 32px);
    }
}

@media (max-width: 1024px) {
    body[data-course-shell] .course-shell-topbar {
        gap: 0.7rem;
    }

    body[data-course-shell] .course-shell-topbar__cluster--meta {
        gap: 0.45rem;
    }

    body[data-course-shell] .course-shell-back-link span {
        display: none;
    }
}

@media (max-width: 960px) {
    body[data-course-shell] {
        --course-shell-topbar-height: 138px;
    }

    body[data-course-shell] .course-shell-stage {
        padding-top: calc(var(--course-shell-topbar-height) + 1rem);
    }

    body[data-course-shell] .course-shell-topbar {
        flex-wrap: wrap;
        align-items: flex-start;
        row-gap: 0.65rem;
    }

    body[data-course-shell] .course-shell-topbar__cluster--meta {
        order: 3;
        width: 100%;
        flex: 1 1 100%;
        margin-left: 0;
        justify-content: flex-start;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        padding-bottom: 0.1rem;
        scrollbar-width: none;
        -ms-overflow-style: none;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x proximity;
    }

    body[data-course-shell] .course-shell-topbar__cluster--meta > * {
        flex: 0 0 auto;
        scroll-snap-align: start;
    }

    body[data-course-shell] .course-shell-chip,
    body[data-course-shell] .course-shell-review-btn,
    body[data-course-shell] .course-shell-notes-btn,
    body[data-course-shell] .course-shell-bookmark-btn,
    body[data-course-shell] .course-shell-focus-btn,
    body[data-course-shell] .course-shell-theme-btn {
        white-space: nowrap;
    }
}

@media (max-width: 768px) {
    body[data-course-shell] {
        --course-shell-topbar-height: 124px;
    }

    body[data-course-shell] .course-shell-stage {
        padding-top: calc(var(--course-shell-topbar-height) + 1rem);
    }

    body[data-course-shell] .course-shell-stage .slide {
        padding-top: 0.9rem;
    }

    body[data-course-shell] .course-shell-topbar {
        left: 10px;
        right: 10px;
        padding: 0.7rem 0.8rem;
        border-radius: 1rem;
    }

    body[data-course-shell] .course-shell-topbar__center {
        display: none;
    }

    body[data-course-shell] .course-shell-chip {
        min-height: 36px;
        padding: 0 0.75rem;
        font-size: 0.78rem;
    }

    body[data-course-shell] .course-shell-review-btn,
    body[data-course-shell] .course-shell-notes-btn,
    body[data-course-shell] .course-shell-bookmark-btn,
    body[data-course-shell] .course-shell-focus-btn,
    body[data-course-shell] .course-shell-theme-btn {
        min-height: 38px;
        padding: 0 0.8rem;
        font-size: 0.78rem;
        gap: 0.4rem;
    }

    body[data-course-shell] .course-shell-focus-btn span,
    body[data-course-shell] .course-shell-review-btn span,
    body[data-course-shell] .course-shell-notes-btn span,
    body[data-course-shell] .course-shell-bookmark-btn span {
        display: inline;
    }

    body[data-course-shell] .course-shell-topbar .theme-toggle-btn.course-shell-theme-btn {
        width: 38px;
        min-width: 38px;
        height: 38px;
    }

    body[data-course-shell] .course-shell-notes-sheet {
        top: auto;
        right: 0;
        left: 0;
        bottom: 0;
        width: auto;
        max-height: min(82vh, 760px);
        border-radius: 1.35rem 1.35rem 0 0;
        transform: translateY(100%);
    }

    body[data-course-shell].shell-notes-open {
        overflow: hidden;
    }

    body[data-course-shell].shell-notes-open .course-shell-notes-sheet {
        transform: translateY(0);
    }

    body[data-course-shell] .course-shell-notes-sheet__header,
    body[data-course-shell] .course-shell-notes-meta,
    body[data-course-shell] .course-shell-notes-actions {
        flex-direction: column;
        align-items: stretch;
    }

    body[data-course-shell] .course-shell-notes-sheet__header-actions {
        width: 100%;
        justify-content: space-between;
    }

    body[data-course-shell] .course-shell-notes-action--primary {
        margin-left: 0;
    }

    body[data-course-shell] .course-shell-completion-panel__benefits,
    .edu-course-completion-dialog__metrics {
        grid-template-columns: 1fr;
    }

    body[data-course-shell] .course-shell-completion-inline-status {
        grid-template-columns: 1fr;
        text-align: center;
    }

    body[data-course-shell] .course-shell-completion-inline-status__actions {
        justify-content: center;
    }

    .edu-course-completion-dialog {
        padding-inline: 0.75rem;
    }

    .edu-course-completion-dialog__panel {
        padding: 1rem;
        border-radius: 1.25rem;
    }

    .edu-course-completion-dialog__hero {
        padding-right: 2.1rem;
    }

    .edu-course-completion-dialog__actions {
        flex-direction: column;
    }

    .edu-course-completion-dialog__action {
        width: 100%;
    }

    body[data-course-shell] .course-shell-drawer {
        left: 10px;
        right: 10px;
        width: auto;
        bottom: 10px;
        border-radius: 1.2rem;
    }

    body[data-course-shell] .course-shell-drawer__item {
        grid-template-columns: 42px minmax(0, 1fr);
        padding: 0.75rem 0.8rem;
    }

    body[data-course-shell] .course-shell-drawer__item-index {
        width: 42px;
        height: 42px;
        border-radius: 0.9rem;
    }

    body[data-course-shell] .course-shell-flashcards {
        grid-template-columns: 1fr;
    }

    body[data-course-shell] .course-shell-flashcard,
    body[data-course-shell] .course-shell-flashcard__inner,
    body[data-course-shell] .course-shell-flashcard__face {
        min-height: 208px;
    }

    body[data-course-shell] .course-shell-microcheck__option {
        grid-template-columns: 36px minmax(0, 1fr);
        gap: 0.7rem;
        padding: 0.8rem 0.9rem;
    }

    body[data-course-shell] .course-shell-microcheck__option-key {
        width: 36px;
        height: 36px;
    }
}

@media (prefers-reduced-motion: reduce) {
    body[data-course-shell] .course-shell-topbar,
    body[data-course-shell] .course-shell-stage,
    body[data-course-shell] .course-shell-drawer,
    body[data-course-shell] .course-shell-drawer__item,
    body[data-course-shell] .course-shell-icon-btn,
    body[data-course-shell] .course-shell-back-link,
    body[data-course-shell] .course-shell-review-btn,
    body[data-course-shell] .course-shell-notes-btn,
    body[data-course-shell] .course-shell-bookmark-btn,
    body[data-course-shell] .course-shell-focus-btn,
    body[data-course-shell] .course-shell-flashcard__inner,
    body[data-course-shell] .course-shell-microcheck__option,
    body[data-course-shell] .course-shell-backdrop,
    body[data-course-shell] .course-shell-notes-backdrop,
    body[data-course-shell] .course-shell-notes-sheet,
    body[data-course-shell] .course-shell-notes-action,
    body[data-course-shell] .course-shell-notes-scope__btn,
    .edu-course-completion-dialog__action,
    .edu-course-completion-dialog__panel,
    .edu-course-completion-dialog__backdrop {
        transition: none !important;
    }
}

@media (hover: none) {
    body[data-course-shell] .course-shell-icon-btn:hover,
    body[data-course-shell] .course-shell-back-link:hover,
    body[data-course-shell] .course-shell-review-btn:hover,
    body[data-course-shell] .course-shell-notes-btn:hover,
    body[data-course-shell] .course-shell-bookmark-btn:hover,
    body[data-course-shell] .course-shell-focus-btn:hover,
    body[data-course-shell] .course-shell-theme-btn:hover,
    body[data-course-shell] .course-shell-stage .icon-card:hover,
    body[data-course-shell] .course-shell-stage .card:hover,
    body[data-course-shell] .course-shell-stage .quiz-option:hover {
        transform: none;
        box-shadow: inherit;
    }
}

@supports not (selector(:focus-visible)) {
    body[data-course-shell] .course-shell-icon-btn:focus,
    body[data-course-shell] .course-shell-back-link:focus,
    body[data-course-shell] .course-shell-review-btn:focus,
    body[data-course-shell] .course-shell-notes-btn:focus,
    body[data-course-shell] .course-shell-bookmark-btn:focus,
    body[data-course-shell] .course-shell-focus-btn:focus,
    body[data-course-shell] .course-shell-theme-btn:focus,
    body[data-course-shell] .course-shell-flashcard:focus,
    body[data-course-shell] .course-shell-microcheck__option:focus,
    body[data-course-shell] .course-shell-drawer__item:focus,
    body[data-course-shell] .quiz-option:focus {
        outline: 3px solid rgba(37, 99, 235, 0.48);
        outline-offset: 3px;
    }

    html[data-theme="dark"] body[data-course-shell] .course-shell-icon-btn:focus,
    html[data-theme="dark"] body[data-course-shell] .course-shell-back-link:focus,
    html[data-theme="dark"] body[data-course-shell] .course-shell-review-btn:focus,
    html[data-theme="dark"] body[data-course-shell] .course-shell-notes-btn:focus,
    html[data-theme="dark"] body[data-course-shell] .course-shell-bookmark-btn:focus,
    html[data-theme="dark"] body[data-course-shell] .course-shell-focus-btn:focus,
    html[data-theme="dark"] body[data-course-shell] .course-shell-theme-btn:focus,
    html[data-theme="dark"] body[data-course-shell] .course-shell-flashcard:focus,
    html[data-theme="dark"] body[data-course-shell] .course-shell-microcheck__option:focus,
    html[data-theme="dark"] body[data-course-shell] .course-shell-drawer__item:focus,
    html[data-theme="dark"] body[data-course-shell] .quiz-option:focus {
        outline-color: rgba(125, 211, 252, 0.82);
    }
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    body[data-course-shell] .course-shell-topbar,
    body[data-course-shell] .course-shell-drawer,
    body[data-course-shell] .course-shell-notes-sheet,
    body[data-course-shell] .course-shell-stage .icon-card,
    body[data-course-shell] .course-shell-stage .card,
    body[data-course-shell] .course-shell-stage .highlight-box,
    body[data-course-shell] .course-shell-stage .question-box,
    body[data-course-shell] .course-shell-stage .quiz-question,
    body[data-course-shell] .course-shell-stage .container,
    .edu-course-completion-dialog__backdrop {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    body[data-course-shell] .course-shell-topbar {
        background: #f8fafc !important;
    }

    html[data-theme="dark"] body[data-course-shell] .course-shell-topbar {
        background: #0f172a !important;
    }

    body[data-course-shell] .course-shell-drawer,
    body[data-course-shell] .course-shell-notes-sheet {
        background: #f8fafc !important;
    }

    html[data-theme="dark"] body[data-course-shell] .course-shell-drawer,
    html[data-theme="dark"] body[data-course-shell] .course-shell-notes-sheet {
        background: #111827 !important;
    }

    body[data-course-shell] .course-shell-stage .container {
        background: #ffffff !important;
    }

    html[data-theme="dark"] body[data-course-shell] .course-shell-stage .container {
        background: #0f172a !important;
    }

    body[data-course-shell] .course-shell-stage .icon-card,
    body[data-course-shell] .course-shell-stage .card,
    body[data-course-shell] .course-shell-stage .highlight-box,
    body[data-course-shell] .course-shell-stage .question-box,
    body[data-course-shell] .course-shell-stage .quiz-question {
        background: #f8fafc !important;
    }

    html[data-theme="dark"] body[data-course-shell] .course-shell-stage .icon-card,
    html[data-theme="dark"] body[data-course-shell] .course-shell-stage .card,
    html[data-theme="dark"] body[data-course-shell] .course-shell-stage .highlight-box,
    html[data-theme="dark"] body[data-course-shell] .course-shell-stage .question-box,
    html[data-theme="dark"] body[data-course-shell] .course-shell-stage .quiz-question {
        background: #1e293b !important;
    }

    .edu-course-completion-dialog__backdrop {
        background: rgba(15, 23, 42, 0.72) !important;
    }
}

@supports not (text-wrap: balance) {
    body[data-course-shell] .course-shell-stage .header h1,
    body[data-course-shell] .course-shell-stage .course-header h1,
    body[data-course-shell] .course-shell-stage .slide-title,
    body[data-course-shell] .course-shell-stage .header .course-title {
        max-width: 100%;
        overflow-wrap: anywhere;
    }
}
