/* =========================================================
   style.css — Unified CSS for Pharmacology Course Website
   Collected and deduplicated from all module HTML files.
   ========================================================= */

/* ── RESET ── */
* { box-sizing: border-box; margin: 0; padding: 0; }

/* ── DESIGN TOKENS ── */
:root {
    --bg: #0a0a0f;
    --card: #111118;
    --border: #1e1e2e;
    --border-soft: #16161e;
    --text: #eaeaf5;
    --bright: #ffffff;
    --muted: #9898b8;
    --dim: #5c5c80;
    --purple: #7c3aed;
    --purple-bright: #9d6ff8;
    --purple-dim: rgba(124, 58, 237, 0.1);
    --purple-border: rgba(157, 111, 248, 0.28);
    --topbar-h: 52px;
    --sidebar: #0e0e16;
    --card-hover: #16161f;
    --sub-bg: #0c0c13;
}

/* ── BASE ── */
body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
}

/* ── MODULE PAGE HEADER (sticky) ── */
header {
    background: #0e0e16;
    border-bottom: 1px solid var(--border);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    position: sticky;
    top: 0;
    z-index: 10;
}

.back { font-size: 0.85rem; color: var(--purple-bright); text-decoration: none; font-weight: 500; }
.back:hover { text-decoration: underline; }

.breadcrumb { font-size: 0.85rem; color: var(--dim); }
.breadcrumb span { color: var(--muted); font-weight: 500; }
.breadcrumb a { color: var(--purple-bright); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

/* ── CONTENT AREA ── */
.content { max-width: 720px; margin: 0 auto; padding: 3rem 1.5rem 4rem; }

/* ── MODULE LABEL ── */
.mod-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--purple-bright);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 0.4rem;
}

/* ── TYPOGRAPHY ── */
h1 { font-size: 1.8rem; font-weight: 700; margin-bottom: 0.75rem; color: var(--bright); }

h2 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 2rem 0 0.75rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--border);
    color: var(--bright);
}

h3 { font-size: 0.95rem; font-weight: 600; margin: 1.25rem 0 0.4rem; color: var(--bright); }

p { font-size: 0.93rem; line-height: 1.75; color: var(--text); margin-bottom: 0.85rem; }

ul, ol { padding-left: 1.4rem; margin-bottom: 0.85rem; }
li { font-size: 0.93rem; line-height: 1.75; color: var(--text); margin-bottom: 0.4rem; }
li ul { margin-top: 0.25rem; margin-bottom: 0; }

hr { border: none; border-top: 1px solid var(--border); margin: 2rem 0; }

/* ── MODULE INTRO / NOTE ── */
.mod-intro {
    font-size: 0.9rem;
    color: var(--muted);
    background: rgba(251, 191, 36, 0.07);
    border-left: 3px solid rgba(251, 191, 36, 0.45);
    padding: 0.7rem 1rem;
    margin: 1rem 0 0.75rem;
    border-radius: 0 4px 4px 0;
    line-height: 1.6;
}

.mod-note { font-size: 0.9rem; color: var(--muted); margin-bottom: 2rem; line-height: 1.7; }
.covers { font-size: 0.9rem; color: var(--muted); margin-bottom: 2rem; }

/* ── CALLOUT BOXES ── */
.box { padding: 0.75rem 1rem; border-radius: 0 4px 4px 0; margin: 1rem 0; font-size: 0.9rem; line-height: 1.65; }
.box-note    { background: rgba(96,165,250,0.08); border-left: 3px solid rgba(96,165,250,0.45); color: #93c5fd; }
.box-warning { background: rgba(248,113,113,0.08); border-left: 3px solid rgba(248,113,113,0.45); color: #fca5a5; }
.box-summary { background: rgba(74,222,128,0.07); border-left: 3px solid rgba(74,222,128,0.4); color: #86efac; font-weight: 500; }
.box-intro   { background: rgba(157,111,248,0.07); border-left: 3px solid rgba(157,111,248,0.35); color: #c4b5fd; }
.box-drug    { background: rgba(216,100,255,0.08); border-left: 3px solid rgba(216,100,255,0.45); color: #d8a4ff; }
.box-nerd    { background: rgba(251,191,36,0.07); border-left: 3px solid rgba(251,191,36,0.45); color: #fde68a; }
.box-aside   { background: rgba(157,111,248,0.07); border-left: 3px solid rgba(157,111,248,0.35); color: #c4b5fd; }

.box p { margin: 0; font-size: 0.9rem; color: inherit; }
.box p + p { margin-top: 0.5rem; }
.box strong { color: inherit; }
.box ul { margin: 0.4rem 0 0; padding-left: 1.2rem; }
.box li { font-size: 0.9rem; color: inherit; margin-bottom: 0.3rem; }

/* ── BADGES (unified system) ── */
.badge {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.2rem 0.6rem;
    border-radius: 3px;
}
.badge-purple {
    background: var(--purple-dim);
    color: var(--purple-bright);
    border: 1px solid var(--purple-border);
}
.badge-red {
    background: rgba(248,113,113,0.12);
    color: #f87171;
    border: 1px solid rgba(248,113,113,0.3);
}
.badge-blue {
    background: rgba(96,165,250,0.1);
    color: #93c5fd;
    border: 1px solid rgba(96,165,250,0.3);
}
.badge-green {
    background: rgba(74,222,128,0.08);
    color: #4ade80;
    border: 1px solid rgba(74,222,128,0.3);
}
.badge-amber {
    background: rgba(251,191,36,0.1);
    color: #fbbf24;
    border: 1px solid rgba(251,191,36,0.3);
}

/* ── PART LABEL (legacy, keeps its margin) ── */
.part-label {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    background: var(--purple-dim);
    color: var(--purple-bright);
    border: 1px solid var(--purple-border);
    padding: 0.25rem 0.75rem;
    border-radius: 3px;
    margin: 2rem 0 1.5rem;
}

/* ── IMAGE CAPTION BADGE (unified, replaces loc-label + effect-img-label) ── */
.img-caption-badge {
    display: inline-block;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--purple-bright);
    background: var(--purple-dim);
    border: 1px solid var(--purple-border);
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
    margin-bottom: 0.4rem;
}

/* ── PILLS ── */
.examples { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 2rem; }
.pill {
    font-size: 0.75rem;
    font-weight: 500;
    background: #131318;
    color: var(--muted);
    border: 1px solid #38384e;
    padding: 0.2rem 0.65rem;
    border-radius: 20px;
}

/* ── NEW TAG ── */
.new-tag {
    display: inline-block;
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    background: rgba(74,222,128,0.1);
    color: #4ade80;
    border: 1px solid rgba(74,222,128,0.3);
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    margin-left: 0.4rem;
    vertical-align: middle;
}

/* ── ARROWS ── */
.up { color: #4ade80; font-weight: 700; }
.dn { color: #f87171; font-weight: 700; }

.img-arrow-pair { display: flex; align-items: center; gap: 0.4rem; }
.img-arrow { font-size: 2rem; font-weight: 700; line-height: 1; }
.img-arrow.up { color: #4ade80; }
.img-arrow.dn { color: #f87171; }
.img-arrow.updn { font-size: 1.4rem; display: flex; flex-direction: column; line-height: 1.1; }

.mech-big-arrow { font-size: 2.2rem; line-height: 1; font-weight: 800; }
.mech-big-arrow.dn { color: #f87171; }
.mech-big-arrow.up { color: #4ade80; }

/* ── FIGURES ── */
figure { margin: 1.5rem 0; text-align: center; }
figure img { max-width: 100%; border-radius: 6px; border: 1px solid var(--border); background: #fff; }
figure img[src$=".svg"] { background: #0a0a0f; }
figcaption { font-size: 0.78rem; color: var(--muted); margin-top: 0.4rem; font-style: italic; }

.fig-placeholder {
    border: 1px dashed var(--border);
    border-radius: 6px;
    background: #131318;
    padding: 2rem 1.5rem;
    text-align: center;
    margin: 1.5rem 0;
    color: var(--dim);
    font-size: 0.82rem;
    font-style: italic;
}
.fig-placeholder strong {
    display: block;
    color: var(--muted);
    margin-bottom: 0.3rem;
    font-style: normal;
    font-size: 0.85rem;
}

/* ── IMAGE PAIR (two figures side by side, module2) ── */
.img-pair {
    display: flex;
    gap: 1rem;
    margin: 1.25rem 0;
    align-items: flex-start;
}
.img-pair figure { flex: 1; margin: 0; text-align: center; }
.img-pair figure img { width: 100%; display: block; border: 1px solid #38384e; background: #fff; }

/* ── INFO GRID (replaces region-table/region-row system) ── */
.info-grid { border: 1px solid var(--border); border-radius: 6px; overflow: hidden; margin: 1rem 0; }

.info-row {
    display: grid;
    grid-template-columns: 1fr 1fr 90px;
    gap: 0.75rem;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-soft);
    background: #131318;
}
.info-row:last-child { border-bottom: none; }

.info-row-header {
    background: #0c0c13;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--dim);
}

.info-row-name { font-size: 0.88rem; font-weight: 600; color: var(--bright); line-height: 1.4; }
.info-row-desc { font-size: 0.85rem; color: var(--muted); line-height: 1.5; }

.info-row-thumb img {
    width: 90px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--border);
    display: block;
}

.info-row-emoji { font-size: 2rem; text-align: center; line-height: 1; }

/* 4-column variant: name | receptor/tag | description | thumb */
.info-grid-4col .info-row { grid-template-columns: 1.2fr 80px 2fr 90px; }
.region-receptor { font-size: 0.82rem; color: var(--purple-bright); font-weight: 600; }

/* ── EFFECT BLOCK ── */
.effect-block {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--border-soft);
}
.effect-block:last-child { border-bottom: none; }

.effect-text { flex: 1; }
.effect-text h3 { margin-top: 0; margin-bottom: 0.5rem; font-size: 0.95rem; }
.effect-text p { margin: 0; font-size: 0.9rem; line-height: 1.7; }
.effect-text p + p { margin-top: 0.5rem; }

.effect-img { flex-shrink: 0; width: 105px; text-align: center; }
.effect-img img {
    width: 105px;
    height: 70px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--border);
    display: block;
}

/* ── TYPE BLOCK (modules 6, 7, 7a-d) ── */
.type-block {
    border: 1px solid #38384e;
    border-radius: 6px;
    background: #131318;
    padding: 1rem 1.25rem;
    margin: 1.25rem 0;
}
.type-block h3 { margin-top: 0; color: var(--bright); }

/* Legacy type-label — kept for module7.html risk variant and backward compat */
.type-label {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    background: var(--purple-dim);
    color: var(--purple-bright);
    border: 1px solid var(--purple-border);
    padding: 0.2rem 0.6rem;
    border-radius: 3px;
    margin-bottom: 0.6rem;
}
.type-label.risk {
    background: rgba(248,113,113,0.08);
    color: #fca5a5;
    border-color: rgba(248,113,113,0.3);
}

/* ── RECEPTOR CARDS (module4) ── */
.receptor-list { margin: 1rem 0; }
.receptor-card {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    padding: 0.9rem 1rem;
    background: #131318;
    border: 1px solid var(--border-soft);
    border-radius: 0 4px 4px 0;
    margin-bottom: 0.6rem;
}
.receptor-card.mor { border-left: 3px solid var(--purple-bright); }
.receptor-card.kor { border-left: 3px solid rgba(248,113,113,0.55); }
.receptor-card.dor { border-left: 3px solid rgba(74,222,128,0.45); }

.rec-body { flex: 1; }
.rec-name { font-size: 0.88rem; font-weight: 700; color: var(--bright); margin-bottom: 0.2rem; }
.rec-desc { font-size: 0.85rem; color: var(--muted); line-height: 1.6; }

/* ── OR TABLE (module4 KOR/DOR) ── */
.or-table {
    width: 100%;
    table-layout: fixed;
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    border-collapse: collapse;
    margin: 1rem 0;
}
.or-table th {
    background: #0c0c13;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--dim);
    padding: 0.6rem 0.85rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.or-table th:nth-child(1) { width: 14%; }
.or-table th:nth-child(2) { width: 36%; }
.or-table th:nth-child(3) { width: 50%; }
.or-table td {
    padding: 0.7rem 0.85rem;
    border-bottom: 1px solid var(--border-soft);
    font-size: 0.85rem;
    line-height: 1.55;
    vertical-align: top;
    background: var(--card);
    color: var(--text);
    word-wrap: break-word;
}
.or-table tr:last-child td { border-bottom: none; }

.or-tag {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ── DRUG TYPE CARDS (module4) ── */
.drug-types { margin: 1rem 0; }
.drug-type {
    background: #131318;
    border: 1px solid var(--border-soft);
    border-radius: 6px;
    margin-bottom: 0.75rem;
    overflow: hidden;
}
.dtype-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: #0d0d14;
    border-bottom: 1px solid var(--border-soft);
    flex-wrap: wrap;
}

.dtype-examples { font-size: 0.8rem; color: var(--muted); }
.dtype-body { padding: 1rem; }
.dtype-body p { font-size: 0.88rem; line-height: 1.7; color: var(--text); margin-bottom: 0.6rem; }
.dtype-body p:last-child { margin-bottom: 0; }
.dtype-body ul { margin: 0.35rem 0 0; padding-left: 1.2rem; }
.dtype-body li { font-size: 0.86rem; color: var(--muted); margin-bottom: 0.3rem; }
.dtype-body strong { color: var(--bright); }

/* ── DRUG SECTION (module8) ── */
.drug-section {
    background: #131318;
    border: 1px solid #38384e;
    border-radius: 8px;
    padding: 1.4rem 1.5rem;
    margin-bottom: 1.25rem;
}
.drug-section h2 {
    margin-top: 0;
    font-size: 1rem;
    border-bottom: 1px solid var(--border-soft);
    padding-bottom: 0.4rem;
    margin-bottom: 1rem;
}
.drug-examples { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 1rem; }
.drug-meta {
    font-size: 0.82rem;
    font-weight: 700;
    color: #686880;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.drug-meta:first-of-type { margin-top: 0; }

.se-list { margin: 0.75rem 0 0; }
.se-item {
    padding: 1rem;
    border-left: 2px solid var(--border);
    margin-bottom: 0.75rem;
    background: #131318;
    border-radius: 0 4px 4px 0;
}
.se-item h3 { font-size: 0.9rem; font-weight: 700; color: var(--bright); margin-bottom: 0.3rem; margin-top: 0; }
.se-item p { font-size: 0.87rem; color: var(--muted); line-height: 1.65; margin: 0; }

/* ── ACCORDION (details/summary) ── */
details {
    border: 1px solid var(--border);
    border-radius: 6px;
    margin: 0.75rem 0;
    background: #131318;
}

details summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.1rem;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    list-style: none;
    user-select: none;
    transition: background 0.12s;
}
details summary::-webkit-details-marker { display: none; }
details summary::before {
    content: '›';
    font-size: 1rem;
    color: var(--dim);
    margin-right: 0.6rem;
    transition: transform 0.2s;
    flex-shrink: 0;
}
details[open] summary { border-bottom: 1px solid var(--border-soft); }
details[open] summary::before { transform: rotate(90deg); color: var(--purple-bright); }

.details-body { padding: 1rem 1.1rem; }

/* ── STEP ACCORDION (module7) ── */
.step-details {
    border: 1px solid #38384e;
    border-radius: 8px;
    overflow: hidden;
    margin: 0;
}
.step-details[open] { border-color: var(--purple-border); }

.step-summary {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.1rem;
    cursor: pointer;
    list-style: none;
    user-select: none;
    transition: background 0.12s;
}
.step-summary::-webkit-details-marker { display: none; }
.step-summary:hover { background: rgba(157,111,248,0.05); }
.step-details[open] .step-summary {
    border-bottom: 1px solid var(--border-soft);
    background: rgba(157,111,248,0.05);
}

.step-summary-text { flex: 1; }
.step-summary-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--bright);
    line-height: 1.3;
    margin-bottom: 0.4rem;
}
.step-details[open] .step-summary-title { color: var(--purple-bright); }
.step-summary-blurb { font-size: 0.84rem; color: var(--muted); line-height: 1.6; }

.step-chevron {
    font-size: 0.85rem;
    color: var(--dim);
    padding-top: 0.2rem;
    flex-shrink: 0;
    transition: transform 0.2s;
}
.step-details[open] .step-chevron { transform: rotate(90deg); color: var(--purple-bright); }

.step-body { padding: 1.25rem 1.1rem 1.5rem; }
.step-body p { font-size: 0.93rem; line-height: 1.75; color: var(--text); margin-bottom: 0.85rem; }
.step-body p:last-child { margin-bottom: 0; }
.step-body ul, .step-body ol { padding-left: 1.4rem; margin-bottom: 0.85rem; }
.step-body li { font-size: 0.93rem; line-height: 1.75; color: var(--text); margin-bottom: 0.3rem; }

/* ── DRUG ACCORDION (module5/6) ── */
.drug-accordion { margin: 0.5rem 0; }
.drug-accordion details {
    border: 1px solid #38384e;
    border-radius: 6px;
    background: #131318;
    margin-bottom: 0.45rem;
    overflow: hidden;
}
.drug-accordion details[open] { border-color: var(--purple-border); }
.drug-accordion summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.1rem;
    cursor: pointer;
    list-style: none;
    user-select: none;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--bright);
    transition: background 0.12s;
}
.drug-accordion summary::-webkit-details-marker { display: none; }
.drug-accordion summary::before { display: none; } /* override global ::before */
.drug-accordion summary:hover { background: rgba(157,111,248,0.06); }
.drug-accordion details[open] summary { color: var(--purple-bright); border-bottom: 1px solid var(--border-soft); }
.drug-chevron { font-size: 0.75rem; color: var(--dim); transition: transform 0.2s; }
.drug-accordion details[open] .drug-chevron { transform: rotate(90deg); color: var(--purple-bright); }
.drug-accordion-body { padding: 1rem 1.1rem 1.1rem; }
.drug-accordion-body p { font-size: 0.9rem; line-height: 1.75; color: var(--text); margin-bottom: 0.7rem; }
.drug-accordion-body p:last-child { margin-bottom: 0; }
.drug-note {
    background: rgba(248,113,113,0.07);
    border-left: 3px solid rgba(248,113,113,0.45);
    border-radius: 0 4px 4px 0;
    padding: 0.6rem 0.9rem;
    margin-top: 0.75rem;
    font-size: 0.87rem;
    color: #fca5a5;
    line-height: 1.6;
}

/* ── SOURCES ── */
.sources { padding-left: 0; list-style-position: outside; }
.sources li { font-size: 0.82rem; color: var(--muted); line-height: 1.6; margin-bottom: 0.75rem; padding-left: 2rem; text-indent: -2rem; }

/* ── PAGE NAV ── */
.page-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    gap: 1rem;
}
.page-nav a {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--purple-bright);
    text-decoration: none;
    padding: 0.6rem 1.2rem;
    border: 1px solid var(--purple-border);
    border-radius: 5px;
    transition: background 0.15s, color 0.15s;
}
.page-nav a:hover { background: var(--purple-dim); color: #fff; }
.page-nav .spacer { flex: 1; }

/* ── MODULE 7 — RECEPTOR TABLE ── */
.rec-table { border: 1px solid var(--border); border-radius: 6px; overflow: hidden; margin: 1rem 0; }
.rec-row {
    display: grid;
    grid-template-columns: 80px 120px 1fr 52px;
    gap: 0.75rem;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-soft);
    background: #131318;
}
.rec-row:last-child { border-bottom: none; }
.rec-row.header-row {
    background: #0c0c13;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--dim);
    align-items: center;
}
/* rec-name and rec-desc also used in receptor-card above */
.rec-row .rec-name { font-size: 0.88rem; font-weight: 700; color: var(--purple-bright); line-height: 1.3; }
.rec-row .rec-desc { font-size: 0.82rem; color: var(--muted); line-height: 1.55; }
.rec-emoji { font-size: 1.6rem; text-align: center; line-height: 1; }
.rec-badge {
    display: inline-block;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}
.badge-exc  { background: rgba(74,222,128,0.1);  color: #4ade80;              border: 1px solid rgba(74,222,128,0.3); }
.badge-inh  { background: rgba(96,165,250,0.1);  color: #93c5fd;              border: 1px solid rgba(96,165,250,0.3); }
.badge-mod  { background: rgba(157,111,248,0.1); color: var(--purple-bright); border: 1px solid var(--purple-border); }
.badge-risk { background: rgba(248,113,113,0.1); color: #f87171;              border: 1px solid rgba(248,113,113,0.3); }
.rec-row.risk-row { background: rgba(248,113,113,0.04); }

/* ── SYM TABLE (module 7c — anticholinergic toxidrome) ── */
.sym-table { border: 1px solid var(--border); border-radius: 6px; overflow: hidden; margin: 1rem 0; }
.sym-row {
    display: grid;
    grid-template-columns: 1fr 1.8fr;
    gap: 0.75rem;
    align-items: start;
    padding: 0.7rem 1rem;
    border-bottom: 1px solid var(--border);
}
.sym-row:last-child { border-bottom: none; }
.sym-row.header-row {
    background: rgba(157,111,248,0.07);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--dim);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.5rem 1rem;
    align-items: center;
}
.sym-name { font-size: 0.88rem; font-weight: 600; color: var(--bright); line-height: 1.4; }
.sym-mech { font-size: 0.82rem; color: var(--muted); line-height: 1.55; }
.region-rec { font-size: 0.82rem; color: var(--purple-bright); font-weight: 600; }
.region-thumb-empty { width: 90px; }

/* ── MODULE 7 — DOSE TABLE ── */
.dose-table { border: 1px solid var(--border); border-radius: 6px; overflow: hidden; margin: 1rem 0; }
.dose-row {
    display: grid;
    grid-template-columns: 1fr 1fr 2fr;
    gap: 0.75rem;
    align-items: start;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-soft);
    background: #131318;
}
.dose-row:last-child { border-bottom: none; }
.dose-row.header-row {
    background: #0c0c13;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--dim);
    align-items: center;
}
.dose-row .dose-label { font-size: 0.88rem; font-weight: 600; color: var(--bright); line-height: 1.4; }
.dose-row .dose-occ   { font-size: 0.82rem; color: var(--purple-bright); font-weight: 500; }
.dose-row .dose-desc  { font-size: 0.82rem; color: var(--muted); line-height: 1.55; }

/* ── MODULE 7 — TIMELINE ── */
.timeline { list-style: none; padding-left: 0; margin: 1rem 0; }
.timeline li {
    display: flex;
    gap: 1rem;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--border-soft);
    font-size: 0.93rem;
    color: var(--text);
    margin-bottom: 0;
}
.timeline li:last-child { border-bottom: none; }
.timeline-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--purple-bright);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    min-width: 100px;
    padding-top: 0.1rem;
    line-height: 1.4;
}
.timeline-body { flex: 1; font-size: 0.88rem; color: var(--muted); line-height: 1.7; }

/* ── NEW BADGE (module7a new-badge) ── */
.new-badge {
    display: inline-block;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: rgba(74,222,128,0.12);
    color: #86efac;
    border: 1px solid rgba(74,222,128,0.3);
    padding: 0.1rem 0.45rem;
    border-radius: 3px;
    margin-left: 0.4rem;
    vertical-align: middle;
}

/* ── MODULE 9 — STATS BLOCK ── */
.stat-list { margin: 1rem 0; }
.stat-item {
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-soft);
}
.stat-item:last-child { border-bottom: none; }
.stat-num {
    font-size: 1.3rem;
    font-weight: 700;
    color: #f87171;
    min-width: 3.5rem;
    line-height: 1.2;
    flex-shrink: 0;
}
.stat-desc { font-size: 0.88rem; line-height: 1.65; color: var(--text); }
.stat-desc em { color: var(--muted); font-size: 0.82rem; }

/* ── MODULE 9 — FRAMEWORK GRID ── */
.framework-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.75rem;
    margin: 1.25rem 0;
}
.fw-card { background: #131318; border: 1px solid #38384e; border-radius: 6px; padding: 1rem; }
.fw-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--dim);
    margin-bottom: 0.35rem;
}
.fw-type { font-size: 0.88rem; font-weight: 600; color: var(--bright); margin-bottom: 0.5rem; }
.fw-arrow-row {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
}
.fw-desc { font-size: 0.8rem; color: var(--muted); line-height: 1.55; }

/* ── MODULE 9 — MECHANISM COLLISION ── */
.mech-collision {
    display: flex;
    align-items: stretch;
    gap: 0.75rem;
    margin: 1.5rem 0;
    background: #131318;
    border: 1px solid #38384e;
    border-radius: 8px;
    overflow: hidden;
}
.mech-arm {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.25rem 0.75rem;
    gap: 0.3rem;
    text-align: center;
}
.mech-arm.left  { border-right: 1px solid var(--border-soft); }
.mech-arm.right { border-left: 1px solid var(--border-soft); }
.mech-drug-tag {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--purple-bright);
    background: var(--purple-dim);
    border: 1px solid var(--purple-border);
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    margin-bottom: 0.2rem;
}
.mech-path { font-size: 0.78rem; color: var(--muted); line-height: 1.4; margin-bottom: 0.3rem; }
.mech-effect { font-size: 0.75rem; font-weight: 600; color: #f87171; }
.mech-target {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.25rem 0.75rem;
    gap: 0.4rem;
    min-width: 120px;
}
.mech-target img {
    width: 100px;
    height: 68px;
    object-fit: contain;
    border-radius: 4px;
    border: 1px solid #38384e;
    background: #131318;
}
.mech-target-label { font-size: 0.75rem; font-weight: 600; color: var(--muted); text-align: center; }
.mech-plus {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 800;
    color: #a78bfa;
    flex-shrink: 0;
    padding: 0 0.1rem;
}

/* ── MODULE 9 — MASKING ROW ── */
.masking-row {
    display: flex;
    gap: 0.75rem;
    margin: 1.25rem 0;
    align-items: stretch;
}
.masking-cell {
    flex: 1;
    background: #131318;
    border: 1px solid #38384e;
    border-radius: 6px;
    padding: 0.9rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    text-align: center;
}
.masking-cell img {
    width: 90px;
    height: 60px;
    object-fit: contain;
    border-radius: 4px;
    border: 1px solid #38384e;
    background: #131318;
}
.masking-cell .arrows {
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.05em;
}
.masking-cell .cell-label { font-size: 0.75rem; font-weight: 600; color: var(--bright); }
.masking-cell .cell-note { font-size: 0.72rem; color: var(--muted); line-height: 1.4; }

/* ── MODULE 10 — TOC GRID ── */
.toc-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
    margin: 1.75rem 0 2rem;
}
.toc-card {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 1rem 1.1rem;
    background: #131318;
    border: 1px solid #38384e;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text);
    transition: border-color 0.15s, background 0.12s;
}
.toc-card:hover { border-color: var(--purple-border); background: #13131c; }
.toc-num { font-size: 0.62rem; font-weight: 700; color: var(--dim); min-width: 2rem; }
.toc-info { flex: 1; }
.toc-title { font-size: 0.88rem; font-weight: 600; color: var(--bright); margin-bottom: 0.15rem; }
.toc-sub { font-size: 0.75rem; color: var(--muted); line-height: 1.4; }
.toc-arrow { font-size: 0.75rem; color: var(--dim); }

/* ── MODULE 10 — LAYER LIST ── */
.layer-list { margin: 1rem 0; }
.layer-item {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    padding: 0.9rem 1rem;
    background: var(--card);
    border: 1px solid var(--border-soft);
    border-radius: 0 4px 4px 0;
    margin-bottom: 0.6rem;
}
.layer-item:nth-child(1) { border-left: 3px solid var(--purple-bright); }
.layer-item:nth-child(2) { border-left: 3px solid rgba(96,165,250,0.6); }
.layer-item:nth-child(3) { border-left: 3px solid rgba(74,222,128,0.5); }
.layer-num { font-size: 0.68rem; font-weight: 800; color: var(--dim); min-width: 1.5rem; margin-top: 0.1rem; }
.layer-body { flex: 1; }
.layer-title { font-size: 0.9rem; font-weight: 700; color: var(--bright); margin-bottom: 0.25rem; }
.layer-desc { font-size: 0.85rem; color: var(--muted); line-height: 1.6; }

/* ── MODULE 10 — ADULTERANT TABLE ── */
.adult-table {
    width: 100%;
    table-layout: fixed;
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    border-collapse: collapse;
    margin: 1rem 0;
}
.adult-table th {
    background: #0c0c13;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--dim);
    padding: 0.65rem 0.85rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.adult-table td {
    padding: 0.85rem;
    border-bottom: 1px solid var(--border-soft);
    font-size: 0.87rem;
    line-height: 1.6;
    vertical-align: top;
    background: #131318;
    color: var(--text);
    word-wrap: break-word;
}
.adult-table tr:last-child td { border-bottom: none; }
.adult-name { font-weight: 600; color: var(--bright); }
.adult-name small { display: block; font-size: 0.75rem; font-weight: 400; color: var(--muted); margin-top: 0.15rem; }

/* ── MODULE 10 — ALK TABLE ── */
.alk-table {
    width: 100%;
    table-layout: fixed;
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    border-collapse: collapse;
    margin: 1rem 0;
}
.alk-table th {
    background: #0c0c13;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--dim);
    padding: 0.65rem 0.85rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.alk-table td {
    padding: 0.75rem 0.85rem;
    border-bottom: 1px solid var(--border-soft);
    font-size: 0.85rem;
    line-height: 1.6;
    vertical-align: top;
    background: var(--card);
    color: var(--text);
}
.alk-table tr:last-child td { border-bottom: none; }
.alk-name { font-weight: 600; color: var(--bright); }

/* ── MODULE 10 — COMPARISON TABLE ── */
.cmp-table {
    width: 100%;
    table-layout: fixed;
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    border-collapse: collapse;
    margin: 1rem 0;
}
.cmp-table th {
    background: #0c0c13;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--dim);
    padding: 0.65rem 0.85rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.cmp-table td {
    padding: 0.75rem 0.85rem;
    border-bottom: 1px solid var(--border-soft);
    font-size: 0.85rem;
    line-height: 1.6;
    vertical-align: top;
    background: var(--card);
    color: var(--text);
}
.cmp-table tr:last-child td { border-bottom: none; }
.cmp-table td:first-child { font-weight: 600; color: var(--muted); font-size: 0.82rem; }
.cmp-hi  { color: #f87171; font-weight: 600; }
.cmp-lo  { color: #4ade80; font-weight: 600; }
.cmp-mid { color: #fbbf24; font-weight: 600; }

/* ── MODULE 10 — REAGENT TABLE ── */
.reagent-table {
    width: 100%;
    table-layout: fixed;
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    border-collapse: collapse;
    margin: 1rem 0;
}
.reagent-table th {
    background: #0c0c13;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--dim);
    padding: 0.55rem 0.85rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.reagent-table td {
    padding: 0.65rem 0.85rem;
    border-bottom: 1px solid var(--border-soft);
    font-size: 0.84rem;
    line-height: 1.6;
    vertical-align: top;
    background: var(--card);
    color: var(--text);
}
.reagent-table tr:last-child td { border-bottom: none; }

/* ── MODULE 10 — RISK TABLE (10b) ── */
.risk-table {
    width: 100%;
    table-layout: fixed;
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    border-collapse: collapse;
    margin: 1rem 0;
}
.risk-table th {
    background: #0c0c13;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--dim);
    padding: 0.6rem 0.85rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.risk-table th:nth-child(1) { width: 58%; }
.risk-table th:nth-child(2) { width: 42%; }
.risk-table td {
    padding: 0.7rem 0.85rem;
    border-bottom: 1px solid var(--border-soft);
    font-size: 0.86rem;
    line-height: 1.5;
    vertical-align: middle;
    background: var(--card);
    color: var(--text);
    word-wrap: break-word;
}
.risk-table tr:last-child td { border-bottom: none; }
.risk-table tr.highlight td { background: rgba(157,111,248,0.06); }
.subst-name { font-weight: 600; color: var(--bright); }
.risk-num { font-weight: 700; font-size: 0.97rem; }
.risk-hi  { color: #f87171; }
.risk-mid { color: #fbbf24; }
.risk-lo  { color: #4ade80; }

/* ── MODULE 10 — PROBABILITY BADGES ── */
.prob {
    display: inline-block;
    padding: 0.18rem 0.55rem;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: normal;
}
.prob-vh  { background: rgba(248,113,113,0.2);  color: #fca5a5; border: 1px solid rgba(248,113,113,0.3); }
.prob-hi  { background: rgba(248,113,113,0.12); color: #fca5a5; border: 1px solid rgba(248,113,113,0.2); }
.prob-mod { background: rgba(251,191,36,0.12);  color: #fde68a; border: 1px solid rgba(251,191,36,0.2); }
.prob-lo  { background: rgba(96,165,250,0.1);   color: #93c5fd; border: 1px solid rgba(96,165,250,0.2); }
.prob-vlo { background: rgba(74,222,128,0.08);  color: #86efac; border: 1px solid rgba(74,222,128,0.2); }
.prob-em  { background: rgba(192,132,252,0.1);  color: #d8b4fe; border: 1px solid rgba(192,132,252,0.2); }

/* ── MODULE 10 — COMPOUND CARDS ── */
.compound {
    background: var(--card);
    border: 1px solid var(--border-soft);
    border-left: 3px solid var(--dim);
    border-radius: 0 4px 4px 0;
    padding: 0.9rem 1rem;
    margin-bottom: 0.65rem;
}
.compound.lead      { border-left-color: var(--purple-bright); }
.compound.coact,
.compound.coactive  { border-left-color: rgba(248,113,113,0.6); }
.compound.minor     { border-left-color: rgba(74,222,128,0.4); }
.compound.mod       { border-left-color: rgba(96,165,250,0.6); }
.compound.modulator { border-left-color: rgba(251,191,36,0.5); }
.compound-name { font-size: 0.9rem; font-weight: 700; color: var(--bright); margin-bottom: 0.2rem; }
.compound-role {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #686880;
    margin-bottom: 0.3rem;
}
.compound-desc { font-size: 0.87rem; color: var(--muted); line-height: 1.65; }
.compound-desc li { font-size: 0.87rem; color: var(--muted); }

/* ── MODULE 10 — COMPARE GRID ── */
.compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.65rem; margin: 1rem 0; }
.compare-col { background: var(--card); border: 1px solid var(--border); border-radius: 6px; padding: 1rem; }
.compare-col h3 { font-size: 0.82rem; margin-top: 0; margin-bottom: 0.5rem; }
.compare-col li { font-size: 0.84rem; color: var(--muted); margin-bottom: 0.3rem; }
.compare-col ul { margin: 0; }
.col-danger { border-top: 3px solid rgba(248,113,113,0.5); }
.col-safer  { border-top: 3px solid rgba(74,222,128,0.4); }

/* ── MODULE 10 — ERA GRID ── */
.era-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0.65rem; margin: 1rem 0; }
.era-card { background: var(--card); border: 1px solid var(--border); border-radius: 6px; padding: 0.9rem; }
.era-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #686880;
    margin-bottom: 0.3rem;
}
.era-thc { font-size: 1.6rem; font-weight: 800; line-height: 1; margin-bottom: 0.3rem; }
.era-desc { font-size: 0.78rem; color: var(--muted); line-height: 1.5; }

/* ── MODULE 10 — PURITY BARS ── */
.purity-bar { margin: 1.25rem 0; }
.purity-row { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.5rem; }
.purity-label { font-size: 0.82rem; color: var(--muted); min-width: 180px; }
.purity-track { flex: 1; height: 10px; background: var(--border); border-radius: 5px; overflow: hidden; }
.purity-fill { height: 100%; border-radius: 5px; }
.purity-pct { font-size: 0.78rem; font-weight: 700; color: var(--muted); min-width: 3.5rem; text-align: right; }

/* ── MODULE 10 — PATTERN GRID ── */
.pattern-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0.65rem; margin: 1rem 0; }
.pattern-card { background: var(--card); border: 1px solid var(--border); border-radius: 6px; padding: 0.85rem; }
.pattern-icon { font-size: 1.3rem; margin-bottom: 0.35rem; }
.pattern-label { font-size: 0.78rem; font-weight: 700; color: var(--bright); margin-bottom: 0.3rem; }
.pattern-desc { font-size: 0.78rem; color: var(--muted); line-height: 1.5; }

/* Pattern note (10b) — flex card with badge */
.pattern-note {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    padding: 1rem;
    background: var(--card);
    border: 1px solid var(--border-soft);
    border-radius: 4px;
    margin-bottom: 0.6rem;
}
.pattern-badge {
    flex-shrink: 0;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 0.3rem 0.55rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
}
.pattern-body { flex: 1; font-size: 0.88rem; line-height: 1.65; color: var(--text); }
.pattern-body strong { color: var(--bright); }

/* ── MODULE 10 — DIFF LIST ── */
.diff-list { margin: 1rem 0; }
.diff-item {
    display: flex;
    gap: 1rem;
    padding: 0.9rem 1rem;
    background: var(--card);
    border: 1px solid var(--border-soft);
    border-radius: 4px;
    margin-bottom: 0.6rem;
}
.diff-num { font-size: 0.72rem; font-weight: 800; color: var(--purple-bright); min-width: 1.5rem; margin-top: 0.1rem; }
.diff-body { flex: 1; }
.diff-title { font-size: 0.9rem; font-weight: 700; color: var(--bright); margin-bottom: 0.2rem; }
.diff-desc { font-size: 0.86rem; color: var(--muted); line-height: 1.6; }

/* ── MODULE 10b — SUMMARY LIST ── */
.summary-list { margin: 1rem 0; }
.summary-item {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    padding: 0.9rem 1rem;
    background: var(--card);
    border: 1px solid var(--border-soft);
    border-radius: 4px;
    margin-bottom: 0.5rem;
}
.sum-num { font-size: 0.7rem; font-weight: 800; color: var(--purple-bright); min-width: 1.4rem; margin-top: 0.15rem; }
.sum-body { flex: 1; }
.sum-title { font-size: 0.9rem; font-weight: 700; color: var(--bright); margin-bottom: 0.2rem; }
.sum-desc { font-size: 0.86rem; color: var(--muted); line-height: 1.6; }

/* ── MODULE 10b — IMAGE PLACEHOLDER ── */
.img-placeholder {
    background: rgba(157,111,248,0.04);
    border: 1px dashed rgba(157,111,248,0.3);
    border-radius: 6px;
    padding: 2rem 1.5rem;
    text-align: center;
    margin: 1.25rem 0;
}
.img-placeholder .ph-icon { font-size: 1.4rem; margin-bottom: 0.4rem; }
.img-placeholder .ph-label { font-size: 0.78rem; color: #686880; margin-top: 0.3rem; line-height: 1.55; max-width: 480px; margin-left: auto; margin-right: auto; }
.img-placeholder .ph-name { font-size: 0.85rem; font-weight: 600; color: var(--muted); }

/* ── COLOR SWATCH ── */
.color-swatch {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 3px;
    margin-right: 0.35rem;
    vertical-align: middle;
}

/* ─────────────────────────────────────────────
   COURSE.HTML — Sidebar + Main layout
   ───────────────────────────────────────────── */
html, body { height: 100%; }

/* course.html overrides body to flex */
body.course-layout {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── TOPBAR ── */
.topbar {
    height: var(--topbar-h);
    background: var(--sidebar);
    border-bottom: 1px solid var(--border);
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.9rem;
    position: sticky;
    top: 0;
    z-index: 100;
    flex-shrink: 0;
}

.logo {
    width: 30px;
    height: 30px;
    background: var(--purple);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
    letter-spacing: -0.02em;
}

.topbar-info { flex: 1; }
.topbar-title { font-size: 0.88rem; font-weight: 600; color: var(--text); line-height: 1.2; }
.topbar-meta { font-size: 0.72rem; color: #686880; margin-top: 0.1rem; }

.topbar-home {
    font-size: 0.8rem;
    color: var(--muted);
    text-decoration: none;
    font-weight: 500;
    padding: 0.4rem 0.8rem;
    border: 1px solid #38384e;
    border-radius: 5px;
    transition: color 0.15s, border-color 0.15s;
}
.topbar-home:hover { color: var(--purple-bright); border-color: var(--purple-border); }

/* ── LAYOUT ── */
.layout { display: flex; flex: 1; overflow: hidden; }

/* ── SIDEBAR ── */
.sidebar {
    width: 260px;
    min-width: 260px;
    background: var(--sidebar);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    position: sticky;
    top: var(--topbar-h);
    height: calc(100vh - var(--topbar-h));
    padding: 0.75rem 0.75rem 2rem;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.nav-section { border: 1px solid #2a2a3e; border-radius: 6px; overflow: hidden; margin-bottom: 0.75rem; }

.nav-group-label {
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--dim);
    padding: 0.6rem 1rem 0.35rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 1rem;
    text-decoration: none;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 500;
    border-left: 2px solid #3a3a56;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
    line-height: 1.3;
}
.nav-link:hover { background: rgba(255,255,255,0.04); color: var(--text); border-left-color: #6060a0; }
.nav-link.active { background: rgba(255,255,255,0.05); color: var(--purple-bright); border-left-color: var(--purple); font-weight: 600; }

.nav-num { font-size: 0.62rem; font-weight: 700; color: var(--dim); min-width: 1.4rem; font-variant-numeric: tabular-nums; }

.nav-sub {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.42rem 1rem 0.42rem 2.65rem;
    text-decoration: none;
    color: var(--dim);
    font-size: 0.77rem;
    font-weight: 400;
    border-left: 2px solid #2e2e48;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.nav-sub:hover { background: rgba(255,255,255,0.04); color: var(--muted); border-left-color: #5050a0; }

.nav-sub-header {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.5rem 1rem 0.5rem 1.65rem;
    text-decoration: none;
    color: var(--text);
    font-size: 0.82rem;
    font-weight: 600;
    border-left: 2px solid #4a4a6a;
    background: rgba(255,255,255,0.02);
    transition: background 0.12s, color 0.12s, border-color 0.12s;
    margin-top: 0.15rem;
}
.nav-sub-header .nav-num { color: var(--purple-bright); }
.nav-sub-header:hover { background: rgba(255,255,255,0.05); border-left-color: var(--purple-bright); }
.nav-sub-header.active { color: var(--purple-bright); border-left-color: var(--purple); background: rgba(255,255,255,0.05); }

.nav-subsub {
    display: flex;
    align-items: center;
    padding: 0.36rem 1rem 0.36rem 3.5rem;
    text-decoration: none;
    color: var(--dim);
    font-size: 0.74rem;
    font-weight: 400;
    border-left: 2px solid #252538;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.nav-subsub:hover { background: rgba(255,255,255,0.03); color: var(--muted); border-left-color: #5050a0; }
.nav-subsub.active { color: var(--purple-bright); background: rgba(255,255,255,0.04); border-left-color: var(--purple); }

.nav-divider { display: none; }

/* ── MAIN AREA ── */
.main { flex: 1; overflow-y: auto; padding: 2.5rem 3rem 4rem; }

.page-eyebrow {
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--purple-bright);
    margin-bottom: 0.5rem;
}

.page-title { font-size: 1.7rem; font-weight: 700; color: var(--text); margin-bottom: 0.6rem; line-height: 1.2; }
.page-sub { font-size: 0.88rem; color: var(--muted); line-height: 1.75; margin-bottom: 2rem; max-width: 480px; }

/* Formula card */
.formula-card {
    background: #131318;
    border: 1px solid #38384e;
    border-left: 3px solid var(--purple);
    border-radius: 0 8px 8px 0;
    padding: 1.1rem 1.4rem;
    margin-bottom: 2.5rem;
}
.formula-label {
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--purple-bright);
    margin-bottom: 0.45rem;
}
.formula-text { font-size: 0.88rem; font-weight: 600; color: var(--text); letter-spacing: 0.01em; }
.formula-text .accent { color: var(--purple-bright); }

/* Section headers */
.section-head {
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--dim);
    margin: 2rem 0 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-soft);
}

/* Module cards */
.mod-card {
    background: #131318;
    border: 1px solid #38384e;
    border-radius: 8px;
    margin-bottom: 0.45rem;
    overflow: hidden;
    transition: border-color 0.15s;
}
.mod-card:hover { border-color: var(--purple-border); }

.mod-link {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.85rem 1.1rem;
    text-decoration: none;
    color: var(--text);
    transition: background 0.12s;
}
.mod-link:hover { background: var(--card-hover); }

.mod-num { font-size: 0.65rem; font-weight: 700; color: var(--dim); min-width: 1.6rem; font-variant-numeric: tabular-nums; }
.mod-title { font-size: 0.88rem; font-weight: 600; flex: 1; color: var(--text); }

.mod-badge {
    font-size: 0.62rem;
    font-weight: 700;
    background: var(--purple-dim);
    color: var(--purple-bright);
    border: 1px solid var(--purple-border);
    padding: 0.18rem 0.55rem;
    border-radius: 20px;
    letter-spacing: 0.03em;
}

.mod-arrow { font-size: 0.75rem; color: var(--dim); }

/* Submodule rows */
.sub-link {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.6rem 1.1rem 0.6rem 2.7rem;
    text-decoration: none;
    color: var(--muted);
    border-top: 1px solid var(--border-soft);
    background: var(--sub-bg);
    font-size: 0.82rem;
    transition: background 0.12s, color 0.12s;
}
.sub-link:hover { background: var(--purple-dim); color: var(--text); }
.sub-num { font-size: 0.62rem; font-weight: 700; color: var(--dim); min-width: 1.6rem; }
.sub-title { flex: 1; font-size: 0.82rem; font-weight: 500; }

/* ─────────────────────────────────────────────
   INDEX.HTML — Landing page
   ───────────────────────────────────────────── */

/* Three-section grid */
.sections { flex: 1; min-height: 0; display: grid; grid-template-rows: 1fr 1fr 1fr; }

.sec {
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    border-bottom: 1px solid var(--border);
}
.sec:last-child { border-bottom: none; }

.sec-inner { max-width: 620px; margin: 0 auto; width: 100%; padding: 0 2.5rem; }

/* TOP */
.course-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.7rem;
}
.course-tag {
    display: inline-block;
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--purple-bright);
    background: var(--purple-dim);
    border: 1px solid var(--purple-border);
    padding: 0.2rem 0.55rem;
    border-radius: 3px;
}
.course-title { font-size: 2.2rem; font-weight: 700; color: var(--text); line-height: 1.1; margin-bottom: 0.6rem; }
.course-tagline {
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--purple-bright);
    margin-bottom: 0.4rem;
}
.course-tags { margin-bottom: 1.3rem; }

.btn-start {
    display: inline-block;
    background: var(--purple);
    color: #fff;
    font-size: 0.92rem;
    font-weight: 700;
    padding: 0.75rem 1.9rem;
    border-radius: 6px;
    text-decoration: none;
    letter-spacing: 0.02em;
    transition: background 0.18s, transform 0.1s;
}
.btn-start:hover { background: #ab82ef; transform: translateY(-1px); }

/* MIDDLE */
.col-label { font-size: 0.85rem; font-weight: 600; color: var(--muted); margin-bottom: 0.75rem; }

.goal-list { list-style: none; padding: 0; margin: 0 0 1.25rem; }
.goal-item {
    display: flex;
    gap: 0.6rem;
    align-items: flex-start;
    font-size: 0.88rem;
    color: var(--muted);
    line-height: 1.55;
    margin-bottom: 0.55rem;
}
.goal-item:last-child { margin-bottom: 0; }
.goal-dot { color: var(--purple-bright); font-weight: 700; flex-shrink: 0; }
.goal-text { flex: 1; }
.goal-continuation {
    display: block;
    color: #686882;
    font-size: 0.82rem;
    margin-top: 0.1rem;
    padding-left: 0.55rem;
    border-left: 1px solid var(--border);
}

/* Learning objectives table */
.obj-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 1.25rem;
}
.obj-table tr {
    border-bottom: 1px solid var(--border-soft);
}
.obj-table tr:last-child { border-bottom: none; }
.obj-num {
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    color: var(--purple-bright);
    opacity: 0.6;
    padding: 0.7rem 1rem 0.7rem 0;
    vertical-align: top;
    white-space: nowrap;
}
.obj-text {
    font-size: 0.88rem;
    color: var(--muted);
    line-height: 1.55;
    padding: 0.7rem 0;
}
.obj-em {
    color: var(--text);
    font-weight: 600;
}

.formula {
    background: #131318;
    border-left: 3px solid var(--purple);
    padding: 0.65rem 1rem;
    border-radius: 0 5px 5px 0;
    font-size: 0.82rem;
    color: var(--muted);
    font-weight: 600;
    letter-spacing: 0.01em;
}
.formula .accent { color: var(--purple-bright); }

/* BOTTOM */
.module-cols { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0.55rem; margin-bottom: 0.7rem; }

.mod-block {
    background: #131318;
    border: 1px solid #38384e;
    border-radius: 6px;
    padding: 0.75rem 0.9rem;
}
.mod-range {
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--purple-bright);
    margin-bottom: 0.2rem;
}
.mod-name { font-size: 0.82rem; font-weight: 600; color: var(--text); margin-bottom: 0.3rem; }
.mod-desc { font-size: 0.74rem; color: var(--dim); line-height: 1.5; }
.submod-note { font-size: 0.75rem; color: var(--dim); font-style: italic; }

/* Footer */
footer {
    min-height: 54px;
    height: auto;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.85rem 2.5rem;
    flex-shrink: 0;
}

.landing-disclaimer-text {
    font-size: 0.72rem;
    color: var(--dim);
    line-height: 1.65;
    text-align: center;
    max-width: 580px;
    margin: 0;
}

/* ── SITE FOOTER (course.html, aboutme.html) ── */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 0.65rem 1.5rem;
    font-size: 0.72rem;
    color: var(--dim);
    text-align: center;
    background: var(--bg);
    line-height: 1.5;
}
.site-footer a {
    color: var(--purple-bright);
    text-decoration: none;
    margin-left: 0.25rem;
}
.site-footer a:hover { text-decoration: underline; }

.footer-btn-group { display: flex; border: 1px solid #38384e; border-radius: 6px; overflow: hidden; }
.footer-btn {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--muted);
    text-decoration: none;
    padding: 0.45rem 1.2rem;
    border-right: 1px solid var(--border);
    transition: color 0.15s, background 0.15s;
}
.footer-btn:last-child { border-right: none; }
.footer-btn:hover { color: var(--purple-bright); background: var(--purple-dim); }

/* ── COLLAPSIBLE VIDEO ── */
.video-details {
    margin: 1.25rem 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    background: var(--card);
}
.video-details summary {
    display: block;
    padding: 0.7rem 1rem;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--purple-bright);
    list-style: none;
    user-select: none;
    transition: background 0.15s;
}
.video-details summary::-webkit-details-marker { display: none; }
.video-details summary::before {
    content: '▶';
    font-size: 0.6rem;
    display: inline-block;
    margin-right: 0.5rem;
    transition: transform 0.2s;
    opacity: 0.7;
    vertical-align: middle;
}
.video-details[open] summary::before {
    transform: rotate(90deg);
}
.video-details summary:hover {
    background: var(--purple-dim);
}
.video-details summary .yt-link {
    font-size: 0.75rem;
    font-weight: 400;
    opacity: 0.55;
    color: inherit;
    text-decoration: none;
    margin-left: 0.5rem;
    pointer-events: all;
}
.video-details summary .yt-link:hover {
    opacity: 1;
    text-decoration: underline;
}

/* ── VIDEO EMBED (responsive 16:9) ── */
.video-wrap {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    margin: 0;
    overflow: hidden;
}
.video-wrap iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}
.video-details .video-wrap {
    border-top: 1px solid var(--border);
}

/* ─────────────────────────────────────────────
   MEDIA QUERIES
   ───────────────────────────────────────────── */

/* course.html sidebar collapse */
@media (max-width: 768px) {
    .sidebar { display: none; }
    .main { padding: 1.5rem 1.25rem; }
}

/* Tables, effect images, info grid collapse */
@media (max-width: 640px) {
    .info-row { grid-template-columns: 1fr 1fr; }
    .info-row-thumb { display: none; }
    .dose-row { grid-template-columns: 1fr 2fr; }
    .dose-row .dose-occ { display: none; }
    .effect-img { display: none; }
    .rec-row { grid-template-columns: 70px 1fr 40px; }
    .rec-row .rec-badge { display: none; }
}

/* Info grid, effect img, module9 collapse */
@media (max-width: 560px) {
    .info-row { grid-template-columns: 1fr 1fr; }
    .info-row-thumb { display: none; }
    .info-row-emoji { display: none; }
    .effect-img { display: none; }
    .framework-grid { grid-template-columns: 1fr; }
    .mech-collision { flex-direction: column; }
    .mech-arm.left { border-right: none; border-bottom: 1px solid var(--border-soft); }
    .mech-arm.right { border-left: none; border-top: 1px solid var(--border-soft); }
    .mech-plus { font-size: 1.1rem; padding: 0.1rem 0; }
    .masking-row { flex-direction: column; }
    .adult-table th:nth-child(3),
    .adult-table td:nth-child(3) { display: none; }
}

/* img-pair stacks */
@media (max-width: 500px) {
    .img-pair { flex-direction: column; }
    .toc-grid { grid-template-columns: 1fr; }
    .pattern-grid { grid-template-columns: 1fr; }
}

/* index.html mobile */
@media (max-width: 640px) {
    html, body { height: auto; overflow: auto; }
    .sections { display: flex; flex-direction: column; }
    .sec { padding: 2.5rem 0; border-bottom: 1px solid var(--border); min-height: 0; }
    .sec-inner { padding: 0 1.5rem; }
    .module-cols { grid-template-columns: 1fr; }
    footer { padding: 0 1.5rem; }
}
