@import url('assets/fonts/fonts.css');

/* ============================================================================
   M365 Copilot Productivity ROI Calculator — Design System
   "Institutional Precision": executive financial-report aesthetic.
   Money is brass. Exactly one azure accent carries all interaction.
   Depth from hairline rules and layered ink surfaces — never colored shadows.
   ========================================================================== */

:root {
    /* ── Ink surfaces (layered, neutral, cool) ───────────────────────────── */
    --ink-900: #0A0C10;
    --ink-800: #0E1117;
    --ink-700: #13171F;
    --ink-600: #1A1F29;
    --ink-500: #232936;

    /* ── Hairlines ───────────────────────────────────────────────────────── */
    --rule: rgba(255, 255, 255, 0.075);
    --rule-strong: rgba(255, 255, 255, 0.14);

    /* ── Text ────────────────────────────────────────────────────────────── */
    --text-primary: #E9ECF1;
    --text-secondary: #A2ABB9;
    --text-tertiary: #6C7684;

    /* ── The single interaction accent ───────────────────────────────────── */
    --accent: #4C8DFF;
    --accent-soft: rgba(76, 141, 255, 0.12);
    --accent-line: rgba(76, 141, 255, 0.45);
    --accent-hover: #3B79E6;

    /* ── Money ───────────────────────────────────────────────────────────── */
    --value: #D9A441;
    --value-soft: rgba(217, 164, 65, 0.10);

    /* ── Status ──────────────────────────────────────────────────────────── */
    --positive: #46B77F;
    --negative: #D2685F;
    --warn: #C9973F;

    /* ── Cohort ramp — categorical data encoding only (charts, pills, KPI
       rails). Not part of the interaction palette. Read at runtime by
       insights-shared.js so both themes stay in sync. ─────────────────────── */
    --cohort-power: var(--positive);
    --cohort-habitual: var(--accent);
    --cohort-novice: #8B5CF6;
    --cohort-low: var(--warn);
    --cohort-non: var(--negative);

    /* ── Type ────────────────────────────────────────────────────────────── */
    --font-display: 'Newsreader', Georgia, serif;
    --font-sans: 'IBM Plex Sans', 'Segoe UI', system-ui, sans-serif;
    /* Labels and figures use the sans face with tabular figures — the monospace
       look is reserved for genuine code and formulas via --font-code. */
    --font-mono: 'IBM Plex Sans', 'Segoe UI', system-ui, sans-serif;
    --font-code: 'IBM Plex Mono', 'Cascadia Mono', Consolas, monospace;

    /* ── Geometry ────────────────────────────────────────────────────────── */
    --radius: 10px;
    --radius-sm: 8px;

    /* ========================================================================
       LEGACY TOKEN ALIASES — do not remove.
       ~190 inline styles across script.js / sales-script.js / insights-*.js /
       *.html reference these older variable names. Aliasing them here re-skins
       every one of those call sites without editing a single inline style.
       ====================================================================== */
    --copilot-blue: var(--accent);
    --copilot-cyan: var(--accent);
    --copilot-purple: var(--accent);
    --copilot-orange: var(--warn);
    --dark-blue: var(--accent);
    --light-blue: var(--accent);

    --bg: var(--ink-900);
    --dark-bg: var(--ink-900);
    --surface: var(--ink-700);
    --surface-raised: var(--ink-600);
    --card-alt: var(--ink-600);
    --light-gray: rgba(255, 255, 255, 0.06);

    --border: var(--rule);
    --shadow: rgba(0, 0, 0, 0.5);

    --text: var(--text-primary);
    --text-muted: var(--text-secondary);
    --gray: var(--text-secondary);

    --green: var(--positive);
    --red: var(--negative);

    /* NOTE: --white was #0F172A (a DARK value) in the previous sheet. It is used
       as a foreground on filled chips/badges, so it must stay dark or that text
       becomes invisible. Preserve the dark semantic. */
    --white: var(--ink-900);

    /* Retired glow tokens — neutralised rather than deleted so any straggling
       reference resolves to something invisible instead of an invalid var(). */
    --glow-blue: transparent;
    --glow-purple: transparent;

    color-scheme: dark;
}

/* ============================================================================
   LIGHT THEME — "Institutional Precision, printed."

   Same discipline, rendered as premium financial print: a warm paper canvas
   (never clinical #FFFFFF for the page), deep ink type, hairline rules, white
   cards lifting off the paper with a whisper of shadow, one azure accent, and
   brass STILL reserved exclusively for money — darkened so it holds on paper.

   Dark is the CSS default and is left byte-for-byte intact. Everything below
   is additive and scoped to [data-theme="light"].
   ========================================================================== */

:root[data-theme="light"] {
    /* ── Paper + card surfaces ───────────────────────────────────────────── */
    --ink-900: #FFFDFB;   /* creamsicle canvas base (exports read this token) */
    --ink-800: #FFFFFF;
    --ink-700: #FFFFFF;   /* cards lift off the paper */
    --ink-600: #F1EFEA;
    --ink-500: #E7E4DD;

    /* ── Hairlines ───────────────────────────────────────────────────────── */
    --rule: rgba(23, 26, 33, 0.12);
    --rule-strong: rgba(23, 26, 33, 0.22);

    /* ── Text ────────────────────────────────────────────────────────────── */
    --text-primary: #12151B;
    --text-secondary: #3E4652;
    --text-tertiary: #5C6673;

    /* ── The single interaction accent ───────────────────────────────────── */
    --accent: #1B5FD9;
    --accent-soft: rgba(27, 95, 217, 0.09);
    --accent-line: rgba(27, 95, 217, 0.40);
    --accent-hover: #164FB4;

    /* ── Money — brass, darkened for paper ───────────────────────────────── */
    --value: #8A6514;
    --value-soft: rgba(138, 101, 20, 0.10);

    /* ── Status ──────────────────────────────────────────────────────────── */
    --positive: #12734A;
    --negative: #B3261E;
    --warn: #8A6514;

    --cohort-novice: #6D45B8;

    /* ── Legacy aliases that carried a LITERAL in dark ───────────────────── */
    /* Every alias declared as var(--token) re-derives automatically from the
       ramp above; only the literals need restating here. */
    --light-gray: rgba(23, 26, 33, 0.05);
    --shadow: rgba(23, 26, 33, 0.10);

    /* --white is a FOREGROUND on filled chips (e.g. the ROI Multiple figure on
       the orange fill in roi-calculator.html). It must stay DARK INK in BOTH
       themes or that text disappears. Never make this literally white. */
    --white: #15181E;

    color-scheme: light;
}

/* Paper grain: dark specks at a whisper, multiplied into the stock. */
:root[data-theme="light"] body::after {
    opacity: 0.02;
    mix-blend-mode: multiply;
}

/* Creamsicle: warm orange crests breaking into cream, settling to white.
   The solid background-color stays a real colour so canvas exports can read it. */
:root[data-theme="light"] body {
    background-color: #FFFDFB;
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 620' preserveAspectRatio='none'%3E%3Cdefs%3E%3ClinearGradient id='w1' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%23FF7A33' stop-opacity='.50'/%3E%3Cstop offset='.65' stop-color='%23FF9A5C' stop-opacity='.34'/%3E%3Cstop offset='1' stop-color='%23FFB27E' stop-opacity='.20'/%3E%3C/linearGradient%3E%3ClinearGradient id='w2' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%23FFA463' stop-opacity='.34'/%3E%3Cstop offset='.7' stop-color='%23FFC894' stop-opacity='.20'/%3E%3Cstop offset='1' stop-color='%23FFDDBE' stop-opacity='.10'/%3E%3C/linearGradient%3E%3ClinearGradient id='w3' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%23FFD2A6' stop-opacity='.22'/%3E%3Cstop offset='1' stop-color='%23FFFFFF' stop-opacity='0'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath fill='url(%23w1)' d='M0,0 L1440,0 L1440,214 C1250,300 1070,158 852,220 C654,276 468,186 246,230 C162,247 80,242 0,222 Z'/%3E%3Cpath fill='url(%23w2)' d='M0,0 L1440,0 L1440,320 C1236,416 1002,268 772,340 C572,402 372,300 172,344 C110,358 54,354 0,340 Z'/%3E%3Cpath fill='url(%23w3)' d='M0,0 L1440,0 L1440,448 C1210,556 968,398 726,470 C520,532 320,430 140,470 C90,481 44,478 0,466 Z'/%3E%3C/svg%3E"),
        radial-gradient(1100px 520px at 6% -10%, rgba(255, 138, 71, 0.26), transparent 62%),
        radial-gradient(900px 460px at 94% -6%, rgba(255, 176, 122, 0.22), transparent 66%),
        linear-gradient(180deg, #FFE7D4 0%, #FFF3E9 36%, #FFFFFF 76%);
    background-repeat: no-repeat;
    background-position: top center, top left, top right, top center;
    background-size: 100% 64vh, auto, auto, 100% 100%;
    background-attachment: fixed;
}

/* Cards lift off the paper with a single hairline shadow. Dark stays flat. */
:root[data-theme="light"] .instructions-section,
:root[data-theme="light"] .results-container > section,
:root[data-theme="light"] .roi-table-container,
:root[data-theme="light"] .leaderboard-container,
:root[data-theme="light"] .collapsible-section,
:root[data-theme="light"] .metric-card,
:root[data-theme="light"] .step-card,
:root[data-theme="light"] .info-box,
:root[data-theme="light"] .insights-card {
    box-shadow: 0 1px 2px var(--shadow);
}

:root[data-theme="light"] .metric-card:hover {
    box-shadow: 0 2px 6px var(--shadow);
}

:root[data-theme="light"] .info-tip .tip-text {
    box-shadow: 0 8px 24px var(--shadow);
}

/* Washes that were white-on-dark have to invert to ink-on-paper. */
:root[data-theme="light"] .segmented button:hover,
:root[data-theme="light"] .time-toggle-btn:hover {
    background: rgba(23, 26, 33, 0.045);
}

:root[data-theme="light"] .section-toggle:hover {
    background: rgba(23, 26, 33, 0.025);
}

:root[data-theme="light"] tr:hover {
    background: rgba(23, 26, 33, 0.028);
}

/* The active segment reads as a physical white chip on the recessed track. */
:root[data-theme="light"] .segmented button[aria-selected="true"],
:root[data-theme="light"] .segmented button.active,
:root[data-theme="light"] .time-toggle-btn.active {
    background: #FFFFFF;
    border-color: var(--accent);
    box-shadow: 0 1px 2px var(--shadow);
}

/* Select chevron is a data-URI, so its ink can't be a var(). */
:root[data-theme="light"] .config-item select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23838A95' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
}

/* Keep print identical in both themes — flat white stock, black ink. */
@media print {
    :root[data-theme="light"] body {
        background: #fff;
        background-image: none;
        color: #111;
    }
}

/* ============================================================================
   THEME TOGGLE — a compact two-state control, sized to sit inside
   .header-actions alongside the quiet header buttons.
   ========================================================================== */

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: transparent;
    border: 1px solid var(--rule);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    flex-shrink: 0;
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.theme-toggle:hover {
    background: var(--ink-600);
    border-color: var(--rule-strong);
    color: var(--text-primary);
}

.theme-toggle svg {
    width: 15px;
    height: 15px;
    display: block;
}

/* Pages with no <header> host the control at the end of the nav rule. */
.theme-toggle-nav {
    margin-left: auto;
    align-self: center;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    line-height: 1.65;
    color: var(--text-primary);
    background-color: var(--ink-900);
    background-image:
        radial-gradient(ellipse 90% 46% at 50% -14%, rgba(76, 141, 255, 0.055), transparent 70%),
        radial-gradient(ellipse 70% 40% at 88% 108%, rgba(217, 164, 65, 0.035), transparent 72%);
    background-attachment: fixed;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Faint film grain. Kills the flat "web app" look and gives printed-paper depth. */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    opacity: 0.035;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23g)'/%3E%3C/svg%3E");
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2.5rem 2rem 4rem;
}

/* ============================================================================
   TYPOGRAPHY
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 600;
    text-wrap: balance;
}

h1, header h1 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(2.2rem, 4vw, 3.2rem);
    letter-spacing: -0.02em;
    line-height: 1.08;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    /* Explicitly no gradient text. Ever. */
    background: none;
    -webkit-text-fill-color: currentColor;
}

h2 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    letter-spacing: -0.012em;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h3 {
    font-family: var(--font-sans);
    font-size: 1.0625rem;
    letter-spacing: -0.005em;
    line-height: 1.35;
    margin-bottom: 0.5rem;
}

h4 {
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    letter-spacing: -0.003em;
    margin-bottom: 0.4rem;
}

p {
    color: var(--text-secondary);
}

strong {
    color: var(--text-primary);
    font-weight: 600;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

code {
    font-family: var(--font-code);
    font-size: 0.875em;
}

/* Lede paragraph under a masthead title. */
.subtitle {
    font-family: var(--font-sans);
    font-size: 1.0625rem;
    line-height: 1.55;
    color: var(--text-secondary);
    max-width: 62ch;
    font-weight: 400;
}

/* Eyebrow: the small uppercase label that sits above a figure. */
.eyebrow,
.metric-label {
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 0.75rem;
    line-height: 1.4;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--text-secondary);
}

/* ── Numerals ────────────────────────────────────────────────────────────── */
.metric-value,
.figure {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

/* Every table gets column-aligned digits, terminal style. */
table,
th,
td {
    font-variant-numeric: tabular-nums;
}

/* ── The money rule: monetary figures are brass. ─────────────────────────── */
.is-value,
.figure--value {
    color: var(--value);
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

/* ============================================================================
   HEADER / MASTHEAD
   ========================================================================== */

header {
    position: relative;
    z-index: 2;
    margin-bottom: 2rem;
    padding: 0 0 1.75rem;
    background: none;
    border: none;
    border-bottom: 1px solid var(--rule);
    border-radius: 0;
    box-shadow: none;
    backdrop-filter: none;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 2.5rem;
}

.header-content > div:first-child {
    flex: 1;
    text-align: left;
    min-width: 0;
}

.header-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
    align-items: center;
}

/* ── Quiet header buttons ────────────────────────────────────────────────── */
.action-btn {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    background: var(--ink-700);
    border: 1px solid var(--rule-strong);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1;
    min-width: 0;
    white-space: nowrap;
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.action-btn:hover {
    background: var(--ink-600);
    border-color: var(--rule-strong);
    color: var(--text-primary);
    transform: none;
    box-shadow: none;
}

.action-icon {
    /* No emoji chrome. Retained as a hook; collapsed if anything still emits it. */
    display: none;
}

.action-text {
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.01em;
}

/* ============================================================================
   NAVIGATION — refined horizontal text nav, no cards, no icons
   ========================================================================== */

.nav-buttons {
    position: relative;
    z-index: 2;
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    align-items: stretch;
    gap: 0;
    margin: 0 0 2.5rem;
    padding: 0;
    border-bottom: 1px solid var(--rule);
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.nav-buttons::-webkit-scrollbar {
    display: none;
}

.nav-btn {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 0;
    flex: 0 0 auto;
    min-width: 0;
    padding: 0.75rem 0.25rem;
    margin-right: 1.75rem;
    margin-bottom: -1px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    box-shadow: none;
    text-decoration: none;
    white-space: nowrap;
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.005em;
    color: var(--text-secondary);
    transition: color 0.18s ease, border-color 0.18s ease;
}

.nav-btn:last-child {
    margin-right: 0;
}

.nav-btn:hover {
    color: var(--text-primary);
    background: none;
    transform: none;
    box-shadow: none;
    border-bottom-color: var(--rule-strong);
    text-decoration: none;
}

.nav-btn-active {
    color: var(--text-primary);
    font-weight: 600;
    background: var(--accent-soft);
    box-shadow: none;
    border-bottom-color: var(--accent);
    border-bottom-width: 3px;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    border-radius: 6px 6px 0 0;
}

/* .nav-text carries its own weight, so the active state has to win on the span too. */
.nav-btn-active .nav-text {
    font-weight: 600;
    color: var(--text-primary);
}

.nav-btn-active:hover {
    transform: none;
    box-shadow: none;
    background: var(--accent-soft);
    border-bottom-color: var(--accent);
}

/* Safety net: nothing decorative in the nav, whatever emits it. */
.nav-icon {
    display: none;
}

.nav-text {
    font-weight: 500;
    font-size: 0.875rem;
    text-align: left;
}

/* ============================================================================
   SEGMENTED CONTROLS (period selector, view switches)
   ========================================================================== */

.segmented,
.time-toggle-bar,
.mpa-toggle-bar {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px;
    padding: 3px;
    background: var(--ink-600);
    border: 1px solid var(--rule);
    border-radius: var(--radius-sm);
}

.time-toggle-bar,
.mpa-toggle-bar {
    /* These bars are emitted with inline flex/justify styles; keep them centred. */
    margin-left: auto;
    margin-right: auto;
}

.segmented button,
.time-toggle-btn {
    appearance: none;
    -webkit-appearance: none;
    padding: 0.4375rem 0.875rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    font-family: var(--font-sans);
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: 0.005em;
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.16s ease, color 0.16s ease;
}

.segmented button:hover,
.time-toggle-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.segmented button[aria-selected="true"],
.segmented button.active,
.time-toggle-btn.active {
    background: var(--ink-500);
    color: var(--text-primary);
    font-weight: 600;
    border-color: var(--accent);
    box-shadow: inset 0 0 0 1px var(--rule);
}

/* ============================================================================
   REPORT TABS
   ========================================================================== */

.report-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    margin: 1.75rem 0 0;
    padding: 0;
    border: none;
    border-bottom: 1px solid var(--rule) !important;
    background: none;
}

.report-tab {
    flex: 0 0 auto !important;
    appearance: none;
    -webkit-appearance: none;
    padding: 0.75rem 0 !important;
    margin-right: 1.75rem;
    margin-bottom: -1px;
    background: transparent !important;
    border: none !important;
    border-bottom: 2px solid transparent !important;
    border-radius: 0 !important;
    font-family: var(--font-sans) !important;
    font-size: 0.875rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.005em;
    color: var(--text-tertiary) !important;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.18s ease, border-color 0.18s ease;
}

.report-tab:last-child {
    margin-right: 0;
}

.report-tab:hover {
    color: var(--text-primary) !important;
}

.report-tab.active {
    color: var(--text-primary) !important;
    border-bottom-color: var(--accent) !important;
}

/* ============================================================================
   PANELS
   ========================================================================== */

.instructions-section,
.results-container > section,
.roi-table-container,
.leaderboard-container,
.collapsible-section {
    position: relative;
    z-index: 2;
    background: var(--ink-700);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    box-shadow: none;
    margin-bottom: 1.5rem;
}

.instructions-section {
    padding: 2rem 2.25rem 2.25rem;
}

.instructions-section h2 {
    color: var(--text-primary);
    font-size: 1.5rem;
    margin-bottom: 1.75rem;
    text-align: left;
    padding-bottom: 0.875rem;
    border-bottom: 1px solid var(--rule);
}

.roi-table-container {
    padding: 1.75rem 2rem 2rem;
    overflow-x: auto;
}

/* Wide result tables scroll inside their panel rather than running off the page.
   Tooltips are portalled to <body>, so clipping the panel is safe. */
.leaderboard-container {
    overflow-x: auto;
}

.sortable-table {
    font-size: 0.8125rem;
}

/* Nine columns only fit if the headers are allowed to wrap. */
.sortable-table th {
    white-space: normal;
    padding: 0.625rem 0.5rem;
}

.sortable-table td {
    padding: 0.625rem 0.5rem;
}

#teamsTable th:first-child,
#teamsTable td:first-child {
    white-space: normal;
    min-width: 7rem;
    max-width: 14rem;
    word-break: break-word;
}

.roi-table-container h2,
.leaderboard-container h2 {
    color: var(--text-primary);
    font-size: 1.25rem;
    margin-bottom: 1.25rem;
    text-align: left;
}

.leaderboard-container {
    padding: 1.75rem 2rem 2rem;
}

/* Top-level section headings on long narrative pages (Adoption Journey).
   Sized to actually announce a new section rather than read as a sub-label. */
.page-section-title {
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 2.6vw, 2.4rem);
    font-weight: 600;
    line-height: 1.18;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    text-align: center;
    margin: 3.5rem 0 1rem;
}

/* ── Step cards ──────────────────────────────────────────────────────────── */
.step-card {
    display: flex;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
    padding: 1.375rem 1.5rem;
    background: var(--ink-600);
    border: 1px solid var(--rule);
    border-left: 1px solid var(--rule);
    border-radius: var(--radius);
}

.step-card:last-child {
    margin-bottom: 0;
}

.step-number {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    background: transparent;
    border: 1px solid var(--accent-line);
    color: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1;
}

.step-content {
    flex: 1;
    min-width: 0;
}

.step-content h3 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 1.0625rem;
    font-weight: 600;
}

.step-content p {
    margin-bottom: 0.875rem;
    color: var(--text-secondary);
}

.step-content ol {
    margin-left: 1.25rem;
    margin-bottom: 0.875rem;
    color: var(--text-secondary);
}

.step-content li {
    margin-bottom: 0.375rem;
}

/* ── Info / privacy / error callouts ─────────────────────────────────────── */
.info-box {
    background: var(--ink-600);
    padding: 1rem 1.25rem;
    border: 1px solid var(--rule);
    border-left: 2px solid var(--accent);
    border-radius: var(--radius-sm);
    margin-top: 1rem;
}

.info-box strong {
    display: inline;
    color: var(--text-primary);
}

.info-box p {
    margin: 0;
    font-size: 0.9375rem;
    line-height: 1.65;
    color: var(--text-secondary);
}

.info-box small {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
}

.privacy-box {
    display: flex;
    gap: 0.875rem;
    align-items: flex-start;
    border-left-color: var(--positive);
}

.privacy-box svg {
    flex-shrink: 0;
    color: var(--positive);
    margin-top: 0.2rem;
}

.error-box {
    background: var(--ink-700);
    border: 1px solid var(--rule);
    border-left: 2px solid var(--negative);
    border-radius: var(--radius);
    padding: 1.75rem 2rem;
    text-align: left;
}

.error-box h3 {
    color: var(--negative);
    margin-bottom: 0.75rem;
}

/* ── Collapsible sections ────────────────────────────────────────────────── */
.section-toggle {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 1.125rem 1.75rem;
    font-family: var(--font-display);
    font-size: 1.1875rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    cursor: pointer;
    list-style: none;
    user-select: none;
    transition: background-color 0.16s ease;
}

.section-toggle::-webkit-details-marker { display: none; }

.section-toggle:hover {
    background: rgba(255, 255, 255, 0.02);
}

details.collapsible-section[open] .section-toggle {
    border-bottom: 1px solid var(--rule);
}

.toggle-chevron {
    display: inline-block;
    transition: transform 0.22s cubic-bezier(0.2, 0.7, 0.2, 1);
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

details.collapsible-section:not([open]) .toggle-chevron {
    transform: rotate(-90deg);
}

.section-body {
    padding: 1.5rem 1.75rem 1.75rem;
}

/* Remove double-boxing when a container sits inside a collapsible. */
.collapsible-section .roi-table-container,
.collapsible-section .leaderboard-container {
    box-shadow: none;
    border: none;
    padding: 0;
    margin: 0;
    border-radius: 0;
    background: transparent;
}

/* ============================================================================
   METRIC CARDS — a statement grid, not floating glow boxes
   ========================================================================== */

.metrics-grid {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.metric-card {
    background: var(--ink-700);
    padding: 1.5rem 1.5rem 1.625rem;
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    box-shadow: none;
    text-align: left;
    container-type: inline-size;
    overflow: visible;
    transition: border-color 0.18s ease;
}

.metric-card:hover {
    transform: none;
    box-shadow: none;
    border-color: var(--rule-strong);
}

.metric-value {
    display: block;
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    font-size: clamp(2rem, 3.4vw, 2.75rem);
    font-weight: 500;
    letter-spacing: -0.02em;
    line-height: 1.1;
    color: var(--text-primary);
    background: none;
    -webkit-text-fill-color: currentColor;
    margin: 0.625rem 0 0;
    overflow-wrap: break-word;
    word-break: break-word;
}

.metric-label {
    display: block;
}

.metric-sublabel {
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--text-tertiary);
    margin-top: 0.5rem;
}

.metric-label-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
}

/* Money is brass. The monthly / annual productivity value figures carry it.
   Declared with !important because these figures are emitted with an inline
   colour by the report renderer; the design system owns the hue, not the JS. */
#km-monthlyValue,
#km-annualValue,
.metric-value.is-value {
    color: var(--value) !important;
    -webkit-text-fill-color: var(--value) !important;
}

/* ============================================================================
   TOOLTIPS
   ========================================================================== */

.info-tip {
    position: relative;
    display: inline-flex;
    cursor: help;
}

.info-tip .info-icon {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    border: 1px solid var(--text-tertiary);
    color: var(--text-tertiary);
    font-family: var(--font-sans);
    font-size: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.18s ease, color 0.18s ease;
    flex-shrink: 0;
}

.info-tip:hover .info-icon {
    border-color: var(--accent);
    color: var(--accent);
}

.info-tip .tip-text {
    visibility: hidden;
    opacity: 0;
    position: fixed;
    z-index: 9999;
    background: var(--ink-600);
    color: var(--text-primary);
    padding: 0.75rem 0.875rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 0.8125rem;
    font-weight: 400;
    line-height: 1.5;
    width: 260px;
    text-align: left;
    text-transform: none;
    letter-spacing: normal;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
    border: 1px solid var(--rule-strong);
    transition: opacity 0.18s ease, visibility 0.18s ease;
    pointer-events: none;
}

.info-tip .tip-text::after {
    display: none;
}

.info-tip:hover .tip-text {
    visibility: visible;
    opacity: 1;
}

.cri-tip {
    display: inline-block;
    margin-left: 0.375rem;
    cursor: help;
    color: var(--text-tertiary);
    font-size: 0.85em;
    line-height: 1;
    border-radius: 50%;
    transition: color 0.15s ease;
}

.cri-tip:hover,
.cri-tip:focus {
    color: var(--accent);
    outline: none;
    transform: none;
}

/* ============================================================================
   MATH CALLOUTS
   ========================================================================== */

.cri-math {
    margin-top: 1rem;
    padding: 0.875rem 1rem;
    background: var(--ink-600);
    border: 1px solid var(--rule);
    border-left: 2px solid var(--accent);
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.cri-math-label {
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.6875rem;
    margin-bottom: 0.4rem;
}

.cri-math-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cri-math-item {
    position: relative;
    padding-left: 1.1rem;
    margin: 0 0 0.3rem;
    font-family: var(--font-sans);
    font-variant-numeric: tabular-nums;
    font-size: 0.8125rem;
    line-height: 1.55;
    color: var(--text-primary);
    word-break: break-word;
}

.cri-math-item:last-child {
    margin-bottom: 0;
}

.cri-math-item::before {
    content: "\2022";
    position: absolute;
    left: 0.15rem;
    color: var(--accent);
}

.cri-math-note {
    margin-top: 0.4rem;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    line-height: 1.5;
}

/* ============================================================================
   TABLES
   ========================================================================== */

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

th {
    background: transparent;
    color: var(--text-tertiary);
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    line-height: 1.4;
    padding: 0.75rem 0.875rem;
    text-align: left;
    vertical-align: bottom;
    border-bottom: 1px solid var(--rule-strong);
    white-space: nowrap;
}

th span {
    letter-spacing: 0.06em;
}

th.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    transition: color 0.16s ease;
}

th.sortable:hover {
    background: transparent;
    color: var(--text-secondary);
}

th.sortable .sort-icon {
    font-size: 0.8em;
    margin-left: 0.25rem;
    color: var(--accent);
}

th.sortable.sort-asc,
th.sortable.sort-desc {
    background: transparent;
    color: var(--text-primary);
}

td {
    padding: 0.75rem 0.875rem;
    border-bottom: 1px solid var(--rule);
    color: var(--text-secondary);
    vertical-align: top;
}

td strong {
    color: var(--text-primary);
}

tbody tr:last-child td {
    border-bottom: none;
}

tr:hover {
    background: rgba(255, 255, 255, 0.022);
}

/* ── Cohort row tints ─────────────────────────────────────────────────────
   A low-alpha wash keyed to each Usage Threshold tier, fading out to the
   right so the numbers stay on a clean field. Painted as background-image so
   the row-hover background-color still reads on top. */
.cohort-row {
    background-repeat: no-repeat;
}

.cohort-row--power    { background-image: linear-gradient(90deg, rgba(70, 183, 127, 0.16), rgba(70, 183, 127, 0) 72%); }
.cohort-row--habitual { background-image: linear-gradient(90deg, rgba(56, 189, 208, 0.15), rgba(56, 189, 208, 0) 72%); }
.cohort-row--novice   { background-image: linear-gradient(90deg, rgba(76, 141, 255, 0.14), rgba(76, 141, 255, 0) 72%); }
.cohort-row--low      { background-image: linear-gradient(90deg, rgba(224, 164, 68, 0.15), rgba(224, 164, 68, 0) 72%); }
.cohort-row--non      { background-image: linear-gradient(90deg, rgba(210, 104, 95, 0.14), rgba(210, 104, 95, 0) 72%); }

:root[data-theme="light"] .cohort-row--power    { background-image: linear-gradient(90deg, rgba(31, 138, 90, 0.11), rgba(31, 138, 90, 0) 72%); }
:root[data-theme="light"] .cohort-row--habitual { background-image: linear-gradient(90deg, rgba(20, 138, 156, 0.10), rgba(20, 138, 156, 0) 72%); }
:root[data-theme="light"] .cohort-row--novice   { background-image: linear-gradient(90deg, rgba(27, 95, 217, 0.09), rgba(27, 95, 217, 0) 72%); }
:root[data-theme="light"] .cohort-row--low      { background-image: linear-gradient(90deg, rgba(176, 116, 20, 0.11), rgba(176, 116, 20, 0) 72%); }
:root[data-theme="light"] .cohort-row--non      { background-image: linear-gradient(90deg, rgba(178, 61, 52, 0.09), rgba(178, 61, 52, 0) 72%); }

.highlight-row {
    background: var(--accent-soft);
    font-weight: 600;
}

.highlight-row td {
    color: var(--text-primary);
}

/* Numeric cell hook — mono, tabular, right-aligned. */
td.num,
th.num {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
    text-align: right;
}

/* ── Glossary ────────────────────────────────────────────────────────────── */
.glossary-table td:first-child {
    white-space: nowrap;
    width: 1%;
    color: var(--text-primary);
    font-weight: 600;
    vertical-align: top;
    padding-right: 1.5rem;
}

.glossary-table td {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    line-height: 1.6;
}

/* ============================================================================
   BUTTONS
   ========================================================================== */

.btn-primary,
.btn-secondary {
    padding: 0.6875rem 1.375rem;
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.005em;
    line-height: 1.3;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: inline-block;
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    color: #fff;
    transform: none;
    box-shadow: none;
    text-decoration: none;
}

.btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--rule);
}

.btn-secondary:hover {
    background: var(--ink-600);
    border-color: var(--rule-strong);
    color: var(--text-primary);
}

/* ============================================================================
   FORMS
   ========================================================================== */

.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem 1.5rem;
    margin-top: 1.5rem;
}

.config-item {
    display: flex;
    flex-direction: column;
}

.config-item label {
    font-family: var(--font-sans);
    font-weight: 500;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-bottom: 0.4375rem;
}

.config-item input,
.config-item select {
    padding: 0.625rem 0.75rem;
    font-family: var(--font-sans);
    font-size: 0.875rem;
    border: 1px solid var(--rule);
    border-radius: var(--radius-sm);
    background-color: var(--ink-600);
    color: var(--text-primary);
    width: 100%;
    transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.config-item input[type="number"] {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
}

.config-item select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236C7684' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
    cursor: pointer;
}

.config-item input:focus,
.config-item select:focus {
    outline: none;
    border-color: var(--accent-line);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.config-item small {
    margin-top: 0.375rem;
    font-size: 0.75rem;
    line-height: 1.5;
    color: var(--text-tertiary);
}

/* ============================================================================
   UPLOAD AREA
   ========================================================================== */

.upload-area {
    border: 1px dashed var(--rule-strong);
    border-radius: var(--radius);
    padding: 3rem 2rem;
    text-align: center;
    background: transparent;
    transition: border-color 0.18s ease, background-color 0.18s ease;
    cursor: pointer;
    margin: 1.5rem 0;
}

.upload-area:hover {
    border-color: var(--accent-line);
    background: var(--accent-soft);
    box-shadow: none;
}

.upload-area.dragover {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.upload-area svg {
    color: var(--text-tertiary);
    margin-bottom: 0.875rem;
    transition: color 0.18s ease;
}

.upload-area:hover svg,
.upload-area.dragover svg {
    color: var(--accent);
}

.upload-area p {
    margin: 0.375rem 0;
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

/* ============================================================================
   LOADING / STATES
   ========================================================================== */

#loadingState {
    text-align: center;
    padding: 4rem 2rem;
}

.loading-spinner {
    width: 34px;
    height: 34px;
    border: 2px solid var(--rule-strong);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.results-container {
    position: relative;
    z-index: 2;
    animation: rise 0.45s cubic-bezier(0.2, 0.7, 0.2, 1) backwards;
}

/* ============================================================================
   TOGGLE SWITCH
   ========================================================================== */

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--ink-500);
    border: 1px solid var(--rule);
    transition: background-color 0.22s ease, border-color 0.22s ease;
    border-radius: 999px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: var(--text-secondary);
    transition: transform 0.22s cubic-bezier(0.2, 0.7, 0.2, 1), background-color 0.22s ease;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: var(--accent);
    border-color: var(--accent);
}

input:checked + .toggle-slider:before {
    transform: translateX(18px);
    background-color: #fff;
}

.toggle-slider:hover {
    border-color: var(--rule-strong);
    box-shadow: none;
}

input:checked + .toggle-slider:hover {
    box-shadow: none;
}

/* ============================================================================
   FOOTER
   ========================================================================== */

footer,
.cri-footer {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 2.5rem 1rem 1rem;
    margin-top: 2rem;
    border-top: 1px solid var(--rule);
    color: var(--text-tertiary);
}

footer p,
.cri-footer p {
    margin: 0.3rem 0;
    font-size: 0.8125rem;
    color: var(--text-tertiary);
}

footer a,
.cri-footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    margin: 0 0.15rem;
    transition: color 0.16s ease;
}

footer a:hover,
.cri-footer-links a:hover {
    color: var(--text-primary);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* The quiet secondary link that carries pages out of the primary nav. */
.footer-nav {
    margin-top: 0.75rem;
    font-size: 0.8125rem;
    color: var(--text-tertiary);
}

.footer-nav a {
    color: var(--text-secondary);
}

/* ============================================================================
   ACCESSIBILITY
   ========================================================================== */

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 3px;
}

::selection {
    background: var(--accent-soft);
    color: var(--text-primary);
}

/* ============================================================================
   MOTION
   ========================================================================== */

@keyframes rise {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Legacy name kept: inline styles and JS still reference `fadeIn`. */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* `backwards` (not `both`) is deliberate: a lingering fill would leave a
   permanent transform on these panels, turning them into containing blocks for
   the position:fixed metric tooltips nested inside them. */
header,
.nav-buttons,
.instructions-section,
.metrics-grid,
.roi-table-container,
.leaderboard-container,
.collapsible-section {
    animation: rise 0.45s cubic-bezier(0.2, 0.7, 0.2, 1) backwards;
}

.nav-buttons            { animation-delay: 0.04s; }
.instructions-section   { animation-delay: 0.08s; }
.metrics-grid           { animation-delay: 0.08s; }
.roi-table-container    { animation-delay: 0.12s; }
.leaderboard-container  { animation-delay: 0.14s; }
.collapsible-section    { animation-delay: 0.16s; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }

    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        animation-delay: 0s !important;
    }
}

/* ============================================================================
   PRINT
   ========================================================================== */

@media print {
    body::after { display: none; }

    body {
        background: #fff;
        color: #111;
    }

    details.collapsible-section:not([open]) .section-body {
        display: none !important;
    }
    .section-toggle {
        page-break-after: avoid;
    }
    .toggle-chevron {
        display: none;
    }

    .nav-buttons,
    .header-actions,
    .action-btn,
    button,
    .opp-slider-row,
    .toggle-switch,
    .opp-toggle-row,
    input[type="range"] {
        display: none !important;
    }

    .page-break {
        page-break-before: always;
    }

    .phase-card,
    .month-card,
    .insight-card,
    .scenario-card,
    img,
    .timeline-visual,
    .month-grid,
    .metric-card {
        page-break-inside: avoid;
    }

    header {
        page-break-after: avoid;
    }

    * {
        animation: none !important;
    }
}

/* ============================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 768px) {
    .container {
        padding: 1.5rem 1rem 3rem;
    }

    header h1 {
        font-size: 1.875rem;
    }

    .header-content {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
        gap: 1.25rem;
    }

    .header-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .nav-btn {
        margin-right: 1.25rem;
    }

    .instructions-section {
        padding: 1.5rem 1.25rem;
    }

    .roi-table-container,
    .leaderboard-container {
        padding: 1.25rem 1rem 1.5rem;
    }

    .section-toggle {
        padding: 1rem 1.25rem;
        font-size: 1.0625rem;
    }

    .section-body {
        padding: 1.25rem 1.25rem 1.5rem;
    }

    .step-card {
        flex-direction: row;
        gap: 1rem;
        padding: 1.125rem 1.25rem;
    }

    .config-grid {
        grid-template-columns: 1fr;
    }

    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .metric-card {
        padding: 1.25rem;
    }

    .report-tab {
        margin-right: 1.25rem;
    }

    table {
        font-size: 0.8125rem;
    }

    th, td {
        padding: 0.625rem 0.5rem;
    }
}

@media (max-width: 640px) {
    .nav-buttons {
        justify-content: flex-start;
    }

    .nav-btn {
        min-width: unset;
    }
}

/* Light mode: header controls sit on the warm gradient, so they need a solid
   chip and a real edge to stay legible. */
:root[data-theme="light"] .action-btn {
    background: #FFFFFF;
    border-color: rgba(23, 26, 33, 0.26);
    color: var(--text-primary);
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(23, 26, 33, 0.10);
}

:root[data-theme="light"] .action-btn:hover {
    background: #FFFFFF;
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 2px 6px rgba(23, 26, 33, 0.14);
}

:root[data-theme="light"] .nav-btn {
    color: #3E4652;
    font-weight: 500;
}

:root[data-theme="light"] .nav-btn:hover {
    color: var(--text-primary);
}

:root[data-theme="light"] .nav-btn-active {
    color: var(--text-primary);
    font-weight: 600;
    background: var(--accent-soft);
}

:root[data-theme="light"] .nav-btn-active .nav-text {
    font-weight: 600;
    color: var(--text-primary);
}

:root[data-theme="light"] .subtitle {
    color: #3E4652;
}

/* ==========================================================================
   LIGHT MODE — INTERACTIVE CHIP
   Anything you can click or type into gets the same treatment: a solid white
   chip with a real edge and a hairline shadow, so controls read as raised
   against the warm canvas instead of dissolving into it.
   ========================================================================== */

:root[data-theme="light"] .config-item input,
:root[data-theme="light"] .config-item select,
:root[data-theme="light"] input[type="text"],
:root[data-theme="light"] input[type="number"],
:root[data-theme="light"] select,
:root[data-theme="light"] textarea,
:root[data-theme="light"] .segmented,
:root[data-theme="light"] .upload-area,
:root[data-theme="light"] details.collapsible-section,
:root[data-theme="light"] .btn-secondary {
    background-color: #FFFFFF;
    border-color: rgba(23, 26, 33, 0.26);
    color: var(--text-primary);
    box-shadow: 0 1px 2px rgba(23, 26, 33, 0.10);
}

:root[data-theme="light"] .config-item input:hover,
:root[data-theme="light"] .config-item select:hover,
:root[data-theme="light"] input[type="text"]:hover,
:root[data-theme="light"] input[type="number"]:hover,
:root[data-theme="light"] select:hover,
:root[data-theme="light"] .btn-secondary:hover {
    border-color: rgba(23, 26, 33, 0.40);
    box-shadow: 0 2px 6px rgba(23, 26, 33, 0.13);
}

:root[data-theme="light"] .config-item input:focus,
:root[data-theme="light"] .config-item select:focus,
:root[data-theme="light"] input[type="text"]:focus,
:root[data-theme="light"] input[type="number"]:focus,
:root[data-theme="light"] select:focus,
:root[data-theme="light"] textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft), 0 1px 2px rgba(23, 26, 33, 0.10);
    outline: none;
}

/* The dashed drop target still reads as a target, just on a white chip. */
:root[data-theme="light"] .upload-area {
    border-style: dashed;
    border-color: rgba(23, 26, 33, 0.30);
}

:root[data-theme="light"] .upload-area:hover,
:root[data-theme="light"] .upload-area.dragover {
    border-color: var(--accent);
    background-color: #FFFFFF;
    box-shadow: 0 2px 10px rgba(23, 26, 33, 0.14);
}

/* Collapsible headers are clickable, so the whole chip lifts on hover. */
:root[data-theme="light"] details.collapsible-section:hover {
    border-color: rgba(23, 26, 33, 0.34);
    box-shadow: 0 2px 6px rgba(23, 26, 33, 0.13);
}

/* Segmented track stays recessed; the selected chip is the white one. */
:root[data-theme="light"] .segmented {
    background-color: #F1EFEA;
    box-shadow: inset 0 1px 2px rgba(23, 26, 33, 0.06);
}

/* Range slider: white thumb with a real edge so it reads as grabbable. */
:root[data-theme="light"] input[type="range"] {
    accent-color: var(--accent);
}

:root[data-theme="light"] input[type="range"]::-webkit-slider-thumb {
    background: #FFFFFF;
    border: 1px solid rgba(23, 26, 33, 0.34);
    box-shadow: 0 1px 3px rgba(23, 26, 33, 0.22);
}

:root[data-theme="light"] .toggle-slider {
    background-color: #E7E4DD;
    border: 1px solid rgba(23, 26, 33, 0.20);
}

:root[data-theme="light"] .toggle-slider:before {
    background-color: #FFFFFF;
    box-shadow: 0 1px 3px rgba(23, 26, 33, 0.24);
}

/* Tooltip copy always renders as bullets so it can be scanned, not read. */
.tip-text .tip-list {
    margin: 0;
    padding-left: 1.05rem;
    list-style: disc;
    text-align: left;
}

.tip-text .tip-list li {
    margin: 0 0 0.35rem;
    padding: 0;
    line-height: 1.45;
}

.tip-text .tip-list li:last-child {
    margin-bottom: 0;
}

/* Benchmark mode adds a delta chip to several columns, which pushes the ROI
   column past the edge. Reclaim the width from the sparkline and the padding. */
.insights-host table.bench-on {
    table-layout: auto;
    width: 100%;
}

.insights-host table.bench-on th,
.insights-host table.bench-on td {
    padding-left: 0.4rem;
    padding-right: 0.4rem;
}

.insights-host table.bench-on th:last-child,
.insights-host table.bench-on td:last-child {
    padding-right: 0.85rem;
    white-space: nowrap;
}

.insights-host table.bench-on .js-spark,
.insights-host table.bench-on .spark-cell {
    width: 84px;
    max-width: 84px;
}

.insights-host table.bench-on .spark-cell svg {
    width: 84px;
    height: auto;
}

/* Tooltips are injected inside label rows that set white-space:nowrap, so the
   bubble inherits it and its text runs past the edge. Force wrapping here. */
.info-tip .tip-text,
.info-tip .tip-text * {
    white-space: normal !important;
    overflow-wrap: anywhere;
    word-break: normal;
    text-overflow: clip;
}

.info-tip .tip-text {
    width: max-content;
    max-width: 300px;
    box-sizing: border-box;
}

/* Parse overlay: painted before the blocking CSV parse so the page never looks frozen. */
#parseLoadingOverlay {
    background: rgba(10, 12, 16, 0.93);
}

:root[data-theme="light"] #parseLoadingOverlay {
    background: rgba(255, 253, 251, 0.94);
}
