
  /* ── Dark mode (Sara 2026-09-15): dark green surfaces, light text, the same two
     greens for accents, purple where it was purple. First pass: the shared frame,
     cards, rails, tables and text. Anything still white is a spot to report. ── */
  body.phi-dark { --page-bg:var(--color-page-bg); --content-bg:var(--color-surface-subtle); --cream:var(--color-surface-subtle); --border:var(--color-border); --text:var(--color-text); --muted:var(--color-text-muted); --warm:var(--color-surface-muted); background:var(--color-page-bg) !important; color:var(--color-text); }
  body.phi-dark .content, body.phi-dark .main, body.phi-dark #view-model, body.phi-dark #view-projects, body.phi-dark #fin-main, body.phi-dark .ledger-wrap, body.phi-dark .m2wrap, body.phi-dark #view-people, body.phi-dark #view-members, body.phi-dark #view-home, body.phi-dark .phi-shellmain, body.phi-dark #out-panel, body.phi-dark .out-head-strip, body.phi-dark #view-contacts .contacts-table-area, body.phi-dark #view-contacts .contacts-header-bar, body.phi-dark .camp-table-area, body.phi-dark .camp-main, body.phi-dark .mb-wrap, body.phi-dark .mb-body { background:var(--color-page-bg) !important; color:var(--color-text); }
  body.phi-dark .sidebar, body.phi-dark .phi-rail, body.phi-dark .camp-sidebar, body.phi-dark .finance-sidebar, body.phi-dark .org-sidebar, body.phi-dark .sci-tree, body.phi-dark #view-projects > div > aside:first-child, body.phi-dark #view-model > div > aside:first-child, body.phi-dark #view-sales > div > aside:first-child, body.phi-dark .phi-related, body.phi-dark .right-panel, body.phi-dark .camp-detail-panel { background:var(--color-surface) !important; border-color:var(--color-border) !important; }
  body.phi-dark .sidebar .sidebar-item, body.phi-dark .phi-rail-link, body.phi-dark .camp-sidebar-item, body.phi-dark .proj-cat-btn, body.phi-dark .m2-sb-j, body.phi-dark .sci-node, body.phi-dark #fin-sidebar > div[onclick], body.phi-dark .phi-rail-child { color:var(--color-text) !important; }
  body.phi-dark .sidebar .sidebar-item:hover, body.phi-dark .phi-rail-item:not(.active):hover, body.phi-dark .camp-sidebar-item:hover, body.phi-dark .sci-node:hover, body.phi-dark .phi-rail-child:hover { background:var(--color-surface-raised) !important; }
  body.phi-dark .m2-card, body.phi-dark .mb-slab, body.phi-dark .mb-head, body.phi-dark .mb-kpi, body.phi-dark .mb-profile, body.phi-dark .mb-diag, body.phi-dark .mb-rail, body.phi-dark .mb-card, body.phi-dark .mb-ent, body.phi-dark .m2-tile, body.phi-dark .phi-stat, body.phi-dark .m2-area, body.phi-dark .sci-row, body.phi-dark .sci-box, body.phi-dark .sci-methods, body.phi-dark .sci-inline, body.phi-dark .ppl-card, body.phi-dark .phi-crew, body.phi-dark .phi-crew > div, body.phi-dark .report-card, body.phi-dark .product-card, body.phi-dark .rl-card, body.phi-dark .kb-card, body.phi-dark .m2-pcard, body.phi-dark .hsec, body.phi-dark .detail-section, body.phi-dark .pers-table, body.phi-dark .type-list, body.phi-dark .contact-sheet, body.phi-dark .contact-table, body.phi-dark .camp-table, body.phi-dark .out-soon, body.phi-dark .alta-card, body.phi-dark .ws-card, body.phi-dark .mb-search, body.phi-dark .sci-reader { background:var(--color-surface) !important; border-color:var(--color-border) !important; color:var(--color-text); }
  body.phi-dark .m2-area-wide { background:linear-gradient(160deg,var(--emerald-670) 0%,#22412f 46%,#1a3325 100%) !important; }
  body.phi-dark .m2-card-h h3, body.phi-dark .mb-slab h4, body.phi-dark h1, body.phi-dark h2, body.phi-dark h3, body.phi-dark .phi-stat-n, body.phi-dark .m2-area-big, body.phi-dark .mb-ent b, body.phi-dark .mb-ent span, body.phi-dark .ppl-meta b, body.phi-dark .corp-t, body.phi-dark .out-row-n, body.phi-dark .contact-name, body.phi-dark .phi-head2-t h1, body.phi-dark .m2-head h1, body.phi-dark .mb-rail-t .nm, body.phi-dark .mb-rail-h h4, body.phi-dark .m2-area-stats b, body.phi-dark .m2-hero h1 { color:var(--grey-50) !important; }
  body.phi-dark .phi-stat-l, body.phi-dark .m2-p, body.phi-dark .m2-area-stats span, body.phi-dark .corp-d, body.phi-dark .out-row-m, body.phi-dark .m2-note, body.phi-dark .phi-head2-sub, body.phi-dark .m2-sub, body.phi-dark .m2-date, body.phi-dark .m2-area-blurb, body.phi-dark .m2-area-cap, body.phi-dark .mb-mini, body.phi-dark .mb-empty, body.phi-dark .m2-empty, body.phi-dark .mb-ent em, body.phi-dark .mb-ent i, body.phi-dark .ppl-meta i, body.phi-dark .mb-rail-t .sub, body.phi-dark .sci-n, body.phi-dark .phi-stat-h { color:var(--color-text-muted) !important; }
  body.phi-dark .m2-area:not(.m2-area-wide) .m2-area-name { filter:brightness(1.6); }
  body.phi-dark .contact-table th, body.phi-dark .camp-table thead th, body.phi-dark .mb-rail-row:hover, body.phi-dark .corp-row:hover, body.phi-dark .out-row:hover, body.phi-dark .contact-table tbody tr:hover td, body.phi-dark .camp-table tbody tr:hover, body.phi-dark .sci-row:hover { background:var(--color-surface-raised) !important; color:var(--color-text); }
  body.phi-dark .contact-table td, body.phi-dark .camp-table td, body.phi-dark .contact-table tbody tr, body.phi-dark .corp-row, body.phi-dark .out-row, body.phi-dark .mb-row, body.phi-dark .sci-row, body.phi-dark .mb-rail-row { color:var(--color-text); border-color:var(--color-border) !important; background:transparent; }
  body.phi-dark .contact-table th, body.phi-dark .camp-table thead th { color:var(--color-text-muted) !important; }
  body.phi-dark input, body.phi-dark select, body.phi-dark textarea, body.phi-dark input[placeholder*="Search"], body.phi-dark input[placeholder*="search"] { background-color:var(--color-page-bg) !important; color:var(--color-text) !important; border-color:var(--color-border) !important; }
  body.phi-dark .mb-fchip, body.phi-dark .mb-tag.mute, body.phi-dark .mb-count, body.phi-dark .btn-cols, body.phi-dark .view-select, body.phi-dark .m2-btn-ghost, body.phi-dark .mb-add, body.phi-dark .mb-dtab { background:var(--color-surface-raised) !important; color:var(--color-text) !important; border-color:var(--color-border) !important; }
  body.phi-dark .mb-fchip.on, body.phi-dark .mb-btn, body.phi-dark .mb-dtab.on { background:var(--color-accent) !important; color:var(--color-text-inverse) !important; }
  body.phi-dark .mb-tag.good { background:var(--color-success-soft) !important; color:var(--color-success) !important; }
  body.phi-dark .mb-tag.info { background:#1c3a45 !important; color:#9fd0e3 !important; }
  body.phi-dark .mb-tag.warn { background:var(--color-warning-soft) !important; color:var(--color-highlight) !important; }
  body.phi-dark .alta-ask { background:var(--color-secondary) !important; }
  body.phi-dark .m2-quiet a, body.phi-dark .phi-rel-more, body.phi-dark a { color:var(--color-success); }
  body.phi-dark .m2-area-stats > div, body.phi-dark .m2-row, body.phi-dark .mb-ent, body.phi-dark .phi-crew-bio { border-color:var(--color-border) !important; }
  body.phi-dark .mb-ent { background:var(--color-surface-raised) !important; }
  body.phi-dark .phi-crew-bio, body.phi-dark .phi-crew i, body.phi-dark .phi-crew span { color:var(--sage-100); }
  body.phi-dark .phi-crew > div > div:nth-child(3) span { color:var(--color-text); }
  body.phi-dark .mb-svg text, body.phi-dark svg text { fill:var(--color-text-muted); }
  body.phi-dark .m2-grid2, body.phi-dark .phi-row { background:transparent; }
  /* Sara 2026-09-19: the banner WAS lighter - it was the standard dark emerald
     until the split at 3am this morning darkened it to #10261f. Put back. */
  body.phi-dark .topnav { background:var(--color-nav-bg); }
  body.phi-dark #phi-subtabs, body.phi-dark .phi-band { background:var(--color-surface) !important; }
  body.phi-dark .sign-out-pill, body.phi-dark .phi-tools button { background:var(--color-surface-raised); }
  /* text that was set inline to a light-mode grey */
  body.phi-dark .contact-table td, body.phi-dark .contact-table td span:not(.contact-name), body.phi-dark .camp-table td, body.phi-dark .m2-row, body.phi-dark .m2-rl, body.phi-dark .m2-rr, body.phi-dark .odline span, body.phi-dark .sidebar .sidebar-section div, body.phi-dark .sidebar .sidebar-item, body.phi-dark .sb-outreach-item, body.phi-dark .mb-row, body.phi-dark .mb-row .nm, body.phi-dark .corp-row, body.phi-dark .out-row, body.phi-dark .phi-crew div, body.phi-dark .mb-ent, body.phi-dark .phi-stat-h, body.phi-dark label { color:var(--sage-100) !important; }
  body.phi-dark .contact-table td a, body.phi-dark a { color:var(--color-success) !important; }
  body.phi-dark .contact-table td[style*="muted"], body.phi-dark .sidebar-item .count, body.phi-dark .phi-stat-h, body.phi-dark .m2-note { color:var(--color-text-muted) !important; }
  body.phi-dark input:-webkit-autofill, body.phi-dark input:-webkit-autofill:focus { -webkit-box-shadow:0 0 0 1000px var(--emerald-850) inset !important; -webkit-text-fill-color:var(--color-text) !important; }
  body.phi-dark .sidebar .sidebar-item.active, body.phi-dark .phi-rail-item.active, body.phi-dark .camp-sidebar-item.active, body.phi-dark .proj-cat-btn.active, body.phi-dark .sci-node.on { background:var(--color-secondary) !important; color:var(--color-text-inverse) !important; }
  body.phi-dark .mb-av, body.phi-dark .ppl-face { filter:brightness(1.15); }
  body.phi-dark .contact-table tr.selected td, body.phi-dark .contact-table tr.bulk-checked td { background:var(--color-surface-raised) !important; }
  /* Sara 2026-09-15: nothing white in the dark view — anything that was white turns light green */
  body.phi-dark .tk-stream, body.phi-dark .lst-card, body.phi-dark .bk-card, body.phi-dark .pv-tile, body.phi-dark .pv-pcard,
  body.phi-dark .ws-card, body.phi-dark .ppl-card, body.phi-dark .m2-tile, body.phi-dark .phi-stat, body.phi-dark .phi-alta-card,
  body.phi-dark .phi-alta-cell > div, body.phi-dark .m2-sb, body.phi-dark .m2-empty, body.phi-dark .lst-pane-l, body.phi-dark .lst-pane-r,
  body.phi-dark .ppl-dossier, body.phi-dark .ppl-dh, body.phi-dark .tpl-card, body.phi-dark .rl-card, body.phi-dark .dl-card, body.phi-dark .sci-row,
  body.phi-dark .camp-detail-panel, body.phi-dark .contact-sheet, body.phi-dark .modal-content, body.phi-dark .modal-box, body.phi-dark .phi-print-preview,
  body.phi-dark [style*="background:#fff"], body.phi-dark [style*="background: #fff"], body.phi-dark [style*="background:#ffffff"], body.phi-dark [style*="background:white"]
    { background:var(--color-accent-soft) !important; color:var(--color-text) !important; border-color:var(--color-border) !important; }
  body.phi-dark .tk-stream .tk-s-l, body.phi-dark .lst-name, body.phi-dark .lst-block p, body.phi-dark .lst-tagline, body.phi-dark .bk-row, body.phi-dark .bk-head b { color:var(--color-text) !important; }
  body.phi-dark .tk-s-late { background:var(--color-danger-soft) !important; color:var(--red-250) !important; }
  body.phi-dark .phi-alta-park, body.phi-dark .phi-alta-park * { background:var(--color-accent-soft) !important; border-color:var(--color-border) !important; }
  body.phi-dark .phi-rail-caret{ color:var(--color-text-muted); } body.phi-dark .phi-rail-caret.leaf{ color:#6f8f82; }
  body.phi-dark .phi-rail-item:not(.active):hover, body.phi-dark .phi-rail-child:hover { background:rgba(255,255,255,.07) !important; }
  body.phi-dark .phi-rail-child { color:#c9dbd2; }
  body.phi-dark .phi-rail-link, body.phi-dark .sidebar .phi-rail-link { color:var(--sage-100) !important; }
  body.phi-dark #alta-dock, body.phi-dark #alta-dock .ad-body, body.phi-dark #alta-dock .ad-foot, body.phi-dark #alta-dock .ad-head,
  body.phi-dark #theme-settings-panel, body.phi-dark .pv-kv, body.phi-dark .pv-suite, body.phi-dark .m2-club2, body.phi-dark .m2-club2-stats,
  body.phi-dark .m2-cs, body.phi-dark .m2-seg, body.phi-dark .m2-hbar-t, body.phi-dark .frosty-chip, body.phi-dark .frosty-tag,
  body.phi-dark .pv-chip, body.phi-dark .pv-chip.pv-chip-dim, body.phi-dark .m2-seg button, body.phi-dark button.on
    { background:var(--color-accent-soft) !important; color:var(--color-text) !important; border-color:var(--color-border) !important; }
  body.phi-dark #alta-dock { box-shadow:0 6px 24px rgba(0,0,0,.45) !important; }
  body.phi-dark #view-lists > div > aside:first-child, body.phi-dark #view-templates > div > aside:first-child, body.phi-dark #view-reflib > div > aside:first-child,
  body.phi-dark #view-docs > div > aside:first-child, body.phi-dark #view-personal > div > aside:first-child, body.phi-dark #view-docs .camp-sidebar, body.phi-dark #view-templates .camp-sidebar
    { background:var(--color-surface) !important; border-color:var(--color-border) !important; }
  body.phi-dark .lst-remove { background:#2e3f3a !important; color:var(--red-250) !important; border-color:#5a3a3a !important; }
  /* Sara 2026-09-15: card backgrounds lighter, and every number and label on them white or bright light green */
  body.phi-dark .m2-card, body.phi-dark .mb-slab, body.phi-dark .mb-kpi, body.phi-dark .mb-profile, body.phi-dark .mb-diag, body.phi-dark .mb-rail,
  body.phi-dark .mb-card, body.phi-dark .m2-tile, body.phi-dark .phi-stat, body.phi-dark .sci-row, body.phi-dark .sci-box, body.phi-dark .ppl-card,
  body.phi-dark .report-card, body.phi-dark .product-card, body.phi-dark .rl-card, body.phi-dark .kb-card, body.phi-dark .m2-pcard, body.phi-dark .hsec,
  body.phi-dark .detail-section, body.phi-dark .phi-crew, body.phi-dark .alta-card, body.phi-dark .ws-card, body.phi-dark .lst-card, body.phi-dark .bk-card,
  body.phi-dark .pv-tile, body.phi-dark .pv-pcard, body.phi-dark .tk-stream, body.phi-dark .m2-club2, body.phi-dark .pv-kv, body.phi-dark .pv-suite,
  body.phi-dark .phi-alta-card, body.phi-dark .phi-alta-cell > div, body.phi-dark #alta-dock, body.phi-dark #alta-dock .ad-body, body.phi-dark #alta-dock .ad-foot
    { background:var(--color-accent-strong) !important; border-color:var(--color-border-strong) !important; }
  body.phi-dark .lst-pane-l, body.phi-dark .ppl-dh, body.phi-dark .m2-cs, body.phi-dark .m2-club2-stats, body.phi-dark .pv-kv { background:var(--emerald-575) !important; }
  /* text on the cards: white for the words, bright light green for the big figures; coloured figures keep their colour */
  body.phi-dark .m2-card b:not([style*="color"]), body.phi-dark .m2-card span:not([style*="color"]), body.phi-dark .m2-card div:not([style*="color"]),
  body.phi-dark .m2-card p:not([style*="color"]), body.phi-dark .m2-card td:not([style*="color"]), body.phi-dark .m2-card li:not([style*="color"]),
  body.phi-dark .phi-stat *:not([style*="color"]), body.phi-dark .m2-tile *:not([style*="color"]), body.phi-dark .pv-tile *:not([style*="color"]),
  body.phi-dark .pv-pcard *:not([style*="color"]), body.phi-dark .ws-card *:not([style*="color"]), body.phi-dark .bk-card *:not([style*="color"]),
  body.phi-dark .lst-card *:not([style*="color"]), body.phi-dark .tk-stream *:not([style*="color"]), body.phi-dark .m2-club2 *:not([style*="color"])
    { color:var(--grey-50); }
  body.phi-dark .m2-tile-v, body.phi-dark .phi-stat-v:not([style*="color"]), body.phi-dark .pv-n:not([style*="color"]), body.phi-dark .ws-n, body.phi-dark .m2-club2 .m2-cs b,
  body.phi-dark .bk-row.net i:not([style*="color"]), body.phi-dark .tk-s-n, body.phi-dark .m2-big, body.phi-dark .m2-kpi-v { color:var(--color-accent-text) !important; }
  body.phi-dark .m2-tile-l, body.phi-dark .m2-tile-s, body.phi-dark .phi-stat-l, body.phi-dark .phi-stat-h, body.phi-dark .pv-l, body.phi-dark .pv-s,
  body.phi-dark .m2-card-h span, body.phi-dark .m2-sub, body.phi-dark .lst-h3, body.phi-dark .lst-h, body.phi-dark .bk-sec, body.phi-dark .bk-head span { color:var(--emerald-150) !important; }
  body.phi-dark .m2-card h3, body.phi-dark .m2-card-h h3, body.phi-dark .lst-name, body.phi-dark .bk-head b { color:var(--color-text-inverse) !important; }
  /* figures given a dark ink inline (the neutral slate) read as light green instead */
  body.phi-dark .phi-stat [style*="color:#1d2b2b"], body.phi-dark .m2-card [style*="color:#1d2b2b"], body.phi-dark [style*="color:#8b9a9a"], body.phi-dark [style*="color:#5d6d6d"],
  body.phi-dark [style*="color:#4a5c58"], body.phi-dark [style*="color:#33433d"], body.phi-dark [style*="color:#23332e"], body.phi-dark [style*="color:#2c4a44"], body.phi-dark [style*="color:#41544d"] { color:var(--sage-100) !important; }
  body.phi-dark .pv-n[style*="color:#b6c2bb"], body.phi-dark [style*="color:#7c8f8b"], body.phi-dark [style*="color:#9aa7a7"] { color:var(--color-accent-text) !important; }
  /* the accent inks brighten so they read on green */
  body.phi-dark [style*="color:#b4472f"], body.phi-dark [style*="color:#a33333"], body.phi-dark [style*="color:#c0392b"] { color:var(--color-danger) !important; }
  body.phi-dark [style*="color:#c98a00"], body.phi-dark [style*="color:#8a6a10"] { color:#f5c860 !important; }
  body.phi-dark [style*="color:#63466a"], body.phi-dark .m2-area-name { color:#d9b8e0 !important; }
  body.phi-dark [style*="color:#3a6ea5"] { color:#8fbcf0 !important; }
  body.phi-dark [style*="color:#2f6b52"], body.phi-dark [style*="color:#235f40"], body.phi-dark [style*="color:#1a4530"] { color:var(--color-success) !important; }
  /* The Model / Pro Forma pages (.pbrief) carry their own palette; in the dark view it goes green too (Sara 2026-09-15) */
  body.phi-dark .pbrief { --pb-surface:var(--emerald-525); --pb-page:var(--emerald-850); --pb-text:var(--grey-50); --pb-text2:var(--emerald-150); --pb-muted:var(--emerald-200);
    --pb-grid:var(--emerald-450); --pb-baseline:var(--emerald-400); --pb-border:rgba(255,255,255,.14); background:var(--color-page-bg) !important; color:var(--grey-50) !important; }
  body.phi-dark .pbrief h1, body.phi-dark .pbrief h2, body.phi-dark .pbrief h3, body.phi-dark .pbrief .pb-h { color:var(--color-text-inverse) !important; }
  body.phi-dark .pbrief .pb-sub, body.phi-dark .pbrief .pb-note, body.phi-dark .pbrief .pb-fine, body.phi-dark .pbrief .pb-lbl, body.phi-dark .pbrief .pb-legend { color:var(--emerald-150) !important; }
  body.phi-dark .pbrief .pb-tile, body.phi-dark .pbrief .pb-sec, body.phi-dark .pbrief .m2-tile, body.phi-dark .pbrief .m2-card { background:var(--color-accent-strong) !important; border-color:var(--color-border-strong) !important; }
  body.phi-dark .pbrief .pb-val, body.phi-dark .pbrief .m2-tile-v { color:var(--color-accent-text) !important; }
  body.phi-dark .pbrief table.pb-t td, body.phi-dark .pbrief table.pb-t th { color:var(--grey-50) !important; border-color:var(--color-border-strong) !important; }
  body.phi-dark .pbrief table.pb-t th { color:var(--emerald-150) !important; }
  body.phi-dark .pbrief table.pb-t tr.pb-plan td { background:rgba(143,188,240,.14) !important; }
  body.phi-dark .pbrief .pb-chip { background:var(--emerald-575) !important; color:var(--color-text) !important; border-color:var(--color-border-strong) !important; }
  body.phi-dark .pbrief .pb-chip.on { background:var(--blue-500) !important; color:var(--color-text-inverse) !important; }
  body.phi-dark .pbrief .pb-empty { background:var(--emerald-575) !important; color:var(--emerald-150) !important; border-color:var(--emerald-400) !important; }
  body.phi-dark .pbrief .pb-empty code { background:var(--color-page-bg) !important; color:var(--color-text) !important; }
  body.phi-dark .pbrief svg text { fill:var(--emerald-150) !important; }
  body.phi-dark #pb-tip { background:var(--color-accent-strong) !important; color:var(--grey-50) !important; border-color:var(--color-border-strong) !important; }
  body.phi-dark .m2-t td, body.phi-dark .m2-t th, body.phi-dark .pbrief td, body.phi-dark .m2-pipe, body.phi-dark .m2-chip, body.phi-dark .m2-t tr.m2-strong td
    { background:var(--color-accent-strong) !important; color:var(--grey-50) !important; border-color:var(--color-border-strong) !important; }
  body.phi-dark .m2-t th { color:var(--emerald-150) !important; background:var(--emerald-575) !important; }
  body.phi-dark .m2-chip { background:var(--emerald-575) !important; }
  /* ── the rest of the CRM in the dark view: The Books, Reports, Inventory, Members, Science Library, Alta, Organizations, Templates ── */
  body.phi-dark main.content .sidebar-label, body.phi-dark main.content .fr-label, body.phi-dark .sci-tree-h { color:var(--color-text-muted) !important; }
  body.phi-dark main.content td:not([style*="color"]), body.phi-dark main.content th:not([style*="color"]), body.phi-dark main.content b:not([style*="color"]),
  body.phi-dark main.content i:not([style*="color"]), body.phi-dark main.content p:not([style*="color"]), body.phi-dark main.content h4:not([style*="color"]),
  body.phi-dark main.content h5:not([style*="color"]), body.phi-dark main.content summary:not([style*="color"]), body.phi-dark main.content label:not([style*="color"]),
  body.phi-dark main.content li:not([style*="color"]), body.phi-dark main.content .fr-stat-value, body.phi-dark main.content .alta-ov-n, body.phi-dark .sci-crumb,
  body.phi-dark .sci-row-t, body.phi-dark .sci-m-ref, body.phi-dark .mh-note, body.phi-dark .mh-lab-n, body.phi-dark .mh-lab-v, body.phi-dark .mh-count, body.phi-dark .ldg-contact,
  body.phi-dark .ldg-amount, body.phi-dark .ldg-balance, body.phi-dark .tpl-btn, body.phi-dark .alta-msgtog, body.phi-dark .qf-pill, body.phi-dark .mb-back, body.phi-dark .mb-good
    { color:var(--color-text) !important; }
  body.phi-dark main.content span:not([style*="color"]):not(.ldg-chip):not(.mh-pill):not(.mb-tag):not(.sci-tag):not(.kb-pill):not(.mh-chip) { color:inherit; }
  body.phi-dark main.content .ldg-chip, body.phi-dark .mh-pill, body.phi-dark .mb-tag, body.phi-dark .sci-tag, body.phi-dark .kb-pill, body.phi-dark .mh-chip,
  body.phi-dark [class*="-chip"], body.phi-dark [class*="-pill"] { background:var(--emerald-575) !important; color:var(--sage-100) !important; border-color:var(--color-border-strong) !important; }
  body.phi-dark .ldg-income-chip { color:var(--color-accent-text) !important; } body.phi-dark .ldg-expense-chip { color:var(--color-danger) !important; }
  body.phi-dark .alta-ov-tile, body.phi-dark .alta-msgtog, body.phi-dark #btn-view-grid, body.phi-dark #btn-org-grid, body.phi-dark .qf-pill, body.phi-dark .tpl-btn, body.phi-dark .mb-back,
  body.phi-dark .mh-priv, body.phi-dark .mh-stat, body.phi-dark .mh-panel, body.phi-dark .sci-mid, body.phi-dark .sci-head, body.phi-dark .sci-stats, body.phi-dark .sci-stats > div,
  body.phi-dark .org-detail-panel, body.phi-dark .org-sidebar, body.phi-dark main.content tr, body.phi-dark main.content tbody tr:nth-child(even) td,
  body.phi-dark main.content tbody tr:hover td, body.phi-dark .ledger-table, body.phi-dark .ledger-table td, body.phi-dark .ledger-table th
    { background:var(--color-accent-soft) !important; border-color:var(--color-border) !important; }
  body.phi-dark .ledger-table th, body.phi-dark main.content thead th { background:var(--color-surface) !important; color:var(--emerald-150) !important; }
  body.phi-dark .mh-panel, body.phi-dark .mh-stat, body.phi-dark .alta-ov-tile { background:var(--color-accent-strong) !important; }
  body.phi-dark main.content button:not([style*="background"]):not(.m2-btn):not(.phi-rail-link):not(.phi-rail-child):not(.phi-rail-caret):not(.phi-rail-more):not(.lst-more):not(.alta-ask):not(.btn-add-sale):not(.primary):not(.ppl-rail-hit)
    { background:var(--emerald-575) !important; color:var(--color-text) !important; border-color:var(--color-border-strong) !important; }
  body.phi-dark main.content .btn-add-sale, body.phi-dark main.content button.primary, body.phi-dark main.content .alta-ask { background:var(--color-secondary) !important; color:var(--color-text-inverse) !important; }
  body.phi-dark .pbrief input, body.phi-dark .pbrief select { background:var(--color-surface) !important; color:var(--color-text) !important; border-color:var(--color-border-strong) !important; }
  body.phi-dark #alta-dock textarea, body.phi-dark #alta-dock input { background:var(--color-surface) !important; color:var(--color-text) !important; border-color:var(--color-border) !important; }
  body.phi-dark .frosty-chip.frosty-chip-hit { background:#3f5a2c !important; }
  body.phi-dark .m2-seg button.on, body.phi-dark button.on { background:var(--color-accent) !important; }

/* ── Sara 2026-09-18: dark mode fixes ─────────────────────────────────────────
   1. The campaign detail page was still pure white in dark mode - the sheet and
      every section card on it. Neither was covered by the rules above.
   2. Card backgrounds lifted a step so they read as raised against the page
      instead of sinking into it.                                             */

/* 1. the campaign detail page */
body.phi-dark .campaign-sheet,
body.phi-dark .campaign-sheet.open,
body.phi-dark .camp-detail-panel.active,
body.phi-dark .camp-detail-main,
body.phi-dark .camp-detail-side {
  background: var(--color-surface) !important;
  border-color: var(--color-border) !important;
  color: var(--color-text) !important;
}
body.phi-dark .camp-dp-section-card {
  background: var(--color-surface-raised) !important;
  border-color: var(--emerald-590) !important;
  color: var(--color-text) !important;
}
body.phi-dark .campaign-sheet h1,
body.phi-dark .campaign-sheet h2,
body.phi-dark .campaign-sheet h3,
body.phi-dark .camp-dp-section-card h1,
body.phi-dark .camp-dp-section-card h2,
body.phi-dark .camp-dp-section-card h3,
body.phi-dark .camp-dp-section-card b { color: var(--grey-50) !important; }
body.phi-dark .camp-dp-section-card label,
body.phi-dark .camp-dp-section-card span,
body.phi-dark .camp-dp-section-card div,
body.phi-dark .camp-dp-section-card p,
body.phi-dark .campaign-sheet label { color: var(--sage-100) !important; }
body.phi-dark .camp-dp-section-card input,
body.phi-dark .camp-dp-section-card textarea,
body.phi-dark .camp-dp-section-card select,
body.phi-dark .campaign-sheet input,
body.phi-dark .campaign-sheet textarea,
body.phi-dark .campaign-sheet select {
  background: var(--color-surface) !important; color: var(--color-text) !important; border-color: var(--emerald-590) !important;
}

/* 2. every card a step lighter than the page behind it */
body.phi-dark .m2-card, body.phi-dark .m2-tile, body.phi-dark .m2-area, body.phi-dark .m2-pcard,
body.phi-dark .phi-stat, body.phi-dark .phi-alta-card, body.phi-dark .phi-crew, body.phi-dark .phi-crew > div,
body.phi-dark .mb-slab, body.phi-dark .mb-head, body.phi-dark .mb-kpi, body.phi-dark .mb-profile,
body.phi-dark .mb-diag, body.phi-dark .mb-rail, body.phi-dark .mb-card, body.phi-dark .mb-ent, body.phi-dark .mb-search,
body.phi-dark .ppl-card, body.phi-dark .ppl-dossier, body.phi-dark .report-card, body.phi-dark .product-card,
body.phi-dark .rl-card, body.phi-dark .kb-card, body.phi-dark .dl-card, body.phi-dark .tpl-card,
body.phi-dark .ws-card, body.phi-dark .lst-card, body.phi-dark .bk-card, body.phi-dark .tk-stream,
body.phi-dark .pv-tile, body.phi-dark .pv-pcard, body.phi-dark .alta-card, body.phi-dark .out-soon,
body.phi-dark .hsec, body.phi-dark .detail-section, body.phi-dark .contact-sheet,
body.phi-dark .sci-row, body.phi-dark .sci-box, body.phi-dark .sci-methods, body.phi-dark .sci-inline, body.phi-dark .sci-reader,
body.phi-dark .contact-table, body.phi-dark .camp-table, body.phi-dark .pers-table, body.phi-dark .type-list {
  background: var(--color-surface-raised) !important;
  border-color: var(--emerald-590) !important;
}
/* rails and side panels sit between the page and the cards */
body.phi-dark .sidebar, body.phi-dark .phi-rail, body.phi-dark .camp-sidebar,
body.phi-dark .finance-sidebar, body.phi-dark .org-sidebar, body.phi-dark .sci-tree,
body.phi-dark .phi-related, body.phi-dark .right-panel {
  background: var(--color-surface) !important; border-color: var(--color-border) !important;
}

/* Sara 2026-09-18: Alta was standing inside a visible square in dark mode - the
   button she is docked on was painting its own lighter panel behind her. She
   should sit straight on the page. */
body.phi-dark #alta-dock-btn,
body.phi-dark #alta-dock-btn.alta-in-cell,
body.phi-dark #alta-dock-btn.alta-idle,
body.phi-dark .alta-in-cell {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

  /* ── The Model Builder mode banner, the changed-defaults panel and the saved-versions
     panel (2026-09-18). They were written light-only, so in dark mode their text was
     dark on dark and effectively invisible. ── */
  body.phi-dark .fin-mode-proj { background:var(--color-surface-raised) !important; border-color:var(--color-border) !important; color:var(--sage-100) !important; }
  body.phi-dark .fin-mode-tpl { background:var(--color-secondary-soft) !important; border-color:#5b4566 !important; color:#ecdff1 !important; }
  body.phi-dark .fin-drift, body.phi-dark .fin-vers { background:var(--color-surface) !important; border-color:var(--color-border) !important; color:var(--color-text) !important; }
  body.phi-dark .fin-drift-l, body.phi-dark .fin-vers-l { color:var(--color-text) !important; }
  body.phi-dark .fin-drift-v, body.phi-dark .fin-vers-v, body.phi-dark .fin-vers-note { color:var(--color-text-muted) !important; }
  body.phi-dark .fin-drift-r, body.phi-dark .fin-vers-r { border-top-color:var(--emerald-670) !important; }
  body.phi-dark .fin-btn { background:var(--color-surface-raised) !important; border-color:var(--color-border) !important; color:var(--color-text) !important; }
  body.phi-dark .fin-btn-go { background:var(--color-secondary) !important; border-color:var(--color-secondary) !important; color:var(--color-text-inverse) !important; }
  body.phi-dark .fin-btn-warn { background:var(--color-warning-soft) !important; border-color:#7a5f22 !important; color:var(--color-highlight) !important; }
  body.phi-dark.fin-locked-nums [id^="fin-asm-"] { background:var(--color-surface-raised) !important; color:var(--emerald-110) !important; }

/* ── Messages, dark view (Sara 2026-09-20) ─────────────────────────────────
   The inbox is built with inline styles, so these have to carry !important.
   Same four dark surfaces the rest of the site uses: page #163129, card
   #24493d, border #35604f, text #e6efe9. */
body.phi-dark #alta-inbox-block { background:var(--color-page-bg) !important; }
body.phi-dark #alta-inbox-thread-head,
body.phi-dark #alta-inbox-compose { background:var(--color-surface-raised) !important; border-color:var(--color-border) !important; }
body.phi-dark #alta-inbox-block > div:last-child { background:var(--color-page-bg) !important; border-color:var(--color-border) !important; }
body.phi-dark #alta-inbox-search { background:var(--color-surface) !important; border-color:var(--color-border) !important; color:var(--color-text) !important; }
body.phi-dark #alta-inbox-search::placeholder { color:var(--emerald-300) !important; }
body.phi-dark #alta-inbox-list > div { border-color:var(--color-border) !important; }
body.phi-dark .am-tab { background:transparent !important; border:none !important; color:var(--sage-100) !important; }
body.phi-dark .am-tab-on { background:var(--color-secondary) !important; color:var(--color-text-inverse) !important; }   /* plum, as on every rail (2026-09-20) */
body.phi-dark .am-row { border-bottom-color:var(--emerald-670) !important; }
body.phi-dark .am-row-on { background:var(--color-secondary) !important; }
body.phi-dark .am-name { color:var(--color-text) !important; }
body.phi-dark .am-prev { color:var(--color-text-muted) !important; }
body.phi-dark .am-when { color:var(--emerald-300) !important; }
body.phi-dark .am-day { background:var(--color-surface-raised) !important; border-color:var(--color-border) !important; color:var(--color-text-muted) !important; }
body.phi-dark .am-bub-in { background:var(--color-surface-raised) !important; border-color:var(--emerald-575) !important; color:var(--color-text) !important; }
body.phi-dark .am-bub-in div { color:var(--color-text) !important; }
body.phi-dark .am-bub-out { background:var(--emerald-550) !important; color:var(--color-text-inverse) !important; }
body.phi-dark .am-bub-out div { color:var(--color-text-inverse) !important; }
body.phi-dark .am-bub-draft { background:var(--color-surface) !important; border-color:#4a7a66 !important; }
body.phi-dark .am-bub-draft div { color:var(--emerald-110) !important; }
body.phi-dark #alta-inbox-thread-head > div > div:first-child { color:var(--color-text) !important; }
body.phi-dark #alta-inbox-thread-head > div > div:last-child { color:var(--color-text-muted) !important; }


/* ── Sara 2026-09-20: the Alta left rail was written light-only, so Setup,
   Sessions and the Brain rail stayed a pale column in dark view, and the Brain
   cards' own type was near-black on dark. ── */
body.phi-dark #alta-kb-side { background:var(--color-surface) !important; border-color:var(--color-border) !important; }
body.phi-dark #alta-kb-side h4 { color:var(--color-text-muted) !important; }
body.phi-dark .cf-opt { color:var(--sage-100) !important; }
body.phi-dark .cf-opt:hover { background:var(--color-surface-raised) !important; }
body.phi-dark .cf-opt.on { background:var(--color-secondary) !important; color:var(--color-text-inverse) !important; }
body.phi-dark .cf-opt.on .cf-n { color:#e3d6e8 !important; }
body.phi-dark .cf-n { color:var(--color-text-muted) !important; }
body.phi-dark .cf-check { color:var(--sage-100) !important; }
body.phi-dark .cf-search, body.phi-dark .cf-sel, body.phi-dark #alta-kb-side input { background:var(--color-surface-raised) !important; border-color:var(--emerald-590) !important; color:var(--color-text) !important; }
body.phi-dark .cf-clear { background:transparent !important; border-color:var(--color-border) !important; color:var(--color-text-muted) !important; }
body.phi-dark .cf-clear:hover { background:var(--color-surface-raised) !important; color:var(--color-text) !important; }
body.phi-dark .kb-name, body.phi-dark .kb-body { color:var(--grey-50) !important; }
body.phi-dark .kb-sub, body.phi-dark .kb-foot, body.phi-dark .kb-count, body.phi-dark .kb-group { color:var(--color-text-muted) !important; }
body.phi-dark .kb-when { color:var(--color-text) !important; }
body.phi-dark .kb-when b { color:#f0a878 !important; }
body.phi-dark .kb-warn { background:var(--amber-800) !important; color:#f0cdb0 !important; }
body.phi-dark .kb-key { background:var(--color-surface-raised) !important; color:#dcc9e3 !important; }
body.phi-dark .kb-verify { background:var(--amber-800) !important; border-color:#6b4a30 !important; color:#f0b98f !important; }
body.phi-dark .kb-act, body.phi-dark .kb-more, body.phi-dark .kb-count a { color:#c9a9d4 !important; }
body.phi-dark .kb-act.del { color:#f08f80 !important; }

/* ── Contact card in dark mode (Sara 2026-09-24: "weird coloration problems on
   dark theme when you pull up contact card"). Six places kept a light-mode
   colour on a dark background and could not be read. ── */
body.phi-dark .pxr { background:var(--color-surface-raised) !important; border-color:var(--color-border) !important; }
body.phi-dark .pxr-h { color:var(--color-text-muted) !important; }
body.phi-dark .pxr-camp, body.phi-dark .pxr-next, body.phi-dark .pxr-last { color:var(--color-text) !important; }
body.phi-dark .pxr-own { color:var(--color-text-muted) !important; }
body.phi-dark .pxr-f { color:var(--emerald-300) !important; }
body.phi-dark .roles-col-label { color:var(--grey-50) !important; }
body.phi-dark .assoc-rel-badge, body.phi-dark .assoc-chip, body.phi-dark .assoc-chip a,
body.phi-dark .assoc-chip span { color:var(--emerald-900) !important; }
body.phi-dark .dossier-value, body.phi-dark .dossier-tagline-value { color:var(--color-text) !important; }
body.phi-dark .activity-subject { color:var(--grey-50) !important; }
body.phi-dark .activity-note, body.phi-dark .activity-body { color:var(--sage-100) !important; }
body.phi-dark .act-add-head { color:#d5b9de !important; }
body.phi-dark .role-contact-chip, body.phi-dark .role-contact-chip span,
body.phi-dark .role-contact-chip a { color:var(--emerald-900) !important; }
body.phi-dark .activity-linked span, body.phi-dark .activity-linked a { color:#9fd0ff !important; }

/* Sara 2026-09-25: subtab pills are links, so the blanket dark-mode link colour
   above turned their text pale green - on the white selected pill it could not
   be read. Every subtab, on every tab, now looks the same in dark as in light:
   white text on the translucent pill, dark green text on the white selected one. */
body.phi-dark #phi-subtabs a { color:var(--color-text-inverse) !important; -webkit-text-fill-color:var(--color-text-inverse) !important; background:rgba(255,255,255,0.14) !important; }
body.phi-dark #phi-subtabs a:hover { background:rgba(255,255,255,0.30) !important; }
body.phi-dark #phi-subtabs a.active { background:var(--white) !important; color:var(--emerald-675) !important; -webkit-text-fill-color:var(--emerald-675) !important; }

/* People rail search results (Sara 2026-09-25). Light and dark. */
.ppl-rail-hits{ display:none; margin-top:6px; border:1px solid var(--border,#d9d2c5); border-radius:9px; background:var(--white); overflow:hidden; max-height:360px; overflow-y:auto; }
.ppl-rail-hit{ display:block; width:100%; text-align:left; background:none; border:0; border-bottom:1px solid #eee7dc; padding:7px 10px; cursor:pointer; font:inherit; font-size:12.5px; color:#23372f; }
.ppl-rail-hit:hover{ background:#f2efe9; }
.ppl-rail-hit b{ display:block; font-weight:700; }
.ppl-rail-hit i{ display:block; font-style:normal; font-size:11px; color:var(--sage-500); }
.ppl-rail-all{ font-weight:700; color:var(--plum-650); }
.ppl-rail-none{ padding:8px 10px; font-size:12px; color:var(--sage-500); }
body.phi-dark .ppl-rail-hits{ background:var(--color-surface) !important; border-color:var(--color-border) !important; }
body.phi-dark main.content button.ppl-rail-hit, body.phi-dark .ppl-rail-hit{ background:transparent !important; color:var(--color-text) !important; border-color:var(--emerald-670) !important; }
body.phi-dark .ppl-rail-hit:hover{ background:var(--emerald-670) !important; }
body.phi-dark .ppl-rail-hit i, body.phi-dark .ppl-rail-none{ color:var(--color-text-muted) !important; }
body.phi-dark .ppl-rail-all{ color:#e3c9ea !important; }

/* Science Library lines: where each study comes from, what it tested, converted drug results (Sara 2026-09-25). */
.sci-m-ref{ display:flex; flex-wrap:wrap; align-items:center; gap:2px 6px; }
.sci-src{ display:inline-block; font-size:10px; font-weight:800; letter-spacing:.02em; padding:1px 7px; border-radius:10px; white-space:nowrap; max-width:100%; overflow:hidden; text-overflow:ellipsis; }
.sci-src.lt{ background:#f3e6b8; color:var(--gold-700); }
.sci-src.ox{ background:#cfe3f3; color:#1d4566; }
.sci-src.md{ background:#e6d6ea; color:#4b2f52; }
.sci-src.ot{ background:var(--grey-75); color:#34423c; }
.sci-m-what{ display:block; width:100%; font-style:normal; font-size:11px; font-weight:400; line-height:1.3; opacity:.75; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.sci-m-cv{ display:inline-block; font-size:9.5px; font-weight:800; letter-spacing:.04em; text-transform:uppercase; padding:0 6px; border-radius:8px; border:1px dashed currentColor; opacity:.85; }
.sci-m-row.conv .sci-m-dot{ border-style:dashed; }
/* Sara 2026-09-26: what each number measures, the drug arm from the same review, selectable titles. */
.sci-m-vs{ display:block; width:100%; font-size:11.5px; font-weight:700; line-height:1.3; cursor:text; user-select:text; white-space:normal !important; overflow-wrap:anywhere; }
.sci-m-row.arm{ margin-top:-4px; padding-left:18px; border-left:2px solid #c9b3cf; }
.sci-m-row.arm .sci-m-dot{ background:var(--plum-500); border-color:var(--plum-500); }
.sci-row-t, .sci-m-name, .sci-m-what, .sci-m-vs{ cursor:text; user-select:text; -webkit-user-select:text; }
body.phi-dark .sci-m-row.arm{ border-left-color:#7d5a86; }

/* Document preview over the page (Sara 2026-09-25). */
#phi-docprev{ position:fixed; inset:0; z-index:100000; background:rgba(10,24,19,.62); display:flex; align-items:center; justify-content:center; padding:3vh 3vw; }
#phi-docprev .phi-dp-box{ background:var(--white); color:var(--sage-850); width:min(1100px,100%); height:94%; border-radius:12px; display:flex; flex-direction:column; overflow:hidden; box-shadow:0 12px 40px rgba(0,0,0,.35); }
#phi-docprev .phi-dp-h{ display:flex; align-items:center; gap:10px; padding:10px 14px; border-bottom:1px solid var(--grey-75); }
#phi-docprev .phi-dp-h b{ font-size:15px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
#phi-docprev .phi-dp-f{ flex:1; font-size:11.5px; color:var(--sage-500); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
#phi-docprev .phi-dp-btn{ background:var(--emerald-600); color:var(--white); border:0; border-radius:8px; padding:6px 12px; font:inherit; font-size:12.5px; font-weight:700; cursor:pointer; text-decoration:none; }
#phi-docprev .phi-dp-btn + .phi-dp-btn{ background:var(--plum-650); }
#phi-docprev .phi-dp-b{ flex:1; overflow:auto; background:var(--grey-60); }
#phi-docprev .phi-dp-frame{ width:100%; height:100%; border:0; display:block; background:var(--white); }
#phi-docprev .phi-dp-img{ display:flex; justify-content:center; padding:16px; }
#phi-docprev .phi-dp-img img{ max-width:100%; height:auto; background:var(--white); box-shadow:0 2px 10px rgba(0,0,0,.12); }
#phi-docprev .phi-dp-doc{ background:var(--white); max-width:820px; margin:18px auto; padding:40px 56px; box-shadow:0 2px 10px rgba(0,0,0,.10); font-size:14px; line-height:1.55; color:var(--sage-850); }
#phi-docprev .phi-dp-doc table{ border-collapse:collapse; } #phi-docprev .phi-dp-doc td, #phi-docprev .phi-dp-doc th{ border:1px solid var(--sage-125); padding:4px 8px; }
#phi-docprev .phi-dp-text{ background:var(--white); max-width:900px; margin:18px auto; padding:24px 28px; white-space:pre-wrap; font-size:13px; line-height:1.5; color:var(--sage-850); }
#phi-docprev .phi-dp-msg{ padding:40px; text-align:center; color:var(--sage-650); font-size:14px; }
body.phi-dark #phi-docprev .phi-dp-btn{ color:var(--color-text-inverse) !important; }
#phi-docprev .phi-dp-docx .docx-wrapper{ background:var(--grey-60) !important; padding:18px 0 !important; }
#phi-docprev .phi-dp-docx .docx-wrapper > section.docx{ box-shadow:0 2px 10px rgba(0,0,0,.12); margin-bottom:18px; color:var(--sage-850); }
/* The preview is a document: keep it paper-white in dark mode too, and let wide pages scroll sideways. */
body.phi-dark #phi-docprev .phi-dp-box{ background:var(--white) !important; color:var(--sage-850) !important; }
body.phi-dark #phi-docprev .phi-dp-h b{ color:var(--sage-850) !important; }
#phi-docprev .phi-dp-docx{ min-width:max-content; }

/* Science Library (Sara 2026-09-27): explainer in headed sections, study opened under its line, head-to-head kept apart, where the open paper lives. */
.sci-m-x{ display:grid !important; grid-template-columns:repeat(auto-fill,minmax(300px,1fr)); gap:10px 18px; }
.sci-m-xs{ min-width:0; }
.sci-m-xs h5{ margin:4px 0 4px; font-size:12.5px; font-weight:800; letter-spacing:.01em; color:var(--emerald-600); }
.sci-m-xs p{ max-width:none !important; }
body.phi-dark .sci-m-xs h5{ color:var(--emerald-175); }
.sci-m-row.on{ background:var(--grey-50); box-shadow:inset 3px 0 0 var(--emerald-600); }
body.phi-dark .sci-m-row.on{ background:var(--color-surface-raised); box-shadow:inset 3px 0 0 var(--emerald-175); }
.sci-m-open{ margin:4px 0 12px 18px; cursor:default; }
.sci-m-open .sci-inline{ margin:0; }
.sci-m-h2h{ margin-top:18px; padding-top:12px; border-top:2px dashed var(--sage-125); }
.sci-m-h2h-h{ font-size:14.5px; font-weight:800; }
.sci-m-h2h-h span{ font-size:11.5px; font-weight:600; opacity:.7; margin-left:6px; }
.sci-m-h2h > p{ margin:4px 0 8px; font-size:12px; line-height:1.5; opacity:.85; max-width:900px; }
body.phi-dark .sci-m-h2h{ border-top-color:var(--color-border); }
.sci-measures{ margin:10px 0 4px; padding:8px 11px; border-left:3px solid var(--emerald-600); background:var(--grey-50); border-radius:6px; font-size:12.5px; line-height:1.45; }
.sci-measures span{ display:block; font-size:10.5px; font-weight:800; text-transform:uppercase; letter-spacing:.06em; opacity:.7; }
.sci-measures em{ display:block; font-style:normal; font-size:11.5px; opacity:.8; margin-top:3px; }
body.phi-dark .sci-measures{ background:var(--color-surface); border-left-color:var(--emerald-175); }
.sci-node.here:not(.on){ background:var(--gold-100) !important; box-shadow:inset 3px 0 0 var(--gold-350); font-weight:700; }
.sci-node.holds:not(.on){ box-shadow:inset 3px 0 0 var(--gold-200); }
body.phi-dark .sci-node.here:not(.on){ background:var(--gold-700) !important; color:var(--color-text-inverse) !important; }

/* Science Library at-a-glance table (Sara 2026-09-27). */
.sci-glance{ margin:10px 0 14px; padding:10px 12px 12px; border:1px solid var(--sage-125); border-radius:10px; background:var(--white); }
body.phi-dark .sci-glance{ background:var(--color-surface); border-color:var(--color-border); }
.sci-g-h{ display:flex; align-items:baseline; gap:10px; cursor:pointer; flex-wrap:wrap; }
.sci-g-h b{ font-size:16px; }
.sci-g-h > span:last-child{ font-size:11.5px; opacity:.7; }
.sci-g-link{ margin:8px 0 10px; font-size:12.5px; }
.sci-g-link a{ font-weight:700; color:var(--emerald-600); }
body.phi-dark .sci-g-link a{ color:var(--emerald-175); }
.sci-g-link span{ opacity:.65; }
.sci-g-wrap{ overflow-x:auto; margin-top:10px; }
table.sci-g{ border-collapse:separate; border-spacing:3px; font-size:11.5px; min-width:760px; }
table.sci-g thead th{ font-size:10.5px; font-weight:800; text-transform:uppercase; letter-spacing:.03em; padding:4px 4px 6px; vertical-align:bottom; text-align:center; max-width:96px; line-height:1.25; opacity:.8; }
table.sci-g tr.sci-g-grp th{ text-align:left; font-size:10.5px; font-weight:800; text-transform:uppercase; letter-spacing:.06em; padding:8px 2px 2px; color:var(--emerald-600); }
body.phi-dark table.sci-g tr.sci-g-grp th{ color:var(--emerald-175); }
th.sci-g-fam{ text-align:left; font-weight:700; padding:3px 8px 3px 2px; white-space:nowrap; font-size:12px; }
td.sci-g-none{ background:transparent; }
td.sci-g-c{ min-width:84px; padding:5px 6px; border-radius:7px; text-align:center; cursor:pointer; line-height:1.2; border:1px solid transparent; }
td.sci-g-c b{ display:block; font-size:14px; }
td.sci-g-c i{ display:block; font-style:normal; font-size:10.5px; opacity:.85; }
td.sci-g-c em{ display:block; font-style:normal; font-size:9.8px; opacity:.7; margin-top:1px; }
td.sci-g-c.g0{ background:var(--grey-60); color:var(--sage-700); }
td.sci-g-c.g1{ background:#e3f1ea; color:var(--emerald-800); }
td.sci-g-c.g2{ background:#bfe0cf; color:var(--emerald-850); }
td.sci-g-c.g3{ background:#7fc0a0; color:var(--emerald-900); }
td.sci-g-c.g4{ background:var(--emerald-600); color:var(--white); }
td.sci-g-c.few{ opacity:.55; }
td.sci-g-c:hover{ border-color:var(--emerald-600); }
td.sci-g-c.on{ border-color:var(--gold-350); box-shadow:0 0 0 2px var(--gold-350); opacity:1; }
body.phi-dark td.sci-g-c.g0{ background:#2a3f38; color:var(--sage-125); }
body.phi-dark td.sci-g-c.g1{ background:var(--color-surface-raised); color:var(--color-text); }
body.phi-dark td.sci-g-c.g2{ background:var(--color-accent); color:var(--color-text-inverse); }
body.phi-dark td.sci-g-c.g3{ background:#3f8d6b; color:var(--color-text-inverse); }
body.phi-dark td.sci-g-c.g4{ background:#6cc59a; color:var(--emerald-900); }
.sci-g-detail{ margin-top:10px; border-top:1px solid var(--grey-75); padding-top:8px; }
.sci-g-dh{ display:flex; align-items:baseline; gap:10px; flex-wrap:wrap; margin-bottom:4px; }
.sci-g-dh span{ font-size:11.5px; opacity:.7; flex:1; }
.sci-g-dh button{ background:transparent; border:1px solid var(--sage-150); border-radius:7px; padding:2px 10px; cursor:pointer; font:inherit; font-size:11.5px; color:inherit; }
.sci-g-s{ display:flex; gap:10px; align-items:flex-start; padding:5px 4px; border-top:1px solid var(--grey-50); cursor:pointer; font-size:12px; }
.sci-g-s:hover{ background:var(--grey-50); }
.sci-g-s.on{ background:var(--grey-50); box-shadow:inset 3px 0 0 var(--emerald-600); }
body.phi-dark .sci-g-s:hover, body.phi-dark .sci-g-s.on{ background:var(--color-surface-raised); }
.sci-g-sv{ min-width:44px; font-weight:800; font-size:13px; text-align:right; }
.sci-g-st em{ display:block; font-style:normal; font-size:11px; opacity:.7; }
.sci-g-note{ margin-top:10px; display:grid; grid-template-columns:repeat(auto-fill,minmax(320px,1fr)); gap:6px 18px; }
.sci-g-note p{ margin:0; font-size:11.8px; line-height:1.5; opacity:.9; }

/* Science Library data-check notes (Sara 2026-09-27 13:41). */
.sci-dcheck{ margin:10px 0 4px; padding:8px 11px; border-left:3px solid var(--gold-350); background:var(--gold-20); border-radius:6px; font-size:12.5px; line-height:1.45; color:var(--gold-800); }
.sci-dcheck span{ display:block; font-size:10.5px; font-weight:800; text-transform:uppercase; letter-spacing:.06em; opacity:.75; }
body.phi-dark .sci-dcheck{ background:var(--gold-800); color:var(--gold-100); border-left-color:var(--gold-200); }
.sci-dc-tag{ display:inline-block; font-size:9.5px; font-weight:800; letter-spacing:.04em; text-transform:uppercase; padding:0 6px; border-radius:8px; background:var(--gold-100); color:var(--gold-700); border:1px solid var(--gold-200); cursor:help; white-space:nowrap; }
body.phi-dark .sci-dc-tag{ background:var(--gold-700); color:var(--gold-100); border-color:var(--gold-350); }
