/* report_v8.css — Grand County Timed Entry Study */

/* === FONTS === */

/* Aeonik — body and UI font */
@font-face {
    font-family: "Aeonik";
    src: url("fonts/Aeonik-Regular.otf")
        format("opentype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Aeonik";
    src: url("fonts/Aeonik-RegularItalic.otf")
        format("opentype");
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}
@font-face {
    font-family: "Aeonik";
    src: url("fonts/Aeonik-Bold.otf") format("opentype");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Aeonik";
    src: url("fonts/Aeonik-BoldItalic.otf")
        format("opentype");
    font-weight: 700;
    font-style: italic;
    font-display: swap;
}
/* Caslon Ionic — display/title only */
@font-face {
    font-family: "Caslon Ionic";
    src: url("fonts/CaslonIonic-Thin.otf")
        format("opentype");
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

/* === DESIGN SYSTEM === */

/* ── Design tokens (OpenAI-aligned neutral palette) ── */
:root {
    --c-bg: #ffffff;
    --c-surface: #ffffff;
    --c-surface-alt: #f5f5f5; /* OpenAI secondarySolid-4 */
    --c-border: #e5e5e5; /* OpenAI secondarySolid-12 */
    --c-text: #0d0d0d; /* near-black */
    --c-text-muted: #6b6b6b; /* OpenAI secondarySolid-44 */
    --c-text-faint: #adadad; /* OpenAI secondarySolid-60 */

    /* Accent — muted blue (links & interactive only, not backgrounds) */
    --c-accent: #4a6fa5;
    --c-accent-bg: #f5f7fb; /* barely-there blue tint */
    --c-accent-border: #dce4f0;
    --c-accent-text: #1e3a6e;

    /* Caution — near-neutral warm */
    --c-caution: #faf8f3;
    --c-caution-border: #e0d5c0;
    --c-caution-text: #4a3010;
    --c-caution-label: #6b4510;

    /* Positive / green */
    --c-green: #2e7d32;
    --c-green-bg: #f2f8f2; /* barely-there green */

    /* TOC — black active state (OpenAI style) */
    --c-toc-active: #0d0d0d;
    --c-toc-bar: #0d0d0d;

    /* Park identity colors */
    --park-arch: #5c6bc0;
    --park-cany: #0F968A;
    --park-care: #E09409;
    --park-brca: #EA338E;
    --park-zion: #6b7280;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 2rem;
    overflow-x: hidden;
}
#exec-summary-alt > .section-h2:first-child {
    padding-top: 0.5rem;
    margin-top: 0;
}

/* ── Body baseline ── */
body {
    background-color: var(--c-bg);
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 1rem;
    line-height: 1.55;
    color: var(--c-text);
}

/* ── Prose spacing ── */
p,
ul,
ol,
dl {
    margin-bottom: 1rem;
}
ul,
ol {
    /* offset last li's 0.75rem so total after-list space = 1rem */
    margin-bottom: 0.25rem;
}
li {
    margin-bottom: 0.75rem;
}

/* ── List style in prose content ── */
.main-content ul {
    list-style: disc;
    padding-left: 1.5rem;
}

/* ── Global text-wrap ── */
h1,
h2,
h3,
h4,
h5 {
    text-wrap: pretty;
    line-height: 1.5;
}
h5 {
    margin: 0 0 1rem;
    font-weight: normal;
    font-style: italic;
    opacity: .6;
}
p,
li,
td,
th,
blockquote {
    text-wrap: pretty;
}

/* ── Underline links in prose contexts by default ── */
p a,
li a,
td a,
th a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: opacity 0.15s;
}
p a:hover,
li a:hover,
td a:hover,
th a:hover {
    opacity: 0.7;
}

/* ── Links inside purple callout-info boxes ── */
.callout-info a,
.faq-accordion a,
.study-accordion a {
    color: #5c6bc0;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ── Tabular numerics in tables ── */
.data-table td,
.detail-table td,
.data-table th,
.detail-table th {
    font-variant-numeric: tabular-nums;
    line-height: 1.5;
}
.c-indigo { color: #5c6bc0; }

.callout-appendix {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    color: #111;
    padding: 14px 20px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    text-decoration: none;
    margin: 1.25rem 0;
    font-size: 0.9rem;
    font-weight: 500;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.callout-appendix:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.08), 0 1px 4px rgba(0,0,0,0.04);
    border-color: #9ca3af;
}
.callout-appendix span {
    text-decoration: none;
}
.callout-appendix .callout-appendix__arrow {
    font-size: 1.1rem;
    color: #9ca3af;
    transition: color 0.2s ease;
}
.callout-appendix:hover .callout-appendix__arrow {
    color: #374151;
}

span.status {
    background: #5c6bc0;
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    position: relative;
    top: -1px;
}

code {
    background: rgba(0, 0, 0, .05);
    padding: 4px 8px;
    margin: 0;
    border-radius: 6px;
    font-family: 'JetBrains Mono';
    font-size: .85em !important;
    color: rgba(0, 0, 0, .7);
    white-space: nowrap;
}

/* Allow code/file paths inside table cells to wrap */
.data-table td code,
.detail-table td code {
    white-space: normal;
    word-break: break-all;
}

/* ── Paragraph and section spacing ── */
.header-wrap {
    background: var(--c-bg);
    max-width: 1240px;
    margin: 0 auto;
    padding: 3.5rem 4rem 2.5rem;
    border-bottom: 1px solid var(--c-border);
}
@media (max-width: 1024px) {
    .header-wrap {
        padding: 2.5rem 2rem 2rem;
    }
}
@media (max-width: 640px) {
    .header-wrap {
        padding: 2rem 1.25rem 1.75rem;
    }
}

.page-subtitle {
    color: #8a8077;
    font-size: 1.2rem;
    line-height: 1.4;
    margin-top: 0.875rem;
}

/* ── Layout shell ── */
.layout-shell {
    display: flex;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 4rem;
    gap: 3.5rem;
}
@media (max-width: 1024px) {
    .layout-shell {
        padding: 0 2rem;
        gap: 2.5rem;
    }
}
@media (max-width: 640px) {
    .layout-shell {
        padding: 0 1.25rem;
    }
}

/* ── Floating TOC ── */
.floating-toc {
    font-family:
        "Aeonik",
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}

/* ── Floating TOC — exact Shape of AI pattern ── */
.floating-toc__header {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: #9a9a9a;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
}
.floating-toc__section-label {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #c8c8c8;
    padding: 0.65rem 0 0.15rem 0;
    pointer-events: none;
    user-select: none;
}
.floating-toc__icon {
    color: #9a9a9a;
    flex-shrink: 0;
}

.floating-toc__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.floating-toc__item {
    margin: 0;
    padding: 0;
    transition: opacity 200ms ease;
}

.floating-toc__link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0;
    text-decoration: none;
    transition: all 150ms ease;
    cursor: pointer;
    touch-action: manipulation;
}
/* Horizontal progress bar — Shape of AI exact spec */
.floating-toc__indicator {
    width: 1rem;
    height: 0.125rem;
    border-radius: 1px;
    background-color: #d4d4d4;
    flex-shrink: 0;
    transition: width 150ms ease;
    position: relative;
    overflow: hidden;
}
.floating-toc__indicator::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background-color: #555;
    border-radius: 1px;
}
.floating-toc__link.is-active .floating-toc__indicator {
    width: 2rem;
}
.floating-toc__link.is-active .floating-toc__indicator::after {
    width: var(--progress, 0%);
}

.floating-toc__label {
    font-size: 0.8125rem;
    font-weight: 400;
    color: #858585;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: opacity 200ms ease;
    max-width: 11rem;
    display: block;
}
.floating-toc__link.is-active .floating-toc__label {
    color: #1a1b1f;
    font-weight: 600;
}
.floating-toc__link:hover .floating-toc__label {
    color: #555;
}
/* Active links: suppress the global li a:hover opacity:0.7 */
.floating-toc__link.is-active:hover,
.floating-toc__child-link.is-active:hover {
    opacity: 1;
}
/* TOC focus-visible */
.floating-toc__link:focus-visible,
.floating-toc__child-link:focus-visible {
    outline: 2px solid #888;
    outline-offset: 2px;
    border-radius: 2px;
}

/* Nested H3 children — Shape of AI: margin-left calc(2.25rem + 2px) */
.floating-toc__children {
    list-style: none;
    margin: 0.25rem 0 0 calc(2.25rem + 2px);
    padding: 0;
}
.floating-toc__child {
    margin: 0;
    padding: 0;
}
.floating-toc__child-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.125rem 0;
    font-size: 0.75rem;
    color: #858585;
    text-decoration: none;
    transition: color 150ms ease;
    cursor: pointer;
    touch-action: manipulation;
}
.floating-toc__child-link:hover {
    color: #555;
}
.floating-toc__child-link.is-active {
    color: #1a1b1f;
}
.floating-toc__child-arrow {
    width: 1rem;
    flex-shrink: 0;
    color: #9a9a9a;
    font-size: 0.75rem;
    text-align: center;
    transition: color 150ms ease;
}
.floating-toc__child-link.is-active .floating-toc__child-arrow {
    color: #1a1b1f;
}
.floating-toc__child-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 9rem;
    display: block;
}

/* Appendix subsection in TOC */
.floating-toc__header + .floating-toc__list .floating-toc__link {
    font-size: 0.75rem;
}

/* Collapsed TOC for medium viewports */
@media (max-width: 767px) {
    .toc-sidebar {
        display: none;
    }
}
@media (min-width: 768px) and (max-width: 1023px) {
    .main-content {
        min-width: 0;
    }
    .toc-sidebar {
        width: 2.75rem !important;
        overflow: visible;
    }
    .floating-toc {
        position: relative;
        padding: 0.5rem;
        border-radius: 8px;
        transition:
            background-color 150ms ease,
            box-shadow 150ms ease,
            border-color 150ms ease;
        border: 1px solid transparent;
        z-index: 20;
        width: max-content;
        min-width: 2rem;
    }
    .floating-toc:hover {
        background-color: white;
        border-color: #e5e5e5;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    }
    .floating-toc__header {
        display: none;
    }
    .floating-toc__label {
        opacity: 0;
        transition: opacity 150ms ease;
        width: 0;
        max-width: 0;
        overflow: hidden;
    }
    .floating-toc__children {
        display: none;
    }
    .floating-toc__link {
        padding: 0.35rem 0;
    }
    .floating-toc__indicator {
        margin-right: 0.5rem;
    }
    .floating-toc:hover .floating-toc__label {
        opacity: 1;
        width: auto;
        max-width: 11rem;
    }
    .floating-toc:hover .floating-toc__link {
        padding: 0.25rem 0;
    }
    .floating-toc__section-label {
        display: none;
    }
    .floating-toc:hover .floating-toc__section-label {
        display: block;
    }
}

/* ── Tables ── */
.data-table {
    width: 100%;
    border-collapse: collapse;
}
.data-table thead tr {
    border-bottom: 2px solid var(--c-text);
}
.data-table th {
    text-align: left;
    padding: 10px 14px;
    font-weight: 700;
    font-size: 0.72em;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--c-text-muted);
}
.data-table td {
    padding: 13px 14px;
    border-bottom: 1px solid var(--c-border);
    vertical-align: top;
}
.data-table tbody tr:nth-child(even) td {
    background: rgba(0, 0, 0, 0.018);
}
.data-table tbody tr:last-child td {
    border-bottom: 2px solid var(--c-text);
}
.data-table tbody tr:hover td {
    background: rgba(0, 0, 0, 0.03);
}

.detail-table {
    width: 100%;
    border-collapse: collapse;
}
.detail-table thead tr {
    border-bottom: 2px solid var(--c-text);
}
.detail-table th {
    text-align: left;
    padding: 11px 16px;
    font-weight: 700;
    font-size: 0.72em;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--c-text-muted);
    vertical-align: bottom;
}
.detail-table td {
    padding: 18px 16px;
    border-bottom: 1px solid var(--c-border);
    vertical-align: top;
    font-size: 0.85rem;
}
.detail-table tbody tr:nth-child(even) td {
    background: rgba(0, 0, 0, 0.018);
}
.detail-table tbody tr:last-child td {
    border-bottom: 2px solid var(--c-text);
}
.detail-table tbody tr:hover td {
    background: rgba(0, 0, 0, 0.03);
}

/* Break a table rightward into the layout shell's available whitespace.
   Layout constants: shell(max 1240px, pad 4rem) > toc(13rem) + gap(3.5rem) + main(max 700px)
   Main gets capped at 700px once viewport > 1092px; extension fills the right remainder.
   At ≤1092px the table just fills content width. At ≥1304px it reaches the shell's outer edge.

   WHY THE OLD VERSION BROKE: width: calc(100% + clamp(...)) makes .table-full wider than
   .main-content, which is the intended rightward extension. But html { overflow-x: hidden }
   clips anything whose right edge exceeds the viewport. The old code had NO max-width, so on
   any viewport where the clamp produced a non-zero extension, the browser could (and did) clip
   the right portion of the table rather than scroll it.

   THE FIX: constrain .table-full with max-width so it can never extend past the viewport.
   The right edge of safe content = min(viewport, shell outer right edge).
   Shell outer right edge = min(100vw, 1240px) centered → right edge offset from .table-full's
   left = min(100vw, 1240px) - (shell_left_pad + toc + gap) = min(100vw, 1240px) - 20.5rem.
   This ensures .table-full stays within the viewport at all widths. If the table inside is
   wider than the max-width, overflow-x:auto provides a scrollbar. */
.table-full {
    width: calc(100% + clamp(0px, 100vw - 1092px, 212px));
    max-width: calc(min(100vw, 1240px) - 20.5rem);
    display: block;
    overflow-x: auto;
}

@media (max-width: 1091px) {
    .table-full {
        width: 100%;
        max-width: 100%;
        display: block;
        overflow-x: auto;
    }
}

/* ── Pull quotes ── */
/* Decorative side quotes, visible only on wide viewports (≥1240px).
   Float right into the gutter between main content and viewport edge. */
.pullquote {
    display: none;
}
@media (min-width: 1340px) {
    .pullquote {
        display: block;
        float: right;
        clear: right;
        width: 200px;
        margin: 0.25rem -230px 1.5rem 1.75rem;
        padding: 0;
        font-family: var(--font-sans, -apple-system, sans-serif);
        font-size: 0.9rem;
        line-height: 1.45;
        font-style: italic;
        color: #5c6bc0;
        border-top: 2px solid #5c6bc0;
        padding-top: 0.75rem;
    }
    .pullquote footer {
        display: block;
        margin-top: 0.5rem;
        font-family: var(--font-sans, -apple-system, sans-serif);
        font-size: 0.75rem;
        font-style: normal;
        color: #5c6bc0;
        opacity: 0.8;
        letter-spacing: 0.02em;
    }
    .pullquote footer a {
        color: #5c6bc0;
        opacity: 0.8;
        transition: opacity 0.15s ease;
    }
    .pullquote footer a:hover {
        opacity: 1;
    }
}

@media (max-width: 767px) {
    .table-full {
        width: 100%;
        max-width: 100%;
        display: block;
        overflow-x: auto;
    }
}

.verdict {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 3px;
    font-size: 0.78em;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
    background: var(--c-green-bg);
    color: var(--c-green);
}

/* ── Inline verdict badges ── */
.badge-neutral {
    font-style: italic;
    font-weight: 400;
    color: var(--c-text-muted);
    font-size: 0.82em;
    line-height: 1.45;
}

/* ── Section headings ── */
.section-h2 {
    font-size: 2rem;
    line-height: 1.2;
    font-weight: 600;
    color: var(--c-text);
    margin-top: 3.5rem;
    margin-bottom: 1.25rem;
    padding-bottom: 0.625rem;
    border-bottom: 2px solid var(--c-border);
}
.section-h2::before {
    display: block;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--c-text-faint);
    margin-bottom: 0.5rem;
}
/* Definition popovers */
.dfn {
    border-bottom: 1.5px dotted rgba(0,0,0,0.35);
    color: inherit;
    cursor: help;
    text-decoration: none;
}
/* Footnote triggers */
.fn { display: inline; cursor: help; }
.fn-num {
    font-size: 0.65em;
    vertical-align: super;
    line-height: 0;
    color: #2563eb;
    font-weight: 600;
    border-bottom: 1px dotted #2563eb;
    padding: 0 1px;
}
/* Shared floating tooltip */
#pop-tip {
    display: none;
    position: absolute;
    top: 0; left: 0;
    background: #1e293b;
    color: #f8fafc;
    font-size: 0.9em;
    font-weight: 400;
    line-height: 1.55;
    padding: 8px 12px;
    border-radius: 6px;
    max-width: 250px;
    width: max-content;
    z-index: 10000;
    pointer-events: none;
    box-shadow: 0 4px 14px rgba(0,0,0,0.18);
}
#pop-arrow {
    position: absolute;
    width: 10px; height: 10px;
    background: #1e293b;
    transform: rotate(45deg);
}

.section-eyebrow {
    display: block;
    font-size: 1rem;
    margin-bottom: 1rem;
    opacity: .6;
}
.section-h3 {
    font-size: 1.5rem;
    line-height: 1.3;
    font-weight: 600;
    color: #2a2a2a;
    margin-top: 4rem;
    margin-bottom: 0.75rem;
    text-wrap: pretty;
}
.section-h4 {
    font-size: 1.1rem;
    line-height: 1.35;
    font-weight: 600;
    color: #2a2a2a;
    margin-top: 1.75rem;
    margin-bottom: 0.5rem;
    text-wrap: pretty;
}
.chart-h4 {
    margin-top:0;
    margin-bottom:0.25rem;
    font-size: 1.1rem;
    line-height: 1.35;
    font-weight: 600;
    color: #2a2a2a;
    text-wrap: pretty;
}
.section-h4.subhead {
    font-weight: 500;
    font-style: italic;
    margin-top: 0;
    margin-bottom: 2rem;
    opacity: 0.8;
}
.chart-h5 {
    color: #2a2a2a;
    font-size: 0.875rem;
    line-height: 1.5;
    text-wrap: pretty;
    margin-block-end: 12px;
    margin-block-start: 12.4px;
    font-weight: 400;
    margin-top: 0;
    opacity: .75;
    font-style: italic;
}
.chart-sub {
    font-size:0.85em;
    text-wrap: pretty;
    color:#6b7280;
    margin-top:0.6rem;
    margin-bottom: 0;
    line-height: 1.4;
}
/* ── Section heading block (h3 + subtitle h4) ── */
.section-heading-block {
    background: #f5f4f0;
    border-radius: 6px;
    padding: 1.5rem 1.75rem;
    margin-top: 2rem;
    margin-bottom: 2rem;
}
.section-heading-block .section-h3 { margin-top: 0; margin-bottom: 0.4rem; }
.section-heading-block .section-h4.subhead { margin-top: 0; margin-bottom: 0; font-style: normal; font-weight: 400; opacity: 1; color: #4b5563; font-size: 1rem; }

/* === CHART TOGGLES === */

.toggle-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 0.75rem;
    font-size: 0.75rem;
    color: #6b7280;
}
.yr-btn {
    font-size: 0.75rem;
    padding: 3px 10px;
    border-radius: 4px;
    border: 1.5px solid rgb(209, 213, 219);
    background: rgb(255, 255, 255);
    color: rgb(107, 114, 128);
    cursor: pointer;
    font-family: inherit;
    font-weight: 400;
}
.yr-btn.active {
    border-color: rgb(92, 107, 192);
    background: rgb(92, 107, 192);
    color: rgb(255, 255, 255);
    font-weight: 600;
}

/* === FIGURE CARD STYLE === */

figure {
    margin: 2rem 0;
    padding: 1.5rem;
    border: 1px solid rgba(0, 0, 0, .1);
    border-radius: 12px;
}

/* Note: main print stylesheet is at the bottom of this file */
@media print {
    .toc-sidebar,
    .download-btn {
        display: none !important;
    }
}

/* ── Appendix page-swap ── */
#report-body {
    transition: opacity 0.2s ease;
}
#appendix-container {
    display: none;
}
.appendix-page {
    display: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.appendix-page.is-active {
    display: block;
    opacity: 1;
}

#appendix-back-bar {
    display: none;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0;
    margin-bottom: 2.25rem;
    border-bottom: 1px solid var(--c-border);
}
#appendix-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--c-text-muted);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    text-decoration: none;
    transition: color 150ms ease;
    touch-action: manipulation;
}
#appendix-back-btn:hover {
    color: var(--c-text);
}
#appendix-back-btn:focus-visible {
    outline: 2px solid var(--c-accent);
    outline-offset: 3px;
    border-radius: 3px;
}
#appendix-back-btn svg {
    flex-shrink: 0;
}
#appendix-title-label {
    font-size: 0.78rem;
    color: var(--c-text-faint);
    font-weight: 400;
}

/* ── Finding Accordions ── */
.finding-accordion {
    overflow: hidden;
    border-radius: 6px;
    border: 1px solid #c1c8f6;
    background: #eff1ff;
    transition: box-shadow 150ms ease;
}
.finding-accordion:hover {
    box-shadow: 0 2px 8px rgba(92, 107, 192, 0.12);
}

.finding-accordion__hd {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    padding: 1.125rem 1.5rem;
    text-align: left;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    transition: background 120ms ease;
    touch-action: manipulation;
}
.finding-accordion__hd:hover {
    background: rgba(92, 107, 192, 0.07);
}
.finding-accordion__hd:focus-visible {
    outline: 2px solid #5c6bc0;
    outline-offset: -2px;
    border-radius: 5px;
}

.finding-accordion__hd-content {
    display: contents;
}
.finding-accordion__label-pill {
    grid-column: 1;
    grid-row: 1;
    align-self: center;
}
.finding-accordion__hd-meta {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}
.finding-accordion__summary,
.kf-description {
    grid-column: 1 / -1;
}
.finding-accordion__toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.67rem;
    font-weight: 700;
    color: #5c6bc0;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
    transition: color 120ms ease;
}
.finding-accordion__hd:hover .finding-accordion__toggle {
    color: #3d4fa8;
}

/* Plus/minus icon — no circle */
.finding-accordion__plus {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    line-height: 1;
    color: #5c6bc0;
    transition:
        transform 280ms ease,
        color 150ms ease;
    flex-shrink: 0;
}
.finding-accordion__hd.is-open .finding-accordion__plus {
    transform: rotate(45deg);
    color: #5c6bc0;
}

/* Finding label — plain uppercase, no pill */
.finding-accordion__label-pill {
    font-size: 0.67rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #5c6bc0;
    background: none;
    padding: 0;
    border: none;
}

.finding-accordion__summary {
    font-weight: 600;
    width: 100%;
    margin: 0;
    font-size: 0.9625rem;
    line-height: 1.55;
    color: var(--c-text);
    text-wrap: pretty;
}
.finding-accordion__bd {
    max-height: 0;
    overflow: hidden;
    transition: max-height 350ms ease;
}
.finding-accordion__bd-inner {
    padding: 0 1.875rem 1.625rem;
    border-top: 1px solid #c1c8f6;
    padding-top: 1.125rem;
    line-height: 1.6;
}

/* KF cards — key findings variant: grey border, white bg, purple headline */
.finding-accordion.kf-style {
    background: #ffffff;
    border: 1px solid #d1d5db;
}
.finding-accordion.kf-style:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
.finding-accordion.kf-style .finding-accordion__hd:hover {
    background: none;
}
.finding-accordion.kf-style .finding-accordion__summary {
    color: #111;
    font-size: 1.0rem;
    font-weight: 700;
    margin-top: .5rem;
}
.finding-accordion.kf-style .finding-accordion__summary code {
    background: rgba(0, 0, 0, .05);
    padding: 4px 8px;
    margin: 0;
    border-radius: 6px;
    font-family: 'JetBrains Mono';
    font-size: .85em;
    color: rgba(0, 0, 0, .7);
    white-space: nowrap;
    box-shadow: none;
}
.finding-accordion.kf-style .finding-accordion__bd-inner {
    border-top: 1px solid #e5e7eb;
    background: #ffffff;
}
.kf-description {
    font-size: 0.875rem;
    color: #374151;
    line-height: 1.65;
    margin: 0.5rem 0 0;
    font-weight: 400;
}

/* Footnote / further-reading reference superscripts */
span.fr-ref {
    position: relative;
    display: inline;
    font-size: 0.85em;
    line-height: 1;
}
span.fr-ref::before {
    content: "[";
    color: var(--c-accent, #2563eb);
    font-weight: 600;
}
span.fr-ref::after {
    content: "]";
    color: var(--c-accent, #2563eb);
    font-weight: 600;
}
span.fr-ref a {
    color: var(--c-accent, #2563eb);
    text-decoration: none;
    font-weight: 600;
}
span.fr-ref a:hover {
    text-decoration: underline;
}
/* Tooltip — appears instantly, no fade */
span.fr-ref a[data-source-label]::before {
    content: attr(data-source-label);
    position: absolute;
    bottom: 1.4em;
    left: 50%;
    transform: translateX(-50%);
    background: #111827;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    z-index: 200;
}
span.fr-ref a[data-source-label]:hover::before {
    opacity: 1;
}
.fr-backlink {
    display: none; /* replaced by citation-return-toast */
}

/* Citation return toast */
#citation-return-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) scale(0.7);
    background: #111;
    color: #fff;
    padding: 0.8rem 1.75rem;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4), 0 2px 12px rgba(0, 0, 0, 0.25);
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    user-select: none;
    letter-spacing: 0.01em;
}
#citation-return-toast.toast-visible {
    animation: citationToastIn 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    pointer-events: auto;
}
#citation-return-toast.toast-hiding {
    animation: citationToastOut 0.25s ease-in forwards;
    pointer-events: none;
}
@keyframes citationToastIn {
    0%   { opacity: 0; transform: translateX(-50%) scale(0.65); }
    65%  { opacity: 1; transform: translateX(-50%) scale(1.07); }
    82%  {             transform: translateX(-50%) scale(0.97); }
    100% { opacity: 1; transform: translateX(-50%) scale(1);    }
}
@keyframes citationToastOut {
    0%   { opacity: 1; transform: translateX(-50%) scale(1);    }
    100% { opacity: 0; transform: translateX(-50%) scale(0.88); }
}


.exec-divider {
    border: 0;
    border-top: 1px solid #e5e7eb;
    margin: 1.75rem 0;
}

.callout-info {
    background: #eff1ff;
    border: 1px solid #c1c8f6;
    border-radius: 6px;
    padding: 1.375rem 1.75rem;
    margin: 1.5rem 0;
}
.callout-info > *:last-child,
.callout-caution > *:last-child,
.callout-warm > *:last-child,
.dark-callout > *:last-child {
    margin-bottom: 0;
}
.callout-info__label {
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #5c6bc0;
    margin-bottom: 0.75rem;
}
.callout-info h4 {
    margin-top: 0.25rem;
    text-wrap: pretty;
}

/* Study accordion -- callout-info purple styling with accordion toggle mechanics */
.study-accordion {
    overflow: hidden;
    border-radius: 6px;
    border: 1px solid #c1c8f6;
    background: #eff1ff;
    transition: box-shadow 150ms ease;
}
.study-accordion:hover {
    box-shadow: 0 2px 8px rgba(92, 107, 192, 0.12);
}
.study-accordion__hd {
    width: 100%;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.125rem 1.5rem;
    text-align: left;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    transition: background 120ms ease;
    touch-action: manipulation;
}
.study-accordion__hd:hover {
    background: rgba(92, 107, 192, 0.07);
}
.study-accordion__hd:focus-visible {
    outline: 2px solid #5c6bc0;
    outline-offset: -2px;
    border-radius: 5px;
}
.study-accordion__hd-meta {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}
.study-accordion__toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.67rem;
    font-weight: 700;
    color: #5c6bc0;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
    transition: color 120ms ease;
}
.study-accordion__plus {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    line-height: 1;
    color: #5c6bc0;
    transition: transform 280ms ease, color 150ms ease;
    flex-shrink: 0;
}
.study-accordion__hd.is-open .study-accordion__plus {
    transform: rotate(45deg);
}
.study-accordion__hd-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 0.2rem;
    order: -1;
}
.study-accordion__summary {
    display: block;
    font-weight: 600;
    margin: 0;
    padding: 0;
    font-size: 0.9625rem;
    line-height: 1.4;
    color: var(--c-text);
    text-wrap: pretty;
}
.study-accordion__verdict {
    display: block;
    font-size: 0.82rem;
    font-weight: 400;
    color: #5c6bc0;
    line-height: 1.35;
}
.study-accordion__bd {
    max-height: 0;
    overflow: hidden;
    transition: max-height 350ms ease;
}
.study-accordion__bd-inner {
    padding: 1rem 1.5rem 1.375rem;
    border-top: 1px solid #c1c8f6;
    line-height: 1.6;
}
.study-accordion__bd-inner p:last-child {
    margin-bottom: 0;
}

/* ── FAQ Accordion -- callout-info purple, question format, no pill ── */
.faq-accordion {
    overflow: hidden;
    border-radius: 6px;
    border: 1px solid #c1c8f6;
    background: #ffffff;
    transition: box-shadow 150ms ease;
}
.faq-accordion:hover {
    box-shadow: 0 2px 8px rgba(92, 107, 192, 0.12);
}
.faq-accordion__hd {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 1.25rem;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    touch-action: manipulation;
}
.faq-accordion__hd:hover {
    background: rgba(92, 107, 192, 0.07);
}
.faq-accordion__hd:focus-visible {
    outline: 2px solid #5c6bc0;
    outline-offset: -2px;
    border-radius: 5px;
}
.faq-accordion__q-pill {
    font-size: 0.67rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #5c6bc0;
    background: rgba(92, 107, 192, 0.15);
    border-radius: 3px;
    padding: 2px 6px;
    flex-shrink: 0;
    user-select: none;
}
.faq-accordion__question {
    flex: 1;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--c-text-base);
    line-height: 1.4;
    text-wrap: pretty;
}
.faq-accordion__toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: #5c6bc0;
    flex-shrink: 0;
    transition: color 120ms ease;
}
.faq-accordion__plus {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 400;
    width: 1.125rem;
    height: 1.125rem;
    flex-shrink: 0;
    transition: transform 220ms ease;
}
.faq-accordion__hd.is-open .faq-accordion__plus {
    transform: rotate(45deg);
    color: #5c6bc0;
}
.faq-accordion__bd {
    max-height: 0;
    overflow: hidden;
    transition: max-height 350ms ease;
}
.faq-accordion__bd-inner {
    padding: 1rem 1.5rem 1.375rem;
    border-top: 1px solid #c1c8f6;
}
.faq-accordion__bd-inner p:last-child {
    margin-bottom: 0;
}

.callout-caution {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: 6px;
    padding: 1.375rem 1.75rem;
}
.callout-caution__label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--c-text-muted);
    margin-bottom: 0.75rem;
}

.callout-warm {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: 6px;
    padding: 1.25rem 1.75rem;
}
.callout-warm__label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--c-text-muted);
    margin-bottom: 0.75rem;
}

/* ── Dark callout box ── */
.dark-callout {
    background-color: #111111;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.85);
    padding: 1.375rem 1.75rem;
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.24),
        0 4px 8px rgba(0, 0, 0, 0.18),
        0 12px 24px rgba(0, 0, 0, 0.14),
        0 36px 72px rgba(0, 0, 0, 0.12);
}
.dark-callout h4 {
    color: #ffffff;
    font-weight: 600;
    opacity: 1;
    margin-top: 0.25rem;
    margin-bottom: 0.875rem;
}
.dark-callout p,
.dark-callout li {
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.4;
}
.dark-callout .fn-num {
    color: rgba(255, 255, 255, 0.5);
}
.dark-callout .fn {
    border-bottom-color: rgba(255, 255, 255, 0.3);
}
/* ── Grid cards ── */
.insight-card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: 7px;
    padding: 1.375rem 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition:
        box-shadow 150ms ease,
        transform 150ms ease;
}
.insight-card:hover {
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}
.insight-card__title {
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}
.insight-card__body {
    font-size: 0.84rem;
    line-height: 1.6;
    color: #555;
}

.confound-card {
    background: #fff;
    border: 1px solid var(--c-border);
    border-radius: 7px;
    padding: 1.25rem 1.375rem;
}
.confound-card__title {
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 0.375rem;
    color: var(--c-text);
}
.confound-card__body {
    font-size: 0.84rem;
    line-height: 1.6;
    color: #555;
    margin: 0;
}
.confound-card--primary {
    background: var(--c-caution);
    border-color: var(--c-caution-border);
    border-left: 3px solid var(--c-caution-label);
}
.confound-card--primary .confound-card__title {
    color: var(--c-caution-label);
    font-size: 1rem;
}

/* ── Finding boxes (non-accordion) — clean card, no accent border ── */
.finding-box {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: 6px;
    padding: 1.375rem 1.625rem;
}
.finding-box__number {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--c-text-faint);
    margin-bottom: 0.5rem;
}
.finding-box__title {
    font-weight: 700;
    font-size: 0.9625rem;
    margin-bottom: 0.375rem;
}
.finding-box__body {
    font-size: 0.84rem;
    line-height: 1.6;
    color: #555;
    margin: 0;
}

/* ── Chart container ── */
.chart-wrap {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: 8px;
    padding: 1.25rem 1.25rem 1rem;
    margin: 1.5rem 0;
}

/* ── Inline stat number formatting ── */
.stat-number {
    font-size: .9rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    line-height: 1.15;
    color: var(--c-text);
}
.stat-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--c-text-muted);
    margin-bottom: 0.25rem;
    font-weight: 700;
}

/* ── Blockquote / left-bar callout — neutral ── */
.border-l-callout {
    border-left: 3px solid var(--c-border) !important;
    background: var(--c-surface) !important;
    border-radius: 0 6px 6px 0 !important;
    padding: 1.375rem 1.75rem !important;
}
.border-l-callout__label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--c-text-muted);
    margin-bottom: 0.75rem;
}

/* ── Toolbar (edit + comment) ── */
#edit-toolbar {
    position: fixed;
    top: 1rem;
    right: 1.5rem;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: 10px;
    padding: 6px 10px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    font-family:
        -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 0.78rem;
}
#edit-toolbar button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 3px 8px;
    border-radius: 5px;
    font-size: 0.78rem;
    font-weight: 500;
    transition:
        background 120ms ease,
        color 120ms ease;
    touch-action: manipulation;
}
#edit-toolbar button:focus-visible {
    outline: 2px solid var(--c-accent);
    outline-offset: 2px;
}
#toolbar-divider {
    width: 1px;
    height: 16px;
    background: #e0e0e0;
    margin: 0 2px;
}
#edit-enter-btn {
    color: #555;
}
#edit-enter-btn:hover {
    background: var(--c-surface-alt);
    color: var(--c-text);
}
#comment-toggle-btn {
    color: #555;
}
#comment-toggle-btn:hover {
    background: var(--c-surface-alt);
    color: var(--c-text);
}
#comment-toggle-btn.is-active {
    background: #1a1a1a;
    color: #fff;
}
#comment-toggle-btn.is-active:hover {
    background: #333;
}
#edit-save-btn {
    background: var(--c-text);
    color: white;
    font-weight: 600;
}
#edit-save-btn:hover {
    background: #333;
}
#edit-cancel-btn {
    color: #888;
}
#edit-cancel-btn:hover {
    background: var(--c-surface-alt);
    color: #333;
}
#edit-mode-badge {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--c-text-muted);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0 4px;
}
.toolbar-divider {
    display: inline-block;
    width: 1px;
    height: 16px;
    background: #e0e0e0;
    margin: 0 2px;
    flex-shrink: 0;
}
#fmt-bold-btn {
    font-weight: 700;
    color: #444;
    min-width: 26px;
}
#fmt-italic-btn {
    font-style: italic;
    color: #444;
    min-width: 26px;
}
#fmt-link-btn {
    color: #5c6bc0;
}
#fmt-bold-btn:hover,
#fmt-italic-btn:hover,
#fmt-link-btn:hover {
    background: var(--c-surface-alt);
}

/* Link dialog */
#link-dialog {
    position: fixed;
    top: 3.5rem;
    right: 1.5rem;
    z-index: 999;
    display: none;
    flex-direction: column;
    gap: 8px;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: 10px;
    padding: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 0.78rem;
    min-width: 300px;
}
#link-url-input {
    width: 100%;
    border: 1px solid var(--c-border);
    border-radius: 5px;
    padding: 6px 8px;
    font-size: 0.78rem;
    font-family: inherit;
    outline: none;
    box-sizing: border-box;
    color: var(--c-text);
}
#link-url-input:focus {
    border-color: #5c6bc0;
    box-shadow: 0 0 0 2px rgba(92, 107, 192, 0.15);
}
#link-target-toggle {
    display: flex;
    gap: 4px;
}
#link-target-toggle button {
    flex: 1;
    padding: 4px 0;
    border: 1px solid var(--c-border);
    border-radius: 5px;
    background: none;
    cursor: pointer;
    font-size: 0.72rem;
    font-weight: 500;
    color: #555;
    font-family: inherit;
    transition: background 100ms ease, color 100ms ease, border-color 100ms ease;
}
#link-target-toggle button.is-active {
    background: #eff1ff;
    border-color: #c1c8f6;
    color: #5c6bc0;
    font-weight: 600;
}
#link-dialog-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}
#link-apply-btn {
    background: var(--c-text);
    color: white;
    border: none;
    border-radius: 5px;
    padding: 4px 14px;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 600;
    font-family: inherit;
}
#link-apply-btn:hover {
    background: #333;
}
#link-cancel-btn {
    background: none;
    border: 1px solid var(--c-border);
    border-radius: 5px;
    padding: 4px 10px;
    cursor: pointer;
    font-size: 0.78rem;
    color: #888;
    font-family: inherit;
}
#link-cancel-btn:hover {
    background: var(--c-surface-alt);
    color: #333;
}

body.edit-mode [contenteditable="true"] {
    outline: 1.5px dashed rgba(0, 0, 0, 0.2);
    outline-offset: 2px;
    border-radius: 2px;
    cursor: text;
}
body.edit-mode [contenteditable="true"]:hover {
    background: rgba(0, 0, 0, 0.025);
}
body.edit-mode [contenteditable="true"]:focus {
    outline: 2px solid rgba(0, 0, 0, 0.4);
    outline-offset: 2px;
    background: rgba(0, 0, 0, 0.025);
}

/* ── Comment system ── */
body.comment-mode {
    cursor: cell;
}
body.comment-mode .cm-target {
    cursor: cell !important;
    transition:
        outline 60ms ease,
        background-color 60ms ease;
}
body.comment-mode .cm-target:hover {
    outline: 2px dashed rgba(200, 160, 0, 0.7) !important;
    outline-offset: 3px !important;
    background-color: rgba(255, 220, 40, 0.06) !important;
}
mark.cm-anchor {
    background: rgba(255, 220, 40, 0.32);
    border-radius: 2px;
    color: inherit;
    padding: 1px 0;
}
mark.cm-anchor:hover,
mark.cm-anchor.is-lit {
    background: rgba(255, 210, 20, 0.6);
}
[data-cid].cm-elem-anchor {
    outline: 2px solid rgba(200, 160, 0, 0.45) !important;
    outline-offset: 3px !important;
}
[data-cid].cm-elem-anchor.is-lit {
    outline-color: rgba(200, 140, 0, 0.8) !important;
}
#comments-layer {
    position: absolute;
    left: calc(100% + 1.5rem);
    top: 0;
    width: 210px;
    pointer-events: none;
}
.cm-card {
    position: absolute;
    width: 210px;
    background: #fffef0;
    border: 1px solid #e0cc60;
    border-left: 3px solid #c8a800;
    border-radius: 6px;
    padding: 9px 11px 7px;
    font-size: 0.74rem;
    line-height: 1.55;
    color: #333;
    pointer-events: auto;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.07);
    transition:
        box-shadow 0.12s ease,
        border-left-color 0.12s ease;
    cursor: default;
}
.cm-card.is-lit {
    box-shadow: 0 2px 14px rgba(0, 0, 0, 0.14);
    border-left-color: #9a7800;
    z-index: 5;
}
.cm-card__text {
    white-space: pre-wrap;
    margin-bottom: 7px;
}
.cm-card__actions {
    display: flex;
    gap: 10px;
}
.cm-card__btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.69rem;
    color: #999;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 2px;
    font-family: inherit;
}
.cm-card__btn:hover {
    color: #333;
}
.cm-card__resolve {
    color: #4a7c4a;
}
.cm-card__resolve:hover {
    color: #2d5a2d !important;
}
#cm-popover {
    position: fixed;
    z-index: 9999;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 13px;
    width: 290px;
    box-shadow: 0 6px 28px rgba(0, 0, 0, 0.14);
    display: none;
    font-family:
        -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
#cm-popover textarea {
    width: 100%;
    box-sizing: border-box;
    font-size: 0.82rem;
    font-family: inherit;
    line-height: 1.5;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 8px 10px;
    resize: vertical;
    outline: none;
}
#cm-popover textarea:focus {
    border-color: #aaa;
}
#cm-popover-actions {
    display: flex;
    gap: 8px;
    margin-top: 9px;
}
#cm-submit-btn {
    background: #1a1a1a;
    color: #fff;
    border: none;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}
#cm-submit-btn:hover {
    background: #333;
}
#cm-cancel-btn {
    background: none;
    border: none;
    color: #999;
    font-size: 0.78rem;
    cursor: pointer;
    padding: 6px 4px;
    font-family: inherit;
}
#cm-cancel-btn:hover {
    color: #444;
}
#cm-sel-tip {
    position: fixed;
    z-index: 9998;
    background: #1a1a1a;
    color: #fff;
    padding: 5px 11px;
    border-radius: 6px;
    font-size: 0.76rem;
    font-weight: 500;
    cursor: pointer;
    display: none;
    white-space: nowrap;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.22);
    font-family:
        -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    transform: translateX(-50%);
    pointer-events: auto;
}
#cm-sel-tip:hover {
    background: #333;
}
@media print {
    #edit-toolbar {
        display: none !important;
    }
    #cm-popover {
        display: none !important;
    }
    #cm-sel-tip {
        display: none !important;
    }
    .cm-card {
        display: none !important;
    }
}

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


/* === COMPONENTS === */

.rv-hover {
    outline: 2px solid rgba(10, 10, 10, 0.6) !important;
    outline-offset: 2px !important;
    background-color: rgba(10, 10, 10, 0.04) !important;
    cursor: crosshair !important;
}

/* === EXECUTIVE SUMMARY === */
.exec-key-numbers {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    align-items: start;
    gap: 1rem;
    margin: 1.75rem 0;
}
@media (max-width: 700px) {
    .exec-key-numbers { grid-template-columns: repeat(2, 1fr); }
}
.exec-key-numbers__card {
    background: var(--c-surface-raised);
    border: 1px solid var(--c-border);
    border-radius: 8px;
    padding: 1.1rem 1.25rem 1rem;
}
.exec-key-numbers__value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--c-accent);
    line-height: 1.1;
    letter-spacing: -0.02em;
}
.exec-key-numbers__label {
    font-size: 0.78rem;
    color: var(--c-text-muted);
    margin-top: 0.3rem;
    line-height: 1.35;
}
.exec-headline {
    font-size: 1.08rem;
    line-height: 1.65;
    font-weight: 400;
}

/* ── Executive Summary Version Toggle ─────────────────────────────── */
.exec-version-tabs {
    display: flex;
    gap: 0.5rem;
    margin: 1.25rem 0 1.5rem;
    border-bottom: 1px solid var(--c-border);
    padding-bottom: 0.75rem;
}
.exec-version-tab {
    padding: 0.35rem 1rem;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    border: 1px solid var(--c-border, #ddd);
    border-radius: 3px;
    cursor: pointer;
    background: transparent;
    color: var(--c-text-muted);
    transition: background 0.15s, color 0.15s;
}
.exec-version-tab.active {
    background: var(--c-brand, #111);
    color: #fff;
    border-color: var(--c-brand, #111);
}
.exec-version-tab:hover:not(.active) {
    background: var(--c-bg-alt, #f5f5f5);
    color: var(--c-text);
}

/* Inline text highlight */
.hl {
  background-color: #ddd6fe;
  padding: 0 0.25em;
  border-radius: 2px;
}

/* ─────────────────────────────────────────────────────────────
   Print stylesheet
   Hides the sidebar and interactive chrome; full-width clean layout.
   ───────────────────────────────────────────────────────────── */

/* @page must be top-level to be reliably honored by browsers */
@page {
  size: letter portrait;
  margin: 1in;
}

@media print {

  html, body {
    font-size: 11pt;
    background: #fff !important;
    color: #000 !important;
  }

  /* Hide sidebar, TOC, appendix nav bar, and all toggle/interactive controls */
  .toc-sidebar,
  .floating-toc,
  #appendix-back-bar,
  #comment-toggle-btn,
  #link-target-toggle,
  #btn-supply-hotels,
  #btn-supply-str,
  #btn-county-3,
  #btn-county-4,
  .exec-version-tabs,
  .finding-accordion__toggle,
  .study-accordion__toggle,
  .faq-accordion__toggle {
    display: none !important;
  }

  /* Collapse flex layout — sidebar hidden, content column centered */
  .layout-shell {
    display: block !important;
    max-width: 100% !important;
    padding: 0 !important;
    gap: 0 !important;
    margin: 0 !important;
  }

  /* Preserve the 700px reading column from screen; center it on the page */
  .main-content {
    max-width: 700px !important;
    width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  /* Links: black, keep underline */
  a, a:visited {
    color: #000 !important;
    text-decoration: underline;
  }

  /* Page breaks: new page before each major section */
  .section-h2 {
    page-break-before: always;
    break-before: page;
  }

  /* Don't break before the exec summary — it immediately follows the header */
  /* :first-of-type doesn't work here because a hidden h2 steals the selector */
  #exec-summary-alt .section-h2 {
    page-break-before: avoid !important;
    break-before: avoid !important;
  }

  /* Keep callouts and tables together — never split mid-element */
  /* NOTE: figures are excluded; SVG charts can be 400px+ tall and cause blank pages if forced intact */
  table,
  .dark-callout,
  .callout-info,
  #additional-finding-breakpoint,
  .detail-table {
    page-break-inside: avoid;
    break-inside: avoid;
  }

  /* Header: match the 700px content column width and center */
  .header-wrap {
    max-width: 700px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    border-bottom: 1px solid #ccc !important;
  }

  /* Headings: don't orphan from their following content */
  .section-h2,
  .section-h3,
  h3, h4 {
    page-break-after: avoid;
    break-after: avoid;
  }

  /* Dark callout: print-safe background */
  .dark-callout {
    background: #f0f0f0 !important;
    color: #000 !important;
    border: 1px solid #ccc !important;
    border-left: 4px solid #555 !important;
  }

  .dark-callout h4,
  .dark-callout p,
  .dark-callout li,
  .dark-callout a {
    color: #000 !important;
  }

  /* Exec summary panel */
  .exec-panel {
    background: #f0f0f0 !important;
    color: #000 !important;
  }

  .exec-panel *,
  .exec-headline {
    color: #000 !important;
  }

  /* Expand all accordion bodies in print (correct class names: __bd not __body) */
  .finding-accordion__bd,
  .study-accordion__bd,
  .faq-accordion__bd {
    display: block !important;
    max-height: none !important;
    overflow: visible !important;
    visibility: visible !important;
  }

  /* Widows and orphans: no single stranded lines at page tops/bottoms */
  p, li {
    widows: 3;
    orphans: 3;
  }

  /* Strip decorative shadows */
  * {
    box-shadow: none !important;
    text-shadow: none !important;
  }

  /* Info and caution callouts: print-safe colors */
  .callout-info,
  .callout-caution {
    background: #f8f8f8 !important;
    border: 1px solid #ccc !important;
    border-left: 4px solid #555 !important;
  }
  .callout-info *,
  .callout-caution * {
    color: #000 !important;
  }

  /* FAQ accordions (finding-accordion kf-style): strip card chrome, render as plain text */
  .finding-accordion.kf-style {
    background: #fff !important;
    border: none !important;
    border-top: 1px solid #ccc !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 0.5rem 0 !important;
    margin-bottom: 0.25rem !important;
  }
  .finding-accordion.kf-style .finding-accordion__hd {
    background: #fff !important;
    padding: 0 !important;
    cursor: default !important;
    pointer-events: none !important;
    display: block !important;
  }
  .finding-accordion.kf-style .finding-accordion__hd-meta {
    display: none !important;
  }
  .finding-accordion.kf-style .finding-accordion__label-pill {
    color: #555 !important;
    font-size: 0.65rem !important;
  }
  .finding-accordion.kf-style .finding-accordion__summary {
    color: #000 !important;
    font-size: 0.95rem !important;
    font-weight: 700 !important;
  }
  .finding-accordion.kf-style .kf-description {
    color: #333 !important;
    font-style: italic !important;
  }
  .finding-accordion.kf-style .finding-accordion__bd-inner {
    background: #fff !important;
    border-top: none !important;
    padding: 0.25rem 0 0 0 !important;
  }

  /* SVG figures: full width */
  figure svg {
    max-width: 100%;
    height: auto;
  }

  /* Remove sticky positioning from anything that has it inline */
  .sticky {
    position: static !important;
  }

  /* Tables: ensure borders visible */
  .detail-table th,
  .detail-table td {
    border: 1px solid #ccc !important;
  }
}

/* ── Dashboard ─────────────────────────────────────────────── */
.dash-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1.25rem 1.25rem 1rem;
  overflow: hidden;
}
.dash-card figure {
  margin: 0;
}