:root {
    /* Warm mid-tone palette — darker parchment */
    --bg: #d4cfc4;
    --bg-card: #eae7e0;
    --bg-hover: #ddd9d0;
    --border: rgba(120, 100, 70, 0.12);
    --border-hover: rgba(120, 100, 70, 0.25);
    --text: #2c2416;
    --text-secondary: #5a4e3c;
    --text-muted: #8a7e6c;

    /* Muted amber/earth accent palette */
    --accent: #8b6914;
    --accent-warm: #a67c2e;
    --accent-green: #5c7a3a;
    --accent-red: #e0220f;
    --accent-purple: #6b5278;
    --accent-cyan: #4a7a7d;
    --accent-orange: #b0703a;

    /* Chart type colors — muted earth tones */
    --chart-agent: #6b89a8;
    --chart-skill: #7a9e6b;
    --chart-command: #c08c5a;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(180deg, #d4cfc4 0%, #c8bfb0 30%, #c0b5a5 60%, #b8a895 100%);
    background-attachment: fixed;
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    line-height: 1.6;
    font-weight: 400;
}

a { color: var(--accent-warm); }
a:hover { color: var(--accent); }

.container { max-width: 960px; margin: 0 auto; padding: 0 24px; }

/* Navigation — matches thinkwright standard */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    background: #0a0a0f;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.nav-logo {
    font-size: 20px;
    font-weight: 700;
    color: white;
    text-decoration: none;
    letter-spacing: -0.02em;
    display: flex;
    align-items: baseline;
    gap: 0;
}
.nav-logo a {
    text-decoration: none;
}
.nav-logo-muted {
    font-weight: 400;
    color: rgba(255, 255, 255, 0.7);
    transition: color 0.2s;
}
.nav-logo-muted:hover { color: white; }
.nav-links {
    display: flex;
    gap: 24px;
    align-items: center;
}
.nav-link {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}
.nav-link:hover { color: white; }

/* Methodology dropdown */
.nav-ref-wrapper {
    position: relative;
}
.nav-ref-trigger {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    font-family: inherit;
}
.nav-ref-trigger:hover { color: white; }
.nav-ref-trigger svg {
    width: 12px;
    height: 12px;
    transition: transform 0.2s;
}
.nav-ref-trigger.open svg {
    transform: rotate(180deg);
}
.ref-dropdown-overlay {
    position: fixed;
    inset: 0;
    top: 64px;
    z-index: 98;
    display: none;
}
.ref-dropdown-overlay.open {
    display: block;
}
.ref-dropdown {
    position: absolute;
    top: calc(100% + 16px);
    right: -80px;
    width: 780px;
    background: rgba(18, 18, 26, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
    opacity: 0;
    z-index: 99;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
}
.ref-dropdown.open {
    max-height: 80vh;
    opacity: 1;
    overflow-y: auto;
}
.ref-dropdown-inner {
    padding: 28px 28px 32px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
}
.ref-section {
    min-width: 0;
}
.ref-section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.45);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.ref-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.ref-table th {
    text-align: left;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    padding: 7px 10px 7px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    white-space: nowrap;
}
.ref-table td {
    padding: 7px 10px 7px 0;
    color: rgba(255, 255, 255, 0.6);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    line-height: 1.5;
}
.ref-table tr:last-child td {
    border-bottom: none;
}
.ref-item {
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.ref-item:last-child { border-bottom: none; }
.ref-item-title {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2px;
}
.ref-item-desc {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.55);
    line-height: 1.5;
}
.ref-threshold {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
}
.ref-threshold:last-child { border-bottom: none; }
.ref-threshold-val {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

/* Hero */
.hero {
    max-width: 960px;
    margin: 0 auto;
    padding: 88px 24px 36px;
}
.hero-inner {
    max-width: 720px;
    text-align: left;
}
.hero .edition-badge {
    display: inline-block;
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 3px 8px;
    margin-bottom: 10px;
    background: rgba(56, 152, 212, 0.15);
    border: 1px solid rgba(56, 152, 212, 0.3);
    border-radius: 2px;
    color: #2a7ab5;
}
.hero h1 {
    font-size: 2.6rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
    margin-top: 0;
    margin-bottom: 2px;
    line-height: 1.15;
}
.hero .subtitle {
    font-size: 1.15rem;
    color: var(--text);
    line-height: 1.5;
    margin-bottom: 20px;
    font-weight: 300;
    font-style: italic;
    letter-spacing: -0.01em;
    max-width: 560px;
}
.hero .subtitle a {
    color: var(--accent);
    text-decoration: none;
}
.hero .subtitle a:hover {
    text-decoration: underline;
}

/* Executive summary - research report style */
.executive-summary {
    max-width: 680px;
    margin: 24px 0 0;
    text-align: left;
    position: relative;
}

.exec-lead {
    font-size: 0.98rem;
    line-height: 1.8;
    color: var(--text);
    margin-bottom: 20px;
    font-weight: 300;
}

.exec-body {
    font-size: 0.93rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 18px;
    font-weight: 400;
}

.exec-body a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

.exec-body a:hover {
    text-decoration: underline;
}

.exec-key {
    font-size: 0.95rem;
    line-height: 1.8;
    color: var(--text);
    font-weight: 400;
    margin-top: 24px;
    padding: 20px 24px;
    background: rgba(228, 179, 100, 0.12);
    border-left: 3px solid var(--accent);
    border-radius: 0 4px 4px 0;
}

.exec-key strong {
    color: var(--accent);
    font-weight: 600;
}

/* Hero stats grid */
.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, auto);
    gap: 16px 40px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid rgba(120, 100, 70, 0.15);
    width: fit-content;
}
.hero-stat {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.hero-stat-num {
    font-size: 1.55rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.1;
}
.hero-stat-label {
    font-size: 0.66rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}
/* Warm-to-cool spectrum for stat numbers */
.hero-stat-num.color-1 { color: #8b6914; }
.hero-stat-num.color-2 { color: #9e7a2a; }
.hero-stat-num.color-3 { color: #7a8c3a; }
.hero-stat-num.color-4 { color: #4a7a7d; }
.hero-stat-num.color-5 { color: #5c7a3a; }
.hero-stat-num.color-6 { color: #c94a3a; }


/* Hero content */
.hero-content {
    margin-top: 32px;
    position: relative;
}

.hero-intro {
    margin-bottom: 28px;
}

.intro-text {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 16px;
    font-weight: 400;
    text-align: left;
}
.intro-text a {
    color: var(--accent);
    text-decoration: none;
}
.intro-text a:hover {
    text-decoration: underline;
}
.intro-text strong {
    color: var(--text);
    font-weight: 600;
}

/* Metrics grid — subtle floating cards */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin: 24px 0;
}

.metric-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px;
    transition: border-color 0.2s ease;
}

.metric-card:hover {
    border-color: var(--border-hover);
}

.metric-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    margin-bottom: 12px;
}

.metric-items {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 20px;
}

.metric-item {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.metric-value {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.metric-value.green { color: var(--accent-green); }
.metric-value.red { color: var(--accent-red); }
.metric-value.purple { color: var(--accent-purple); }
.metric-value.cyan { color: var(--accent-cyan); }

/* Key insight */
.key-insight {
    font-size: 0.92rem;
    color: var(--text);
    line-height: 1.7;
    margin-top: 24px;
    padding: 16px 20px;
    background: rgba(139, 105, 20, 0.08);
    border-left: 3px solid var(--accent);
    border-radius: 0 4px 4px 0;
    font-weight: 400;
}
.key-insight strong {
    color: var(--accent);
    font-weight: 600;
}

/* Sections */
.section {
    margin-bottom: 52px;
    padding-top: 28px;
}
.section.vignette-section {
    position: relative;
}
.section-header {
    margin-bottom: 18px;
}
.section-header h2 {
    font-size: 1.25rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    margin-bottom: 6px;
    color: #3d2a10;
}
.section-header p {
    color: var(--text-secondary);
    font-size: 0.88rem;
    max-width: 700px;
    line-height: 1.6;
    font-weight: 400;
}

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 20px;
    margin-bottom: 12px;
}

/* Chart containers — parchment mat with white inner canvas */
.chart-container {
    background: #e4dfd6;
    border: 1px solid rgba(120, 100, 70, 0.22);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
    border-radius: 3px;
    padding: 12px;
    position: relative;
    min-height: 320px;
    overflow: hidden;
}
.chart-container svg {
    display: block;
    background: #faf9f7;
}
.chart-container .sankey-zoom-controls {
    /* Zoom controls sit on the mat, not the canvas */
    background: transparent;
}

/* Controls */
.controls {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.control-group {
    display: flex;
    align-items: center;
    gap: 8px;
}
.control-group label {
    font-size: 0.72rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
}
.control-group input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 130px;
    height: 4px;
    background: rgba(120, 100, 70, 0.15);
    border-radius: 2px;
    outline: none;
    touch-action: none;
}
.control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid #f5f4f1;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
    cursor: pointer;
}
.control-group input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid #f5f4f1;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
    cursor: pointer;
}

/* Custom select — flat, theme-matched */
.control-group select,
select.custom-select {
    appearance: none;
    -webkit-appearance: none;
    background: rgba(120, 100, 70, 0.06);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 2px;
    padding: 5px 28px 5px 10px;
    font-size: 0.78rem;
    font-family: inherit;
    font-weight: 400;
    line-height: 1.4;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%235a4e3c' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 10px 6px;
    transition: border-color 0.15s, background 0.15s;
}
.control-group select:hover,
select.custom-select:hover {
    border-color: var(--border-hover);
    background-color: rgba(120, 100, 70, 0.10);
}
.control-group select:focus,
select.custom-select:focus {
    outline: none;
    border-color: var(--accent);
}
.control-group select option {
    background: rgba(234, 231, 224, 0.85);
    color: var(--text);
}

.control-value {
    font-size: 0.82rem;
    color: var(--accent);
    font-weight: 500;
    min-width: 32px;
    font-variant-numeric: tabular-nums;
}

/* Key findings (now integrated into data strip) */

/* Bar chart styles */
.bar-chart { width: 100%; }
.bar-chart .bar-group { margin-bottom: 10px; }
.bar-chart .bar-label {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-bottom: 3px;
}
.bar-chart .bar-track {
    height: 24px;
    background: rgba(0,0,0,0.03);
    position: relative;
    overflow: hidden;
}
.bar-chart .bar-fill {
    height: 100%;
    display: flex;
    align-items: center;
    padding-left: 8px;
    font-size: 0.72rem;
    font-weight: 500;
    color: white;
    transition: width 0.6s ease;
}

/* Loading */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 400;
}
.loading::before {
    content: '';
    width: 16px;
    height: 16px;
    border: 1.5px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 10px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Sankey zoom controls */
.sankey-zoom-controls {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    gap: 4px;
    z-index: 10;
}
.sankey-zoom-controls button {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 4px 10px;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
    line-height: 1;
}
.sankey-zoom-controls button:hover {
    border-color: var(--border-hover);
    color: var(--text);
}
.zoom-hint-label {
    text-align: right;
    font-size: 0.68rem;
    color: var(--text-muted);
    opacity: 0.7;
    font-style: italic;
    margin-bottom: 4px;
}

/* Zoom-active outline for gated charts */
svg.zoom-active {
    outline: 2px solid var(--accent-warm);
    outline-offset: -2px;
    border-radius: 4px;
}

/* Tooltip */
.tooltip {
    position: fixed;
    background: var(--bg-card);
    border: 1px solid var(--border-hover);
    padding: 6px 10px;
    font-size: 0.72rem;
    pointer-events: none;
    z-index: 1000;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    max-width: 240px;
    color: var(--text);
}
.tooltip .tt-title { font-weight: 500; margin-bottom: 1px; }
.tooltip .tt-value { color: var(--accent); font-variant-numeric: tabular-nums; }

/* Footer */
.footer {
    text-align: center;
    padding: 40px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.78rem;
    font-weight: 400;
}
.footer a { color: rgba(255, 255, 255, 0.65); text-decoration: none; }
.footer a:hover { text-decoration: underline; color: rgba(255, 255, 255, 0.85); }

/* Vignette cards — static margin annotations */
.vignette-card {
    position: absolute;
    right: -160px;
    top: 48px;
    width: 180px;
    background: #c9c4ba;
    border: 1px solid rgba(120, 100, 70, 0.15);
    border-radius: 10px;
    padding: 16px;
    z-index: 1;
}

.vignette-card:hover {
    border-color: var(--border-hover);
}

.vignette-card.accent-orange { border-left: 2px solid var(--accent-orange); }
.vignette-card.accent-green { border-left: 2px solid var(--accent-green); }
.vignette-card.accent-purple { border-left: 2px solid var(--accent-purple); }
.vignette-card.accent-blue { border-left: 2px solid var(--accent); }

.vignette-card-eyebrow {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
}

.vignette-card-eyebrow.orange { color: var(--accent-orange); }
.vignette-card-eyebrow.green { color: var(--accent-green); }
.vignette-card-eyebrow.purple { color: var(--accent-purple); }
.vignette-card-eyebrow.blue { color: var(--accent); }

.vignette-card-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
    line-height: 1.3;
}

.vignette-card-body {
    font-size: 12px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.stat-row {
    padding: 2px 0;
}
.stat-num {
    font-weight: 700;
    color: var(--text);
    font-size: 13px;
}
.stat-divider {
    border-top: 1px solid rgba(120, 100, 70, 0.15);
    margin: 5px 0;
    padding: 0;
}

.vignette-card-detail {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    margin-top: 0;
    transition: max-height 0.4s ease, opacity 0.3s ease, margin-top 0.3s ease;
}

.vignette-card.is-expanded .vignette-card-detail {
    max-height: 200px;
    opacity: 1;
    margin-top: 8px;
}

.vignette-card-toggle {
    display: inline-block;
    margin-top: 8px;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
    transition: color 0.2s ease;
}

.vignette-card-toggle:hover {
    color: var(--text-secondary);
}

/* Vertical hairline connecting vignette cards */
.vignette-card-container {
    position: relative;
}

.vignette-card-container::before {
    content: '';
    position: absolute;
    right: -70px;
    top: -480px;
    bottom: 60px;
    width: 1px;
    background: linear-gradient(
        to bottom,
        var(--accent-orange),
        var(--accent-orange) 95%,
        transparent
    );
    opacity: 0.25;
    pointer-events: none;
}

/* ── Report Layout ── */

/* Chapter structure */
.chapter {
    margin-bottom: 56px;
    padding-top: 32px;
    border-top: 1px solid rgba(120, 100, 70, 0.10);
    scroll-margin-top: 80px;
}
.chapter:first-child {
    border-top: none;
    padding-top: 0;
}
.chapter-number {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.10em;
    color: var(--accent);
    display: block;
    margin-bottom: 6px;
}
.chapter-title {
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: #3d2a10;
    margin-bottom: 20px;
    line-height: 1.3;
}
.chapter-subtitle {
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--text);
    margin-top: 28px;
    margin-bottom: 12px;
    letter-spacing: -0.005em;
}

/* Narrative prose blocks */
.chapter-lead {
    max-width: 680px;
    margin-bottom: 24px;
}
.chapter-lead p {
    font-size: 0.93rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 14px;
}
.chapter-lead p:last-child { margin-bottom: 0; }

.chapter-interpretation {
    max-width: 680px;
    margin-top: 24px;
    margin-bottom: 16px;
}
.chapter-interpretation p {
    font-size: 0.93rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 14px;
}
.chapter-interpretation p:last-child { margin-bottom: 0; }
.chapter-interpretation strong,
.chapter-lead strong {
    color: var(--text);
    font-weight: 600;
}

/* Figure and caption */
.report-figure {
    margin: 20px 0;
    position: relative;
}
.report-figure .chart-container {
    min-height: 280px;
}
.figure-caption {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 10px;
    line-height: 1.5;
    font-style: italic;
    padding-left: 12px;
    border-left: 2px solid rgba(120, 100, 70, 0.12);
}
.figure-caption strong {
    font-style: normal;
    font-weight: 600;
    color: var(--text-secondary);
}

/* Findings list */
.findings-list {
    list-style: none;
    padding: 0;
    margin: 16px 0;
    max-width: 680px;
}
.findings-list li {
    font-size: 0.91rem;
    line-height: 1.7;
    color: var(--text-secondary);
    padding: 8px 0 8px 20px;
    position: relative;
    border-bottom: 1px solid rgba(120, 100, 70, 0.06);
}
.findings-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 14px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
}
.findings-list li:last-child { border-bottom: none; }
.findings-list li strong { color: var(--text); font-weight: 600; }

/* Report callout boxes */
.report-callout {
    font-size: 0.90rem;
    line-height: 1.75;
    color: var(--text);
    padding: 20px 24px;
    margin: 20px 0;
    max-width: 680px;
    border-radius: 0 4px 4px 0;
    border-left: 3px solid var(--accent);
    background: rgba(228, 179, 100, 0.10);
}
.report-callout.callout-method {
    border-left-color: var(--accent-cyan);
    background: rgba(74, 122, 125, 0.08);
}
.report-callout.callout-warning {
    border-left-color: var(--accent-red);
    background: rgba(158, 66, 52, 0.06);
}

/* Report table */
.report-table {
    width: 100%;
    max-width: 680px;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 0.88rem;
}
.report-table th {
    text-align: left;
    font-weight: 600;
    color: var(--text);
    padding: 10px 12px;
    border-bottom: 2px solid rgba(120, 100, 70, 0.15);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.report-table td {
    padding: 10px 12px;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(120, 100, 70, 0.08);
    vertical-align: top;
    line-height: 1.6;
}
.report-table tr:last-child td { border-bottom: none; }
.report-table td strong { color: var(--text); font-weight: 600; }

/* Table of contents */
/* Vertical chapter nav — fixed left margin on wide viewports */
.report-toc {
    position: fixed;
    left: 20px;
    top: 44%;
    transform: translateY(-50%);
    z-index: 100;
    padding: 0;
    background: none;
    border: none;
}
.report-toc-title {
    display: none;
}
.report-toc ol {
    list-style: none;
    counter-reset: toc;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}
/* Vertical connecting line */
.report-toc ol::before {
    content: '';
    position: absolute;
    top: 8px;
    bottom: 8px;
    left: 50%;
    width: 1px;
    background: rgba(120, 100, 70, 0.18);
    transform: translateX(-50%);
}
.report-toc li {
    counter-increment: toc;
    position: relative;
    z-index: 1;
}
.report-toc li a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    background: var(--bg);
    border: 1.5px solid rgba(120, 100, 70, 0.15);
    transition: all 0.2s ease;
    margin: 5px 0;
}
.report-toc li a::before {
    content: counter(toc);
    min-width: auto;
}
.report-toc li a span.toc-label {
    position: absolute;
    left: 38px;
    white-space: nowrap;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-secondary);
    opacity: 0;
    transform: translateX(-4px);
    transition: all 0.2s ease;
    pointer-events: none;
}
.report-toc li a:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--bg-card);
    transform: scale(1.15);
}
.report-toc li a:hover span.toc-label {
    opacity: 1;
    transform: translateX(0);
}
/* Active chapter highlight */
.report-toc li a.toc-active {
    border-color: var(--accent);
    color: var(--bg-card);
    background: var(--accent);
}

/* Report metadata line in hero */
.report-meta {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 20px;
    font-weight: 400;
    letter-spacing: 0.01em;
}
.report-meta .meta-sep {
    margin: 0 4px;
    color: rgba(120, 100, 70, 0.25);
}

/* Mini-tool containers */
.mini-tool {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 20px;
    margin: 24px 0;
}
.mini-tool-title {
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--accent);
    margin-bottom: 12px;
}
.mini-tool-body {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.6;
}
.mini-tool input[type="text"],
.mini-tool input[type="search"] {
    width: 100%;
    max-width: 400px;
    padding: 8px 12px;
    font-size: 0.86rem;
    font-family: inherit;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid var(--border);
    border-radius: 3px;
    color: var(--text);
    margin-bottom: 12px;
}
.mini-tool input:focus {
    outline: none;
    border-color: var(--accent);
}
.mini-tool select {
    padding: 6px 10px;
    font-size: 0.84rem;
    font-family: inherit;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid var(--border);
    border-radius: 3px;
    color: var(--text);
    margin-bottom: 12px;
}

/* Type badges for mini-tool results */
.type-badge {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 2px 6px;
    border-radius: 2px;
}
.type-badge.agent { background: rgba(107, 137, 168, 0.2); color: var(--chart-agent); }
.type-badge.skill { background: rgba(122, 158, 107, 0.2); color: var(--chart-skill); }
.type-badge.command { background: rgba(192, 140, 90, 0.2); color: var(--chart-command); }

/* Inline score bar for mini-tool results */
.score-bar {
    display: inline-block;
    height: 6px;
    border-radius: 3px;
    background: var(--accent);
    vertical-align: middle;
}

/* Boundary audit expand/collapse */
.audit-hidden-rows {
    display: none;
}
.audit-hidden-rows.audit-visible {
    display: table-row-group;
}
.audit-expand-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding: 4px 0;
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.78rem;
    cursor: pointer;
    transition: color 0.15s;
}
.audit-expand-btn:hover {
    color: var(--accent-warm);
}
.audit-chevron {
    display: inline-block;
    transform: rotate(90deg);
    transition: transform 0.3s ease;
    font-size: 0.9rem;
    line-height: 1;
}
.audit-expand-btn[aria-expanded="true"] .audit-chevron {
    transform: rotate(-90deg);
}

/* Mode tab toggle (Static / Runtime) */
.mode-tab-group {
    display: inline-flex;
    gap: 0;
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}
.mode-tab {
    padding: 4px 14px;
    font-size: 0.72rem;
    font-family: inherit;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.mode-tab.active {
    background: var(--accent);
    color: white;
}

/* Section divider */
.section-divider {
    height: 1px;
    background: linear-gradient(
        to right,
        transparent,
        rgba(120, 100, 70, 0.15) 20%,
        rgba(120, 100, 70, 0.15) 80%,
        transparent
    );
    margin: 48px 0;
}

/* ── Responsive ── */

/* Vignette cards — show inline on narrow viewports */
@media (max-width: 1199px) {
    .vignette-card {
        position: static;
        right: auto;
        top: auto !important;
        width: 100%;
        max-width: 680px;
        margin: 20px 0;
    }
    .vignette-section[style*="height:0"] {
        height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    .vignette-card-container::before { display: none; }

    .report-toc {
        display: none;
    }
}

@media (max-width: 768px) {
    .hero h1 { font-size: 2rem; }
    .strip-sep { margin: 0 8px; }
    .strip-row { font-size: 0.75rem; }
    .chart-container { min-height: 240px; padding: 12px; }
    .chapter-title { font-size: 1.15rem; }
    /* report-toc already hidden at ≤1199px */
}
