/* =========================================================
   System Design Elite — Complete Stylesheet
   ========================================================= */

:root {
    --page-bg: #ffffff;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --surface-hover: #f1f5f9;
    --border: #e2e8f0;
    --border-soft: #edf2f7;

    --text: #0f172a;
    --text-soft: #334155;
    --text-muted: #64748b;

    --blue: #0284c7;
    --blue-hover: #0369a1;
    --green: #15803d;
    --red: #cf222e;
    --yellow: #9a6700;

    --diagram-bg: #0b1220;
    --diagram-panel: #17243a;
    --diagram-border: #30415f;
    --diagram-text: #e6edf7;
    --diagram-line: #9fb0c8;

    --sidebar-width: 300px;
    --content-width: 1080px;
    --toc-width: 230px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --shadow-soft: 0 10px 28px rgba(15, 23, 42, 0.06);

    --font-sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
}

/* ---------- Reset and document ---------- */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    text-size-adjust: 100%;
}

body {
    margin: 0;
    color: var(--text);
    background: var(--page-bg);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

img,
svg,
video,
canvas {
    max-width: 100%;
}

button,
input,
select,
textarea {
    font: inherit;
}

a {
    color: var(--blue);
}

a:hover {
    color: var(--blue-hover);
}

/* ---------- App layout ---------- */

.app-container {
    display: flex;
    min-height: 100vh;
}

.content-wrapper {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.reader-layout {
    width: 100%;
    max-width: calc(var(--content-width) + var(--toc-width) + 144px);
    margin-inline: auto;
    display: grid;
    grid-template-columns: minmax(0, calc(var(--content-width) + 80px)) var(--toc-width);
    align-items: start;
    gap: 32px;
}

/* ---------- App Header (Web Component & Standard) ---------- */

app-header {
    display: block;
    position: sticky;
    top: 0;
    z-index: 50;
    background: #ffffff;
}

.app-header {
    height: 64px;
    background: #ffffff;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 20px;
}

.brand-title {
    font-weight: 800;
    font-size: 17px;
    color: var(--text);
    text-decoration: none;
    letter-spacing: -0.01em;
}

.header-nav {
    display: flex;
    gap: 16px;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    transition: color 0.15s;
}

.nav-link:hover, .nav-link.active {
    color: var(--text);
}

.btn-login {
    background: var(--blue);
    color: #ffffff;
    border: none;
    padding: 7px 18px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-login:hover {
    background: var(--blue-hover);
}

/* ---------- App Sidebar (Web Component & Accordion UI) ---------- */

app-sidebar {
    position: sticky;
    top: 64px;
    width: var(--sidebar-width);
    height: calc(100vh - 64px);
    flex-shrink: 0;
    overflow-y: auto;
    border-right: 1px solid var(--border);
    background: #ffffff;
    scrollbar-width: thin;
    z-index: 10;
}

.sidebar-nav-container {
    padding: 20px 16px;
}

.sidebar-overview-link {
    margin-bottom: 14px;
}

.sidebar-overview-link a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-soft);
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 150ms ease, color 150ms ease;
}

.sidebar-overview-link a:hover {
    background: var(--surface-hover);
    color: var(--text);
}

.sidebar-overview-link.active a {
    background: var(--surface-hover);
    color: var(--text);
    border-color: #cbd5e1;
}

.overview-icon {
    font-size: 1rem;
    color: var(--blue);
}

.sidebar-course-title {
    margin-bottom: 16px;
    padding: 0 4px;
}

.sidebar-course-title a {
    display: block;
    color: var(--text);
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-decoration: none;
    line-height: 1.35;
}

.sidebar-course-title a:hover {
    color: var(--blue);
}

/* Module Container */
.sidebar-modules {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-module {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #ffffff;
    overflow: hidden;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.sidebar-module.is-expanded {
    border-color: #cbd5e1;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

/* Module Header Trigger */
.sidebar-module-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--surface-soft);
    border: none;
    cursor: pointer;
    text-align: left;
    transition: background-color 0.15s ease;
}

.sidebar-module-toggle:hover {
    background: var(--surface-hover);
}

.sidebar-module.is-expanded .sidebar-module-toggle {
    background: var(--surface-hover);
    border-bottom: 1px solid var(--border);
}

.sidebar-module-title {
    color: var(--text);
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.3;
}

.sidebar-module-chevron {
    color: var(--text-muted);
    font-size: 0.8rem;
    transition: transform 0.2s ease;
    margin-left: 8px;
    flex-shrink: 0;
}

/* Lesson Items List */
.sidebar-lessons {
    margin: 0;
    padding: 4px 0;
    list-style: none;
    background: #ffffff;
}

.sidebar-lessons[hidden] {
    display: none;
}

.sidebar-lesson-item {
    margin: 0;
}

.sidebar-lesson-item a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px 7px 16px;
    color: var(--text-soft);
    font-size: 0.82rem;
    line-height: 1.4;
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.sidebar-lesson-item a:hover {
    background: var(--surface-soft);
    color: var(--blue);
}

.sidebar-lesson-item.active a {
    background: #f0fdf4;
    color: var(--green);
    font-weight: 700;
    border-left-color: #16a34a;
}

.lesson-status-icon {
    font-size: 0.8rem;
    opacity: 0.75;
    flex-shrink: 0;
}

.lesson-label {
    flex: 1;
    white-space: normal;
    word-break: break-word;
}

.sidebar-lesson-item.locked-item a {
    color: #475569;
}

.sidebar-lesson-item.locked-item a:hover {
    color: var(--blue);
}

/* Legacy .sidebar classes fallback */
.sidebar {
    position: sticky;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    flex-shrink: 0;
    overflow-y: auto;
    padding: 36px 22px;
    border-right: 1px solid var(--border);
    background: var(--surface-soft);
    scrollbar-width: thin;
}

.sidebar h2 {
    margin: 0 0 8px;
    color: var(--text);
    font-size: 1.25rem;
    line-height: 1.25;
}

.sidebar h3 {
    margin: 0 0 14px;
    color: var(--text);
    font-size: 0.95rem;
}

.sidebar hr {
    margin: 26px 0;
    border: 0;
    border-top: 1px solid var(--border);
}

/* ---------- Header and user profile ---------- */

.top-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-height: 68px;
    padding: 14px 48px;
    border-bottom: 1px solid var(--border-soft);
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(10px);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 11px;
}

.user-avatar {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    border-radius: 50%;
    color: #ffffff;
    background: var(--blue);
    font-size: 0.95rem;
    font-weight: 700;
}

.user-info {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.user-name {
    color: var(--text);
    font-size: 0.88rem;
    font-weight: 700;
}

.user-email {
    color: var(--text-muted);
    font-size: 0.78rem;
}

/* ---------- Main page ---------- */

.main-content {
    width: 100%;
    min-width: 0;
    padding: 48px 40px 80px;
}

.lesson-toc {
    position: sticky;
    top: 82px;
    min-width: 0;
    padding: 48px 20px 40px 0;
}

.lesson-toc[hidden] {
    display: none;
}

.lesson-toc-inner {
    max-height: calc(100vh - 122px);
    overflow-y: auto;
    padding-left: 18px;
    border-left: 1px solid var(--border);
    scrollbar-width: thin;
}

.lesson-toc-title {
    margin-bottom: 10px;
    color: var(--text);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.055em;
    text-transform: uppercase;
}

.lesson-toc-link {
    width: 100%;
    display: block;
    padding: 5px 0;
    border: 0;
    color: var(--text-muted);
    background: transparent;
    cursor: pointer;
    font-size: 0.82rem;
    line-height: 1.38;
    text-align: left;
    transition: color 160ms ease;
}

.lesson-toc-link:hover,
.lesson-toc-link.active {
    color: var(--blue);
}

.lesson-toc-link.active {
    font-weight: 700;
}

.lesson-toc-link.level-3 {
    padding-left: 12px;
    font-size: 0.78rem;
}

.breadcrumb {
    display: block;
    margin-bottom: 22px;
    color: var(--text-muted);
    font-size: 0.84rem;
}

h1,
h2,
h3,
h4 {
    color: var(--text);
    line-height: 1.25;
    text-wrap: balance;
}

h1 {
    margin: 0 0 16px;
    font-size: clamp(2rem, 4vw, 2.5rem);
    letter-spacing: -0.035em;
}

p.intro {
    max-width: 720px;
    margin: 0 0 26px;
    color: #424a53;
    font-size: 1.07rem;
    line-height: 1.7;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 9px 18px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: #ffffff;
    background: var(--blue);
    font-size: 0.93rem;
    font-weight: 700;
    text-decoration: none;
    transition: background-color 160ms ease, transform 160ms ease;
}

.button:hover {
    color: #ffffff;
    background: var(--blue-hover);
    transform: translateY(-1px);
}

/* ---------- General accordion ---------- */

.accordion-item {
    padding: 16px 0;
    border-bottom: 1px solid var(--border-soft);
}

.accordion-item:first-of-type {
    border-top: 1px solid var(--border-soft);
}

.accordion-item summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    color: var(--text);
    cursor: pointer;
    font-size: 1.05rem;
    font-weight: 700;
    list-style: none;
}

.accordion-item summary::-webkit-details-marker {
    display: none;
}

.accordion-item summary::after {
    content: "+";
    color: var(--text-muted);
    font-size: 1.35rem;
    font-weight: 400;
}

.accordion-item[open] summary::after {
    content: "−";
}

.accordion-content {
    padding-top: 12px;
}

.accordion-content p {
    margin: 0 0 16px;
    color: var(--text-soft);
    font-size: 0.95rem;
    line-height: 1.65;
}

.lesson-link {
    color: var(--blue);
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
}

.lesson-link:hover {
    text-decoration: underline;
}

/* ---------- Lesson article ---------- */

.lesson-article {
    width: 100%;
    max-width: var(--content-width);
    margin-inline: auto;
}

.lesson-article h2,
.lesson-article h3 {
    scroll-margin-top: 88px;
}

.lesson-article h1 {
    margin-bottom: 18px;
}

.lesson-article h2 {
    margin: 44px 0 16px;
    padding-top: 4px;
    color: var(--text);
    font-size: clamp(1.4rem, 2vw, 1.65rem);
    letter-spacing: -0.02em;
}

.lesson-article h3 {
    margin: 30px 0 12px;
    color: var(--text);
    font-size: 1.2rem;
}

.lesson-article h4 {
    margin: 24px 0 10px;
    font-size: 1.05rem;
}

.lesson-article p,
.lesson-article ul,
.lesson-article ol {
    color: #334155;
    font-size: 1rem;
    line-height: 1.72;
}

.lesson-article p {
    margin: 0 0 20px;
}

.lesson-article ul,
.lesson-article ol {
    margin: 0 0 22px;
    padding-left: 26px;
}

.lesson-article li {
    margin-bottom: 7px;
}

.lesson-article strong {
    color: #0f172a;
    font-weight: 750;
}

.lesson-article blockquote {
    margin: 22px 0;
    padding: 14px 18px;
    border-left: 4px solid var(--blue);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    color: #334155;
    background: #eef5ff;
}

.lesson-article blockquote p:last-child {
    margin-bottom: 0;
}

.lesson-article hr {
    margin: 36px 0;
    border: 0;
    border-top: 1px solid var(--border-soft);
}

/* ---------- Tables ---------- */

.lesson-article table {
    width: 100%;
    margin: 22px 0 28px;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    font-size: 0.94rem;
}

.lesson-article th,
.lesson-article td {
    padding: 12px 14px;
    border-right: 1px solid var(--border-soft);
    border-bottom: 1px solid var(--border-soft);
    text-align: left;
    vertical-align: top;
}

.lesson-article th {
    color: var(--text);
    background: var(--surface-soft);
    font-weight: 750;
}

.lesson-article tr:last-child td {
    border-bottom: 0;
}

.lesson-article th:last-child,
.lesson-article td:last-child {
    border-right: 0;
}

/* ---------- Code ---------- */

.lesson-article :not(pre) > code {
    padding: 0.16em 0.4em;
    border: 1px solid var(--border-soft);
    border-radius: 5px;
    color: #1f2328;
    background: var(--surface-soft);
    font-family: var(--font-mono);
    font-size: 0.88em;
}

.lesson-article pre {
    margin: 22px 0;
    padding: 18px 20px;
    overflow-x: auto;
    border: 1px solid #263449;
    border-radius: var(--radius-md);
    color: #e6edf7;
    background: #0d1525;
    box-shadow: var(--shadow-soft);
    tab-size: 4;
}

.lesson-article pre code {
    color: inherit;
    background: transparent;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    line-height: 1.65;
    white-space: pre;
}

/* ---------- Missing page ---------- */

.missing-state {
    margin-top: 40px;
    text-align: left;
}

.missing-icon {
    margin-bottom: 16px;
    font-size: 3rem;
}

/* ---------- Paywalled Content for Google Indexing & Security ---------- */

.paywalled-container {
    position: relative;
    min-height: 300px;
    margin-top: 28px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #f8fafc;
}

.paywalled-content.is-locked {
    min-height: 300px;
    padding: 30px;
    box-sizing: border-box;
    user-select: none;
    pointer-events: none;
    filter: blur(7px);
    opacity: 0.35;
}


.paywall-overlay-gate {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 28px;
    box-sizing: border-box;
    background:
            linear-gradient(90deg, rgba(248, 250, 252, 0.95), rgba(255, 255, 255, 0.50), rgba(248, 250, 252, 0.95)),
            linear-gradient(180deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.92));
}


.paywall-modal-box {
    width: min(620px, 100%);
    padding: 30px 34px;
    box-sizing: border-box;
    text-align: center;
    border: 1px solid #dbeafe;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
}

.paywall-modal-box .locked-course-icon {
    margin: 0 0 10px;
    font-size: 2rem;
}


.paywall-modal-box h4 {
    margin: 0 0 8px;
    color: #0f172a;
    font-size: 1.1rem;
    font-weight: 800;
}

.paywall-modal-box p {
    margin: 0 auto 18px;
    color: #64748b;
    font-size: 0.92rem;
    line-height: 1.55;
}

.btn-unlock {
    min-width: 170px;
    padding: 11px 22px;
    border: 0;
    border-radius: 8px;
    background: #0284c7;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 750;
    cursor: pointer;
}

.btn-unlock:hover {
    background: #0369a1;
}


@media (max-width: 640px) {
    .paywalled-container,
    .paywalled-content.is-locked {
        min-height: 330px;
    }

    .paywall-modal-box {
        padding: 26px 20px;
    }
}

/* ---------- Reusable animation container ---------- */

.protected-media {
    position: relative;
    width: 100%;
    max-width: 640px;
    height: 250px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 30px 0;
    padding: 0 50px;
    overflow: hidden;
    border: 1px solid var(--diagram-border);
    border-radius: var(--radius-lg);
    color: var(--diagram-text);
    background: linear-gradient(145deg, var(--diagram-panel), var(--diagram-bg));
    user-select: none;
    -webkit-user-drag: none;
}

.protection-overlay {
    position: absolute;
    inset: 0;
    z-index: 10;
    cursor: default;
}

.anim-node {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    border: 1px solid #475569;
    border-radius: 12px;
    color: #ffffff;
    background: #1e293b;
    font-size: 0.88rem;
    font-weight: 700;
}

.anim-server {
    border-radius: 50%;
    background: var(--blue);
}

.anim-packet {
    position: absolute;
    top: 50%;
    width: 15px;
    height: 15px;
    margin-top: -7.5px;
    border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 12px rgba(52, 211, 153, 0.7);
    animation: transferData 2s infinite ease-in-out;
}

@keyframes transferData {
    0% {
        left: 130px;
        opacity: 0;
        transform: scale(0.5);
    }
    15%,
    85% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        left: calc(100% - 130px);
        opacity: 0;
        transform: scale(0.5);
    }
}

/* ---------- Mermaid ---------- */

.mermaid {
    width: 100%;
    min-height: 180px;
    margin: 26px 0 30px;
    padding: 28px;
    overflow-x: auto;
    border: 1px solid var(--diagram-border);
    border-radius: var(--radius-lg);
    color: var(--diagram-text);
    background: var(--diagram-bg);
    text-align: center;
    box-shadow: var(--shadow-soft);
}

.mermaid svg {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    margin-inline: auto;
}

.mermaid text,
.mermaid .nodeLabel,
.mermaid .edgeLabel,
.mermaid .cluster-label {
    font-family: var(--font-sans) !important;
}

.mermaid .node.root .nodeLabel,
.mermaid .node.root text,
.mermaid .node.root tspan,
.mermaid .root .nodeLabel,
.mermaid .root text,
.mermaid .root tspan {
    color: #e6edf7 !important;
    fill: #e6edf7 !important;
}

.mermaid .edgeLabel,
.mermaid .edgeLabel span,
.mermaid .edgeLabel p {
    color: var(--diagram-text) !important;
}

.mermaid .edgeLabel text,
.mermaid .edgeLabel tspan {
    fill: var(--diagram-text) !important;
}

.mermaid .edgeLabel rect,
.mermaid .labelBkg {
    fill: var(--diagram-bg) !important;
    opacity: 0.96 !important;
}

.mermaid .cluster-label,
.mermaid .cluster-label span {
    color: var(--diagram-text) !important;
}

.mermaid .cluster-label text,
.mermaid .cluster-label tspan {
    fill: var(--diagram-text) !important;
}

.mermaid .flowchart-link {
    stroke: var(--diagram-line) !important;
}

.mermaid marker path {
    fill: var(--diagram-line) !important;
    stroke: var(--diagram-line) !important;
}

/* ---------- Nomnoml ---------- */

.nomnoml-canvas {
    display: block;
    width: 100%;
    max-width: 100%;
    min-height: 180px;
    height: auto;
    margin: 26px 0 30px;
    padding: 28px;
    overflow-x: auto;
    border: 1px solid var(--diagram-border);
    border-radius: var(--radius-lg);
    color: var(--diagram-text);
    background: var(--diagram-bg);
    box-shadow: var(--shadow-soft);
}

.nomnoml-canvas svg {
    display: block;
    max-width: 100%;
    height: auto;
    margin-inline: auto;
}

/* ---------- Errors and focus ---------- */

.render-error {
    margin: 24px 0;
    padding: 16px 18px;
    border: 1px solid #ffb3ba;
    border-radius: var(--radius-md);
    color: #82071e;
    background: #ffebe9;
}

:focus-visible {
    outline: 3px solid rgba(9, 105, 218, 0.35);
    outline-offset: 2px;
}

/* ---------- Responsive layout ---------- */

@media (max-width: 980px) {
    :root {
        --sidebar-width: 260px;
    }

    .top-header {
        padding-inline: 30px;
    }

    .main-content {
        padding: 40px 34px 72px;
    }
}

@media (max-width: 1480px) {
    .reader-layout {
        display: block;
        max-width: calc(var(--content-width) + 80px);
    }

    .lesson-toc {
        display: none !important;
    }
}

@media (max-width: 760px) {
    .app-container {
        display: block;
    }

    app-sidebar,
    .sidebar {
        position: relative;
        top: 0;
        width: 100%;
        height: auto;
        max-height: none;
        padding: 16px;
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .top-header {
        position: relative;
        min-height: 60px;
        padding: 12px 20px;
    }

    .main-content {
        width: 100%;
        padding: 32px 20px 60px;
    }

    .reader-layout {
        display: block;
        max-width: none;
    }

    .lesson-article table {
        display: block;
        max-width: 100%;
        overflow-x: auto;
        white-space: nowrap;
    }

    .protected-media {
        min-height: 220px;
        height: auto;
        padding: 30px 20px;
    }

    .mermaid,
    .nomnoml-canvas {
        padding: 18px;
    }

    .mermaid svg {
        min-width: 580px;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 15px;
    }

    .user-email {
        display: none;
    }

    .main-content {
        padding-inline: 16px;
    }

    .lesson-article h2 {
        margin-top: 36px;
    }

    .lesson-article pre {
        padding: 15px;
    }
}

/* ---------- Motion accessibility ---------- */

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ---------- Print ---------- */

@media print {
    app-sidebar,
    .sidebar,
    .top-header,
    .app-header,
    .lesson-toc {
        display: none !important;
    }

    .main-content,
    .lesson-article {
        width: 100%;
        max-width: none;
        padding: 0;
    }

    .mermaid,
    .nomnoml-canvas,
    .protected-media,
    .lesson-article pre {
        break-inside: avoid;
        box-shadow: none;
    }
}
[data-enc-src] {
    opacity: 0.2;
    min-height: 120px;
    background: var(--surface-soft);
    border-radius: var(--radius-sm);
    transition: opacity 0.2s ease-in-out;
}

/* ---------- Course pricing & referral code ---------- */

.course-pricing-section { margin-top: 42px; }
.course-pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
}
.course-price-card {
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: var(--shadow-soft);
}
.course-price-card h3 { margin-top: 0; }
.course-price-line { display: flex; align-items: baseline; gap: 10px; margin: 16px 0 4px; }
.old-course-price { color: var(--text-muted); text-decoration: line-through; }
.current-course-price { font-size: 1.75rem; color: var(--text); }
.course-discount-label { color: #1a7f37; font-weight: 650; margin-top: 4px; }
.referral-apply-row { display: flex; gap: 8px; margin-top: 20px; }
.referral-code-input {
    flex: 1;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    text-transform: uppercase;
}
.apply-referral-btn {
    padding: 10px 16px;
    border: 0;
    border-radius: var(--radius-sm);
    background: var(--blue);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}
.apply-referral-btn:disabled { opacity: 0.55; cursor: wait; }
.referral-result { min-height: 22px; margin: 10px 0 0; font-size: 0.9rem; }
.referral-result.success { color: #1a7f37; }
.referral-result.error { color: #cf222e; }
.pricing-unavailable { color: var(--text-muted); }

/* ---------- Locked lesson purchase experience ---------- */

.sidebar-coming-soon-badge {
    display: inline-flex;
    margin-left: 6px;
    padding: 2px 7px;
    border: 1px solid #ffd8a8;
    border-radius: 999px;
    background: #fff4e6;
    color: #a64b00;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    vertical-align: middle;
}
.sidebar-lesson-list li a.coming-soon-link { color: #6e7781; }

.coming-soon-state {
    position: relative;
    max-width: 760px;
    margin: 54px auto;
    padding: 58px 54px;
    overflow: hidden;
    text-align: center;
    border: 1px solid #c9ddff;
    border-radius: 24px;
    background:
            radial-gradient(circle at 50% 0%, rgba(9, 105, 218, 0.13), transparent 44%),
            linear-gradient(145deg, #ffffff, #f5f9ff);
    box-shadow: 0 24px 70px rgba(31, 91, 168, 0.14);
}
.coming-soon-orbit {
    position: relative;
    width: 112px;
    height: 112px;
    margin: 0 auto 24px;
}
.coming-soon-orbit::before,
.coming-soon-orbit::after {
    content: '';
    position: absolute;
    inset: 8px;
    border: 1px solid rgba(9, 105, 218, 0.28);
    border-radius: 50%;
}
.coming-soon-orbit::after { inset: 22px; border-style: dashed; }
.coming-soon-orbit > span {
    position: absolute;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--blue);
    box-shadow: 0 0 16px rgba(9, 105, 218, 0.6);
}
.coming-soon-orbit > span:nth-child(1) { top: 8px; left: 52px; }
.coming-soon-orbit > span:nth-child(2) { right: 8px; bottom: 27px; }
.coming-soon-orbit > span:nth-child(3) { left: 12px; bottom: 22px; }
.coming-soon-icon {
    position: absolute;
    inset: 31px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--blue);
    color: #fff;
    font-size: 1.8rem;
    box-shadow: 0 12px 28px rgba(9, 105, 218, 0.3);
}
.coming-soon-eyebrow {
    margin: 0 0 10px;
    color: var(--blue);
    font-size: 0.78rem;
    font-weight: 850;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}
.coming-soon-state h1 { margin: 0; font-size: clamp(2rem, 5vw, 3.25rem); line-height: 1.12; }
.coming-soon-copy { max-width: 590px; margin: 20px auto 26px; color: var(--text-soft); font-size: 1.05rem; line-height: 1.75; }
.coming-soon-note {
    display: inline-flex;
    flex-direction: column;
    gap: 3px;
    padding: 13px 20px;
    border: 1px solid #ffd8a8;
    border-radius: 12px;
    background: #fff8f0;
    color: #6b3b12;
}
.coming-soon-note strong { color: #a64b00; }
.coming-soon-note span { font-size: 0.88rem; }
.coming-soon-back {
    display: block;
    width: fit-content;
    margin: 28px auto 0;
    color: var(--blue);
    font-weight: 750;
    text-decoration: none;
}
.coming-soon-back:hover { text-decoration: underline; }

.locked-course-state {
    max-width: 660px;
    margin: 70px auto;
    padding: 48px;
    text-align: center;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: linear-gradient(145deg, #ffffff, #f6f9ff);
    box-shadow: var(--shadow-soft);
}
.locked-course-icon { font-size: 3.2rem; }
.locked-course-eyebrow, .purchase-modal-eyebrow {
    margin: 14px 0 6px;
    color: var(--blue);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}
.locked-course-state h1 { margin: 0; font-size: clamp(1.8rem, 4vw, 2.5rem); }
.locked-course-state > p:not(.locked-course-eyebrow) { color: var(--text-soft); }
.locked-course-buy-button, .purchase-primary-button {
    border: 0;
    border-radius: var(--radius-sm);
    background: var(--blue);
    color: #fff;
    font-weight: 750;
    cursor: pointer;
}
.locked-course-buy-button { margin-top: 12px; padding: 12px 26px; }

.purchase-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(9, 18, 36, 0.68);
    backdrop-filter: blur(8px);
}
.purchase-modal {
    position: relative;
    width: min(760px, 100%);
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    padding: 38px;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.28);
}
.purchase-modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    background: var(--surface-soft);
    color: var(--text);
    font-size: 1.6rem;
    cursor: pointer;
}
.purchase-modal h2 { margin: 4px 42px 8px 0; font-size: clamp(1.8rem, 4vw, 2.4rem); }
.purchase-modal-copy { color: var(--text-soft); }
.purchase-social-proof { color: var(--green); font-weight: 700; }
.purchase-options { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 28px; }
.purchase-option-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 240px;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
}
.purchase-option-card.featured { border: 2px solid var(--blue); background: #f6f9ff; }
.purchase-option-label { color: var(--text-muted); font-size: 0.78rem; font-weight: 750; text-transform: uppercase; }
.purchase-option-card h3 { margin: 10px 0; }
.purchase-option-price { margin-bottom: 24px; font-size: 1.8rem; }
.purchase-primary-button { width: 100%; margin-top: auto; padding: 12px 16px; }
.purchase-best-value {
    position: absolute;
    top: -12px;
    right: 16px;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--blue);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
}
.purchase-modal-note { margin: 18px 0 0; color: var(--text-muted); text-align: center; font-size: 0.85rem; }

@media (max-width: 640px) {
    .purchase-options { grid-template-columns: 1fr; }
    .purchase-modal { padding: 28px 20px; }
    .locked-course-state { margin: 30px auto; padding: 32px 20px; }
    .coming-soon-state { margin: 24px auto; padding: 40px 20px; }
}

/* Simple launch overview */
.simple-overview { max-width: 780px; padding: 24px 0 8px; }
.simple-overview h1 { margin: 0; color: #24292e; font-size: clamp(2.35rem,5vw,4rem); line-height: 1.08; letter-spacing: -.045em; }
.simple-overview > p:not(.overview-eyebrow) { max-width: 680px; margin: 22px 0 0; color: #586574; font-size: 1.05rem; line-height: 1.7; }
.simple-overview-points { display: flex; flex-wrap: wrap; gap: 9px 22px; margin-top: 22px; color: #526174; font-size: .88rem; font-weight: 700; }
.simple-overview-points span::before { content: '✓'; margin-right: 7px; color: #0875df; }
.simple-overview + .course-pricing-section { margin-top: 38px; }
@media (max-width: 640px) { .simple-overview { padding-top: 8px; } }
dialog#authDialog { width:min(420px,calc(100% - 32px)); border:0; border-radius:18px; padding:28px; box-shadow:0 24px 80px rgba(15,23,42,.35); }
dialog#authDialog::backdrop { background:rgba(15,23,42,.6); backdrop-filter:blur(4px); }
#authDialog label { display:grid; gap:7px; margin:14px 0; font-weight:650; }
#authDialog input { padding:12px; border:1px solid #cbd5e1; border-radius:9px; font:inherit; }
.auth-close { float:right; }.auth-close button { border:0; background:none; font-size:26px; cursor:pointer; }
#authDialog [hidden] { display:none !important; }

.profile-page { max-width:920px; margin:0 auto; }
.profile-hero { display:flex; align-items:center; gap:20px; padding:28px; border-radius:18px; background:linear-gradient(135deg,#071a38,#0c4a8f); color:#fff; box-shadow:0 18px 45px rgba(3,102,214,.18); }
.profile-hero h1,.profile-hero p { margin:3px 0; color:inherit; }
.profile-eyebrow { text-transform:uppercase; letter-spacing:.12em; font-size:.75rem; opacity:.72; font-weight:800; }
.profile-avatar { width:68px; height:68px; display:grid; place-items:center; flex:0 0 auto; border-radius:50%; background:#38bdf8; color:#082f49; font-size:1.8rem; font-weight:900; box-shadow:0 0 30px rgba(56,189,248,.55); }
.profile-summary { width:max-content; display:flex; align-items:center; gap:10px; margin:24px 0; padding:14px 20px; border:1px solid #dbeafe; border-radius:12px; background:#f0f7ff; color:#1e3a5f; }
.profile-summary strong { font-size:1.5rem; color:#0366d6; }
.purchase-history { display:grid; gap:14px; }
.purchase-history-card { display:flex; justify-content:space-between; align-items:center; gap:24px; padding:22px; border:1px solid #e2e8f0; border-radius:14px; background:#fff; box-shadow:0 8px 24px rgba(15,23,42,.05); }
.purchase-history-card h3 { margin:8px 0 4px; }
.purchase-history-card p,.purchase-history-card small { margin:0; color:#64748b; }
.paid-badge { display:inline-block; padding:4px 9px; border-radius:999px; background:#dcfce7; color:#15803d; font-size:.72rem; font-weight:800; text-transform:uppercase; }
.purchase-history-actions { display:flex; flex-direction:column; align-items:flex-end; gap:12px; }
.receipt-download { border:0; border-radius:8px; padding:10px 14px; background:#0366d6; color:#fff; font-weight:750; cursor:pointer; }
.receipt-download:disabled { opacity:.6; cursor:wait; }
.buy-course-btn { width:100%; margin-top:14px; padding:11px 14px; border:0; border-radius:9px; background:linear-gradient(135deg,#0366d6,#0ea5e9); color:#fff; font-weight:800; cursor:pointer; box-shadow:0 8px 20px rgba(3,102,214,.2); }
.empty-purchases { padding:34px; text-align:center; border:1px dashed #cbd5e1; border-radius:14px; color:#64748b; }
@media (max-width:700px) { .purchase-history-card { align-items:flex-start; flex-direction:column; } .purchase-history-actions { align-items:flex-start; } }
.auth-google { width:100%; min-height:44px; display:flex; align-items:center; justify-content:center; margin-top:20px; overflow:hidden; }
.auth-google > div,.auth-google iframe { max-width:100%; }
.auth-divider { display:flex; align-items:center; gap:12px; margin:18px 0 4px; color:#94a3b8; font-size:.82rem; }
.auth-divider::before,.auth-divider::after { content:""; height:1px; flex:1; background:#e2e8f0; }
.auth-primary { width:100%; padding:12px; border:0; border-radius:9px; background:#0366d6; color:white; font-weight:750; cursor:pointer; }
.auth-switch { width:100%; border:0; background:none; color:#0366d6; cursor:pointer; }.auth-status.error{color:#b91c1c}.auth-status.success{color:#047857}
.course-price-card[tabindex] { cursor:pointer; }
.course-module-overview { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:16px; margin-top:28px; }
.course-module-card { padding:20px; border:1px solid #dbe4ef; border-radius:14px; background:white; }

/* Click/tap zoom for lesson images */
.lesson-zoomable-image { cursor:zoom-in; transition:transform 180ms ease,box-shadow 180ms ease; }
.lesson-zoomable-image:hover { transform:translateY(-2px); box-shadow:0 14px 32px rgba(15,23,42,.16); }
.lesson-zoomable-image:focus-visible { outline:3px solid #60a5fa; outline-offset:4px; }
.lesson-media-modal-open { overflow:hidden; }
.lesson-media-lightbox { position:fixed; inset:0; z-index:20000; display:none; grid-template-rows:auto 1fr auto; gap:12px; padding:18px; background:rgba(2,6,23,.94); backdrop-filter:blur(10px); }
.lesson-media-lightbox.is-open { display:grid; }
.lesson-media-toolbar { justify-self:center; display:flex; align-items:center; gap:8px; padding:7px; border:1px solid rgba(148,163,184,.28); border-radius:12px; background:rgba(15,23,42,.92); box-shadow:0 12px 40px rgba(0,0,0,.32); }
.lesson-media-toolbar button { min-width:40px; height:38px; padding:0 12px; border:1px solid #334155; border-radius:8px; background:#1e293b; color:#f8fafc; font:700 .9rem/1 Inter,system-ui,sans-serif; cursor:pointer; }
.lesson-media-toolbar button:hover { background:#334155; }
.lesson-media-zoom-value { min-width:58px; color:#cbd5e1; text-align:center; font:700 .78rem Inter,system-ui,sans-serif; }
.lesson-media-stage { min-height:0; display:grid; place-items:center; overflow:hidden; touch-action:none; }
.lesson-media-lightbox-image { display:block; max-width:min(96vw,1800px); max-height:calc(100vh - 145px); object-fit:contain; user-select:none; transform-origin:center; transition:transform 100ms ease-out; cursor:zoom-in; }
.lesson-media-lightbox-image.is-zoomed { cursor:grab; transition:none; }
.lesson-media-lightbox-image.is-zoomed:active { cursor:grabbing; }
.lesson-media-hint { color:#94a3b8; text-align:center; font-size:.76rem; }
.lesson-playable-video { display:block; width:100%; max-width:100%; background:#020617; border-radius:12px; }
@media(max-width:640px){.lesson-media-lightbox{padding:10px}.lesson-media-toolbar{width:100%;justify-content:center}.lesson-media-toolbar button{min-width:36px;padding:0 9px}.lesson-media-lightbox-image{max-width:100%;max-height:calc(100vh - 135px)}.lesson-media-hint{font-size:.7rem}}

/* ---------- Final launch overview ---------- */
.overview-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr);
    gap: 52px;
    align-items: center;
    padding: 52px;
    overflow: hidden;
    border: 1px solid #d8e5f5;
    border-radius: 24px;
    background:
            radial-gradient(circle at 92% 8%, rgba(56,189,248,.18), transparent 32%),
            linear-gradient(135deg, #f8fbff 0%, #eef6ff 56%, #f7fbff 100%);
    box-shadow: 0 22px 60px rgba(30,64,175,.1);
}
.overview-eyebrow { margin: 0 0 14px; color: #0366d6; font-size: .75rem; font-weight: 850; letter-spacing: .16em; text-transform: uppercase; }
.overview-hero h1 { margin: 0; color: #172033; font-size: clamp(2.65rem,5vw,4.7rem); line-height: .98; letter-spacing: -.055em; }
.overview-hero h1 span { color: #0879e8; }
.overview-lead { max-width: 690px; margin: 26px 0 0; color: #536174; font-size: 1.08rem; line-height: 1.75; }
.overview-actions { display: flex; align-items: center; gap: 18px; margin-top: 30px; color: #657386; font-size: .84rem; }
.overview-primary-action { display: inline-flex; padding: 12px 18px; border-radius: 10px; background: #0875df; color: #fff; font-weight: 800; text-decoration: none; box-shadow: 0 10px 24px rgba(3,102,214,.22); }
.overview-visual { padding: 22px; border: 1px solid rgba(147,197,253,.55); border-radius: 20px; background: rgba(255,255,255,.76); box-shadow: 0 18px 40px rgba(15,23,42,.08); backdrop-filter: blur(12px); }
.visual-node { display: grid; grid-template-columns: 38px 1fr; column-gap: 12px; padding: 15px; border: 1px solid #dce8f6; border-radius: 13px; background: #fff; }
.visual-node span { grid-row: 1 / 3; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: #eaf4ff; color: #0875df; font-size: .72rem; font-weight: 900; }
.visual-node strong { color: #253246; font-size: .94rem; }
.visual-node small { margin-top: 4px; color: #78869a; }
.visual-node-two { border-color: #a9d4ff; box-shadow: 0 9px 24px rgba(3,102,214,.08); }
.visual-connector { width: 2px; height: 18px; margin-left: 40px; background: linear-gradient(#93c5fd,#38bdf8); }
.overview-pillars { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; margin: 24px 0 48px; }
.overview-pillars article { display: flex; gap: 15px; padding: 22px; border: 1px solid #e1e8f0; border-radius: 16px; background: #fff; }
.overview-pillars article > span { display: grid; place-items: center; flex: 0 0 38px; height: 38px; border-radius: 10px; background: #edf6ff; color: #0875df; font-weight: 900; }
.overview-pillars h2 { margin: 0 0 7px; color: #253246; font-size: 1rem; }
.overview-pillars p { margin: 0; color: #68778a; font-size: .87rem; line-height: 1.55; }

/* ---------- Company and payment-policy pages ---------- */
.legal-page { max-width: 820px; margin: 20px auto 70px; padding: 46px 50px; border: 1px solid #dce5ef; border-radius: 20px; background: #fff; box-shadow: 0 18px 50px rgba(15,23,42,.07); }
.legal-page > h1 { margin: 0 0 28px; color: #1e293b; font-size: clamp(2rem,4vw,3rem); letter-spacing: -.035em; }
.legal-page-body { color: #536174; font-size: 1rem; line-height: 1.8; }
.legal-page-body h2 { margin: 30px 0 8px; color: #26364a; font-size: 1.15rem; }
.legal-page-body a { color: #0366d6; font-weight: 700; }
.legal-highlight { display: flex; flex-direction: column; gap: 5px; margin: 24px 0; padding: 20px; border-left: 4px solid #1683ea; border-radius: 0 12px 12px 0; background: #f1f7ff; }
.site-footer { display: grid; grid-template-columns: 1fr auto; gap: 16px 36px; padding: 32px clamp(24px,5vw,72px); border-top: 1px solid #e1e8f0; background: #f8fafc; color: #66758a; }
.site-footer > div { display: flex; flex-direction: column; gap: 5px; }
.site-footer strong { color: #1e293b; font-size: 1.05rem; }
.site-footer nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px 20px; }
.site-footer a { color: #526174; font-size: .84rem; font-weight: 700; text-decoration: none; }
.site-footer a:hover { color: #0366d6; }
.site-footer small { grid-column: 1 / -1; font-size: .76rem; }

@media (max-width: 900px) {
    .overview-hero { grid-template-columns: 1fr; padding: 38px; }
    .overview-pillars { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .overview-hero { padding: 30px 22px; border-radius: 18px; }
    .overview-actions { align-items: flex-start; flex-direction: column; }
    .overview-visual { padding: 14px; }
    .legal-page { padding: 32px 22px; }
    .site-footer { grid-template-columns: 1fr; }
    .site-footer nav { justify-content: flex-start; }
    .site-footer small { grid-column: auto; }
}
/* Sidebar Course Header & Accordion Trigger */
.sidebar-course-card {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #ffffff;
    overflow: hidden;
    margin-top: 10px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
    transition: border-color 0.15s ease;
}

.sidebar-course-card.is-open {
    border-color: #cbd5e1;
}

.sidebar-course-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: #f8fafc;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s ease;
}

.sidebar-course-toggle:hover {
    background: #f1f5f9;
}

.sidebar-course-title {
    font-size: 13px;
    font-weight: 800;
    color: #0f172a;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1.35;
}

/* Chevron Rotation */
.sidebar-chevron {
    font-size: 12px;
    color: #64748b;
    transition: transform 0.2s ease;
    flex-shrink: 0;
    margin-left: 8px;
}

.sidebar-chevron.open {
    transform: rotate(180deg);
}

/* Module Group inside Course */
.sidebar-modules {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 8px;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
}

.sidebar-module {
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #ffffff;
    overflow: hidden;
    transition: border-color 0.15s ease;
}

.sidebar-module.is-expanded {
    border-color: #cbd5e1;
}

.sidebar-module-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: #f8fafc;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s ease;
}

.sidebar-module-toggle:hover {
    background: #f1f5f9;
}

.sidebar-module.is-expanded .sidebar-module-toggle {
    background: #f1f5f9;
    border-bottom: 1px solid #e2e8f0;
}

.sidebar-module-title {
    font-size: 12.5px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.3;
}

/* Chapter / Lesson List */
.sidebar-lessons {
    list-style: none;
    margin: 0;
    padding: 4px 0;
    background: #ffffff;
}

.sidebar-lesson-item a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px 7px 16px;
    color: #334155;
    font-size: 12px;
    line-height: 1.4;
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: all 0.15s ease;
}

.sidebar-lesson-item a:hover {
    background: #f8fafc;
    color: #0284c7;
}

.sidebar-lesson-item.active a {
    background: #f0fdf4;
    color: #15803d;
    font-weight: 700;
    border-left-color: #16a34a;
}

/* Slightly larger active sidebar */
app-sidebar {
    width: 352px !important;
    min-width: 352px !important;
    max-width: 352px !important;
}

.sidebar-nav-container {
    padding: 22px 18px;
}

.sidebar-overview-link a {
    padding: 10px 14px;
    font-size: 0.96rem;
}

.sidebar-course-title,
.sidebar-module-title {
    font-size: 0.95rem;
}

.sidebar-lesson-item a {
    padding-block: 8px;
    font-size: 0.9rem;
}
