:root {
            --navy: #1B2A4A;
            --navy-light: #25396B;
            --teal: #00A896;
            --teal-light: #00D4BE;
            --orange: #FF7B2A;
            --orange-light: #FF9F5A;
            --yellow: #FFC857;
            --green: #2ECC71;
            --green-light: #58E694;
            --red: #E24C4C;
            --red-light: #EF7A7A;
            --cream: #FDF6E3;
            --cream-dark: #F5ECDB;
            --white: #FFFFFF;
            --ink: #2C3E50;
            --ink-soft: #5A6B7F;
            --sidebar-width: 280px;
            --toc-width: 280px;
            --card-radius: 16px;
            --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
            --tier-ephemeral: #B5482F;
            --tier-applied: #A98A3D;
            --tier-foundational: #3D4F7A;
        }

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

        body {
            background-color: var(--cream);
            color: var(--ink);
            font-family: 'Inter', sans-serif;
            line-height: 1.7;
            min-height: 100vh;
            display: flex; flex-direction: column;
        }

        .site-layout {
            display: grid;
            grid-template-columns: var(--toc-width) minmax(0, 1fr) var(--sidebar-width);
            justify-content: center;
            align-items: start;
            gap: 1.5rem;
            flex: 1;
            padding: 2rem;
            max-width: 1800px;
            margin: 0 auto;
            width: 100%;
        }

        .doc-content { min-width: 0; width: 100%; }

        .section-badge {
            display: inline-flex; align-items: center; gap: 0.5rem;
            background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
            color: var(--white); padding: 0.6rem 1.2rem;
            border-radius: 50px; font-size: 1rem; font-weight: 600;
            margin-bottom: 1.5rem; box-shadow: 0 4px 20px rgba(27, 42, 74, 0.3);
            border: none;
        }
        .section-badge a { color: var(--white); text-decoration: none; border-bottom: 1px dashed var(--teal-light); transition: var(--transition); }
        .section-badge a:hover { border-bottom-color: var(--yellow); color: var(--yellow); }

        .content-card {
            background: var(--white); border-radius: var(--card-radius);
            padding: 2.5rem; margin: 1.5rem 0;
            border: 1px solid rgba(27,42,74,0.06);
            box-shadow: 0 2px 12px rgba(27,42,74,0.04);
            position: relative;
        }

        .level-ribbon-wrap {
            position: absolute; top: 0; right: 0; width: 84px; height: 84px;
            z-index: 2; cursor: help;
        }
        .level-ribbon-clip {
            position: absolute; top: 0; right: 0; width: 84px; height: 84px;
            overflow: hidden; border-radius: 0 var(--card-radius) 0 0;
        }
        .level-ribbon {
            display: block; position: absolute; top: 15px; right: -21px; width: 100px;
            transform: rotate(45deg); text-align: center;
            padding: 0.2rem 0; font-family: system-ui, sans-serif;
            font-size: 0.75rem; font-weight: 700; letter-spacing: 0.04em;
            color: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.25);
        }
        .level-ribbon.level-F { background: #4CAF7D; }
        .level-ribbon.level-U { background: #3B82C4; }
        .level-ribbon.level-M { background: #D98A2B; }
        .level-ribbon.level-P { background: #8B4FB0; }
        .level-ribbon-tooltip {
            visibility: hidden; opacity: 0; pointer-events: none;
            position: absolute; top: 100%; right: 0; margin-top: 0.4rem;
            background: var(--ink); color: #fff; white-space: nowrap;
            padding: 0.4rem 0.7rem; border-radius: 6px; font-weight: 500;
            font-size: 0.85rem; letter-spacing: normal; box-shadow: 0 2px 8px rgba(0,0,0,0.3);
            transition: opacity 0.15s ease, transform 0.15s ease;
            transform: translateY(-4px);
        }
        .level-ribbon-wrap:hover .level-ribbon-tooltip,
        .level-ribbon-wrap:focus .level-ribbon-tooltip,
        .level-ribbon-wrap:focus-visible .level-ribbon-tooltip {
            visibility: visible; opacity: 1;
            transform: translateY(0);
        }

        /* ==== Tier ribbon (page-level half-life classification) ====
           Mirrors .level-ribbon-wrap in the opposite corner. Three-letter
           codes, never a single letter, so this never reads as level's F/U/M/P. */
        .tier-ribbon-wrap {
            position: absolute; top: 0; left: 0; width: 84px; height: 84px;
            z-index: 2; cursor: help;
        }
        .tier-ribbon-clip {
            position: absolute; top: 0; left: 0; width: 84px; height: 84px;
            overflow: hidden; border-radius: var(--card-radius) 0 0 0;
        }
        .tier-ribbon {
            display: block; position: absolute; top: 15px; left: -21px; width: 100px;
            transform: rotate(-45deg); text-align: center;
            padding: 0.2rem 0; font-family: system-ui, sans-serif;
            font-size: 0.75rem; font-weight: 700; letter-spacing: 0.04em;
            color: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.25);
        }
        .tier-ribbon.tier-ephemeral { background: var(--tier-ephemeral); }
        .tier-ribbon.tier-applied { background: var(--tier-applied); }
        .tier-ribbon.tier-foundational { background: var(--tier-foundational); }
        .tier-ribbon-tooltip {
            visibility: hidden; opacity: 0; pointer-events: none;
            position: absolute; top: 100%; left: 0; margin-top: 0.4rem;
            background: var(--ink); color: #fff; white-space: nowrap;
            padding: 0.4rem 0.7rem; border-radius: 6px; font-weight: 500;
            font-size: 0.85rem; letter-spacing: normal; box-shadow: 0 2px 8px rgba(0,0,0,0.3);
            transition: opacity 0.15s ease, transform 0.15s ease;
            transform: translateY(-4px);
        }
        .tier-ribbon-wrap:hover .tier-ribbon-tooltip,
        .tier-ribbon-wrap:focus .tier-ribbon-tooltip,
        .tier-ribbon-wrap:focus-visible .tier-ribbon-tooltip {
            visibility: visible; opacity: 1;
            transform: translateY(0);
        }

        /* ==== Tier badge (section-level half-life classification) ====
           Inline chip after an h2/h3's heading text. Colour is supplementary
           only: the icon shape and the full-word label both stand on their own. */
        .tier-badge {
            display: inline-flex; align-items: center; gap: 0.35rem;
            font-family: 'Inter', sans-serif; font-size: 0.7rem; font-weight: 600;
            padding: 0.15rem 0.55rem 0.15rem 0.4rem; border-radius: 12px;
            border: 1px solid rgba(27,42,74,0.15); color: var(--ink-soft);
            cursor: help; vertical-align: middle; margin-left: 0.6rem;
            position: relative; white-space: nowrap;
        }
        .tier-badge .tier-icon {
            width: 10px; height: 12px; display: grid;
            grid-template-rows: repeat(3, 1fr); gap: 1.5px; flex: none;
        }
        .tier-badge .tier-icon span {
            display: block; border-radius: 1px; background: rgba(27,42,74,0.2);
        }
        .tier-badge.tier-ephemeral .tier-icon span:nth-child(1) { background: var(--tier-ephemeral); }
        .tier-badge.tier-applied .tier-icon span:nth-child(2) { background: var(--tier-applied); }
        .tier-badge.tier-foundational .tier-icon span:nth-child(3) { background: var(--tier-foundational); }
        .tier-badge .tier-tooltip {
            visibility: hidden; opacity: 0; pointer-events: none;
            position: absolute; bottom: 100%; left: 0; margin-bottom: 0.4rem;
            background: var(--ink); color: #fff; white-space: nowrap;
            padding: 0.35rem 0.6rem; border-radius: 6px; font-size: 0.75rem; font-weight: 500;
            box-shadow: 0 2px 8px rgba(0,0,0,0.3);
            transition: opacity 0.15s ease, transform 0.15s ease;
            transform: translateY(4px); z-index: 3;
        }
        .tier-badge:hover .tier-tooltip,
        .tier-badge:focus .tier-tooltip,
        .tier-badge:focus-visible .tier-tooltip {
            visibility: visible; opacity: 1;
            transform: translateY(0);
        }

        .screenshot { margin: 1.5rem 0; text-align: center; }
        .screenshot img {
            max-width: 100%; height: auto; display: inline-block;
            border-radius: 8px; border: 1px solid rgba(27,42,74,0.12);
            box-shadow: 0 2px 12px rgba(27,42,74,0.08);
        }

        h1, h2, h3, h4, h5, h6 {
            font-family: 'Crimson Pro', serif; font-weight: 700; color: var(--navy);
            margin-top: 2.5rem; margin-bottom: 1.25rem; line-height: 1.3;
            position: relative; padding-left: 1rem;
        }
        h1 { font-size: 2.5rem; border-bottom: 3px solid var(--teal); padding-bottom: 0.75rem; padding-left: 0; }
        h1::before { content: ""; position: absolute; left: -1rem; top: 0.2rem; bottom: 0.2rem; width: 6px; background: linear-gradient(180deg, var(--teal), var(--orange)); border-radius: 3px; }
        h2 { font-size: 2rem; color: var(--navy); border-left: 4px solid var(--orange); padding-left: 1rem; background: linear-gradient(90deg, rgba(255,123,42,0.05), transparent); border-radius: 0 8px 8px 0; scroll-margin-top: 2rem; }
        h3 { font-size: 1.6rem; color: var(--navy-light); border-left: 3px solid var(--teal); padding-left: 0.85rem; }
        h4 { font-size: 1.35rem; color: var(--ink); }

        p { margin-bottom: 1.25rem; font-size: 1.1rem; color: var(--ink); }
        .lead { font-size: 1.25rem; color: var(--navy-light); font-weight: 500; margin-bottom: 1.5rem; }

        .highlight { background: linear-gradient(120deg, var(--yellow), var(--orange-light)); color: var(--navy); padding: 0.2rem 0.5rem; border-radius: 4px; font-weight: 600; }

        blockquote {
            border-left: 4px solid var(--teal);
            background: linear-gradient(90deg, rgba(0,168,150,0.08), transparent);
            padding: 1.5rem 2rem; margin: 1.5rem 0;
            border-radius: 0 12px 12px 0;
            font-style: italic; color: var(--ink-soft);
            position: relative; overflow: hidden;
        }
        blockquote::before {
            content: "\201D"; font-family: 'Crimson Pro', serif;
            font-size: 4rem; color: var(--teal); opacity: 0.15;
            position: absolute; top: -1rem; left: 1rem;
        }

        ul, ol { margin-bottom: 1.25rem; padding-left: 1.75rem; }
        li { margin-bottom: 0.5rem; }

        table {
            width: 100%;
            border-collapse: separate;
            border-spacing: 0;
            margin: 1.5rem 0;
            font-size: 0.95rem;
        }
        th {
            background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
            color: var(--white);
            font-weight: 600;
            padding: 0.85rem 1.5rem;
            text-align: left;
            border: none;
        }
        td {
            padding: 0.75rem 1.5rem;
            border-bottom: 1px solid rgba(27, 42, 74, 0.1);
            color: var(--ink);
        }
        tr:last-child td {
            border-bottom: none;
        }
        tbody tr:hover td {
            background: rgba(0, 168, 150, 0.04);
        }
        thead th:first-child { border-radius: 8px 0 0 0; }
        thead th:last-child { border-radius: 0 8px 0 0; }
        ul li::marker { color: var(--teal); font-weight: 700; }
        ol { counter-reset: item; list-style: none; padding-left: 1.5rem; }
        ol li { position: relative; padding-left: 2rem; }
        ol li::before {
            counter-increment: item; content: counter(item) ".";
            position: absolute; left: 0; top: 0;
            color: var(--orange); font-weight: 700; font-family: 'Crimson Pro', serif;
        }

        .section-rule { border: none; border-top: 2px dashed rgba(27,42,74,0.15); margin: 2rem 0; }

        a { color: var(--teal); text-decoration: none; border-bottom: 1px dashed var(--teal-light); transition: var(--transition); }
        a:hover { border-bottom-color: var(--orange); color: var(--orange); }
        
        /* External links — open in new tab */
        a[href^="http"] { 
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2300A896' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6'/%3E%3Cpolyline points='15 3 21 3 21 9'/%3E%3Cline x1='10' y1='14' x2='21' y2='3'/%3E%3C/svg%3E");
            background-repeat: no-repeat;
            background-position: right center;
            padding-right: 16px;
        }
        a[href^="http"]:hover {
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23FF7B2A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6'/%3E%3Cpolyline points='15 3 21 3 21 9'/%3E%3Cline x1='10' y1='14' x2='21' y2='3'/%3E%3C/svg%3E");
        }

        .citation { font-family: 'Inter', sans-serif; font-size: 0.9em; color: var(--ink-soft); background: rgba(0,168,150,0.1); padding: 0.15rem 0.4rem; border-radius: 4px; }

        .callout {
            border-radius: 12px; padding: 1.5rem; margin: 1.5rem 0;
            border-left: 5px solid; display: flex; gap: 1rem; align-items: flex-start;
        }
        .callout-tip { background: linear-gradient(90deg, rgba(0,168,150,0.1), transparent); border-color: var(--teal); }
        .callout-tip::before { content: "💡"; font-size: 1.5rem; }
        .callout-warning { background: linear-gradient(90deg, rgba(255,123,42,0.1), transparent); border-color: var(--orange); }
        .callout-warning::before { content: "⚠️"; font-size: 1.5rem; }
        .callout-note { background: linear-gradient(90deg, rgba(27,42,74,0.08), transparent); border-color: var(--navy); }
        .callout-note::before { content: "📝"; font-size: 1.5rem; }
        .callout-example { background: linear-gradient(90deg, rgba(255,200,87,0.15), transparent); border-color: var(--yellow); }
        .callout-example::before { content: "🎯"; font-size: 1.5rem; }
        .callout-dont { background: linear-gradient(90deg, rgba(226,76,76,0.12), transparent); border-color: var(--red); }
        .callout-dont::before { content: "❌"; font-size: 1.5rem; }
        .callout-important { background: linear-gradient(90deg, rgba(255,200,87,0.22), transparent); border-color: var(--yellow); }
        .callout-important::before { content: "❗"; font-size: 1.5rem; }
        .callout-do { background: linear-gradient(90deg, rgba(46,204,113,0.14), transparent); border-color: var(--green); }
        .callout-do::before { content: "✔️"; font-size: 1.5rem; }

        .card-grid {
            display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
            gap: 1.5rem; margin: 2rem 0;
        }
        .topic-card {
            background: var(--white); border-radius: 14px; padding: 1.5rem;
            border: 1px solid rgba(27,42,74,0.08);
            transition: var(--transition); text-decoration: none; color: inherit; display: block;
        }
        .topic-card:hover { transform: translateY(-4px); box-shadow: 0 12px 32px rgba(27,42,74,0.12); border-color: var(--teal); }
        .topic-card .card-icon { font-size: 2.5rem; margin-bottom: 0.75rem; display: block; }
        .topic-card h3 { margin: 0 0 0.5rem; font-size: 1.25rem; }
        .topic-card p { margin: 0; font-size: 0.95rem; color: var(--ink-soft); font-size: 0.95rem; }

        .progress-bar {
            height: 6px; background: rgba(27,42,74,0.1); border-radius: 3px; overflow: hidden; margin: 1rem 0;
        }
        .progress-bar-fill {
            height: 100%; background: linear-gradient(90deg, var(--teal), var(--orange));
            border-radius: 3px; transition: width 0.5s ease;
        }

        .site-footer {
            width: 100%; padding: 2rem; border-top: 1px solid rgba(27,42,74,0.1);
            color: var(--ink-soft); font-size: 0.9rem;
            text-align: center; background: var(--cream-dark);
            margin-top: 3rem;
        }

        .paper-meta {
            display: flex; flex-wrap: wrap; gap: 1rem; margin: 1.5rem 0;
            padding: 1.5rem; background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
            border-radius: var(--card-radius); color: var(--white);
        }
        .paper-meta-item { display: flex; align-items: center; gap: 0.5rem; font-size: 0.95rem; }
        .paper-meta-item::before { font-size: 1.2rem; }

        .toc-expand { background: none; border: none; color: var(--ink-soft); font: inherit; cursor: pointer; padding: 0; font-size: 0.9rem; display: flex; align-items: center; gap: 0.35rem; transition: var(--transition); }
        .toc-expand:hover { color: var(--teal); }
        .toc-expand svg { transition: transform 0.2s; }
        .toc-expand[aria-expanded="true"] svg { transform: rotate(180deg); }

        /* Code blocks */
        pre { background: var(--navy); color: var(--cream); padding: 1.5rem; border-radius: 10px; overflow-x: auto; margin: 1.5rem 0; }
        code { font-family: 'Fira Code', 'Consolas', monospace; font-size: 0.9em; }
        .highlight { background: linear-gradient(120deg, var(--yellow), var(--orange-light)); color: var(--navy); padding: 0.2rem 0.5rem; border-radius: 4px; font-weight: 600; }

        .card-grid {
            display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
            gap: 1.5rem; margin: 2rem 0;
        }
        .topic-card {
            background: var(--white); border-radius: 14px; padding: 1.5rem;
            border: 1px solid rgba(27,42,74,0.08);
            transition: var(--transition); text-decoration: none; color: inherit; display: block;
        }
        .topic-card:hover { transform: translateY(-4px); box-shadow: 0 12px 32px rgba(27,42,74,0.12); border-color: var(--teal); }
        .topic-card .card-icon { font-size: 2.5rem; margin-bottom: 0.75rem; display: block; }
        .topic-card h3 { margin: 0 0 0.5rem; font-size: 1.25rem; }
        .topic-card p { margin: 0; font-size: 0.95rem; color: var(--ink-soft); font-size: 0.95rem; }

        .progress-bar {
            height: 6px; background: rgba(27,42,74,0.1); border-radius: 3px; overflow: hidden; margin: 1rem 0;
        }
        .progress-bar-fill {
            height: 100%; background: linear-gradient(90deg, var(--teal), var(--orange));
            border-radius: 3px; transition: width 0.5s ease;
        }

        .site-footer {
            width: 100%; padding: 2rem; border-top: 1px solid rgba(27,42,74,0.1);
            color: var(--ink-soft); font-size: 0.9rem;
            text-align: center; background: var(--cream-dark);
            margin-top: 3rem;
        }

        .paper-meta {
            display: flex; flex-wrap: wrap; gap: 1rem; margin: 1.5rem 0;
            padding: 1.5rem; background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
            border-radius: var(--card-radius); color: var(--white);
        }
        .paper-meta-item { display: flex; align-items: center; gap: 0.5rem; font-size: 0.95rem; }
        .paper-meta-item::before { font-size: 1.2rem; }

        .toc-expand { background: none; border: none; color: var(--ink-soft); font: inherit; cursor: pointer; padding: 0; font-size: 0.9rem; display: flex; align-items: center; gap: 0.35rem; transition: var(--transition); }
        .toc-expand:hover { color: var(--teal); }
        .toc-expand svg { transition: transform 0.2s; }
        .toc-expand[aria-expanded="true"] svg { transform: rotate(180deg); }

        @media (max-width: 1000px) {
            .site-layout { grid-template-columns: 1fr; gap: 1rem; padding: 1rem; }
            .toc-panel, .doc-nav { width: 100%; position: static; max-height: none; }
            .doc-nav { order: 3; }
            .toc-panel { order: 1; }
            .doc-content { order: 2; }
        }
        
        @media (max-width: 700px) {
            .site-layout { padding: 0.75rem; }
            .toc-panel, .doc-nav { padding: 1rem; }
            .doc-nav ul { display: none; }
            .doc-nav .nav-toggle { display: block; }
        }

        /* ===== Breadcrumbs ===== */
        .breadcrumbs {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            margin-bottom: 1rem;
            padding: 0.5rem 0;
            font-size: 0.875rem;
            color: var(--ink-soft);
            flex-wrap: wrap;
        }
        .breadcrumbs a {
            color: var(--teal);
            text-decoration: none;
            border-bottom: 1px dashed var(--teal-light);
            transition: var(--transition);
        }
        .breadcrumbs a:hover {
            color: var(--orange);
            border-bottom-color: var(--orange);
        }
        .breadcrumbs .separator {
            color: var(--ink-soft);
            opacity: 0.5;
        }
        .breadcrumbs .current {
            color: var(--ink);
            font-weight: 500;
        }
        .breadcrumbs .home-icon {
            font-size: 1rem;
            line-height: 1;
        }
        .last-updated {
            font-size: 0.8rem;
            color: var(--ink-soft);
            margin: -0.5rem 0 1.25rem;
        }

        /* ===== Tabbed Code Blocks ===== */
        .code-tabs {
            margin: 1.5rem 0;
            border-radius: var(--card-radius);
            overflow: hidden;
            border: 1px solid rgba(27, 42, 74, 0.1);
            background: var(--white);
        }
        .code-tabs-nav {
            display: flex;
            background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
            border-bottom: 1px solid rgba(27, 42, 74, 0.15);
        }
        .code-tab-btn {
            flex: 1;
            padding: 0.85rem 1.25rem;
            border: none;
            background: transparent;
            color: var(--cream);
            font: inherit;
            font-weight: 500;
            font-size: 0.875rem;
            cursor: pointer;
            transition: var(--transition);
            border-bottom: 3px solid transparent;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
        }
        .code-tab-btn:hover {
            background: rgba(255, 255, 255, 0.08);
        }
        .code-tab-btn.active {
            background: var(--white);
            color: var(--navy);
            border-bottom-color: var(--teal);
        }
        .code-tab-btn::before {
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.8rem;
        }
        .code-tab-btn[data-lang="python"]::before { content: "🐍"; }
        .code-tab-btn[data-lang="cpp"]::before { content: "⚡"; }
        .code-tab-btn[data-lang="java"]::before { content: "☕"; }
        .code-tab-btn[data-lang="csharp"]::before { content: "🔷"; }
        .code-tab-btn[data-lang="ruby"]::before { content: "💎"; }
        .code-tab-panel {
            display: none;
            padding: 1.25rem;
        }
        .code-tab-panel.active {
            display: block;
            animation: fadeIn 0.2s ease;
        }
        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(4px); }
            to { opacity: 1; transform: translateY(0); }
        }
        .code-tab-panel pre {
            margin: 0;
            border-radius: 6px;
            overflow-x: auto;
        }
        .code-tab-panel code {
            font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
            font-size: 0.875rem;
            line-height: 1.6;
        }
        /* Prism toolbar position fix */
        .code-tab-panel .prism-toolbar {
            position: static;
            opacity: 1;
        }
        .code-tab-panel button.copy-to-clipboard {
            background: var(--navy);
            color: var(--cream);
            border: none;
            padding: 0.35rem 0.75rem;
            border-radius: 4px;
            font-size: 0.75rem;
            cursor: pointer;
            transition: var(--transition);
        }
        .code-tab-panel button.copy-to-clipboard:hover {
            background: var(--teal);
        }

/* ---- Additions: references, citations, listing cards, prev/next (build.py) ---- */
a.citation {
    font-size: 0.8em; vertical-align: super; line-height: 1;
    border-bottom: none; padding: 0 0.1rem;
}
ol.references { padding-left: 2rem; font-size: 0.95rem; }
ol.references li { margin-bottom: 0.75rem; line-height: 1.55; scroll-margin-top: 2rem; }
ol.references li:target { background-color: var(--yellow, #FFC857); border-radius: 6px; padding: 0.3rem 0.5rem; }
ol.references a { word-break: break-all; font-size: 0.9em; }

.topic-articles { display: flex; flex-direction: column; gap: 1rem; }
.topic-article-card {
    background: var(--white, #fff); border: 1px solid rgba(27,42,74,0.15);
    border-radius: 12px; padding: 1.25rem 1.5rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    position: relative;
}
/* stretch the title link over the whole card so it acts as one button */
.topic-article-card h3 a::after { content: ""; position: absolute; inset: 0; }
.topic-article-card:hover { border-color: var(--teal, #00A896); box-shadow: 0 4px 12px rgba(27,42,74,0.10); }
.topic-article-card h3 { margin: 0 0 0.35rem 0; font-size: 1.2rem; background: none; border: none; padding: 0; position: static; }
.topic-article-card p { margin: 0; font-size: 0.95rem; }

.related-block {
    background: var(--cream, #F5ECDB); border: 1px solid rgba(27,42,74,0.15);
    border-radius: 12px; padding: 1.25rem 1.5rem; margin: 2rem 0;
}
.related-block h2 { margin-top: 0; font-size: 1.3rem; }
.related-block ul { margin: 0.75rem 0 0; padding-left: 1.25rem; }

.page-siblings { display: flex; justify-content: space-between; gap: 1rem; margin: 2.5rem 0 1rem; font-size: 0.95rem; }
.page-siblings a {
    display: inline-block; padding: 0.6rem 1rem; background: var(--white, #fff);
    border: 1px solid rgba(27,42,74,0.15); border-radius: 10px; max-width: 46%;
}
.page-siblings a:hover { border-color: var(--teal, #00A896); }
.page-siblings .next { margin-left: auto; text-align: right; }


/* ---- Panel tint for the shared panels.css ---- */
:root {
    --panel-width: var(--toc-width, 280px);
    --panel-bg-a: #FFFFFF;
    --panel-bg-b: var(--cream-dark, #F0E6CE);
    --panel-border: rgba(27, 42, 74, 0.08);
    --panel-shadow: rgba(27, 42, 74, 0.06);
    --panel-heading-font: 'Crimson Pro', serif;
    --panel-heading-color: var(--navy);
    --panel-accent: var(--teal);
    --panel-fg: var(--navy);
    --panel-fg-soft: var(--ink-soft, #5A6B7F);
    --panel-btn-a: var(--navy);
    --panel-btn-b: var(--navy-light);
    --panel-btn-fg: #FFFFFF;
    --panel-chevron-bg: var(--teal);
    --panel-chevron-fg: #FFFFFF;
    --panel-hover: rgba(0, 168, 150, 0.15);
    --panel-active-a: rgba(0, 168, 150, 0.2);
    --panel-active-b: rgba(255, 123, 42, 0.1);
    --panel-active-accent: var(--orange);
}

/* ============================================================
   Geometric Algebra guide content — scoped to .ga-guide so it
   cannot leak onto other teaching pages. Ported from the
   standalone GA & Interval Arithmetic guide's stylesheet;
   custom properties inlined as hex values to avoid colliding
   with this site's global :root variables (e.g. --ink).
   ============================================================ */

.ga-guide, .ga-guide article { max-width: 100%; }

.ga-guide .full-bleed { max-width: 100%; }

.ga-guide figure {
  max-width: 100%;
  margin: 2rem 0;
  background: #f2efe8;
  border: 1px solid #e8e4dc;
  border-radius: 10px;
  overflow: hidden;
}
.ga-guide figure svg,
.ga-guide figure canvas { display: block; width: 100%; }
.ga-guide figcaption {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 0.68rem;
  color: #6b6760;
  padding: 0.6rem 1rem;
  border-top: 1px solid #e8e4dc;
  line-height: 1.5;
  letter-spacing: 0.03em;
}
.ga-guide figcaption strong { color: #3d3a34; }

/* Definition / concept blocks */
.ga-guide .defn {
  border-left: 3px solid #534ab7;
  background: #eeedfe;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  border-radius: 0 8px 8px 0;
}
.ga-guide .defn.amber { border-color: #ba7517; background: #faeeda; }
.ga-guide .defn.teal  { border-color: #0f6e56; background: #e1f5ee; }
.ga-guide .defn.coral { border-color: #993c1d; background: #faece7; }
.ga-guide .defn.blue  { border-color: #185fa5; background: #e6f1fb; }
.ga-guide .defn.ruby  { border-color: #7B3FA0; background: #f3eafa; }
.ga-guide .defn.test  { border-color: #1D6B5E; background: #e0f5f2; }
.ga-guide .defn.cga   { border-color: #2d7a5f; background: #e3f5ef; }
.ga-guide .defn.cga2  { border-color: #6b3d8c; background: #f0e8fa; }
.ga-guide .defn.cga3  { border-color: #a05a1a; background: #fdf0e0; }

.ga-guide .defn-label {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #534ab7;
  margin-bottom: 0.35rem;
}
.ga-guide .amber .defn-label { color: #633806; }
.ga-guide .teal  .defn-label { color: #085041; }
.ga-guide .coral .defn-label { color: #711b13; }
.ga-guide .blue  .defn-label { color: #0c447c; }
.ga-guide .ruby  .defn-label { color: #5c2d91; }
.ga-guide .test  .defn-label { color: #124e47; }
.ga-guide .cga   .defn-label { color: #1a4d3a; }
.ga-guide .cga2  .defn-label { color: #3a1a4d; }
.ga-guide .cga3  .defn-label { color: #4d2a0a; }

.ga-guide .defn p { margin-bottom: 0; }

/* Code / formula blocks */
.ga-guide .formula-block, .ga-guide .rspec-output {
  white-space: pre-wrap;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 0.8rem;
  background: #1a1814;
  color: #d4d0c8;
  border-radius: 8px;
  padding: 1.1rem 1.4rem;
  margin: 1.5rem 0;
  line-height: 2;
  overflow-x: auto;
}
.ga-guide .formula-block .c-purple { color: #afa9ec; }
.ga-guide .formula-block .c-amber  { color: #fac775; }
.ga-guide .formula-block .c-teal   { color: #5dcaa5; }
.ga-guide .formula-block .c-coral  { color: #f0997b; }
.ga-guide .formula-block .c-blue   { color: #85b7eb; }
.ga-guide .formula-block .c-dim    { color: #5f5e5a; }
.ga-guide .formula-block .c-cga    { color: #5dcaa5; }
.ga-guide .formula-block .c-cga2   { color: #c9a0f0; }
.ga-guide .formula-block .c-cga3   { color: #f5c07a; }

/* Tip boxes */
.ga-guide .tip {
  background: #f2efe8;
  border: 1px solid #d4d0c8;
  border-radius: 8px;
  padding: 0.85rem 1.1rem;
  margin: 1.5rem 0;
  display: flex;
  gap: 10px;
  font-size: 0.92rem;
  color: #3d3a34;
}
.ga-guide .tip-icon {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 0.65rem;
  font-weight: 500;
  background: #faeeda;
  color: #633806;
  border: 1px solid #ba7517;
  border-radius: 50%;
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
  letter-spacing: 0;
}
.ga-guide .tip p { margin: 0; }

/* References section */
.ga-guide .references {
  margin-top: 3.5rem;
  padding-top: 1.5rem;
  border-top: 2px solid #d4d0c8;
}
.ga-guide .references h2 { font-size: 1.1rem; margin-top: 0; border: none; padding: 0; }

.ga-guide .ref-list {
  list-style: none;
  counter-reset: refs;
  margin-top: 0.8rem;
}
.ga-guide .ref-list li {
  counter-increment: refs;
  display: flex;
  gap: 10px;
  margin-bottom: 0.65rem;
  font-size: 0.88rem;
  color: #3d3a34;
  line-height: 1.55;
}
.ga-guide .ref-list li::before {
  content: "[" counter(refs) "]";
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 0.65rem;
  color: #9b9790;
  min-width: 30px;
  padding-top: 2px;
  flex-shrink: 0;
}
.ga-guide .ref-list .ref-authors { font-style: italic; }
.ga-guide .ref-list .ref-title   { font-weight: 600; color: #1a1814; }

/* Footnote markers */
.ga-guide sup.cite {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 0.6rem;
  color: #534ab7;
  vertical-align: super;
  line-height: 0;
  cursor: default;
}
.ga-guide sup.cite a {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}
.ga-guide sup.cite a:hover {
  text-decoration: underline;
}

/* Two-column layout */
.ga-guide .two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1.5rem 0;
}
.ga-guide .card {
  background: #faf8f4;
  border: 1px solid #d4d0c8;
  border-radius: 8px;
  padding: 1rem 1.1rem;
}
.ga-guide .card-label {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #6b6760;
  margin-bottom: 0.4rem;
}
.ga-guide .card p { font-size: 0.92rem; margin: 0; line-height: 1.6; }

/* Step list */
.ga-guide .step-list { margin: 1rem 0; list-style: none; }
.ga-guide .step-list li {
  display: flex;
  gap: 12px;
  margin-bottom: 0.75rem;
  align-items: flex-start;
}
.ga-guide .step-num {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 0.65rem;
  font-weight: 500;
  min-width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  margin-top: 3px;
  background: #eeedfe;
  color: #3c3489;
  border: 1px solid #534ab7;
}
.ga-guide .step-num.teal  { background: #e1f5ee; color: #085041; border-color: #0f6e56; }
.ga-guide .step-num.amber { background: #faeeda; color: #633806; border-color: #ba7517; }
.ga-guide .step-num.blue  { background: #e6f1fb; color: #0c447c; border-color: #185fa5; }
.ga-guide .step-list li p { margin: 0; font-size: 0.95rem; line-height: 1.65; }

/* Ruby code blocks (ch6/ch7) */
.ga-guide .ruby-block {
  white-space: pre-wrap;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 0.78rem;
  background: #1a1814;
  color: #d4d0c8;
  border-radius: 8px;
  padding: 1.1rem 1.4rem;
  margin: 1.5rem 0;
  line-height: 1.9;
  overflow-x: auto;
  position: relative;
}
.ga-guide .ruby-block .lang-tag {
  position: absolute;
  top: 0.5rem; right: 0.9rem;
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #5f5e5a;
}
.ga-guide .rb-kw    { color: #afa9ec; }
.ga-guide .rb-cls   { color: #fac775; }
.ga-guide .rb-fn    { color: #85b7eb; }
.ga-guide .rb-str   { color: #9FE1CB; }
.ga-guide .rb-sym   { color: #f0997b; }
.ga-guide .rb-num   { color: #fac775; }
.ga-guide .rb-cmt   { color: #5f5e5a; }
.ga-guide .rb-op    { color: #d4d0c8; }
.ga-guide .rb-const { color: #fac775; }
.ga-guide .rb-ivar  { color: #85b7eb; }

/* Inline filename pill */
.ga-guide .file-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  background: #e9e5dc;
  border: 1px solid #d4d0c8;
  border-radius: 6px;
  padding: 3px 9px;
  color: #3d3a34;
  margin-bottom: 0.3rem;
  user-select: all;
}

/* Implementation section box */
.ga-guide .impl-section {
  border: 1px solid #d4d0c8;
  border-radius: 10px;
  overflow: hidden;
  margin: 2rem 0;
}
.ga-guide .impl-section-header {
  background: #f2efe8;
  border-bottom: 1px solid #e8e4dc;
  padding: 0.7rem 1.1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.ga-guide .impl-section-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  padding: 0;
}
.ga-guide .impl-section-body { padding: 1.1rem 1.1rem 0.2rem; }
.ga-guide .impl-section-body p { font-size: 0.95rem; }

/* Worked example box (ch8) */
.ga-guide .worked-example {
  border: 1px solid #d4d0c8;
  border-radius: 12px;
  overflow: hidden;
  margin: 2.5rem 0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.ga-guide .we-header {
  padding: 0.8rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  border-bottom: 1px solid #e8e4dc;
}
.ga-guide .we-num {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.7;
  flex-shrink: 0;
}
.ga-guide .we-title {
  font-family: 'Libre Baskerville', 'Georgia', serif;
  font-size: 1.05rem;
  font-weight: 700;
}
.ga-guide .we-body { padding: 1.25rem 1.25rem 0.5rem; background: #faf8f4; }
.ga-guide .we-body > p { font-size: 0.95rem; }
.ga-guide .we-diagram {
  background: #f2efe8;
  border-top: 1px solid #e8e4dc;
  border-bottom: 1px solid #e8e4dc;
  padding: 0;
  overflow: hidden;
}
.ga-guide .we-diagram svg { display: block; width: 100%; }
.ga-guide .we-diagram figcaption {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 0.65rem;
  color: #6b6760;
  padding: 0.5rem 1.1rem;
  border-top: 1px solid #e8e4dc;
  background: #f2efe8;
  line-height: 1.5;
  letter-spacing: 0.02em;
}
.ga-guide .we-result {
  padding: 0.75rem 1.25rem 1rem;
  background: #faf8f4;
  border-top: 1px solid #e8e4dc;
}
.ga-guide .we-result .result-label {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #9b9790;
  margin-bottom: 0.3rem;
}

/* Step-by-step derivation table (ch4/ch5/ch8) */
.ga-guide .derivation {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin: 1rem 0;
}
.ga-guide .derivation td {
  padding: 0.45rem 0.75rem;
  border-bottom: 1px solid #e8e4dc;
  vertical-align: top;
  line-height: 1.5;
}
.ga-guide .derivation td:first-child {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  color: #9b9790;
  text-transform: uppercase;
  white-space: nowrap;
  padding-right: 1rem;
  width: 90px;
}
.ga-guide .derivation td:last-child { color: #6b6760; font-style: italic; }
.ga-guide .derivation .hi td { background: #e3f5ef; }

@media (max-width: 600px) {
  .ga-guide .two-col { grid-template-columns: 1fr; }
}

/* Interactive demo widget (ch8 worked example 5) */
.ga-guide .demo-wrap { border: 1px solid #e8e4dc; border-radius: 12px; overflow: hidden; margin: 1.5rem 0; background: #faf8f4; }
.ga-guide .demo-head { padding: .65rem 1.1rem; background: #f2efe8; border-bottom: 1px solid #e8e4dc; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .5rem; }
.ga-guide .demo-label { font-family: 'JetBrains Mono', 'Courier New', monospace; font-size: .62rem; text-transform: uppercase; letter-spacing: .1em; color: #6b6760; }
.ga-guide .demo-canvas { display: block; width: 100%; }
.ga-guide .demo-ctrl { background: #e9e5dc; border-top: 1px solid #e8e4dc; padding: .7rem 1rem; display: flex; flex-wrap: wrap; gap: .9rem; align-items: center; }
.ga-guide .demo-ctrl label { font-family: 'JetBrains Mono', 'Courier New', monospace; font-size: .6rem; letter-spacing: .08em; text-transform: uppercase; color: #6b6760; min-width: 68px; }
.ga-guide .demo-ctrl input[type=range] { flex: 1; min-width: 80px; accent-color: #2d7a5f; }
.ga-guide .demo-ctrl .val { font-family: 'JetBrains Mono', 'Courier New', monospace; font-size: .7rem; color: #1a1814; min-width: 38px; text-align: right; }
.ga-guide .demo-ctrl-group { display: flex; align-items: center; gap: 7px; flex: 1; min-width: 150px; }

/* Interval-bisection interactive demo (ch4) */
.ga-guide #bisect-canvas { display: block; width: 100%; cursor: default; }
.ga-guide .bisect-controls { background: #e9e5dc; border-top: 1px solid #e8e4dc; padding: 0.75rem 1rem; display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.ga-guide .bisect-btn { font-family: 'JetBrains Mono', 'Courier New', monospace; font-size: 0.65rem; letter-spacing: 0.08em; text-transform: uppercase; padding: 5px 14px; border: 1px solid #d4d0c8; border-radius: 20px; background: #faf8f4; cursor: pointer; color: #3d3a34; transition: all .15s; }
.ga-guide .bisect-btn:hover { background: #e9e5dc; }
.ga-guide .bisect-btn.primary { background: #185fa5; color: #fff; border-color: #185fa5; }
.ga-guide .bisect-btn.primary:hover { background: #0c447c; }
.ga-guide #bisect-status { font-family: 'JetBrains Mono', 'Courier New', monospace; font-size: 0.7rem; color: #6b6760; }

/* CSG tree diagram (ch4) */
.ga-guide .csg-tree { font-family: 'JetBrains Mono', 'Courier New', monospace; font-size: 0.78rem; line-height: 2.2; background: #1a1814; color: #d4d0c8; border-radius: 8px; padding: 1.1rem 1.4rem; margin: 1.5rem 0; overflow-x: auto; white-space: pre-wrap; }
.ga-guide .csg-tree .culled { color: #5f5e5a; text-decoration: line-through; }
.ga-guide .csg-tree .hit    { color: #5dcaa5; }
.ga-guide .csg-tree .test   { color: #85b7eb; }
.ga-guide .csg-tree .op     { color: #fac775; }

/* Phase-plane interactive demo (ch5) */
.ga-guide #phase-canvas { display: block; width: 100%; }
.ga-guide .phase-controls { background: #e9e5dc; border-top: 1px solid #e8e4dc; padding: 0.75rem 1rem; display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }
.ga-guide .pc-group { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 160px; }
.ga-guide .pc-group label { font-family: 'JetBrains Mono', 'Courier New', monospace; font-size: 0.62rem; letter-spacing: 0.08em; text-transform: uppercase; color: #6b6760; min-width: 60px; }
.ga-guide .pc-group input[type=range] { flex: 1; accent-color: #993C1D; }
.ga-guide .pc-group .val { font-family: 'JetBrains Mono', 'Courier New', monospace; font-size: 0.7rem; color: #1a1814; min-width: 40px; text-align: right; }
.ga-guide #stability-badge { font-family: 'JetBrains Mono', 'Courier New', monospace; font-size: 0.65rem; letter-spacing: 0.08em; padding: 4px 10px; border-radius: 20px; transition: all .3s; }

/* Screen Reader Only Utility */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Illuminated Initials & Raised Caps */
.illuminated-lead {
    position: relative;
}

.raised-cap .illuminated-initial-box {
    float: left;
    margin-right: 0.05rem;
    margin-top: -1.25rem;
    margin-bottom: -0.2rem;
}

.dropped-cap .illuminated-initial-box {
    float: left;
    margin-right: 0.1rem;
    margin-top: 0.1rem;
    margin-bottom: 0.1rem;
}

.illuminated-svg {
    width: 4.8rem !important;
    height: 4.8rem !important;
    display: block !important;
}

.word-rest {
    font-weight: 600;
    letter-spacing: -0.01em;
}

.initial-fallback {
    display: none;
    font-weight: 600;
}

/* User preference toggle OFF */
[data-illuminated-initials="disabled"] .illuminated-initial-box {
    display: none !important;
}

[data-illuminated-initials="disabled"] .initial-fallback,
[data-illuminated-initials="disabled"] .word-rest {
    display: inline !important;
    font-weight: normal !important;
}

/* Print fallback */
@media print {
    .illuminated-initial-box {
        display: none !important;
    }
    .initial-fallback, .word-rest {
        display: inline !important;
        font-weight: normal !important;
    }
}

/* ---- Marginalia: handwritten margin notes, pre-rendered to SVG at build time ---- */
.marginalia {
    --marg-ink: #2c3a5a;
    --marg-k: 0.0205em;
    display: block;
    position: absolute;
    top: 0.2em;
    right: 100%;
    color: var(--marg-ink);
    pointer-events: none;
    user-select: none;
    text-decoration: none;
    border: 0;
}
.marginalia-text {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}
.marginalia-lines { display: none; }
.marginalia-lines svg {
    display: block;
    width: calc(var(--w) * var(--marg-k));
    max-width: 100%;
    height: auto;
    margin: 0 0 0.25em auto;
    overflow: visible;
}
.has-marginalia { position: relative; }
.site-layout.toc-collapsed.marg-side .marginalia-lines { display: block; }
.site-layout.toc-collapsed.marg-side a.marginalia-link { pointer-events: auto; cursor: pointer; }
a.marginalia-link:hover { --marg-ink: #121d38; }
a.marginalia-link:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; border-radius: 4px; }
body.marginalia-live .marginalia { opacity: 0; transition: opacity 0.12s linear; }
body.marginalia-live .marginalia:focus-visible { opacity: 1 !important; }
@media (prefers-reduced-motion: reduce) {
    body.marginalia-live .marginalia { transition: none; }
}
@media print {
    .marginalia-lines { display: none !important; }
}

/* ---- Collapsible contents panel ---- */
.toc-collapse {
    margin-left: auto;
    background: none;
    border: 0;
    border-radius: 6px;
    padding: 0.3rem 0.4rem;
    line-height: 0;
    cursor: pointer;
    color: inherit;
    opacity: 0.6;
}
.toc-collapse:hover, .toc-collapse:focus-visible { opacity: 1; }
.toc-collapse svg { transition: transform 0.2s; }
.toc-panel.is-collapsed .toc-collapse svg { transform: rotate(-90deg); }
.toc-panel.is-collapsed { padding: 0.7rem 1rem; }
.toc-panel.is-collapsed h3 { margin: 0; padding: 0; border-bottom: 0; }
.toc-panel.is-collapsed .toc { display: none; }
