        /* === A4 Print Layout === */
        @page { size: A4; margin: 20mm 18mm 25mm 18mm; }
        @media print {
            body { padding: 0; margin: 0; max-width: 170mm; }
            .no-print { display: none !important; }
            .page-break { page-break-before: always; }
            .avoid-break { page-break-inside: avoid; }
            a { color: inherit; text-decoration: none; }
            .toc a { color: #1a1a2e; }
        }

        /* === Base Styles === */
        * { box-sizing: border-box; margin: 0; padding: 0; }
        body {
            font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
            font-size: 11pt; line-height: 1.7; color: #1a1a2e;
            max-width: 960px; margin: 0 auto; padding: 40px 48px; background: white;
        }

        /* === Typography === */
        h1 { font-size: 22pt; font-weight: 700; color: #0f172a; margin-bottom: 8pt; line-height: 1.2; }
        h2 { font-size: 15pt; font-weight: 600; color: #1e293b; margin-top: 24pt; margin-bottom: 10pt; padding-bottom: 4pt; border-bottom: 2px solid #e2e8f0; }
        h3 { font-size: 12pt; font-weight: 600; color: #334155; margin-top: 16pt; margin-bottom: 8pt; }
        h4 { font-size: 10.5pt; font-weight: 600; color: #475569; margin-top: 12pt; margin-bottom: 6pt; }
        p { margin-bottom: 8pt; }

        /* === Title Page === */
        .title-page { text-align: center; padding: 60pt 0 40pt; min-height: 60vh; display: flex; flex-direction: column; justify-content: center; align-items: center; }
        .title-page .series-label { font-size: 10pt; font-weight: 500; text-transform: uppercase; letter-spacing: 2px; color: #0f766e; margin-bottom: 16pt; }
        .title-page h1 { font-size: 28pt; margin-bottom: 12pt; }
        .title-page .subtitle { font-size: 13pt; color: #64748b; font-weight: 400; max-width: 580px; margin-bottom: 40pt; }
        .title-page .meta { font-size: 9pt; color: #94a3b8; }

        /* === Table of Contents === */
        .toc { padding: 16pt 20pt; background: #f8fafc; border-radius: 8pt; margin: 20pt 0; }
        .toc h2 { font-size: 12pt; margin-top: 0; border: none; padding-bottom: 8pt; }
        .toc ol { list-style: none; counter-reset: toc; padding: 0; }
        .toc > ol > li { counter-increment: toc; margin-bottom: 4pt; }
        .toc > ol > li::before { content: counter(toc) ". "; font-weight: 600; color: #0f766e; }
        .toc a { color: #334155; text-decoration: none; }
        .toc a:hover { color: #0f766e; }
        .toc .sub-items { padding-left: 20pt; list-style: none; }
        .toc .sub-items li { font-size: 9.5pt; color: #64748b; margin-bottom: 2pt; }
        .toc .toc-part-label { font-weight: 600; font-size: 10pt; color: #0f766e; text-transform: uppercase; letter-spacing: 1px; margin-top: 12pt; margin-bottom: 4pt; padding-top: 8pt; border-top: 1px solid #e2e8f0; }
        .toc .toc-part-label:first-child { margin-top: 0; padding-top: 0; border-top: none; }

        /* === Part Dividers === */
        .part-divider { text-align: center; padding: 40pt 0 20pt; }
        .part-divider .part-label { font-size: 10pt; font-weight: 500; text-transform: uppercase; letter-spacing: 3px; color: #0f766e; margin-bottom: 8pt; }
        .part-divider h2 { border: none; font-size: 18pt; margin-top: 0; }
        .part-divider p { color: #64748b; font-size: 10.5pt; }

        /* === Info Boxes === */
        .info-box {
            background: #fafafa;
            border: 1px solid #e2e8f0;
            padding: 12pt 16pt;
            border-radius: 6pt;
            margin: 12pt 0;
            font-size: 10pt;
        }
        .info-box-title { font-weight: 600; margin-bottom: 4pt; }

        /* === Glossary === */
        .glossary { background: #fafafa; border: 1px solid #e2e8f0; border-radius: 8pt; padding: 16pt; margin: 16pt 0; }
        .glossary h3 { margin-top: 0; font-size: 11pt; }
        .glossary dl { margin: 0; }
        .glossary dt { font-weight: 600; color: #1e293b; margin-top: 8pt; }
        .glossary dd { margin-left: 0; padding-left: 16pt; color: #475569; font-size: 10pt; }

        /* === Figures === */
        figure { margin: 16pt 0; text-align: center; page-break-inside: avoid; }
        figure {
            margin: 16pt 0;
            text-align: center;
            page-break-inside: avoid;
        }

        figure img {
            max-width: 100%;
            border: 1px solid #e2e8f0;
            border-radius: 6pt;
            box-shadow: 0 2px 8px rgba(0,0,0,0.08);
        }

        figcaption { font-size: 9pt; color: #64748b; font-style: italic; margin-top: 6pt; }

        /* === Tables === */
        table { width: 100%; border-collapse: collapse; margin: 12pt 0; font-size: 10pt; page-break-inside: avoid; }
        th, td { padding: 8pt 10pt; text-align: left; border-bottom: 1px solid #e2e8f0; }
        th { background: #f8fafc; font-weight: 600; color: #334155; font-size: 9.5pt; text-transform: uppercase; letter-spacing: 0.5px; }

        /* === Code / Formulas === */
        code { font-family: 'JetBrains Mono', monospace; font-size: 9pt; background: #f1f5f9; padding: 1pt 4pt; border-radius: 3pt; color: #0f172a; }
        pre { font-family: 'JetBrains Mono', monospace; font-size: 9pt; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 6pt; padding: 12pt 16pt; overflow-x: auto; margin: 10pt 0; line-height: 1.6; }
        .formula-box { background: #f8fafc; border: 1px solid #cbd5e1; border-radius: 8pt; padding: 16pt 20pt; margin: 14pt 0; text-align: center; page-break-inside: avoid; }
        .formula-box .formula { font-family: 'JetBrains Mono', monospace; font-size: 11pt; color: #1e293b; margin: 8pt 0; }
        .formula-box .formula-label { font-size: 9pt; color: #64748b; margin-top: 6pt; }

        /* === Example Walkthrough === */
        .example-box { background: #fefce8; border: 1px solid #fde68a; border-radius: 8pt; padding: 16pt; margin: 14pt 0; page-break-inside: avoid; }
        .example-box h4 { color: #92400e; margin-top: 0; }
        .example-box .calculation { font-family: 'JetBrains Mono', monospace; font-size: 9.5pt; background: white; border-radius: 4pt; padding: 10pt; margin: 8pt 0; }

        /* === Method Comparison Table === */
        .method-comparison { border: 2px solid #e2e8f0; border-radius: 8pt; overflow: hidden; margin: 16pt 0; }
        .method-comparison th { background: #1e293b; color: white; text-transform: none; font-size: 10pt; }
        .method-comparison td { vertical-align: top; }
        .method-comparison .rank-best { color: #16a34a; font-weight: 600; }
        .method-comparison .rank-good { color: #2563eb; font-weight: 600; }
        .method-comparison .rank-ok { color: #d97706; font-weight: 600; }
        .method-comparison .rank-caution { color: #dc2626; font-weight: 600; }

        /* === References === */
        .references { margin-top: 30pt; }
        .references h2 { border-bottom: 2px solid #334155; }
        .references p { padding-left: 36pt; text-indent: -36pt; margin-bottom: 6pt; font-size: 9.5pt; line-height: 1.5; }

        /* === Utility === */
        .text-muted { color: #94a3b8; }
        .ui-path { font-family: 'JetBrains Mono', monospace; font-size: 9pt; color: #0f766e; font-weight: 500; }
        ul, ol { margin-bottom: 8pt; padding-left: 20pt; }
        li { margin-bottom: 4pt; }

        /* ============================================================
           Faithful TURF (MaxDiff) UI replica.
           Mirrors app/templates/analysis/turf/_turf_main.html and
           _sidebar_turf.html so the mockups look like the live page.
           ============================================================ */
        .md-card { background: white; border: 1px solid #e5e7eb; border-radius: 10px; margin: 14pt 0; page-break-inside: avoid; box-shadow: 0 2px 6px rgba(15,23,42,0.05); }
        .md-card-header { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; border-bottom: 1px solid #f1f5f9; gap: 12px; flex-wrap: wrap; }
        .md-card-header h5 { margin: 0; font-size: 10pt; font-weight: 600; color: #1e293b; }
        .md-card-body { padding: 14px 16px; font-size: 9.5pt; }
        .md-btn-teal { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border: none; border-radius: 8px; background: #0f766e; color: #fff; font-weight: 600; font-size: 8.5pt; }
        .md-export-btn { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 6px; border: 1px solid #cbd5e1; background: #fff; color: #334155; font-size: 8pt; font-weight: 500; margin-left: 5px; }
        .md-field-label { font-size: 8.5pt; color: #64748b; font-weight: 500; display: block; margin-bottom: 4px; }
        .md-field-input { display: flex; align-items: center; border: 1.5px solid #94a3b8; border-radius: 6px; padding: 5px 9px; font-size: 9pt; color: #0f172a; background: #fff; box-shadow: inset 0 1px 2px rgba(15,23,42,0.05); min-height: 30px; }
        .md-field-input.num { width: 80px; }
        .md-help { margin-top: 10px; padding: 8px 11px; background: #f8fafc; border-left: 2px solid #0f766e; border-radius: 4px; font-size: 8.5pt; color: #475569; line-height: 1.5; }
        .turf-settings-grid { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; }
        .turf-field { display: flex; flex-direction: column; gap: 2px; min-width: 120px; }
        .turf-field-wide { flex: 0 1 340px; min-width: 240px; }

        /* Item checkboxes (Assortment) */
        .mk-checkbox { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid #e2e8f0; border-radius: 6px; margin-bottom: 4px; font-size: 9pt; background: #fff; }
        .mk-checkbox.selected { border-color: #0f766e; background: #ecfdf5; }
        .mk-box { width: 13px; height: 13px; border: 1.5px solid #94a3b8; border-radius: 3px; flex-shrink: 0; display: inline-block; }
        .mk-box.on { background: #0f766e; border-color: #0f766e; position: relative; }
        .mk-box.on::after { content: '\F26E'; font-family: 'bootstrap-icons'; color: #fff; font-size: 9px; position: absolute; top: -2px; left: 0; }

        /* Importance / ranking bars (Relative Preference, P(Accept)) */
        .imp-head { display: flex; align-items: center; gap: 12px; padding-bottom: 6px; margin-bottom: 8px; border-bottom: 1px solid #f1f5f9; font-size: 7pt; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: #94a3b8; }
        .imp-head .ih-rank { width: 22px; flex-shrink: 0; }
        .imp-head .ih-name { width: 180px; flex-shrink: 0; }
        .imp-head .ih-bar { flex: 1; }
        .imp-head .ih-value { width: 48px; text-align: right; flex-shrink: 0; }
        .imp-head .ih-secondary { width: 56px; text-align: right; flex-shrink: 0; }
        .imp-list { display: flex; flex-direction: column; gap: 9px; }
        .imp-item { display: flex; align-items: center; gap: 12px; }
        .imp-item .rank-badge { width: 22px; height: 22px; border-radius: 5px; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 8pt; flex-shrink: 0; background: #e2e8f0; color: #64748b; }
        .imp-item.top-3 .rank-badge { background: #f7a813; color: #78350f; }
        .imp-item .attr-name { width: 180px; flex-shrink: 0; font-weight: 500; font-size: 9pt; color: #374151; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .imp-item.top-3 .attr-name { font-weight: 600; color: #1e293b; }
        .imp-item .bar-container { flex: 1; height: 20px; background: #f1f5f9; position: relative; }
        .imp-item .bar-fill { height: 100%; background: #7c9b95; }
        .imp-item.top-3 .bar-fill { background: #f7a813; }
        .imp-item .score-value { width: 48px; text-align: right; font-size: 9pt; font-weight: 600; color: #374151; flex-shrink: 0; }
        .imp-item.top-3 .score-value { color: #b45309; }
        .imp-item .accept-value { width: 56px; text-align: right; font-size: 9pt; font-weight: 600; color: #0f766e; flex-shrink: 0; }

        /* Share-of-choice horizontal bars */
        .soc-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 9pt; }
        .soc-name { width: 150px; flex-shrink: 0; color: #374151; }
        .soc-track { flex: 1; height: 18px; background: #f1f5f9; }
        .soc-fill { height: 100%; background: #7c9b95; }
        .soc-pct { width: 46px; text-align: right; font-variant-numeric: tabular-nums; color: #475569; }

        /* TURF combination table */
        .turf-combo-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 9pt; margin: 0; }
        .turf-combo-table thead th { background: #f8fafc; font-weight: 600; font-size: 7pt; text-transform: uppercase; letter-spacing: 0.5px; padding: 6px 10px; color: #475569; border-bottom: 1px solid #e5e7eb; }
        .turf-combo-table tbody td { padding: 8px 10px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
        .turf-combo-table tbody tr.is-best { background: #ecfdf5; }
        .turf-id-chip { display: inline-block; background: #e2e8f0; color: #0f172a; font-family: 'JetBrains Mono', monospace; font-size: 7.5pt; padding: 1px 5px; border-radius: 4px; margin-right: 3px; }
        .is-best .turf-id-chip { background: #99f6e4; color: #134e4a; }
        .turf-combo-names .item-sep { color: #94a3b8; margin: 0 5px; }
        .turf-combo-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

        /* Ladder cumulative-reach bar */
        .turf-cum { display: flex; align-items: center; gap: 10px; }
        .turf-cum-track { flex: 1; height: 13px; min-width: 70px; background: #f1f5f9; border-radius: 4px; overflow: hidden; }
        .turf-cum-fill { height: 100%; background: #0f766e; border-radius: 4px; }
        .turf-cum-pct { font-size: 8pt; font-variant-numeric: tabular-nums; color: #475569; min-width: 42px; text-align: right; }

        /* Sidebar replica */
        .sb-mock { max-width: 300px; border: 1px solid #e2e8f0; border-radius: 10px; padding: 12px; background: #fff; font-size: 9pt; }
        .sb-badge { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: #0f766e; margin-bottom: 10px; }
        .sb-card { padding: 10px 12px; margin-bottom: 8px; border: 1px solid #e2e8f0; border-radius: 8px; background: #f8fafc; }
        .sb-label { font-size: 7pt; text-transform: uppercase; letter-spacing: 0.5px; color: #64748b; font-weight: 600; margin-bottom: 6px; }
        .sb-select { border: 1.5px solid #94a3b8; border-radius: 6px; padding: 4px 8px; font-size: 8.5pt; background: #fff; display: flex; justify-content: space-between; align-items: center; }
        .sb-meta { display: flex; flex-direction: column; gap: 2px; padding-top: 6px; font-size: 7.5pt; color: #64748b; }
        .sb-section { font-size: 7pt; text-transform: uppercase; letter-spacing: 0.5px; color: #94a3b8; font-weight: 700; margin: 10px 0 4px; }
        .sb-nav { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; font-size: 8.5pt; color: #475569; }
        .sb-nav.active { background: #ecfdf5; color: #0f766e; font-weight: 600; }
        .sb-nav i { width: 16px; text-align: center; }
        .sb-pdf { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 4px; padding: 7px 10px; border: 1px solid #e2e8f0; border-radius: 8px; background: #fff; color: #475569; font-size: 8.5pt; font-weight: 600; }

        /* Print Button */
        .print-btn { position: fixed; bottom: 20px; right: 20px; background: #0f766e; color: white; border: none; padding: 10px 20px; border-radius: 8px; cursor: pointer; font-size: 14px; box-shadow: 0 2px 10px rgba(0,0,0,0.2); z-index: 100; }
        .print-btn:hover { background: #0d615a; }
