/* NUSX Design System — dark-first, flat, technical (v0.3)
   Brand: lime accent (#E4FE6C) on the claude.ai warm-grey neutral ramp
   (dark: #262624 canvas / #30302E cards / #1F1E1D sidebar; light: ivory
   #FAF9F5 canvas / white cards / #F5F4ED sidebar). PP Neue Montreal / Mono,
   served here via the spec's fallback faces (Inter + Roboto Mono).
   Old token names are aliased at the bottom so the existing markup resolves. */

/* Type — self-hosted so the app renders instantly and offline (no Google Fonts
   request). Inter (SIL OFL 1.1) + Roboto Mono (Apache-2.0) are the NUSX DS's own
   stand-ins for the licensed PP faces; files + licenses live in static/fonts/.
   The `--font-sans` / `--font-mono` stacks list the PP families first, so real
   brand faces take over the moment the drop-in block below is enabled. */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("/static/fonts/inter-400.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("/static/fonts/inter-500.woff2") format("woff2"); }
@font-face { font-family: "Roboto Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("/static/fonts/roboto-mono-400.woff2") format("woff2"); }
@font-face { font-family: "Roboto Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("/static/fonts/roboto-mono-500.woff2") format("woff2"); }

/* Drop-in for the real brand faces — buy the PP webfont license, add the woff2
   files to static/fonts/pp/, then uncomment. See static/fonts/README.md.
@font-face { font-family: "PP Neue Montreal"; font-style: normal; font-weight: 400; font-display: swap; src: url("/static/fonts/pp/PPNeueMontreal-Book.woff2") format("woff2"); }
@font-face { font-family: "PP Neue Montreal"; font-style: normal; font-weight: 500; font-display: swap; src: url("/static/fonts/pp/PPNeueMontreal-Medium.woff2") format("woff2"); }
@font-face { font-family: "PP Neue Montreal Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("/static/fonts/pp/PPNeueMontrealMono-Book.woff2") format("woff2"); }
@font-face { font-family: "PP Neue Montreal Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("/static/fonts/pp/PPNeueMontrealMono-Medium.woff2") format("woff2"); }
*/

:root {
    color-scheme: dark;

    /* ---- Main collection primitives (Yellow mode) ---- */
    --nx-accent:        #E4FE6C;
    --nx-accent-hover:  #D3EE55;

    /* ---- App Semantic · Background (Dark = default) ----
       claude.ai's warm grey ramp, elevation-ordered (bg-000 = most raised →
       bg-400 = deepest): #30302E / #262624 / #1F1E1D / #141413 / #000.
       The app canvas sits DEEP (bg-300) so the sidebar and cards read as
       raised panels above it — matching claude.ai's dark UI.
       Accent stays NUSX lime — claude.ai's orange is NOT used. */
    --bg-base:           #141413;   /* bg-300 — canvas, deepest surface */
    --bg-panel:          #1F1E1D;   /* bg-200 — flanking panels: sidebar + artifact */
    --bg-surface:        #262624;   /* bg-100 — cards, composer, drawer */
    --bg-surface-raised: rgba(255,255,255,.05);   /* claude.ai alpha-1 */
    --bg-overlay:        rgba(0,0,0,.60);
    --bg-inverse:        #FAF9F5;

    /* ---- App Semantic · Text (claude.ai ivory ramp) ---- */
    --text-primary:   #FAF9F5;
    --text-secondary: #C2C0B6;
    --text-tertiary:  #9C9A92;
    --text-disabled:  rgba(255,255,255,.35);   /* alpha-4 */
    --text-inverse:   #141413;
    --text-on-accent: #000000;
    --text-accent:    #E4FE6C;

    /* ---- App Semantic · Border ----
       claude.ai's border token is a colour composed with an alpha (it ships as
       an HSL triplet used like `border-border-300/25`). In DARK the base is the
       ivory hsl(51 16.5% 84.5%) = #DEDCD1 — a light hairline over the dark
       canvas. (The dark-ink #1F1E1D base is the LIGHT theme's; don't swap them.) */
    --border-default: rgba(222,220,209,.12);
    --border-strong:  rgba(222,220,209,.25);
    --border-focus:   #E4FE6C;

    /* ---- App Semantic · Interactive ---- */
    --interactive-accent:       #E4FE6C;
    --interactive-accent-hover: #D3EE55;
    --interactive-hover:        rgba(255,255,255,.05);   /* alpha-1 */
    --interactive-active:       rgba(255,255,255,.10);   /* alpha-2 */
    --interactive-selected:     rgba(255,255,255,.10);

    /* ---- App Semantic · Status ---- */
    --status-success: #4ADE80; --status-success-bg: rgba(74,222,128,.14);
    --status-error:   #F87171; --status-error-bg:   rgba(248,113,113,.14);
    --status-warning: #FBBF24; --status-warning-bg: rgba(251,191,36,.14);
    --status-info:    #60A5FA; --status-info-bg:    rgba(96,165,250,.14);

    /* ---- App category hues (extension — disease areas, kinds, themes) ----
       Low-chroma, tuned to read on black; each with a 14% tint background. */
    --cat-cardio: #7FB0E6; --cat-cardio-bg: rgba(127,176,230,.14);
    --cat-liver:  #E8899F; --cat-liver-bg:  rgba(232,137,159,.14);
    --cat-onco:   #F0B95E; --cat-onco-bg:   rgba(240,185,94,.14);
    --cat-renal:  #B79BE0; --cat-renal-bg:  rgba(183,155,224,.14);

    /* ---- Layout (App Layout collection) ---- */
    --space-2:2px; --space-4:4px; --space-6:6px; --space-8:8px;
    --space-12:12px; --space-16:16px; --space-20:20px; --space-24:24px;
    --space-32:32px; --space-40:40px; --space-48:48px; --space-64:64px;

    /* Radii — Tailwind's scale, which is what claude.ai uses. Controls stay on
       sm/md; card surfaces ride xl and the composer 2xl (claude.ai's rounder
       card language). Superseded NUSX's tight 2/4/8. */
    --radius-none:0; --radius-sm:2px; --radius-md:6px; --radius-lg:8px;
    --radius-xl:12px; --radius-2xl:16px; --radius-3xl:24px; --radius-pill:999px;
    --stroke-hairline:1px; --stroke-thick:1.5px;
    --control-sm:24px; --control-md:32px; --control-lg:40px;

    /* ---- Motion — claude.ai's system, verbatim ----
       Read out of the Claude desktop bundle's compiled Tailwind, not guessed:
         .transition   → cubic-bezier(0.4,0,0.2,1) @ 150ms   (the default)
         .ease-in      → cubic-bezier(0.4,0,1,1)
         .ease-in-out  → cubic-bezier(0.4,0,0.2,1)
         .ease-out     → cubic-bezier(0,0,0.2,1)             (Tailwind default)
         ease-[cubic-bezier(0.165,0.85,0.45,1)] @ 300ms      (the signature curve)
       Durations are a 100/150/200/300/500 grid — nothing in between. Hover and
       colour states are 100ms; panels/drawers are 300ms on --ease-emphasis. */
    --ease-in:       cubic-bezier(0.4, 0, 1, 1);
    --ease-out:      cubic-bezier(0, 0, 0.2, 1);
    --ease-in-out:   cubic-bezier(0.4, 0, 0.2, 1);
    --ease-emphasis: cubic-bezier(0.165, 0.85, 0.45, 1);

    --duration-100: 100ms;
    --duration-150: 150ms;
    --duration-200: 200ms;
    --duration-300: 300ms;
    --duration-500: 500ms;

    /* Overlays: claude.ai opens at 250ms ease-out and closes faster, at 125ms
       ease-in reverse — an asymmetry worth keeping. */
    --modal-animation-duration: 250ms;
    --modal-close-duration:     125ms;

    /* ---- Type (PP Neue Montreal / Mono → Inter / Roboto Mono fallback) ---- */
    --font-sans: "PP Neue Montreal", "Inter", -apple-system, "Segoe UI", sans-serif;
    --font-mono: "PP Neue Montreal Mono", "Roboto Mono", "SF Mono", ui-monospace, monospace;

    /* ============================================================
       BACK-COMPAT ALIASES — old names → NUSX tokens.
       The markup still references these; keep them mapped, not removed.
       ============================================================ */

    /* NUSX has no display serif — collapse it onto the sans face. */
    --font-serif: var(--font-sans);

    /* Backgrounds */
    --bg-raised: var(--bg-surface-raised);
    --bg-hover:  var(--interactive-hover);
    --bg-active: var(--interactive-active);

    /* Sidebar — bg-200, a step ABOVE the deep canvas (reads as a raised panel).
       Peer of the artifact panel; both ride --bg-panel. */
    --sidebar-bg:        var(--bg-panel);
    --sidebar-hover:     var(--interactive-hover);
    --sidebar-active-bg: var(--interactive-selected);
    --sidebar-active-fg: var(--text-primary);
    --sidebar-text:      var(--text-secondary);

    /* Borders */
    --border:       var(--border-default);
    --border-light: var(--border-default);

    /* Text */
    --text-muted: var(--text-tertiary);

    /* Accent — split roles: `--accent` is the text/border role (lime on dark,
       black on light for contrast); `--accent-fill` is the fill role (lime both). */
    --accent:       var(--text-accent);
    --accent-fill:  var(--interactive-accent);
    --accent-dim:   rgba(228,254,108,.12);
    --accent-hover: var(--interactive-accent-hover);

    /* Status / category colour aliases */
    --green:  var(--status-success); --green-dim:  var(--status-success-bg);
    --amber:  var(--status-warning); --amber-dim:  var(--status-warning-bg);
    --red:    var(--status-error);   --red-dim:    var(--status-error-bg);
    --sky:    var(--cat-cardio);     --sky-dim:    var(--cat-cardio-bg);
    --navy:   var(--cat-cardio);     --navy-dim:   var(--cat-cardio-bg);
    --purple: var(--cat-renal);      --purple-dim: var(--cat-renal-bg);
    --slate:  var(--text-secondary); --slate-dim:  var(--interactive-hover);
    --garnet: var(--cat-liver);

    /* Sizes */
    --sidebar-w: 220px;
    --radius-xs: 2px;

    /* Elevation — claude.ai's shadow scale, verbatim. The ambient layer rides
       --shadow-color (theme-dependent: heavier in dark); the contact layer is a
       fixed low-alpha ink. Dark values below, light overridden in [data-theme]. */
    --shadow-color:   rgba(0,0,0,.24);
    --shadow-xs:      0 1px 2px 0 rgba(11,11,11,.06);
    --shadow-sm:      0 1px 2px 0 rgba(11,11,11,.06),  0 2px 8px 0 var(--shadow-color);
    --shadow-md:      0 2px 4px 0 rgba(11,11,11,.07),  0 6px 16px 0 var(--shadow-color);
    --shadow-lg:      0 4px 8px 0 rgba(11,11,11,.08),  0 12px 28px -2px var(--shadow-color);
    --shadow-popover: 0 8px 24px rgb(0 0 0 / .32), 0 2px 6px rgb(0 0 0 / .2);
}

/* ============================================================
   LIGHT MODE — App Semantic · Light (opt-in via [data-theme="light"])
   ============================================================ */
/* Light neutrals are the claude.ai ivory ramp: canvas = bg-100 #FAF9F5,
   cards/inputs = bg-000 #FFFFFF (white lifts OFF the ivory, claude.ai-style),
   sidebar = bg-200 #F5F4ED. Text is the warm slate ramp (#141413 / #3D3D3A /
   #73726C). Accent stays Moss (lime fails contrast on light). Flat, hairline. */
:root[data-theme="light"] {
    color-scheme: light;

    --bg-base:           #FAF9F5;
    --bg-panel:          #F5F4ED;   /* bg-200 — sidebar + artifact panel */
    --bg-surface:        #FFFFFF;
    --bg-surface-raised: rgba(11,11,11,.05);   /* alpha-1 */
    --bg-overlay:        rgba(11,11,11,.50);
    --bg-inverse:        #141413;

    --text-primary:   #141413;
    --text-secondary: #3D3D3A;
    --text-tertiary:  #73726C;
    --text-disabled:  rgba(11,11,11,.35);   /* alpha-4 */
    --text-inverse:   #FAF9F5;
    --text-accent:    #3F6212;   /* Light-mode accent = Moss (Anni's pick). In light, Moss is the
                                     accent EVERYWHERE — text/border/mark AND fills (lime is dark-only). */

    /* Accent FILLS also go Moss in light, with WHITE content — moss is dark enough
       to carry white text/icons (lime needed black). Avatar, theme toggle, send
       button, primary buttons, checkboxes, and step-marks all inherit this. */
    --interactive-accent:       #3F6212;
    --interactive-accent-hover: #2E4A0D;
    --text-on-accent:           #FFFFFF;

    /* Light border base is claude.ai's dark ink hsl(30 3.3% 11.8%) = #1F1E1D,
       composed with a low alpha — the mirror of dark's ivory hairline. */
    --border-default: rgba(31,30,29,.12);
    --border-strong:  rgba(31,30,29,.25);
    --border-focus:   #3F6212;

    --interactive-hover:    rgba(11,11,11,.05);
    --interactive-active:   rgba(11,11,11,.10);
    --interactive-selected: rgba(11,11,11,.05);

    --status-success: #15803D; --status-success-bg: rgba(21,128,61,.10);
    --status-error:   #DC2626; --status-error-bg:   rgba(220,38,38,.10);
    --status-warning: #B45309; --status-warning-bg: rgba(180,83,9,.10);
    --status-info:    #1D4ED8; --status-info-bg:    rgba(29,78,216,.10);

    /* Category hues — app extension (not in the DS), darkened for white */
    --cat-cardio: #2A6BB0; --cat-cardio-bg: rgba(42,107,176,.10);
    --cat-liver:  #B03A5B; --cat-liver-bg:  rgba(176,58,91,.10);
    --cat-onco:   #9A6614; --cat-onco-bg:   rgba(154,102,20,.10);
    --cat-renal:  #6B50A8; --cat-renal-bg:  rgba(107,80,168,.10);

    /* Elevation — light shadows are far subtler than dark (claude.ai ships
       --shadow-color at gray-900/8% here vs rgba(0,0,0,.24) in dark). */
    --shadow-color:   rgba(11,11,11,.08);
    --shadow-popover: 0 8px 24px rgb(0 0 0 / .12), 0 2px 6px rgb(0 0 0 / .08);

    /* Mode-dependent aliases — wells/avatars, accent wash.
       --sidebar-bg needs no override: it resolves through --bg-panel above. */
    --bg-raised:  rgba(11,11,11,.05);
    --accent-dim: rgba(63,98,18,.10);
}

/* ============================================================
   RESET
   ============================================================ */

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

html {
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::-webkit-scrollbar        { width: 6px; height: 6px; }
::-webkit-scrollbar-track  { background: transparent; }
::-webkit-scrollbar-thumb  { background: var(--border); border-radius: var(--radius-sm); }

body {
    font-family: var(--font-sans);
    background: var(--bg-base);
    color: var(--text-secondary);
    line-height: 1.55;
    font-size: 13.5px;
    min-height: 100vh;
    display: flex;
}

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

/* Reduced motion — claude.ai ships motion-reduce:animate-none / duration-0.
   Collapse the grid to 0 rather than dropping transitions, so state changes
   still land instantly instead of being skipped. */
@media (prefers-reduced-motion: reduce) {
    :root {
        --duration-100: 0ms; --duration-150: 0ms; --duration-200: 0ms;
        --duration-300: 0ms; --duration-500: 0ms;
        --modal-animation-duration: 0ms; --modal-close-duration: 0ms;
    }
    *, *::before, *::after { animation-iteration-count: 1 !important; }
}

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }

/* ============================================================
   APP SHELL — SIDEBAR + MAIN
   ============================================================ */

/* Fixed left column (claude.ai): an in-flow flex child so the remaining panels
   size deterministically — no fixed-position + margin hack, no collapse. */
.sidebar {
    flex: 0 0 var(--sidebar-w);
    width: var(--sidebar-w);
    position: sticky;
    top: 0;
    align-self: flex-start;
    height: 100vh;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 50;
    overflow-y: auto;
    overflow-x: hidden;
}

.app-main {
    flex: 1 1 auto;
    min-width: 0;                 /* critical: let it shrink to the free space */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============================================================
   SIDEBAR INTERNALS — Specter-style light
   ============================================================ */

.sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.375rem;
    padding: 0.875rem 0.625rem 0.625rem;
}

/* NUSX wordmark — the brand logo: "NUS" in the foreground + "X" in brand lime
   (per the Figma logo node; the X stays lime in both themes). */
.sidebar-brand {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    font-family: var(--font-sans);
    font-size: 1.1rem;
    font-weight: 500;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    text-decoration: none;
    overflow: hidden;
}

.sidebar-brand-text {
    white-space: nowrap;
}

.sidebar-brand em {
    color: var(--text-accent);
    font-style: normal;
    font-weight: 500;
}

.sidebar-head-actions {
    display: inline-flex;
    gap: 0.125rem;
    flex-shrink: 0;
}

.sidebar-icon-btn {
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--duration-100) var(--ease-in-out), color var(--duration-100) var(--ease-in-out);
}

.sidebar-icon-btn svg {
    width: 14px;
    height: 14px;
}

.sidebar-icon-btn:hover {
    background: var(--bg-raised);
    color: var(--text-secondary);
}

.sidebar-search {
    margin: 0 0.75rem 0.375rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4375rem 0.625rem;
    background: var(--bg-base);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    transition: border-color var(--duration-100) var(--ease-in-out), background var(--duration-100) var(--ease-in-out);
}

.sidebar-search:focus-within {
    border-color: var(--border-focus);
    outline: var(--stroke-thick) solid var(--border-focus);
    outline-offset: -1px;
    background: var(--bg-surface);
}

.sidebar-search-icon {
    width: 13px;
    height: 13px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.sidebar-search input {
    flex: 1;
    min-width: 0;
    border: 0;
    background: transparent;
    outline: 0;
    font-family: var(--font-sans);
    font-size: 0.8125rem;
    color: var(--text-primary);
}

.sidebar-search input::placeholder {
    color: var(--text-muted);
}

.sidebar-search-kbd {
    font-family: var(--font-mono);
    font-size: 0.625rem;
    color: var(--text-muted);
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    padding: 1px 5px;
    border-radius: var(--radius-sm);
    line-height: 1.2;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.25rem 0.5rem 0.5rem;
}

.sidebar-group {
    padding: 0.375rem 0 0.25rem;
}

.sidebar-group-label {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem 0.375rem;
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.01em;
}

.sidebar-group-chevron {
    width: 11px;
    height: 11px;
    opacity: 0.7;
    flex-shrink: 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.5rem;
    border-radius: var(--radius-md);
    font-family: var(--font-mono);
    font-size: 12px;            /* App/Nav */
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--sidebar-text);
    transition: background var(--duration-100) var(--ease-in-out), color var(--duration-100) var(--ease-in-out), box-shadow var(--duration-100) var(--ease-in-out);
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
}

.nav-item:hover {
    background: var(--sidebar-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--sidebar-active-bg);
    color: var(--text-primary);
    box-shadow: inset 2px 0 0 var(--accent);
}

.nav-item .nav-icon {
    width: 16px;
    height: 16px;
    opacity: 0.85;
    flex-shrink: 0;
}

.nav-item.active .nav-icon {
    opacity: 1;
    color: var(--text-accent);
}

/* ---- Sidebar footer + theme toggle ---- */
.sidebar-foot {
    position: relative;
    padding: 0.5rem;
    border-top: var(--stroke-hairline) solid var(--border-default);
}

/* User options popover — opens from the user row, holds the theme options. */
.side-user-menu {
    position: absolute;
    left: 0.5rem; right: 0.5rem;
    bottom: calc(100% + 6px);
    background: var(--bg-surface);
    border: var(--stroke-hairline) solid var(--border-strong);
    border-radius: var(--radius-xl);
    padding: 0.4rem;
    z-index: 60;
}
.side-user-menu[hidden] { display: none; }
.side-menu-sec { display: flex; flex-direction: column; gap: 0.3rem; }
.side-menu-label {
    font-family: var(--font-mono); font-size: 10px; font-weight: 500;
    letter-spacing: 0.6px; text-transform: uppercase; color: var(--text-tertiary);
    padding: 0.15rem 0.4rem 0;
}
.side-menu-account {
    margin-top: 0.4rem; padding-top: 0.4rem;
    border-top: var(--stroke-hairline) solid var(--border);
}
.side-signout {
    display: flex; align-items: center; gap: 0.5rem; width: 100%;
    padding: 0.4rem; border-radius: var(--radius-md);
    color: var(--text-secondary); text-decoration: none;
    font-size: 13px; font-weight: 500; transition: background var(--duration-100) var(--ease-in-out), color var(--duration-100) var(--ease-in-out);
}
.side-signout:hover { background: var(--sidebar-hover); color: var(--text-primary); }
.side-signout svg { width: 15px; height: 15px; flex: none; color: var(--text-tertiary); }

/* Theme options — labelled list. Active row: accent text + soft accent wash
   (theme-uniform — lime in dark, Moss in light). */
.theme-seg { display: flex; flex-direction: column; gap: 2px; }
.theme-opt {
    display: flex; align-items: center; gap: 0.6rem; width: 100%;
    padding: 0.4rem 0.5rem; border: 0; background: transparent;
    border-radius: var(--radius-md); cursor: pointer;
    color: var(--text-secondary);
    font-family: var(--font-mono); font-size: 11px; font-weight: 500;
    letter-spacing: 0.5px; text-transform: uppercase;
    transition: background var(--duration-100) var(--ease-in-out), color var(--duration-100) var(--ease-in-out);
}
.theme-opt svg { width: 15px; height: 15px; flex: none; }
.theme-opt span { flex: 1 1 auto; text-align: left; }
.theme-opt:hover { background: var(--interactive-hover); color: var(--text-primary); }
.theme-opt.is-active { color: var(--accent); background: var(--accent-dim); }
.theme-opt:focus-visible {
    outline: var(--stroke-thick) solid var(--border-focus);
    outline-offset: -1px;
}

/* User row is a button that toggles the options popover. */
.side-user:hover { background: var(--sidebar-hover); }
.side-user-caret {
    width: 14px; height: 14px; flex: none; margin-left: auto;
    color: var(--text-tertiary); transition: transform var(--duration-150) var(--ease-in-out);
}
.side-user[aria-expanded="true"] .side-user-caret { transform: rotate(180deg); }

/* ============================================================
   PAGE CHROME
   ============================================================ */

.page-bar {
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.75rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg-surface);
    flex-shrink: 0;
}

.page-bar-title {
    font-family: var(--font-serif);
    font-size: 1.0625rem;
    font-weight: 400;
    letter-spacing: -0.01em;
    color: var(--text-primary);
}

.page-bar-meta {
    font-size: 0.6875rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.page-content {
    padding: 1.75rem;
    flex: 1;
}

/* ============================================================
   BREADCRUMB
   ============================================================ */

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}

.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--text-primary); }
.breadcrumb-sep { color: var(--border); }

/* ============================================================
   SECTION HEADER
   ============================================================ */

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.875rem;
}

.section-label {
    font-family: var(--font-mono);   /* App/Label */
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--text-tertiary);
}

/* ============================================================
   STATS ROW
   ============================================================ */

.stats-row {
    display: flex;
    gap: 1px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 1.75rem;
    background: var(--border);
}

.stat-block {
    flex: 1;
    padding: 1rem 1.25rem;
    background: var(--bg-surface);
}

.stat-val {
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 300;
    color: var(--text-primary);
    letter-spacing: -0.03em;
    line-height: 1;
}

.stat-lbl {
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-top: 0.375rem;
}

/* ============================================================
   BADGES / TAGS
   ============================================================ */

.tag {
    display: inline-flex;
    align-items: center;
    gap: 0.3125rem;
    padding: 2px 7px;
    border-radius: var(--radius-pill);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.tag-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Company type tags */
.tag-portfolio  { background: var(--green-dim);  color: var(--green); }
.tag-pipeline   { background: var(--amber-dim);  color: var(--amber); }
.tag-competitive{ background: var(--sky-dim);    color: var(--sky); }
.tag-exit-comp  { background: var(--purple-dim); color: var(--purple); }
.tag-customer   { background: var(--slate-dim);  color: var(--slate); }
.tag-unknown    { background: var(--bg-raised);  color: var(--text-muted); }

/* Person role tags */
.tag-team             { background: var(--green-dim);   color: var(--green); }
.tag-founder          { background: var(--navy-dim);    color: var(--navy); }
.tag-expert           { background: var(--purple-dim);  color: var(--purple); }
.tag-operator         { background: var(--sky-dim);     color: var(--sky); }
.tag-advisor          { background: var(--amber-dim);   color: var(--amber); }
.tag-research-mentor  { background: var(--accent-dim);  color: var(--accent); }
.tag-investor         { background: var(--slate-dim);   color: var(--slate); }
.tag-customer-role    { background: var(--slate-dim);   color: var(--slate); }

/* ============================================================
   FILTER BAR
   ============================================================ */

.filter-row {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid var(--border);
    background: var(--bg-surface);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--duration-100) var(--ease-in-out);
    text-decoration: none;
}

.filter-btn:hover {
    border-color: var(--border-strong);
    color: var(--text-primary);
    background: var(--bg-raised);
}

.filter-btn.active {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-dim);
}

/* ============================================================
   ENTITY LIST (table-row style)
   ============================================================ */

.entity-list {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-surface);
}

.entity-row {
    display: grid;
    align-items: center;
    padding: 0.6875rem 1rem;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-surface);
    transition: background var(--duration-100) var(--ease-in-out);
    text-decoration: none;
    color: inherit;
}

.entity-row:last-child { border-bottom: none; }
.entity-row:hover { background: var(--bg-raised); }

.company-row { grid-template-columns: 32px 1fr auto auto 70px 70px; gap: 0.75rem; }
.person-row  { grid-template-columns: 32px 1fr auto 90px 70px; gap: 0.75rem; }

.entity-row-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.entity-row-sub {
    font-size: 0.6875rem;
    color: var(--text-muted);
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.entity-row-count {
    font-size: 0.6875rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
    text-align: right;
}

.entity-row-cell {
    min-width: 0;
    max-width: 16rem;
    font-size: 0.78rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.entity-list-header {
    display: grid;
    align-items: center;
    padding: 0.5rem 1rem;
    background: var(--bg-base);
    border-bottom: 1px solid var(--border);
    font-size: 0.5625rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.company-list-header { grid-template-columns: 32px 1fr auto auto 70px 70px; gap: 0.75rem; }
.person-list-header  { grid-template-columns: 32px 1fr auto 90px 70px; gap: 0.75rem; }
.ip-list-header      { grid-template-columns: 32px 1fr auto 140px 90px; gap: 0.75rem; }
.ip-row              { grid-template-columns: 32px 1fr auto 140px 90px; gap: 0.75rem; }

.ip-kind-mark {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    line-height: 1;
    background: var(--bg-surface);
}

/* ============================================================
   AVATAR
   ============================================================ */

.avatar {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    background: var(--bg-raised);
    border: 1px solid var(--border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.625rem;
    font-weight: 700;
    color: var(--text-muted);
    flex-shrink: 0;
}

.avatar-circle { border-radius: 50%; }

/* ============================================================
   DETAIL HERO
   ============================================================ */

.entity-hero {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.5rem;
}

.entity-hero-avatar {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    background: var(--bg-raised);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-serif);
    font-size: 1.375rem;
    font-weight: 400;
    color: var(--text-muted);
    flex-shrink: 0;
}

.entity-hero-body { flex: 1; min-width: 0; }

.entity-hero-name {
    font-family: var(--font-serif);
    font-size: 1.75rem;
    font-weight: 300;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin-bottom: 0.375rem;
}

.entity-hero-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.entity-hero-desc {
    margin-top: 0.625rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.65;
    max-width: 60ch;
}

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

.tab-strip {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.5rem;
}

.tab-btn {
    padding: 0.5rem 0.875rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color var(--duration-100) var(--ease-in-out), border-color var(--duration-100) var(--ease-in-out);
    cursor: pointer;
}

.tab-btn:hover { color: var(--text-secondary); }
.tab-btn.active { color: var(--text-primary); font-weight: 600; border-bottom-color: var(--accent); }

.tab-count {
    font-size: 0.6875rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
    margin-left: 5px;
    background: var(--bg-raised);
    padding: 1px 5px;
    border-radius: var(--radius-pill);
}

/* ============================================================
   TIMELINE
   ============================================================ */

.timeline { display: flex; flex-direction: column; }

.tl-item {
    display: grid;
    grid-template-columns: 1.75rem 1fr;
    gap: 0.75rem;
    position: relative;
    padding-bottom: 1.25rem;
}

.tl-item:not(:last-child)::after {
    content: "";
    position: absolute;
    left: 0.8125rem;
    top: 1.625rem;
    bottom: 0;
    width: 1px;
    background: var(--border);
}

.tl-dot {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    background: var(--bg-surface);
    border: 1.5px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.5625rem;
    font-weight: 700;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.tl-body { min-width: 0; padding-top: 0.1875rem; }

.tl-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.25rem;
}

.tl-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
    min-width: 0;
}

.tl-title a { color: var(--text-primary); }
.tl-title a:hover { color: var(--text-primary); }

.tl-meta {
    display: flex;
    gap: 0.75rem;
    font-size: 0.6875rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
    margin-bottom: 0.25rem;
}

.tl-summary {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.55;
    max-width: 65ch;
}

/* ============================================================
   METRICS
   ============================================================ */

.metrics-band {
    display: flex;
    gap: 1px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin: 1rem 0;
    background: var(--border);
}

.metric-cell {
    flex: 1;
    background: var(--bg-surface);
    padding: 0.75rem 1rem;
}

.metric-val {
    font-family: var(--font-serif);
    font-size: 1.375rem;
    font-weight: 300;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    line-height: 1;
}

.metric-key {
    font-size: 0.5625rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-top: 0.3125rem;
}

/* ============================================================
   TWO-COLUMN LAYOUT
   ============================================================ */

.two-col {
    display: grid;
    grid-template-columns: 1fr 272px;
    gap: 1.5rem;
    align-items: start;
}

.info-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 1rem 1.125rem;
}

.info-card + .info-card { margin-top: 0.75rem; }

.info-card-label {
    font-size: 0.5625rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.3125rem 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.8125rem;
}

.info-row:last-child { border-bottom: none; }
.info-row-key { color: var(--text-muted); flex-shrink: 0; }
.info-row-val { color: var(--text-primary); font-weight: 500; text-align: right; }

/* ============================================================
   CHIPS
   ============================================================ */

.chips { display: flex; flex-wrap: wrap; gap: 0.375rem; }

.chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: border-color var(--duration-100) var(--ease-in-out), color var(--duration-100) var(--ease-in-out);
}

.chip:hover { border-color: var(--border-strong); color: var(--text-primary); }

/* ============================================================
   ARTIFACT ROWS
   ============================================================ */

.artifact-row {
    display: flex;
    gap: 0.875rem;
    padding: 0.75rem 1rem;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-light);
    transition: background var(--duration-100) var(--ease-in-out);
}

.artifact-row:last-child { border-bottom: none; }
.artifact-row:hover { background: var(--bg-raised); }

.artifact-id {
    font-size: 0.6875rem;
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
    padding-top: 2px;
    min-width: 2.5rem;
}

.artifact-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.artifact-meta {
    display: flex;
    gap: 0.75rem;
    font-size: 0.6875rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
    margin-top: 2px;
}

/* ============================================================
   ACTIVITY FEED
   ============================================================ */

.activity-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.activity-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.75rem;
    align-items: start;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-light);
    transition: background var(--duration-100) var(--ease-in-out);
}

.activity-item:last-child { border-bottom: none; }
.activity-item:hover { background: var(--bg-raised); }

.activity-icon {
    width: 1.875rem;
    height: 1.875rem;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6875rem;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 1px;
}

.activity-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.activity-sub {
    font-size: 0.6875rem;
    color: var(--text-muted);
    margin-top: 2px;
    font-family: var(--font-mono);
}

.activity-date {
    font-size: 0.6875rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
    white-space: nowrap;
    padding-top: 3px;
}

/* ============================================================
   MINI TABLE
   ============================================================ */

.mini-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
}

.mini-table th {
    font-size: 0.5625rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 0.375rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

.mini-table td {
    padding: 0.4375rem 0.75rem;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

.mini-table tr:last-child td { border-bottom: none; }
.mini-table tbody tr:hover td { background: var(--bg-raised); }
.mini-table a { font-weight: 500; color: var(--text-primary); }
.mini-table a:hover { color: var(--text-primary); }

.cell-muted { color: var(--text-muted); font-family: var(--font-mono); font-size: 0.6875rem; }

/* ============================================================
   WARMEST CONNECTION
   ============================================================ */

.warmest-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4375rem 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.8125rem;
}

.warmest-row:last-child { border-bottom: none; }
.warmest-name { font-weight: 500; color: var(--text-primary); }
.warmest-count { font-family: var(--font-mono); font-size: 0.6875rem; color: var(--text-muted); }

/* ============================================================
   WORKFLOW PLACEHOLDER
   ============================================================ */

.workflow-placeholder {
    max-width: 580px;
    margin: 4rem auto;
    text-align: center;
}

.workflow-icon-lg {
    font-size: 2.25rem;
    margin-bottom: 1rem;
    opacity: 0.4;
}

.workflow-ph-title {
    font-family: var(--font-serif);
    font-size: 1.75rem;
    font-weight: 300;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.workflow-ph-desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.65;
    margin-bottom: 1.75rem;
    max-width: 50ch;
    margin-left: auto;
    margin-right: auto;
}

.coming-soon-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 1.25rem 1.5rem;
    text-align: left;
}

.coming-soon-label {
    font-size: 0.5625rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.875rem;
}

.coming-soon-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.coming-soon-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.coming-soon-list li::before {
    content: "→";
    color: var(--accent);
    font-weight: 700;
    flex-shrink: 0;
}

/* ============================================================
   UTILITY
   ============================================================ */

.mono { font-family: var(--font-mono); }
.text-primary   { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted     { color: var(--text-muted); }
.text-accent    { color: var(--accent); }
.fw-600         { font-weight: 600; }

.empty {
    text-align: center;
    padding: 3rem 1rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* ============================================================
   v2 — KICKER / KB-INTRO / SIDEBAR GROUPS / INTELLIGENCE LAYER
   ============================================================ */

.kicker {
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent);
    font-weight: 500;
}

.kicker-muted { color: var(--text-muted); }

/* Sidebar group — two-group layout */
.sidebar-group-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.375rem 0.625rem 0.4375rem;
    margin-bottom: 0.125rem;
}

.sidebar-group + .sidebar-group { margin-top: 0.75rem; }

.sidebar-group-kicker {
    font-family: var(--font-mono);
    font-size: 0.625rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
}

.sidebar-group-count {
    font-family: var(--font-mono);
    font-size: 0.625rem;
    color: var(--text-muted);
    background: var(--bg-raised);
    padding: 1px 5px;
    border-radius: var(--radius-pill);
}

.nav-item-workflow {
    padding-left: 0.875rem;
}

.nav-workflow-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
    display: inline-block;
    margin-right: 0.125rem;
}

/* Workflow run button + post-run banner */
.run-form {
    display: inline;
    margin-left: 0.75rem;
}

.btn-run {
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--accent);
    background: var(--bg-base);
    border: 1px solid var(--accent);
    border-radius: var(--radius-sm);
    padding: 0.25rem 0.625rem;
    cursor: pointer;
    transition: background var(--duration-100) var(--ease-in-out), color var(--duration-100) var(--ease-in-out);
}

.btn-run:hover {
    background: var(--accent);
    color: var(--bg-base);
}

.run-banner {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 0.875rem;
    margin-bottom: 1rem;
    background: var(--accent-dim);
    border: 1px solid rgba(45, 106, 79, 0.18);
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.run-banner-check {
    color: var(--accent);
    font-weight: 600;
}

.run-banner a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* KB intro blurb */
.kb-intro {
    max-width: 64ch;
    margin-bottom: 1.5rem;
}

.kb-intro .kicker { margin-bottom: 0.5rem; display: block; }

.kb-intro-deck {
    font-family: var(--font-serif);
    font-weight: 400;
    font-style: italic;
    font-size: 1rem;
    line-height: 1.55;
    color: var(--text-secondary);
    letter-spacing: -0.005em;
}

/* Intelligence landing */
.intel-intro { max-width: 64ch; margin-bottom: 2rem; }
.intel-intro .kicker { margin-bottom: 0.625rem; display: block; }

.intel-intro-title {
    font-family: var(--font-serif);
    font-weight: 300;
    font-size: 2.25rem;
    line-height: 1.05;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.intel-intro-title em {
    font-style: italic;
    font-weight: 400;
    color: var(--accent);
}

.intel-intro-deck {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--text-secondary);
    max-width: 60ch;
}

/* Workflow detail hero */
.workflow-hero {
    --wf-color: var(--accent);
    position: relative;
    padding: 1.75rem 2rem 1.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    background: var(--bg-surface);
    margin-bottom: 0.5rem;
    overflow: hidden;
}

.workflow-hero::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--wf-color);
}

.workflow-hero-kicker {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.625rem;
}

.workflow-hero-title {
    font-family: var(--font-serif);
    font-weight: 300;
    font-size: 2rem;
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.workflow-hero-blurb {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--text-secondary);
    max-width: 66ch;
    margin-bottom: 1.25rem;
}

.workflow-hero-meta {
    display: flex;
    gap: 2rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.workflow-hero-meta-row {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.8125rem;
    color: var(--text-primary);
}

/* Buttons */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.4375rem 0.875rem 0.4375rem 1rem;
    background: var(--accent-fill);
    color: var(--text-on-accent);
    border: 0;
    border-radius: var(--radius-md);
    font-family: var(--font-mono);
    font-size: 13px;            /* App/Button */
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: background var(--duration-100) var(--ease-in-out), opacity var(--duration-100) var(--ease-in-out);
}

.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }

/* ============================================================
   DS FORM CONTROLS — Checkbox, Switch (App DS · Components)
   The DS ships these alongside Button/Input/Badge/Tab. Native
   controls inherit the accent; the classes below match Figma
   exactly (checked = accent fill + black glyph; on = accent
   track + black thumb) for any form surface that needs them.
   ============================================================ */

/* Native checkbox/radio/range pick up the brand accent automatically */
:root { accent-color: var(--accent-fill); }

/* Checkbox — accent fill + black check when checked */
.nusx-check {
    appearance: none; -webkit-appearance: none;
    width: 16px; height: 16px; flex: none; margin: 0;
    background: var(--bg-surface);
    border: var(--stroke-hairline) solid var(--border-default);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: inline-grid; place-content: center;
    transition: background var(--duration-100) var(--ease-in-out), border-color var(--duration-100) var(--ease-in-out);
}
.nusx-check::before {
    content: ""; width: 10px; height: 10px; transform: scale(0);
    transition: transform var(--duration-100) var(--ease-in-out);
    background: var(--text-on-accent);
    clip-path: polygon(41% 74%, 84% 22%, 92% 30%, 41% 92%, 8% 56%, 16% 48%);
}
.nusx-check:checked { background: var(--accent-fill); border-color: var(--accent-fill); }
.nusx-check:checked::before { transform: scale(1); }
.nusx-check:focus-visible { outline: var(--stroke-thick) solid var(--border-focus); outline-offset: 2px; }

/* Switch — accent track + black thumb when on. Track reflects the
   host's [aria-checked] or an ancestor state (see theme toggle). */
.nusx-switch {
    position: relative; flex: none;
    width: 34px; height: 20px; border-radius: var(--radius-pill);
    background: var(--bg-raised);
    border: var(--stroke-hairline) solid var(--border-default);
    transition: background var(--duration-150) var(--ease-in-out), border-color var(--duration-150) var(--ease-in-out);
}
.nusx-switch-thumb {
    position: absolute; top: 2px; left: 2px;
    width: 14px; height: 14px; border-radius: 50%;
    background: var(--text-tertiary);
    transition: transform var(--duration-150) var(--ease-in-out), background var(--duration-150) var(--ease-in-out);
}
[aria-checked="true"] .nusx-switch,
.nusx-switch.is-on {
    background: var(--accent-fill); border-color: transparent;
}
[aria-checked="true"] .nusx-switch-thumb,
.nusx-switch.is-on .nusx-switch-thumb {
    transform: translateX(14px); background: var(--text-on-accent);
}

.btn-primary-kbd {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.15);
    padding: 1px 6px;
    border-radius: var(--radius-sm);
    opacity: 0.8;
}

.workflow-run-btn { margin-top: 0.25rem; }

/* Feed filters */
.feed-filters {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-light);
}
.feed-filter {
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 500;
    padding: 0.35rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    background: var(--bg-surface);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--duration-150) var(--ease-in-out);
}
.feed-filter:hover {
    background: var(--bg-hover);
}
.feed-filter.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* Signal feed */
.signal-feed,
.signal-list {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.signal-card {
    --wf-color: var(--accent);
    position: relative;
    padding: 1rem 1.125rem 0.9375rem 1.25rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    transition: border-color var(--duration-100) var(--ease-in-out), box-shadow var(--duration-100) var(--ease-in-out);
}

.signal-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--wf-color);
    opacity: 0.85;
}

.signal-card:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-sm);
}

/* Internal event signal cards */
.signal-card-internal {
    border-left: 3px solid var(--accent);
    background: linear-gradient(90deg, var(--accent-dim) 0%, transparent 120px);
}
.signal-card-internal .signal-dot {
    opacity: 0.7;
}

.signal-card-head {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.signal-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    display: inline-block;
}

.signal-card-time {
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    color: var(--text-muted);
}

.signal-card-title {
    font-family: var(--font-serif);
    font-size: 1.125rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    margin-bottom: 0.375rem;
    line-height: 1.25;
}

.signal-card-summary {
    font-size: 0.8125rem;
    line-height: 1.55;
    color: var(--text-secondary);
    max-width: 72ch;
    margin-bottom: 0.75rem;
}

.signal-card-theme {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.625rem;
}

.signal-card-touched {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    flex-wrap: wrap;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-light);
}

.touched-label {
    flex-shrink: 0;
    padding-top: 4px;
}

.touched-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3125rem;
    flex: 1;
}

/* KB chips — colored per knowledge base */
.kb-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3125rem;
    padding: 2px 8px 2px 4px;
    border-radius: var(--radius-pill);
    font-size: 0.6875rem;
    font-weight: 500;
    background: var(--bg-raised);
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    max-width: 26rem;
    text-decoration: none;
    transition: border-color var(--duration-100) var(--ease-in-out), color var(--duration-100) var(--ease-in-out), background var(--duration-100) var(--ease-in-out);
}

.kb-chip:hover {
    border-color: var(--border-strong);
    color: var(--text-primary);
    background: var(--bg-surface);
}

.kb-chip-kind {
    font-family: var(--font-mono);
    font-size: 0.5625rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    padding: 1px 5px;
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    color: var(--text-muted);
}

.kb-chip-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kb-chip-ip         .kb-chip-kind { color: var(--cat-renal);  border-color: transparent; background: var(--cat-renal-bg); }
.kb-chip-companies  .kb-chip-kind { color: var(--cat-cardio); border-color: transparent; background: var(--cat-cardio-bg); }
.kb-chip-people     .kb-chip-kind { color: var(--green);      border-color: transparent; background: var(--green-dim); }
.kb-chip-investors  .kb-chip-kind { color: var(--cat-onco);   border-color: transparent; background: var(--cat-onco-bg); }

.signal-card-body { margin-top: 0.75rem; }
.signal-card-body summary {
    cursor: pointer;
    list-style: none;
    outline: none;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0;
}

.signal-card-body summary::-webkit-details-marker { display: none; }
.signal-card-body summary::after {
    content: "▸";
    font-size: 0.625rem;
    color: var(--text-muted);
    transition: transform var(--duration-150) var(--ease-in-out);
    display: inline-block;
}

.signal-card-body[open] summary::after { transform: rotate(90deg); }

.signal-card-body-md {
    white-space: pre-wrap;
    font-family: var(--font-serif);
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--text-secondary);
    padding: 0.75rem 0.25rem 0.25rem;
    margin: 0;
    max-width: 70ch;
}

/* ============================================================
   v2 — IP / PAPER ROWS & DETAIL
   ============================================================ */

/* Override existing column grids to match new schemas */
.company-list-header { grid-template-columns: 32px 1fr auto auto auto 60px 60px; gap: 0.75rem; }
.company-row         { grid-template-columns: 32px 1fr auto auto auto 60px 60px; gap: 0.75rem; }

.person-list-header  { grid-template-columns: 32px 1fr auto 1fr 70px 70px; gap: 0.75rem; }
.person-row          { grid-template-columns: 32px 1fr auto 1fr 70px 70px; gap: 0.75rem; }

.paper-list-header   { grid-template-columns: 32px 1fr 1fr auto 50px 100px 60px; gap: 0.75rem; }
.paper-row           { grid-template-columns: 32px 1fr 1fr auto 50px 100px 60px; gap: 0.75rem; }

.investor-list-header { grid-template-columns: 32px 1fr auto auto auto 90px; gap: 0.75rem; }
.investor-row         { grid-template-columns: 32px 1fr auto auto auto 90px; gap: 0.75rem; }

/* Theme marks (small chip on the left of each paper row) */
.paper-mark {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    font-family: var(--font-mono);
    background: var(--bg-surface);
}

.mark-theme-quantum    { color: var(--cat-renal);  border-color: var(--cat-renal-bg); }
.mark-theme-biomedical { color: var(--cat-liver);  border-color: var(--cat-liver-bg); }
.mark-theme-ai         { color: var(--cat-cardio); border-color: var(--cat-cardio-bg); }
.mark-theme-materials  { color: var(--cat-onco);   border-color: var(--cat-onco-bg); }

/* Theme tags */
.tag-theme-quantum    { background: var(--cat-renal-bg);  color: var(--cat-renal); }
.tag-theme-biomedical { background: var(--cat-liver-bg);  color: var(--cat-liver); }
.tag-theme-ai         { background: var(--cat-cardio-bg); color: var(--cat-cardio); }
.tag-theme-materials  { background: var(--cat-onco-bg);   color: var(--cat-onco); }

/* Licensing pill */
.pill {
    display: inline-flex;
    align-items: center;
    padding: 1px 7px;
    border-radius: var(--radius-pill);
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
    border: 1px solid transparent;
}

.pill-available  { background: var(--green-dim);  color: var(--green);  border-color: rgba(45, 106, 79, 0.25); }
.pill-licensed   { background: var(--amber-dim);  color: var(--amber);  border-color: rgba(160, 112, 32, 0.25); }
.pill-spun-out   { background: var(--navy-dim);   color: var(--navy);   border-color: rgba(61, 90, 128, 0.25); }

/* Paper detail hero */
.paper-hero {
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.5rem;
}

.paper-hero .kicker { display: block; margin-bottom: 0.625rem; }

.paper-hero-title {
    font-family: var(--font-serif);
    font-weight: 400;
    font-size: 2rem;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin-bottom: 0.625rem;
    max-width: 48rem;
}

.paper-hero-authors {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    margin-bottom: 0.375rem;
    font-family: var(--font-serif);
    font-weight: 400;
    font-style: italic;
}

.paper-hero-meta {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    font-size: 0.8125rem;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.paper-abstract {
    font-family: var(--font-serif);
    font-size: 1rem;
    line-height: 1.65;
    color: var(--text-secondary);
    max-width: 68ch;
    margin-bottom: 1.5rem;
}

/* Linked entity cards (used in right-column info cards) */
.linked-entity {
    display: block;
    padding: 0.5rem 0.625rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: border-color var(--duration-100) var(--ease-in-out), background var(--duration-100) var(--ease-in-out);
}

.linked-entity + .linked-entity { margin-top: 0.375rem; }

.linked-entity:hover {
    border-color: var(--border-strong);
    background: var(--bg-raised);
}

.linked-entity-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.linked-entity-sub {
    font-size: 0.6875rem;
    color: var(--text-muted);
    display: flex;
    gap: 0.375rem;
    align-items: center;
    flex-wrap: wrap;
}

/* Rounds table (investor detail) */
.rounds-table {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-surface);
}

.rounds-header, .rounds-row {
    display: grid;
    grid-template-columns: 1.5fr 0.8fr 1fr 0.8fr 0.6fr;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    align-items: center;
}

.rounds-header {
    font-size: 0.5625rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    background: var(--bg-base);
    border-bottom: 1px solid var(--border);
}

.rounds-row {
    border-bottom: 1px solid var(--border-light);
    font-size: 0.8125rem;
}

.rounds-row:last-child { border-bottom: none; }

/* Company type tag additions (new type vocabulary) */
.tag-incubated    { background: var(--green-dim); color: var(--green); }
.tag-market-watch { background: var(--sky-dim);   color: var(--sky); }
.tag-exit         { background: var(--purple-dim); color: var(--purple); }

/* Person role tag additions */
.tag-researcher { background: var(--accent-dim); color: var(--accent); }


/* Make signal-card title a clickable link without re-styling the headline */
.signal-card-title-link { color: inherit; text-decoration: none; }
.signal-card-title-link:hover { color: var(--text-primary); }

@media (max-width: 900px) {
    /* .sidebar becomes an off-canvas drawer — see the MOBILE section at the
       end of this file (it needs to cascade after the app-shell rules). */
    .two-col { grid-template-columns: 1fr; }
    .rounds-header, .rounds-row { grid-template-columns: 1fr; gap: 0.25rem; }
}

/* ============================================================
   DECK EXTENSIONS
   Tokens, typography, and component classes ported from
   pitch-deck/deck.css for hero moments and document polish.
   New classes only — existing classes (.card, .tag, .pill,
   .entity-hero, .section-label, etc.) are preserved.
   ============================================================ */

:root {
    /* Navy ramp */
    --navy-50:  #F0F3F8;
    --navy-100: #D9E2EE;
    --navy-200: #B3C5DD;
    --navy-300: #8DA8CC;
    --navy-400: #678BBB;
    --navy-500: #3D5A80;
    --navy-600: #314868;
    --navy-700: #253650;
    --navy-800: #192438;
    --navy-900: #0C1A2A;

    /* Green ramp */
    --green-50:  #F0F7F4;
    --green-100: #D4E8DC;
    --green-200: #A8D1BA;
    --green-300: #7DBA97;
    --green-400: #519275;
    --green-500: #2D6A4F;
    --green-600: #245540;
    --green-700: #1B4030;
    --green-800: #122B20;

    /* Cream ramp */
    --cream-50:  #FAFAF7;
    --cream-100: #F5F2ED;
    --cream-200: #EDEAE4;
    --cream-300: #E0DCD4;
    --cream-400: #C9C4BA;
    --cream-500: #B0AAA0;

    /* Dark hero surface — a step off the canvas, still flat */
    --bg-inverse: #0F0F0F;

    /* Elevation stays flat under NUSX — keep the extended aliases null. */
    --shadow-xs: none;
    --shadow-xl: none;

    /* Warning accent (quote highlights, flagged content) */
    --warning-500: var(--status-warning);

    /* The deck-ported components use the light ramp steps as surfaces/borders.
       Remap those steps to theme-aware semantic tokens so they read correctly
       on the dark canvas (and stay correct when [data-theme="light"] flips them). */
    --cream-50:  var(--bg-base);
    --cream-100: var(--bg-surface);
    --cream-200: var(--border-default);
    --cream-300: var(--border-default);
    --cream-400: var(--text-tertiary);
    --cream-500: var(--text-tertiary);
    --navy-50:   var(--bg-surface);
    --green-50:  var(--bg-surface);
}

/* ------------------------------------------------------------
   Editorial type scale
   ------------------------------------------------------------ */

.text-headline {
    font-family: var(--font-serif);
    font-size: clamp(2rem, 4.5vw, 2.75rem);
    font-weight: 400;
    line-height: 1.15;
    letter-spacing: -0.015em;
    color: var(--text-primary);
}

.text-section-title {
    font-family: var(--font-serif);
    font-size: clamp(1.375rem, 2.6vw, 1.75rem);
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: -0.01em;
    color: var(--text-primary);
}

.text-label {
    font-family: var(--font-sans);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.text-overline {
    font-family: var(--font-sans);
    font-size: 0.6875rem;
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.text-overline-accent {
    color: var(--accent);
}

/* ------------------------------------------------------------
   Elevated and dark-surface cards
   ------------------------------------------------------------ */

.card-elevated {
    background: var(--bg-surface);
    border: 1px solid var(--cream-200);
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    transition: transform var(--duration-200) var(--ease-out), box-shadow var(--duration-200) var(--ease-out);
}

.card-elevated:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.card-dark {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 0.75rem;
    padding: 1.5rem;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--text-primary);
}

/* ------------------------------------------------------------
   Deck-aligned badges (complement existing .tag/.pill)
   ------------------------------------------------------------ */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-family: var(--font-sans);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-pill);
    border: 1px solid transparent;
    white-space: nowrap;
}

.badge-navy {
    background: var(--navy-50);
    color: var(--navy-700);
    border-color: var(--navy-100);
}

.badge-green {
    background: var(--green-50);
    color: var(--green-700);
    border-color: var(--green-100);
}

.badge-cream {
    background: var(--bg-surface);
    color: var(--text-secondary);
    border-color: var(--border-default);
}

.badge-warning {
    background: var(--status-warning-bg);
    color: var(--status-warning);
    border-color: transparent;
}

/* ------------------------------------------------------------
   Grid utilities
   ------------------------------------------------------------ */

.grid-2 { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
.grid-4 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }

@media (min-width: 768px) {
    .grid-2 { grid-template-columns: 1fr 1fr; gap: 2rem; }
    .grid-3 { grid-template-columns: repeat(3, 1fr); gap: 2rem; }
    .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

/* ------------------------------------------------------------
   Eyebrow row — overline + optional section title pair
   ------------------------------------------------------------ */

.eyebrow-pair {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    margin-bottom: 1.5rem;
}

.eyebrow-pair .text-overline { margin: 0; }

/* ------------------------------------------------------------
   Hero entity uplift
   ------------------------------------------------------------ */

.entity-hero.entity-hero-polished .entity-hero-name {
    font-family: var(--font-serif);
    font-size: clamp(2rem, 4vw, 2.5rem);
    font-weight: 400;
    letter-spacing: -0.015em;
    line-height: 1.1;
}

.entity-hero.entity-hero-polished .entity-hero-desc {
    font-size: 1rem;
    line-height: 1.55;
    color: var(--text-secondary);
    max-width: 72ch;
}

.entity-hero-overline {
    font-family: var(--font-sans);
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.625rem;
}

/* ------------------------------------------------------------
   Artifact pages — signal detail views
   (email digest, cohort report, intro pack, opportunity brief)
   ------------------------------------------------------------ */

.artifact-header {
    margin: 0.5rem 0 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-default);
}

.artifact-title {
    font-family: var(--font-serif);
    font-weight: 400;
    font-size: clamp(1.5rem, 2.2vw, 1.875rem);
    line-height: 1.2;
    letter-spacing: -0.015em;
    color: var(--text-primary);
    margin: 0 0 0.625rem;
}

.artifact-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.artifact-meta-sep { color: var(--border-light); }

.artifact-summary {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin: 0 0 1.75rem;
    max-width: 72ch;
}

.artifact-section {
    margin-top: 1.75rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-default);
}

.artifact-section:first-of-type { border-top: none; padding-top: 0; }

.artifact-section .section-label {
    display: block;
    margin-bottom: 0.875rem;
    font-family: var(--font-sans);
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.artifact-prose {
    font-size: 0.9375rem;
    line-height: 1.65;
    color: var(--text-primary);
    max-width: 72ch;
}

.artifact-prose p { margin: 0 0 0.875rem; }
.artifact-prose p:last-child { margin-bottom: 0; }
.artifact-prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.artifact-prose strong { font-weight: 600; color: var(--text-primary); }
.artifact-prose ul, .artifact-prose ol { margin: 0 0 0.875rem 1.25rem; padding: 0; }
.artifact-prose li { margin-bottom: 0.375rem; }

/* Links section (email digest) */
.artifact-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.artifact-links li {
    display: flex;
    align-items: baseline;
    gap: 0.625rem;
    font-size: 0.875rem;
    line-height: 1.5;
}

.artifact-link-tag {
    display: inline-block;
    font-family: var(--font-sans);
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    background: var(--bg-raised);
    border: 1px solid var(--cream-300);
    padding: 0.125rem 0.375rem;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    min-width: 2.5rem;
    text-align: center;
}

.artifact-link-tag-co { color: var(--navy); }

.artifact-links a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px dotted var(--border-light);
}

.artifact-links a:hover {
    color: var(--text-primary);
    border-bottom-color: var(--text-primary);
}

.artifact-link-sub { color: var(--text-muted); font-size: 0.8125rem; }

/* Chips (people/companies/investors references) */
.artifact-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.artifact-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.3125rem 0.625rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-primary);
    background: var(--bg-raised);
    border: 1px solid var(--cream-300);
    border-radius: var(--radius-pill);
    text-decoration: none;
    transition: background var(--duration-100) var(--ease-in-out), border-color var(--duration-100) var(--ease-in-out);
}

.artifact-chip:hover {
    background: var(--cream-100);
    border-color: var(--border-strong);
    color: var(--text-primary);
}

.artifact-chip-inv {
    color: var(--navy);
    border-color: var(--navy);
    background: transparent;
}

.artifact-chip-inv:hover {
    background: var(--navy);
    color: #fff;
    border-color: var(--navy);
}

/* IP list (opportunity brief) */
.artifact-ip-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.artifact-ip-row {
    display: flex;
    gap: 0.875rem;
    padding: 0.875rem 1rem;
    background: var(--bg-raised);
    border: 1px solid var(--cream-300);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: inherit;
    transition: border-color var(--duration-100) var(--ease-in-out), transform var(--duration-100) var(--ease-in-out);
}

.artifact-ip-row:hover {
    border-color: var(--border-strong);
    transform: translateY(-1px);
}

.artifact-ip-body { flex: 1; min-width: 0; }

.artifact-ip-title {
    font-weight: 600;
    font-size: 0.9375rem;
    line-height: 1.35;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.artifact-ip-authors {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.artifact-ip-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* People grid (opportunity brief) */
.artifact-people-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.75rem;
}

.artifact-person-card {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    padding: 0.75rem 0.875rem;
    background: var(--bg-raised);
    border: 1px solid var(--cream-300);
    border-radius: var(--radius-xl);
    text-decoration: none;
    color: inherit;
    transition: border-color var(--duration-100) var(--ease-in-out);
}

.artifact-person-card:hover { border-color: var(--border-strong); }

.artifact-person-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.artifact-person-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.artifact-person-title {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Cohort grid (cohort report) */
.artifact-cohort-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0.75rem;
}

.artifact-cohort-card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.875rem 1rem;
    background: var(--bg-raised);
    border: 1px solid var(--cream-300);
    border-radius: var(--radius-xl);
    text-decoration: none;
    color: inherit;
    transition: border-color var(--duration-100) var(--ease-in-out), transform var(--duration-100) var(--ease-in-out);
}

.artifact-cohort-card:hover {
    border-color: var(--border-strong);
    transform: translateY(-1px);
}

.artifact-cohort-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.artifact-cohort-name {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--text-primary);
}

.artifact-cohort-line {
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--text-secondary);
    margin: 0;
}

.artifact-cohort-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Target (intro pack) */
.artifact-target {
    display: grid;
    gap: 0.5rem;
}

.artifact-target-card {
    padding: 0.875rem 1rem;
    background: var(--bg-raised);
    border: 1px solid var(--cream-300);
    border-radius: var(--radius-xl);
    text-decoration: none;
    color: inherit;
    transition: border-color var(--duration-100) var(--ease-in-out);
}

.artifact-target-card:hover { border-color: var(--border-strong); }

.artifact-target-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.artifact-target-line {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Ranked people list (intro pack) */
.artifact-people-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    counter-reset: none;
}

.artifact-person-row {
    display: flex;
    align-items: stretch;
    gap: 0.75rem;
}

.artifact-person-rank {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 2rem;
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--bg-raised);
    border: 1px solid var(--cream-300);
    border-radius: var(--radius-md);
}

.artifact-person-row .artifact-person-card {
    flex: 1;
}

/* ============================================================
   KNOWLEDGE-TAB CARD GRID (companies / people / investors)
   ============================================================ */

.entity-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
}

.entity-card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.125rem 1.25rem 1rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    text-decoration: none;
    color: inherit;
    transition: border-color var(--duration-100) var(--ease-in-out), box-shadow var(--duration-100) var(--ease-in-out), transform var(--duration-100) var(--ease-in-out);
}

.entity-card:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.entity-card-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.entity-card-head .avatar,
.entity-card-head .avatar-circle {
    flex-shrink: 0;
}

.entity-card-identity {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.entity-card-kicker {
    font-family: var(--font-mono);
    font-size: 0.625rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.entity-card-name {
    font-family: var(--font-serif);
    font-size: 1.0625rem;
    font-weight: 500;
    letter-spacing: -0.005em;
    color: var(--text-primary);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.entity-card-tag {
    flex-shrink: 0;
}

.entity-card-body {
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.44em;
}

.entity-card-body.muted {
    color: var(--text-muted);
    font-style: italic;
}

.entity-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding-top: 0.625rem;
    border-top: 1px solid var(--border-light);
    font-size: 0.6875rem;
    color: var(--text-muted);
}

.entity-card-meta-left,
.entity-card-meta-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.entity-card-meta-right {
    font-family: var(--font-mono);
    color: var(--text-muted);
    flex-shrink: 0;
}

/* ============================================================
   PAPER LIST (IP — academic reference list)
   ============================================================ */

.paper-list {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-surface);
}

.paper-list-item {
    display: grid;
    grid-template-columns: 32px 1fr auto;
    column-gap: 1rem;
    align-items: start;
    padding: 0.9375rem 1.125rem;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-surface);
    transition: background var(--duration-100) var(--ease-in-out);
    text-decoration: none;
    color: inherit;
}

.paper-list-item:last-child { border-bottom: none; }
.paper-list-item:hover { background: var(--bg-raised); }

.paper-list-item .paper-mark {
    margin-top: 2px;
}

.paper-list-body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.paper-list-title {
    font-family: var(--font-serif);
    font-size: 1.0625rem;
    font-weight: 500;
    letter-spacing: -0.005em;
    line-height: 1.3;
    color: var(--text-primary);
}

.paper-list-authors {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.45;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
}

.paper-list-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    color: var(--text-muted);
    margin-top: 0.125rem;
}

.paper-list-meta .sep {
    color: var(--border);
}

.paper-list-trailing {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    padding-top: 2px;
}

@media (max-width: 720px) {
    .paper-list-item {
        grid-template-columns: 32px 1fr;
    }
    .paper-list-trailing {
        grid-column: 2;
        padding-top: 0;
    }
}

/* ============================================================
   AI Agent view
   ============================================================ */

.agent-shell {
    display: flex;
    height: 100vh;
    overflow: hidden;
}
.agent-chat {
    display: flex;
    flex-direction: column;
    flex: 1 1 38%;
    min-width: 360px;
    border-right: 1px solid var(--border);
    background: var(--bg-base);
}
.agent-shell[data-state="landing"] .agent-chat {
    flex-basis: 100%;
    border-right: none;
}
.agent-chat-scroll {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 2.5rem 2rem 1rem;
}
/* landing has no thread yet; active uses it for the conversation */
.agent-shell[data-state="landing"] .agent-chat-scroll { display: none; }

/* landing hero: greeting -> input -> sample -> category/stage buttons */
.agent-landing {
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    animation: agentFade var(--duration-500) var(--ease-out) both;
}
/* centered hero on landing; collapses to a docked input bar when active */
.agent-shell[data-state="landing"] .agent-landing { margin: auto; padding: 0 2rem 6vh; }
.agent-shell[data-state="active"] .agent-landing {
    gap: 0;
    padding: 1rem 2rem 1.5rem;
    border-top: 1px solid var(--border-light);
}
.agent-shell[data-state="active"] .agent-greeting,
.agent-shell[data-state="active"] .agent-paperchip,
.agent-shell[data-state="active"] #actionRow,
.agent-shell[data-state="active"] #domainPanel { display: none; }
/* the "Enter a patent abstract…" placeholder is a landing-only cue */
.agent-shell[data-state="active"] .agent-textarea::placeholder { color: transparent; }
@keyframes agentFade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.agent-greeting {
    font-family: var(--font-serif);
    font-weight: 300;
    font-size: 2.6rem;
    line-height: 1.15;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    margin: 0;
    text-align: center;
}
/* thread + messages */
.agent-msg { max-width: 680px; margin: 0 auto 1rem; font-size: 0.9rem; line-height: 1.5; }
.agent-msg-user {
    background: var(--accent-dim);
    border: 1px solid rgba(45,106,79,0.16);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-xl);
    white-space: pre-wrap;
}
.agent-msg-agent { color: var(--text-secondary); }
.agent-msg-attach {
    display: inline-flex; align-items: center; gap: 0.4rem;
    max-width: 100%; margin-bottom: 0.45rem;
    padding: 0.3rem 0.6rem 0.3rem 0.5rem;
    background: var(--bg-surface); border: 1px solid var(--border-light);
    border-radius: var(--radius-sm); font-size: 0.76rem; color: var(--text-secondary);
}
.agent-msg-attach .agent-paperchip-icon { width: 14px; height: 14px; flex-shrink: 0; }
.agent-msg-attach-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-msg-text { margin: 0; }
.agent-working-line {
    display: flex; align-items: center; gap: 0.5rem;
    color: var(--text-muted); font-size: 0.85rem; padding: 0.15rem 0;
    animation: agentFade var(--modal-animation-duration) var(--ease-out) both;
}
.agent-working-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--accent);
    animation: agentPulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
@keyframes agentPulse { 0%,100% { opacity: 0.35; } 50% { opacity: 1; } }
.agent-working.done .agent-working-dot { animation: none; opacity: 0.5; }
.agent-reply-text { margin: 0 0 0.6rem; }
.agent-nextstep {
    display: inline-flex; align-items: center;
    padding: 0.3rem 0.7rem;
    background: var(--bg-surface);
    border: 1px solid var(--accent);
    border-radius: var(--radius-pill);
    color: var(--accent); font: inherit; font-size: 0.72rem;
    cursor: pointer; transition: background var(--duration-150) var(--ease-in-out), box-shadow var(--duration-150) var(--ease-in-out);
}
.agent-nextstep:hover { background: var(--accent-dim); box-shadow: var(--shadow-sm); }
.agent-nextstep:disabled { opacity: 0.45; cursor: default; box-shadow: none; }
.agent-nextsteps { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-top: 0.7rem; }

/* input (lives inside the hero; the hero handles landing/active spacing) */
.agent-input { width: 100%; }
.agent-input-box {
    display: flex; flex-direction: column;
    max-width: 680px; margin: 0 auto;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-2xl);
    padding: 0.85rem 0.9rem 0.7rem;
    box-shadow: var(--shadow-sm);
    transition: border-color var(--duration-150) var(--ease-in-out), box-shadow var(--duration-150) var(--ease-in-out);
}
/* DS Input: border/default -> border/focus at stroke/thick (1.5px), no wash.
   outline draws the 1.5px ring over the 1px border with zero layout shift. */
.agent-input-box:focus-within {
    border-color: var(--border-focus);
    outline: var(--stroke-thick) solid var(--border-focus);
    outline-offset: -1px;
}
/* ghost overlay: lets a faint action-prompt preview sit below the solid text */
.agent-ta-wrap { position: relative; flex: 1 1 auto; display: flex; }
.agent-textarea {
    flex: 1 1 auto; width: 100%; resize: none; border: none; outline: none;
    background: none; font: inherit; font-size: 0.9rem; line-height: 1.45;
    color: var(--text-primary); min-height: 68px; max-height: 220px;
    position: relative; z-index: 1;
    margin: 0; padding: 0; overflow-wrap: break-word;
}
.agent-ghost {
    position: absolute; inset: 0; z-index: 0;
    pointer-events: none; overflow: hidden;
    font: inherit; font-size: 0.9rem; line-height: 1.45;
    margin: 0; padding: 0;
    white-space: pre-wrap; overflow-wrap: break-word;
    color: transparent;
}
.agent-ghost .agent-ghost-preview { color: var(--text-muted); }
.agent-send {
    flex: 0 0 auto;
    width: 34px; height: 34px;
    display: grid; place-items: center;
    border: none; border-radius: var(--radius-md);
    background: var(--accent-fill); color: var(--text-on-accent); cursor: pointer;
    transition: background var(--duration-150) var(--ease-in-out), opacity var(--duration-150) var(--ease-in-out);
}
.agent-send svg { width: 16px; height: 16px; }
.agent-send:disabled { background: var(--bg-active); color: var(--text-muted); cursor: default; }
.agent-send:not(:disabled):hover { background: var(--accent-hover); }
/* composer bottom bar — attach (paperclip) left, send right */
.agent-input-bar { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.5rem; }
.agent-input-bar-spacer { flex: 1 1 auto; }
.agent-attach-wrap { position: relative; }
.agent-attach {
    display: inline-flex; align-items: center; gap: 0.4rem;
    height: 32px; padding: 0 0.7rem;
    border: 1px solid var(--border); background: var(--bg-surface); color: var(--text-secondary);
    border-radius: 16px; cursor: pointer; font: inherit; font-size: 0.8rem;
    transition: background var(--duration-150) var(--ease-in-out), color var(--duration-150) var(--ease-in-out), border-color var(--duration-150) var(--ease-in-out);
}
.agent-attach:hover,
.agent-attach.active { border-color: var(--border-strong); color: var(--accent); }
.agent-attach svg { width: 16px; height: 16px; }
.agent-attach-label { white-space: nowrap; }

/* Patent picker — popover anchored above the attach button (searchable list). */
.agent-paper-picker {
    position: absolute; bottom: 100%; left: 0; z-index: 30;
    width: 24rem; max-width: 80vw;
    background: var(--bg-surface); border: 1px solid var(--border);
    border-radius: var(--radius-xl); box-shadow: var(--shadow-lg);
    padding: 0.5rem; margin-bottom: 0.4rem;
}
.agent-paper-picker[hidden] { display: none; }
.agent-paper-search {
    width: 100%; font: inherit; font-size: 0.85rem;
    padding: 0.4rem 0.55rem; border: 1px solid var(--border);
    border-radius: var(--radius-sm); margin-bottom: 0.4rem; background: var(--bg-base);
}
.agent-paper-search:focus {
    border-color: var(--border-focus);
    outline: var(--stroke-thick) solid var(--border-focus);
    outline-offset: -1px;
}
.agent-paper-options {
    max-height: 16rem; overflow-y: auto;
    display: flex; flex-direction: column; gap: 1px;
}
.agent-paper-option {
    display: flex; gap: 0.5rem; align-items: baseline; width: 100%;
    text-align: left; border: none; background: none; cursor: pointer;
    padding: 0.4rem 0.45rem; border-radius: var(--radius-sm);
    font-family: var(--font-sans); font-size: 0.82rem;
    transition: background var(--duration-100) var(--ease-in-out);
}
.agent-paper-option:hover { background: var(--accent-dim); }
.agent-paper-option-id {
    font-family: var(--font-mono); font-size: 0.72rem; font-weight: 600;
    color: var(--accent); white-space: nowrap; flex-shrink: 0;
}
.agent-paper-option-title {
    color: var(--text-secondary);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.agent-paper-empty { padding: 0.6rem 0.45rem; font-size: 0.82rem; color: var(--text-muted); }

/* research-paper attachment chip (demo step 1) — lives inside the composer */
.agent-paperchip {
    display: flex; align-items: center; gap: 0.6rem;
    margin-bottom: 0.6rem;
    padding: 0.5rem 0.55rem 0.5rem 0.7rem;
    background: var(--bg-raised);
    border: 1px solid var(--border-light);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius-sm);
}
.agent-paperchip[hidden] { display: none; }   /* class display would otherwise beat [hidden] */
.agent-paperchip.is-parsing { color: var(--text-muted); border-left-color: var(--border); }
.agent-paperchip-parsing { font-size: 0.8rem; color: var(--text-muted); }
.agent-paperchip-icon { width: 17px; height: 17px; color: var(--accent); flex-shrink: 0; }
.agent-paperchip-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.agent-paperchip-title {
    font-size: 0.8rem; font-weight: 600; color: var(--text-primary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.agent-paperchip-meta {
    font-family: var(--font-mono); font-size: 0.65rem; color: var(--text-muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.agent-paperchip-x {
    flex-shrink: 0; width: 22px; height: 22px; display: grid; place-items: center;
    border: none; background: none; color: var(--text-muted); font-size: 1.05rem; line-height: 1;
    border-radius: var(--radius-sm); cursor: pointer; transition: background var(--duration-150) var(--ease-in-out), color var(--duration-150) var(--ease-in-out);
}
.agent-paperchip-x:hover { background: var(--red-dim); color: var(--red); }

/* the composer doubles as the drop target */
.agent-input-box.dragover { border-color: var(--accent); box-shadow: var(--shadow-md); background: var(--accent-dim); }

/* artifact pane */
.agent-artifacts {
    flex: 1 1 62%;
    display: flex; flex-direction: column;
    background: var(--bg-surface);
    min-width: 420px;
    animation: agentFade var(--modal-animation-duration) var(--ease-out) both;
}
.agent-artifacts-top {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; padding: 0.5rem 1rem 0;
    border-bottom: 1px solid var(--border);
}
.agent-tabbar { display: flex; gap: 0.25rem; overflow-x: auto; }
.agent-tab {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.5rem 0.85rem;
    border: 1px solid transparent; border-bottom: none;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    background: none; font: inherit; font-size: 0.8rem;
    color: var(--text-muted); cursor: pointer; white-space: nowrap;
    transition: color var(--duration-150) var(--ease-in-out), background var(--duration-150) var(--ease-in-out);
}
.agent-tab:hover { color: var(--text-secondary); background: var(--bg-raised); }
.agent-tab.active {
    color: var(--text-primary);
    background: var(--bg-surface);
    border-color: var(--border);
    margin-bottom: -1px;
}
.agent-tab-dot { width: 7px; height: 7px; border-radius: 50%; }
.agent-tools, .agent-artifact-toolbar { display: flex; gap: 0.4rem; }
.agent-artifact-toolbar { padding: 0.5rem 1.25rem; border-bottom: 1px solid var(--border-light); }
.agent-tool {
    padding: 0.35rem 0.7rem;
    background: var(--bg-surface); border: 1px solid var(--border);
    border-radius: var(--radius-sm); font: inherit; font-size: 0.75rem;
    color: var(--text-secondary); cursor: pointer; white-space: nowrap;
    transition: border-color var(--duration-150) var(--ease-in-out), color var(--duration-150) var(--ease-in-out);
}
.agent-tool:hover { border-color: var(--border-strong); color: var(--text-primary); }
.agent-tool-sm { font-size: 0.72rem; padding: 0.3rem 0.6rem; }
.agent-artifact-body { flex: 1 1 auto; overflow-y: auto; padding: 2rem 2.5rem 3rem; }

/* artifacts (report / list / deck / stub) */
.art { max-width: 720px; margin: 0 auto; animation: agentFade var(--modal-animation-duration) var(--ease-out) both; }
.art-head { margin-bottom: 1.75rem; }
.art-kicker {
    display: inline-flex; align-items: center; gap: 0.4rem;
    font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--text-muted); margin-bottom: 0.6rem;
}
.art-dot { width: 8px; height: 8px; border-radius: 50%; }
.art-title {
    font-family: var(--font-serif); font-weight: 300; font-size: 1.9rem;
    line-height: 1.2; letter-spacing: -0.01em; color: var(--text-primary); margin: 0 0 1rem;
}
.art-sub { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.5; margin: 0; }
.art-verdict {
    border-left: 3px solid var(--accent);
    background: var(--accent-dim);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    padding: 0.85rem 1.1rem;
}
.art-verdict-high { border-left-color: var(--green); background: var(--accent-dim); }
.art-verdict-mid { border-left-color: var(--amber); background: var(--amber-dim); }
.art-verdict-low { border-left-color: var(--slate); background: var(--slate-dim); }
.art-verdict-level {
    display: block; font-weight: 600; font-size: 0.82rem; text-transform: capitalize;
    color: var(--text-primary); margin-bottom: 0.25rem;
}
.art-verdict-why { margin: 0; font-size: 0.85rem; color: var(--text-secondary); line-height: 1.5; }
.art-section { margin-top: 2rem; }
.art-section-label {
    font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--text-muted); margin-bottom: 0.85rem;
    padding-bottom: 0.4rem; border-bottom: 1px solid var(--border-light);
}
.art-asset-title { font-weight: 600; font-size: 0.95rem; color: var(--text-primary); margin-bottom: 0.4rem; }
.art-asset-abstract { font-size: 0.85rem; line-height: 1.55; color: var(--text-secondary); margin: 0 0 0.6rem; }
.art-asset-meta { display: flex; flex-wrap: wrap; gap: 0.9rem; font-size: 0.74rem; color: var(--text-muted); }

/* research-paper asset header + linked market signal */
.art-asset-byline { font-size: 0.76rem; color: var(--text-muted); margin-bottom: 0.7rem; }
.art-asset-results {
    margin-top: 0.7rem; padding: 0.55rem 0.85rem;
    background: var(--accent-dim); border-left: 3px solid var(--accent);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.art-asset-results-label {
    display: block; font-family: var(--font-mono); font-size: 0.6rem;
    letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent);
    font-weight: 600; margin-bottom: 0.3rem;
}
.art-asset-results p { margin: 0; font-size: 0.83rem; line-height: 1.55; color: var(--text-secondary); }
.art-cat-source {
    display: inline-flex; align-items: center; gap: 0.3rem;
    margin: 0 0 0.85rem; padding: 0.25rem 0.6rem;
    font-size: 0.72rem; font-weight: 500; color: var(--sky);
    background: var(--sky-dim); border: 1px solid transparent;
    border-radius: var(--radius-pill);
    transition: border-color var(--duration-150) var(--ease-in-out);
}
.art-cat-source:hover { border-color: var(--sky); }
.art-cat-source-arrow { width: 12px; height: 12px; flex-shrink: 0; }

/* rendered markdown inside artifact prose (signal detail + agent report pages) */
.artifact-prose .md-h,
.art-prose .md-h {
    font-family: var(--font-sans); font-size: 0.7rem; font-weight: 700;
    letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted);
    margin: 1.25rem 0 0.45rem;
}
.artifact-prose .md-h:first-child,
.art-prose .md-h:first-child { margin-top: 0; }
.artifact-prose p,
.art-prose p { margin: 0 0 0.7rem; line-height: 1.6; }
.artifact-prose .md-ul,
.art-prose .md-ul { margin: 0 0 0.85rem; padding-left: 1.15rem; }
.artifact-prose .md-ul li,
.art-prose .md-ul li { margin-bottom: 0.3rem; line-height: 1.55; }
.artifact-prose strong,
.art-prose strong { color: var(--text-primary); font-weight: 600; }

/* categories */
.art-cat { margin-bottom: 1.5rem; }
.art-cat-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.art-cat-name { font-weight: 600; font-size: 0.92rem; color: var(--text-primary); }
.art-cat-score { font-family: var(--font-serif); font-size: 1.5rem; font-weight: 300; color: var(--accent); }
.art-cat-score small { font-size: 0.66rem; font-family: var(--font-sans); color: var(--text-muted); margin-left: 0.15rem; }
.art-cat-meter { height: 4px; background: var(--bg-active); border-radius: var(--radius-pill); overflow: hidden; margin: 0.5rem 0 0.4rem; }
.art-cat-meter span { display: block; height: 100%; background: var(--accent); border-radius: var(--radius-pill); }
.art-cat-traction { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 0.8rem; }
.art-cat-tam {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin: 0.4rem 0;
    font-size: 12px;
}
.art-tam-label {
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 10px;
}
.art-tam-value {
    font-family: var(--font-mono);
    font-weight: 500;
    color: var(--text-primary);
}
.art-cat-drivers {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 0.75rem;
    padding-left: 0.5rem;
    border-left: 2px solid var(--border-light);
}
.art-startups { display: flex; flex-direction: column; gap: 0.6rem; padding-left: 0.9rem; border-left: 2px solid var(--border-light); }
.art-startup { background: var(--bg-base); border: 1px solid var(--border-light); border-radius: var(--radius-sm); padding: 0.7rem 0.9rem; }
.art-startup-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem; }
.art-startup-name { font-weight: 600; font-size: 0.85rem; color: var(--text-primary); }
.art-startup-stage { font-size: 0.72rem; color: var(--text-muted); }
.art-startup-line { font-size: 0.8rem; color: var(--text-secondary); margin: 0.25rem 0 0.5rem; }
.art-startup-investors { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; }
.art-inv-label { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-right: 0.2rem; }
.art-inv-pill { font-size: 0.72rem; color: var(--navy); background: var(--navy-dim); border-radius: var(--radius-pill); padding: 0.15rem 0.5rem; }
.art-startup-link {
    color: var(--navy);
    font-weight: 500;
    border-bottom: 1px dotted var(--navy-dim);
    transition: border-color var(--duration-150) var(--ease-in-out);
}
.art-startup-link:hover {
    border-bottom-color: var(--navy);
}
.art-inv-link {
    display: inline-block;
    color: var(--accent);
    border: 1px solid var(--accent-dim);
    background: var(--accent-dim);
    border-radius: var(--radius-pill);
    padding: 0.15rem 0.5rem;
    font-size: 11px;
    font-weight: 500;
    transition: all var(--duration-150) var(--ease-in-out);
}
.art-inv-link:hover {
    background: var(--accent);
    color: white;
    border-color: var(--border-strong);
}

/* licensing-potential candidates (strategic pharma / hospital backers) */
.art-licensee-intro { font-size: 0.8rem; color: var(--text-secondary); margin: 0 0 0.75rem; }
.art-licensees { display: flex; flex-direction: column; gap: 0.5rem; }
.art-licensee {
    background: var(--bg-base); border: 1px solid var(--border-light);
    border-left: 2px solid var(--navy); border-radius: var(--radius-sm);
    padding: 0.6rem 0.85rem;
}
.art-licensee-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0.5rem; }
.art-licensee-name { font-weight: 600; font-size: 0.85rem; }
.art-licensee-affil {
    font-size: 11px; font-weight: 500; color: var(--navy);
    background: var(--navy-dim); border-radius: var(--radius-pill);
    padding: 0.1rem 0.5rem;
}
.art-licensee-cos { font-size: 0.76rem; color: var(--text-muted); margin-top: 0.3rem; }

/* list table */
.art-table-wrap { overflow-x: auto; }
.art-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.art-table th {
    text-align: left; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--text-muted); font-weight: 600; padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--border);
}
.art-table td { padding: 0.6rem; border-bottom: 1px solid var(--border-light); color: var(--text-secondary); vertical-align: top; }
.art-td-name { font-weight: 600; color: var(--text-primary); white-space: nowrap; }
.art-td-why { color: var(--text-muted); }
.art-rel { font-size: 0.68rem; font-weight: 600; padding: 0.1rem 0.45rem; border-radius: var(--radius-pill); }
.art-rel-high { color: var(--green); background: var(--green-dim); }
.art-rel-mid { color: var(--amber); background: var(--amber-dim); }
.art-rel-low { color: var(--slate); background: var(--slate-dim); }
.art-rel-watch { color: var(--red); background: var(--red-dim); }

/* ── Licensing · Evaluate report (redesigned) ──────────────────────────── */
.lr { display: flex; flex-direction: column; gap: 1.5rem; }

.lr-hero {
  display: flex; gap: 1.5rem; align-items: flex-start; justify-content: space-between;
  background: linear-gradient(180deg, var(--bg-raised), var(--bg-base));
  border: 1px solid var(--border-light); border-radius: var(--radius-xl); padding: 1.4rem 1.5rem;
}
.lr-hero-main { min-width: 0; flex: 1; }
.lr-kicker {
  display: flex; align-items: center; gap: 0.5rem; font-size: 0.72rem; text-transform: uppercase;
  letter-spacing: 0.09em; font-weight: 700; color: var(--navy); margin-bottom: 0.6rem;
}
.lr-kicker-sep { opacity: 0.4; }
.lr-title {
  font-family: var(--font-serif); font-weight: 400; font-size: 1.7rem; line-height: 1.12;
  color: var(--text-primary); margin: 0 0 0.55rem; letter-spacing: -0.01em; text-wrap: balance;
}
.lr-idrow { display: flex; flex-wrap: wrap; gap: 0.4rem 0.55rem; align-items: center; margin-bottom: 0.85rem; }
.lr-pno { font-family: var(--font-mono); font-size: 0.76rem; color: var(--text-secondary); font-weight: 600; }
.lr-tag {
  font-size: 0.72rem; padding: 0.12rem 0.5rem; border-radius: var(--radius-pill);
  background: var(--bg-active); color: var(--text-secondary); border: 1px solid var(--border-light);
}
.lr-thesis { font-size: 0.9rem; line-height: 1.5; color: var(--text-primary); margin: 0; }
.lr-caveat {
  font-size: 0.82rem; line-height: 1.45; color: var(--text-secondary); margin: 0.6rem 0 0;
  padding-left: 0.7rem; border-left: 2px solid var(--amber);
}
.lr-caveat-tag {
  text-transform: uppercase; font-size: 0.66rem; letter-spacing: 0.06em; font-weight: 700;
  color: var(--amber); margin-right: 0.35rem;
}

.lr-gauge { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 0.1rem; --g: var(--green); }
.lr-gauge-mid { --g: var(--amber); }
.lr-gauge-low { --g: var(--slate); }
.lr-ring {
  width: 104px; height: 104px; border-radius: 50%;
  background: conic-gradient(var(--g) calc(var(--pct) * 1%), var(--border-light) 0);
  display: grid; place-items: center;
}
.lr-ring-in {
  width: 78px; height: 78px; border-radius: 50%; background: var(--bg-base);
  display: flex; flex-direction: column; align-items: center; justify-content: center; box-shadow: var(--shadow-xs);
}
.lr-ring-num {
  font-family: var(--font-serif); font-size: 2.1rem; line-height: 1; font-weight: 500;
  color: var(--g); font-variant-numeric: tabular-nums;
}
.lr-ring-den { font-size: 0.7rem; color: var(--text-muted); margin-top: 0.1rem; }
.lr-gauge-level { margin-top: 0.5rem; font-size: 0.82rem; font-weight: 700; color: var(--g); }
.lr-gauge-cap { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-muted); }

.lr-section-head { margin-bottom: 0.9rem; }
.lr-h2 { font-family: var(--font-serif); font-weight: 500; font-size: 1.25rem; color: var(--navy); margin: 0 0 0.2rem; }
.lr-section-sub { font-size: 0.8rem; line-height: 1.45; color: var(--text-secondary); }
.lr-section-sub em { font-style: italic; color: var(--text-primary); }

.lr-lics { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.7rem; }
.lr-lic {
  display: flex; gap: 0.9rem; padding: 1rem 1.1rem; background: var(--bg-base);
  border: 1px solid var(--border-light); border-radius: var(--radius-xl); border-left: 3px solid var(--border);
  transition: box-shadow var(--duration-150) var(--ease-in-out);
}
.lr-lic:hover { box-shadow: var(--shadow-sm); }
.lr-fitband-high { border-left-color: var(--green); }
.lr-fitband-mid { border-left-color: var(--amber); }
.lr-fitband-low { border-left-color: var(--slate); }
.lr-fitband-watch { border-left-color: var(--red); }
.lr-lic-rank {
  flex: 0 0 auto; width: 1.7rem; height: 1.7rem; border-radius: 50%;
  background: var(--bg-active); color: var(--text-secondary); font-weight: 700; font-size: 0.85rem;
  display: grid; place-items: center; font-variant-numeric: tabular-nums;
}
.lr-lic-body { min-width: 0; flex: 1; }
.lr-lic-top { display: flex; align-items: center; gap: 0.55rem; flex-wrap: wrap; }
.lr-lic-name { font-weight: 700; font-size: 1rem; color: var(--text-primary); }
.lr-lic-score {
  margin-left: auto; font-family: var(--font-serif); font-size: 1.15rem; font-weight: 500;
  color: var(--text-primary); font-variant-numeric: tabular-nums;
}
.lr-lic-score i { font-style: normal; font-size: 0.7rem; color: var(--text-muted); }
.lr-lic-facts { font-size: 0.76rem; color: var(--text-secondary); margin-top: 0.3rem; }
.lr-chips { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.5rem; align-items: center; }
.lr-chips-label {
  font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-muted); font-weight: 600; margin-right: 0.15rem;
}
.lr-chip {
  font-size: 0.7rem; padding: 0.1rem 0.45rem; border-radius: var(--radius-xs);
  background: var(--accent-dim); color: var(--green); font-weight: 600;
}

.lr-foot { margin-top: 0.7rem; }
.lr-foot-label {
  font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted);
  font-weight: 600; margin-bottom: 0.35rem;
}
.lr-foot-row {
  display: grid; grid-template-columns: minmax(0, 10.5rem) 1fr auto; align-items: center;
  gap: 0.55rem; padding: 0.12rem 0;
}
.lr-foot-name {
  font-size: 0.78rem; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lr-foot-bar { height: 6px; border-radius: var(--radius-sm); background: var(--bg-active); overflow: hidden; }
.lr-foot-bar i { display: block; height: 100%; border-radius: var(--radius-sm); background: var(--navy); opacity: 0.8; }
.lr-foot-n { font-size: 0.74rem; color: var(--text-secondary); font-variant-numeric: tabular-nums; white-space: nowrap; }
.lr-foot-n em { font-style: normal; color: var(--green); }
.lr-lic-why { font-size: 0.83rem; line-height: 1.5; color: var(--text-secondary); margin: 0.65rem 0 0; }

.lr-abstract { border-top: 1px solid var(--border-light); padding-top: 0.9rem; }
.lr-abstract summary {
  cursor: pointer; font-size: 0.78rem; font-weight: 600; color: var(--accent);
  text-transform: uppercase; letter-spacing: 0.05em;
}
.lr-abstract p { font-size: 0.85rem; line-height: 1.6; color: var(--text-secondary); margin: 0.7rem 0 0.4rem; }
.lr-gp-link { font-size: 0.78rem; color: var(--accent); font-weight: 600; text-decoration: none; }
.lr-source {
  font-size: 0.72rem; line-height: 1.5; color: var(--text-muted);
  border-top: 1px solid var(--border-light); padding-top: 0.8rem;
}

@media (max-width: 560px) {
  .lr-hero { flex-direction: column-reverse; align-items: stretch; }
  .lr-gauge { flex-direction: row; align-self: flex-start; gap: 0.6rem; }
  .lr-foot-row { grid-template-columns: minmax(0, 8rem) 1fr auto; }
}

/* Licensing lead table (Find licensees / Outreach) — same card language, scoped
   so the shared .lead-* styles used by the incubation list are untouched. */
.lr-leads-head { margin-bottom: 1.1rem; }
.lr-leads-sub { font-size: 0.82rem; line-height: 1.45; color: var(--text-secondary); margin: 0.4rem 0 0; }

/* Ranked shortlist table — compact, sortable-by-score view (replaces the old cards
   that duplicated the evaluation report). */
.lr-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; table-layout: fixed; }
.lr-table thead th {
  text-align: left; font-size: 0.64rem; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-muted); font-weight: 600; padding: 0.4rem 0.6rem;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
.lr-table .lr-th-rank { width: 1.8rem; }
.lr-table .lr-th-name { width: 11.5rem; }
.lr-table .lr-th-fit { width: 4rem; }
.lr-table .lr-th-score { width: 3.4rem; text-align: right; }
.lr-table .lr-th-actions { width: 9.5rem; text-align: right; }
.lr-table tbody tr {
  border-bottom: 1px solid var(--border-light);
  transition: background var(--duration-150) var(--ease-in-out), opacity var(--duration-200) var(--ease-out), transform var(--duration-200) var(--ease-out);
}
/* Reset the generic flex `.lead-row` styles (used by the incubation list) so our
   <tr> renders as a real table row — 2 classes + element beats `.lr-leads .lead-row`. */
.lr-table tr.lead-row {
  display: table-row; background: transparent; border: 0;
  border-bottom: 1px solid var(--border-light); padding: 0; cursor: default; gap: 0;
}
.lr-table tr.lead-row:first-child { border-top: 0; }
.lr-table tr.lead-row:hover { background: var(--bg-hover); box-shadow: none; }
.lr-table td { padding: 0.6rem; vertical-align: top; }
.lr-table .lr-td-rank {
  font-variant-numeric: tabular-nums; color: var(--text-muted); font-weight: 600;
  border-left: 3px solid var(--border);
}
.lr-table .lead-row.lr-fitband-high .lr-td-rank { border-left-color: var(--green); }
.lr-table .lead-row.lr-fitband-mid  .lr-td-rank { border-left-color: var(--amber); }
.lr-table .lead-row.lr-fitband-low  .lr-td-rank { border-left-color: var(--slate); }
.lr-table .lead-row.lr-fitband-watch .lr-td-rank { border-left-color: var(--red); }
.lr-table .lr-lic-name { font-weight: 700; color: var(--text-primary); display: block; }
.lr-table .lr-td-sub {
  display: block; font-size: 0.68rem; color: var(--text-muted); margin-top: 0.1rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lr-table .lr-td-fit { white-space: nowrap; }
.lr-table .lr-td-score {
  text-align: right; font-variant-numeric: tabular-nums; font-weight: 700;
  color: var(--text-primary); white-space: nowrap;
}
.lr-table .lr-td-score i { font-style: normal; font-weight: 500; font-size: 0.7rem; color: var(--text-muted); }
.lr-table .lr-td-why { color: var(--text-secondary); line-height: 1.45; }
.lr-table .lr-td-actions { text-align: right; }
.lr-table .lr-td-actions .lead-action {
  display: inline-block; min-width: 0; padding: 0.28rem 0.55rem; font-size: 11px;
  margin: 0 0 0.3rem 0.3rem;
}
/* Actions wrap to their own full-width line and sit at the bottom-right of the card,
   clear of the name/score row above. */
.lr-leads .lead-actions {
  flex: 1 1 100%; margin-top: 0.15rem;
  display: flex; flex-direction: row; gap: 0.4rem;
  justify-content: flex-end; align-items: center;
}
/* Email / Proposal: equal-width accent-outline actions */
.lr-leads .lead-action {
  text-align: center; min-width: 4.6rem; font-size: 11px; padding: 0.34rem 0.7rem;
}
.lr-leads .lead-action {
  color: var(--green); border-color: var(--green-dim); background: var(--bg-base);
}
.lr-leads .lead-action:hover {
  background: var(--green-dim); border-color: var(--green);
}
/* Remove: same footprint as the action buttons, subtle until hover */
.lr-leads 
.lr-leads 

/* trial-derived candidate licensees (licensing evaluate report) */
.art-licensee-score { font-size: 0.72rem; font-weight: 600; color: var(--accent); margin-left: auto; }
.art-licensee-inds { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.45rem; }
.art-ind-chip {
    font-size: 0.68rem; color: var(--text-secondary);
    background: var(--bg-active); border: 1px solid var(--border-light);
    border-radius: var(--radius-pill); padding: 0.08rem 0.5rem;
}
.art-licensee-why { font-size: 0.78rem; color: var(--text-muted); margin: 0.45rem 0 0; line-height: 1.5; }

/* summary — colour-coded keyword highlights (MoA + therapeutic area) */
.art-summary-line { font-size: 0.92rem; line-height: 1.65; color: var(--text-secondary); margin: 0; }
.kw { font-weight: 600; padding: 0.05rem 0.4rem; border-radius: var(--radius-sm); white-space: nowrap; }
.kw-moa { color: var(--sky); background: var(--sky-dim); }
.kw-ta  { color: var(--accent); background: var(--accent-dim); }

/* target-sectors heatmap — fibrosis subtype × licensee, cells = real trial counts */
.art-heatmap-wrap { overflow-x: auto; margin-top: 0.5rem; }
.art-heatmap { border-collapse: separate; border-spacing: 3px; width: 100%; }
.hm-corner { background: transparent; border: none; }
.hm-subtype { vertical-align: bottom; text-align: center; padding: 0.3rem 0.35rem; }
.hm-subtype-name { display: block; font-size: 0.72rem; font-weight: 600; color: var(--text-primary); }
.hm-subtype-note { display: block; font-size: 0.58rem; color: var(--text-muted); margin-top: 0.15rem; line-height: 1.25; }
.hm-adjacent .hm-subtype-name { color: var(--red); }
.hm-adjacent .hm-subtype-note { color: var(--red); opacity: 0.75; }
.hm-row { text-align: right; white-space: nowrap; font-weight: 600; font-size: 0.78rem; padding-right: 0.6rem; color: var(--text-primary); }
.hm-row a { color: inherit; }
.hm-row a:hover { color: var(--text-primary); }
.hm-cell {
    text-align: center; min-width: 44px; padding: 0.55rem 0.4rem;
    font-size: 0.8rem; font-weight: 600; font-variant-numeric: tabular-nums;
    border-radius: var(--radius-sm); color: var(--text-primary);
}
.hm-l0 { background: var(--bg-surface); color: var(--text-muted); font-weight: 400; }
.hm-l1 { background: rgba(45, 106, 79, 0.12); }
.hm-l2 { background: rgba(45, 106, 79, 0.28); }
.hm-l3 { background: rgba(45, 106, 79, 0.46); color: #fff; }
.hm-l4 { background: rgba(45, 106, 79, 0.66); color: #fff; }
.hm-l5 { background: rgba(45, 106, 79, 0.86); color: #fff; }
.art-heatmap-legend { display: flex; align-items: center; gap: 3px; margin-top: 0.65rem; font-size: 0.68rem; color: var(--text-muted); }
.hm-swatch { width: 18px; height: 12px; border-radius: 2px; display: inline-block; }
.hm-legend-label { margin: 0 0.25rem; }

/* source / provenance note */
.art-source-note {
    display: block; margin-top: 1.6rem; padding-top: 0.9rem;
    border-top: 1px solid var(--border-light);
    font-size: 0.72rem; color: var(--text-muted); line-height: 1.55;
}

/* deck slides */
.art-slides { display: flex; flex-direction: column; gap: 1rem; }
.art-slide {
    position: relative; aspect-ratio: 16 / 9;
    background: var(--bg-base); border: 1px solid var(--border);
    border-radius: var(--radius-md); padding: 1.5rem 1.75rem;
    box-shadow: var(--shadow-sm); display: flex; flex-direction: column; justify-content: center;
}
.art-slide-title-only, .art-slide-title { justify-content: center; }
.art-slide-no { position: absolute; top: 0.85rem; right: 1.1rem; font-size: 0.7rem; color: var(--text-muted); font-family: var(--font-mono); }
.art-slide-title { font-family: var(--font-serif); font-weight: 300; font-size: 1.4rem; color: var(--text-primary); margin: 0 0 0.75rem; line-height: 1.2; }
.art-slide-bullets { margin: 0; padding-left: 1.1rem; }
.art-slide-bullets li { font-size: 0.85rem; line-height: 1.6; color: var(--text-secondary); }
.art-slide-figure {
    margin-top: 0.9rem; align-self: flex-start;
    font-size: 0.78rem; color: var(--accent);
    background: var(--accent-dim); border-radius: var(--radius-sm); padding: 0.35rem 0.7rem;
}

/* stub */
.art-stub { text-align: center; padding-top: 3rem; }
.art-stub-badge {
    display: inline-block; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em;
    color: var(--amber); background: var(--amber-dim); border-radius: var(--radius-pill);
    padding: 0.2rem 0.7rem; margin-bottom: 1rem;
}
.art-stub-text { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.6; max-width: 420px; margin: 0 auto; }

/* sidebar agent nav entry */
.nav-item-agent { font-weight: 600; }

/* toast */
.agent-toast {
    position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%) translateY(10px);
    background: var(--navy-900); color: #fff;
    font-size: 0.82rem; padding: 0.6rem 1.1rem; border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg); opacity: 0; transition: opacity var(--duration-200) var(--ease-out), transform var(--duration-200) var(--ease-out); z-index: 100;
}
.agent-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* the [hidden] attribute must win over the display:flex/inline-flex set above */
.agent-artifacts[hidden],
.agent-artifact-toolbar[hidden],
.agent-domain-panel[hidden] { display: none; }

/* Trend arrows on investor cards */
.trend-arrow {
    font-size: 0.7em;
    margin-left: 0.35rem;
    vertical-align: middle;
}
.trend-up {
    color: var(--green);
}
.trend-down {
    color: var(--red);
}


/* ============================================================
   ACTION-FIRST AGENT ENTRY
   ============================================================ */

/* Action-first entry buttons */
.agent-action-row {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}
.agent-action-btn {
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    padding: 0.6rem 1.2rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    background: var(--bg-surface);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: all var(--duration-150) var(--ease-in-out);
}
.agent-action-btn:hover {
    background: var(--bg-hover);
    border-color: var(--border-strong);
}
.agent-action-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* Domain dropdown panel */
.agent-domain-panel {
    margin-top: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    background: var(--bg-surface);
    overflow: hidden;
}
.agent-domain-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 1rem;
    background: var(--bg-raised);
    font-weight: 600;
    font-size: 12px;
    color: var(--text-secondary);
}
.agent-domain-close {
    background: none;
    border: none;
    font-size: 18px;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
}
.agent-domain-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0.7rem 1rem;
    border: none;
    border-top: 1px solid var(--border-light);
    background: var(--bg-surface);
    font-family: var(--font-sans);
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    text-align: left;
    transition: background var(--duration-100) var(--ease-in-out);
}
.agent-domain-item:hover {
    background: var(--bg-hover);
}
.agent-domain-chevron {
    color: var(--text-muted);
    font-size: 12px;
}
/* Lead table */
.lead-list {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin: 1rem 0;
}
.lead-row {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-surface);
    cursor: grab;
    transition: background var(--duration-100) var(--ease-in-out);
}
.lead-info-top {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.45rem;
}
.lead-why {
    margin: 0.3rem 0 0;
    font-size: 0.8rem;
    line-height: 1.5;
    color: var(--text-secondary);
}
.lead-strategic {
    font-size: 10px;
    font-weight: 500;
    color: var(--navy);
    background: var(--navy-dim);
    border-radius: var(--radius-pill);
    padding: 0.08rem 0.45rem;
}
.lead-row:last-child {
    border-bottom: none;
}
.lead-row:hover {
    background: var(--bg-hover);
}


.lead-info {
    flex: 1;
    min-width: 0;
}
.lead-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
    display: block;
}
.lead-name:hover {
    color: var(--text-primary);
}
.lead-meta {
    font-size: 11px;
    color: var(--text-muted);
    display: block;
    margin-top: 0.15rem;
}
.lead-relevance {
    flex-shrink: 0;
}
.lead-actions {
    display: flex;
    gap: 0.35rem;
    flex-shrink: 0;
}
.lead-action {
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 500;
    padding: 0.3rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--duration-150) var(--ease-in-out);
}
.lead-action:hover {
    background: var(--bg-hover);
    border-color: var(--border-strong);
}



/* Add investor row */
.lead-add {
    position: relative;
    margin: 1rem 0;
}
.lead-add-input {
    width: 100%;
    font-family: var(--font-sans);
    font-size: 13px;
    padding: 0.6rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    color: var(--text-secondary);
}
.lead-add-input:focus {
    border-color: var(--border-focus);
    outline: var(--stroke-thick) solid var(--border-focus);
    outline-offset: -1px;
}
.lead-autocomplete {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 0.25rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    box-shadow: var(--shadow-md);
    z-index: 10;
    max-height: 200px;
    overflow-y: auto;
}
.lead-autocomplete-item {
    display: block;
    width: 100%;
    padding: 0.6rem 1rem;
    border: none;
    border-bottom: 1px solid var(--border-light);
    background: none;
    font-family: var(--font-sans);
    font-size: 13px;
    text-align: left;
    cursor: pointer;
    color: var(--text-secondary);
}
.lead-autocomplete-item:last-child {
    border-bottom: none;
}
.lead-autocomplete-item:hover {
    background: var(--bg-hover);
}

/* Send all button */
.lead-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
}
.lead-hint { flex: 1 1 auto; margin: 0; font-size: 0.78rem; line-height: 1.5; color: var(--text-muted); }
.lead-hint strong { color: var(--accent); font-weight: 600; }

/* Cover email artifact */
.art-email {
    max-width: 560px;
}
.email-body {
    font-size: 13.5px;
    line-height: 1.7;
    color: var(--text-secondary);
}
.email-body p {
    margin-bottom: 1rem;
}
.email-link {
    color: var(--accent);
    border-bottom: 1px solid var(--accent-dim);
    font-weight: 500;
}
.email-link:hover {
    /* An accent-coloured link: its underline stays accent (matching the text),
       it just goes from --accent-dim to full. Not a neutral hover-border case. */
    border-bottom-color: var(--accent);
}
.email-news {
    padding: 0.75rem 1rem;
    background: var(--bg-raised);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--accent);
    font-size: 12px;
    color: var(--text-secondary);
}

/* Personalized deck artifact */
.art-deck {
    max-width: 600px;
}
.deck-slide {
    padding: 1.5rem;
    margin-bottom: 1rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}
.deck-slide-num {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}
.deck-slide-title {
    font-family: var(--font-serif);
    font-size: 20px;
    font-weight: 300;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    line-height: 1.3;
}
.deck-slide-body {
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-secondary);
}
.deck-news {
    margin-top: 0.75rem;
    padding: 0.6rem 0.9rem;
    background: var(--accent-dim);
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: var(--accent);
    font-weight: 500;
}
.deck-slide-list {
    list-style: none;
    padding: 0;
}
.deck-slide-list li {
    padding: 0.4rem 0;
    padding-left: 1.2rem;
    position: relative;
    font-size: 13px;
    color: var(--text-secondary);
}
.deck-slide-list li::before {
    content: "—";
    position: absolute;
    left: 0;
    color: var(--accent);
}

/* ============ Matchmaking ============ */
.nav-beta { font-family: var(--font-mono); font-size: 0.58rem; letter-spacing: 0.08em; text-transform: uppercase;
  background: var(--accent-fill); color: var(--text-on-accent); border-radius: var(--radius-sm);
  padding: 0.1em 0.45em; margin-left: 0.4em; vertical-align: middle; font-weight: 500; }

.mm-shell { max-width: 960px; margin: 0 auto; padding: 3rem 2rem 5rem; }
.mm-head { margin-bottom: 2.5rem; }
.mm-h1 { font-family: var(--font-serif); font-weight: 300;
  font-size: 2.8rem; letter-spacing: -0.01em; color: var(--text-primary); margin: 0; }
.mm-sub { color: var(--text-secondary); margin: 0.3rem 0 1.4rem; }
.mm-modes { display: flex; gap: 0.5rem; border-bottom: 1px solid var(--border-light, #EDEAE4); }
.mm-mode { padding: 0.6rem 1rem; color: var(--text-secondary); text-decoration: none; font-weight: 500;
  border-bottom: 2px solid transparent; margin-bottom: -1px; }
.mm-mode.active { color: var(--accent, #2D6A4F); border-bottom-color: var(--accent, #2D6A4F); }
.mm-soon { font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-tertiary); border: 1px solid var(--border-light, #EDEAE4); border-radius: var(--radius-pill); padding: 0.05em 0.45em; }

.mm-patents { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.75rem; }
.mm-patent-link { display: flex; align-items: center; gap: 1.25rem; padding: 1.1rem 1.25rem;
  background: var(--bg-base, #FAFAF7); border: 1px solid var(--border-light, #EDEAE4); border-radius: 12px;
  text-decoration: none; color: inherit; box-shadow: none; transition: box-shadow var(--duration-150) var(--ease-in-out), transform var(--duration-150) var(--ease-in-out); }
.mm-patent-link:hover { box-shadow: none; transform: translateY(-1px); }
.mm-rank { font-family: var(--font-serif); font-size: 1.6rem; font-weight: 300;
  color: var(--text-primary); width: 1.5rem; text-align: center; flex: none; }
.mm-patent-main { display: flex; flex-direction: column; gap: 0.2rem; flex: 1; min-width: 0; }
.mm-patent-title { font-weight: 600; color: var(--text-primary); }
.mm-patent-meta { font-size: 0.8rem; color: var(--text-tertiary); }
.mm-patent-matches { font-size: 0.82rem; color: var(--accent, #2D6A4F); }
/* Screen 1 — curated shortlist section */
.mm-section-head { display: flex; align-items: baseline; gap: 0.6rem; flex-wrap: wrap;
  margin: 1.6rem 0 0.7rem; }
.mm-section-head:first-of-type { margin-top: 0.4rem; }
.mm-section-h { font-family: var(--font-serif); font-weight: 300; font-size: 1.5rem;
  color: var(--text-primary); margin: 0; }
.mm-section-sub { font-size: 0.78rem; color: var(--text-tertiary); }
.mm-patent-top .mm-patent-link { border-color: rgba(45,106,79,0.28); background: linear-gradient(180deg, rgba(45,106,79,0.035), var(--bg-base,#FAFAF7) 60%); }
.mm-rank-promise { color: var(--green, #2D6A4F); font-weight: 500; }
.mm-group-tag { align-self: flex-start; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--text-primary); background: rgba(61,90,128,0.09); padding: 0.1rem 0.45rem; border-radius: var(--radius-pill,999px); }
.mm-promise-note { font-size: 0.86rem; color: var(--text-secondary); line-height: 1.45; margin-top: 0.15rem; }
.mm-promise-caveat { font-size: 0.8rem; color: var(--text-tertiary); line-height: 1.4; }
.mm-promise-caveat strong { color: var(--text-secondary); }
.mm-unlic { color: var(--green, #2D6A4F); font-weight: 600; }
.mm-demand { display: flex; flex-direction: column; align-items: center; flex: none; padding-left: 1rem;
  border-left: 1px solid var(--border-light, #EDEAE4); }
.mm-demand-n { font-family: var(--font-serif); font-size: 1.7rem; font-weight: 300; color: var(--text-primary); }
.mm-demand-l { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-tertiary); }
/* Licensing-fit ("promise") score — honest, colour-banded */
.mm-promise { display: flex; flex-direction: column; align-items: center; flex: none; min-width: 4.2rem;
  padding: 0.3rem 0.2rem 0.3rem 1rem; border-left: 1px solid var(--border-light, #EDEAE4); }
.mm-promise-n { font-family: var(--font-serif); font-size: 2rem; font-weight: 300; line-height: 1; }
.mm-promise-l { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-tertiary); margin-top: 0.1rem; }
.mm-promise-high .mm-promise-n { color: var(--green, #2D6A4F); }
.mm-promise-mid  .mm-promise-n { color: var(--cat-cardio); }
.mm-promise-low  .mm-promise-n { color: var(--amber, #a07020); }
.mm-promise-low  .mm-promise-l { color: var(--amber, #a07020); }

.mm-teaser { text-align: center; padding: 4rem 2rem; background: var(--bg-raised, #F5F2ED);
  border: 1px dashed var(--border-light, #EDEAE4); border-radius: var(--radius-xl); }
.mm-teaser-badge { display: inline-block; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--amber, #B8924A); margin-bottom: 0.75rem; }
.mm-teaser-text { max-width: 34rem; margin: 0 auto; color: var(--text-secondary); }

.mm-deck-shell { max-width: 720px; margin: 0 auto; padding: 1.5rem 1.5rem 4rem; }
.mm-ctxbar { display: flex; align-items: center; gap: 1rem; padding: 0.75rem 0 1.25rem; border-bottom: 1px solid var(--border-light,#EDEAE4); margin-bottom: 1.5rem; }
.mm-back { color: var(--text-secondary); text-decoration: none; font-size: 0.85rem; flex: none; }
.mm-ctx { flex: 1; display: flex; flex-direction: column; gap: 0.1rem; align-items: flex-start;
  background: none; border: 0; padding: 0.35rem 0.5rem; margin: -0.35rem -0.5rem; border-radius: var(--radius-lg);
  text-align: left; cursor: pointer; transition: background var(--duration-150) var(--ease-in-out); }
.mm-ctx:hover { background: rgba(61,90,128,0.06); }
.mm-ctx-title { font-weight: 600; color: var(--text-primary); }
.mm-ctx-info { font-size: 0.72rem; font-weight: 500; color: var(--text-primary); white-space: nowrap; }
.mm-ctx:hover .mm-ctx-info { text-decoration: underline; }
.mm-ctx-meta { font-size: 0.78rem; color: var(--text-tertiary); }
.mm-ctx-progress { font-size: 0.8rem; color: var(--text-tertiary); flex: none; }

.mm-stage { position: relative; min-height: 520px; }
.mm-card { position: absolute; inset: 0; background: var(--bg-base,#FAFAF7); border: 1px solid var(--border-light,#EDEAE4);
  border-radius: var(--radius-2xl); padding: 1.5rem 1.6rem; box-shadow: none;
  display: flex; flex-direction: column; gap: 1rem; overflow-y: auto;
  transition: transform var(--duration-300) var(--ease-emphasis), opacity var(--duration-300) var(--ease-emphasis); }
.mm-card[hidden] { display: none; }
.mm-card.mm-gone-left { transform: translateX(-120%) rotate(-8deg); opacity: 0; }
.mm-card.mm-gone-right { transform: translateX(120%) rotate(8deg); opacity: 0; }

.mm-card-idrow { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; }
.mm-card-id { display: flex; align-items: center; gap: 0.7rem; min-width: 0; }
.mm-avatar { flex: none; width: 2.6rem; height: 2.6rem; border-radius: 12px; display: inline-flex;
  align-items: center; justify-content: center; font-family: var(--font-sans);
  font-weight: 700; font-size: 0.9rem; letter-spacing: 0.02em; color: #fff; background: var(--navy,#3D5A80);
  box-shadow: inset 0 -2px 6px rgba(0,0,0,0.12); }
.mm-avatar-high { background: var(--accent-fill); color: var(--text-on-accent); }
.mm-avatar-watch { background: var(--garnet,#8C2F39); }
.mm-card-name { font-family: var(--font-serif); font-weight: 300; font-size: 1.9rem;
  color: var(--text-primary); margin: 0; line-height: 1.05; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mm-progress { font-size: 0.72rem; color: var(--text-tertiary); flex: none; }
.mm-card-facts { font-size: 0.82rem; color: var(--text-secondary); line-height: 1.5; }
.mm-fit { display: inline-flex; align-items: center; margin: 0.6rem 0 0.5rem; font-size: 0.74rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em; padding: 0.3em 0.75em; border-radius: var(--radius-pill);
  border: 1px solid transparent; }
.mm-why { font-size: 0.92rem; color: var(--text-primary); margin: 0; line-height: 1.5; }

/* Patent detail modal (fetched into .mm-overlay) */
.mm-detail { position: relative; background: var(--bg-base,#FAFAF7); border: 1px solid var(--border-light,#EDEAE4);
  border-radius: 16px; padding: 1.6rem 1.7rem; box-shadow: none;
  max-height: 82vh; overflow-y: auto; display: flex; flex-direction: column; gap: 1rem; }
.mm-detail-x { position: absolute; top: 0.9rem; right: 1rem; border: 0; background: none; cursor: pointer;
  font-size: 1rem; color: var(--text-tertiary); line-height: 1; padding: 0.3rem; }
.mm-detail-x:hover { color: var(--text-primary); }
.mm-detail-kicker { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; font-size: 0.7rem;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-tertiary); }
.mm-detail-rank { color: var(--green,#2D6A4F); font-weight: 700; }
.mm-detail-title { font-family: var(--font-serif); font-weight: 300; font-size: 1.55rem;
  color: var(--text-primary); margin: 0; line-height: 1.15; text-wrap: balance; }
.mm-detail-idrow { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; font-size: 0.82rem; }
.mm-detail-no { font-weight: 600; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.mm-detail-link { color: var(--text-primary); text-decoration: none; font-weight: 600; }
.mm-detail-link:hover { text-decoration: underline; }
.mm-chip { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.04em; padding: 0.12rem 0.5rem;
  border-radius: var(--radius-pill); font-weight: 600; }
.mm-chip-green { color: var(--green,#2D6A4F); background: rgba(45,106,79,0.10); }
.mm-chip-amber { color: var(--amber,#a07020); background: rgba(160,112,32,0.10); }
.mm-chip-warn { color: var(--garnet,#8C2F39); background: rgba(140,47,57,0.10); }
.mm-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 0.7rem 1.2rem; margin: 0;
  padding: 0.9rem 0; border-top: 1px solid var(--border-light,#EDEAE4); border-bottom: 1px solid var(--border-light,#EDEAE4); }
.mm-detail-grid dt { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-tertiary); margin-bottom: 0.15rem; }
.mm-detail-grid dd { margin: 0; font-size: 0.86rem; color: var(--text-primary); }
.mm-detail-label { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-tertiary); margin-bottom: 0.35rem; }
.mm-detail-note { font-size: 0.88rem; color: var(--text-primary); line-height: 1.5; margin: 0; }
.mm-detail-caveat { font-size: 0.82rem; color: var(--text-tertiary); line-height: 1.45; margin: 0.35rem 0 0; }
.mm-detail-abstract p { font-size: 0.88rem; color: var(--text-primary); line-height: 1.6; margin: 0; }
.mm-detail-warn { font-size: 0.85rem; color: var(--garnet,#8C2F39); background: rgba(140,47,57,0.07);
  border: 1px solid rgba(140,47,57,0.18); border-radius: var(--radius-lg); padding: 0.7rem 0.85rem; line-height: 1.5; }
.mm-detail-claims { border-top: 1px solid var(--border-light,#EDEAE4); padding-top: 0.6rem; }
.mm-detail-claims summary { cursor: pointer; font-size: 0.8rem; font-weight: 600; color: var(--text-primary); }
.mm-detail-claimtext { margin: 0.6rem 0 0; max-height: 40vh; overflow-y: auto; white-space: pre-wrap;
  font-family: var(--font-sans); font-size: 0.78rem; color: var(--text-secondary); line-height: 1.5;
  background: var(--bg-raised,#F5F2ED); border-radius: 8px; padding: 0.8rem; }

.mm-zone { border-top: 1px solid var(--border-light,#EDEAE4); padding-top: 0.9rem; }
.mm-zone-label { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-tertiary); margin-bottom: 0.55rem; }
.mm-foot { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.mm-foot-row { display: grid; grid-template-columns: 11rem 1fr auto; align-items: center; gap: 0.6rem; font-size: 0.82rem; }
.mm-foot-area { color: var(--text-primary); }
.mm-foot-bar { height: 8px; background: var(--bg-active, #EDEAE4); border-radius: 4px; overflow: hidden; }
.mm-foot-fill { display: block; height: 100%; background: var(--navy,#3D5A80); }
.mm-foot-n { text-align: right; color: var(--text-secondary); white-space: nowrap; }
.mm-trials { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.55rem; }
.mm-trial-row { display: flex; flex-direction: column; gap: 0.2rem; }
.mm-trial-title { font-size: 0.85rem; color: var(--text-primary); line-height: 1.35; }
.mm-trial-mat { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; font-size: 0.76rem; }
.mm-trial-status { text-transform: capitalize; color: var(--text-tertiary); }
.mm-trial-status.mm-ts-active { color: var(--green,#2D6A4F); font-weight: 600; }
.mm-trial-nct { color: var(--text-tertiary); font-variant-numeric: tabular-nums; margin-left: auto; }
.mm-foot-row-match .mm-foot-area { color: var(--green,#2D6A4F); font-weight: 600; }
.mm-foot-row-match .mm-foot-fill { background: var(--green,#2D6A4F); }
.mm-foot-tag { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--green,#2D6A4F);
    background: rgba(45,106,79,0.10); padding: 0.05rem 0.35rem; border-radius: var(--radius-pill,999px); margin-left: 0.3rem; }
.mm-foot-recent { color: var(--text-muted, #8a8a85); font-size: 0.72rem; }
.mm-lic { color: var(--amber, #a07020); font-weight: 600; }

.mm-pipe { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.mm-pipe-top { font-size: 0.88rem; }
.mm-pipe-name { font-weight: 600; color: var(--text-primary); }
.mm-pipe-moa { color: var(--text-secondary); }
.mm-pipe-mat { display: flex; align-items: center; gap: 0.5rem; font-size: 0.78rem; color: var(--text-secondary); margin-top: 0.15rem; }
.mm-pipe-status { font-weight: 600; padding: 0.05em 0.5em; border-radius: var(--radius-pill); }
.mm-status-approved { background: rgba(45,106,79,0.12); color: var(--accent,#2D6A4F); }
.mm-status-trial { background: rgba(61,90,128,0.12); color: var(--text-primary); }
.mm-pipe-sales { color: var(--text-tertiary); }
.mm-cross { font-size: 0.76rem; color: var(--amber,#B8924A); margin-top: 0.15rem; }
.mm-pipe-empty { font-size: 0.85rem; color: var(--text-tertiary); margin: 0; }

.mm-zone-internal { background: rgba(61,90,128,0.04); margin: 0 -0.4rem; padding: 0.9rem 0.4rem 0.6rem; border-radius: var(--radius-lg); }
.mm-note-src { font-size: 0.76rem; color: var(--text-tertiary); margin-bottom: 0.35rem; }
.mm-note-points { margin: 0; padding-left: 1.1rem; font-size: 0.84rem; color: var(--text-primary); display: flex; flex-direction: column; gap: 0.25rem; }

.mm-card-actions { position: sticky; bottom: 0; margin: 0.4rem -1.6rem -1.5rem; padding: 0.85rem 1.6rem 1.05rem;
  display: flex; gap: 0.75rem; background: linear-gradient(180deg, rgba(250,250,247,0), var(--bg-base,#FAFAF7) 32%);
  border-top: 1px solid var(--border-light,#EDEAE4); }
.mm-btn { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  padding: 0.8rem 1rem; border-radius: 12px; font-weight: 600; font-size: 0.95rem; cursor: pointer;
  border: 1px solid transparent; transition: transform var(--duration-100) var(--ease-in-out), box-shadow var(--duration-150) var(--ease-in-out), background var(--duration-150) var(--ease-in-out); }
.mm-btn:hover { transform: translateY(-1px); }
.mm-btn:active { transform: translateY(0); }
.mm-btn-ic { font-size: 0.9em; line-height: 1; }
.mm-pass { background: var(--bg-surface); border-color: var(--border-light,#EDEAE4); color: var(--text-secondary); }
.mm-pass:hover { border-color: #d9b3b3; color: var(--garnet,#8C2F39); box-shadow: none; }
.mm-like { background: var(--accent-fill); color: var(--text-on-accent); text-align: center; }
.mm-like:hover { background: var(--accent-hover); }
.mm-like .mm-btn-ic { color: var(--text-on-accent); }
.mm-done { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; }
.mm-done[hidden] { display: none; }   /* class display would otherwise beat [hidden] */
.mm-done-inner { color: var(--text-secondary); }
.mm-done-h { font-family: var(--font-serif); font-weight: 300; font-size: 1.8rem; color: var(--text-primary); }

.mm-reason { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center;
  align-items: center; gap: 1rem; background: var(--bg-raised,#F5F2ED); border: 1px solid var(--border-light,#EDEAE4);
  border-radius: var(--radius-2xl); padding: 2rem; text-align: center; }
.mm-reason-q { color: var(--text-secondary); }
.mm-reason-q em { color: var(--text-tertiary); font-style: italic; }
.mm-reason-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; max-width: 26rem; }
.mm-reason-chip { padding: 0.45rem 0.85rem; border-radius: var(--radius-pill); border: 1px solid var(--border-light,#EDEAE4);
  background: var(--bg-surface); color: var(--text-primary); cursor: pointer; font-size: 0.85rem; }
.mm-reason-chip:hover { border-color: var(--text-primary); color: var(--text-primary); }
.mm-reason-skip { background: transparent; color: var(--text-tertiary); }

.mm-overlay { position: fixed; inset: 0; background: rgba(20,30,40,0.35); display: flex;
  align-items: center; justify-content: center; padding: 1.5rem; z-index: 50; }
.mm-overlay-inner { width: 100%; max-width: 540px; }
.mm-draft-card { background: var(--bg-base,#FAFAF7); border: 1px solid var(--border-light,#EDEAE4);
  border-radius: var(--radius-xl); padding: 1.5rem; box-shadow: none; }
.mm-draft-flag { color: var(--accent,#2D6A4F); font-weight: 600; font-size: 0.85rem; margin-bottom: 1rem; }
.mm-draft-field { display: flex; gap: 0.75rem; padding: 0.4rem 0; border-bottom: 1px solid var(--border-light,#EDEAE4); font-size: 0.9rem; }
.mm-draft-k { color: var(--text-tertiary); width: 3.5rem; flex: none; }
.mm-draft-body { padding: 1rem 0; color: var(--text-primary); font-size: 0.92rem; line-height: 1.5; display: flex; flex-direction: column; gap: 0.6rem; }
.mm-draft-foot { display: flex; align-items: center; justify-content: space-between; padding-top: 0.5rem; }
.mm-draft-attach { font-size: 0.85rem; color: var(--text-primary); }
.mm-draft-foot .mm-like { flex: none; padding: 0.5rem 1.3rem; }

/* ============================================================
   ASK-THE-AGENT · redesign (evaluate-licensing flow)
   Brand-forward landing + claude.ai-style docked composer.
   Namespaced .ax-* / sidebar rail — supersedes the legacy .agent-* view.
   ============================================================ */

/* ---- Sidebar rail: New evaluation · Recent · User -------------------- */
.side-new {
    display: flex; align-items: center; gap: 0.5rem;
    margin: 0.25rem 0.5rem 0.25rem;
    padding: 0.5rem 0.625rem;
    border: 0;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 12px; font-weight: 500; letter-spacing: 0.5px; text-transform: uppercase;
    cursor: pointer; transition: background var(--duration-100) var(--ease-in-out);
}
.side-new svg { width: 14px; height: 14px; flex: none; color: currentColor; }
.side-new:hover { background: var(--interactive-hover); }

.recent-list { display: flex; flex-direction: column; gap: 1px; }
.recent-empty {
    padding: 0.25rem 0.5rem; font-size: 12px; line-height: 1.4;
    color: var(--text-tertiary); font-family: var(--font-sans);
}
.recent-item {
    display: flex; flex-direction: column; gap: 1px; align-items: flex-start;
    width: 100%; text-align: left; border: 0; background: transparent; cursor: pointer;
    padding: 0.4rem 0.5rem; border-radius: var(--radius-md);
    transition: background var(--duration-100) var(--ease-in-out);
}
.recent-item:hover { background: var(--interactive-hover); }
.recent-item.is-active { background: var(--interactive-selected); box-shadow: inset 2px 0 0 var(--accent); }
.recent-pno { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.3px; color: var(--text-tertiary); }
.recent-title {
    font-size: 12.5px; color: var(--text-secondary); line-height: 1.3;
    max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.recent-item:hover .recent-title, .recent-item.is-active .recent-title { color: var(--text-primary); }

.side-user {
    display: flex; align-items: center; gap: 0.5rem; width: 100%;
    padding: 0.45rem 0.5rem; border: 0; background: transparent;
    border-radius: var(--radius-md); cursor: pointer; text-align: left;
    transition: background var(--duration-100) var(--ease-in-out);
}
.side-user-av {
    width: 26px; height: 26px; flex: none; border-radius: var(--radius-sm);
    display: grid; place-items: center;
    background: var(--accent-fill); color: var(--text-on-accent);
    font-family: var(--font-mono); font-weight: 500; font-size: 12px;
}
.side-user-meta { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; flex: 1 1 auto; }
.side-user-name { font-size: 13px; font-weight: 500; color: var(--text-primary); }
.side-user-role { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.4px;
    text-transform: uppercase; color: var(--text-tertiary); }

/* ---- Shell / layout -------------------------------------------------- */
.ax {
    height: 100vh; display: flex; flex-direction: row; min-height: 0;
    background: var(--bg-base);
}
.ax-conversation {
    flex: 1 1 auto; min-width: 0; height: 100vh;
    display: flex; flex-direction: column; min-height: 0;
}
.ax-scroll {
    flex: 1 1 auto; min-height: 0; overflow-y: auto;
    display: flex; flex-direction: column;
}

/* ---- Landing (centered brand hero) ----------------------------------- */
.ax-landing { margin: auto; width: 100%; max-width: 720px; padding: 3rem 2rem 1rem; }
.ax[data-state="result"] .ax-landing { display: none; }
.ax[data-state="landing"] .ax-thread { display: none; }

.ax-hero { margin-bottom: 2rem; }
.ax-eyebrow {
    font-family: var(--font-mono); font-size: 11px; font-weight: 500;
    letter-spacing: 0.8px; text-transform: uppercase; color: var(--text-accent);
    margin-bottom: 1rem;
}
.ax-headline {
    font-family: var(--font-sans); font-weight: 500;
    font-size: clamp(2.4rem, 4.6vw, 3.4rem); line-height: 1.02;
    letter-spacing: -0.02em; color: var(--text-primary); margin: 0 0 1.1rem;
}
.ax-mark {
    text-decoration: none;
}
.ax-sub {
    font-size: 1.0625rem; line-height: 1.5; color: var(--text-secondary);
    max-width: 52ch; margin: 0;
}

/* ---- Starter cards --------------------------------------------------- */
.ax-starters { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; }
.ax-starter {
    display: flex; flex-direction: column; gap: 0.35rem; text-align: left;
    padding: 0.9rem 1rem 1rem; cursor: pointer;
    background: var(--bg-surface);
    border: var(--stroke-hairline) solid var(--border-default);
    border-radius: var(--radius-xl);
    transition: border-color var(--duration-100) var(--ease-in-out), transform var(--duration-100) var(--ease-in-out);
}
.ax-starter:hover { border-color: var(--border-strong); }
.ax-starter-k {
    font-family: var(--font-mono); font-size: 10px; font-weight: 500;
    letter-spacing: 0.6px; text-transform: uppercase; color: var(--text-accent);
}
.ax-starter-t { font-size: 0.95rem; font-weight: 500; color: var(--text-primary); }
.ax-starter-d { font-size: 0.8rem; line-height: 1.4; color: var(--text-tertiary); }

/* ---- Docked composer ------------------------------------------------- */
.ax-composer-wrap {
    flex: 0 0 auto; padding: 0.5rem 2rem 1rem;
    background: linear-gradient(to top, var(--bg-base) 72%, transparent);
}
.ax-composer {
    max-width: 720px; margin: 0 auto;
    background: var(--bg-surface);
    border: var(--stroke-hairline) solid var(--border-default);
    border-radius: var(--radius-2xl);
    padding: 0.75rem 0.85rem 0.65rem;
    transition: border-color var(--duration-150) var(--ease-in-out);
}
.ax-composer:focus-within {
    border-color: var(--border-strong);
}
.ax-chip-row { margin-bottom: 0.5rem; }
.ax-chip {
    display: inline-flex; align-items: center; gap: 0.5rem; max-width: 100%;
    padding: 0.3rem 0.3rem 0.3rem 0.55rem;
    background: var(--bg-raised);
    border: var(--stroke-hairline) solid var(--border-default);
    border-radius: var(--radius-sm);
}
.ax-chip-pno {
    font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.3px;
    color: var(--text-accent); flex: none;
}
.ax-chip-title {
    font-size: 12.5px; color: var(--text-primary);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ax-chip-x {
    flex: none; width: 18px; height: 18px; border: 0; border-radius: var(--radius-sm);
    background: transparent; color: var(--text-tertiary); cursor: pointer;
    font-size: 15px; line-height: 1; display: grid; place-items: center;
}
.ax-chip-x:hover { background: var(--interactive-hover); color: var(--text-primary); }

.ax-ta-wrap { position: relative; }
/* A ghost over an EMPTY textarea would collide with the placeholder — both draw at the
   same origin and the two strings overlap into mush. Only the starter-chip hover preview
   hits this (a committed suggestion always has solid text in front of it), but the rule
   is written against any ghost so the two can never co-render. */
.ax-ta-wrap.has-ghost .ax-textarea::placeholder { color: transparent; }
.ax-textarea {
    width: 100%; border: 0; outline: none; resize: none; background: none;
    font-family: var(--font-sans); font-size: 0.95rem; line-height: 1.5;
    color: var(--text-primary); min-height: 26px; max-height: 180px;
    padding: 0.15rem 0.15rem 0.35rem;
    position: relative; z-index: 1;
    /* block, not the default inline-block: an inline textarea sits on a text baseline
       and leaves a descender gap under it, which makes the wrapper (and so the
       inset-0 ghost mirror) a few px taller than the textarea itself. */
    display: block;
}
.ax-textarea::placeholder { color: var(--text-tertiary); }
/* Starter-prompt ghost: a mirror of the textarea sitting behind it, so the accepted
   stem (transparent, space-holding) and the grey suggestion tail read as one line of
   text. EVERY metric here must track .ax-textarea — including the breakpoint override
   below — or the suggestion drifts out of alignment. Same idiom as .agent-ghost. */
.ax-ghost {
    position: absolute; inset: 0; z-index: 0;
    pointer-events: none; overflow: hidden;
    font-family: var(--font-sans); font-size: 0.95rem; line-height: 1.5;
    padding: 0.15rem 0.15rem 0.35rem;
    white-space: pre-wrap; overflow-wrap: break-word;
    color: transparent;
}
.ax-ghost-suggest { color: var(--text-tertiary); }

.ax-composer-bar { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.ax-attach-wrap { position: relative; }
.ax-attach {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.4rem 0.7rem; cursor: pointer;
    background: transparent;
    border: var(--stroke-hairline) solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-family: var(--font-mono); font-size: 11px; font-weight: 500;
    letter-spacing: 0.4px; text-transform: uppercase;
    transition: border-color var(--duration-100) var(--ease-in-out), color var(--duration-100) var(--ease-in-out);
}
.ax-attach svg { width: 12px; height: 12px; }
.ax-attach:hover { border-color: var(--border-strong); color: var(--text-primary); }

.ax-run {
    display: inline-flex; align-items: center; gap: 0.45rem;
    padding: 0.5rem 0.95rem; cursor: pointer; border: 0;
    background: var(--accent-fill); color: var(--text-on-accent);
    border-radius: var(--radius-md);
    font-family: var(--font-mono); font-size: 13px; font-weight: 500;
    letter-spacing: 0.5px; text-transform: uppercase;
    transition: background var(--duration-100) var(--ease-in-out), opacity var(--duration-100) var(--ease-in-out);
}
.ax-run:hover:not(:disabled) { background: var(--accent-hover); }
.ax-run:disabled { opacity: 0.4; cursor: not-allowed; }
.ax-kbd {
    font-family: var(--font-mono); font-size: 11px;
    background: rgba(0,0,0,.18); border-radius: var(--radius-sm); padding: 0 4px; line-height: 1.4;
}

/* ---- Invention picker (popover) -------------------------------------- */
.ax-picker {
    position: absolute; bottom: calc(100% + 8px); left: 0; z-index: 60;
    width: 380px; max-width: 78vw;
    /* Opaque surface — must fully occlude the hero/cards it overlays.
       --bg-surface is opaque in both themes (claude.ai ramp), so it's safe here. */
    background: var(--bg-surface);
    border: var(--stroke-hairline) solid var(--border-strong);
    border-radius: var(--radius-xl); padding: 0.4rem;
}
.ax-search {
    width: 100%; margin-bottom: 0.4rem;
    padding: 0.45rem 0.6rem;
    background: var(--bg-base);
    border: var(--stroke-hairline) solid var(--border-default);
    border-radius: var(--radius-sm);
    color: var(--text-primary); font-family: var(--font-sans); font-size: 13px;
}
.ax-search:focus { outline: var(--stroke-thick) solid var(--border-focus); outline-offset: -1px; border-color: var(--border-focus); }
.ax-search::placeholder { color: var(--text-tertiary); }
.ax-options { max-height: 300px; overflow-y: auto; display: flex; flex-direction: column; gap: 1px; }
.ax-option {
    display: flex; flex-direction: column; gap: 1px; align-items: flex-start;
    width: 100%; text-align: left; border: 0; background: transparent; cursor: pointer;
    padding: 0.45rem 0.55rem; border-radius: var(--radius-sm); transition: background var(--duration-100) var(--ease-in-out);
}
.ax-option:hover, .ax-option.is-sel { background: var(--interactive-hover); }
.ax-option.is-sel { box-shadow: inset 2px 0 0 var(--accent); }
.ax-option-pno { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.3px; color: var(--text-accent); }
.ax-option-title { font-size: 13px; color: var(--text-primary); line-height: 1.3; }
.ax-option-empty { padding: 0.6rem; font-size: 12.5px; color: var(--text-tertiary); }
/* Grouped, tagged picker (Pharma · Licensing / Prof Ben · Incubation) */
.ax-option { position: relative; padding-right: 5.5rem; }
.ax-option-group {
    font-family: var(--font-mono); font-size: 9px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.6px; color: var(--text-tertiary);
    padding: 0.55rem 0.55rem 0.2rem;
}
.ax-options > .ax-option-group:first-child { padding-top: 0.2rem; }
.ax-option-tag {
    position: absolute; top: 0.5rem; right: 0.55rem;
    font-family: var(--font-mono); font-size: 8.5px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.4px;
    padding: 0.06rem 0.32rem; border-radius: var(--radius-xs);
}
.ax-option-tag.is-licensing { color: var(--green); background: var(--accent-dim); }
.ax-option-tag.is-incubation { color: var(--sky); background: var(--sky-dim); }

.ax-disclaimer {
    max-width: 720px; margin: 0.55rem auto 0; text-align: center;
    font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.2px;
    line-height: 1.4; color: var(--text-tertiary);
}

/* ---- Thread (results) ------------------------------------------------ */
.ax-thread { width: 100%; max-width: 860px; margin: 0 auto; padding: 2rem 2rem 1rem; }
.ax-turn { margin-bottom: 1.75rem; }

.ax-turn-user { display: flex; justify-content: flex-end; }
.ax-u-bubble {
    max-width: 78%;
    background: var(--bg-surface);
    border: var(--stroke-hairline) solid var(--border-default);
    border-radius: var(--radius-xl) var(--radius-lg) var(--radius-sm) var(--radius-lg);
    padding: 0.7rem 0.9rem;
}
.ax-u-q { font-size: 0.95rem; color: var(--text-primary); line-height: 1.4; }
.ax-u-asset {
    display: flex; align-items: baseline; gap: 0.5rem; margin-top: 0.35rem;
    padding-top: 0.35rem; border-top: var(--stroke-hairline) solid var(--border-default);
}
.ax-u-pno { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.3px; color: var(--text-accent); flex: none; }
.ax-u-title { font-size: 12px; color: var(--text-tertiary); line-height: 1.3;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ax-turn-a { display: grid; grid-template-columns: 28px 1fr; gap: 0.75rem; }
.ax-a-rail { display: flex; justify-content: center; padding-top: 2px; }
.ax-a-dot { width: 18px; height: 18px; border-radius: var(--radius-sm);
    background: var(--accent-fill);
    -webkit-mask: repeating-linear-gradient(45deg, #000 0 2px, transparent 2px 4px);
    mask: repeating-linear-gradient(45deg, #000 0 2px, transparent 2px 4px); }
.ax-a-main { min-width: 0; }
.ax-a-working {
    display: flex; align-items: center; gap: 0.5rem;
    font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.2px;
    color: var(--text-tertiary); padding: 0.35rem 0;
}
.ax-a-spin {
    width: 13px; height: 13px; flex: none; border-radius: 50%;
    border: 1.5px solid var(--border-strong); border-top-color: var(--accent-fill);
    animation: ax-spin 1s linear infinite;
}
@keyframes ax-spin { to { transform: rotate(360deg); } }
.ax-error { color: var(--status-error); font-size: 0.9rem; }

/* ============================================================
   ASK-THE-AGENT · agentic chat (streaming steps · next steps · drawer · brief)
   ============================================================ */

/* Room to pin each new question to the top of the viewport. */
.ax-thread { padding-bottom: 44vh; }

/* ---- Streaming "working" steps ---------------------------------------- */
.ax-steps { display: flex; flex-direction: column; gap: 0.3rem; margin: 0.15rem 0 0.4rem; }
.ax-steps.is-collapsed { opacity: 0.6; }
.ax-step {
    display: flex; align-items: center; gap: 0.55rem;
    font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.2px;
    color: var(--text-tertiary);
    opacity: 0; transform: translateY(2px); animation: ax-step-in var(--modal-animation-duration) var(--ease-out) forwards;
}
@keyframes ax-step-in { to { opacity: 1; transform: none; } }
.ax-step-mark {
    width: 13px; height: 13px; flex: none; border-radius: 50%;
    border: 1.5px solid var(--border-strong); border-top-color: var(--accent-fill);
    animation: ax-spin 1s linear infinite;
}
.ax-step.is-done { color: var(--text-secondary); }
.ax-step.is-done .ax-step-mark {
    border: 0; animation: none;
    background: var(--accent-fill);
    -webkit-mask: var(--ax-check); mask: var(--ax-check);
    -webkit-mask-size: contain; mask-size: contain;
    -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
    -webkit-mask-position: center; mask-position: center;
}
:root { --ax-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5l3.2 3.2L13 4.8' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
@keyframes ax-spin { to { transform: rotate(360deg); } }

.ax-a-body { opacity: 0; transform: translateY(4px); transition: opacity var(--duration-300) var(--ease-emphasis), transform var(--duration-300) var(--ease-emphasis); }
.ax-a-body.is-in { opacity: 1; transform: none; }
.ax-error { color: var(--status-error); font-size: 0.9rem; }

/* ---- Next steps ------------------------------------------------------- */
.ax-next {
    display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem;
    margin-top: 1.1rem; padding-top: 1rem;
    border-top: var(--stroke-hairline) solid var(--border-default);
}
.ax-next-label {
    width: 100%; margin-bottom: 0.15rem;
    font-family: var(--font-mono); font-size: 10px; font-weight: 500;
    letter-spacing: 0.8px; text-transform: uppercase; color: var(--text-tertiary);
}
.ax-next-btn {
    display: inline-flex; align-items: center; gap: 0.5rem; cursor: pointer;
    padding: 0.5rem 0.8rem;
    background: var(--bg-surface);
    border: var(--stroke-hairline) solid var(--border-default);
    border-radius: var(--radius-md);
    transition: border-color var(--duration-100) var(--ease-in-out), background var(--duration-100) var(--ease-in-out);
}
.ax-next-btn:hover { border-color: var(--border-strong); background: var(--interactive-hover); }
.ax-next-k {
    font-family: var(--font-mono); font-size: 10px; font-weight: 500;
    letter-spacing: 0.5px; text-transform: uppercase; color: var(--text-accent);
}
.ax-next-t { font-size: 13px; color: var(--text-primary); }

/* ---- Agentic search results (inline, selectable list) ----------------- */
.ax-results { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.6rem; }
.ax-result {
    display: flex; align-items: center; gap: 0.85rem; width: 100%; cursor: pointer; text-align: left;
    padding: 0.7rem 0.85rem;
    background: var(--bg-surface);
    border: var(--stroke-hairline) solid var(--border-default);
    border-radius: var(--radius-lg);
    transition: border-color var(--duration-100) var(--ease-in-out), background var(--duration-100) var(--ease-in-out);
}
/* `.is-hover`, not :hover — the class is set on a real mousemove (see wireStep). A parked
   cursor that results render underneath gets browser enter events but no movement, and a row
   nobody pointed at must not light up. */
.ax-result.is-hover { border-color: var(--border-strong); background: var(--interactive-hover); }
.ax-result-rank {
    flex: none; width: 20px; height: 20px; display: grid; place-items: center;
    font-family: var(--font-mono); font-size: 11px; font-weight: 500; color: var(--text-tertiary);
}
.ax-result-main { min-width: 0; flex: 1 1 auto; display: flex; flex-direction: column; gap: 0.2rem; }
.ax-result-title {
    font-size: 13.5px; color: var(--text-primary); line-height: 1.35;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ax-result-meta { display: flex; align-items: baseline; gap: 0.5rem; min-width: 0; }
.ax-result-kind {
    flex: none; font-family: var(--font-mono); font-size: 9.5px; font-weight: 500;
    letter-spacing: 0.5px; text-transform: uppercase; color: var(--text-accent);
    padding: 0.12rem 0.4rem; border-radius: var(--radius-sm);
    background: var(--bg-raised); border: var(--stroke-hairline) solid var(--border-default);
}
.ax-result-pno {
    font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.2px; color: var(--text-tertiary);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ax-result-cta {
    flex: none; display: inline-flex; align-items: center; gap: 0.3rem;
    font-family: var(--font-mono); font-size: 10px; font-weight: 500;
    letter-spacing: 0.5px; text-transform: uppercase; color: var(--text-accent);
}
.ax-result-cta svg { width: 13px; height: 13px; }
.ax-results-more {
    padding: 0.3rem 0.2rem 0.1rem; font-family: var(--font-mono); font-size: 11px;
    letter-spacing: 0.3px; color: var(--text-tertiary);
}

/* ---- Collection header (incubation results group) -------------------- */
/* Groups the results rows under the inventor's research programme, so the assets read
   as two collections rather than five independent filings. Quiet, native to the list:
   uppercase mono, a hairline rule, and a short accent tick as the "collection" mark. */
.ax-result-group {
    display: flex; align-items: center; gap: 0.55rem;
    padding: 0.55rem 0.2rem 0.4rem; margin-bottom: -0.1rem;
    border-bottom: var(--stroke-hairline) solid var(--border-default);
}
/* The collection block: header + its rows, and the whole thing is ONE click target —
   the analysis runs on the collection, so the hit area is the collection (Anni,
   2026-07-29). Rows keep their own surfaces; what the block adds is a single hover and
   focus state across all of them, so the group reads as one control rather than a header
   with a small button in it. */
.ax-result-group-block { display: flex; flex-direction: column; gap: 0.5rem; }
.ax-result-group-block + .ax-result-group-block { margin-top: 0.75rem; }
.ax-result-group-block.is-clickable { cursor: pointer; border-radius: var(--radius-xl); }
/* Hover steps NEUTRALS, never the accent — the rows take exactly the step a clickable
   licensing row takes on its own hover, and the header rule + CTA follow. Keyed off
   `.is-hover` (a real mousemove) rather than :hover, so a block that merely rendered under a
   parked cursor stays quiet. */
.ax-result-group-block.is-clickable.is-hover .ax-result-static {
    border-color: var(--border-strong); background: var(--interactive-hover);
}
.ax-result-group-block.is-clickable.is-hover .ax-result-group { border-bottom-color: var(--border-strong); }
.ax-result-group-block.is-clickable.is-hover .ax-result-group-eval { color: var(--text-primary); }
.ax-result-group-block.is-clickable:focus-visible { outline: 1.5px solid var(--accent); outline-offset: 3px; }
/* collection-level Evaluate — a marker on the header, not a control of its own */
.ax-result-group-eval {
    flex: none; display: inline-flex; align-items: center; gap: 0.3rem;
    font-family: var(--font-mono); font-size: 10px; font-weight: 600;
    letter-spacing: 0.5px; text-transform: uppercase; color: var(--text-accent);
    background: transparent; border: none; padding: 0.1rem 0;
    transition: color var(--duration-100) var(--ease-in-out);
}
.ax-result-group-eval svg { width: 13px; height: 13px; }
/* grouped rows are a manifest of the collection — no per-row CTA, and no per-row hover: the
   row is part of the collection's target, so it highlights with the block, not alone. It
   never carries `.is-hover` itself (only wireStep'd controls do), so no reset is needed. */
.ax-result-static { cursor: inherit; }
.ax-result-group-inv {
    position: relative; padding-left: 0.7rem;
    font-family: var(--font-mono); font-size: 11px; font-weight: 600;
    letter-spacing: 0.4px; text-transform: uppercase; color: var(--text-secondary);
}
.ax-result-group-inv::before {
    content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
    width: 3px; height: 12px; border-radius: var(--radius-sm); background: var(--accent-fill);
}
.ax-result-group-label {
    min-width: 0; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.3px;
    text-transform: uppercase; color: var(--text-tertiary);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ax-result-group-count {
    flex: none; margin-left: auto; font-family: var(--font-mono); font-size: 10px;
    letter-spacing: 0.3px; color: var(--text-tertiary);
}

/* ---- Internal-notes button (shortlist row) + popup -------------------- */
/* Icon-only, neutral — never accent. Inherits .lead-action's border/color/hover. */
.lead-action-crm { display: inline-flex; align-items: center; justify-content: center; padding: 0.3rem 0.45rem; }
.lead-action-crm svg { width: 14px; height: 14px; }

.crm-card { max-width: 560px; }
.crm-contact { display: flex; align-items: center; gap: 0.7rem; margin: 0.2rem 0 1.1rem; }
.crm-avatar {
    flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
    background: var(--accent-fill); color: var(--text-on-accent);
    font-family: var(--font-mono); font-size: 15px; font-weight: 600;
}
.crm-contact-id { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.crm-name { font-size: 0.95rem; font-weight: 500; color: var(--text-primary); }
.crm-role { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.2px; color: var(--text-tertiary); }
.crm-touch {
    font-size: 0.95rem; line-height: 1.5; color: var(--text-secondary);
    padding: 0.6rem 0.8rem; margin: 0 0 1.1rem;
    background: var(--bg-raised); border-radius: var(--radius-md);
    border-left: 2px solid var(--accent-fill);
}
.crm-touch strong { color: var(--text-primary); font-weight: 500; }
.crm-sec { padding: 0.9rem 0; border-top: var(--stroke-hairline) solid var(--border-default); }
.crm-sec:first-of-type { border-top: 0; padding-top: 0; }
.crm-h {
    font-family: var(--font-mono); font-size: 10px; font-weight: 500;
    letter-spacing: 0.6px; text-transform: uppercase; color: var(--text-accent); margin: 0 0 0.3rem;
}
.crm-sec p { font-size: 0.95rem; line-height: 1.6; color: var(--text-secondary); margin: 0; }

/* ---- Slide-over drawer (email / proposal preview) --------------------- */
.ax-drawer-backdrop {
    position: fixed; inset: 0; z-index: 200;
    background: var(--bg-overlay); opacity: 0; transition: opacity var(--duration-200) var(--ease-out);
}
.ax-drawer-backdrop.is-open { opacity: 1; }
.ax-drawer {
    position: fixed; top: 0; right: 0; bottom: 0; z-index: 201;
    width: 520px; max-width: 92vw;
    display: flex; flex-direction: column;
    background: var(--bg-surface);
    border-left: var(--stroke-hairline) solid var(--border-strong);
    transform: translateX(100%); transition: transform var(--duration-300) var(--ease-emphasis);
}
.ax-drawer.is-open { transform: none; }
.ax-drawer-head {
    display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
    padding: 0.85rem 1.1rem; flex: none;
    border-bottom: var(--stroke-hairline) solid var(--border-default);
}
.ax-drawer-title {
    font-family: var(--font-mono); font-size: 11px; font-weight: 500;
    letter-spacing: 0.5px; text-transform: uppercase; color: var(--text-secondary);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ax-drawer-x {
    flex: none; width: 28px; height: 28px; border: 0; border-radius: var(--radius-sm);
    background: transparent; color: var(--text-tertiary); cursor: pointer;
    font-size: 20px; line-height: 1; display: grid; place-items: center;
}
.ax-drawer-x:hover { background: var(--interactive-hover); color: var(--text-primary); }
.ax-drawer-body { flex: 1 1 auto; overflow-y: auto; padding: 1.25rem; }
.ax-drawer-load { font-family: var(--font-mono); font-size: 12px; color: var(--text-tertiary); }

/* ---- Toast ------------------------------------------------------------ */
.ax-toast {
    /* Above the modal (301) — it confirms actions taken inside it. */
    position: fixed; left: 50%; bottom: 26px; z-index: 400;
    transform: translate(-50%, 12px); opacity: 0;
    padding: 0.6rem 1rem;
    background: var(--accent-fill); color: var(--text-on-accent);
    border-radius: var(--radius-md);
    font-family: var(--font-mono); font-size: 12px; font-weight: 500; letter-spacing: 0.3px;
    transition: opacity var(--duration-200) var(--ease-out), transform var(--duration-200) var(--ease-out);
}
.ax-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ============================================================
   ASK-THE-AGENT · artifact panel (claude-style docked side pane) + brand docs
   Supersedes the earlier slide-over drawer (.ax-drawer-* now unused).
   ============================================================ */
.ax-artifact {
    flex: 0 0 0px; min-width: 0; overflow: hidden;
    height: 100vh; display: flex; flex-direction: column;
    /* A raised panel (bg-200), like the sidebar — not the canvas. claude.ai
       separates the artifact pane with a surface STEP; the seam is secondary. */
    background: var(--bg-panel);
    /* Structural panel divider — same weight as the sidebar's border-right.
       --border-strong here made it read 2x heavier than the sidebar seam. */
    border-left: 0 solid var(--border-default);
    transition: flex-basis var(--duration-300) var(--ease-emphasis);
}
.ax.is-split .ax-artifact {
    flex-basis: clamp(460px, 52%, 900px);
    border-left-width: var(--stroke-hairline);
}
.ax-art-head {
    flex: none; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding: 0.7rem 1.1rem;
    border-bottom: var(--stroke-hairline) solid var(--border-default);
}
.ax-art-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ax-art-kicker {
    font-family: var(--font-mono); font-size: 10px; font-weight: 500;
    letter-spacing: 0.6px; text-transform: uppercase; color: var(--text-accent);
}
.ax-art-title {
    font-size: 13px; font-weight: 500; color: var(--text-primary);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ax-art-actions { display: flex; align-items: center; gap: 0.3rem; flex: none; }
.ax-art-btn {
    padding: 0.35rem 0.7rem; cursor: pointer;
    background: transparent;
    border: var(--stroke-hairline) solid var(--border-default);
    border-radius: var(--radius-md);
    font-family: var(--font-mono); font-size: 11px; font-weight: 500;
    letter-spacing: 0.4px; text-transform: uppercase; color: var(--text-secondary);
    transition: border-color var(--duration-100) var(--ease-in-out), color var(--duration-100) var(--ease-in-out);
}
.ax-art-btn:hover { border-color: var(--border-strong); color: var(--text-primary); }
.ax-art-x {
    width: 28px; height: 28px; flex: none; border: 0; border-radius: var(--radius-sm);
    background: transparent; color: var(--text-tertiary); cursor: pointer;
    display: grid; place-items: center;
}
.ax-art-x svg { width: 14px; height: 14px; }
.ax-art-x:hover { background: var(--interactive-hover); color: var(--text-primary); }
.ax-art-body { flex: 1 1 auto; overflow-y: auto; padding: 1.75rem 1.6rem 3rem; }
.ax-art-load { font-family: var(--font-mono); font-size: 12px; color: var(--text-tertiary); }

/* ---- Brand document (email / proposal) -------------------------------- */
.doc { max-width: 620px; color: var(--text-primary); font-family: var(--font-sans); }
.doc-kicker {
    font-family: var(--font-mono); font-size: 10.5px; font-weight: 500;
    letter-spacing: 0.6px; text-transform: uppercase; color: var(--text-tertiary);
    margin: 0 0 0.85rem;
}
.doc-subject {
    font-family: var(--font-sans); font-weight: 500; font-size: 1.5rem;
    line-height: 1.18; letter-spacing: -0.015em; color: var(--text-primary);
    margin: 0 0 1.2rem;
}
.doc-body { display: flex; flex-direction: column; gap: 0.9rem; }
.doc-body p { font-size: 0.975rem; line-height: 1.65; color: var(--text-secondary); margin: 0; }
.doc-body strong, .doc-sec-main p strong { color: var(--text-primary); font-weight: 500; }
.doc-sign { margin-top: 0.5rem; color: var(--text-primary) !important; line-height: 1.6; }
.doc-sign-role { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.3px; color: var(--text-tertiary); }

/* Document links (cover email: proposal / calendar / provenance) — accent + underline,
   so they read unmistakably as links inside prose (T1). Was unstyled = no differential. */
.doc-link {
    color: var(--accent); text-decoration: underline;
    text-underline-offset: 2px; text-decoration-thickness: 1px;
}
.doc-link:hover { text-decoration-thickness: 2px; }

/* Internal engagement note inside the cover email — a native <details> reveal for the
   rep. NOT part of the sent draft; the customer-facing personalisation is in paragraph 2. */
.doc-note { margin: -0.2rem 0 0; }
.doc-note > summary {
    list-style: none; display: inline-flex; align-items: center; gap: 0.4rem; cursor: pointer;
    width: max-content; padding: 0.28rem 0.6rem 0.28rem 0.45rem;
    font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.06em; text-transform: uppercase;
    color: var(--text-tertiary); background: var(--bg-raised);
    border: var(--stroke-hairline) solid var(--border-default); border-radius: var(--radius-md);
    transition: color var(--duration-100) var(--ease-in-out), border-color var(--duration-100) var(--ease-in-out);
}
.doc-note > summary::-webkit-details-marker { display: none; }
.doc-note > summary:hover { color: var(--text-secondary); border-color: var(--border-strong); }
.doc-note-ico { display: inline-flex; color: var(--text-secondary); }
.doc-note-ico svg { width: 14px; height: 14px; display: block; }
.doc-note-body {
    margin-top: 0.65rem; padding: 0.1rem 0 0.1rem 0.9rem;
    border-left: 2px solid var(--border-strong);
    display: flex; flex-direction: column; gap: 0.5rem;
}
.doc-note-body p { font-size: 0.85rem; line-height: 1.55; color: var(--text-secondary); margin: 0; }
.doc-note-lbl {
    display: block; margin-bottom: 0.12rem; font-family: var(--font-mono);
    font-size: 0.6rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-tertiary);
}

.doc-metrow { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: -0.4rem 0 1.6rem; }
.doc-tag {
    font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.2px;
    padding: 0.22rem 0.55rem; border-radius: var(--radius-sm);
    background: var(--bg-surface); border: var(--stroke-hairline) solid var(--border-default);
    color: var(--text-secondary);
}
.doc-fit {
    font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.2px;
    padding: 0.22rem 0.55rem; border-radius: var(--radius-sm);
    background: var(--bg-raised); color: var(--text-primary);
    border: var(--stroke-hairline) solid var(--border-default);
}
.doc-fit-high { border-left: 3px solid var(--status-success); }
.doc-fit-mid { border-left: 3px solid var(--status-warning); }
.doc-fit-low, .doc-fit-watch { border-left: 3px solid var(--text-tertiary); }

.doc-sec { display: flex; gap: 1rem; padding: 1.15rem 0; border-top: var(--stroke-hairline) solid var(--border-default); }
.doc-sec-n { flex: none; font-family: var(--font-mono); font-size: 12px; font-weight: 500; color: var(--text-accent); padding-top: 0.15rem; }
.doc-sec-main { min-width: 0; }
.doc-sec-h { font-family: var(--font-sans); font-weight: 500; font-size: 1rem; color: var(--text-primary); margin: 0 0 0.4rem; }
.doc-sec-main p { font-size: 0.95rem; line-height: 1.6; color: var(--text-secondary); margin: 0; }
.doc-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.7rem; }
.doc-list { margin: 0.25rem 0 0; padding-left: 1.1rem; display: flex; flex-direction: column; gap: 0.4rem; }
.doc-list li { font-size: 0.95rem; line-height: 1.5; color: var(--text-secondary); }

/* ---- NUSX wordmark for outward-facing artifacts (letterhead) ---------- */
.nusx-wm {
    font-family: var(--font-sans); font-weight: 500; font-size: 1rem;
    letter-spacing: -0.03em; color: var(--text-primary); line-height: 1;
}
.nusx-wm em { color: var(--accent); font-style: normal; font-weight: 500; }
.doc-letterhead {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    margin-bottom: 1.4rem; padding-bottom: 1rem;
    border-bottom: var(--stroke-hairline) solid var(--border-default);
}
.doc-letterhead-org {
    font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.5px;
    text-transform: uppercase; color: var(--text-tertiary);
}

/* ---- Assistant say-line + artifact card (claude.ai message flow) ------- */
.ax-a-say {
    font-size: 0.975rem; line-height: 1.55; color: var(--text-primary);
    margin: 0.1rem 0 0.85rem;
}
.ax-card {
    display: flex; align-items: center; gap: 0.75rem; width: 100%; max-width: 440px;
    text-align: left; cursor: pointer;
    padding: 0.75rem 0.85rem;
    background: var(--bg-surface);
    border: var(--stroke-hairline) solid var(--border-default);
    border-radius: var(--radius-xl);
    transition: border-color var(--duration-100) var(--ease-in-out), background var(--duration-100) var(--ease-in-out);
}
.ax-card.is-open { border-color: var(--border-default); }
/* Composite the hover overlay OVER the card's own surface, not as a bare
   background — a translucent fill would otherwise show the deeper canvas
   through it and read DARKER than rest. claude.ai raises the card on hover. */
.ax-card:hover {
    border-color: var(--border-strong);
    background:
        linear-gradient(var(--interactive-hover), var(--interactive-hover)),
        var(--bg-surface);
}
.ax-card-ic {
    flex: none; width: 34px; height: 34px; display: grid; place-items: center;
    border-radius: var(--radius-sm);
    background: var(--accent-dim); color: var(--text-accent);
}
.ax-card-ic svg { width: 17px; height: 17px; }
.ax-card-meta { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1 1 auto; }
.ax-card-title {
    font-size: 13.5px; font-weight: 500; color: var(--text-primary);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ax-card-type {
    font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.4px;
    text-transform: uppercase; color: var(--text-tertiary);
}
.ax-card-open {
    flex: none; font-family: var(--font-mono); font-size: 10px; font-weight: 500;
    letter-spacing: 0.5px; text-transform: uppercase; color: var(--text-accent);
}

/* ---- Report inside the artifact panel: stack the hero so the promise
   score stays visible at any panel width (the base .lr-hero is a fixed row). --- */
.ax-art-body .lr-hero { flex-direction: column-reverse; align-items: stretch; gap: 1rem; }
.ax-art-body .lr-gauge { flex-direction: row; align-self: flex-start; align-items: center; gap: 0.6rem; }
.ax-art-body .lr-lics, .ax-art-body .lr-foot-bar { min-width: 0; }

/* ============================================================
   POLISH · fewer outlines → soft fills + whitespace (both themes)
   ============================================================ */
/* Chat: bubbles, next-step chips and cards read as soft fills, not boxes */
.ax-u-bubble { border: 0; background: var(--bg-surface); }
.ax-next { border-top: 0; margin-top: 0.85rem; padding-top: 0; }
.ax-next-btn { border-color: transparent; }
.ax-next-btn:hover { border-color: transparent; background: var(--interactive-hover); }

/* Report artifacts: drop full borders, keep the fit-band accent + fills */
.lr-hero { border: 0; }
.lr-tag, .lr-chip { border: 0; }
.lr-lic {
    background: var(--bg-surface);
    border-top-width: 0; border-right-width: 0; border-bottom-width: 0;
}
.lr-lic:hover { box-shadow: none; background: var(--bg-raised); }
.lr-abstract { border-top-color: var(--border-default); }

/* On-brand: retire the stray blue kicker/heading + make the kicker dot lime */
.lr-kicker { color: var(--text-secondary); }
.lr-h2 { color: var(--text-primary); }
.lr-kicker .art-dot { background: var(--text-accent) !important; }

/* ============================================================
   CLAUDE.AI PASS · soft, rounded, sentence-case, airy (agent surface)
   Deliberately overrides NUSX's mono-uppercase + tight-radius defaults for
   this view, per explicit direction to match claude.ai. Brand kept: lime + wordmark.
   ============================================================ */

/* ---- Assistant turns: no avatar rail, full-width text (claude today) ---- */
.ax-turn-a { display: block; }
.ax-a-rail { display: none; }
.ax-turn { margin-bottom: 2rem; }

/* ---- Generous rounding everywhere ----
   Snapped onto Tailwind's radius scale (what claude.ai uses). 24/16 were
   already exactly 3xl/2xl; the off-grid 20/14/10 are gone (-> 2xl/xl/lg). */
.ax-composer { border-radius: var(--radius-3xl); padding: 0.9rem 1.05rem 0.75rem; }
.ax-u-bubble { border-radius: var(--radius-2xl); padding: 0.7rem 1rem; }
.ax-card { border-radius: var(--radius-2xl); padding: 0.9rem 1rem; }
.ax-card-ic { border-radius: var(--radius-lg); }
.ax-starter { border-radius: var(--radius-2xl); padding: 1.05rem 1.1rem; }
.ax-next-btn { border-radius: var(--radius-pill); padding: 0.5rem 1rem; }
.ax-attach { border-radius: var(--radius-pill); padding: 0.45rem 0.9rem; }
.ax-chip { border-radius: var(--radius-pill); }
.ax-run { border-radius: var(--radius-pill); padding: 0.55rem 1.15rem; }
.ax-picker, .ax-search { border-radius: var(--radius-xl); }
.ax-option { border-radius: var(--radius-lg); }
.side-new { border-radius: var(--radius-xl); padding: 0.6rem 0.8rem; }
.recent-item { border-radius: var(--radius-lg); }
.ax-art-btn { border-radius: var(--radius-pill); }

/* ---- De-mono / sentence-case: kill the "technical dashboard" labels ---- */
.side-new, .sidebar-group-kicker, .theme-toggle-label, .side-user-role,
.ax-eyebrow, .ax-starter-k, .ax-step, .ax-next-label, .ax-next-t,
.ax-card-type, .ax-card-open, .ax-disclaimer, .ax-attach, .ax-run,
.ax-art-kicker, .ax-art-btn, .doc-kicker, .doc-letterhead-org, .lr-kicker {
    font-family: var(--font-sans);
    text-transform: none;
    letter-spacing: normal;
}
.side-new { font-size: 0.9rem; font-weight: 500; }
.sidebar-group-kicker { font-size: 0.75rem; font-weight: 500; color: var(--text-tertiary); }
.theme-toggle-label, .side-user-role { font-size: 0.8rem; font-weight: 400; }
.ax-eyebrow { font-size: 0.85rem; font-weight: 500; color: var(--text-tertiary); margin-bottom: 0.75rem; }
.ax-starter-k { font-size: 0.78rem; font-weight: 600; color: var(--text-accent); }
.ax-step { font-size: 0.9rem; }
.ax-next-label { font-size: 0.8rem; font-weight: 500; color: var(--text-tertiary); }
.ax-next-k { display: none; }                 /* drop the redundant DRAFT/ASSEMBLE prefix */
.ax-next-t { font-size: 0.875rem; color: var(--text-primary); }
.ax-card-type { font-size: 0.76rem; }
.ax-card-title { font-size: 0.95rem; }
.ax-card-open { font-size: 0.8rem; }
.ax-disclaimer { font-size: 0.78rem; line-height: 1.5; }
.ax-attach { font-size: 0.85rem; color: var(--text-secondary); }
.ax-run { font-size: 0.9rem; font-weight: 500; }
.ax-kbd { display: none; }                    /* claude's send has no ↵ hint */
.ax-art-kicker { font-size: 0.75rem; font-weight: 500; color: var(--text-tertiary); }
.ax-art-btn { font-size: 0.8rem; }
.doc-kicker, .doc-letterhead-org, .lr-kicker { font-weight: 500; }

/* ---- Composer + inputs: bigger, softer, more air ---- */
.ax-textarea { font-size: 1rem; line-height: 1.55; }
.ax-textarea::placeholder { color: var(--text-tertiary); }
/* The ghost mirror tracks the textarea's metrics here too — see .ax-ghost. */
.ax-ghost { font-size: 1rem; line-height: 1.55; }
.ax-landing { padding-top: 3.5rem; }
.ax-hero { margin-bottom: 2.5rem; }
.ax-a-say { font-size: 1rem; line-height: 1.6; margin: 0 0 1rem; }

/* ---- Artifact panel controls (claude.ai parity: copy · download · versions · publish) ---- */
.ax-art-icon {
    width: 30px; height: 30px; flex: none; border: 0; border-radius: 8px;
    background: transparent; color: var(--text-tertiary); cursor: pointer;
    display: grid; place-items: center; transition: background var(--duration-100) var(--ease-in-out), color var(--duration-100) var(--ease-in-out);
}
.ax-art-icon svg { width: 16px; height: 16px; }
.ax-art-icon:hover { background: var(--interactive-hover); color: var(--text-primary); }
/* Gmail-draft icon after a successful draft: spent, not clickable. */
.ax-art-icon:disabled { color: var(--text-disabled); cursor: default; }
.ax-art-icon:disabled:hover { background: transparent; color: var(--text-disabled); }

/* Create Gmail draft — the flow's primary action: a labelled accent pill, not a
   bare header icon. Accent fill is a sanctioned use (fills, not hover states). */
.ax-modal-gmail {
    display: inline-flex; align-items: center; gap: 0.4rem; height: 30px; padding: 0 0.7rem;
    border: 0; border-radius: var(--radius-md); cursor: pointer;
    font-family: var(--font-mono); font-size: 10.5px; font-weight: 500;
    letter-spacing: 0.4px; text-transform: uppercase; white-space: nowrap;
    background: var(--accent-fill); color: var(--text-on-accent);
    transition: opacity var(--duration-100) var(--ease-in-out);
}
/* The display above would otherwise beat the UA sheet's [hidden] — JS hides this
   button on every non-licensing-email window (the CRM popup above all). */
.ax-modal-gmail[hidden] { display: none; }
.ax-modal-gmail svg { width: 15px; height: 15px; }
.ax-modal-gmail:hover { opacity: 0.88; }
/* Spent after a successful draft (JS disables it — one draft per open). */
.ax-modal-gmail:disabled { opacity: 0.45; cursor: default; }
.ax-modal-gmail:disabled:hover { opacity: 0.45; }
/* Gmail connection chip — sits left of the draft pill. Amber = clickable
   reconnect; lime = inert status. Hover steps a neutral, never the accent. */
.ax-gmail-chip {
    display: inline-flex; align-items: center; gap: 0.45rem; height: 30px; padding: 0 0.7rem;
    background: transparent;
    border: var(--stroke-hairline) solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-family: var(--font-mono); font-size: 10.5px; font-weight: 500;
    letter-spacing: 0.4px; text-transform: uppercase; white-space: nowrap;
    transition: border-color var(--duration-100) var(--ease-in-out),
                color var(--duration-100) var(--ease-in-out),
                opacity var(--duration-100) var(--ease-in-out);
}
.ax-gmail-chip[hidden] { display: none; }
.ax-gmail-dot { width: 7px; height: 7px; border-radius: var(--radius-pill); flex: none; }
.ax-gmail-chip[data-state="connected"] { cursor: default; }
.ax-gmail-chip[data-state="connected"] .ax-gmail-dot { background: var(--accent); }
.ax-gmail-chip[data-state="reconnect"] { cursor: pointer; }
.ax-gmail-chip[data-state="reconnect"] .ax-gmail-dot { background: var(--status-warning); }
.ax-gmail-chip[data-state="reconnect"]:hover { border-color: var(--border-strong); color: var(--text-primary); }
.ax-gmail-chip[data-state="checking"] { opacity: 0.55; cursor: default; }
.ax-gmail-chip[data-state="checking"] .ax-gmail-dot { background: var(--text-tertiary); }
.ax-art-sep { width: 1px; height: 18px; background: var(--border-default); margin: 0; flex: none; }

.ax-art-foot {
    flex: none; display: flex; align-items: center; justify-content: space-between;
    padding: 0.55rem 1rem; border-top: var(--stroke-hairline) solid var(--border-default);
}
.ax-art-ver { display: flex; align-items: center; gap: 0.3rem; }
.ax-art-vbtn {
    width: 26px; height: 26px; border: 0; border-radius: 6px; background: transparent;
    color: var(--text-tertiary); cursor: pointer; display: grid; place-items: center;
}
.ax-art-vbtn svg { width: 15px; height: 15px; }
.ax-art-vbtn:not(:disabled):hover { background: var(--interactive-hover); color: var(--text-primary); }
.ax-art-vbtn:disabled { opacity: 0.3; cursor: default; }
.ax-art-vlabel {
    font-family: var(--font-sans); font-size: 0.8rem; color: var(--text-tertiary);
    min-width: 62px; text-align: center;
}
.ax-art-publish {
    font-family: var(--font-sans); font-size: 0.85rem; font-weight: 500;
    padding: 0.4rem 1.05rem; border-radius: var(--radius-pill); cursor: pointer;
    background: var(--bg-raised); color: var(--text-primary);
    border: var(--stroke-hairline) solid var(--border-default);
    transition: background var(--duration-100) var(--ease-in-out), border-color var(--duration-100) var(--ease-in-out);
}
.ax-art-publish:hover { border-color: var(--border-strong); background: var(--interactive-hover); }

/* ---- General-purpose send button (up arrow) + 2-col starters ---------- */
.ax-run {
    width: 36px; height: 36px; padding: 0; border-radius: 50%;
    display: grid; place-items: center; flex: none;
    margin-left: auto;
}
.ax-run svg { width: 16px; height: 16px; }
.ax-run:hover:not(:disabled) { background: var(--accent-hover); }
.ax-run:disabled { opacity: 1; background: var(--bg-raised); color: var(--text-tertiary); cursor: default; }
.ax-starters { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* ============================================================================
   ARTIFACT + NEXT-STEPS — visual-design pass
   Harmonise the legacy .lr- and .art- report styling with the flat NUSX + claude
   aesthetic: drop the saturated green/navy, flatten the promise ring to the
   brand accent, neutralise data chips, and refine the next-step suggestions.
   ========================================================================== */

/* --- Next-step suggestion chips (claude-style) --- */
.ax-next { gap: 0.5rem; margin-top: 1.25rem; padding-top: 1.1rem; }
.ax-next-label { color: var(--text-tertiary); }
.ax-next-btn {
    padding: 0.5rem 0.55rem 0.5rem 0.9rem; border-radius: var(--radius-pill);
    background: var(--bg-surface); border: 1px solid var(--border-default);
    color: var(--text-primary);
    transition: border-color var(--duration-100) var(--ease-in-out), background var(--duration-100) var(--ease-in-out);
}
.ax-next-btn:hover { border-color: var(--border-strong); background: var(--interactive-hover); }
.ax-next-t { font-size: 13px; }
.ax-next-btn::after {
    content: "→"; font-size: 12px; color: var(--text-tertiary);
    transition: color var(--duration-100) var(--ease-in-out), transform var(--duration-100) var(--ease-in-out);
}
.ax-next-btn:hover::after { color: var(--text-primary); transform: translateX(2px); }

/* --- Report hero: flat surface, no gradient/border --- */
.ax-art-body .lr-hero { background: var(--bg-surface); border: 0; }
.lr-title, .lr-h2 { font-family: var(--font-sans); color: var(--text-primary); letter-spacing: -0.01em; }

/* --- Promise score: simple, compact one-line readout (no ring) --- */
.lr-gauge, .ax-art-body .lr-gauge {
    flex-direction: row; align-items: baseline; gap: 0.4rem;
    align-self: flex-start; margin: 0;
}
.lr-score-n {
    font-size: 1.9rem; font-weight: 600; line-height: 1; color: var(--text-primary);
    font-variant-numeric: tabular-nums; letter-spacing: -0.01em;
}
.lr-score-d { font-size: 0.9rem; color: var(--text-tertiary); }
.lr-gauge-sep { color: var(--text-tertiary); }
.lr-gauge-level {
    font-size: 0.9rem; font-weight: 600; color: var(--text-primary);
    text-transform: none; letter-spacing: normal; margin: 0;
}

/* --- Fit tiers: flat DS status tints (theme-aware) --- */
.art-rel { border-radius: var(--radius-pill); font-weight: 600; }
.art-rel-high { color: var(--status-success); background: var(--status-success-bg); }
.art-rel-mid  { color: var(--status-warning); background: var(--status-warning-bg); }
.art-rel-low  { color: var(--text-secondary); background: var(--bg-raised); }
.art-rel-watch{ color: var(--status-error); background: var(--status-error-bg); }
/* No coloured left band — the fit chip already carries the tier; keep a uniform hairline */
.lr-lic,
.lr-fitband-high, .lr-fitband-mid, .lr-fitband-low, .lr-fitband-watch {
    border-left-width: 1px; border-left-color: var(--border-default);
}

/* --- Data chips + mini-bars: neutral, not green/navy --- */
.lr-chip { background: var(--bg-raised); color: var(--text-secondary); font-weight: 500; border-radius: var(--radius-pill); padding: 0.12rem 0.55rem; }
.lr-lic { background: var(--bg-surface); }
.lr-lic:hover { box-shadow: none; border-color: var(--border-strong); }
.lr-foot-bar { background: var(--bg-raised); }
.lr-foot-bar i { background: var(--text-tertiary); opacity: 1; }
.lr-foot-n em { color: var(--text-secondary); }
.lr-lic-rank { background: var(--bg-raised); color: var(--text-secondary); }

/* --- Simplify pass: flat divided list, neutral chips, quiet caveat (no colour blocks) --- */
.lr-lics { gap: 0; }
.lr-lic {
    background: transparent; border: 0; border-radius: 0;
    border-top: var(--stroke-hairline) solid var(--border-default);
    padding: 1.2rem 0;
}
.lr-lic:first-child { border-top: 0; padding-top: 0.25rem; }
.lr-lic:hover { box-shadow: none; }
/* fit tier: quiet neutral chip — the word + score already rank it */
.art-rel, .art-rel-high, .art-rel-mid, .art-rel-low, .art-rel-watch {
    color: var(--text-secondary); background: var(--bg-raised); font-weight: 500;
}
/* caveat: a quiet aside, not an amber alert */
.lr-caveat { border-left-color: var(--border-strong); }
.lr-caveat-tag { color: var(--text-tertiary); }

/* Outreach: "Create drafts" completed state (agent prepared drafts; human sends) */
.btn-primary.is-done {
    background: var(--bg-raised); color: var(--text-secondary);
    border: var(--stroke-hairline) solid var(--border-default); cursor: default;
}

/* --- Outreach pack (licensing .lr-leads + investor .art-leads): flat divided list,
   no colour bands, neutral actions — matches the simplified report --- */
.lr-leads .lead-list, .art-leads .lead-list {
    border: 0; border-radius: 0; overflow: visible; margin: 0.6rem 0 0; gap: 0;
}
.lr-leads .lead-row, .art-leads .lead-row {
    background: transparent; border: 0; border-radius: 0;
    border-top: var(--stroke-hairline) solid var(--border-default); padding: 1.1rem 0;
}
.lr-leads .lead-row:first-child, .art-leads .lead-row:first-child { border-top: 0; }
.lr-leads .lead-row:hover, .art-leads .lead-row:hover { box-shadow: none; background: transparent; }
.lr-leads .lr-fitband-high, .lr-leads .lr-fitband-mid,
.lr-leads .lr-fitband-low, .lr-leads .lr-fitband-watch { border-left: 0; }
/* Email / Proposal / Deck actions: neutral outline (no green) */
.lead-action, .lr-leads .lead-action {
    color: var(--text-secondary); border-color: var(--border-default); background: transparent;
}
.lead-action:hover, .lr-leads .lead-action:hover {
    color: var(--text-primary); border-color: var(--border-strong); background: var(--interactive-hover);
}
.lead-strategic { color: var(--text-secondary); background: var(--bg-raised); }

/* ============================================================================
   SIGNAL COLOURS — subtle, restored across all flows (mono had gone too far).
   The tier reads from the chip + the score; rows stay flat (no coloured bands).
   ========================================================================== */
/* Fit / relevance chips — subtle DS status tints */
.art-rel-high  { color: var(--status-success); background: var(--status-success-bg); }
.art-rel-mid   { color: var(--status-warning); background: var(--status-warning-bg); }
.art-rel-low   { color: var(--text-secondary); background: var(--bg-raised); }
.art-rel-watch { color: var(--status-error);   background: var(--status-error-bg); }
/* Promise score — the number carries the band */
.lr-gauge-high .lr-score-n { color: var(--status-success); }
.lr-gauge-mid  .lr-score-n { color: var(--status-warning); }
.lr-gauge-low  .lr-score-n { color: var(--text-primary); }
/* Caveat — a quiet amber "watch-out" cue */
.lr-caveat-tag { color: var(--status-warning); }

/* ============================================================================
   EVALUATE REPORT — instrument cluster + Market Demand + Competition (item 2).
   Extends the .lr-* document vocabulary: neutral surfaces, hairline dividers,
   status colour only on the interest score number. No new palette.
   ========================================================================== */

/* Hero is a wrapping row for the Evaluate report: title left, instrument cluster
   right (matching the approved layout), dropping below the title on a narrow pane.
   Overrides the artifact's column-reverse gauge stack for .lr reports only. */
.ax-art-body .lr-hero {
    flex-direction: row; align-items: flex-start; justify-content: space-between;
    flex-wrap: wrap; gap: 1.5rem 2rem;
}
.ax-art-body .lr-hero .lr-hero-main { flex: 1 1 20rem; }

/* Hero right rail: two stacked readouts instead of one score line. The compound
   .lr-gauge.lr-cluster out-specifies the row layout from the base + artifact rules. */
.lr-gauge.lr-cluster,
.ax-art-body .lr-gauge.lr-cluster {
    flex: 0 0 auto; flex-direction: column; align-items: flex-start; gap: 1.1rem; margin: 0;
}
.lr-metric { display: flex; flex-direction: column; gap: 0.2rem; min-width: 9.5rem; }
.lr-metric-label {
    font-family: var(--font-mono); font-size: 0.62rem; font-weight: 500;
    letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-tertiary);
}
.lr-metric-read { display: flex; align-items: baseline; gap: 0.4rem; }
/* Segmented magnitude bar — discrete ticks read as an instrument, not a progress bar.
   Both bars are neutral; the interest band colour lives in the number alone. */
.lr-segbar { display: flex; gap: 3px; margin-top: 0.35rem; width: 9.5rem; max-width: 100%; }
.lr-seg { flex: 1; height: 5px; border-radius: var(--radius-sm); background: var(--bg-raised); }
.lr-seg.is-on { background: var(--text-secondary); }

/* Market Demand — divided company blocks, each with an optional sourced pull-quote. */
.lr-demand + .lr-demand {
    margin-top: 1.4rem; padding-top: 1.4rem;
    border-top: var(--stroke-hairline) solid var(--border-default);
}
.lr-demand-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; }
.lr-demand-name { font-weight: 600; font-size: 0.95rem; color: var(--text-primary); }
.lr-demand-trials {
    font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-tertiary);
    font-variant-numeric: tabular-nums; white-space: nowrap;
}
.lr-demand-products { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.5rem; }
.lr-demand-quote { margin: 0.75rem 0 0; padding: 0.1rem 0 0.1rem 0.9rem; border-left: 2px solid var(--border-strong); }
.lr-demand-quote p { margin: 0; font-size: 0.875rem; line-height: 1.6; color: var(--text-primary); }
.lr-demand-cite {
    display: block; margin-top: 0.45rem; font-family: var(--font-mono);
    font-size: 0.68rem; letter-spacing: 0.02em; color: var(--text-tertiary); font-style: normal;
}
.lr-demand-cite a { color: var(--accent); text-decoration: none; }
.lr-demand-cite a:hover { text-decoration: underline; }

/* Competition — divided program blocks + field note + the authored "read" thesis line. */
.lr-prog + .lr-prog {
    margin-top: 1.3rem; padding-top: 1.3rem;
    border-top: var(--stroke-hairline) solid var(--border-default);
}
.lr-prog-top { display: flex; align-items: center; gap: 0.55rem; flex-wrap: wrap; }
.lr-prog-name { font-weight: 600; font-size: 0.92rem; color: var(--text-primary); }
.lr-prog-flag {
    font-family: var(--font-mono); font-size: 0.6rem; font-weight: 500;
    letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-secondary);
    background: var(--bg-raised); border-radius: var(--radius-pill); padding: 0.12rem 0.5rem;
}
.lr-prog-meta { font-size: 0.82rem; line-height: 1.5; color: var(--text-secondary); margin-top: 0.3rem; }
.lr-prog-evidence {
    display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin-top: 0.4rem;
    font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-tertiary);
}
.lr-prog-stage { color: var(--text-secondary); }
.lr-prog-evidence a { color: var(--accent); text-decoration: none; }
.lr-prog-evidence a:hover { text-decoration: underline; }
.lr-prog-note { font-size: 0.8rem; line-height: 1.5; color: var(--text-secondary); font-style: italic; margin: 0.3rem 0 0; }
.lr-field-note { margin: 1.4rem 0 0; font-size: 0.8rem; line-height: 1.55; color: var(--text-secondary); }
.lr-field-note a { color: var(--accent); text-decoration: none; }
.lr-field-note a:hover { text-decoration: underline; }
.lr-read {
    margin: 1.4rem 0 0; padding-top: 1.2rem;
    border-top: var(--stroke-hairline) solid var(--border-default);
    font-size: 0.9rem; line-height: 1.65; color: var(--text-primary);
}

/* ---- Exact NUSX wordmark (inline SVG from Figma, node 9002:41150) ---------
   "NUS" = currentColor (theme-adaptive), "X" = brand lime baked into the SVG. */
.nusx-logo { display: block; width: auto; height: 1em; }
.sidebar-brand { color: var(--text-primary); display: inline-flex; align-items: center; }
.sidebar-brand .nusx-logo { height: 17px; }
.nusx-wm { color: var(--text-primary); display: inline-flex; align-items: center; }
.nusx-wm .nusx-logo { height: 14px; }

/* Artifact card "Open" affordance — clean SVG arrow (replaces the unicode ↗) */
.ax-card-open { display: inline-flex; align-items: center; gap: 0.25rem; }
.ax-card-open svg { width: 13px; height: 13px; flex: none; }

/* NUSX logo "X" follows the accent: lime in dark, Moss (#3F6212) in light. */
.nusx-x { fill: var(--text-accent); }

/* ============================================================
   Incubation workflows (Tacniq) — Evaluate report (.ir) + tiered lead
   shortlist (.ir-leads). Same card language as the licensing report (.lr-*),
   token-driven so both themes resolve. Cluster hues reuse the four --cat-*
   tokens; outcome chips reuse --status-*.
   ============================================================ */

/* cluster / angle / sector hue helper (fallback + per-cluster override) */
.ir-angle, .ir-cluster, .ir-cat, .ir-sector { --cl: var(--text-secondary); --cl-bg: var(--bg-active); }
.ir-hue-tactile      { --cl: var(--cat-cardio); --cl-bg: var(--cat-cardio-bg); }
.ir-hue-flexforce    { --cl: var(--cat-onco);   --cl-bg: var(--cat-onco-bg); }
.ir-hue-haptics      { --cl: var(--cat-liver);  --cl-bg: var(--cat-liver-bg); }
.ir-hue-neuromorphic { --cl: var(--cat-renal);  --cl-bg: var(--cat-renal-bg); }
.ir-hue-interconnect { --cl: var(--text-tertiary); --cl-bg: var(--bg-active); }
/* SWE-agents collection categories (mock/incubation.yaml groups.swe-agents.categories);
   same four --cat-* tokens, downplayed `verification` goes grey like interconnect. */
.ir-hue-agents       { --cl: var(--cat-cardio); --cl-bg: var(--cat-cardio-bg); }
.ir-hue-trust        { --cl: var(--cat-onco);   --cl-bg: var(--cat-onco-bg); }
.ir-hue-repair       { --cl: var(--cat-liver);  --cl-bg: var(--cat-liver-bg); }
.ir-hue-testing      { --cl: var(--cat-renal);  --cl-bg: var(--cat-renal-bg); }
.ir-hue-verification { --cl: var(--text-tertiary); --cl-bg: var(--bg-active); }

/* hero + appetite verdict */
.ir-hero {
  display: flex; gap: 1.5rem; align-items: flex-start; justify-content: space-between;
  background: linear-gradient(180deg, var(--bg-raised), var(--bg-base));
  border: 1px solid var(--border-light); border-radius: var(--radius-xl); padding: 1.4rem 1.5rem;
}
.ir-hero-main { min-width: 0; flex: 1; }
.ir-kicker {
  display: flex; align-items: center; gap: 0.5rem; font-size: 0.72rem; text-transform: uppercase;
  letter-spacing: 0.09em; font-weight: 700; color: var(--navy); margin-bottom: 0.6rem;
}
.ir-title {
  font-family: var(--font-serif); font-weight: 400; font-size: 1.7rem; line-height: 1.12;
  color: var(--text-primary); margin: 0 0 0.55rem; letter-spacing: -0.01em; text-wrap: balance;
}
.ir-idrow { display: flex; flex-wrap: wrap; gap: 0.4rem 0.55rem; align-items: center; margin-bottom: 0.85rem; }
.ir-space { font-size: 0.78rem; color: var(--text-secondary); font-weight: 600; }
.ir-tag {
  font-size: 0.72rem; padding: 0.12rem 0.5rem; border-radius: var(--radius-pill);
  background: var(--bg-active); color: var(--text-secondary); border: 1px solid var(--border-light);
}
.ir-thesis { font-size: 0.9rem; line-height: 1.55; color: var(--text-primary); margin: 0; }
.ir-verdict {
  flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 0.3rem;
  text-align: center; padding: 0.9rem 1.1rem; border-radius: var(--radius-xl);
  background: var(--accent-dim); border: 1px solid var(--border-light); max-width: 11rem; --v: var(--green);
}
.ir-verdict-no { --v: var(--slate); }
.ir-verdict-word {
  font-family: var(--font-serif); font-size: 2.3rem; line-height: 1; font-weight: 500;
  color: var(--v); letter-spacing: 0.02em;
}
.ir-verdict-qual { font-size: 0.72rem; line-height: 1.35; color: var(--text-secondary); }

/* evidence stat tiles */
.ir-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.6rem; margin-top: 1rem; }
.ir-stat {
  background: var(--bg-base); border: 1px solid var(--border-light); border-radius: var(--radius-md);
  padding: 0.75rem 0.85rem; display: flex; flex-direction: column; gap: 0.18rem;
}
.ir-stat-value { font-family: var(--font-serif); font-size: 1.12rem; font-weight: 500; color: var(--text-primary); line-height: 1.1; }
.ir-stat-label { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); font-weight: 700; }
.ir-stat-note { font-size: 0.72rem; color: var(--text-secondary); line-height: 1.35; }

/* section headers (shared) */
.ir-section { margin-top: 2rem; }
.ir-section-head { margin-bottom: 0.9rem; }
.ir-h2 { font-family: var(--font-serif); font-weight: 500; font-size: 1.25rem; color: var(--navy); margin: 0 0 0.2rem; }
.ir-section-sub { font-size: 0.8rem; line-height: 1.45; color: var(--text-secondary); }
.ir-section-sub em { font-style: italic; color: var(--text-primary); }
.ir-section-label { font-size: 0.64rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); font-weight: 700; margin-bottom: 0.5rem; }

/* "why the appetite is the right kind" positives */
.ir-positives { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.ir-positives li { position: relative; padding-left: 1.1rem; font-size: 0.85rem; line-height: 1.5; color: var(--text-secondary); }
.ir-positives li::before { content: ""; position: absolute; left: 0; top: 0.55em; width: 6px; height: 6px; border-radius: 50%; background: var(--green); }

/* asset under review */
.ir-asset {
  background: var(--bg-base); border: 1px solid var(--border-light); border-left: 3px solid var(--accent);
  border-radius: var(--radius-md); padding: 1rem 1.1rem;
}
.ir-asset-title { font-weight: 700; font-size: 0.98rem; color: var(--text-primary); margin-bottom: 0.35rem; }
.ir-asset-byline { font-size: 0.76rem; color: var(--text-muted); margin-bottom: 0.4rem; }
.ir-pno { font-family: var(--font-mono); font-size: 0.74rem; color: var(--text-secondary); font-weight: 600; }
.ir-asset-legal { font-size: 0.72rem; color: var(--text-secondary); margin-bottom: 0.55rem; }
.ir-asset-abstract { font-size: 0.85rem; line-height: 1.55; color: var(--text-secondary); margin: 0 0 0.6rem; }
.ir-asset-results { background: var(--bg-active); border-radius: var(--radius-sm); padding: 0.55rem 0.7rem; }
.ir-asset-results-label { display: block; font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); font-weight: 700; margin-bottom: 0.2rem; }
.ir-asset-results p { margin: 0; font-size: 0.82rem; line-height: 1.5; color: var(--text-secondary); }
.ir-gp-link { display: inline-block; margin-top: 0.6rem; font-size: 0.76rem; color: var(--accent); font-weight: 600; text-decoration: none; }

/* commercial angles */
.ir-angles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.7rem; }
.ir-angle {
  position: relative; background: var(--bg-base); border: 1px solid var(--border-light);
  border-left: 3px solid var(--cl); border-radius: var(--radius-md); padding: 0.85rem 1rem;
}
.ir-angle.ir-stance-omit { opacity: 0.6; }
.ir-angle.is-active { box-shadow: inset 0 0 0 1.5px var(--accent); border-left-color: var(--accent); }
.ir-angle-top { display: flex; align-items: center; gap: 0.5rem; justify-content: space-between; }
.ir-angle-name { font-weight: 700; font-size: 0.88rem; color: var(--text-primary); }
.ir-stance-tag { font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700; padding: 0.1rem 0.4rem; border-radius: var(--radius-pill); white-space: nowrap; }
.ir-stance-tag-lead { color: var(--text-on-accent); background: var(--accent-fill); }
.ir-stance-tag-support { color: var(--navy); background: var(--navy-dim); }
.ir-stance-tag-downplay { color: var(--amber); background: var(--amber-dim); }
.ir-stance-tag-omit { color: var(--text-muted); background: var(--bg-active); border: 1px solid var(--border-light); }
.ir-angle-heat { display: flex; align-items: center; gap: 0.4rem; margin: 0.55rem 0; }
.ir-heat-label { font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); font-weight: 600; }
.ir-heat-bar { display: inline-flex; gap: 2px; }
.ir-heat-bar i { width: 14px; height: 5px; border-radius: 2px; background: var(--bg-active); }
.ir-heat-word { font-size: 0.68rem; font-weight: 600; color: var(--text-secondary); text-transform: capitalize; }
.ir-heat-high .ir-heat-bar i { background: var(--green); }
.ir-heat-high .ir-heat-word { color: var(--green); }
.ir-heat-mid .ir-heat-bar i:nth-child(-n+2) { background: var(--amber); }
.ir-heat-mid .ir-heat-word { color: var(--amber); }
.ir-heat-low .ir-heat-bar i:nth-child(1) { background: var(--slate); }
.ir-angle-note { font-size: 0.8rem; line-height: 1.5; color: var(--text-secondary); margin: 0; }
.ir-angle-here { margin-top: 0.55rem; font-size: 0.64rem; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700; color: var(--accent); }

/* comparable landscape */
.ir-cluster { margin-bottom: 1.1rem; }
.ir-cluster-head { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8rem; font-weight: 700; color: var(--text-primary); margin-bottom: 0.5rem; }
.ir-cluster-dot { width: 9px; height: 9px; border-radius: 2px; background: var(--cl); flex: 0 0 auto; }
.ir-comps { display: flex; flex-direction: column; padding-left: 0.9rem; border-left: 2px solid var(--cl-bg); }
.ir-comp {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.35rem 0.55rem;
  font-size: 0.8rem; padding: 0.35rem 0; border-bottom: 1px solid var(--border-light);
}
.ir-comp:last-child { border-bottom: none; }
.ir-comp-name { font-weight: 600; color: var(--text-primary); }
.ir-comp-raised { font-variant-numeric: tabular-nums; color: var(--text-secondary); font-size: 0.76rem; }
.ir-comp-year { font-size: 0.72rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.ir-comp-note { font-size: 0.74rem; color: var(--text-muted); line-height: 1.35; flex: 1 1 100%; }
.ir-status { font-size: 0.6rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; padding: 0.1rem 0.4rem; border-radius: var(--radius-pill); white-space: nowrap; }
.ir-status-live { color: var(--status-success); background: var(--status-success-bg); }
.ir-status-acquired { color: var(--status-info); background: var(--status-info-bg); }
.ir-status-distressed { color: var(--status-warning); background: var(--status-warning-bg); }
.ir-status-dead { color: var(--status-error); background: var(--status-error-bg); }
.ir-status-public { color: var(--text-secondary); background: var(--bg-active); border: 1px solid var(--border-light); }

/* investor archetypes */
.ir-archetypes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.7rem; }
.ir-arch { background: var(--bg-base); border: 1px solid var(--border-light); border-radius: var(--radius-md); padding: 0.9rem 1rem; }
.ir-arch-top { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.4rem; }
.ir-arch-name { font-weight: 700; font-size: 0.82rem; color: var(--text-primary); line-height: 1.25; }
.ir-arch-fit { font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700; padding: 0.1rem 0.4rem; border-radius: var(--radius-pill); white-space: nowrap; }
.ir-fit-best .ir-arch-fit { color: var(--text-on-accent); background: var(--accent-fill); }
.ir-fit-strong .ir-arch-fit { color: var(--green); background: var(--green-dim); }
.ir-fit-fair .ir-arch-fit { color: var(--text-secondary); background: var(--bg-active); }
.ir-arch-note { font-size: 0.78rem; line-height: 1.5; color: var(--text-secondary); margin: 0 0 0.5rem; }
.ir-arch-ex { font-size: 0.72rem; color: var(--text-muted); line-height: 1.4; }

/* risks + actions two-column */
.ir-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-top: 2rem; }
.ir-cols .ir-section { margin-top: 0; }
.ir-risks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.ir-risks li { position: relative; padding-left: 1.15rem; font-size: 0.82rem; line-height: 1.5; color: var(--text-secondary); }
.ir-risks li::before { content: "!"; position: absolute; left: 0; top: 0; font-weight: 800; color: var(--amber); }
.ir-actions { margin: 0; padding-left: 1.2rem; display: flex; flex-direction: column; gap: 0.5rem; }
.ir-actions li { font-size: 0.82rem; line-height: 1.5; color: var(--text-secondary); }
.ir-actions li::marker { color: var(--accent); font-weight: 700; }

/* provenance footer */
.ir-source { margin-top: 2rem; font-size: 0.72rem; line-height: 1.5; color: var(--text-muted); border-top: 1px solid var(--border-light); padding-top: 0.8rem; }
.ir-source-lead strong { color: var(--text-secondary); }
.ir-caveats { margin: 0.5rem 0 0; padding-left: 1.1rem; }
.ir-caveats li { margin-bottom: 0.2rem; }
.ir-generated { display: block; margin-top: 0.5rem; font-family: var(--font-mono); font-size: 0.68rem; color: var(--text-tertiary); }

/* ---- tiered lead shortlist (.ir-leads) ---- */
.ir-leads-head { margin-bottom: 1.2rem; }
.ir-leads-sub { font-size: 0.82rem; line-height: 1.5; color: var(--text-secondary); margin: 0.4rem 0 0; }
/* .ir-inferred / .ir-inferred-key removed with the asterisk marks (Balaji, 2026-07-29). */
.ir-tier { margin-top: 1.4rem; }
.ir-tier-head { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.3rem; }
.ir-tier-badge {
  font-size: 0.64rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-on-accent); background: var(--accent-fill); padding: 0.15rem 0.5rem; border-radius: var(--radius-sm);
}
.ir-tier-label { font-family: var(--font-serif); font-size: 1.05rem; font-weight: 500; color: var(--text-primary); }
.ir-tier-count { margin-left: auto; font-size: 0.72rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.ir-tier-blurb { font-size: 0.78rem; line-height: 1.45; color: var(--text-secondary); margin: 0 0 0.7rem; }
.ir-leads .lead-list.ir-firm-list { margin: 0.4rem 0 0; }
.ir-firm { align-items: center; }
.ir-firm-rank {
  flex: 0 0 auto; width: 1.5rem; height: 1.5rem; border-radius: 50%; background: var(--bg-active);
  color: var(--text-secondary); font-weight: 700; font-size: 0.76rem; display: grid; place-items: center;
  font-variant-numeric: tabular-nums;
}
.ir-firm-body { flex: 1; min-width: 0; }
.ir-firm-top { display: flex; align-items: baseline; gap: 0.5rem; flex-wrap: wrap; }
.ir-firm-name { font-weight: 700; font-size: 0.9rem; color: var(--text-primary); }
.ir-firm-country {
  font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted);
  background: var(--bg-active); border-radius: var(--radius-pill); padding: 0.08rem 0.45rem;
}
.ir-firm-led { font-size: 0.78rem; color: var(--text-secondary); margin-top: 0.15rem; }
.ir-firm-led strong { color: var(--text-primary); font-weight: 600; }
.ir-firm-note { font-size: 0.76rem; line-height: 1.45; color: var(--text-muted); margin: 0.25rem 0 0; }

/* ============================================================
   FUND-STATUS SHORTLIST (.ldf-*) — the tiered lead shortlist as an aligned two-column
   ledger. Each firm carries a fund-status dot (Deploying green / Harvesting amber / Off
   balance sheet grey); deploying funds also show their latest vintage + fund size, and
   every firm shows the month/year of its most recent deal. A shared column track
   (--ldf-cols) drives the header and every row so the two columns line up down the list.
   Scoped to .ldf-leads so the licensing shortlist (also .ir-leads) is untouched.
   ============================================================ */
/* rank · firm · fund status · last deal. (The leading grip and trailing remove
   tracks went with the read-only pass — the list is not editable.) */
/* Both modes share these four tracks. Outreach does NOT add a fifth: a trailing actions
   track cost ~5rem of an already-tight row and squeezed the firm name and fund status
   into wrapping (Balaji, 2026-07-29). The Proposal / Email pair drops to its own row
   beneath the ledger line instead (see the min-width block below), so Lead Gen and
   Outreach align column-for-column. */
.ldf-leads { --ldf-cols: 1.25rem minmax(0, 1fr) 10rem 3.5rem; }
/* Outreach adds a narrow trailing actions column; the Proposal / Email pair STACKS inside
   it (the rows are two lines tall, so a stacked pair fits without a separate row). Status
   and last-deal are trimmed to give that column its width back. */
.ldf-leads.ldf-outreach { --ldf-cols: 1.25rem minmax(0, 1fr) 9.5rem 3.3rem 4.6rem; }
.ldf-actioncell { display: flex; align-items: center; gap: 0.4rem; }
.ldf-actioncell .lead-action { text-align: center; }
/* Internal-note icon sits inline after the firm name (see incubation_leads.html for
   why it isn't in a trailing cell like licensing's). Nudged up to sit on the name's
   optical line rather than its baseline box. */
.ldf-note { flex: 0 0 auto; margin-left: 0.1rem; }

/* status legend — the key that used to live in the roll-up */
.ldf-legend { display: flex; flex-wrap: wrap; gap: 0.35rem 1.3rem; margin-top: 0.85rem; }
.ldf-leg { display: inline-flex; align-items: center; gap: 0.4rem; font-family: var(--font-mono); font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-secondary); }
.ldf-leg-note { text-transform: none; letter-spacing: 0; color: var(--text-muted); }

/* status dots — green deploying / amber harvesting / grey dead (not investing) */
.ldf-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--text-muted); flex: 0 0 auto; display: inline-block; }
.ldf-dot-deploying { background: var(--status-success); }
.ldf-dot-slowing { background: var(--status-warning); }
.ldf-dot-dead { background: var(--text-disabled); }

/* --- the ledger: column header + rows share --ldf-cols so both columns align --- */
.ldf-leads .ldf-colhead {
  display: grid; grid-template-columns: var(--ldf-cols); align-items: end; column-gap: 0.5rem;
  padding: 0 0.15rem 0.4rem; margin-top: 0.55rem; border-bottom: 1px solid var(--border-light);
}
.ldf-ch { font-family: var(--font-mono); font-size: 0.53rem; text-transform: uppercase; letter-spacing: 0.09em; color: var(--text-disabled); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ldf-ch-num { text-align: right; }

/* flat list — override the base bordered-card .lead-list / surface .lead-row */
.ldf-leads .ir-firm-list.lead-list { border: 0; border-radius: 0; overflow: visible; margin: 0; }
.ldf-leads .lead-row.ldf-firm {
  display: grid; grid-template-columns: var(--ldf-cols); align-items: center; column-gap: 0.5rem;
  background: transparent; border: 0; border-top: 1px solid var(--border-light);
  padding: 0.6rem 0.15rem; cursor: default;
}
.ldf-leads .lead-row.ldf-firm:first-child { border-top: 0; }
.ldf-leads .lead-row.ldf-firm:hover { background: var(--bg-hover); }
.ldf-metrics { display: contents; }

/* drag grip — subtle, reveals on row hover (reorder is a curate affordance) */



/* rank — quiet mono numeral, right-set against the firm name */
.ldf-leads .ldf-rank { font-family: var(--font-mono); font-size: 0.72rem; font-variant-numeric: tabular-nums; color: var(--text-muted); text-align: right; }

/* firm cell — name + inline country, then a muted "led X · descriptor" sub-line */
.ldf-leads .ldf-firmcell { min-width: 0; }
/* align-items: baseline would drop the note button below the name's baseline box —
   center it instead, and let the text items keep their own alignment. */
.ldf-leads .ldf-firm-line { display: flex; align-items: center; gap: 0.4rem; }
.ldf-leads .ir-firm-name { font-weight: 650; font-size: 0.86rem; color: var(--text-primary); line-height: 1.25; overflow-wrap: anywhere; }
.ldf-country { font-family: var(--font-mono); font-size: 0.55rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-muted); flex: none; }
.ldf-firm-sub { display: flex; align-items: baseline; min-width: 0; font-size: 0.72rem; line-height: 1.4; color: var(--text-muted); margin-top: 0.12rem; }
.ldf-led { flex: none; white-space: nowrap; }
.ldf-led strong { color: var(--text-secondary); font-weight: 600; }
/* descriptor wraps to at most two lines rather than truncating mid-word (Anni, 2026-07-29) */
.ldf-desc { flex: 1 1 auto; min-width: 0; color: var(--text-muted); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ldf-sub-sep { margin: 0 0.34rem; color: var(--text-disabled); }
.ldf-leads .ldf-uncovered .ir-firm-name { color: var(--text-secondary); }

/* fund status — semantic dot + mono label, and (deploying only) a scale line:
   vintage + fund size, else AUM (evergreen / undisclosed), else an off-balance note */
.ldf-statuscell { min-width: 0; }
.ldf-status { display: inline-flex; align-items: center; gap: 0.32rem; font-family: var(--font-mono); font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; white-space: nowrap; }
.ldf-status-deploying { color: var(--status-success); }
.ldf-status-slowing { color: var(--status-warning); }
.ldf-status-dead { color: var(--text-muted); }
.ldf-status-detail { display: block; margin-top: 0.14rem; font-family: var(--font-mono); font-size: 0.68rem; color: var(--text-secondary); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ldf-unit { color: var(--text-muted); }
.ldf-evergreen { color: var(--text-secondary); }
.ldf-detail-mute { color: var(--text-disabled); }

/* last deal — right-aligned mono month/year */
.ldf-leads .ldf-lastdeal { font-family: var(--font-mono); font-size: 0.76rem; color: var(--text-secondary); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.ldf-dash { color: var(--text-disabled); font-weight: 400; }

/* remove — compact, hover-revealed (space reserved so the grid never shifts) */





/* Outreach actions live in their own narrow trailing column (see --ldf-cols above) with
   the Proposal / Email buttons STACKED (Anni, 2026-07-29 — the side-by-side pair read as
   crammed against the date). Scoped to min-width so the narrow-screen block below, which
   stacks the whole row via its own grid-areas, isn't outranked. */
@media (min-width: 561px) {
  .ldf-leads.ldf-outreach .ldf-actioncell {
    flex-direction: column; align-items: flex-end; justify-content: center; gap: 0.28rem;
  }
  /* smaller, fixed-narrow buttons hugged to the right edge, so a clear gap opens between
     them and the last-deal column (Anni, 2026-07-29) */
  .ldf-leads.ldf-outreach .ldf-actioncell .lead-action {
    width: 3.9rem; font-size: 10px; padding: 0.22rem 0.4rem;
  }
}

@media (max-width: 560px) {
  .ir-hero { flex-direction: column-reverse; align-items: stretch; }
  .ir-stats, .ir-market-stats { grid-template-columns: repeat(2, 1fr); }
  .ir-angles, .ir-archetypes { grid-template-columns: 1fr; }
  .ir-cols { grid-template-columns: 1fr; gap: 0; }
  .ir-cols .ir-section:last-child { margin-top: 2rem; }
  /* ledger reflows to firm-on-top, status + last deal below; hairline header hidden */
  .ldf-leads .ldf-colhead { display: none; }
  .ldf-leads .lead-row.ldf-firm {
    grid-template-columns: 1.2rem 1fr;
    grid-template-areas: "rank firm" "meta meta" "actions actions";
    column-gap: 0.55rem; row-gap: 0.5rem; padding: 0.75rem 0.15rem;
  }
  .ldf-leads .ldf-rank { grid-area: rank; }
  .ldf-leads .ldf-firmcell { grid-area: firm; }
  /* narrow screens have full row width — the desktop vertical stack goes back to a
     left-aligned horizontal pair under the metrics. */
  .ldf-actioncell { grid-area: actions; flex-direction: row; align-items: stretch; justify-content: flex-start; }
  .ldf-actioncell .lead-action { text-align: center; }
  /* One left-aligned wrapping readout — status · scale · last deal. The desktop
     column split (space-between) reads as random gaps once the header is hidden,
     so the date gets its own inline mini-label instead of a column. */
  .ldf-metrics {
    grid-area: meta; display: flex; flex-wrap: wrap; align-items: baseline;
    justify-content: flex-start; column-gap: 0.6rem; row-gap: 0.25rem;
  }
  .ldf-statuscell { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 0.6rem; row-gap: 0.25rem; }
  .ldf-status-detail { display: inline; margin-top: 0; white-space: normal; overflow: visible; }
  .ldf-leads .ldf-lastdeal { text-align: left; }
  .ldf-leads .ldf-lastdeal::before {
    content: "last deal"; margin-right: 0.35rem;
    font-family: var(--font-mono); font-size: 0.58rem; font-weight: 500;
    text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted);
  }
}

/* ============================================================
   Incubation Evaluate report — "deal tearsheet". Tri-modal encoding so a datum's
   form signals its kind: numbers = mono, editorial judgment = colored text,
   lifecycle state = semantic dot, entities = links. Sectors are header bands;
   comparables nest under them as aligned ledger rows.
   ============================================================ */

/* one utility label, used everywhere (uppercase mono, muted) */
.ir-label { font-family: var(--font-mono); font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.09em; color: var(--text-muted); font-weight: 500; }

/* header: title + interest readout */
.ir-head { margin-bottom: 1.6rem; }
.ir-headgrid { display: flex; align-items: flex-start; justify-content: space-between; gap: 1.4rem; margin-top: 0.55rem; }
.ir-headgrid .ir-title { margin: 0; flex: 1; }
.ir-verdict { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; gap: 0.15rem; text-align: right; padding-top: 0.2rem; }
.ir-verdict-value { font-size: 1.15rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.01em; line-height: 1; color: var(--slate); }
.ir-verdict-high { color: var(--green); }
.ir-verdict-mid { color: var(--amber); }
.ir-verdict-low { color: var(--slate); }
.ir-idrow { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin-top: 0.75rem; }
.ir-meta { font-size: 0.76rem; color: var(--text-muted); }
.ir-meta-sep { color: var(--text-disabled); }
.ir-interest-why { font-size: 0.88rem; line-height: 1.55; color: var(--text-secondary); margin: 0.85rem 0 0; max-width: 62ch; }

/* collection strip — the report evaluates a research collection, not one filing.
   A quiet bounded block that names the inventor's programme and lists its assets,
   flagging the one under review. Reuses the report's accent-tag + mono vocabulary. */
.ir-collection { margin-top: 0.95rem; padding: 0.8rem 0.9rem; background: var(--bg-surface); border: 1px solid var(--border-light); border-radius: var(--radius-md); }
.ir-collection-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem; }
.ir-collection-tag { flex: none; font-family: var(--font-mono); font-size: 0.58rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; color: var(--accent); border: 1px solid var(--accent); border-radius: var(--radius-pill); padding: 0.06rem 0.45rem; }
.ir-collection-inv { font-family: var(--font-mono); font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-primary); }
.ir-collection-name { font-size: 0.8rem; color: var(--text-secondary); }
.ir-collection-count { margin-left: auto; font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.02em; color: var(--text-muted); }
.ir-collection-members { list-style: none; margin: 0.7rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.25rem; }
.ir-collection-members li { margin: 0; }
/* each member is a selector — clicking it swaps the abstract section below */
.ir-collection-member { display: flex; align-items: baseline; gap: 0.5rem; width: 100%; text-align: left; cursor: pointer; padding: 0.36rem 0.55rem; border-radius: var(--radius-sm); font-size: 0.78rem; color: var(--text-secondary); background: transparent; border: 1px solid transparent; transition: background var(--duration-100) var(--ease-in-out), border-color var(--duration-100) var(--ease-in-out), color var(--duration-100) var(--ease-in-out); }
.ir-collection-member:hover { background: var(--bg-raised); border-color: var(--border-light); color: var(--text-primary); }
.ir-collection-member.is-active { background: var(--bg-raised); color: var(--text-primary); border-color: var(--border-light); box-shadow: inset 2px 0 0 var(--accent); }
.ir-collection-mtitle { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ir-collection-mpno { flex: none; margin-left: auto; font-family: var(--font-mono); font-size: 0.64rem; color: var(--text-muted); }
.ir-collection-note { font-size: 0.74rem; line-height: 1.5; color: var(--text-muted); margin: 0.65rem 0 0; }

/* selected-patent title above the abstract */
.ir-fm-title { font-size: 0.98rem; font-weight: 600; color: var(--text-primary); line-height: 1.35; margin: 0 0 0.15rem; letter-spacing: -0.01em; }
.ir-fm .ir-idrow { margin-top: 0.35rem; margin-bottom: 0.75rem; }

/* collection badge on the lead-gen / outreach header — the same programme, inline */
.ir-leads-collection { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem; margin: 0.65rem 0 0; }

/* frontmatter — the IP itself, accent-tabbed; key tech reads as a spec line */
.ir-fm { margin-top: 1.1rem; padding: 1.1rem 1.2rem; background: var(--bg-surface); border: 1px solid var(--border-light); border-left: 3px solid var(--accent); border-radius: var(--radius-md); }
.ir-fm-abstract { font-size: 0.88rem; line-height: 1.65; color: var(--text-secondary); margin: 0; }
.ir-fm-tech { margin-top: 0.85rem; padding-top: 0.85rem; border-top: 1px solid var(--border-light); }
.ir-fm-tech .ir-label { display: block; margin-bottom: 0.35rem; }
.ir-spec { margin: 0; font-family: var(--font-mono); font-size: 0.76rem; line-height: 1.65; color: var(--text-secondary); }
.ir-gp-link { display: inline-block; margin-top: 0.85rem; font-family: var(--font-mono); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--accent); text-decoration: none; }
.ir-gp-link:hover { text-decoration: underline; text-underline-offset: 2px; }

/* market — stat values are mono readouts */
.ir-market-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; margin-bottom: 1rem; }
.ir-market-stats .ir-stat { background: var(--bg-surface); border: 1px solid var(--border-light); border-radius: var(--radius-md); padding: 0.8rem 0.9rem; display: flex; flex-direction: column; gap: 0.25rem; }
.ir-market-stats .ir-stat-value { font-family: var(--font-mono); font-size: 1.1rem; font-weight: 600; color: var(--text-primary); letter-spacing: -0.02em; }
.ir-market-stats .ir-stat-note { font-size: 0.72rem; color: var(--text-secondary); line-height: 1.35; }
.ir-market-note { font-size: 0.88rem; line-height: 1.65; color: var(--text-secondary); margin: 0; }

/* sector band */
.ir-sector { margin-top: 1.7rem; padding-top: 1.7rem; border-top: 1px solid var(--border-light); }
.ir-sector:first-of-type { margin-top: 0.5rem; padding-top: 0; border-top: none; }
.ir-sector-top { display: flex; align-items: center; gap: 0.6rem; }
.ir-stance { display: inline-flex; align-items: center; gap: 0.32rem; font-family: var(--font-mono); font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 600; }
.ir-stance-glyph { font-size: 0.68em; line-height: 1; }
.ir-stance-lead { color: var(--accent); }
.ir-stance-lead .ir-stance-glyph::before { content: "\25B2"; }              /* ▲ */
.ir-stance-support { color: var(--text-secondary); }
.ir-stance-support .ir-stance-glyph::before { content: "\25C6"; }           /* ◆ */
.ir-stance-downplay { color: var(--text-muted); }
.ir-stance-downplay .ir-stance-glyph::before { content: "\25BD"; }          /* ▽ */
.ir-matches { font-family: var(--font-mono); font-size: 0.58rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; color: var(--accent); border: 1px solid var(--accent); border-radius: var(--radius-pill); padding: 0.06rem 0.45rem; }
.ir-relevance { margin-left: auto; display: inline-flex; align-items: baseline; gap: 0.35rem; }
.ir-relevance b { font-family: var(--font-mono); font-size: 1rem; font-weight: 600; color: var(--text-primary); letter-spacing: -0.02em; }
.ir-sector-name { font-size: 1.2rem; font-weight: 600; color: var(--text-primary); margin: 0.45rem 0 0; letter-spacing: -0.015em; }
.ir-sector-meter { height: 3px; background: var(--bg-active); border-radius: var(--radius-pill); overflow: hidden; margin: 0.65rem 0 0.75rem; }
.ir-sector-meter span { display: block; height: 100%; background: var(--cl); border-radius: var(--radius-pill); }
.ir-sector.is-active .ir-sector-meter span { background: var(--accent); }
.ir-sector-traction { font-size: 0.84rem; line-height: 1.55; color: var(--text-secondary); margin: 0 0 0.9rem; }

/* comparables — ledger rows nested under a hue-tinted rule */
.ir-firms { border-left: 2px solid var(--cl-bg); padding-left: 1.15rem; }
.ir-firm-row { padding: 0.7rem 0; }
.ir-firm-row + .ir-firm-row { border-top: 1px solid var(--border-light); }
.ir-firm-line { display: grid; grid-template-columns: minmax(0, 1fr) 6rem 5.6rem; align-items: baseline; column-gap: 1rem; }
.ir-entity { text-decoration: none; }
.ir-entity:focus-visible { outline: 1.5px solid var(--accent); outline-offset: 2px; border-radius: 1px; }
.ir-company { font-size: 0.92rem; font-weight: 600; color: var(--text-primary); }
.ir-company::after { content: "\2197"; font-size: 0.66em; margin-left: 0.22rem; color: var(--text-muted); vertical-align: 0.1em; }  /* ↗ */
.ir-company:hover { color: var(--text-primary); text-decoration: underline; text-underline-offset: 3px; }
.ir-company:hover::after { color: var(--text-primary); }
.ir-raised { justify-self: end; text-align: right; font-family: var(--font-mono); font-size: 0.86rem; font-weight: 600; color: var(--text-primary); letter-spacing: -0.02em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ir-state { justify-self: start; display: inline-flex; align-items: center; gap: 0.35rem; font-family: var(--font-mono); font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); white-space: nowrap; }
.ir-state i { width: 6px; height: 6px; border-radius: 50%; background: var(--text-muted); flex: 0 0 auto; }
.ir-state-live i { background: var(--status-success); }
.ir-state-acquired i { background: var(--status-info); }
.ir-state-distressed i { background: var(--status-warning); }
.ir-state-distressed { color: var(--status-warning); }
.ir-state-dead i { background: var(--status-error); }
.ir-state-dead { color: var(--status-error); }
.ir-firm-desc { font-size: 0.8rem; line-height: 1.5; color: var(--text-secondary); margin: 0.35rem 0 0; }
.ir-ledby { display: flex; align-items: center; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.55rem; }
.ir-ledby .ir-label { margin-right: 0.15rem; }
.ir-investor { font-size: 0.74rem; color: var(--navy); background: var(--navy-dim); border: 1px solid transparent; border-radius: var(--radius-sm); padding: 0.13rem 0.5rem; font-weight: 500; transition: border-color var(--duration-100) var(--ease-in-out), background var(--duration-100) var(--ease-in-out); }
.ir-investor:hover { border-color: var(--navy); }

.ir-downplay { font-size: 0.78rem; line-height: 1.55; color: var(--text-muted); margin: 1.5rem 0 0; padding-top: 1rem; border-top: 1px solid var(--border-light); }

@media (max-width: 560px) {
  .ir-headgrid { flex-direction: column; gap: 0.6rem; }
  .ir-verdict { text-align: left; flex-direction: row; align-items: baseline; gap: 0.4rem; }
  .ir-firm-line { grid-template-columns: 1fr auto; column-gap: 0.8rem; row-gap: 0.35rem; }
  .ir-company { grid-column: 1 / -1; }
  .ir-raised { justify-self: start; text-align: left; }
}
.ir-downplay { font-size: 0.76rem; line-height: 1.5; color: var(--text-muted); margin: 0.4rem 0 0; padding-left: 0.9rem; border-left: 2px solid var(--border-light); }

/* ============================================================
   ARTIFACT CONTENT — document treatment (claude.ai)
   The pane renders a DOCUMENT, not a dashboard: content sits directly on
   --bg-panel, sections are divided by hairlines, and there is ONE reading
   measure. Previously the hero was a --bg-surface card while everything
   below it was flat on the panel — two systems stacked, which is the thing
   claude.ai's artifact never does. Cards are reserved for data that is
   genuinely tabular (stat tiles), not for prose.
   ============================================================ */

.ax-art-body { padding: 2.25rem 2rem 4rem; }

/* One measure for the whole document (~68ch). The pane grows to 900px; the
   text column should not. `.art` already centres itself (margin: 0 auto), so
   this only tightens the measure — the column stays centred, as on claude.ai. */
.ax-art-body > .art { max-width: 43rem; }

/* Title block: flat. It's the document's masthead, not a card. */
.ax-art-body .lr-hero,
.ax-art-body .ir-hero {
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0;
    gap: 0.85rem;
}

/* Headings are TEXT, not colour. The .ir-* report never got the "retire the
   stray navy" pass that .lr-* did, so the two reports disagreed: blue headings
   and a blue kicker here, neutral there. claude.ai sets artifact headings in
   text-100 and keeps metadata chips neutral. Finish the job. */
.ax-art-body .ir-title,
.ax-art-body .ir-h2 {
    font-family: var(--font-sans);
    color: var(--text-primary);
    letter-spacing: -0.01em;
}
.ax-art-body .ir-kicker { color: var(--text-secondary); }
.ax-art-body .ir-investor {
    color: var(--text-secondary);
    background: var(--bg-raised);
}
.ax-art-body .ir-investor:hover { border-color: var(--border-strong); }

/* Document type scale — body was 0.9rem/1.5, too tight to read as prose. */
.ax-art-body .lr-title,
.ax-art-body .ir-title { font-size: 2rem; line-height: 1.18; margin-bottom: 0.9rem; }
.ax-art-body .lr-thesis,
.ax-art-body .ir-thesis { font-size: 0.95rem; line-height: 1.7; }
.ax-art-body .lr-h2,
.ax-art-body .ir-h2 { font-size: 1.2rem; line-height: 1.3; margin-bottom: 0.4rem; }
.ax-art-body .lr-section-sub,
.ax-art-body .ir-section-sub { font-size: 0.85rem; line-height: 1.6; }
.ax-art-body .lr-lic-why { font-size: 0.875rem; line-height: 1.65; }
.ax-art-body .lr-caveat { font-size: 0.875rem; line-height: 1.6; }

/* Sections divided by a rule — the artifact's structural device. */
.ax-art-body .lr-section,
.ax-art-body .ir-section,
.ax-art-body .lr-abstract {
    margin-top: 2.25rem;
    padding-top: 2.25rem;
    border-top: var(--stroke-hairline) solid var(--border-default);
}
.ax-art-body .lr-section-head,
.ax-art-body .ir-section-head { margin-bottom: 1.25rem; }

/* The closing provenance note is an aside, not a section. */
.ax-art-body .lr-source {
    margin-top: 2.25rem; padding-top: 1.25rem;
    font-size: 0.75rem; line-height: 1.6;
}

/* ============================================================
   MODAL — cover-email preview.
   Opens over the shortlist instead of replacing the pane, so the ranking you
   launched from stays put. Uses claude.ai's overlay motion: in at 250ms
   ease-out (fade + zoom), out faster at 125ms ease-in.
   ============================================================ */

/* [hidden] is display:none in the UA sheet, but the rules below set `display`,
   which wins on specificity — without these the modal is permanently on screen. */
.ax-modal[hidden],
.ax-modal-backdrop[hidden] { display: none; }

.ax-modal-backdrop {
    position: fixed; inset: 0; z-index: 300;
    background: var(--bg-overlay);
    animation: ax-modal-fade var(--modal-animation-duration) var(--ease-out) both;
}
.ax-modal-backdrop.is-closing {
    animation: ax-modal-fade var(--modal-close-duration) var(--ease-in) reverse both;
}

.ax-modal {
    position: fixed; z-index: 301;
    top: 50%; left: 50%;
    width: min(680px, calc(100vw - 3rem));
    max-height: min(760px, calc(100vh - 4rem));
    display: flex; flex-direction: column;
    background: var(--bg-surface);
    border: var(--stroke-hairline) solid var(--border-default);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-popover);
    animation: ax-modal-in var(--modal-animation-duration) var(--ease-out) both;
}
.ax-modal.is-closing {
    animation: ax-modal-in var(--modal-close-duration) var(--ease-in) reverse both;
}
/* The dialog takes focus on open (for screen readers / Esc), but it is a
   container — the browser's default ring on it is noise, not a focus cue. */
.ax-modal:focus { outline: none; }

@keyframes ax-modal-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ax-modal-in {
    from { opacity: 0; transform: translate(-50%, -50%) scale(0.97); }
    to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.ax-modal-head {
    flex: none; padding: 1rem 1.1rem;
    border-bottom: var(--stroke-hairline) solid var(--border-default);
}
.ax-modal-headrow {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem;
}
.ax-modal-heading { min-width: 0; }
.ax-modal-kicker {
    font-family: var(--font-mono); font-size: 10px; font-weight: 500;
    letter-spacing: 0.6px; text-transform: uppercase; color: var(--text-tertiary);
    margin-bottom: 0.15rem;
}
.ax-modal-title {
    font-family: var(--font-sans); font-size: 0.95rem; font-weight: 500;
    color: var(--text-primary); line-height: 1.35;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* The licensee's internal note, lifted out of the fetched email into the header (see
   liftNote in agent.js). Collapsed it's a pill under the name; expanded it pushes the
   header down, which is why the head is flex:none and the body scrolls. Its own row, so
   the prose reads at the modal's full measure instead of the title column's width. */
.ax-modal-noteslot:empty { display: none; }
.ax-modal-noteslot .doc-note { margin: 0.55rem 0 0; }
.ax-modal-noteslot .doc-note-body { margin-top: 0.55rem; max-height: 11rem; overflow-y: auto; }
.ax-modal-noteslot .doc-note-body p { font-size: 0.8rem; }
/* Actions reuse .ax-art-icon from the panel header — same icons, same behaviour. */
.ax-modal-actions { flex: none; display: flex; align-items: center; gap: 0.15rem; }

.ax-modal-body { flex: 1 1 auto; overflow-y: auto; padding: 1.5rem 1.6rem 2rem; }
/* The email renders as a document, same as the pane — one measure, no card. */
.ax-modal-body > .art { max-width: none; margin: 0; }
.ax-modal-body .ax-art-load { color: var(--text-tertiary); font-size: 0.85rem; }

@media (max-width: 640px) {
    .ax-modal { width: calc(100vw - 1.5rem); max-height: calc(100vh - 2rem); }
    .ax-modal-body { padding: 1.1rem 1.1rem 1.6rem; }
}

/* ============================================================
   MOBILE — additive small-screen layer.
   Every rule below is either a display:none default for
   mobile-only chrome or scoped to a max-width media query,
   so desktop rendering is byte-for-byte unchanged.
   ============================================================ */

/* Mobile-only chrome is inert on desktop. */
.mobile-topbar { display: none; }
.sidebar-backdrop { display: none; }

@media (max-width: 900px) {
    :root { --mobile-topbar-h: 52px; }

    /* -- Fixed topbar with hamburger ------------------------------------ */
    .mobile-topbar {
        display: flex;
        align-items: center;
        gap: 0.375rem;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: var(--mobile-topbar-h);
        padding: 0 0.75rem;
        background: var(--bg-base);
        border-bottom: 1px solid var(--border);
        z-index: 90;
    }
    .mobile-nav-btn {
        display: grid;
        place-items: center;
        width: 36px;
        height: 36px;
        border: none;
        background: none;
        color: var(--text-secondary);
        border-radius: var(--radius-sm);
        cursor: pointer;
    }
    .mobile-nav-btn svg { width: 20px; height: 20px; }
    .mobile-nav-btn:hover { background: var(--bg-raised); color: var(--text-primary); }
    .mobile-nav-btn:focus-visible { outline: 1.5px solid var(--accent); outline-offset: 1px; }
    .mobile-brand { display: inline-flex; align-items: center; color: var(--text-primary); }
    .mobile-brand .nusx-logo { height: 15px; }

    /* Push the app below the fixed topbar. */
    body { padding-top: var(--mobile-topbar-h); }

    /* -- Sidebar becomes an off-canvas drawer --------------------------- */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        height: 100dvh;
        transform: translateX(-100%);
        transition: transform var(--duration-300) var(--ease-emphasis);
        z-index: 110;
    }
    body.sidebar-open .sidebar { transform: none; }
    body.sidebar-open { overflow: hidden; }

    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: var(--bg-overlay);
        opacity: 0;
        pointer-events: none;
        transition: opacity var(--duration-200) var(--ease-out);
        z-index: 100;
    }
    body.sidebar-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }

    /* Full-height views must account for the fixed topbar. */
    .ax { height: calc(100vh - var(--mobile-topbar-h)); height: calc(100dvh - var(--mobile-topbar-h)); }

    /* Split view: the docked artifact pane can't share a phone screen with the
       thread (its clamp() floor is 460px) — it takes over instead, and the
       existing ✕ returns to the conversation. */
    .ax-artifact { height: 100%; }
    .ax.is-split .ax-conversation { display: none; }
    .ax.is-split .ax-artifact { flex-basis: 100%; border-left: 0; }
}

@media (max-width: 900px) and (prefers-reduced-motion: reduce) {
    .sidebar,
    .sidebar-backdrop { transition: none; }
}

@media (max-width: 720px) {
    /* -- Page chrome ----------------------------------------------------- */
    .page-bar { padding: 0 1rem; gap: 0.75rem; }
    .page-bar-meta {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .page-content { padding: 1.25rem 1rem 2rem; }

    /* -- Investor list: firm + portfolio count stay on the lead line,
          detail cells stack underneath at full width ---------------------- */
    .investor-list-header { grid-template-columns: 32px 1fr auto; }
    .investor-list-header span:nth-child(3),
    .investor-list-header span:nth-child(4),
    .investor-list-header span:nth-child(5) { display: none; }
    .investor-row { grid-template-columns: 32px 1fr auto; row-gap: 0.3rem; }
    .investor-row .avatar { grid-row: 1; grid-column: 1; }
    .investor-row .entity-row-main { grid-row: 1; grid-column: 2; }
    .investor-row .entity-row-count { grid-row: 1; grid-column: 3; }
    .investor-row .entity-row-cell {
        grid-column: 2 / -1;
        max-width: none;
        white-space: normal;
    }
    /* A bare "—" reads fine under a desktop column header; as a stacked
       mobile line it's just noise. */
    .investor-row .entity-row-cell.is-empty { display: none; }

    /* -- Agent home (.ax) ------------------------------------------------ */
    .ax-landing { padding: 2rem 1.25rem 1rem; }
    .ax-starters { grid-template-columns: 1fr; }
    .ax-thread { padding-left: 1.1rem; padding-right: 1.1rem; }
    .ax-composer-wrap { padding: 0.5rem 1rem 0.85rem; }
    .ax-u-bubble { max-width: 92%; }

    /* -- Matchmaking shells ----------------------------------------------- */
    .mm-shell { padding: 2rem 1.25rem 4rem; }
    .mm-deck-shell { padding: 1.25rem 1rem 3rem; }
    .mm-card-name { white-space: normal; font-size: 1.5rem; line-height: 1.15; }

    /* -- Stat bands wrap 2-up instead of squeezing 4 across --------------- */
    .stats-row { flex-wrap: wrap; }
    .stat-block { flex: 1 1 40%; }

    /* -- Licensing lead/outreach rows (.ir-leads): the one-line flex row
          (drag · rank · body · Email/Proposal/Remove) starves the text column
          on phones. Wrap: body takes the full line after the rank, actions
          drop to their own row. Drag-reorder is a pointer affordance — hide. */
    .lead-row.ir-firm { flex-wrap: wrap; }
    .lead-row.ir-firm 
    .lead-row.ir-firm .ir-firm-body { flex: 1 1 calc(100% - 2.25rem); }
    .lead-row.ir-firm .lead-actions {
        flex: 1 1 100%;
        justify-content: flex-end;
        margin-top: 0.25rem;
    }

    /* -- Detail-page tab strip scrolls sideways instead of overflowing ---- */
    .tab-strip {
        overflow-x: auto;
        scrollbar-width: none;      /* the underline border already cues position */
    }
    .tab-strip::-webkit-scrollbar { display: none; }
    .tab-btn { white-space: nowrap; flex-shrink: 0; }
}
