/* Inter (SIL Open Font License, static/fonts/OFL.txt), served by the app so the screen, the browser's Print
   and the PDFs printed on the server (where the Mac system font doesn't exist) all use the same type */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap;
    src: url('/static/fonts/inter-latin-wght-normal.woff2') format('woff2-variations');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter'; font-style: italic; font-weight: 100 900; font-display: swap;
    src: url('/static/fonts/inter-latin-wght-italic.woff2') format('woff2-variations');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap;
    src: url('/static/fonts/inter-latin-ext-wght-normal.woff2') format('woff2-variations');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Inter'; font-style: italic; font-weight: 100 900; font-display: swap;
    src: url('/static/fonts/inter-latin-ext-wght-italic.woff2') format('woff2-variations');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
    /* One colour set for the app: change a colour here and every page follows */
    --brand: #3f51b5;
    --brand-dark: #29378f;
    --brand-line: #8e9ed6;
    --brand-tint: #eef1fb;
    --ink: #1f2a44;
    --text: #2c3e50;
    --text-soft: #55627a;
    --muted: #6b7385;
    --faint: #95a5a6;
    --line: #e3e8ef;
    --line-soft: #ecf0f1;
    --line-strong: #bdc3c7;
    --surface-soft: #f6f8fc;
    --danger: #c0392b;
    --danger-bright: #e74c3c;
    --danger-line: #e6b0aa;
    --danger-tint: #fdedec;
    --success: #27ae60;
    --success-tint: #e8f8f0;
    --warning: #d68910;
    --warning-tint: #fef5e7;
    --info: #2e86c1;
    --info-tint: #ebf5fb;
    /* added with the token pass: deeper and lighter steps, accents */
    --brand-deep: #1f2a70;
    --brand-mid: #34449f;
    --slate: #8794ad;
    --line-cool: #d5dbe8;
    --surface: #ffffff;
    --surface-muted: #f2f3f4;
    --canvas: #e9edf7;
    --danger-dark: #922b21;
    --success-dark: #1e8449;
    --success-line: #a9dfbf;
    --warning-dark: #9a6300;
    --warning-ink: #6d5200;
    --warning-line: #f3d27a;
    --info-dark: #1f618d;
    --accent-purple: #8e44ad;
    --accent-purple-tint: #f4ecf7;
    --accent-orange: #e67e22;
    --accent-orange-tint: #fdf2e9;
    --accent-orange-dark: #a04000;
    --accent-yellow: #f1c40f;
    --accent-yellow-tint: #fef9e7;
    /* type scale: every font size in the app is one of these (display numbers and print sizes excepted) */
    --fs-2xs: 11px;
    --fs-xs: 12px;
    --fs-sm: 13px;
    --fs-base: 14px;
    --fs-md: 16px;
    --fs-lg: 18px;
    --fs-xl: 22px;
    --fs-2xl: 28px;
    /* the one risk scale (riskChip in utilities.js): a solid colour, a tint and an ink for text on the tint */
    --risk-very-high: #c0392b; --risk-very-high-tint: #fadbd8; --risk-very-high-ink: #922b21;
    --risk-high: #e67e22;      --risk-high-tint: #fdebd0;      --risk-high-ink: #a04000;
    --risk-moderate: #f1c40f;  --risk-moderate-tint: #fcf3cf;  --risk-moderate-ink: #7d6608;
    --risk-low: #7cb342;       --risk-low-tint: #e6f2d9;       --risk-low-ink: #3f6b1c;
    --risk-minimal: #27ae60;   --risk-minimal-tint: #d4efdf;   --risk-minimal-ink: #145a32;
}

/* Cognitient app styles (moved from dashboard_with_auth.html) */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    /* the blue of the Cognitient logo at the top, fading into a light canvas behind the content */
    background: linear-gradient(180deg, var(--brand-dark) 0, var(--brand-mid) 180px, var(--canvas) 560px) no-repeat, var(--canvas);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.header h1 {
    color: var(--text);
    font-size: var(--fs-xl);
}

.site-footer {
    margin-top: 40px;
    padding: 20px 0;
    text-align: center;
    font-size: var(--fs-xs);
    color: var(--muted);
    line-height: 1.6;
}

.brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.brand-logo.text-logo { font-size: 22px; }   /* the text logo itself: static/logo.css */
.brand-home { display: inline-flex; padding: 0; border: 0; background: none; cursor: pointer; border-radius: 6px; }
.brand-home:focus-visible { outline: 2px solid var(--brand); outline-offset: 4px; }
body.on-app .brand-home:focus-visible { outline-color: #fff; }
.boot-logo.text-logo { font-size: 30px; }

.auth-logo {
    display: block;
    height: 80px;
    margin: 0 auto 24px;
    border-radius: 8px;
}

.user-info {
    display: flex;
    gap: 12px;
    align-items: center;
}

.user-info span {
    color: var(--text-soft);
    font-size: var(--fs-base);
}

/* the top bar's labels stay on one line; on narrower screens the "Signed in as" line goes first (My account shows it) */
.header h1, .user-info .btn-small { white-space: nowrap; }
@media (max-width: 1100px) {
    #userEmail { display: none; }
}

/* the hidden attribute always hides, whatever display a class sets */
[hidden] { display: none !important; }

/* Button Styles: one set for the whole app.
   Sizes: medium (default) and .btn-small. Kinds: .btn-primary, .btn-secondary, and .danger on a
   secondary for anything destructive. The classes carry the full look, so a <summary> or <a> with them
   matches a <button>. */
button {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: var(--fs-base);
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary, .btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-sizing: border-box;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-family: inherit;
    font-size: var(--fs-base);
    font-weight: 500;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

.btn-small {
    padding: 8px 16px;
    font-size: var(--fs-xs);
}

.btn-primary {
    background: var(--brand);
    color: white;
}

.btn-primary:hover {
    background: var(--brand-dark);
}

.btn-primary:disabled, .btn-primary[disabled] {
    background: #aab4d9;
    cursor: not-allowed;
}

/* secondary actions: outlined, so they read as clickable rather than switched off */
.btn-secondary {
    background: var(--surface);
    color: var(--brand);
    box-shadow: inset 0 0 0 1.5px var(--brand-line);
}

.btn-secondary:hover {
    background: var(--brand-tint);
    box-shadow: inset 0 0 0 1.5px var(--brand);
}

.btn-secondary:disabled, .btn-secondary[disabled] {
    background: var(--surface-muted);
    color: var(--line-strong);
    box-shadow: inset 0 0 0 1px var(--line);
    cursor: not-allowed;
}

/* destructive actions (Delete, Turn off, Deactivate): outlined red, so they never look like the main action */
.btn-secondary.danger {
    background: var(--surface);
    color: var(--danger);
    box-shadow: inset 0 0 0 1.5px var(--danger-line);
}

.btn-secondary.danger:hover {
    background: var(--danger-tint);
    box-shadow: inset 0 0 0 1.5px var(--danger);
}

/* buttons beside form fields line up with the fields */
.filter-bar > .btn-primary, .filter-bar > .btn-secondary, .filter-bar > details > summary.btn-secondary {
    align-self: flex-end;
    height: 36px;
    padding-top: 0;
    padding-bottom: 0;
}

/* Dashboard navigation: three tabs on the blue band; the current one is a white pill */
#dashboardNav {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin: -12px 0 24px;
}

.nav-tab {
    background: transparent;
    color: rgba(255, 255, 255, 0.85);
    border-radius: 999px;
    padding: 9px 20px;
    font-weight: 600;
}

.nav-tab:hover { background: rgba(255, 255, 255, 0.14); color: var(--surface); }
.nav-tab.active { background: var(--surface); color: var(--brand-dark); box-shadow: 0 2px 10px rgba(20, 30, 90, 0.25); }

/* Admin sidebar (core.js renderNav): groups that stay open, the current page a white pill; collapses to an icon rail */
:root { --side-w: 248px; --side-rail: 64px; }
.side-nav { position: fixed; top: 0; bottom: 0; left: 0; z-index: 40; width: var(--side-w); display: flex; flex-direction: column;
            background: var(--brand-dark); color: var(--surface); overflow-y: auto; overflow-x: hidden; }
body.with-sidebar { padding-left: calc(var(--side-w) + 24px); }
/* animated only while collapsing or expanding (toggleSideNav), never when a page loads */
body.nav-animate { transition: padding-left .18s ease; }
body.nav-animate .side-nav { transition: width .18s ease; }
body.with-sidebar.nav-collapsed { padding-left: calc(var(--side-rail) + 24px); }
body.nav-collapsed .side-nav { width: var(--side-rail); }
body.with-sidebar #dashboardNav { display: none; }
.side-brand { padding: 18px 16px 10px; }
.side-logo.text-logo { font-size: 24px; }   /* on the sidebar's logo blue, so no badge (static/logo.css) */
.side-group { padding: 10px 10px 6px; }
.side-group + .side-group { border-top: 1px solid rgba(255, 255, 255, 0.12); }
.side-group-title { display: flex; align-items: center; gap: 8px; padding: 4px 10px 6px; font-size: var(--fs-2xs); font-weight: 700;
                    letter-spacing: .08em; text-transform: uppercase; color: rgba(255, 255, 255, 0.62); white-space: nowrap; }
.side-owner-tag { font-size: var(--fs-2xs); letter-spacing: .06em; padding: 1px 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.16); color: var(--surface); }
.side-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 10px; border-radius: 8px; background: none;
             color: rgba(255, 255, 255, 0.86); font-size: var(--fs-base); font-weight: 500; text-align: left; white-space: nowrap; }
.side-item:hover { background: rgba(255, 255, 255, 0.1); color: var(--surface); }
.side-item.active { background: var(--surface); color: var(--brand-dark); font-weight: 600; }
.side-item svg { width: 18px; height: 18px; flex: 0 0 auto; }
.side-label { overflow: hidden; text-overflow: ellipsis; }
.side-sub { margin: 2px 0 4px 30px; border-left: 1px solid rgba(255, 255, 255, 0.2); }
.side-sub .side-item { padding: 6px 10px; font-size: var(--fs-sm); border-radius: 0 8px 8px 0; }
.side-sub .side-item.active { background: rgba(255, 255, 255, 0.16); color: var(--surface); }
.side-foot { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px; border-top: 1px solid rgba(255, 255, 255, 0.12); }
.side-avatar { width: 32px; height: 32px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%;
               background: rgba(255, 255, 255, 0.2); font-size: var(--fs-xs); font-weight: 700; }
.side-who { min-width: 0; display: flex; flex-direction: column; gap: 3px; font-size: var(--fs-xs); }
.side-email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: var(--fs-sm); }
.side-who .badge.admin { align-self: flex-start; background: rgba(255, 255, 255, 0.18); }
.side-links { color: rgba(255, 255, 255, 0.6); white-space: nowrap; }
.side-link { background: none; padding: 0; color: rgba(255, 255, 255, 0.82); font-size: var(--fs-xs); font-weight: 500; }
.side-link:hover { color: var(--surface); text-decoration: underline; }
.side-collapse { margin-left: auto; width: 28px; height: 28px; flex: 0 0 auto; display: grid; place-items: center; padding: 0;
                 border-radius: 6px; background: none; color: rgba(255, 255, 255, 0.8); }
.side-collapse:hover { background: rgba(255, 255, 255, 0.12); color: var(--surface); }
.side-collapse svg { width: 16px; height: 16px; }
/* collapsed: icons only, the name of each in its tooltip */
body.nav-collapsed .side-label, body.nav-collapsed .side-group-title, body.nav-collapsed .side-sub,
body.nav-collapsed .side-who, body.nav-collapsed .side-brand { display: none; }
body.nav-collapsed .side-item { justify-content: center; padding: 9px 0; }
body.nav-collapsed .side-group { padding-top: 8px; }
body.nav-collapsed .side-nav .side-group:first-of-type { padding-top: 16px; }
body.nav-collapsed .side-foot { flex-direction: column; padding: 12px 0; }
body.nav-collapsed .side-collapse { margin-left: 0; transform: rotate(180deg); }
@media (max-width: 760px) {
    body.with-sidebar, body.with-sidebar.nav-collapsed { padding-left: calc(var(--side-rail) + 12px); padding-right: 12px; }
    body.with-sidebar .side-nav { width: var(--side-rail); }
    body.with-sidebar .side-label, body.with-sidebar .side-group-title, body.with-sidebar .side-sub,
    body.with-sidebar .side-who, body.with-sidebar .side-brand { display: none; }
    body.with-sidebar .side-item { justify-content: center; padding: 9px 0; }
    body.with-sidebar .side-foot { flex-direction: column; padding: 12px 0; }
    body.with-sidebar .side-collapse { display: none; }
}
@media print {
    .side-nav { display: none !important; }
    body.with-sidebar, body.with-sidebar.nav-collapsed { padding-left: 0; }
}

/* Risk levels: one scale everywhere (riskChip in utilities.js). .risk-<level> sets the level's colours;
   a chip shows them tinted, or solid with .solid; a deliverable star column uses the ink */
.risk-very-high { --r: var(--risk-very-high); --r-tint: var(--risk-very-high-tint); --r-ink: var(--risk-very-high-ink); }
.risk-high { --r: var(--risk-high); --r-tint: var(--risk-high-tint); --r-ink: var(--risk-high-ink); }
.risk-moderate { --r: var(--risk-moderate); --r-tint: var(--risk-moderate-tint); --r-ink: var(--risk-moderate-ink); }
.risk-low { --r: var(--risk-low); --r-tint: var(--risk-low-tint); --r-ink: var(--risk-low-ink); }
.risk-minimal { --r: var(--risk-minimal); --r-tint: var(--risk-minimal-tint); --r-ink: var(--risk-minimal-ink); }
.risk-chip { display: inline-block; white-space: nowrap; padding: 2px 9px; border-radius: 999px; font-size: var(--fs-xs); font-weight: 600;
             background: var(--r-tint, var(--line-soft)); color: var(--r-ink, var(--text-soft)); }
.risk-chip.solid { background: var(--r, var(--muted)); color: #fff; }
.risk-chip.solid.risk-moderate { color: var(--text); }
.deliverable-summary td.star-col { color: var(--r-ink); }

/* Small utilities for what used to be inline styles (they win over component rules, as the inline styles did) */
.mt-0 { margin-top: 0 !important; }
.mt-xs { margin-top: 6px !important; }
.mt-sm { margin-top: 12px !important; }
.mt-md { margin-top: 20px !important; }
.mt-lg { margin-top: 32px !important; }
.mb-md { margin-bottom: 20px !important; }
.upper { text-transform: uppercase; }
.h-260 { height: 260px !important; }
.h-280 { height: 280px !important; }
.h-300 { height: 300px !important; }

/* Shared building blocks (utilities.js uiLoading / uiEmpty / uiBadge): page states and badge tones */
.ui-state { margin: 12px 0; color: var(--muted); font-size: var(--fs-sm); }
.ui-empty { padding: 24px 12px; text-align: center; }
.badge.tone-brand { background: var(--brand-tint); color: var(--brand-dark); }
.badge.tone-ok { background: var(--success-tint); color: var(--success-dark); }
.badge.tone-warn { background: var(--warning-tint); color: var(--warning-dark); }
.badge.tone-bad { background: var(--danger-tint); color: var(--danger-dark); }
.badge.tone-info { background: var(--info-tint); color: var(--info-dark); }
.card-note { margin: -4px 0 10px; color: var(--text-soft); font-size: var(--fs-sm); }

/* AI assessments: the definition editor and versions (definitions.js) */
.def-status { display: grid; gap: 10px; }
.def-status p { margin: 0; }
.def-save-state { margin-left: 8px; font-size: var(--fs-xs); color: var(--muted); }
.def-note { display: grid; gap: 4px; font-size: var(--fs-sm); font-weight: 600; color: var(--text); }
.def-note textarea { font: inherit; font-weight: 400; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 8px; resize: vertical; }
.def-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.def-cats-head { margin: 18px 0 8px; }
.def-cats-head h3 { margin: 0; }
.def-cats { display: grid; gap: 8px; }
.def-cat { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.def-cat > summary { padding: 10px 14px; cursor: pointer; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.def-cat[open] > summary { border-bottom: 1px solid var(--line); }
.def-cat > .def-cat-fields, .def-cat > .study-scroll, .def-cat > .btn-small { margin: 12px 14px; }
.def-cat-fields { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; }
.def-cat-fields label { display: grid; gap: 4px; font-size: var(--fs-xs); font-weight: 600; color: var(--text-soft); }
.def-cat-fields input[type="text"], .def-cat-fields input[type="number"], .def-cat-fields select {
    padding: 7px 9px; border: 1px solid var(--line-strong); border-radius: 6px; font-size: var(--fs-sm); background: var(--surface); }
.def-cat-fields input[type="number"] { width: 90px; }
.def-name { flex: 1 1 320px; }
.def-name input { width: 100%; }
.def-check { display: flex !important; align-items: center; gap: 6px; font-weight: 500 !important; }
/* Definitions (definition-history.js): every type's versions and what changed */
.dh-type { display: grid; gap: 4px; max-width: 420px; margin: 0 0 14px; font-size: var(--fs-sm); font-weight: 600; color: var(--text); }
.dh-type select { font: inherit; font-weight: 400; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 8px; }
.dh-filters { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; margin: 0 0 12px; }
.dh-filters label { display: grid; gap: 4px; font-size: var(--fs-xs); font-weight: 600; color: var(--text-soft); }
.dh-filters input, .dh-filters select { font: inherit; font-weight: 400; padding: 6px 8px; border: 1px solid var(--line-strong); border-radius: 8px; min-width: 200px; }
.dh-table td, .dh-versions td { vertical-align: top; }
.dh-versions td:nth-child(3) { min-width: 220px; }
.definition-badge { background: var(--surface-soft); color: var(--text-soft); border: 1px solid var(--line); font-weight: 500; }
.dh-counts { margin: 0 0 4px; padding: 0; list-style: none; font-size: var(--fs-sm); white-space: nowrap; }
.dh-table td:nth-child(5), .dh-table td:nth-child(6) { min-width: 180px; max-width: 420px; overflow-wrap: anywhere; }
.dh-table code { font-size: var(--fs-2xs); overflow-wrap: anywhere; }
.def-id { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: var(--fs-xs); color: var(--muted); }
.def-table textarea { width: 100%; min-width: 360px; font: inherit; font-size: var(--fs-sm); padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; resize: vertical; }
.def-table input[type="number"] { width: 80px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; text-align: right; }
.def-table td.center { text-align: center; }
.def-table textarea:disabled, .def-table input:disabled, .def-cat-fields :disabled { background: var(--surface-soft); color: var(--text); border-color: var(--line-soft); }
.def-retired, .def-retired td { opacity: .55; }
.def-retired textarea { text-decoration: line-through; }

/* In-app dialog (appDialog in utilities.js): replaces the browser's confirm, alert and prompt */
.app-dialog { width: min(440px, calc(100vw - 32px)); margin: auto; padding: 0; border: 0; border-radius: 12px; color: var(--text);
              box-shadow: 0 20px 50px rgba(20, 30, 90, 0.28); }
.app-dialog::backdrop { background: rgba(20, 28, 60, 0.45); }
.app-dialog form { display: grid; gap: 14px; padding: 22px 24px 20px; }
.app-dialog h3 { margin: 0; font-size: var(--fs-md); color: var(--ink); line-height: 1.35; }
.app-dialog-message { margin: 0; font-size: var(--fs-base); line-height: 1.5; color: var(--text-soft); white-space: pre-line; }
.app-dialog-input { padding: 9px 11px; border: 1px solid var(--line-strong); border-radius: 8px; font-size: var(--fs-md);
                    letter-spacing: 2px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.app-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.btn-primary.danger-solid { background: var(--danger); }
.btn-primary.danger-solid:hover { background: var(--danger-dark); }

/* Research sub-tabs (Library, Analytics, Stock Study) */
.subtabs { display: flex; gap: 4px; border-bottom: 2px solid var(--canvas); margin: 10px 0 16px; }
.subtab { background: none; border-radius: 0; padding: 9px 16px; color: var(--text-soft); font-weight: 600;
          border-bottom: 2px solid transparent; margin-bottom: -2px; }
.subtab:hover { color: var(--brand-dark); }
.subtab.active { color: var(--brand-dark); border-bottom-color: var(--brand); }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

/* Performance vs Industry Cohort */
.cohort-picker { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-sm); color: var(--text); margin: 4px 0 8px; }
.cohort-picker select { padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; font-size: var(--fs-sm); }
.cohort-label { font-size: var(--fs-sm); color: var(--text); margin-bottom: 8px; }
.cohort-better { color: var(--success-dark); font-weight: 600; }
.cohort-worse { color: var(--danger); font-weight: 600; }

/* Research analytics */
.analytics-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin: 12px 0 20px; }
.analytics-card { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.analytics-card .value { font-size: var(--fs-xl); font-weight: 700; color: var(--brand-dark); }
.analytics-card .label { font-size: var(--fs-xs); color: var(--muted); margin-top: 2px; }
.hist { display: inline-flex; align-items: flex-end; gap: 1px; height: 28px; vertical-align: middle; }
.hist span { width: 5px; background: var(--brand-dark); border-radius: 1px 1px 0 0; min-height: 1px; }
.hist span.neg { background: var(--danger); }
.hist span.zero { background: var(--faint); }
.hist.large { height: 90px; gap: 3px; }
.hist.large span { width: 18px; }
.hist-axis { display: flex; gap: 3px; font-size: var(--fs-2xs); color: var(--muted); }
.hist-axis span { width: 18px; text-align: center; }
.na-bar { display: inline-block; width: 70px; height: 8px; background: var(--success-tint); border-radius: 4px; overflow: hidden; vertical-align: middle; margin-right: 6px; }
.na-bar span { display: block; height: 100%; background: var(--danger); }
.analytics-statement { min-width: 320px; max-width: 460px; }
.study-scatter { max-width: 760px; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); display: block; }
.study-scatter text { font-size: var(--fs-2xs); fill: var(--text-soft); }
.study-scatter .grid { stroke: var(--line-soft); }
.study-scatter .axis { stroke: var(--line-strong); }
.study-scatter .axis-title { font-size: var(--fs-xs); font-weight: 600; fill: var(--text); }
.study-scatter .tick { fill: var(--muted); }
.study-scatter .label { font-size: var(--fs-2xs); fill: #4a5563; }
.study-scatter .mark { stroke: var(--surface); stroke-width: 1; fill-opacity: 0.85; }
.study-scatter .clipped { font-size: var(--fs-2xs); font-weight: 600; }
.study-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: var(--fs-xs); color: #4a5563; margin: 8px 0 4px; max-width: 760px; }
.study-legend span { display: inline-flex; align-items: center; gap: 6px; }
.study-legend i { display: inline-block; border-radius: 50%; }
.study-caption { font-size: var(--fs-sm); color: var(--text); margin: 6px 0 2px; max-width: 760px; }
.study-groups td.pos { color: #1e7e34; font-weight: 600; }
.study-groups td.neg { color: var(--danger); font-weight: 600; }
.study-groups tr.focus td { background: var(--surface-soft); }
.study-scatter .trend { fill: none; stroke-width: 2.2; }
.study-scatter .trend.all { stroke: var(--muted); stroke-dasharray: 6 4; stroke-width: 1.6; }
.study-legend i.line { border-radius: 0; height: 3px; width: 18px; }
.study-table { font-size: var(--fs-sm); }
.study-table th { cursor: pointer; user-select: none; white-space: nowrap; }
.study-table td { padding-top: 6px; padding-bottom: 6px; }
.study-table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.study-table td.pos { color: #1e7e34; }
.study-table td.neg { color: var(--danger); }
.study-initiative { max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-xs); color: var(--muted); }
.study-table tr.study-family-row td { background: var(--brand-dark); color: var(--surface); font-weight: 700; }
.study-table tr.study-family-row td.pos, .study-table tr.study-family-row td.neg, .study-table tr.study-family-row .analytics-category { color: var(--surface); }
.study-table tr.study-path-row td { background: var(--surface-soft); font-weight: 600; color: var(--text); border-top: 2px solid var(--line); }
.study-table tr.study-path-row { cursor: pointer; }
.study-table tr.study-path-row:hover td { background: var(--canvas); }
.study-toggle { display: inline-block; width: 1em; color: var(--brand-dark); }
#stockStudyBody .analytics-card .value.neg { color: var(--danger); }
.study-details { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 10px; }
.study-details > summary { cursor: pointer; font-weight: 700; color: var(--brand-dark); font-size: var(--fs-md); }
.study-details h4 { margin: 16px 0 8px; }
.study-method { padding-left: 18px; line-height: 1.55; color: var(--text); }
.study-method li { margin-bottom: 8px; }
.study-chip { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: var(--fs-xs); color: var(--surface); background: var(--chip); }
.study-scroll { overflow-x: auto; }
.study-headline th { vertical-align: bottom; }
.study-headline td { white-space: nowrap; }
.study-details > summary .analytics-category { font-weight: 400; margin-left: 6px; }
/* Stock Study: one chart per index, side by side (stacked on narrow screens) */
.study-trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.study-trio-chart h4 { margin: 0 0 6px; font-size: var(--fs-base); color: var(--text); }
.study-trio .study-scatter { max-width: none; }
.study-scatter.compact text { font-size: var(--fs-2xs); }
.study-scatter.compact .axis-title { font-size: var(--fs-2xs); }
.study-trio.study-duo { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 18px; }
@media (max-width: 980px) { .study-trio, .study-trio.study-duo { grid-template-columns: 1fr; } .study-trio .study-scatter { max-width: 560px; } }
.research-type-tabs {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
    background: var(--brand-tint);
    border-radius: 8px;
    padding: 4px;
    margin: 4px 0 14px;
}
.research-type-tabs button,
.research-industry-tabs button {
    border: none;
    background: transparent;
    border-radius: 6px;
    padding: 8px 14px;
    font-size: var(--fs-base);
    font-weight: 600;
    color: var(--text-soft);
    cursor: pointer;
    white-space: nowrap;
}
.research-tab-group {
    align-self: center;
    margin: 0 2px 0 10px;
    padding-left: 10px;
    border-left: 1px solid var(--line-cool);
    font-size: var(--fs-2xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--slate);
}
.research-type-tabs { max-width: 100%; box-sizing: border-box; }
.research-pilot-picker { display: inline-flex; align-items: center; gap: 8px; min-width: 0; max-width: 100%; }
.research-pilot-picker select { min-width: 0; }
.research-pilot-picker select {
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    padding: 7px 10px;
    font-size: var(--fs-base);
    font-weight: 600;
    color: var(--text-soft);
    cursor: pointer;
    max-width: 280px;
}
.research-pilot-picker select:hover { border-color: var(--line-cool); }
.research-pilot-picker.open select {
    background: white;
    color: var(--brand-dark);
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}
.engagement-table tbody.engagement { border-top: 2px solid var(--line); }
.engagement-table tbody.engagement:first-of-type { border-top: none; }
.engagement-table tr.engagement-head td { background: var(--surface-soft); padding-top: 10px; padding-bottom: 8px; }
.engagement-table tr.engagement-side td:first-child { padding-left: 28px; }
.engagement-table tr.engagement-side .side-badge { min-width: 84px; text-align: center; margin-right: 6px; }
.engagement-arrow { color: var(--slate); margin: 0 4px; }
.engagement-table tr.engagement-side td { padding-top: 6px; padding-bottom: 6px; }
.engagement-table tr.engagement-side td:first-child { white-space: nowrap; }
.admin-table.engagement-table .actions { flex-wrap: nowrap; justify-content: flex-end; }
.engagement-table .actions .btn-small { white-space: nowrap; }
.study-status { background: var(--surface-soft); border: 1px solid var(--line); border-left: 4px solid var(--brand-dark); border-radius: 6px; padding: 10px 14px; margin: 6px 0 4px; font-size: var(--fs-sm); line-height: 1.5; }
.study-status p { margin: 4px 0; }
.ma-steps { padding-left: 22px; line-height: 1.55; margin: 6px 0 0; }
.ma-steps li { margin-bottom: 10px; }
.ma-strip { width: 100%; max-width: 760px; height: auto; display: block; margin: 6px 0 10px; }
.research-about { margin: 4px 0 14px; font-size: var(--fs-sm); }
.research-about summary { cursor: pointer; color: var(--brand-dark); font-weight: 600; }
.research-about .research-intro { margin-top: 6px; }
.research-type-tabs button[aria-selected="true"] {
    background: white;
    color: var(--brand-dark);
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}
.research-industry-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 4px;
}
.research-industry-tabs button {
    padding: 6px 12px;
    font-size: var(--fs-sm);
    border: 1px solid var(--line);
    background: white;
}
.research-industry-tabs button[aria-selected="true"] {
    background: var(--brand-dark);
    border-color: var(--brand-dark);
    color: white;
}
.tab-count {
    display: inline-block;
    min-width: 18px;
    margin-left: 4px;
    padding: 0 6px;
    border-radius: 9px;
    background: rgba(41, 55, 143, 0.1);
    font-size: var(--fs-2xs);
    line-height: 18px;
    text-align: center;
}
[aria-selected="true"] > .tab-count { background: rgba(255, 255, 255, 0.25); }
.research-type-tabs [aria-selected="true"] > .tab-count { background: rgba(41, 55, 143, 0.12); }
.research-filters select { padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; font-size: var(--fs-base); background: white; }
.research-filters input[type="search"] {
    min-width: 240px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    font-size: var(--fs-base);
}
.research-count { font-size: var(--fs-sm); color: var(--muted); padding-bottom: 9px; }
@media (max-width: 640px) {
    /* one scrollable row of industries instead of several wrapped rows */
    .research-industry-tabs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; }
    .research-filters input[type="search"], .research-filters select { min-width: 0; width: 100%; }
    .research-filters label { flex: 1 1 100%; }
}
.client-only-tag { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 10px; background: var(--brand-tint); color: var(--brand-dark); font-size: var(--fs-2xs); font-weight: 600; }
.analytics-category { font-size: var(--fs-2xs); color: var(--muted); }

/* Page Sections */
.page {
    display: none;
}

.page.active {
    display: block;
}

/* the start-up screen (#bootPage) while the page checks for a session */
.boot-screen {
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
}
.boot-status {
    color: #64748b;
    font-size: 15px;
}

/* Login/Register Form */
.auth-form {
    background: white;
    padding: 32px 36px 36px;
    border-radius: 12px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.25);
}

/* Sign-in page: one centered column. The logo and its line sit on the solid blue at the top of
   the page background (the first 180px), the card below it, and the link home on the light part. */
.signin-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 22px;
    max-width: 440px;
    margin: 28px auto 40px;
}

.signin-brand {
    text-align: center;
}

.signin-brand .auth-logo {
    margin: 0 auto 12px;
}

.signin-home {
    color: var(--brand-dark);
    font-size: var(--fs-base);
    font-weight: 600;
    text-decoration: none;
}

.signin-home:hover {
    text-decoration: underline;
}


.signin-subtitle {
    text-align: center;
    font-size: var(--fs-sm);
    color: var(--muted);
    margin: -22px 0 22px;
}

.password-field {
    position: relative;
}

.password-field input {
    padding-right: 64px;
}

.password-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: none;
    color: var(--brand-dark);
    font-size: var(--fs-xs);
    font-weight: 600;
    cursor: pointer;
    padding: 4px 6px;
}

.signin-submit {
    width: 100%;
    padding: 12px;
    font-size: var(--fs-md);
    background: var(--brand-dark);
}

.signin-submit:hover { background: var(--brand-deep); }
.signin-submit:disabled { opacity: 0.7; cursor: wait; }

.notice-bar { background: var(--accent-yellow-tint); border: 1px solid var(--warning-line); color: var(--warning-ink); border-radius: 8px; padding: 10px 14px; font-size: var(--fs-sm); margin: 8px 0 14px; }
.add-client-form { border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin: 6px 0 14px; }
.add-client-form h3 { margin-bottom: 4px; }
.add-client-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 10px 0 12px; }
.add-client-fields label { display: flex; flex-direction: column; gap: 6px; font-size: var(--fs-sm); color: var(--text); }
.add-client-fields input { padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 6px; font-size: var(--fs-base); }
.link-result { border: 1px solid var(--line-cool); background: var(--surface-soft); border-radius: 8px; padding: 12px 14px; margin: 8px 0 12px; font-size: var(--fs-sm); }
.link-copy { display: flex; gap: 8px; margin-top: 8px; }
.link-copy input { flex: 1; padding: 7px 9px; border: 1px solid var(--line-strong); border-radius: 6px; font-size: var(--fs-xs); }
.label-row { display: flex; justify-content: space-between; align-items: baseline; }
.label-row label { margin-bottom: 8px; }
.signin-link { color: var(--brand-dark); font-size: var(--fs-sm); font-weight: 600; text-decoration: none; }
.signin-link:hover { text-decoration: underline; }
.auth-form textarea { width: 100%; padding: 12px; border: 1px solid var(--line-strong); border-radius: 6px; font: inherit; font-size: var(--fs-base); resize: vertical; }
.optional { color: var(--faint); font-weight: 400; }
.field-hint { font-size: var(--fs-xs); color: var(--muted); margin-top: 6px; }
.hp-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.signin-note {
    margin-top: 16px;
    font-size: var(--fs-sm);
    color: var(--muted);
    text-align: center;
}

@media (max-width: 820px) {
    .signin-layout { margin-top: 16px; gap: 18px; }
}

/* ---- Sign-in page: a glass card over moving waves (signin-background.js) ----
   body.on-signin is set by showPage (core.js) while #loginPage shows. Without WebGL the canvas stays
   empty and the dark background below shows through on its own. */
body.on-signin { background: #0b1020; color: #e2e8f0; }
body.on-signin .site-footer { position: relative; z-index: 1; color: rgba(226, 232, 240, 0.55); }
/* the waves canvas sits behind all the page content (z-index -1 paints it just above the body's own
   background), so no content needs its own stacking layer and pop-ups keep their order */
.waves-canvas { position: fixed; inset: 0; width: 100%; height: 100%; display: block; z-index: -1; }
.waves-canvas[hidden] { display: none; }
#loginPage .signin-layout { position: relative; z-index: 1; margin-top: 40px; }
/* the logo heads the card (static/logo.css), with a hairline between it and the form */
.glass-card .signin-brand { text-align: center; padding-bottom: 22px; margin-bottom: 26px; border-bottom: 1px solid rgba(255, 255, 255, 0.14); }
#loginPage .text-logo { font-size: 30px; }

.glass-card {
    /* deep navy glass (the waves' darkest colour), so the white text reads over the pale parts of the waves too */
    background: rgba(3, 28, 38, 0.62);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.20);
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    padding: 32px;
    max-width: 400px;
}
/* browsers without backdrop blur get a solid dark glass so the text stays readable */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .glass-card { background: rgba(15, 23, 42, 0.88); }
}
#loginPage .glass-card h2 { color: #fff; font-size: 28px; font-weight: 700; margin-bottom: 30px; }
.glass-card .signin-subtitle { color: #cbd5e1; margin: -22px 0 26px; }
.glass-card .signin-note { color: #cbd5e1; }
.glass-card .signin-note strong { color: #fff; }
.glass-card .signin-link { color: #93c5fd; }
.glass-card .signin-link:hover { color: #bfdbfe; }
.glass-card .signin-link-quiet { color: #cbd5e1; font-weight: 500; font-size: var(--fs-xs); }
.glass-card .signin-link-quiet:hover { color: #fff; }
.glass-card .optional { color: #94a3b8; }
.glass-card .field-hint { color: #94a3b8; }
.signin-row { display: flex; justify-content: space-between; align-items: center; margin: -12px 0 4px; }
/* the code step (admin two-factor) comes after "Forgot password?": leave room for its label, which floats up
   above the field once a code is typed */
.signin-row ~ .float-field { margin-top: 30px; }
.glass-card .form-actions { margin-top: 24px; }
.glass-card .message { margin-bottom: 28px; }   /* room for the floated label of the field below */
.glass-card .twofa-key, .glass-card .twofa-recovery { color: var(--ink); }

/* floating labels: the label sits in the field while it is empty and floats above it once focused or filled */
.float-field { position: relative; margin-bottom: 30px; }
.glass-card .float-field input,
.glass-card .float-field textarea {
    display: block;
    width: 100%;
    padding: 10px 0;
    border: 0;
    border-bottom: 2px solid #cbd5e1;
    border-radius: 0;
    background: transparent;
    color: #fff;
    font: inherit;
    font-size: var(--fs-base);
    box-shadow: none;
    appearance: none;
    transition: border-color 0.2s ease;
}
.glass-card .float-field textarea { resize: vertical; min-height: 72px; }
.glass-card .float-field input:focus,
.glass-card .float-field textarea:focus { outline: none; border-bottom-color: #3b82f6; box-shadow: none; }
.glass-card .float-field label {
    position: absolute;
    left: 0;
    top: 10px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #cbd5e1;
    font-size: var(--fs-base);
    font-weight: 400;
    pointer-events: none;
    transform-origin: 0 0;
    transform: translateY(-24px) scale(0.8);
    transition: transform 0.25s ease, color 0.25s ease;
}
.glass-card .float-field input:placeholder-shown:not(:focus) + label,
.glass-card .float-field textarea:placeholder-shown:not(:focus) + label { transform: none; }
.glass-card .float-field input:focus + label,
.glass-card .float-field textarea:focus + label { color: #60a5fa; }
/* browsers keep autofilled values out of :placeholder-shown, so autofill floats the label too */
.glass-card .float-field input:-webkit-autofill { -webkit-text-fill-color: #fff; transition: background-color 9999s ease 0s; }
.field-icon { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.glass-card .password-field input { padding-right: 56px; }
.glass-card .password-toggle { color: #cbd5e1; top: 22px; right: 0; }
.glass-card .password-toggle:hover { color: #fff; }
.glass-card .float-field .signin-note { margin-top: 8px; text-align: left; }

/* the main button: bright blue with an arrow that nudges right on hover (the arrow is CSS, since the
   scripts set the button's text while busy, e.g. "Signing in…") */
.glass-card .signin-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 8px;
    background: #2563eb;
    color: #fff;
    font-weight: 600;
    transition: background-color 0.3s ease;
}
.glass-card .signin-submit:hover { background: #1d4ed8; }
.glass-card .signin-submit:focus-visible { outline: none; box-shadow: 0 0 0 2px #0b1020, 0 0 0 4px #3b82f6; }
.glass-card .signin-submit::after {
    content: "";
    width: 20px;
    height: 20px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M12 5l7 7-7 7'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M12 5l7 7-7 7'/%3E%3C/svg%3E") center / contain no-repeat;
    transition: transform 0.2s ease;
}
.glass-card .signin-submit:hover::after { transform: translateX(4px); }
.glass-card .signin-submit:disabled::after { display: none; }
/* Continue with Google, under the Sign in button */
.signin-divider { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: #94a3b8; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.08em; }
.signin-divider::before, .signin-divider::after { content: ""; flex: 1; height: 1px; background: rgba(255, 255, 255, 0.14); }
.google-signin {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    padding: 11px 16px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.06); color: #f1f5f9; font-weight: 600; text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
}
.google-signin:hover { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.36); color: #fff; }
.google-signin:focus-visible { outline: none; box-shadow: 0 0 0 2px #0b1020, 0 0 0 4px #3b82f6; }
.google-signin svg { width: 18px; height: 18px; flex: none; }
#loginPage .signin-home { color: #cbd5e1; }
#loginPage .signin-home:hover { color: #fff; }
@media (prefers-reduced-motion: reduce) {
    .glass-card .float-field label, .glass-card .signin-submit::after { transition: none; }
}

.auth-form h2 {
    color: var(--text);
    margin-bottom: 30px;
    text-align: center;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text);
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    font-size: var(--fs-base);
}

.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.3);
}

/* dropdowns in forms look like the text fields beside them */
.form-group select {
    width: 100%;
    box-sizing: border-box;
    padding: 11px 10px;
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    font-size: var(--fs-base);
    background: var(--surface);
    color: inherit;
}

/* Assign: the client boxes match the Assessment Type search box next to them (.combo input) */
#assignUserGroup select, #assignSideUserGroup select { height: 36px; padding: 0 12px; }

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 30px;
}

.form-actions button {
    flex: 1;
}

/* Assessment List */
/* dashboard sections sit on white panels over the blue page */
#overviewContainer, #userHomeContainer, #adminAssignmentsContainer, #statementEditorContainer, #researchContainer,
#researchEditContainer, #evidenceContainer, #resultsContainer, #analyticsContainer, #stockStudyContainer, #signalsContainer,
#intakeContainer, #proposalsContainer, #myAccountContainer, #accountsContainer, #definitionContainer {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* ---- Dashboard over the waves (body.on-app, set by showPage in core.js) ----
   A still frame of the sign-in page's waves behind the app (waves-background.js). The frame (top bar,
   sidebar) is the sign-in card's deep navy glass with white text; the content panels are ice-blue glass,
   so tables, charts and forms keep their dark text and colours. Printing drops all of it
   (see @media print). */
body.on-app { background: #0b2a40; }
body.on-app .header,
body.on-app .side-nav,
body.on-app #dashboardNav {
    background: rgba(3, 28, 38, 0.62);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.5);
}
body.on-app .side-nav { border-width: 0 1px 0 0; box-shadow: none; }
body.on-app .header h1 { color: #fff; }
body.on-app .user-info span { color: #cbd5e1; }
body.on-app .header .btn-secondary { background: rgba(255, 255, 255, 0.08); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35); }
body.on-app .header .btn-secondary:hover { background: rgba(255, 255, 255, 0.16); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6); }
body.on-app .header .text-logo--badge { background: transparent; padding: 0; }   /* already on navy */
/* the client tabs sit in a navy glass pill, readable over the pale top of the waves */
body.on-app #dashboardNav { width: fit-content; max-width: 100%; padding: 6px; border-radius: 999px; margin: -6px 0 24px; }
body.on-app #dashboardNav:empty { display: none; }
body.on-app #overviewContainer, body.on-app #userHomeContainer, body.on-app #adminAssignmentsContainer,
body.on-app #statementEditorContainer, body.on-app #researchContainer, body.on-app #researchEditContainer,
body.on-app #evidenceContainer, body.on-app #resultsContainer, body.on-app #analyticsContainer,
body.on-app #stockStudyContainer, body.on-app #signalsContainer, body.on-app #intakeContainer,
body.on-app #proposalsContainer, body.on-app #myAccountContainer, body.on-app #accountsContainer,
body.on-app #definitionContainer, body.on-app .assessment-list {
    /* ice-blue glass: the waves' pale blue, see-through enough to read as glass; white cards inside stay white */
    background: rgba(214, 236, 250, 0.72);
    backdrop-filter: blur(18px) saturate(1.15);
    -webkit-backdrop-filter: blur(18px) saturate(1.15);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 18px 40px -18px rgba(3, 28, 38, 0.55);
    /* the soft greys are a step darker inside the panels, so they keep their contrast on the blue */
    --muted: #4f5a6e;
    --text-soft: #3e4a60;
    --faint: #6b7a8c;
}
body.on-app .site-footer { color: rgba(226, 232, 240, 0.7); }
/* browsers without backdrop blur get a solid navy frame (the white panels are nearly opaque already) */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    body.on-app .header, body.on-app .side-nav, body.on-app #dashboardNav { background: rgba(3, 28, 38, 0.94); }
}

.assessment-list {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Assessment Form */
.assessment-form {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.form-section {
    margin-bottom: 30px;
}

.form-section h3 {
    color: var(--text);
    margin-bottom: 20px;
    border-bottom: 2px solid var(--line-soft);
    padding-bottom: 10px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

/* Questionnaire */
.questionnaire {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.scoring-scale {
    margin-bottom: 25px;
    padding: 15px 20px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.scoring-scale summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--text);
}

.scoring-scale table {
    width: 100%;
    margin-top: 12px;
    border-collapse: collapse;
    font-size: var(--fs-sm);
}

.scoring-scale th,
.scoring-scale td {
    padding: 6px 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}

.scoring-scale th {
    color: var(--muted);
    font-size: var(--fs-2xs);
    text-transform: uppercase;
}

.scoring-scale .scale-score {
    width: 60px;
    font-weight: 600;
    text-align: center;
}

.scoring-scale td.scale-score span {
    display: inline-block;
    min-width: 32px;
    padding: 3px 6px;
    border-radius: 4px;
    background: var(--scale-color);
    color: var(--scale-text);
}

.scoring-scale .scale-completion {
    width: 120px;
    white-space: nowrap;
}

.scoring-scale p {
    margin-top: 10px;
    font-size: var(--fs-xs);
    color: var(--muted);
}

.statement-group h3.uppercase {
    text-transform: uppercase;
}

.type-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.type-card {
    background: white;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 18px;
}

.type-card.locked {
    background: var(--surface-muted);
    color: var(--faint);
}

.type-card h3 {
    font-size: var(--fs-md);
    color: var(--text);
    margin-bottom: 6px;
}

.type-card.locked h3, .type-card.locked h4 {
    color: var(--muted);
}

.type-card p {
    font-size: var(--fs-sm);
    margin-bottom: 10px;
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: var(--fs-2xs);
    font-weight: 600;
    white-space: nowrap;
    background: var(--line-soft);
    color: var(--muted);
}

.badge.admin { background: var(--text); color: white; }
.badge.locked { background: var(--danger-tint); color: var(--danger); }
.badge.side-badge { background: var(--canvas); color: var(--brand-dark); }
.paired-note { font-size: var(--fs-xs); color: var(--muted); }

/* Outsourcing Value Analysis gap report */
.gap-intro { font-size: var(--fs-sm); color: var(--text-soft); margin: 4px 0 16px; }
.gap-value { font-variant-numeric: tabular-nums; white-space: nowrap; }
/* direction, not good / bad: provider higher = blue, outsourcer higher = amber */
.gap-value.positive { color: var(--brand-dark); }
.gap-value.negative { color: #a35400; }
.gap-bar { position: relative; width: 120px; height: 10px; background: var(--surface-muted); border-radius: 2px; display: inline-block; vertical-align: middle; margin-left: 8px; }
.gap-bar::after { content: ''; position: absolute; left: 50%; top: -2px; bottom: -2px; border-left: 1px solid var(--faint); }
.gap-bar span { position: absolute; top: 0; bottom: 0; }
.gap-bar span.positive { left: 50%; background: #4a6fc9; }
.gap-bar span.negative { right: 50%; background: var(--warning); }
.badge.gap-critical { background: var(--danger); color: white; }
.badge.gap-significant { background: #f0a500; color: var(--text); }
.gap-filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 8px 0 12px; font-size: var(--fs-sm); }
.gap-statement { border-top: 1px solid var(--line-soft); padding: 10px 0; display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; align-items: start; }
.gap-statement .gap-text { font-size: var(--fs-base); }
.gap-statement .gap-category { font-size: var(--fs-2xs); color: var(--muted); text-transform: uppercase; margin-bottom: 2px; }
.gap-statement .gap-alt { font-size: var(--fs-xs); color: var(--muted); margin-top: 4px; }
.gap-answers { display: flex; gap: 8px; align-items: center; font-size: var(--fs-xs); white-space: nowrap; }
.gap-answer { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; }
.gap-chip { min-width: 34px; text-align: center; padding: 3px 6px; border-radius: 4px; background: var(--scale-color, var(--line-soft)); color: var(--scale-text, var(--text)); font-weight: 600; }
@media (max-width: 640px) { .gap-statement { grid-template-columns: 1fr; } .gap-bar { width: 80px; } }
.badge.open { background: var(--success-tint); color: var(--success); }

.admin-table td, .admin-table th { vertical-align: middle; }
.assignment-group { font-size: var(--fs-md); margin: 22px 0 8px; display: flex; align-items: center; gap: 8px; }
.assignment-count { font-size: var(--fs-xs); font-weight: 600; color: var(--text-soft); background: var(--line-soft); border-radius: 10px; padding: 1px 8px; }
.assignment-empty { color: var(--muted); margin: 4px 0 8px; font-size: var(--fs-sm); }
.action-plan-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.action-plan-card h4 { margin: 18px 0 8px; font-size: var(--fs-base); }
.action-progress { font-weight: 600; margin: 8px 0 4px; }
.overdue { color: var(--danger); font-weight: 600; }
.risk-areas { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.risk-areas li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 0; border-bottom: 1px solid var(--line-soft); }
.risk-areas li > span:nth-child(2) { flex: 1 1 220px; }
.risk-area-meta { color: var(--muted); font-size: var(--fs-sm); }
.more-risk-areas summary { cursor: pointer; color: var(--info); font-size: var(--fs-sm); margin: 6px 0; }
.action-table td { vertical-align: top; }
.action-table tr.action-done td { color: var(--muted); }
.action-form { margin: 12px 0; }
.guide { margin-bottom: 20px; }
.guide-steps { margin: 12px 0 8px 18px; padding: 0; display: grid; gap: 8px; font-size: var(--fs-base); }
.guide h4 { margin: 14px 0 8px; font-size: var(--fs-base); }
.guide-prepare { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.guide-prepare div { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; font-size: var(--fs-sm); }
.guide-prepare strong { display: block; margin-bottom: 4px; }
.guide-prepare span { color: var(--text-soft); }
#progressContainer { position: sticky; top: 0; z-index: 5; background: var(--surface); padding: 10px 0 6px; }
@media print { #progressContainer { position: static; } }
.progress-line { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.save-status { font-size: var(--fs-xs); color: var(--muted); }
.save-status.saved { color: var(--success); }
.save-status.pending { color: var(--warning); }
.save-status.error { color: var(--danger); font-weight: 600; }
.save-status .btn-small { margin-left: 6px; font-weight: 400; }
.badge.checkpoint { background: var(--info-tint); color: var(--info-dark); }
.badge.checkpoint-due { background: #fdebd0; color: #b9770e; }
.checkpoint-notice { margin: 8px 0 16px; }
.checkpoint-form { margin: 12px 0 18px; }
.checkpoint-form input { width: 100%; box-sizing: border-box; }
.series-table tr.series-current td { font-weight: 600; background: var(--surface-soft); }
.delta { font-size: var(--fs-xs); color: var(--muted); margin-left: 4px; white-space: nowrap; }
.delta.good { color: var(--success); }
.delta.bad { color: var(--danger); }
.series-changes { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; margin-top: 12px; }
.series-changes h4 { margin: 4px 0 6px; font-size: var(--fs-base); }
.client-note { display: block; margin: 6px 0 2px; padding: 6px 10px; background: var(--accent-yellow-tint); border-left: 3px solid var(--accent-yellow); border-radius: 4px; font-size: var(--fs-sm); white-space: pre-line; }
#clientNoteGroup textarea { width: 100%; box-sizing: border-box; }
.guide-tips { margin: 10px 0 0 18px; padding: 0; display: grid; gap: 6px; font-size: var(--fs-base); }
.results-guide summary, .metric-definitions summary { cursor: pointer; font-weight: 600; color: var(--text); }
.metric-definitions { margin-top: 10px; }
.metric-definitions summary { font-size: var(--fs-sm); color: var(--info); }
.results-guide dl, .metric-definitions dl { margin: 12px 0 0; display: grid; gap: 10px; }
.results-guide dt, .metric-definitions dt { font-weight: 600; font-size: var(--fs-base); }
.results-guide dd, .metric-definitions dd { margin: 2px 0 0; color: var(--text-soft); font-size: var(--fs-sm); line-height: 1.45; }
.action-form select, .action-form .pp-wide input { display: block; width: 100%; max-width: 100%; box-sizing: border-box; margin-top: 4px; }
.action-form .pp-wide { display: block; margin-top: 10px; }
.action-summary { display: inline-block; margin-top: 4px; font-size: var(--fs-xs); color: var(--text-soft); }
.dev-toolbar { justify-content: space-between; align-items: center; margin-top: 8px; }
.dev-toolbar .research-type-tabs { margin: 0; }
.dev-table td { vertical-align: middle; }
.dev-table .actions { flex-wrap: nowrap; justify-content: flex-end; }
.data-loads { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--line-soft); }
.data-load-history { margin-top: 8px; }
.data-load-history > summary { cursor: pointer; font-size: var(--fs-sm); color: var(--muted); }
.data-load summary { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.data-load-step { margin: 8px 0 0 4px; font-size: var(--fs-sm); }
.data-load-step pre { margin: 4px 0 0; padding: 8px 10px; background: var(--surface-soft); border-radius: 6px; font-size: var(--fs-xs); white-space: pre-wrap; word-break: break-word; }

.filter-bar {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    flex-wrap: wrap;
    margin: 16px 0 10px;
}

.filter-bar label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: var(--fs-xs);
    font-weight: 600;
    color: var(--muted);
}

/* same width, height and box model as the company search box (.combo input) so the two line up */
.filter-bar select { width: 300px; max-width: 100%; height: 36px; box-sizing: border-box; padding: 6px 10px; border: 1px solid var(--line-strong); border-radius: 6px; font-size: var(--fs-base); background: var(--surface); }

/* Company search on Assignments: type to filter, then pick from the list */
.combo { position: relative; display: flex; flex-direction: column; gap: 4px; }
.combo label { font-size: var(--fs-xs); font-weight: 600; color: var(--muted); }
.combo input { width: 300px; max-width: 100%; height: 36px; box-sizing: border-box; padding: 6px 10px; border: 1px solid var(--line-strong); border-radius: 6px; font-size: var(--fs-base); background: var(--surface); }
.combo input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 5px rgba(52, 152, 219, 0.3); }
.combo-list {
    position: absolute; top: 100%; left: 0; z-index: 20; width: 360px; max-width: calc(100vw - 32px);
    max-height: 320px; overflow-y: auto; margin: 4px 0 0; padding: 4px 0; list-style: none;
    background: var(--surface); border: 1px solid var(--line-cool); border-radius: 8px; box-shadow: 0 8px 24px rgba(20, 30, 90, 0.15);
}
.combo-list li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 12px; font-size: var(--fs-base); color: var(--text); cursor: pointer; }
.combo-list li.active { background: var(--brand-tint); color: var(--brand-dark); }
.combo-list li[aria-selected="true"] { font-weight: 600; }
.combo-list li .combo-detail { color: var(--muted); font-size: var(--fs-xs); white-space: nowrap; }
.combo-list li mark { background: none; color: inherit; text-decoration: underline; }
.combo-list .combo-empty { color: var(--muted); cursor: default; }
.combo-list li.combo-group { display: block; padding: 10px 12px 4px; border-top: 1px solid var(--line); font-size: var(--fs-2xs); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); cursor: default; }
@media (max-width: 640px) { .combo, .combo input, .combo-list { width: 100%; } }
/* the assessment type search box in the assign / create form: styled like the other fields */
.type-combo { display: block; gap: 0; }
.type-combo label { display: block; margin-bottom: 8px; font-size: inherit; font-weight: 500; color: var(--text); }
.type-combo input { width: 100%; padding: 12px; font-size: var(--fs-base); }
.type-combo .combo-list { width: 100%; max-width: 480px; }
.type-combo input:disabled { background: var(--surface-muted); color: var(--muted); }

.filter-summary { font-size: var(--fs-sm); color: var(--text); margin-bottom: 8px; }
.prepared-for { font-size: var(--fs-xs); color: var(--text-soft); }
.assignment-pp { margin-top: 6px; font-size: var(--fs-xs); color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.assignment-pp select { padding: 3px 8px; border: 1px solid var(--line-strong); border-radius: 6px; font-size: var(--fs-sm); background: var(--surface); font-family: inherit; max-width: 170px; }

.badge.completed { background: var(--success-tint); color: var(--success); }
.badge.in-progress { background: var(--warning-tint); color: var(--warning); }
.badge.assigned { background: var(--info-tint); color: var(--info); }
.admin-table .actions { display: flex; gap: 6px; flex-wrap: wrap; }

.editor-category {
    margin-bottom: 18px;
    padding: 14px;
    background: var(--surface-soft);
    border-radius: 8px;
}

.editor-category label {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    font-weight: normal;
    font-size: var(--fs-sm);
    padding: 4px 0;
}

.editor-category label.category-toggle {
    font-weight: 600;
    color: var(--text);
    font-size: var(--fs-base);
}

.editor-category input { width: auto; margin-top: 3px; }

.section-title {
    margin: 30px 0 15px;
    color: var(--text);
    font-size: var(--fs-lg);
    border-bottom: 2px solid var(--line);
    padding-bottom: 6px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
}

.checkbox-group input {
    width: auto;
}

.statement-context {
    margin-bottom: 4px;
    font-size: var(--fs-xs);
    color: var(--muted);
}

.statement-note {
    margin-top: 4px;
    font-size: var(--fs-xs);
    color: var(--muted);
    font-style: italic;
}

.results-table {
    width: 100%;
    margin-top: 20px;
    border-collapse: collapse;
    font-size: var(--fs-sm);
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.results-table caption {
    text-align: left;
    font-weight: 600;
    color: var(--text);
    padding: 0 0 8px;
}

.results-table th,
.results-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--line-soft);
    text-align: left;
}

.results-table th {
    color: var(--muted);
    font-size: var(--fs-2xs);
    text-transform: uppercase;
}

.results-table td.num,
.results-table th.num {
    text-align: right;
    white-space: nowrap;
}

.statement-group {
    margin-bottom: 30px;
    padding: 20px;
    background: var(--surface-soft);
    border-radius: 8px;
}

.statement-group h3 {
    color: var(--text);
    margin-bottom: 15px;
    font-size: var(--fs-md);
}

.statement-item {
    margin-bottom: 20px;
    padding: 15px;
    background: white;
    border-radius: 6px;
    border-left: 4px solid var(--brand);
}

.statement-item p {
    color: var(--text);
    font-size: var(--fs-base);
    margin-bottom: 10px;
    font-weight: 500;
}

.response-options {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.response-btn {
    min-width: 40px;
    padding: 8px 6px;
    border: 1px solid var(--line-strong);
    background: white;
    color: var(--text-soft);
    border-radius: 4px;
    cursor: pointer;
    font-size: var(--fs-xs);
    font-weight: 500;
    transition: all 0.3s ease;
}

.response-btn:hover {
    background: var(--line-soft);
}

.response-btn.selected {
    background: var(--brand);
    color: white;
    border-color: var(--brand);
}

/* Statements that list their own %/month values: each value sits under the button it maps to */
.response-col {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.response-options.with-values .response-btn {
    width: 40px;
}

.answer-value {
    min-height: 16px;
    margin-top: 4px;
    font-size: var(--fs-2xs);
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
}

/* Scale colors (set per button from SCALE_COLORS): tinted until selected, solid when selected */
.response-btn[style*="--scale-color"] {
    border-color: var(--scale-color);
    background: color-mix(in srgb, var(--scale-color) 18%, white);
    color: var(--text);
}

.response-btn[style*="--scale-color"]:hover {
    background: color-mix(in srgb, var(--scale-color) 35%, white);
}

.response-btn[style*="--scale-color"].selected {
    background: var(--scale-color);
    color: var(--scale-text);
    box-shadow: 0 0 0 2px var(--text);
}

/* Results Display */
.results-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.metric-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    text-align: center;
}

.metric-card h3 {
    color: var(--muted);
    font-size: var(--fs-sm);
    text-transform: uppercase;
    margin-bottom: 15px;
    font-weight: 500;
}

.metric-value {
    font-size: 42px;
    font-weight: bold;
    color: var(--text);
    margin-bottom: 10px;
}

.metric-unit {
    color: var(--faint);
    font-size: var(--fs-base);
}

.metric-label {
    color: var(--muted);
    font-size: var(--fs-xs);
    margin-top: 10px;
}

.chart-container {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    position: relative;
    height: 300px;
}

/* Loading & Messages */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--line-soft);
    border-top: 3px solid var(--brand);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.message {
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: var(--fs-base);
    transition: opacity 0.4s ease;
}

/* a save confirmation is a short line with a tick, not a banner */
.message.success {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--success-tint);
    color: var(--success-dark);
    border: 1px solid var(--success-line);
    font-weight: 500;
}

.message.success::before { content: "✓"; font-weight: 700; }

.message.error {
    background: #fadbd8;
    color: var(--danger);
    border: 1px solid var(--danger-line);
}

.message.info {
    background: var(--info-tint);
    color: var(--brand);
    border: 1px solid #c5cdea;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--line-soft);
    border-radius: 4px;
    margin: 15px 0;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--brand);
    transition: width 0.3s ease;
}

/* Research library */
.research-intro {
    margin: 6px 0 16px;
    font-size: var(--fs-sm);
    color: var(--muted);
}

.research-sub {
    font-size: var(--fs-xs);
    color: var(--muted);
}

.research-table {
    table-layout: fixed;
    min-width: 720px;
}

.research-table th:nth-child(1) { width: 18%; }
.research-table th:nth-child(2) { width: 25%; }
.research-table th:nth-child(3),
.research-table th:nth-child(4),
.research-table th:nth-child(5) { width: 10%; }
.research-table th:nth-child(6) { width: 10%; }
.research-table th:nth-child(7) { width: 17%; }

.engagement-table th:nth-child(1) { width: 36%; }
.engagement-table th:nth-child(2),
.engagement-table th:nth-child(3),
.engagement-table th:nth-child(4) { width: 10%; }
.engagement-table th:nth-child(5) { width: 34%; }
.research-table td {
    vertical-align: middle;
    overflow-wrap: anywhere;
}

.badge.edited { background: var(--warning-tint); color: var(--warning-dark); }

.evidence-edit {
    margin-left: auto;
    flex-shrink: 0;
}

.evidence-override {
    margin: 6px 0 0 48px;
    font-size: var(--fs-sm);
    color: #6e3b0b;
}

.override-form {
    margin: 8px 0 0 48px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface);
    font-size: var(--fs-sm);
}

.override-form label {
    display: block;
    margin-bottom: 8px;
}

.override-form textarea,
.override-form select {
    display: block;
    width: 100%;
    max-width: 520px;
    margin-top: 4px;
    padding: 6px;
    font: inherit;
}

.badge.research { background: var(--accent-purple); color: white; }
.badge.unverified { background: var(--accent-orange-tint); color: var(--accent-orange-dark); }

.research-note {
    flex-basis: 100%;
    margin-top: 6px;
    padding: 6px 10px;
    border-left: 3px solid var(--accent-purple);
    background: var(--accent-purple-tint);
    font-size: var(--fs-xs);
    color: #4a235a;
}

.evidence-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--line-soft);
    font-size: var(--fs-base);
}

.evidence-head {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.evidence-score {
    flex-shrink: 0;
    min-width: 38px;
    padding: 2px 6px;
    border-radius: 4px;
    text-align: center;
    font-weight: 700;
    font-size: var(--fs-sm);
}

.evidence-score.na {
    background: var(--line-soft);
    color: var(--muted);
}

.evidence-item.removed { color: var(--faint); }

/* Statement scores: how many statements sit at each score from -4 to +4 */
.score-spread { display: flex; align-items: flex-end; gap: 4px; margin-top: 14px; max-width: 560px; }
.score-spread-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; }
.score-spread-bar { width: 100%; min-height: 1px; border-radius: 3px 3px 0 0; }
.score-spread-count { font-size: var(--fs-2xs); color: var(--text-soft); }
.score-spread-label { font-size: var(--fs-2xs); color: var(--muted); height: 14px; }

.evidence-rationale {
    margin: 6px 0 0 48px;
    color: var(--text);
    font-size: var(--fs-sm);
}

.evidence-quote {
    margin: 6px 0 0 48px;
    padding: 6px 10px;
    border-left: 3px solid var(--line-strong);
    background: var(--surface-soft);
    font-size: var(--fs-sm);
    color: var(--text-soft);
}

.evidence-quote cite {
    display: block;
    margin-top: 3px;
    font-size: var(--fs-2xs);
    font-style: normal;
    color: var(--muted);
}

.evidence-docs {
    margin: 8px 0 0 18px;
    font-size: var(--fs-sm);
}

/* Past projects (Companies page) */
.data-loads-head {
    margin-top: 36px;
}

.past-project-types {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 4px 0 16px;
}

.type-chip {
    border: 1px solid var(--line-cool);
    background: white;
    color: var(--text);
    border-radius: 999px;
    padding: 5px 12px;
    font-size: var(--fs-sm);
    cursor: pointer;
}

.type-chip span { color: var(--muted); margin-left: 2px; }
.type-chip.active { background: var(--brand); border-color: var(--brand); color: white; }
.type-chip.active span { color: rgba(255, 255, 255, 0.75); }

.past-project-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.type-pill {
    display: inline-block;
    background: var(--brand-tint);
    color: var(--brand);
    border-left: 3px solid var(--brand);
    border-radius: 4px;
    padding: 4px 10px;
    font-size: var(--fs-xs);
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.type-pill.none { background: var(--surface-muted); color: var(--muted); border-left-color: var(--line-strong); }

.past-project-date { font-size: var(--fs-sm); color: var(--muted); white-space: nowrap; }

.past-project h3 { margin: 0 0 12px; }

.past-project-people {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 8px 24px;
    margin: 0 0 12px;
    font-size: var(--fs-sm);
}

.past-project-people dt {
    font-size: var(--fs-2xs);
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}

.past-project-people dd { margin: 2px 0 0; color: var(--text); }

.past-project-summary {
    margin: 0 0 14px;
    font-size: var(--fs-sm);
    color: var(--text-soft);
    white-space: pre-line;
}

.past-project-results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.result-tile {
    background: var(--surface-soft);
    border-radius: 8px;
    padding: 10px 12px;
}

.past-project-categories {
    margin-bottom: 14px;
    font-size: var(--fs-sm);
}

.past-project-categories summary {
    cursor: pointer;
    color: var(--text);
    font-weight: 600;
}

.pp-wide {
    display: block;
    margin-top: 12px;
    font-size: var(--fs-sm);
}

.pp-wide textarea,
.pp-wide input[type="file"] {
    display: block;
    width: 100%;
    margin-top: 4px;
    font: inherit;
}

.pp-hint {
    font-size: var(--fs-xs);
    color: var(--muted);
    font-weight: 400;
}

td.nowrap {
    white-space: nowrap;
}

/* Summary cards (Risk Index Summary, Cost / Time Adjustment) */
.summary-card {
    background: white;
    padding: 20px 24px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    color: var(--text);
}

.summary-eyebrow {
    font-size: var(--fs-2xs);
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}

.summary-card h3 {
    margin: 2px 0 16px;
    font-size: var(--fs-lg);
}

.risk-row {
    display: grid;
    grid-template-columns: 120px 1fr 72px;
    align-items: center;
    gap: 14px;
    padding: 9px 0;
    border-bottom: 1px solid var(--line-soft);
    font-size: var(--fs-base);
}

.risk-row .risk-value {
    text-align: right;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.risk-bar {
    height: 8px;
    border-radius: 4px;
    background: var(--line-soft);
    overflow: hidden;
}

.risk-bar span {
    display: block;
    height: 100%;
    border-radius: 4px;
    background: var(--danger-bright);
}

.risk-total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding-top: 12px;
    font-weight: 700;
}

.risk-total .risk-value {
    font-size: var(--fs-xl);
    font-variant-numeric: tabular-nums;
}

.summary-footnote {
    margin-top: 10px;
    font-size: var(--fs-xs);
    color: var(--muted);
}

/* Indices Summary (results screen; the landing page's sample card is the same design) */
.ix-tiles { display: grid; grid-template-columns: repeat(var(--ix-count, 3), minmax(0, 1fr)); gap: 12px; }
/* each tile spans the same rows (label, value, bar, cohort bar and figure), so a label that wraps keeps the values level */
.ix-tile { border: 1px solid var(--line); border-radius: 10px; padding: 16px; display: grid; grid-row: span 5; grid-template-rows: subgrid; row-gap: 6px; }
.ix-tiles--solo .ix-tile { grid-row: span 3; }
.ix-label { font-size: var(--fs-sm); font-weight: 500; color: var(--muted); }
.ix-value {
    font-size: var(--fs-2xl); line-height: 1.1; letter-spacing: -0.02em; font-weight: 600; color: var(--ink);
    font-variant-numeric: tabular-nums; margin-bottom: 8px;
}
.ix-bar { display: block; height: 6px; border-radius: 3px; background: var(--line-soft); overflow: hidden; }
.ix-bar i { display: block; height: 100%; border-radius: 3px; background: var(--brand); }
.ix-bar--cohort i { background: var(--line-strong); }
.ix-bar--dim i { background: var(--ink); opacity: .78; }
.ix-cohort { font-size: var(--fs-sm); color: var(--muted); font-variant-numeric: tabular-nums; margin-top: 2px; }
.ix-legend { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 12px; font-size: var(--fs-sm); color: var(--muted); }
.ix-key { width: 8px; height: 8px; border-radius: 2px; background: var(--brand); }
.ix-key--cohort { background: var(--line-strong); margin-left: 12px; }
.ix-risk { margin-top: 24px; }
.ix-sub { font-size: var(--fs-sm); font-weight: 600; color: var(--ink); margin-bottom: 8px; }
.ix-risk ul { list-style: none; }
.ix-risk li {
    display: grid; grid-template-columns: 120px 1fr 72px; align-items: center; gap: 16px;
    padding: 8px 0; font-size: var(--fs-base); border-top: 1px solid var(--line);
}
.ix-num { text-align: right; font-variant-numeric: tabular-nums; }
.ix-total {
    display: flex; align-items: baseline; justify-content: space-between; margin-top: 16px; padding-top: 16px;
    border-top: 1px solid var(--line-strong); font-size: var(--fs-base); font-weight: 600; color: var(--ink);
}
.ix-total small { font-size: var(--fs-sm); font-weight: 400; color: var(--muted); margin-left: 6px; }
.ix-total strong { font-size: var(--fs-2xl); font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

.impact-row {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    gap: 18px;
    padding: 8px 0;
    border-bottom: 1px solid var(--line-soft);
    font-size: var(--fs-sm);
}

.impact-head {
    padding-top: 0;
    font-size: var(--fs-2xs);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
}

.impact-head span:not(:first-child) {
    text-align: right;
}

.impact-cell {
    display: grid;
    grid-template-columns: 1fr 58px;
    align-items: center;
    gap: 10px;
}

.impact-bar.impact-cost span {
    background: var(--brand);
}

.impact-bar.impact-time span {
    background: var(--accent-purple);
}

.impact-bar.impact-negative span {
    background: var(--success);
}

.scorecard-scroll {
    overflow-x: auto;
}

.scorecard-table {
    width: 100%;
    min-width: 560px;
    border-collapse: collapse;
    font-size: var(--fs-sm);
}

.scorecard-table th {
    padding: 0 10px 8px;
    font-size: var(--fs-2xs);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-align: left;
    color: var(--muted);
    border-bottom: 1px solid var(--line);
}

.scorecard-table td {
    padding: 7px 10px;
    border-bottom: 1px solid var(--line-soft);
    vertical-align: middle;
}

.scorecard-table th:first-child {
    width: 48%;
}

.scorecard-table .num {
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.scorecard-table tr.scorecard-section td {
    padding-top: 12px;
    background: var(--surface-soft);
    font-weight: 700;
}

.scorecard-table tfoot td {
    font-weight: 700;
    border-bottom: none;
}

.scorecard-table tfoot tr:first-child td {
    border-top: 2px solid var(--text);
}


.adjustment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.adjustment-grid .summary-card {
    margin-bottom: 0;
}

.adjustment-inputs {
    display: flex;
    align-items: flex-end;
    gap: 14px;
}

.adjustment-inputs .adjustment-op {
    padding-bottom: 4px;
    font-size: var(--fs-lg);
    color: var(--faint);
}

.adjustment-label {
    font-size: var(--fs-2xs);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
}

.adjustment-number {
    font-size: var(--fs-xl);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.adjustment-result {
    margin-top: 16px;
    padding: 12px 16px;
    border-left: 4px solid var(--brand);
    border-radius: 6px;
    background: var(--info-tint);
}

.adjustment-result .adjustment-number {
    font-size: var(--fs-xl);
    font-weight: 700;
}

.forecast-notice {
    margin-bottom: 20px;
    padding: 14px 18px;
    border-left: 4px solid var(--accent-orange);
    border-radius: 8px;
    background: var(--accent-orange-tint);
    color: #6e3b0b;
    font-size: var(--fs-base);
}

.forecast-notice p {
    margin-top: 4px;
    font-size: var(--fs-sm);
}

.adjustment-result.adjustment-unavailable {
    border-left-color: var(--accent-orange);
    background: var(--accent-orange-tint);
}

.adjustment-reason {
    margin-top: 2px;
    font-size: var(--fs-sm);
    color: #6e3b0b;
}

.adjustment-range {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
}

.adjustment-range > span {
    white-space: nowrap;
}

.adjustment-unit {
    margin-left: 6px;
    font-size: var(--fs-base);
    font-weight: 400;
    color: var(--muted);
}

.adjustment-result .adjustment-to {
    margin: 0 6px;
    font-size: var(--fs-base);
    font-weight: 400;
    color: var(--muted);
}

/* Risk Index Benchmark chart */
.risk-curve {
    margin-bottom: 20px;
}

.risk-curve h3 {
    color: var(--text);
}

.risk-curve-note {
    margin: 4px 0 12px;
    font-size: var(--fs-sm);
    color: var(--muted);
}

.risk-curve-chart {
    display: flex;
    flex-direction: column;
    height: 420px;
    margin-bottom: 10px;
}

.risk-curve-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 6px 18px;
    margin-bottom: 8px;
    font-size: var(--fs-xs);
    color: var(--text-soft);
}

.risk-curve-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.risk-curve-canvas {
    position: relative;
    flex: 1;
    min-height: 0;
}

/* the jump: what changed since the last assessment and the step to the next band down */
.rc-callout { display: grid; gap: 6px; margin: 0 0 16px; padding: 12px 16px; border-radius: 10px; background: var(--surface-soft); border: 1px solid var(--line); font-size: var(--fs-base); color: var(--text); }
.rc-callout strong { color: var(--ink); }
.rc-chip { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: var(--fs-sm); font-weight: 600; white-space: nowrap; }
.rc-chip--very-high { background: var(--risk-very-high-tint); color: var(--risk-very-high-ink); }
.rc-chip--high { background: var(--risk-high-tint); color: var(--risk-high-ink); }
.rc-chip--moderate { background: var(--risk-moderate-tint); color: var(--risk-moderate-ink); }
.rc-chip--minimal { background: var(--risk-minimal-tint); color: var(--risk-minimal-ink); }
.rc-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 4px; }
.rc-fact { border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; display: grid; gap: 4px; align-content: start; }
.rc-value { font-size: var(--fs-xl); font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.rc-value .rc-chip { font-size: var(--fs-base); padding: 3px 10px; }
.rc-sub { font-size: var(--fs-sm); color: var(--muted); font-variant-numeric: tabular-nums; }
.j-curve .summary-footnote { margin-top: 14px; }

.indices-summary-chart {
    height: 420px;
}

/* Results report header */
.report-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

.report-header > button {
    flex-shrink: 0;
    white-space: nowrap;
}

.report-details {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 24px;
    margin-top: 8px;
    font-size: var(--fs-sm);
    color: var(--text-soft);
}

.report-details dt {
    display: inline;
    color: var(--muted);
}

.report-details dt::after {
    content: ': ';
}

.report-details dd {
    display: inline;
    margin: 0;
    color: var(--text);
    font-weight: 500;
}

.print-only {
    display: none;
}

/* Print / Save as PDF: only the results report, on white, letter size */
@page {
    size: letter;
    margin: 0.6in 0.5in;
}

@media print {
    * {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    body, body.on-app {
        background: white;
        padding: 0;
        font-size: var(--fs-xs);
    }

    /* no waves or glass on paper: plain white panels */
    .waves-canvas { display: none !important; }
    body.on-app #resultsContainer, body.on-app #deliverableContainer, body.on-app #proposalContainer,
    body.on-app .assessment-list {
        background: white;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        border: 0;
        box-shadow: none;
    }

    .container {
        max-width: none;
    }

    .header,
    #dashboardMessage,
    #dashboardNav,
    #resultsMessage,
    .no-print {
        display: none !important;
    }

    .print-only {
        display: block;
    }

    .report-header {
        align-items: center;
        justify-content: flex-start;
        padding-bottom: 12px;
        border-bottom: 2px solid var(--text);
    }

    .report-logo.text-logo {
        display: inline-flex;   /* .print-only shows it as a block, which would put the tagline beside the name */
        font-size: 20px;
    }

    .report-header h2 {
        font-size: var(--fs-xl);
    }

    .results-container {
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
        margin-bottom: 16px;
    }

    .metric-card,
    .chart-container {
        box-shadow: none;
        border: 1px solid var(--line);
        padding: 12px;
        break-inside: avoid;
    }

    .metric-card .metric-value {
        font-size: var(--fs-xl);
    }

    .risk-curve {
        break-inside: avoid;
    }

    .summary-card {
        padding: 12px 16px;
        box-shadow: none;
        border: 1px solid var(--line);
        break-inside: avoid;
    }

    .adjustment-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .ix-tile { padding: 10px 12px; }
    .ix-value, .ix-total strong { font-size: var(--fs-xl); }
    .ix-risk { margin-top: 14px; }
    .ix-risk li { padding: 5px 0; font-size: var(--fs-xs); }

    .summary-card.scorecard-card {
        break-inside: auto;
    }

    .scorecard-table {
        min-width: 0;
        font-size: var(--fs-2xs);
    }

    .scorecard-table td {
        padding: 4px 8px;
    }

    .scorecard-table tr {
        break-inside: avoid;
    }

    .risk-curve-chart {
        height: 340px;
    }

    .indices-summary-chart {
        height: 340px;
        break-inside: avoid;
    }

    .results-table {
        font-size: var(--fs-2xs);
        border: 1px solid var(--line);
        break-inside: auto;
    }

    .results-table caption {
        break-after: avoid;
    }

    .results-table thead {
        display: table-header-group;
    }

    .results-table tr {
        break-inside: avoid;
    }

    .results-table th,
    .results-table td {
        padding: 5px 8px;
    }

    .site-footer {
        margin-top: 20px;
        padding: 10px 0 0;
        border-top: 1px solid var(--line);
        font-size: var(--fs-2xs);
        color: var(--muted);
    }

    #resultsContainer {
        padding: 0;
        box-shadow: none;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .impact-row {
        grid-template-columns: 1fr 1fr;
        gap: 6px 14px;
    }

    .impact-row .impact-label {
        grid-column: 1 / -1;
        font-weight: 600;
    }

    .impact-head span:first-child {
        display: none;
    }

    .header {
        flex-direction: column;
        gap: 15px;
    }

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

    .response-btn {
        flex: 1;
        min-width: 70px;
    }

    .results-container {
        grid-template-columns: 1fr;
    }
}

/* Deliverable: a client report laid out like the NorthPoint deliverables (static/app/js/deliverable.js) */
.report-actions { display: flex; gap: 8px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.deliverable-toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
/* the report's own bar: a white panel that stays in view while scrolling the report */
#deliverableToolbar { position: sticky; top: 8px; z-index: 5; justify-content: space-between; align-items: center;
    background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
    box-shadow: 0 4px 14px rgba(31, 42, 68, 0.10); }
.deliverable-toolbar-left, .deliverable-toolbar-right { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.deliverable-state { font-size: var(--fs-xs); padding: 4px 10px; }
.deliverable-state.shared { background: var(--success-tint); color: var(--success-dark); }
.deliverable-state.editing { background: var(--warning-tint); color: var(--warning-dark); }
.deliverable { color: #1f2d3d; }
.deliverable-page { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 40px 48px; margin-bottom: 24px; position: relative; }
.deliverable-cover { display: flex; flex-direction: column; min-height: 640px; }
.deliverable-brand { display: flex; align-items: center; gap: 18px; padding-bottom: 14px; border-bottom: 2px solid #000080; }
.deliverable-brand .text-logo { font-size: 26px; }
.deliverable-brand-line { margin-left: auto; font-size: var(--fs-xs); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-soft); }
.deliverable-cover-title { flex: 1; text-align: center; padding: 70px 0 40px; }
.deliverable-cover-title h1 { font-size: 30px; margin: 0 0 6px; color: #000080; }
.deliverable-cover-title h2 { font-size: var(--fs-xl); margin: 0 0 40px; font-weight: 600; }
.deliverable-prepared { font-style: italic; margin: 40px 0 10px; color: var(--text-soft); }
.deliverable-client { font-size: var(--fs-lg); font-weight: 700; margin: 4px 0; }
.deliverable-date { font-style: italic; font-size: var(--fs-lg); margin-top: 40px; }
.deliverable-cover .deliverable-edit { max-width: 420px; margin: 0 auto; text-align: left; }
.deliverable-confidential { font-size: var(--fs-2xs); line-height: 1.5; color: var(--text-soft); border-top: 1px solid var(--line); padding-top: 12px; margin: 0; }
.deliverable-heading { font-size: var(--fs-xl); color: #000080; margin: 0 0 18px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.deliverable h3 { font-size: var(--fs-lg); margin: 22px 0 10px; }
.deliverable-text p, .deliverable-text li { font-size: var(--fs-base); line-height: 1.6; }
.deliverable-text ul { margin: 6px 0 12px 20px; padding: 0; }
.deliverable-text li { margin-bottom: 6px; }
.deliverable-caption { font-size: var(--fs-sm); color: var(--text-soft); margin: 0 0 10px; }
.deliverable-toc { list-style: none; padding: 0; font-size: var(--fs-md); }
.deliverable-toc > li { margin: 12px 0; font-weight: 600; }
.deliverable-toc ol { list-style: none; padding-left: 28px; font-weight: 400; }
.deliverable-toc ol li { margin: 4px 0; }
.toc-line { display: flex; align-items: baseline; gap: 6px; }
.toc-dots { flex: 1; }
.deliverable-toc.has-pages .toc-dots { border-bottom: 1px dotted #9ca3af; transform: translateY(-4px); }
.toc-page { min-width: 2ch; text-align: right; font-variant-numeric: tabular-nums; }
.deliverable-metrics dt { font-weight: 700; margin-top: 10px; }
.deliverable-metrics dd { margin: 2px 0 0; font-size: var(--fs-base); line-height: 1.5; color: var(--text); }
.deliverable-scale { max-width: 420px; }
.deliverable-footer { margin-top: 28px; padding-top: 8px; border-top: 1px solid var(--line); font-size: var(--fs-2xs); color: var(--muted); text-align: center; }
.deliverable-edit textarea { width: 100%; box-sizing: border-box; font: inherit; font-size: var(--fs-base); line-height: 1.5; padding: 10px; border: 1px solid var(--line-strong); border-radius: 6px; }
.deliverable-edit-note { font-size: var(--fs-xs); color: var(--muted); margin: 4px 0 10px; }
.link-button { background: none; border: none; padding: 0; color: var(--info); text-decoration: underline; cursor: pointer; font: inherit; }
@media (max-width: 700px) {
    .deliverable-page { padding: 24px 18px; }
    .deliverable-cover { min-height: 0; }
    .deliverable-brand { flex-wrap: wrap; }
    .deliverable-brand-line { margin-left: 0; }
}
@media print {
    body.printing-deliverable .site-footer { display: none !important; }
    .deliverable-page { border: none; border-radius: 0; padding: 0; margin: 0; break-after: page; page-break-after: always; }
    .deliverable-page:last-child { break-after: auto; page-break-after: auto; }
    .deliverable-cover { min-height: 9in; }
    .deliverable .summary-card, .deliverable .results-table { break-inside: avoid; }
}
.deliverable-chart { margin: 0 0 28px; }
.deliverable-chart h3 { margin-top: 0; }
.deliverable-text h4 { font-size: var(--fs-md); margin: 16px 0 4px; color: #000080; }
.deliverable-summary .star-col { text-align: center; font-size: var(--fs-2xs); white-space: nowrap; width: 76px; }
.deliverable-summary th.star-col { font-size: var(--fs-2xs); }
.deliverable-scorecard td:first-child, .deliverable-summary td:first-child { max-width: 420px; }
.deliverable-graph { position: relative; width: 100%; }
.draft-mark { display: none; }
.deliverable-graph-cont { margin: 18px 0 4px; font-size: var(--fs-xs); font-weight: 600; color: var(--muted); }
.deliverable-forecast { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: center; }
.deliverable-forecast-chart { position: relative; height: 240px; }
@media (max-width: 700px) {
    .deliverable-forecast { grid-template-columns: 1fr; }
    .deliverable-summary .star-col { width: auto; font-size: var(--fs-2xs); }
}
@media print {
    /* the confidentiality line and page number sit in the page margin, so a section that fills its last
       page never pushes its footer onto a page of its own */
    @page { margin: 0.6in 0.6in 0.75in;
            @bottom-left { content: "Cognitient Corp. \00B7  Confidential"; font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; font-size: 9pt; color: var(--muted); }
            @bottom-right { content: "Page " counter(page) " of " counter(pages); font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; font-size: 9pt; color: var(--muted); } }
    @page :first { @bottom-left { content: none; } @bottom-right { content: none; } }
    .deliverable-chart { break-inside: avoid; }
    .deliverable-footer { display: none; }
    .deliverable-graph-part { break-inside: avoid; }
    /* before release: a faint DRAFT across every page (a fixed element prints on each page) */
    .draft-mark { display: block !important; position: fixed; top: 42%; left: 0; right: 0; z-index: 1000; text-align: center;
        font-size: 120px; font-weight: 800; letter-spacing: 12px; text-transform: uppercase; color: rgba(185, 28, 28, 0.07);
        transform: rotate(-30deg); pointer-events: none; }
    /* a long table (scorecard, summary, categories) runs on from its heading and splits between rows;
       short ones stay whole */
    .deliverable .deliverable-chart:has(tbody tr:nth-child(15)),
    .deliverable .results-table:has(tbody tr:nth-child(15)) { break-inside: auto; }
    .deliverable .results-table tr { break-inside: avoid; }
    .deliverable h2, .deliverable h3, .deliverable h4 { break-after: avoid; }
}

/* Assignments: one primary action per row, the rest in an Actions menu */
.row-actions { display: flex; gap: 6px; align-items: flex-start; justify-content: flex-end; flex-wrap: wrap; }  /* stacks when the table is tight, rather than running past the card */
.row-menu { position: relative; }
.row-menu > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.row-menu > summary::-webkit-details-marker { display: none; }
.row-menu > summary::after { content: " ▾"; font-size: var(--fs-2xs); }
.row-menu-list { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; min-width: 180px; background: var(--surface);
    border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(31, 45, 61, 0.15); padding: 6px; display: grid; }
.row-menu-list button { background: none; border: none; text-align: left; padding: 8px 10px; border-radius: 5px;
    font: inherit; font-size: var(--fs-sm); color: var(--text); cursor: pointer; white-space: nowrap; }
.row-menu-list button:hover:not(:disabled) { background: var(--brand-tint); }
.row-menu-list button:disabled { color: var(--line-strong); cursor: not-allowed; }
.row-menu-list button.danger { color: var(--danger); border-top: 1px solid var(--line-soft); margin-top: 4px; padding-top: 10px; border-radius: 0 0 5px 5px; }
.row-menu-list button.danger:hover { background: var(--danger-tint); }
.row-actions > .btn-small { white-space: nowrap; }
.checkbox-label { flex-direction: row; align-items: center; gap: 8px; }
.checkbox-label input { width: auto; }
/* assign form: several respondents, one row each (user, role, remove) */
.respondent-rows { display: flex; flex-direction: column; gap: 18px; margin-top: 10px; }
.respondent-section { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.respondent-section h4 { margin: 0; font-size: var(--fs-base); }
.respondent-list { display: flex; flex-direction: column; gap: 10px; align-self: stretch; }
.respondent-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto; gap: 12px; align-items: end; }
.respondent-row label { font-size: var(--fs-sm, 0.875rem); }
.respondent-row > button { margin-bottom: 4px; }
@media (max-width: 700px) { .respondent-row { grid-template-columns: minmax(0, 1fr); } }
/* results tables clip their rounded corners; the admin table lets the Actions menu show past its edge */
.results-table.admin-table { overflow: visible; }
.row-menu.open-up .row-menu-list { top: auto; bottom: calc(100% + 4px); }

/* Statement notes in the admin Scores view (admin only) */
.statement-note { margin: 6px 0 2px 46px; font-size: var(--fs-sm); }
.statement-note .note-add { font-size: var(--fs-xs); color: var(--muted); }
.statement-note .note-add:hover { color: var(--info); }
.statement-note .note-text { background: var(--accent-yellow-tint); border-left: 3px solid var(--accent-yellow); padding: 6px 10px; border-radius: 4px; color: var(--text); line-height: 1.45; }
.statement-note .note-meta { font-size: var(--fs-2xs); color: var(--faint); margin-top: 3px; }
.statement-note .note-meta .link-button { font-size: var(--fs-2xs); }
.statement-note textarea { width: 100%; box-sizing: border-box; font: inherit; font-size: var(--fs-sm); padding: 8px; border: 1px solid var(--line-strong); border-radius: 6px; }
.statement-note .note-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.statement-note .note-delete { color: var(--danger); font-size: var(--fs-xs); }
.statement-note .note-status { font-size: var(--fs-xs); color: var(--danger); }
@media print { .statement-note .note-add { display: none; } }

/* Research > Signals: 8-K filing signals and the lead on each company */
.signal-card h3 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.signal-suggests, .signal-research { margin: 6px 0; font-size: var(--fs-sm); color: var(--text); }
.signal-research .btn-small { margin: 2px 4px 2px 0; }
.signals-table td { vertical-align: top; }
.signals-table td.nowrap { white-space: nowrap; }
.signal-excerpt { font-size: var(--fs-sm); color: var(--text); max-width: 640px; }
.lead-form { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line-soft); }
.lead-form label { display: flex; flex-direction: column; gap: 4px; font-size: var(--fs-xs); font-weight: 600; color: var(--muted); }
.lead-form input, .lead-form select, .lead-form textarea { padding: 6px 10px; border: 1px solid var(--line-strong); border-radius: 6px; font-size: var(--fs-base); background: var(--surface); font-family: inherit; }
.lead-form .lead-wide { flex: 1 1 280px; }
.lead-form .lead-notes { flex: 1 1 100%; }
.lead-form .lead-save { display: flex; align-items: center; gap: 10px; }
.badge.lead-open { background: var(--info-tint); color: var(--info); }
.badge.lead-in_progress { background: var(--warning-tint); color: #b9770e; }
.badge.lead-proposal { background: var(--accent-purple-tint); color: #7d3c98; }
.badge.lead-won { background: var(--success-tint); color: var(--success); }
.badge.lead-closed { background: var(--surface-muted); color: var(--muted); }
.badge.lead-dormant { background: var(--danger-tint); color: var(--danger); }
/* signal confidence: how strongly the filings suggest an assessment now */
.badge.confidence-badge { font-variant-numeric: tabular-nums; white-space: nowrap; }
.badge.confidence-high { background: var(--success-tint); color: var(--success); }
.badge.confidence-medium { background: var(--warning-tint); color: #b9770e; }
.badge.confidence-low { background: var(--surface-muted); color: var(--muted); }
.signal-why { margin: 4px 0 10px; font-size: var(--fs-sm); color: var(--text-soft); }

/* Point-person breakdown strip: open-lead counts that double as a filter */
.lead-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 14px; }
.lead-chip { display: inline-flex; align-items: center; gap: 7px; font: inherit; font-size: var(--fs-sm); color: var(--text-soft);
    background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 5px 13px; cursor: pointer; }
.lead-chip:hover { border-color: #c5cdea; }
.lead-chip.active { border-color: var(--brand-dark); color: var(--brand-dark); background: var(--brand-tint); font-weight: 600; }
.lead-chip-n { font-weight: 800; color: var(--brand-dark); }

/* Dormant-review nudge */
.lead-nudge { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 14px;
    background: var(--danger-tint); border: 1px solid var(--danger-line); border-radius: 8px; padding: 10px 14px; font-size: var(--fs-base); color: var(--danger-dark); }

/* Modal (dormant review) */
.modal-backdrop { position: fixed; inset: 0; background: rgba(17, 24, 48, 0.45); display: flex; align-items: center;
    justify-content: center; z-index: 1000; padding: 20px; }
.modal-card { background: var(--surface); border-radius: 12px; padding: 22px 24px; max-width: 640px; width: 100%;
    max-height: 85vh; overflow: auto; box-shadow: 0 20px 60px rgba(17, 24, 48, 0.3); }
.modal-card h3 { margin: 0 0 6px; }
.modal-actions { display: flex; align-items: center; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.modal-actions .modal-spacer { flex: 1 1 auto; }
.dormant-list { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; }
.dormant-row { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px;
    flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.dormant-co { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dormant-name { font-weight: 600; color: var(--ink); }
.dormant-choice { display: flex; gap: 14px; }
.dormant-choice label { display: inline-flex; align-items: center; gap: 5px; font-size: var(--fs-base); cursor: pointer; }
@media (max-width: 640px) {
    /* one event per block: date and event on a line, the excerpt below */
    .signals-table thead { display: none; }
    .signals-table, .signals-table tbody, .signals-table tr { display: block; width: 100%; }
    .signals-table tr { padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
    .signals-table td { display: inline-block; padding: 2px 8px 2px 0; border: 0; vertical-align: baseline; }
    .signals-table td.signal-excerpt { display: block; max-width: none; padding-top: 4px; }
    .lead-form label, .lead-form .lead-wide { flex: 1 1 100%; }
    .lead-form input, .lead-form select { width: 100%; }
}

/* Pre-assessment intake: scope, stakeholders and the due-diligence checklist */
.intake-grid { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; margin: 12px 0; }
.intake-grid label { display: flex; flex-direction: column; gap: 4px; font-size: var(--fs-xs); font-weight: 600; color: var(--muted); }
.intake-grid .intake-wide { flex: 1 1 420px; }
#intakeContainer input, #intakeContainer select, #intakeContainer textarea { padding: 6px 10px; border: 1px solid var(--line-strong); border-radius: 6px;
    font-size: var(--fs-base); background: var(--surface); font-family: inherit; box-sizing: border-box; }
.intake-people input { width: 100%; }
.intake-section { margin: 14px 0; }
.intake-section h4 { margin: 0 0 6px; color: var(--text); }
.intake-item { display: grid; grid-template-columns: minmax(200px, 2fr) 150px minmax(160px, 2fr); gap: 8px; align-items: center;
    padding: 6px 8px; border-left: 3px solid var(--line); margin-bottom: 4px; background: var(--surface); }
.intake-item.status-requested { border-left-color: #f39c12; }
.intake-item.status-received { border-left-color: var(--success); }
.intake-item.status-not_applicable { border-left-color: var(--line-strong); color: var(--faint); }
.intake-text { font-size: var(--fs-base); }
.intake-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 16px; }
@media (max-width: 640px) {
    .intake-item { grid-template-columns: 1fr; }
    .intake-people thead { display: none; }
    .intake-people, .intake-people tbody, .intake-people tr, .intake-people td { display: block; width: 100%; }
    .intake-people tr { padding: 6px 0; border-bottom: 1px solid var(--line-soft); }
}

/* Proposals: the list, the new-proposal form and the document (laid out with the deliverable's classes) */
.proposal-new input[type=number] { width: 130px; }
.badge.proposal-draft { background: var(--info-tint); color: var(--info); }
.badge.proposal-sent { background: var(--warning-tint); color: #b9770e; }
.badge.proposal-accepted { background: var(--success-tint); color: var(--success); }
.badge.proposal-declined { background: var(--surface-muted); color: var(--muted); }
.proposal-panel { margin-bottom: 16px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.proposal-panel .deliverable-toolbar { margin-bottom: 0; align-items: center; }
.proposal-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px 14px; align-items: end; margin-bottom: 14px; }
.proposal-fields label { display: flex; flex-direction: column; gap: 4px; font-size: var(--fs-xs); font-weight: 600; color: var(--muted); }
.proposal-fields input, .proposal-fields select { padding: 6px 10px; border: 1px solid var(--line-strong); border-radius: 6px; font-size: var(--fs-base);
    background: var(--surface); font-family: inherit; }
.proposal-fields input, .proposal-fields select { width: 100%; min-width: 0; }
.proposal-actions { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.proposal-actions-right { display: flex; gap: 8px; flex-wrap: wrap; }
.proposal-actions-right .danger { margin-right: 8px; }
.proposal-saved { margin: 8px 0 0; font-size: var(--fs-xs); }
.proposal-signatures { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin-top: 28px; }
.proposal-signature p { margin: 10px 0; font-size: var(--fs-base); }
@media (max-width: 640px) {
    .proposal-signatures { grid-template-columns: 1fr; }
    .proposal-fields label, .proposal-fields input, .proposal-fields select { width: 100%; }
    .proposal-fields input[type=number] { width: 100%; }
}

/* Admin overview home */
.overview-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 12px 0 28px; }
@media (max-width: 900px) { .overview-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.overview-tile { display: flex; flex-direction: column; gap: 10px; align-items: stretch; text-align: left;
    background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--brand); border-radius: 10px;
    padding: 16px 18px; cursor: pointer; font: inherit; color: inherit;
    box-shadow: 0 1px 2px rgba(31, 42, 68, 0.06); transition: border-color .15s, box-shadow .15s, transform .15s; }
.overview-tile:hover { box-shadow: 0 8px 22px rgba(41, 55, 143, 0.12); transform: translateY(-2px); }
.overview-tile.alert { border-top-color: var(--warning); }
.overview-area { display: flex; justify-content: space-between; align-items: center; font-size: var(--fs-2xs); font-weight: 700;
    letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.overview-go { font-size: var(--fs-md); color: var(--brand-line); transition: color .15s, transform .15s; }
.overview-tile:hover .overview-go { color: var(--brand); transform: translateX(2px); }
.overview-figure { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.overview-num { font-size: 34px; font-weight: 800; color: var(--ink); line-height: 1; }
.overview-label { font-size: var(--fs-base); font-weight: 600; color: var(--text-soft); }
.overview-context { font-size: var(--fs-xs); color: var(--muted); border-top: 1px solid var(--line-soft); padding-top: 8px; }
.overview-tile.alert .overview-context { color: var(--warning-dark); font-weight: 600; }
.overview-attention { margin: 0 0 24px; }
.overview-attention ul { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 8px; }
.overview-todo { display: flex; width: 100%; justify-content: space-between; align-items: center; gap: 12px; text-align: left;
    background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--warning); border-radius: 8px;
    padding: 11px 14px; font: inherit; font-size: var(--fs-base); color: var(--ink); cursor: pointer; }
.overview-todo:hover { background: var(--warning-tint); }
.overview-todo > span:last-child { color: var(--warning); font-weight: 700; }
.overview-proposals { margin: 0 0 24px; }
.overview-proposals-summary { margin: 6px 0 10px; color: var(--text-soft); font-size: var(--fs-base); }
.overview-proposals-table td { vertical-align: top; }
.overview-tasks { margin: 0 0 24px; }
.overview-tasks ul { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 6px; }
.overview-task { display: grid; grid-template-columns: 96px 1fr auto; align-items: center; gap: 12px; width: 100%;
    text-align: left; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--brand);
    border-radius: 8px; padding: 10px 14px; font: inherit; font-size: var(--fs-base); color: var(--ink); cursor: pointer; }
.overview-task:hover { background: var(--line-soft); }
.overview-task.due { border-left-color: var(--warning); }
.overview-task-kind { font-size: var(--fs-2xs); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.overview-task-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.overview-task-title { font-weight: 600; }
.overview-task-next { font-size: var(--fs-sm); color: var(--text-soft); }
.overview-task-due { font-size: var(--fs-xs); color: var(--muted); white-space: nowrap; }
.overview-task.due .overview-task-due { color: var(--warning-dark); font-weight: 700; }

/* Overview stage tracker: active engagements, each lit up to the stage it's in */
.trk-row { display: block; width: 100%; text-align: left; font: inherit; cursor: pointer;
    background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; margin-bottom: 10px;
    transition: border-color .15s, box-shadow .15s; }
.trk-row:hover { border-color: #c5cdea; box-shadow: 0 6px 18px rgba(41, 55, 143, 0.08); }
.trk-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.trk-name { font-size: var(--fs-md); font-weight: 600; color: var(--ink); }
.trk-next { font-size: var(--fs-sm); color: var(--brand-dark); white-space: nowrap; }
.trk-next.trk-done { color: #1d9e75; }
.trk-steps { display: flex; gap: 6px; }
.trk-step { flex: 1; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.trk-bar { height: 6px; border-radius: 3px; background: var(--line); }
.trk-label { font-size: var(--fs-xs); color: var(--slate); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trk-step.done .trk-bar { background: var(--brand-dark); }
.trk-step.done .trk-label { color: var(--text-soft); }
.trk-step.current .trk-bar { background: var(--brand-dark); box-shadow: 0 0 0 2px var(--line-cool); }
.trk-step.current .trk-label { color: var(--brand-dark); font-weight: 600; }
@media (max-width: 640px) { .trk-label { font-size: var(--fs-2xs); } }

/* Client home welcome banner */
.user-welcome { margin: 0 0 18px; }
.user-welcome p { background: var(--brand-tint); border: 1px solid var(--line-cool); border-left: 4px solid var(--brand-dark);
    border-radius: 8px; padding: 14px 18px; color: var(--ink); font-size: var(--fs-md); line-height: 1.5; margin: 0; }

/* Client home cards: title, a short description, then each assessment with its status and actions */
.home-card { display: flex; flex-direction: column; padding: 20px; border-color: var(--line); }
.home-card h3, .home-card h4 { display: flex; align-items: center; gap: 6px; font-size: var(--fs-md); color: var(--ink); margin: 0 0 6px; }
/* More assessments, grouped by the landing page's themes */
.home-theme { margin-top: 26px; }
.home-theme-title { display: flex; align-items: center; gap: 8px; font-size: var(--fs-md); margin: 0; color: var(--ink); }
.home-theme-blurb { font-size: var(--fs-sm); color: var(--muted); margin: 4px 0 0; }
.home-theme .type-cards { margin-top: 12px; }
.home-desc { font-size: var(--fs-sm); line-height: 1.5; color: var(--muted); margin: 0 0 14px;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.home-item { border-top: 1px solid var(--line-soft); padding-top: 14px; margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.home-item + .home-item { margin-top: 14px; }
.home-item-name { font-size: var(--fs-base); font-weight: 600; color: var(--ink); }
.home-item-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: var(--fs-xs); color: var(--muted); }
.home-score { display: flex; align-items: baseline; justify-content: space-between; background: var(--surface-soft);
    border-radius: 8px; padding: 8px 12px; font-size: var(--fs-xs); color: var(--text-soft); }
.home-score strong { font-size: var(--fs-lg); color: var(--brand-dark); font-variant-numeric: tabular-nums; }
.home-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 4px; }
.home-item .home-actions { margin-top: 2px; }
.home-card.locked { background: var(--surface-soft); color: var(--muted); }
.home-card.locked h3, .home-card.locked h4 { font-size: var(--fs-md); color: var(--text-soft); }
.home-card.locked h3 svg, .home-card.locked h4 svg { flex: 0 0 auto; color: #9aa3b5; }
.home-card.locked .home-desc { -webkit-line-clamp: 2; color: var(--slate); }
.home-more-title { margin-top: 36px; }
.home-more-note { font-size: var(--fs-sm); color: var(--muted); margin: 6px 0 0; }
.home-empty { color: var(--muted); font-size: var(--fs-base); }

/* Assignments: requests strip, Client menu, Active / Completed / Past projects tabs */
.requests-strip { background: var(--accent-yellow-tint); border: 1px solid var(--warning-line); border-radius: 8px; margin: 8px 0 14px; }
.requests-strip > summary { cursor: pointer; padding: 10px 14px; font-size: var(--fs-sm); font-weight: 600; color: var(--warning-ink); }
.requests-strip[open] > summary { border-bottom: 1px solid var(--warning-line); }
.requests-strip > div { background: var(--surface); padding: 0 12px; }
.requests-strip > div:empty { display: none; }
.client-menu { align-self: flex-end; }
.client-menu .row-menu-list { left: 0; right: auto; }
.assign-tabs { margin-top: 18px; }
.assign-tabs .assignment-count { margin-left: 4px; }
.assign-tabs { overflow-x: auto; }
.assign-tabs .subtab { white-space: nowrap; padding: 9px 12px; }
.past-projects-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.past-projects-bar .research-intro { margin: 0; }
.past-projects-bar .actions { display: flex; gap: 8px; }

/* Leads > Signals: filters in one row, lead cards with quick actions and a collapsed lead form */
.signals-filters { display: grid; grid-template-columns: minmax(220px, 2fr) repeat(5, minmax(0, 1fr)); gap: 12px; align-items: end; }
.signals-filters label { min-width: 0; }
.signals-filters input[type="search"], .signals-filters select { width: 100%; min-width: 0; }
.signals-filters .research-count { grid-column: 1 / -1; }
@media (max-width: 1000px) { .signals-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); } .signals-filters .signals-search { grid-column: 1 / -1; } }
.signal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.signal-head h3 { margin: 0; }
.signal-head-actions { display: flex; gap: 8px; flex: 0 0 auto; }
.signal-suggests { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 10px 0; }
.signal-suggests .signal-research { margin: 0 0 0 auto; display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.lead-edit { margin-top: 12px; border-top: 1px solid var(--line-soft); }
.lead-edit > summary { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px;
    padding: 12px 0 0; font-size: var(--fs-sm); color: var(--text); }
.lead-edit > summary::-webkit-details-marker { display: none; }
.lead-owner { font-weight: 600; }
.lead-next { color: var(--text); }
.lead-msg { font-size: var(--fs-xs); }
.lead-edit-toggle { margin-left: auto; color: var(--brand); font-weight: 600; }
.lead-edit-toggle::after { content: " ▾"; font-size: var(--fs-2xs); }
.lead-edit[open] .lead-edit-toggle::after { content: " ▴"; }
.lead-edit .lead-form { border-top: none; }

/* Leads > Proposals: the new-proposal card */
.add-client-fields select { padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 6px; font-size: var(--fs-base); background: var(--surface); }
.proposal-new-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* Research > Analytics: Sort by / Show sit over the statements table they control */
.analytics-table-controls { margin: 22px 0 8px; padding-top: 16px; border-top: 1px solid var(--line-soft); }
.analytics-table-controls[hidden] { display: none; }
.analytics-overview { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: stretch; margin: 12px 0 0; }
.analytics-overview .analytics-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; }
.analytics-overview .analytics-cards > :last-child:nth-child(odd) { grid-column: 1 / -1; }
.analytics-overview > .summary-card { margin: 0; display: flex; flex-direction: column; justify-content: center; }
.analytics-overview .hist.large { display: flex; width: 100%; height: 180px; gap: 4px; }
.analytics-overview .hist.large span { flex: 1 1 0; width: auto; }
.analytics-overview .hist-axis { gap: 4px; }
.analytics-overview .hist-axis span { flex: 1 1 0; width: auto; }
@media (max-width: 900px) { .analytics-overview { grid-template-columns: 1fr; } }

/* Two-factor card on My account: same frame as the profile form above it */
.twofa-card { border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; margin: 18px 0 14px; background: var(--surface); }
.twofa-head { display: flex; align-items: center; gap: 16px; }
.twofa-icon { flex: 0 0 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.twofa-head.is-on .twofa-icon { background: var(--success-tint); color: #1e7e4f; }
.twofa-head.is-off .twofa-icon { background: var(--surface-muted); color: var(--slate); }
.twofa-main { flex: 1; min-width: 0; }
.twofa-title { margin: 0 0 3px; font-size: var(--fs-md); color: var(--ink); }
.twofa-status { display: inline-block; margin-left: 8px; vertical-align: 2px; padding: 2px 10px; border-radius: 10px; font-size: var(--fs-2xs); font-weight: 600;
    letter-spacing: 0.3px; text-transform: uppercase; }
.twofa-head.is-on .twofa-status { background: var(--success-tint); color: #1e7e4f; box-shadow: inset 0 0 0 1px var(--success-line); }
.twofa-head.is-off .twofa-status { background: var(--surface-muted); color: var(--text-soft); box-shadow: inset 0 0 0 1px var(--line-cool); }
.twofa-text { margin: 0; font-size: var(--fs-sm); color: var(--muted); line-height: 1.5; }
.twofa-action { flex: 0 0 auto; }
@media (max-width: 640px) {
    .twofa-head { flex-wrap: wrap; align-items: flex-start; }
    .twofa-main { flex-basis: calc(100% - 60px); }
    .twofa-action { margin-left: 60px; }
}

/* Two-factor setup */
.twofa-key { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: var(--fs-lg); letter-spacing: 2px;
    background: var(--surface-soft); border: 1px solid var(--line-cool); border-radius: 8px; padding: 12px 16px; display: inline-block; color: var(--ink); }
.twofa-recovery { display: grid; grid-template-columns: repeat(2, max-content); gap: 6px 24px; margin: 10px 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: var(--fs-md); background: var(--surface-soft);
    border: 1px solid var(--line-cool); border-radius: 8px; padding: 14px 18px; color: var(--ink); }

/* Buyer / Seller Market Management: competitor score rows, buyer interviews, report sheets */
.entity-label { font-size: var(--fs-xs); font-weight: 600; color: var(--text-soft); margin: 8px 0 4px; }
.competitor-options .response-btn { opacity: 0.92; }
.form-grid .profile-group { grid-column: 1 / -1; margin: 10px 0 0; font-size: var(--fs-base); color: var(--brand-dark); }
.bsmm-interviews { margin-top: 30px; }
.interview-table-wrap { overflow: auto; max-height: 520px; border: 1px solid var(--line); border-radius: 6px; }
.interview-table { border-collapse: collapse; font-size: var(--fs-xs); }
.interview-table th { position: sticky; top: 0; background: var(--surface-soft); z-index: 1; min-width: 110px; max-width: 140px;
    padding: 6px; text-align: left; vertical-align: bottom; font-weight: 600; white-space: normal; border-bottom: 1px solid var(--line); }
.interview-table th.rating-col { min-width: 70px; max-width: 80px; background: var(--brand-tint); }
.interview-table td { padding: 2px; border-bottom: 1px solid var(--line-soft); }
.interview-table .row-num { position: sticky; left: 0; background: var(--surface); min-width: 32px; text-align: right; color: var(--muted); padding-right: 6px; }
.interview-table th.row-num { background: var(--surface-soft); z-index: 2; }
.interview-table input { width: 100%; min-width: 100px; padding: 4px 6px; font-size: var(--fs-xs); border: 1px solid var(--canvas); border-radius: 3px; }
.interview-table input.rating-input { min-width: 60px; text-align: right; }
.interview-paste { margin: 12px 0; }
.interview-paste textarea { width: 100%; margin: 8px 0; font-family: monospace; font-size: var(--fs-xs); }
.interview-actions { display: flex; gap: 12px; align-items: center; margin-top: 10px; }
.save-status.error { color: var(--danger); }
.bsmm-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 760px) { .bsmm-metrics { grid-template-columns: 1fr; } }
.bsmm-tabs { flex-wrap: wrap; }
.bsmm-card { margin-top: 16px; }
.bsmm-card h3 { margin: 0 0 6px; }
.bsmm-note { color: var(--muted); font-size: var(--fs-sm); margin: 0 0 12px; max-width: 900px; }
.bsmm-lead { font-size: var(--fs-md); margin: 0 0 10px; }
.bsmm-sub { color: var(--muted); font-size: var(--fs-xs); margin-top: 2px; }
.bsmm-sub-inline { color: var(--muted); font-size: var(--fs-xs); white-space: nowrap; }
.bsmm-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
@media (max-width: 900px) { .bsmm-two { grid-template-columns: 1fr; } }
.bsmm-grid { margin-top: 4px; }
.bsmm-grid thead th { vertical-align: bottom; }
.bsmm-grid tbody th { text-align: left; color: var(--text); font-size: var(--fs-sm); text-transform: none; font-weight: 600; }
.bsmm-grid td.num { font-variant-numeric: tabular-nums; }
.bsmm-items td:first-child { min-width: 260px; }
.bsmm-total th, .bsmm-total td { font-weight: 700; border-top: 2px solid var(--line); }
.bsmm-self th, .bsmm-self td { background: var(--brand-tint); }
.bsmm-up { color: #1e7d4f; }
.bsmm-down { color: #b03a2e; }
.bsmm-bar { display: block; height: 4px; background: var(--line-soft); border-radius: 2px; margin-top: 4px; min-width: 60px; }
.bsmm-bar > span { display: block; height: 100%; background: var(--brand); border-radius: 2px; }
.bsmm-bar.buyers > span { background: #2e9e6b; }
.bsmm-bar.rivals > span { background: #e08a2c; }
.bsmm-ranked { margin: 0; padding-left: 20px; }
.bsmm-ranked li { margin-bottom: 10px; }
.bsmm-ranked-name { display: block; }
.bsmm-ranked-figures { display: block; color: var(--muted); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }
.bsmm-plain { margin: 0; padding-left: 18px; }
.bsmm-plain li { margin-bottom: 4px; }
.bsmm-toolbar { display: flex; justify-content: flex-end; margin-bottom: 6px; font-size: var(--fs-sm); }
.bsmm-toolbar select { margin-left: 6px; }
.bsmm-chart { position: relative; width: 100%; }
.bsmm-card .table-scroll { overflow-x: auto; }
.bsmm-facts { margin-bottom: 12px; }
.bsmm-table-wrap { overflow: auto; max-height: 560px; border: 1px solid var(--line-soft); border-radius: 4px; }
.bsmm-table { border-collapse: collapse; font-size: var(--fs-xs); }
.bsmm-table td { padding: 3px 8px; border-bottom: 1px solid var(--line-soft); vertical-align: top; max-width: 420px; }
.bsmm-table td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bsmm-table td.long { min-width: 240px; }

/* View as client (static/app/js/core.js renderViewAsBanner): always on top while an admin views */
.view-as-banner {
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 10px 16px;
    background: #fff4d6;
    border-bottom: 2px solid #e0a800;
    color: #5a4300;
    font-size: var(--fs-base);
}

/* Assignments: rows open their results; empty tabs say what's missing */
.admin-table tr.row-link { cursor: pointer; }
.admin-table tr.row-link:hover td { background: var(--surface-soft); }
.assign-empty { border: 1px dashed var(--line-cool); border-radius: 10px; padding: 28px 20px; text-align: center; color: var(--muted); margin: 8px 0; }
.assign-empty strong { display: block; color: var(--ink); font-size: var(--fs-md); margin-bottom: 4px; }
.assign-empty p { margin: 0 0 14px; font-size: var(--fs-sm); }
.assign-empty p:last-child { margin-bottom: 0; }

/* Proposals: when each went out, and what's still open */
.proposal-sent-on { display: block; margin-top: 4px; font-size: var(--fs-xs); color: var(--muted); font-weight: normal; }
.proposal-open-summary { margin: 0 0 10px; font-size: var(--fs-sm); color: var(--muted); }

/* Small shared text and layout helpers (instead of inline styles) */
.muted { color: var(--muted); }
.small { font-size: var(--fs-xs); }
.center { text-align: center; }
.strong { font-weight: 600; }
.strong-line { font-weight: 600; margin-bottom: 12px; }
.hint { font-size: var(--fs-sm); color: var(--muted); margin: 6px 0 12px; }
.success-text { color: var(--success); margin-top: 5px; }
.button-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.button-row.flush { margin-top: 0; }
.category-heading { text-transform: uppercase; font-size: var(--fs-md); }
.section-gap { margin-top: 22px; }

/* Outsourcing Value Analysis deliverable: the two sides compared (deliverable-gap.js) */
.deliverable-gap-table td:first-child { max-width: 420px; }
.badge.gap-critical { background: var(--danger-tint); color: var(--danger); }

/* My account: Profile and Security sections; two-factor authentication in a dialog (account.js) */
.account-section-title { margin: 28px 0 6px; font-size: var(--fs-sm); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.account-section-title:first-of-type { margin-top: 10px; }
.twofa-card { margin-top: 8px; }
.twofa-dialog { max-width: 520px; }
.twofa-dialog-head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.twofa-dialog-head h3 { flex: 1; margin: 0; font-size: var(--fs-lg); color: var(--ink); }
.twofa-dialog-head .twofa-icon { background: var(--brand-tint); color: var(--brand); }
.twofa-close { background: none; border: 0; padding: 4px 8px; font-size: var(--fs-xl); line-height: 1; color: var(--muted); border-radius: 6px; }
.twofa-close:hover { background: var(--line-soft); color: var(--ink); }
.twofa-lead { margin: 0 0 14px; font-size: var(--fs-base); line-height: 1.55; color: var(--text); }
.twofa-steps { margin: 0; padding-left: 20px; font-size: var(--fs-base); line-height: 1.55; color: var(--text); }
.twofa-steps li { margin-bottom: 14px; padding-left: 4px; }
.twofa-key-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 8px 0 4px; }
.twofa-key-row .twofa-key { margin: 0; }
.twofa-note { margin: 4px 0 0; font-size: var(--fs-sm); color: var(--muted); }
.twofa-code { display: block; margin-top: 8px; width: 150px; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: 6px;
    font-size: var(--fs-xl); letter-spacing: 6px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.twofa-section { border-top: 1px solid var(--line-soft); padding-top: 14px; }
.twofa-section h4 { margin: 0 0 4px; font-size: var(--fs-base); color: var(--ink); }
.twofa-field { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; font-size: var(--fs-sm); color: var(--text); }
.twofa-field input { max-width: 280px; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 6px; font-size: var(--fs-base); }
.twofa-dialog .twofa-recovery { margin: 4px 0 0; }

/* QR code to scan with Google Authenticator (dialog and admin sign-in setup) */
.twofa-qr { display: block; width: 200px; height: 200px; margin: 10px 0 6px; padding: 6px; background: var(--surface);
    border: 1px solid var(--line); border-radius: 10px; image-rendering: pixelated; }
.twofa-manual { margin-top: 6px; font-size: var(--fs-sm); }
.twofa-manual > summary { cursor: pointer; color: var(--brand); font-weight: 500; }
.twofa-manual[open] > summary { margin-bottom: 6px; }
#loginEnrollGroup .twofa-qr { margin: 10px auto 6px; }

/* Alliance & Acquisition: the optional overall score above the four lenses */
.quick-path-label span { font-weight: 400; color: var(--muted); font-size: var(--fs-xs); }
.bench-table th .research-sub { font-weight: 400; text-transform: none; letter-spacing: 0; }
.bench-table td.bench-reached { background: var(--brand-tint); font-weight: 700; color: var(--brand-dark); }

/* Accounts: invite state and inline name/email editing */
.invite-badge { background: var(--warning-tint); color: var(--warning-dark); }
.invite-badge.expired { background: var(--danger-tint); color: #9b1c1c; }
.accounts-table input[type="text"], .accounts-table input[type="email"] { width: 100%; min-width: 110px; padding: 4px 8px; font: inherit; }
.accounts-table .row-actions { flex-wrap: nowrap; }

/* RBIA: the Process threats panel (rbia.js) and the questionnaire's threat chips and statement tags */
.rbia-threats { margin-bottom: 30px; }
.rbia-threat-summary { font-weight: 600; margin: 8px 0 12px; }
.rbia-threat-group { border: 1px solid var(--line); border-radius: 6px; margin-bottom: 8px; background: var(--surface); }
.rbia-threat-group > summary { cursor: pointer; padding: 8px 12px; }
.rbia-threat-group > summary .muted { margin-left: 8px; }
.rbia-threat-table { margin: 0; }
.rbia-threat-table select { font-size: var(--fs-xs); padding: 3px 6px; max-width: 180px; }
.rbia-threat-all td { background: var(--surface-soft); }
.threat-chip { display: inline-block; margin-left: 10px; padding: 2px 8px; border-radius: 10px; font-size: var(--fs-xs);
    font-weight: 600; text-transform: none; letter-spacing: 0; background: var(--brand-tint); vertical-align: middle; }
.threat-chip.none { background: var(--surface-soft); color: var(--muted); font-weight: 400; }
.statement-tag { display: inline-block; margin-left: 8px; padding: 1px 6px; border-radius: 4px; font-size: var(--fs-xs);
    color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.statement-tag.scenario { border-color: var(--brand-tint); }

/* Companies: the company list, and a picked company's engagement (company-workspace.js) */
.company-directory-bar { margin-top: 4px; }
.ticker-review > div .research-sub { margin: 10px 2px 6px; }
.ticker-review table { margin-bottom: 10px; }
.company-directory td { vertical-align: top; }
.next-overdue { color: var(--danger); font-weight: 600; }
.badge.stage-badge { white-space: nowrap; }
.badge.stage-signal { background: var(--info-tint); color: var(--info-dark); }
.badge.stage-lead { background: var(--warning-tint); color: var(--warning-dark); }
.badge.stage-proposal { background: var(--accent-purple-tint); color: #7d3c98; }
.badge.stage-assessment { background: var(--brand-tint); color: var(--brand-dark); }
.badge.stage-deliverable { background: var(--success-tint); color: var(--success-dark); }
.badge.stage-past { background: var(--surface-muted); color: var(--muted); }

.workspace-head { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 18px; margin: 4px 0 12px; }
.workspace-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.workspace-title h3 { margin: 0; color: var(--ink); font-size: var(--fs-md); }
.workspace-title .link-button { margin-right: 6px; }
.ticker-edit { margin-left: auto; }
.ticker-form { padding: 12px; min-width: 240px; display: flex; flex-direction: column; gap: 8px; }
.ticker-form label { display: flex; flex-direction: column; gap: 4px; font-size: var(--fs-xs); font-weight: 600; color: var(--muted); }
.ticker-form input { padding: 6px 10px; border: 1px solid var(--line-strong); border-radius: 6px; font-size: var(--fs-base); text-transform: uppercase; }
.ticker-form .research-sub { margin: 0; }

.pipeline { list-style: none; display: flex; margin: 14px 0 10px; padding: 0; counter-reset: stage; }
.pipeline-step { flex: 1; position: relative; padding: 8px 10px 6px; border-top: 4px solid var(--line); color: var(--muted); }
.pipeline-step + .pipeline-step { margin-left: 4px; }
.pipeline-step.reached { border-top-color: var(--brand-line); color: var(--text); }
.pipeline-step.current { border-top-color: var(--brand); }
.pipeline-step.current .pipeline-label { color: var(--brand-dark); }
.pipeline-label { display: block; font-weight: 600; font-size: var(--fs-sm); }
.pipeline-detail { display: block; font-size: var(--fs-xs); color: var(--muted); }

.workspace-meta { display: flex; flex-wrap: wrap; gap: 6px 22px; align-items: center; font-size: var(--fs-sm); color: var(--text); }
.workspace-meta strong { color: var(--muted); font-weight: 600; }

.workspace-glance { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 18px; }
.glance-item { background: var(--surface-soft); border: 1px solid var(--line); border-radius: 8px; padding: 8px 14px;
    color: var(--text-soft); font-size: var(--fs-sm); cursor: pointer; }
.glance-item strong { color: var(--ink); font-size: var(--fs-md); margin-right: 2px; }
.glance-item:hover { border-color: var(--brand-line); color: var(--brand-dark); }
.workspace-subhead { margin: 0 0 8px; color: var(--ink); font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: .04em; }

.timeline { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.timeline-item { display: flex; gap: 12px; align-items: baseline; padding: 6px 0 6px 14px; position: relative; font-size: var(--fs-sm); }
.timeline-item::before { content: ''; position: absolute; left: -6px; top: 12px; width: 10px; height: 10px; border-radius: 50%;
    background: var(--surface); border: 2px solid var(--brand-line); }
.timeline-date { flex: 0 0 96px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.timeline-kind { flex: 0 0 auto; }
.timeline-signal .timeline-kind { background: var(--info-tint); color: var(--info-dark); }
.timeline-lead .timeline-kind { background: var(--warning-tint); color: var(--warning-dark); }
.timeline-proposal .timeline-kind { background: var(--accent-purple-tint); color: #7d3c98; }
.timeline-assessment .timeline-kind { background: var(--brand-tint); color: var(--brand-dark); }
.timeline-past .timeline-kind, .timeline-activity .timeline-kind { background: var(--surface-muted); color: var(--muted); }
.timeline-text { color: var(--text); }

/* ---------------------------------------------------------------- combined answers review (consensus-review.js) */
.consensus-review {
    --cr-1: #4a5fdc; --cr-2: #159483; --cr-3: #c27a10; --cr-4: #b03f8c; --cr-5: #5b7d1a; --cr-6: #7a4fd0;
    --cr-band: rgba(74, 95, 220, 0.16); --cr-flag: #b4570f; --cr-flag-tint: rgba(214, 120, 30, 0.13);
    display: flex; flex-direction: column; gap: 18px;
}
.consensus-review #consensusContent { display: flex; flex-direction: column; gap: 18px; }
.consensus-review .eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 500; }
.cr-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; }
.cr-head h2 { margin: 4px 0 0; }
.cr-head .button-row { margin: 0; }
.cr-people { display: flex; flex-wrap: wrap; gap: 8px; }
.cr-person { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 99px; padding: 4px 10px 4px 4px; }
.cr-av { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 11px; font-weight: 600; flex: none; }
.cr-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 18px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.cr-panel h3 { margin: 0; }
.cr-panel .hint { margin: 0; }
.cr-empty { align-items: flex-start; }
.cr-ph { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px; }
.cr-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.cr-stats > div { background: var(--surface); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cr-stats .v { font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; }
.cr-stats .s { font-size: 12px; color: var(--muted); }
.cr-stats .flag .v { color: var(--cr-flag); }
.cr-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 18px; }
.cr-grid.single { grid-template-columns: minmax(0, 1fr); }
.cr-grid.single .cr-ticks, .cr-grid.single .cr-row { grid-template-columns: minmax(0, 320px) minmax(0, 1fr) 56px; }
.cr-radar { width: 100%; height: auto; display: block; }
.cr-radar .cr-tick { font-size: 11px; fill: var(--muted); }
.cr-radar .cr-axis { cursor: pointer; }
.cr-radar .cr-axis-name { font-size: 13px; font-weight: 500; fill: var(--ink); }
.cr-radar .cr-axis.sel .cr-axis-name { fill: var(--brand); font-weight: 700; }
.cr-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--muted); align-items: center; }
.cr-legend i { display: inline-block; vertical-align: -1px; margin-right: 6px; }
.cr-legend .sw-band { width: 14px; height: 10px; background: var(--cr-band); border: 1px solid var(--brand-line); }
.cr-legend .sw-line { width: 16px; border-top: 2.5px solid var(--ink); }
.cr-legend .sw-dash { width: 16px; border-top: 2.5px dashed var(--ink); }
.cr-legend .cr-dot { width: 10px; height: 10px; border-radius: 50%; }
.cr-legend .cr-diamond { width: 9px; height: 9px; background: var(--ink); transform: rotate(45deg); }
.cr-ticks, .cr-row { display: grid; grid-template-columns: minmax(0, 190px) minmax(0, 1fr) 56px; gap: 12px; align-items: center; }
.cr-ticks { padding: 0 8px; font-size: 11px; color: var(--muted); }
.cr-ticks .t { position: relative; height: 14px; }
.cr-ticks .t span { position: absolute; transform: translateX(-50%); }
.cr-ticks > span:last-child { text-align: right; }
.cr-rows { display: flex; flex-direction: column; }
.cr-row { padding: 8px; border: 0; background: none; text-align: left; border-radius: 8px; width: 100%; cursor: pointer; font: inherit; color: inherit; }
.cr-row:hover, .cr-row.sel { background: var(--brand-tint); }
.cr-row.sel { box-shadow: inset 0 0 0 1px var(--brand-line); }
.cr-rname { font-size: 13px; font-weight: 500; line-height: 1.3; }
.cr-rname small { display: block; font-weight: 400; color: var(--muted); font-size: 11.5px; }
.cr-track { position: relative; height: 26px; }
.cr-track .axis { position: absolute; left: 0; right: 0; top: 50%; border-top: 1px solid var(--line); }
.cr-track .zero { position: absolute; top: 2px; bottom: 2px; border-left: 1px dashed var(--line-strong); }
.cr-track .span { position: absolute; top: 50%; height: 6px; margin-top: -3px; border-radius: 3px; background: var(--cr-band); }
.cr-track .dot { position: absolute; top: 50%; width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px; border-radius: 50%; border: 2px solid var(--surface); }
.cr-track .fin { position: absolute; top: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px; transform: rotate(45deg); background: var(--ink); border: 1.5px solid var(--surface); }
.cr-gap { text-align: right; font-variant-numeric: tabular-nums; font-size: 13px; }
.cr-group { display: flex; flex-direction: column; gap: 10px; }
.cr-group h4 { margin: 8px 0 0; }
.cr-issue { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 14px 24px; }
.cr-issue.done { border-color: var(--brand-line); }
.cr-q { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.cr-q p { margin: 0; max-width: 75ch; }
.cr-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; color: var(--muted); }
.cr-chip { display: inline-flex; font-size: 11.5px; font-weight: 500; border-radius: 99px; padding: 1px 9px; background: var(--cr-flag-tint); color: var(--cr-flag); }
.cr-answers { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.cr-ans { display: flex; flex-direction: column; gap: 1px; border-top: 3px solid; padding-top: 6px; min-width: 0; font-size: 12px; }
.cr-ans b { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cr-ans .num { font-size: 15px; font-weight: 500; font-variant-numeric: tabular-nums; }
.cr-decide { display: flex; flex-direction: column; gap: 8px; justify-content: center; border-left: 1px solid var(--line); padding-left: 20px; }
.cr-decide label { font-size: 12px; color: var(--muted); margin: 0; }
.cr-decide select { width: 100%; padding: 6px 8px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); }
.cr-pick-row { display: flex; gap: 8px; }
.cr-picker { display: flex; flex-direction: column; gap: 6px; }
.cr-decided { display: none; flex-wrap: wrap; align-items: center; gap: 8px; }
.cr-issue.done:not(.cr-editing) .cr-decided { display: flex; }
.cr-issue.done:not(.cr-editing) .cr-picker { display: none; }
.cr-final { font-size: 22px; font-weight: 600; color: var(--brand); }
.cr-final.small { font-size: 14px; }
.cr-none { color: var(--muted); border: 1px dashed var(--line-strong); border-radius: 10px; padding: 18px; text-align: center; margin: 0; }
.consensus-review .table-scroll { overflow-x: auto; }
.cr-table { min-width: 820px; }
.cr-table .cr-text { min-width: 280px; max-width: 460px; }
.cr-table .cr-cell { text-align: center; font-variant-numeric: tabular-nums; width: 72px; }
.cr-table .cr-cell.na { color: var(--muted); }
.cr-table tr.cr-cat td { background: var(--surface-soft); font-weight: 600; }
.cr-table tr.flagged td.num:nth-last-child(3) { color: var(--cr-flag); font-weight: 600; }
.cr-st { font-size: 11.5px; border-radius: 99px; padding: 1px 8px; background: var(--surface-muted); white-space: nowrap; }
.cr-st.ok { background: var(--success-tint); color: var(--success-dark); }
.cr-st.done { background: var(--brand-tint); color: var(--brand); }
.cr-st.flag { background: var(--cr-flag-tint); color: var(--cr-flag); }
.badge.consensus-badge { background: var(--brand-tint); color: var(--brand); }
@media (max-width: 1000px) { .cr-grid { grid-template-columns: minmax(0, 1fr); } .cr-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) {
    .cr-issue { grid-template-columns: minmax(0, 1fr); }
    .cr-decide { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 12px; }
    .cr-ticks, .cr-row { grid-template-columns: minmax(0, 110px) minmax(0, 1fr) 44px; }
}
