/* ════════════════════════════════════════════════════════════════
   ControlShift Insights v2 — Base Styles
   Brand palette locked to Expansive EDGE 8 colors.
   ════════════════════════════════════════════════════════════════ */

:root {
    /* Primary brand palette (Expansive EDGE Brand Booklet) */
    --dark-teal:       #04454C;
    --dark-teal-deep:  #024C53;
    --bright-teal:     #1CB0CE;
    --growth-green:    #3BAA85;
    --bright-green:    #65ECAC;
    --mint:            #9DF4CB;
    --black:           #000000;
    --charcoal:        #454545;
    --white:           #FFFFFF;

    /* Secondary neutrals */
    --muted-teal:      #729C9B;
    --medium-gray:     #8C9797;
    --light-gray:      #A0AEAE;
    --silver:          #D7DFDF;

    /* Status */
    --red:             #DC3545;
    --red-bg:          rgba(220, 53, 69, .08);
    --amber:           #F59E0B;
    --amber-bg:        rgba(245, 158, 11, .08);
    --green-bg:        rgba(59, 170, 133, .08);
    --blue-bg:         rgba(28, 176, 206, .08);

    /* Surface tokens */
    --snow:            #F4F7F6;
    --cloud:           #E5E7EB;
    --gray:            #6B7280;

    --radius:          8px;
    --radius-lg:       12px;
    --shadow-sm:       0 1px 2px rgba(0,0,0,.04);
    --shadow:          0 4px 12px rgba(0,0,0,.06);
    --shadow-lg:       0 8px 24px rgba(0,0,0,.1);

    /* Typography (brand guide):
         Poppins     → display/headings (primary)
         Montserrat  → UI / subheads / labels (secondary)
         Helvetica   → body prose (paragraph)                 */
    --font-heading:    'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body:       'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-prose:      'Helvetica', 'Arial', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

html { font-size: 16px; }

body {
    font-family: var(--font-body);
    color: var(--charcoal);
    background: var(--snow);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
    font-family: var(--font-heading);
    color: var(--dark-teal);
    font-weight: 700;
    line-height: 1.2;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.125rem; }

a { color: var(--bright-teal); text-decoration: none; }
a:hover { color: var(--dark-teal); }

.container        { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.container-narrow { max-width: 680px;  margin: 0 auto; padding: 0 1.5rem; }

/* ── Nav ───────────────────────────────────────────────────────── */
.topnav {
    background: white;
    border-bottom: 1px solid var(--cloud);
    padding: .875rem 0;
    position: sticky; top: 0; z-index: 100;
}
.topnav-inner {
    max-width: 1200px; margin: 0 auto; padding: 0 1.5rem;
    display: flex; justify-content: space-between; align-items: center;
}
.topnav-brand { display: flex; align-items: center; gap: .5rem; }
.topnav-brand img { height: 28px; }
.topnav-brand strong { color: var(--dark-teal); font-family: var(--font-heading); font-weight: 700; }
.topnav-links { display: flex; align-items: center; gap: 1.25rem; font-size: .9375rem; }
.topnav-links a { color: var(--charcoal); font-weight: 500; }
.topnav-links a:hover { color: var(--dark-teal); }

/* ── Cards ─────────────────────────────────────────────────────── */
.card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}
.card.compact { padding: 1.25rem 1.5rem; }
.text-center { text-align: center; }
.text-gray { color: var(--gray); }

/* ── Forms ─────────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }
.form-label {
    display: block;
    font-weight: 600;
    color: var(--dark-teal);
    margin-bottom: .375rem;
    font-size: .9375rem;
}
.form-hint { font-size: .8125rem; color: var(--gray); display: block; margin-bottom: .5rem; }
.form-input, .form-textarea, .form-select {
    width: 100%;
    padding: .625rem .875rem;
    border: 1.5px solid var(--cloud);
    border-radius: var(--radius);
    background: white;
    font: inherit;
    color: var(--charcoal);
    transition: border-color .15s;
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
    outline: none;
    border-color: var(--bright-teal);
}
.form-textarea { min-height: 80px; resize: vertical; }

/* ── Buttons ───────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .625rem 1.25rem;
    border: 1.5px solid transparent;
    border-radius: var(--radius);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
    text-decoration: none;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn-primary   { background: var(--dark-teal); color: white; }
.btn-primary:hover { background: var(--bright-teal); color: white; }
.btn-secondary { background: white; color: var(--dark-teal); border-color: var(--cloud); }
.btn-secondary:hover { border-color: var(--dark-teal); color: var(--dark-teal); }
.btn-block   { display: flex; width: 100%; }
.btn-lg      { padding: .875rem 1.75rem; font-size: 1rem; }
.btn-sm      { padding: .375rem .875rem; font-size: .8125rem; }

/* ── Flash messages ────────────────────────────────────────────── */
.flash {
    padding: .75rem 1rem;
    border-radius: var(--radius);
    font-size: .9375rem;
    margin-bottom: 1rem;
    border-left: 3px solid;
}
.flash-error   { background: var(--red-bg);    border-color: var(--red);           color: var(--red); }
.flash-warning { background: var(--amber-bg);  border-color: var(--amber);         color: #8a5a00; }
.flash-info    { background: var(--blue-bg);   border-color: var(--bright-teal);   color: var(--dark-teal); }
.flash-success { background: var(--green-bg);  border-color: var(--growth-green);  color: var(--growth-green); }

/* ── Auth screens ──────────────────────────────────────────────── */
.auth-wrap {
    min-height: calc(100vh - 60px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
}
.auth-card {
    width: 100%;
    max-width: 440px;
    background: white;
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
}
.auth-card .logo { height: 36px; margin-bottom: 1.5rem; display: block; }
.auth-card h1 { font-size: 1.5rem; margin-bottom: .25rem; }
.auth-card .subtitle { color: var(--gray); font-size: .9375rem; margin-bottom: 1.75rem; }
.auth-card .btn { margin-top: .5rem; }
.auth-card .alt-link { text-align: center; margin-top: 1.25rem; font-size: .875rem; color: var(--gray); }

/* ── Dashboard ─────────────────────────────────────────────────── */
.dash-hero {
    background: linear-gradient(135deg, var(--dark-teal) 0%, #0d6570 100%);
    color: white;
    padding: 2.5rem 0;
}
.dash-hero h1 { color: white; margin-bottom: .25rem; }
.dash-hero p { opacity: .8; font-size: 1rem; }
.dash-content { padding: 2rem 0; }

.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    background: white;
    border-radius: var(--radius-lg);
    border: 2px dashed var(--cloud);
}
.empty-state h3 { color: var(--dark-teal); margin-bottom: .5rem; }
.empty-state p { color: var(--gray); margin-bottom: 1.5rem; }

/* ── Utilities ─────────────────────────────────────────────────── */
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.text-sm { font-size: .875rem; }
.font-weight-600 { font-weight: 600; }

/* ── Report pull-quote block (narrative sections) ──────────────────── */
.report-pullquote {
    position: relative;
    padding: 1.25rem 1.5rem 1.25rem 3rem;
    background: rgba(4, 69, 76, .03);
    border-left: 4px solid var(--bright-teal);
    border-radius: var(--radius);
    margin: .5rem 0 1rem 0;
}
.report-pullquote-mark {
    position: absolute;
    top: .25rem;
    left: .75rem;
    font-family: var(--font-heading, Georgia, serif);
    font-size: 3.5rem;
    line-height: 1;
    color: var(--bright-teal);
    opacity: .35;
    font-weight: 700;
}
.report-pullquote-text {
    font-size: 1.125rem;
    line-height: 1.55;
    font-weight: 600;
    color: var(--dark-teal);
    font-style: italic;
}

/* Report narrative blocks (opening/current-state/future/etc) */
.report-narrative-opening {
    background: linear-gradient(180deg, rgba(28,176,206,.02) 0%, white 100%);
    border-top: 3px solid var(--bright-teal);
}

/* ── Voice input + AI rewrite ─────────────────────────────────────── */
.voice-textarea-wrap {
    position: relative;
}
.voice-textarea-wrap textarea.form-textarea {
    padding-right: 44px;
}
.voice-mic-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    background: var(--cloud);
    color: var(--gray);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all .15s ease;
    z-index: 2;
    padding: 0;
    line-height: 1;
}
.voice-mic-btn:hover {
    background: var(--bright-teal);
    color: white;
    transform: translateY(-1px);
}
.voice-mic-btn:focus-visible {
    outline: 2px solid var(--bright-teal);
    outline-offset: 2px;
}
.voice-mic-btn.disabled {
    opacity: .5;
    cursor: not-allowed;
}
.voice-mic-btn svg {
    width: 15px;
    height: 15px;
    fill: currentColor;
}
.voice-mic-btn.recording {
    background: var(--red);
    color: white;
    animation: voice-pulse 1.2s ease-in-out infinite;
}
@keyframes voice-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220, 53, 69, .45); }
    50% { box-shadow: 0 0 0 8px rgba(220, 53, 69, 0); }
}
.voice-tools {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: .25rem;
    min-height: 1.25rem;
}
.voice-status {
    font-size: .75rem;
    color: var(--red);
    font-weight: 600;
}
.voice-status.is-recording::before {
    content: "\25CF  ";
    animation: voice-blink 1s ease-in-out infinite;
}
@keyframes voice-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: .3; }
}
.voice-refine-link {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    font-size: .75rem;
    color: var(--bright-teal);
    cursor: pointer;
    font-weight: 600;
    transition: color .15s ease;
    user-select: none;
}
.voice-refine-link:hover:not(.busy) {
    color: var(--dark-teal);
    text-decoration: underline;
}
.voice-refine-link.busy {
    color: var(--gray);
    cursor: wait;
}
.voice-spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid var(--cloud);
    border-top-color: var(--bright-teal);
    border-radius: 50%;
    animation: voice-spin .6s linear infinite;
    margin-right: .25rem;
    vertical-align: middle;
}
@keyframes voice-spin {
    to { transform: rotate(360deg); }
}
.voice-unsupported-tooltip {
    position: absolute;
    top: -36px;
    right: 0;
    background: var(--dark-teal);
    color: white;
    font-size: .6875rem;
    padding: .375rem .625rem;
    border-radius: var(--radius);
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity .2s ease;
    z-index: 10;
}
.voice-unsupported-tooltip.show {
    opacity: 1;
}

/* AI-rewrite preview panel (shown below textarea after rewrite click) */
.voice-preview {
    margin-top: .5rem;
    border: 1px solid var(--cloud);
    border-left: 3px solid var(--bright-teal);
    border-radius: var(--radius);
    background: #f9fcfd;
    overflow: hidden;
    animation: voice-preview-slide-in .2s ease-out;
}
@keyframes voice-preview-slide-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}
.voice-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .5rem .75rem;
    border-bottom: 1px solid var(--cloud);
    background: rgba(28,176,206,.04);
}
.voice-preview-title {
    display: inline-flex;
    align-items: center;
    gap: .375rem;
    font-size: .6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--bright-teal);
}
.voice-preview-status {
    font-size: .75rem;
    color: var(--gray);
    font-weight: 500;
}
.voice-preview-status.voice-status-info    { color: var(--dark-teal); }
.voice-preview-status.voice-status-success { color: var(--growth-green); }
.voice-preview-status.voice-status-warn    { color: var(--amber); }
.voice-preview-status.voice-status-error   { color: var(--red); font-weight: 600; }
.voice-preview-body {
    padding: .75rem .875rem;
    font-size: .9375rem;
    line-height: 1.55;
    color: var(--charcoal);
    white-space: pre-wrap;
    min-height: 2.5em;
}
.voice-preview-actions {
    display: flex;
    gap: .5rem;
    padding: .625rem .75rem;
    border-top: 1px solid var(--cloud);
    background: white;
    flex-wrap: wrap;
}
.voice-preview-actions .btn {
    font-size: .8125rem;
    padding: .375rem .75rem;
}
.voice-preview-actions .btn:disabled {
    opacity: .5;
    cursor: not-allowed;
    transform: none;
}

/* ─── File-upload widget (P&L / financial docs) ─── */
.file-upload-wrap {
    position: relative;
    border: 2px dashed var(--silver);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    background: var(--snow);
    transition: border-color .15s, background .15s;
}
.file-upload-wrap:hover,
.file-upload-wrap.is-drag-over {
    border-color: var(--bright-teal);
    background: rgba(28,176,206,.04);
}
.file-upload-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}
.file-upload-cta {
    display: flex;
    align-items: center;
    gap: .875rem;
    color: var(--muted-teal);
    font-size: .9375rem;
}
.file-upload-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: white;
    border: 1.5px solid var(--bright-teal);
    color: var(--bright-teal);
    font-weight: 700;
    font-size: 1.125rem;
    flex-shrink: 0;
}
.file-upload-cta strong { color: var(--dark-teal); font-weight: 600; }
.file-upload-text { line-height: 1.4; }
.file-upload-types {
    display: block;
    font-size: .75rem;
    color: var(--light-gray);
    letter-spacing: .08em;
    text-transform: uppercase;
    margin-top: .125rem;
}
.file-upload-status {
    margin-top: .5rem;
    font-size: .8125rem;
    min-height: 1.2em;
}
.file-upload-status .is-uploading { color: var(--bright-teal); }
.file-upload-status .is-extracting { color: var(--amber); }
.file-upload-status .is-error { color: var(--red); }
.file-upload-saved { color: var(--growth-green); font-weight: 600; }

.file-upload-preview {
    margin-top: .75rem;
    padding: 1rem 1.125rem;
    background: white;
    border: 1px solid var(--silver);
    border-left: 3px solid var(--bright-teal);
    border-radius: var(--radius);
}
.file-upload-preview-label {
    font-size: .6875rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted-teal);
    margin-bottom: .5rem;
}
.file-upload-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: .75rem;
}
.file-upload-preview-row {
    display: flex;
    flex-direction: column;
    gap: .2rem;
}
.file-upload-preview-key {
    font-size: .6875rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--medium-gray);
}
.file-upload-preview-value {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--dark-teal);
    font-size: 1.125rem;
}
.file-upload-preview-value input {
    font: inherit;
    color: inherit;
    width: 100%;
    padding: .3rem .5rem;
    background: var(--snow);
    border: 1px solid var(--cloud);
    border-radius: 4px;
}
.file-upload-preview-note {
    margin-top: .75rem;
    padding: .5rem .625rem;
    background: var(--snow);
    border-radius: 4px;
    font-size: .8125rem;
    color: var(--charcoal);
    line-height: 1.45;
}
.file-upload-preview-actions {
    display: flex;
    gap: .5rem;
    margin-top: .75rem;
    flex-wrap: wrap;
}

/* Inline mic/rewrite status colors */
.voice-status.voice-status-info    { color: var(--dark-teal); }
.voice-status.voice-status-warn    { color: var(--amber); }
.voice-status.voice-status-error   { color: var(--red); }
.voice-status.voice-status-success { color: var(--growth-green); }

/* ════════════════════════════════════════════════════════════════
   Report viewer chrome (Phase II-C)
     • Reading progress bar
     • Sticky TOC rail (right rail on desktop, drawer on mobile)
     • Back-to-top button
     • Section anchor scroll offsets
     • Print-specific overrides (hide chrome, restore single column)
   ════════════════════════════════════════════════════════════════ */

/* — SVG chart wrappers — */
.cs-chart-frame {
    background: white;
    border: 1px solid var(--silver);
    border-radius: var(--radius);
    padding: 1rem 1.25rem 0.75rem 1.25rem;
    margin-top: 1rem;
}
.cs-chart-frame-caption {
    font-family: var(--font-body);
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted-teal);
    margin-top: .5rem;
    text-align: center;
}
.cs-chart { width: 100%; height: auto; display: block; max-width: 640px; margin: 0 auto; }
.cs-chart-radar { max-width: 480px; }
.cs-chart-waterfall { max-width: 680px; }
/* Two-column layout: chart on the left, context on the right */
.cs-chart-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 1.25rem;
    align-items: center;
}
@media (max-width: 720px) {
    .cs-chart-row { grid-template-columns: 1fr; }
}

/* — Data tables (critical metrics, levers, etc.) — */
.cs-data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: .75rem;
    font-size: .875rem;
}
.cs-data-table thead th {
    text-align: left;
    font-family: var(--font-body);
    font-size: .6875rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted-teal);
    padding: .5rem .625rem;
    border-bottom: 2px solid var(--silver);
}
.cs-data-table tbody td {
    padding: .625rem;
    border-bottom: 1px solid var(--cloud);
    color: var(--charcoal);
    vertical-align: top;
    line-height: 1.5;
}
.cs-data-table tbody tr:hover { background: var(--snow); }
.cs-data-table tbody tr:last-child td { border-bottom: 0; }
.cs-data-table .cs-col-primary {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--dark-teal);
    font-size: .9375rem;
}
.cs-data-table .cs-col-num {
    font-family: var(--font-heading);
    font-weight: 700;
    text-align: right;
    white-space: nowrap;
    color: var(--dark-teal);
}
.cs-data-table .cs-col-num-green { color: var(--growth-green); }
.cs-pill {
    display: inline-block;
    padding: .15rem .55rem;
    border-radius: 20px;
    font-size: .625rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: white;
    white-space: nowrap;
}
.cs-pill-red   { background: var(--red); }
.cs-pill-amber { background: var(--amber); }
.cs-pill-green { background: var(--growth-green); }
.cs-pill-blue  { background: var(--bright-teal); }

/* — Affiliate links (subtle teal underline, no icon noise) — */
a.affiliate-link {
    color: var(--dark-teal);
    text-decoration: underline;
    text-decoration-color: var(--bright-teal);
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    font-weight: 600;
    transition: color .15s;
}
a.affiliate-link:hover {
    color: var(--bright-teal);
    text-decoration-color: var(--dark-teal);
}

/* — Reading progress bar (fixed to top of viewport) — */
.report-progress {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: transparent;
    z-index: 101;
    pointer-events: none;
}
.report-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--bright-teal), var(--growth-green), var(--bright-green));
    transition: width .1s linear;
    box-shadow: 0 0 6px rgba(28,176,206,.4);
}

/* — Two-column report layout (main content + right rail) — */
.report-layout {
    position: relative;
}
.report-main-container {
    /* Keep the same max-width as .container but leave room for the rail on desktop */
    max-width: 1200px;
    margin: 0 auto;
}

/* Give every anchored section breathing room from the sticky nav */
.report-layout [id^="sec-"],
.report-layout [id^="dive-"] {
    scroll-margin-top: 90px;
}

/* — Sticky TOC rail (desktop) —
   Hidden until the hero scrolls out of view so it doesn't sit on top of
   the Print / Download PDF buttons. Toggled by .is-ready from report-toc.js. */
.report-toc-rail {
    position: fixed;
    top: 5.5rem;               /* below topnav */
    right: max(1rem, calc((100vw - 1200px) / 2 + 1rem));
    width: 260px;
    max-height: calc(100vh - 7rem);
    overflow-y: auto;
    z-index: 50;
    background: white;
    border: 1px solid var(--silver);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 1rem .875rem;
    font-family: var(--font-body);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-.5rem);
    transition: opacity .2s ease-out, transform .2s ease-out;
}
.report-toc-rail.is-ready {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}
.report-toc-rail-inner { }
.report-toc-rail-label {
    font-family: var(--font-body);
    font-size: .6875rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--muted-teal);
    padding-bottom: .625rem;
    margin-bottom: .5rem;
    border-bottom: 1px solid var(--silver);
}
.report-toc-rail-list {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: toc-rail;
}
.report-toc-rail-list li {
    counter-increment: toc-rail;
    margin: 0;
    padding: 0;
}
.report-toc-rail-list a {
    display: block;
    padding: .45rem .5rem .45rem 1.75rem;
    font-size: .8125rem;
    line-height: 1.35;
    font-weight: 500;
    color: var(--charcoal);
    text-decoration: none;
    border-left: 2px solid transparent;
    border-radius: 0 4px 4px 0;
    position: relative;
    transition: background .15s, color .15s, border-color .15s;
}
.report-toc-rail-list > li > a::before {
    content: counter(toc-rail, decimal-leading-zero);
    position: absolute;
    left: .5rem;
    top: .45rem;
    font-family: var(--font-heading);
    font-size: .6875rem;
    font-weight: 700;
    color: var(--light-gray);
    letter-spacing: .02em;
}
.report-toc-rail-list a:hover {
    background: var(--snow);
    color: var(--dark-teal);
}
.report-toc-rail-list a.active {
    background: rgba(28,176,206,.08);
    color: var(--dark-teal);
    font-weight: 600;
    border-left-color: var(--bright-teal);
}
.report-toc-rail-list a.active::before {
    color: var(--bright-teal);
}
/* Nested (deep-dive) children */
.report-toc-rail-list .toc-nested {
    list-style: none;
    padding: 0;
    margin: 0 0 .25rem 0;
}
.report-toc-rail-list .toc-nested a {
    padding-left: 2.5rem;
    font-size: .75rem;
    color: var(--gray);
}
.report-toc-rail-list .toc-nested a::before {
    content: "";
    display: none;
}
.report-toc-rail-list .toc-nested a.active {
    color: var(--dark-teal);
}

/* Push main content to the left so the rail doesn't overlap on desktop */
@media (min-width: 1100px) {
    .report-main-container {
        max-width: 900px;
        margin-left: calc((100vw - 1200px) / 2 + 1rem);
        margin-right: 0;
    }
}
@media (min-width: 1400px) {
    .report-toc-rail {
        right: calc((100vw - 1280px) / 2);
        width: 280px;
    }
    .report-main-container {
        max-width: 920px;
    }
}

/* — Mobile: drawer pattern with toggle — */
.report-toc-toggle {
    display: none;
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    z-index: 60;
    align-items: center;
    gap: .4rem;
    padding: .625rem .875rem;
    background: var(--dark-teal);
    color: white;
    border: none;
    border-radius: 999px;
    font-family: var(--font-body);
    font-size: .8125rem;
    font-weight: 600;
    letter-spacing: .02em;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
}
.report-toc-toggle-icon {
    font-size: 1rem;
    line-height: 1;
}

@media (max-width: 1099px) {
    .report-toc-toggle { display: inline-flex; }
    .report-toc-rail {
        position: fixed;
        top: auto;
        right: 0;
        bottom: 0;
        left: 0;
        width: 100%;
        max-width: 100%;
        max-height: 60vh;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        border: none;
        border-top: 3px solid var(--bright-teal);
        transform: translateY(100%);
        transition: transform .25s ease-out;
        z-index: 70;
    }
    .report-toc-rail.is-open {
        transform: translateY(0);
    }
    /* Body scroll lock when drawer is open is handled by JS */
}

/* — Back-to-top button — */
.report-back-to-top {
    position: fixed;
    bottom: 1rem;
    left: 1rem;
    z-index: 60;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bright-teal);
    color: white;
    border: none;
    font-size: 1.25rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(1rem);
    transition: opacity .2s, transform .2s, background .15s;
}
.report-back-to-top.is-visible {
    opacity: 1;
    transform: translateY(0);
}
.report-back-to-top:hover {
    background: var(--dark-teal);
}
.report-back-to-top[hidden] { display: none; }

/* — Print view (when user hits browser Print) — */
@media print {
    .topnav,
    .report-progress,
    .report-toc-rail,
    .report-toc-toggle,
    .report-back-to-top,
    .report-print-btn,
    .flash {
        display: none !important;
    }
    .report-main-container,
    .report-layout {
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 .5in !important;
    }
    .card {
        box-shadow: none !important;
        border: 1px solid var(--silver) !important;
        page-break-inside: avoid;
        break-inside: avoid;
    }
    body { background: white !important; }
    a[href^="#"] { color: var(--dark-teal) !important; text-decoration: none !important; }
}
