/* Shared chrome for the standalone lesson pages.
   Extracted 2026-07-31 from eight identical copies. Linked
   before each page's own <style>, so page rules still win. */

:root {
            --primary: #155724;
            --primary-light: #1a6b2e;
            --accent: #28a745;
            --accent-light: #34c759;
            --secondary: #003399;
            --secondary-light: #0044cc;
            --text: #1a1a2e;
            --text-light: #555;
            --text-muted: #888;
            --bg: #f4f6f3;
            --bg-card: #ffffff;
            --border: #e2e8e0;
            --border-light: #f0f2ef;
            --foundation: #155724;
            --intermediate: #b35f00;
            --phd: #003399;
            --g1: #28a745;
            --g2: #e68a00;
            --g3: #003399;
            --shadow-sm: 0 1px 3px rgba(21,87,36,0.06);
            --shadow-md: 0 4px 12px rgba(21,87,36,0.08);
            --shadow-lg: 0 8px 24px rgba(21,87,36,0.10);
            --shadow-hover: 0 8px 28px rgba(21,87,36,0.14);
            --radius: 10px;
            --radius-sm: 6px;
            --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
        }

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

body { font-family: 'Inter', sans-serif; line-height: 1.6; color: var(--text); font-size: 13px; background: var(--bg); -webkit-font-smoothing: antialiased; }

.skip-link { position: absolute; top: -100%; left: 1rem; background: var(--primary); color: white; padding: 0.5rem 1rem; border-radius: var(--radius-sm); font-size: 0.85rem; font-weight: 600; z-index: 9999; text-decoration: none; }

.skip-link:focus { top: 0.5rem; }

/* ── NAV ── */
        .nav { position: sticky; top: 0; z-index: 100; background: var(--primary); color: #fff; display: flex; align-items: center; padding: 0 1.5rem; height: 44px; }

.nav-title { font-weight: 700; font-size: 14px; white-space: nowrap; }

.nav-links { margin-left: auto; display: flex; gap: 1.2rem; }

.nav-links a { color: rgba(255,255,255,0.85); text-decoration: none; font-size: 12px; font-weight: 500; transition: color 0.2s; }

.nav-links a:hover { color: #fff; }

/* ── LAYOUT ── */
        .wrap { display: flex; max-width: 1200px; margin: 0 auto; }

.side { width: 180px; min-width: 180px; position: sticky; top: 44px; height: calc(100vh - 44px); overflow-y: auto; padding: 1rem 0; border-right: 1px solid var(--border); scrollbar-width: thin; }

.side-head { font-size: 0.65rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); padding: 0.8rem 0.75rem 0.4rem; }

.side details { border-left: 3px solid var(--g1); margin: 0.3rem 0.5rem; padding-left: 0.5rem; }

.side details.g2 { border-left-color: var(--g2); }

.side details.g3 { border-left-color: var(--g3); }

.side summary { font-size: 0.78rem; font-weight: 600; cursor: pointer; padding: 0.25rem 0; color: var(--text); }

.side ul { list-style: none; padding: 0; margin: 0.2rem 0 0; }

.side li a { display: block; font-size: 0.75rem; padding: 0.2rem 0; color: var(--text-light); text-decoration: none; transition: color 0.2s; }

.side li a:hover, .side li a.active { color: var(--primary); font-weight: 600; }

.side-link { display: block; font-size: 0.75rem; padding: 0.25rem 0.75rem; color: var(--text-muted); text-decoration: none; }

.side-link:hover { color: var(--primary); }

.main { flex: 1; min-width: 0; }

/* ── HERO ── */
        .hero { display: flex; align-items: center; justify-content: space-between; padding: 2rem 1.5rem; background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 40%, var(--accent) 100%); color: #fff; position: relative; overflow: hidden; }

.hero::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse 600px 300px at 20% 80%, rgba(255,255,255,0.06) 0%, transparent 70%); pointer-events: none; }

.hero-left { position: relative; z-index: 1; }

.hero-label { font-size: 0.7rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.85; margin-bottom: 0.5rem; }

.hero h1 { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.02em; }

.hero p { opacity: 0.9; font-size: 0.9rem; margin-top: 0.3rem; }

.hero-stats { display: flex; gap: 1.2rem; position: relative; z-index: 1; }

.hero-stats span { text-align: center; }

.hero-stats b { display: block; font-size: 1.4rem; font-weight: 800; }

.hero-stats small { font-size: 0.65rem; opacity: 0.85; text-transform: uppercase; letter-spacing: 0.04em; }

/* ── RESOURCE BAR ── */
        .res-bar { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.5rem; padding: 0.75rem 1.5rem; background: var(--bg-card); border-bottom: 1px solid var(--border); }

.ccard { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.6rem; text-decoration: none; color: var(--text); font-size: 0.8rem; transition: box-shadow var(--transition); display: block; }

.ccard:hover { box-shadow: var(--shadow-md); }

.ccard-icon { font-size: 1.2rem; margin-bottom: 0.2rem; }

.ccard-label { font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; margin-top: 0.15rem; }

/* ── SECTIONS ── */
        .content-section { padding: 1rem 1.5rem; }

.section-head { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem; padding-bottom: 0.4rem; border-bottom: 2px solid var(--accent); }

.section-head span { width: 24px; height: 24px; border-radius: 5px; background: var(--primary); color: white; display: flex; align-items: center; justify-content: center; font-size: 0.7rem; font-weight: 700; flex-shrink: 0; }

.section-head.s1 span { background: var(--g1); }

.section-head.s2 span { background: var(--g2); }

.section-head.s3 span { background: var(--g3); }

.section-head h2 { font-size: 1.05rem; font-weight: 700; color: var(--primary); }

/* ── TOPIC BLOCKS ── */
        .topic-block { border-left: 3px solid var(--foundation); padding: 0.75rem 1rem; margin-bottom: 0.75rem; background: var(--bg-card); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

.topic-block.t-i { border-left-color: var(--intermediate); }

.topic-block.t-p { border-left-color: var(--phd); }

/* A topic block sits directly under the section h2, so its own heading is an
   h3 and the one below it an h4. These were h4 and h5 until 2 September 2026,
   which left every lesson page announcing a level three that was never there.
   The sizes are unchanged: only the ranks moved. */
.topic-block h3 { font-size: 0.88rem; font-weight: 700; color: var(--primary); margin-bottom: 0.4rem; }

.topic-block h4 { font-size: 0.8rem; font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: 0.04em; margin: 0.5rem 0 0.25rem; }

.topic-block h4:first-child { margin-top: 0; }

.topic-block p { font-size: 0.85rem; line-height: 1.65; margin-bottom: 0.5rem; }

.topic-block ul, .topic-block ol { padding-left: 1.25rem; margin: 0.25rem 0 0.5rem; }

.topic-block li { font-size: 0.85rem; line-height: 1.65; margin-bottom: 0.2rem; }

/* ── CARDS ── */
        .card { background: var(--bg-card); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow-sm); border: 1px solid var(--border); margin-bottom: 1rem; }

.card h3 { color: var(--primary); font-size: 1rem; font-weight: 700; margin-bottom: 0.75rem; padding-bottom: 0.4rem; border-bottom: 2px solid var(--accent); }

.card p { font-size: 0.85rem; line-height: 1.65; margin-bottom: 0.5rem; }

.card h4 { font-size: 0.82rem; font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: 0.04em; margin: 0.75rem 0 0.35rem; }

.card h4:first-of-type { margin-top: 0.25rem; }

.card li { font-size: 0.85rem; line-height: 1.55; }

/* ── ASEAN / RESEARCH BOXES ── */
        .asean-example { background: rgba(40,167,69,0.04); border: 1px solid rgba(40,167,69,0.2); border-left: 3px solid var(--accent); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; padding: 0.55rem 0.75rem; margin: 0.5rem 0; font-size: 0.84rem; }

.asean-example strong { color: var(--primary); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; display: block; margin-bottom: 0.15rem; }

.research-question { background: rgba(0,51,153,0.04); border: 1px solid rgba(0,51,153,0.12); border-left: 3px solid var(--secondary); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; padding: 0.55rem 0.75rem; margin: 0.5rem 0; font-size: 0.84rem; }

.research-question strong { color: var(--secondary); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; display: block; margin-bottom: 0.15rem; }

/* ── FORMULAS ── */
        .formula-block { background: #f8faf8; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.75rem 1rem; margin: 0.5rem 0; overflow-x: auto; }

.formula-block .formula-label { font-size: 0.72rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 0.3rem; }

/* ── TABLES ── */
        .assess-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.82rem; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--border); margin: 0.5rem 0; }

.assess-table th { background: var(--primary); color: white; padding: 0.55rem 0.75rem; text-align: left; font-weight: 600; font-size: 0.78rem; }

.assess-table td { padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--border-light); }

.assess-table tr:last-child td { border-bottom: none; }

.assess-table tr:hover td { background: rgba(21,87,36,0.02); }

/* ── LAB ── */
        .lab-info { display: grid; grid-template-columns: auto 1fr; gap: 0.15rem 0.75rem; font-size: 0.85rem; margin: 0.4rem 0; }

.lab-key { font-weight: 600; color: var(--primary); white-space: nowrap; }

.lab-val { color: var(--text); }

/* ── CODE ── */
        .code-tag { display: inline-block; background: rgba(21,87,36,0.07); color: var(--primary); padding: 0.1rem 0.4rem; border-radius: 4px; font-family: 'SF Mono', 'Fira Code', monospace; font-size: 0.78rem; font-weight: 500; }

.code-block { background: #1a1a2e; color: #e8e8e8; border-radius: var(--radius-sm); padding: 1rem 1.25rem; margin: 0.75rem 0; overflow-x: auto; font-family: 'SF Mono', 'Fira Code', monospace; font-size: 0.78rem; line-height: 1.7; }

.code-block .comment { color: #6a9955; }

.code-block .keyword { color: #c586c0; }

.code-block .string { color: #ce9178; }

/* ── STEPS ── */
        .steps { counter-reset: step; list-style: none; padding: 0; margin: 0.75rem 0; }

.steps li { counter-increment: step; display: flex; align-items: flex-start; gap: 0.65rem; padding: 0.55rem 0; border-bottom: 1px solid var(--border-light); font-size: 0.85rem; }

.steps li:last-child { border-bottom: none; }

.steps li::before { content: counter(step); width: 24px; height: 24px; min-width: 24px; background: linear-gradient(135deg, var(--primary), var(--accent)); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: white; font-size: 0.72rem; font-weight: 700; margin-top: 2px; }

/* ── OUTCOMES ── */
        .outcomes-list { counter-reset: outcome; list-style: none; padding: 0; margin: 0.5rem 0; }

.outcomes-list li { counter-increment: outcome; display: flex; align-items: flex-start; gap: 0.65rem; padding: 0.5rem 0; border-bottom: 1px solid var(--border-light); font-size: 0.85rem; line-height: 1.55; }

.outcomes-list li:last-child { border-bottom: none; }

.outcomes-list li::before { content: counter(outcome); width: 22px; height: 22px; min-width: 22px; background: var(--primary); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: white; font-size: 0.68rem; font-weight: 700; margin-top: 3px; }

/* ── GLOSSARY ── */
        .glossary-grid { display: grid; grid-template-columns: 1fr; gap: 0; }

.glossary-term { display: flex; align-items: flex-start; gap: 0.5rem; padding: 0.5rem 0; border-bottom: 1px solid var(--border-light); font-size: 0.85rem; }

.glossary-term:last-child { border-bottom: none; }

.glossary-term dt { font-weight: 700; color: var(--primary); min-width: 160px; font-size: 0.84rem; }

.glossary-term dd { color: var(--text); font-size: 0.82rem; line-height: 1.55; }

/* ── REFERENCES ── */
        .ref-list { list-style: none; padding: 0; }

.ref-list li { padding: 0.3rem 0; border-bottom: 1px solid var(--border-light); font-size: 0.82rem; }

.ref-list li:last-child { border-bottom: none; }

.ref-year { display: inline-block; background: var(--bg); padding: 0.1rem 0.4rem; border-radius: 4px; font-size: 0.75rem; font-weight: 600; color: var(--text-light); margin-right: 0.25rem; }

.ref-supplementary { margin-top: 0.75rem; padding-top: 0.5rem; border-top: 1px dashed var(--border); }

.ref-supplementary-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); margin-bottom: 0.35rem; }

/* ── BUTTONS / LINKS ── */
        .btn-download { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.65rem 1.25rem; background: linear-gradient(135deg, var(--primary), var(--primary-light)); color: white; border: none; border-radius: var(--radius-sm); font-family: 'Inter', sans-serif; font-size: 0.85rem; font-weight: 600; text-decoration: none; cursor: pointer; transition: all var(--transition); box-shadow: var(--shadow-sm); }

.btn-download:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); background: linear-gradient(135deg, var(--primary-light), var(--accent)); }

.btn-download svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }

.data-links { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }

.data-link { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.3rem 0.65rem; background: rgba(21,87,36,0.05); border: 1px solid var(--border); border-radius: 20px; color: var(--primary); font-size: 0.78rem; font-weight: 500; text-decoration: none; transition: all var(--transition); }

.data-link:hover { background: var(--primary); color: white; border-color: var(--primary); }

/* ── SIBLING NAV ── */
        .sibling-nav { display: flex; justify-content: space-between; padding: 1rem 1.5rem; border-top: 1px solid var(--border); margin-top: 1rem; }

.sibling-nav a { color: var(--primary); text-decoration: none; font-weight: 600; font-size: 0.85rem; }

.sibling-nav a:hover { color: var(--accent); }

/* ── BACK TO TOP ── */
        .back-to-top { position: fixed; bottom: 2rem; right: 2rem; width: 40px; height: 40px; background: var(--primary); color: white; border: none; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-md); opacity: 0; pointer-events: none; z-index: 100; transition: all var(--transition); }

.back-to-top.visible { opacity: 1; pointer-events: auto; }

.back-to-top:hover { background: var(--accent); transform: translateY(-2px); }

.back-to-top svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.5; }

/* ── FOOTER ── */
        .foot { background: var(--text); color: white; padding: 1.5rem; text-align: center; font-size: 0.82rem; margin-top: 1rem; }

.foot img { height: 40px; margin-bottom: 0.5rem; display: block; margin-left: auto; margin-right: auto; }

.disclaimer { background: rgba(255,255,255,0.08); padding: 0.6rem 0.8rem; border-radius: var(--radius-sm); margin-top: 0.6rem; font-size: 0.75rem; max-width: 700px; margin-left: auto; margin-right: auto; line-height: 1.5; }

.footer-link { display: inline-block; color: var(--accent-light); text-decoration: none; font-weight: 500; margin-top: 0.4rem; font-size: 0.8rem; }

.footer-link:hover { color: white; }

/* ── RESPONSIVE ── */
        @media (max-width: 768px) {
            .side { display: none; }
            .wrap { flex-direction: column; }
            .hero { flex-direction: column; gap: 1rem; text-align: center; }
            .hero-stats { justify-content: center; flex-wrap: wrap; }
            .glossary-term { flex-direction: column; gap: 0.15rem; }
            .glossary-term dt { min-width: auto; }
        }

@media (max-width: 480px) {
            .nav-links { display: none; }
            .hero h1 { font-size: 1.25rem; }
        }

@media (prefers-reduced-motion: reduce) {
            *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
        }

@media print {
            .nav, .side { display: none; }
            .hero { background: var(--primary) !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
            .wrap { display: block; }
            body { font-size: 10pt; background: white; }
        }
