/* =====================================================================
  backer.css - Infra-Backer design system
  Derived from:
    - home_revised.html      (homepage: hero, router, pillars, pricing, process, coverage, final)
    - dashboard_profile.html (shell: sidebar/topbar, content grid, profile page)
  Brand accent: #2d6b66 (teal-green)
  Typography:   DM Sans + Fira Mono only
  Dark mode:    [data-bs-theme="dark"] (Bootstrap 5 native)

  Section index:
    1.  TOKENS - light mode
    2.  TOKENS - dark mode
    3.  BASE
    3A. FONTS (@font-face) - DM Sans and Fira Mono, self-hosted
    4.  TYPOGRAPHY
    4B. BOOTSTRAP 5.3 VARIABLE RE-THEME (--bs-* token aliases)
    5.  BOOTSTRAP OVERRIDES (.btn variants, .card family)
    6.  LAYOUT (.app grid, .sidebar, .topbar, .app-content, .container-backer)
    7.  NAVIGATION (.sb-*, .tb-*, .site-nav)
    8.  CORE COMPONENTS (.dtable, .pill, .person, .role-badge, .service-chips,
                    .pager, .empty, .banner, .eyebrow, .page-head)
    9.  MODALS & FORMS (.mf-*, .field, .chipx, .chips-field, .sector-ico,
                    .ghost-alert, .char-meter, .domain-box, .invite-row)
    10. FORM WIZARD (.pf-*) - reusable multi-step form shell
    11. FIELD INFO POPOVER (.fi-pop) - form-adjacent help chrome
    12. INFORMATION-CARD INTERNALS (.cap, .kv-row, .kv-card-sticky, .kv-collapse)
    13. MAPBOX POPUP (.ib-map-pop-*) - paints the default Mapbox GL popup
                    container/tip/close + the .ib-map-pop content chrome.
    14. PAGE: HOMEPAGE (.hero-*, .router-*, .pillar-*,
                    .process-tabs, .coverage-*, .final-*, .map-snap/.pin)
    14B. HOMEPAGE REWORK ADDITIONS (.hero-centered, .soon-pill, .intel-*,
                    .hiwC-*, .p3-*, .pricing-cards) - layered over section 14.
    14C. PAGE: LEGAL (.legal-*) - sticky TOC + section headings for the
                    public legal pages (privacy / terms / cookies /
                    disclaimer). TOC hidden <=991.98px.
    14D. PAGE: AUTH (.auth-*) - centred-card auth screens (sign-in/up,
                    recovery, 2FA, status). Public-shell pages; reuse
                    .eyebrow + .swash. Icons are Font Awesome.
    15. PAGE: PROFILE (.profile-*)
    16. PAGE: ENGAGEMENT MANAGER (.em-*, .focus-card, .pulse-card)
    17. PAGE: PROJECT DETAIL (.pd-*, .eoi-*, .btn-pd-*)
    18. PAGE: ORGANISATIONS DIRECTORY (.dx-*, .active-filters)
    19. PAGE: SAVED SEARCHES (.ss-*)
    20. PAGE: ADMIN (.ad-*, .stat-tabs, .u-table, .org-table, .log-row,
                    .activity-card, .heatmap, .ref-rail, .lk-table) - all
                    page-scoped under #admin-page where the global cascade
                    would otherwise leak (.pager, .kv-row).
    21. PAGE: DEVELOPER DASHBOARD (.dev-*, .lc-*, .fund-*, .qa-row,
                    .activity-row, .bars, .donut, .legend-list, .map-mock,
                    .map-pin, .dev-sector, .fc) - page-scoped under
                    #dev-overview.
    22. PAGE: NOTIFICATIONS (.nf-*) - page-scoped under #nf-page.
    23. PAGE: PROFILE SETTINGS (.ps-*) - page-scoped under #ps-page.
    24. PAGE: INVESTOR SHORTLIST (.sl-*) - redacted per-component shortlist;
                    page-scoped under #inv-shortlist-page.
    24A. PAGE: ADVISOR-REQUEST SHORTLIST (.av-*) - binary card-pick mirroring
                    the investor shortlist; page-scoped under #ar-shortlist-page.
    24B. PAGE: PREFERRED-BIDDER SELECT (.pb-*) - per-component preferred
                    designation; page-scoped under #pref-select-page.
    24C. PAGE: COMING SOON (.cs-*) - placeholder panel rendered by the
                    coming_soon() macro (Infra-Analytics + Infra-Maps).
    25. RESPONSIVE
    26. PRINT
    14C / 14D (legal, auth) sit after §26; then:
    25 (legacy compatibility), §26 FLATPICKR,
    28. INFRA-MAPS - INVESTMENT FLOWS (#inv-flows-page, .if-*)
    28B. INFRA-MAPS - ASSET MAPS (.asset-map-page, .ea-*) - page-only
                    parts: search, region tree, status dots, detail facts.
    28C. ADMIN - DATA SOURCES (#admin-page .ds-*, .lk-*, .dup-*)
    28D. MAP CHROME (SHARED) (.map-dock, .map-panel, .map-sec, .map-check,
                    .map-swatch) - Filters + Layers dock and legend rows for
                    every Infra-Maps page (static/js/maps/layers-panel.js).
    28E. ADMIN - ASSETS (#admin-page .as-*) - the master asset list and
                    one asset's page (sits after §28C in the file).
    INTEREST / PRE-REGISTRATION FORM (.ib-interest)
   ===================================================================== */


/* =====================================================================
    1. TOKENS - light mode
   ===================================================================== */
:root {
  /* Brand */
  --backer:        #2d6b66;
  --backer-rgb:    45, 107, 102;   /* RGB of --backer, for rgba()/--bs-*-rgb slots */
  --backer-ink:    #1d4744;
  --backer-soft:   #e9f1f0;
  --backer-softer: #f4f8f7;

  /* Surfaces */
  --bg:            #fbfaf7;
  --surface:       #ffffff;
  --surface-2:     #f7f6f2;

  /* Sidebar (stays dark in both modes - design anchor) */
  --sidebar-bg:    #1d2b2a;
  --sidebar-bg-2:  #243938;
  --sidebar-fg:    #c7d3d1;
  --sidebar-fg-dim:#8a9a97;
  --sidebar-accent:#5fbdb3;

  /* Ink scale */
  --ink:           #111714;
  --ink-2:         #3b4743;
  --ink-3:         #6a7570;
  --ink-4:         #98a29e;

  /* Lines */
  --line:          #e4e7e6;
  --line-2:        #eceeed;
  --line-sidebar:  rgba(255,255,255,.07);

  /* Secondary accents (with soft pairs) */
  --amber:         #b07e2a;
  --amber-soft:    #f6ecd6;
  --plum:          #6b4a7a;
  --plum-soft:     #ece0f0;
  --green:         #2f7a4d;
  --green-soft:    #e0eee6;
  --red:           #a9442e;
  --red-soft:      #f3e0da;
  --blue:          #2c4a78;
  --blue-soft:     #e3e9f2;
  --indigo:        #3a3f7a;
  --indigo-soft:   #e2e3ef;

  /* Funding capital-stack shade target - the colour the Debt-shade .cat-*
     swatches mix `var(--blue)` toward. White in light mode (lighter tranches);
     overridden to a dark surface in dark mode so the shades don't blow out. */
  --cat-tint:      #fff;

  /* Shape */
  --radius:        12px;
  --radius-sm:     8px;

  /* Shadow */
  --shadow-card:   0 1px 0 rgba(0,0,0,.02), 0 2px 6px -4px rgba(29,71,68,.08);
  --shadow-pop:    0 20px 40px -20px rgba(29,71,68,.3);

  /* Spacing */
  --row-gap:       14px;
  --card-pad:      22px;

  /* Density (set at runtime if required; default 1) */
  --density:       1;

  /* Fonts */
  --font-sans:     'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono:     'Fira Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}


/* =====================================================================
   2. TOKENS - dark mode
   Triggered by [data-bs-theme="dark"] on <html> (Bootstrap 5 native).
   ===================================================================== */
[data-bs-theme="dark"] {
  --bg:            #0f1514;
  --surface:       #172221;
  --surface-2:     #1e2b2a;

  --sidebar-bg:    #172221;  /* match the topbar (--surface) in dark mode */
  --sidebar-bg-2:  #1e2b2a;  /* sb-item hover/active - next surface step (= --surface-2) */
  --sidebar-fg:    #c7d3d1;
  --sidebar-fg-dim:#6f7f7d;
  --sidebar-accent:#6ec5bc;

  --ink:           #e8efed;
  --ink-2:         #c3cecb;
  --ink-3:         #8a9592;
  --ink-4:         #5d6a67;

  --line:          #253333;
  --line-2:        #1e2a29;
  --line-sidebar:  rgba(255,255,255,.06);

  --backer:        #4ea49c;
  --backer-rgb:    78, 164, 156;
  --backer-ink:    #8ccac3;
  --backer-soft:   rgba(78,164,156,.12);
  --backer-softer: rgba(78,164,156,.06);

  /* Accent BASES carry per-mode values: the light hexes (#b07e2a etc.) are too
     dark/saturated to read as text on a near-black surface or on their own dark
     soft pair, so each is lightened here (same character as --backer #2d6b66 ->
     #4ea49c and --indigo #3a3f7a -> #7a80c4). This is what lets accent-text-on-
     soft-bg consumers (.pill.*, .person.*, .service-chip.*, .alert-subtle-*, ...)
     stay legible in dark mode WITHOUT a per-consumer --ink override. */
  --amber:         #d9a441;
  --amber-soft:    rgba(176,126,42,.15);
  --plum:          #b48ec6;
  --plum-soft:     rgba(107,74,122,.18);
  --green:         #5cb682;
  --green-soft:    rgba(47,122,77,.18);
  --red:           #dd8166;
  --red-soft:      rgba(169,68,46,.2);
  --blue:          #6f97ce;
  --blue-soft:     rgba(44,74,120,.2);
  --indigo:        #7a80c4;
  --indigo-soft:   rgba(122,128,196,.18);

  /* Mix the Debt-shade .cat-* swatches toward the dark card surface (not #fff)
     so Subordinated / Working read as muted darker blues rather than blowing
     out to near-white on a dark background. */
  --cat-tint:      var(--surface);

  --shadow-card:   0 1px 0 rgba(0,0,0,.3), 0 2px 10px -4px rgba(0,0,0,.5);
  --shadow-pop:    0 20px 50px -20px rgba(0,0,0,.7);
}

/* Dark mode: content sitting ON a solid accent FILL (destructive buttons,
   featured pills, badge glyphs) uses near-black ink, not white - the accent
   bases are lightened above so white drops below AA on the lighter fill.
   Mirrors the established `.btn-primary` dark treatment (dark text on the
   lightened teal). This is the exhaustive set of solid-accent-fill consumers
   that carried light content; the `.is-destructive:hover` twin lives next to
   its base rule. Text-on-soft-bg consumers (.pill.*, .alert-subtle-*, etc.)
   need no override - the lightened bases read fine on the dark soft pairs. */
[data-bs-theme="dark"] .btn-danger,
[data-bs-theme="dark"] .btn-primary.btn-danger,
[data-bs-theme="dark"] .btn-danger:hover,
[data-bs-theme="dark"] .btn-primary.btn-danger:hover {
  color: #0f1514;
  --bs-btn-active-color: #0f1514;
}
[data-bs-theme="dark"] .feat-star,
[data-bs-theme="dark"] .pc-feat,
[data-bs-theme="dark"] .profile-avatar .verified,
[data-bs-theme="dark"] #admin-page .row-actions .ra-btn.primary,
[data-bs-theme="dark"] .theme-control-toggle .theme-control-toggle-label:hover {
  color: #0f1514;
}
/* Capital-stack `.seg` % labels sit on the 7-category `.cat-*` fills (which read
   off the lightened accent bases + `--backer`); dark ink reads cleanly on every
   shade, so the white text-shadow is no longer needed. */
[data-bs-theme="dark"] .pd-stack-bar .seg {
  color: #0f1514;
  text-shadow: none;
}


/* =====================================================================
   3. BASE
   ===================================================================== */

/* Do not hijack the global reset. These rules are intentionally
   conservative and apply only within backer-scoped contexts. */

/* Neutralise element-level blanket rules that leak onto any `<section>`
   tag. Backer section classes (.hero, .pillar,
   .pricing, .final, etc.) have higher specificity and still apply their own
   padding. Without this, `@media (min-width: 992px) { section { padding: 1rem 0 } }` */
section { padding-top: 0; padding-bottom: 0; }


/* =====================================================================
   3A. FONTS - DM Sans and Fira Mono, self-hosted (static/vendors/fonts/,
   from @fontsource 5.3.0, SIL OFL 1.1; licences beside the files), so no
   page asks Google Fonts. Latin and Latin Extended, the weights in use.
   ===================================================================== */
@font-face { font-family: 'DM Sans'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('../vendors/fonts/dm-sans-5.3.0/dm-sans-latin-ext-400-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'DM Sans'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('../vendors/fonts/dm-sans-5.3.0/dm-sans-latin-400-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'DM Sans'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('../vendors/fonts/dm-sans-5.3.0/dm-sans-latin-ext-500-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'DM Sans'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('../vendors/fonts/dm-sans-5.3.0/dm-sans-latin-500-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'DM Sans'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('../vendors/fonts/dm-sans-5.3.0/dm-sans-latin-ext-600-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'DM Sans'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('../vendors/fonts/dm-sans-5.3.0/dm-sans-latin-600-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'DM Sans'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('../vendors/fonts/dm-sans-5.3.0/dm-sans-latin-ext-700-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'DM Sans'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('../vendors/fonts/dm-sans-5.3.0/dm-sans-latin-700-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'DM Sans'; font-style: normal; font-weight: 800; font-display: swap;
  src: url('../vendors/fonts/dm-sans-5.3.0/dm-sans-latin-ext-800-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'DM Sans'; font-style: normal; font-weight: 800; font-display: swap;
  src: url('../vendors/fonts/dm-sans-5.3.0/dm-sans-latin-800-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Fira Mono'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('../vendors/fonts/fira-mono-5.3.0/fira-mono-latin-ext-400-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Fira Mono'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('../vendors/fonts/fira-mono-5.3.0/fira-mono-latin-400-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Fira Mono'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('../vendors/fonts/fira-mono-5.3.0/fira-mono-latin-ext-500-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Fira Mono'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('../vendors/fonts/fira-mono-5.3.0/fira-mono-latin-500-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Fira Mono'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('../vendors/fonts/fira-mono-5.3.0/fira-mono-latin-ext-700-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Fira Mono'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('../vendors/fonts/fira-mono-5.3.0/fira-mono-latin-700-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }

/* =====================================================================
   4. TYPOGRAPHY
   DM Sans is the platform font, declared at html+body.
   Display-weight headings use DM Sans 500/600 with tight tracking.
   ===================================================================== */
html, body {
  font-family: var(--font-sans);
}

/* Reserve the vertical-scrollbar gutter even on pages/states without overflow.
   Prevents centred layouts (page-head, form frame) from shifting by ~½ the
   scrollbar width when navigating between wizard steps of different heights. */
html {
  scrollbar-gutter: stable;
  scroll-behavior: smooth; /* in-page anchor jumps (e.g. the legal-page TOC) glide */
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

code, kbd, pre, samp, .mono, .font-mono {
  font-family: var(--font-mono);
}

/* =====================================================================
   4B. BOOTSTRAP 5.3 VARIABLE RE-THEME
   The Bootstrap CDN ships default-blue --bs-* tokens, so re-map the
   variables the live app relies on to backer tokens: base body
   paint, links (black → teal on hover), Bootstrap dropdowns (filter menus +
   profile menu), and the primary accent. Tokens that reference --bg / --ink /
   --line / --surface* resolve per-mode automatically; only the literal RGB
   pairs and the brand accent are re-stated in the dark block.
   ===================================================================== */
:root {
  --bs-primary: var(--backer);
  --bs-primary-rgb: var(--backer-rgb);

  --bs-body-bg: var(--bg);
  --bs-body-color: var(--ink);
  --bs-secondary-bg: var(--surface-2);
  --bs-tertiary-bg: var(--surface-2);
  --bs-border-color: var(--line);
  --bs-emphasis-color: var(--ink);
  --bs-secondary-color: var(--ink-2);
  --bs-tertiary-color: var(--ink-3);

  /* Links: ink by default, brand-teal on hover. Bootstrap 5.3 reboot reads
     the -rgb pair, so both rgb and plain vars are set. */
  --bs-link-color: var(--ink);
  --bs-link-hover-color: var(--backer);
  --bs-link-color-rgb: 17, 23, 20;
  --bs-link-hover-color-rgb: var(--backer-rgb);
}

/* Bootstrap dropdowns: re-theme on .dropdown-menu (NOT :root) - Bootstrap declares
   these --bs-dropdown-* tokens LOCALLY on .dropdown-menu, so a :root override loses
   to the component's own 1rem / blue defaults. Compact 0.8rem type + subtle
   brand-green hover bg (ink text). Covers the browse/admin filter menus + profile menu.
   backer.css loads after the Bootstrap CDN, so this same-specificity rule wins. */
.dropdown-menu {
  --bs-dropdown-bg: var(--surface);
  --bs-dropdown-color: var(--ink-2);
  --bs-dropdown-border-color: var(--line);
  --bs-dropdown-border-radius: var(--radius-sm);
  --bs-dropdown-font-size: 0.8rem;
  --bs-dropdown-item-padding-y: 0.4rem;
  --bs-dropdown-item-padding-x: 0.85rem;
  --bs-dropdown-link-color: var(--ink-2);
  --bs-dropdown-link-hover-color: var(--ink);      /* text stays ink on hover - only the bg tints */
  --bs-dropdown-link-hover-bg: var(--backer-soft);  /* subtle brand-green hover background */
  --bs-dropdown-link-active-color: var(--backer-ink);
  --bs-dropdown-link-active-bg: var(--backer-soft);
}

[data-bs-theme="dark"] {
  /* --bs-primary / -rgb and link-hover-rgb flip automatically via var(--backer) /
     var(--backer-rgb) above; only the ink-based link colour needs a dark literal. */
  --bs-link-color-rgb: 232, 239, 237;
}

/* Base page paint - backer's body rule above sets only the font; the surface
   colours reverted to Bootstrap's white/#212529 when it was removed. */
body {
  background-color: var(--bg);
  color: var(--ink);
}

/* Links: no underline by default; colour comes from the --bs-link-* tokens above
   (ink, brand-teal on hover). Components that style their own anchors set their
   own colour/decoration and are unaffected. */
a {
  text-decoration: none;
}

/* =====================================================================
   5. BOOTSTRAP OVERRIDES - .btn family, .card
   These override Bootstrap 5.3.x.
   Dashboard's 8px-radius button is authoritative for the base; homepage
   pill-shape is applied via scoped overrides in Section 14 (Homepage).
   ===================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-2);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: background .12s, border-color .12s, color .12s, transform .1s, box-shadow .15s;
}

.btn-primary {
  /* Bootstrap 5.3 compiles .btn-primary's hover / active / border / focus-ring
     colours as LITERAL blue (not via --bs-primary), so re-point the --bs-btn-*
     tokens to brand-teal - otherwise the blue border shows on hover and the
     blue fill shows on :active (mousedown / right-click). */
  --bs-btn-color: #fff;
  --bs-btn-bg: var(--backer);
  --bs-btn-border-color: var(--backer);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: var(--backer-ink);
  --bs-btn-hover-border-color: var(--backer-ink);
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: var(--backer-ink);
  --bs-btn-active-border-color: var(--backer-ink);
  --bs-btn-disabled-color: #fff;
  --bs-btn-disabled-bg: var(--backer);
  --bs-btn-disabled-border-color: var(--backer);
  --bs-btn-focus-shadow-rgb: var(--backer-rgb);
  background: var(--backer);
  color: #fff;
  box-shadow: 0 1px 0 rgba(0,0,0,.03), 0 8px 20px -12px rgba(45,107,102,.6);
}
.btn-primary:hover,
.btn-primary:focus {
  background: var(--backer-ink);
  color: #fff;
  transform: translateY(-1px);
}
[data-bs-theme="dark"] .btn-primary { color: #0f1514; }
[data-bs-theme="dark"] .btn-primary:hover { color: #0f1514; }

.btn-ghost {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
}
.btn-ghost:hover {
  border-color: var(--ink-3);
  color: var(--ink);
}

.btn-subtle {
  background: var(--backer-soft);
  color: var(--backer-ink);
}
.btn-subtle:hover {
  background: var(--backer);
  color: #fff;
}
[data-bs-theme="dark"] .btn-subtle:hover { color: #0f1514; }

.btn-text {
  background: transparent;
  color: var(--ink);
  padding: 8px 0;
  text-decoration: none;
}
.btn-text:hover { color: var(--backer); }

/* Disabled state - a disabled button keeps its own variant colour, just
   muted + non-interactive. Per-variant rules re-assert the bg/colour. */
.btn:disabled,
.btn[disabled] {
  opacity: .5;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}
.btn-primary:disabled,
.btn-primary[disabled] { background: var(--backer); color: #fff; }
.btn-ghost:disabled,
.btn-ghost[disabled] { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-subtle:disabled,
.btn-subtle[disabled] { background: var(--backer-soft); color: var(--backer-ink); }
[data-bs-theme="dark"] .btn-primary:disabled,
[data-bs-theme="dark"] .btn-primary[disabled] { color: #0f1514; }

.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  justify-content: center;
  background: var(--surface);
  border-color: var(--line);
}
.btn-icon:hover { border-color: var(--ink-3); color: var(--ink); }

.btn-sm { padding: 6px 10px; font-size: 12px; }
.btn-lg { padding: 12px 20px; font-size: 15px; }

.btn-pill { border-radius: 999px; }

/* Destructive paint - layer on top of any .btn (typically .btn-primary).btn-danger
   for the confirm action in a delete/cancel .mf-foot. Single source for the red
   button look; pages should not redefine this. */
.btn-danger,
.btn-primary.btn-danger {
  /* Own the Bootstrap --bs-btn-* tokens so the destructive button stays red in
     EVERY state. Otherwise .btn-primary's teal --bs-btn-active-bg leaks through on
     :active (Bootstrap's `.btn:first-child:active` rule, specificity 0,3,0, beats
     `.btn-primary.btn-danger`'s 0,2,0 static background) - flashing the red confirm
     button teal on mousedown. */
  --bs-btn-bg: var(--red);
  --bs-btn-border-color: var(--red);
  --bs-btn-hover-bg: var(--red);
  --bs-btn-hover-border-color: var(--red);
  --bs-btn-active-bg: var(--red);
  --bs-btn-active-border-color: var(--red);
  --bs-btn-active-color: #fff;
  --bs-btn-focus-shadow-rgb: 169, 68, 46;
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}
.btn-danger:hover,
.btn-primary.btn-danger:hover {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
  filter: brightness(.85);
}

/* Trailing icons inside buttons (.btn i.btn-i) - consistent small scale. */
.btn .btn-i { font-size: 11px; }
.btn-lg .btn-i { font-size: 12px; }

/* Small-caps label used above chip groups (profile page, homepage). */
.chip-group-label {
  margin-top: 18px;
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* Card - dashboard mock's version is authoritative */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
}

/* Pin `.card-foot` to the bottom of the card: the card body (or any list.js
   wrapper around it) grows to fill the remaining space, pushing the foot to
   the edge. Keeps card heights consistent across a grid row. */
.card > .card-body,
.card > [data-list] { flex: 1 1 auto; min-height: 0; }
.card > [data-list] { display: flex; flex-direction: column; }
.card > [data-list] > .card-body { flex: 1 1 auto; min-height: 0; }
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 1px var(--card-pad);
  min-height: 56px;
  border-bottom: 1px solid var(--line-2);
}
.card-head h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--ink);
}
.card-head h3 .count {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-3);
  background: var(--surface-2);
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0;
}
.card-head .card-aux {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ink-3);
}

/* Override the Bootstrap default `.card-body` padding (1rem).
   Descendant combinator - the Team/Activity tables wrap `.card-body` inside a
   `[data-list]` container, so a direct-child selector misses them. */
.card .card-body { padding: var(--card-pad) !important; }
/* `overflow-x: auto` is defence in depth: if any .dtable still can't fit its
   container, scroll horizontally instead of overflowing the card. */
.card .card-body.no-pad { padding: 0 !important; overflow-x: auto; }

.card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px var(--card-pad);
  min-height: 52px;
  border-top: 1px solid var(--line-2);
  font-size: 12px;
  color: var(--ink-3);
}


/* =====================================================================
   6. LAYOUT
   `.content` was renamed to `.app-content` (205 existing template uses
   of `.content` forced the rename).
   ===================================================================== */
.app {
  display: grid;
  /* `minmax(0, 1fr)` lets the content track shrink below its min-content size.
     Without it, a wide child (e.g. a `.tcard` with `min-width` set on the inner
     table) forces the grid track wider than the viewport, producing a page-level
     horizontal scrollbar instead of letting the `.tcard` scroll internally. */
  grid-template-columns: var(--sidebar-w, 244px) minmax(0, 1fr);
  grid-template-rows: 56px 1fr;
  grid-template-areas:
    "sidebar topbar"
    "sidebar content";
  min-height: 100vh;
  transition: grid-template-columns .2s ease;
}
.app.rail,
html.ib-rail-preload .app { --sidebar-w: 68px; }

.sidebar {
  grid-area: sidebar;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--line-sidebar);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  z-index: 20;
}

.topbar {
  grid-area: topbar;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}

.app-content {
  grid-area: content;
  padding: calc(24px * var(--density)) 32px 24px;
  max-width: 1280px;
  width: 100%;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 56px);
}

/* Sticky footer inside `.app-content` - pushed to the bottom by `margin-top: auto`
   in the flex column. Sits below the content when content is short, below the
   scrolled content when content overflows. */
.app-footer {
  margin-top: auto;
  padding-top: 32px;
  color: var(--ink-3);
  font-size: 12px;
}

/* Public-page container (homepage, legal pages). Renamed from .wrap. */
.container-backer {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 32px;
}

/* Narrower centred container for long-form reading (the public legal pages).
   Horizontal padding comes from the page's own px-lg-7 (>=lg) / the .legal-layout
   inline padding (<lg), so only the cap + centring live here. */
.container-small {
  max-width: 1080px;
  margin: 0 auto;
}


/* =====================================================================
   7. NAVIGATION - sidebar (sb-*), topbar (tb-*), public site-nav
   ===================================================================== */

/* ---- Sidebar ---- */
.sb-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  height: 56px;
  flex-shrink: 0;
}
.sb-brand .mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: cover;
  /* reset Bootstrap's <mark>/.mark highlight (yellow bg + padding) */
  background: none;
  padding: 0;
  flex-shrink: 0;
}
.sb-brand .name {
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
}
.sb-brand .name span { color: var(--sidebar-accent); }
/* Green hyphen in the Infra-Pipeline / -Analytics / -Maps group headings
   (and their rail-flyout labels). */
.sb-item .label span,
.sb-sub-label span { color: var(--sidebar-accent); }

.sb-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 14px 10px 20px;
}
.sb-scroll::-webkit-scrollbar { width: 6px; }
.sb-scroll::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.08);
  border-radius: 4px;
}

.sb-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sidebar-fg-dim);
  padding: 14px 12px 6px;
  white-space: nowrap;
}

.sb-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--sidebar-fg);
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 500;
  position: relative;
  transition: background .1s, color .1s;
  white-space: nowrap;
}
.sb-item:hover { background: var(--sidebar-bg-2); color: #fff; }
.sb-item.active { background: var(--sidebar-bg-2); color: #fff; font-weight: 600; }
.sb-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--sidebar-accent);
  border-radius: 0 2px 2px 0;
}
.sb-item .icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  font-size: 14px;
  display: grid;
  place-items: center;
  color: var(--sidebar-fg-dim);
}
.sb-item.active .icon,
.sb-item:hover .icon { color: var(--sidebar-accent); }
.sb-item .caret {
  margin-left: auto;
  font-size: 10px;
  color: var(--sidebar-fg-dim);
  transition: transform .15s;
}
.sb-item.open .caret { transform: rotate(90deg); }

/* Submenu group - wraps each parent `.sb-item[data-sub]` with its sibling
   `.sb-sub` so the sub can be positioned as a flyout in rail mode. */
.sb-group { position: relative; }

.sb-sub {
  display: none;
  margin-left: 18px;
  border-left: 1px solid var(--line-sidebar);
}
.sb-sub.open { display: block; }

/* Flyout heading - shown only in rail-mode flyouts. */
.sb-sub-label {
  display: none;
  padding: 6px 10px 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sidebar-fg-dim);
  border-bottom: 1px solid var(--line-sidebar);
  margin-bottom: 4px;
}
.sb-sub-inner {
  overflow: hidden;
  padding-left: 10px;
  padding-top: 2px;
  padding-bottom: 4px;
}
.sb-sub .sb-item {
  padding: 6.5px 12px;
  font-weight: 400;
  font-size: 13px;
  color: var(--sidebar-fg-dim);
  background: transparent;
}
.sb-sub .sb-item:hover { color: #fff; background: var(--sidebar-bg-2); }
.sb-sub .sb-item.active { color: #fff; background: var(--sidebar-bg-2); font-weight: 500; }
.sb-sub .sb-item.active::before { display: none; }
.sb-sub .sb-item .dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--sidebar-fg-dim);
}
.sb-sub .sb-item.active .dot,
.sb-sub .sb-item:hover .dot { background: var(--sidebar-accent); }

.sb-foot {
  padding: 10px 14px;
  flex-shrink: 0;
}
.sb-foot button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: none;
  color: var(--sidebar-fg-dim);
  padding: 8px 0;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}
.sb-foot button:hover { color: #fff; }
.sb-foot .icon {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  font-size: 13px;
}

/* Rail-toggle icon swap - show left-chevron when expanded, right-chevron when
   collapsed. Driven by `.app.rail` (JS) or `html.ib-rail-preload` (FOUC guard)
   so there is no visible state-mismatch on page load. */
#railToggle .rail-ico-collapsed { display: none; }
.app.rail #railToggle .rail-ico-expanded,
html.ib-rail-preload .app #railToggle .rail-ico-expanded { display: none; }
.app.rail #railToggle .rail-ico-collapsed,
html.ib-rail-preload .app #railToggle .rail-ico-collapsed { display: inline-block; }

/* Rail mode (collapsed sidebar) - icons only; submenus become flyouts.
   `html.ib-rail-preload` is set by an inline <head> script before first paint
   (FOUC guard) so a persisted rail state applies without flicker. JS keeps
   the `.app.rail` class in sync. */
.app.rail .sb-brand .name,
html.ib-rail-preload .app .sb-brand .name,
.app.rail .sb-label,
html.ib-rail-preload .app .sb-label,
.app.rail .sb-item .label,
html.ib-rail-preload .app .sb-item .label,
.app.rail .sb-item .caret,
html.ib-rail-preload .app .sb-item .caret,
.app.rail .sb-foot button span.lbl,
html.ib-rail-preload .app .sb-foot button span.lbl { display: none; }

.app.rail .sb-brand,
html.ib-rail-preload .app .sb-brand { justify-content: center; padding: 14px 0; }

.app.rail .sb-item,
html.ib-rail-preload .app .sb-item { justify-content: center; padding: 10px 0; }

.app.rail .sb-item::before,
html.ib-rail-preload .app .sb-item::before { left: 2px; }

.app.rail .sb-foot button,
html.ib-rail-preload .app .sb-foot button { justify-content: center; }

/* `.sb-sub` is rendered as a fixed-position flyout in rail mode. Positioning
   is `fixed` (not absolute) because `.sidebar` has `overflow: hidden` which
   would clip an absolute-positioned child. JS sets `top` to align with the
   parent item; the `.flyout` class triggers visibility. The server-rendered
   `.open` class (for current-path indication) is intentionally IGNORED here
   so the flyout doesn't auto-show on page load before JS runs. */
.app.rail .sb-sub,
html.ib-rail-preload .app .sb-sub {
  display: block;
  margin-left: 0;
  border-left: none;
  position: fixed;
  left: calc(var(--sidebar-w, 68px) + 6px);
  top: 0;
  width: 220px;
  background: var(--sidebar-bg);
  border: 1px solid var(--line-sidebar);
  border-radius: 10px;
  padding: 6px 4px;
  box-shadow: var(--shadow-pop);
  opacity: 0;
  visibility: hidden;
  transform: translateX(-4px);
  transition: opacity .12s, transform .12s, visibility .12s;
  z-index: 1050;
  pointer-events: none;
}
.app.rail .sb-sub.flyout,
html.ib-rail-preload .app .sb-sub.flyout {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
  pointer-events: auto;
}
.app.rail .sb-sub-label,
html.ib-rail-preload .app .sb-sub-label { display: block; }
.app.rail .sb-sub-inner,
html.ib-rail-preload .app .sb-sub-inner { padding: 4px; }
.app.rail .sb-sub .sb-item,
html.ib-rail-preload .app .sb-sub .sb-item {
  padding: 7px 10px;
  justify-content: flex-start;
}
.app.rail .sb-sub .sb-item .label,
html.ib-rail-preload .app .sb-sub .sb-item .label { display: inline; }
.app.rail .sb-sub .sb-item::before,
html.ib-rail-preload .app .sb-sub .sb-item::before { display: none; }

.sb-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 15;
  display: none;
}
.sb-backdrop.show { display: block; }

/* ---- Topbar ---- */
.tb {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  height: 100%;
}
.tb-hamburger {
  background: none;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: none;
  place-items: center;
  cursor: pointer;
  color: var(--ink-2);
}
.tb-hamburger:hover { background: var(--surface-2); }

.tb-search {
  position: relative;
  flex: 1;
  max-width: 520px;
}
.tb-search input {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 9px 14px 9px 38px;
  font-size: 13px;
  color: var(--ink);
  font-family: inherit;
  outline: none;
  transition: border .15s, background .15s;
}
.tb-search input::placeholder { color: var(--ink-4); }
.tb-search input:focus {
  background: var(--surface);
  border-color: var(--backer);
}
.tb-search .ico {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-4);
  font-size: 13px;
}
.tb-search kbd {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  font-family: var(--font-mono);
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--ink-3);
}

/* Global search dropdown - hangs under .tb-search, populated by
   static/js/pages/global_search.js from GET /api/search. */
.tb-search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-pop);
  max-height: 480px;
  overflow-y: auto;
  z-index: 60;
  padding: 6px 0;
}
.tb-search-results[hidden] { display: none; }
.tb-search-results .gs-group {
  padding: 4px 0;
}
.tb-search-results .gs-group + .gs-group {
  border-top: 1px solid var(--line-2);
}
.tb-search-results .gs-group-label {
  padding: 6px 14px 4px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.tb-search-results .gs-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  color: var(--ink);
  text-decoration: none;
  font-size: 13px;
  cursor: pointer;
}
.tb-search-results .gs-item:hover,
.tb-search-results .gs-item.is-active {
  background: var(--surface-2);
}
.tb-search-results .gs-item .gs-ico {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: var(--backer-soft);
  color: var(--backer-ink);
  font-size: 11px;
}
.tb-search-results .gs-item .gs-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}
.tb-search-results .gs-item .gs-title {
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tb-search-results .gs-item .gs-sub {
  font-size: 11px;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tb-search-results .gs-item.gs-all {
  justify-content: center;
  border-top: 1px solid var(--line-2);
  margin-top: 4px;
}
.tb-search-results .gs-item.gs-all .gs-title { color: var(--backer); font-weight: 600; }
.tb-search-results .gs-item mark {
  background: var(--backer-soft);
  color: var(--backer-ink);
  padding: 0;
  border-radius: 2px;
}
.tb-search-results .gs-empty,
.tb-search-results .gs-loading {
  padding: 18px 14px;
  font-size: 12px;
  color: var(--ink-3);
  text-align: center;
}

.tb-right {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}
.tb-icon-btn {
  position: relative;
  background: none;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--ink-2);
}
.tb-icon-btn:hover { background: var(--surface-2); color: var(--ink); }

/* Notification-bell alignment - the notification dropdown renders
   as `<li class="nav-item dropdown"> > <a class="nav-link">` with inline styles
   that pin the badge at top:4px/right:4px. Force the wrapping link to the same
   36×36 shape as `.tb-icon-btn` so the inline badge coords resolve to top-right
   of the icon (not top-right of an oversized padded box). */
.tb-right > .nav-item.dropdown { list-style: none; }
.tb-right > .nav-item.dropdown > .nav-link {
  position: relative;
  display: grid !important;
  place-items: center;
  width: 36px;
  height: 36px;
  min-width: 36px !important;
  padding: 0 !important;
  border-radius: 8px;
  color: var(--ink-2);
  line-height: 1;
}
.tb-right > .nav-item.dropdown > .nav-link:hover { background: var(--surface-2); color: var(--ink); }

/* Notification unread indicator - simple red dot, no count. */
.tb-right > .nav-item.dropdown > .nav-link .notif-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--red);
  border: 2px solid var(--surface);
  pointer-events: none;
}

.tb-icon-btn .dot {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 7px;
  height: 7px;
  background: var(--red);
  border-radius: 50%;
  border: 2px solid var(--surface);
}

.tb-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  cursor: pointer;
  transition: background .15s;
}
.tb-user:hover { background: var(--surface-2); }
.tb-user .avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--backer) 0%, #5fbdb3 100%);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
}
.tb-user .who {
  display: grid;
  line-height: 1.2;
  padding-right: 4px;
}
.tb-user .who b {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
}
.tb-user .who span {
  font-size: 11px;
  color: var(--ink-3) !important;
  margin-top: 1px;
}
.tb-user .fa-chevron-down {
  font-size: 9px;
  color: var(--ink-3);
}

/* Topbar profile dropdown - the plain Bootstrap .dropdown-menu needs the backer
   card chrome + a gap below the sticky topbar. Without the gap the card's top corners
   tucked under the topbar border and read as a detached "modal" card. Opt-in via the
   positive `.tb-user-menu` class (the bell dropdown `.nf-dd` has its own rule;
   any future topbar dropdown is unstyled unless it asks for this chrome). Item
   font comes from --bs-dropdown-font-size (0.8rem); the org-name <h6> is sized
   down here. */
.topbar .dropdown-menu.tb-user-menu {
  margin-top: 8px;
  background: var(--surface);
  border-radius: var(--radius);
  color: var(--ink-2);
}
.topbar .dropdown-menu.tb-user-menu h6 {
  font-size: 13.5px;
  line-height: 1.3;
}
.topbar .dropdown-menu.tb-user-menu .small,
.topbar .dropdown-menu.tb-user-menu p {
  font-size: 12px;
}

/* ---- Public site-nav (renamed from .nav to avoid Bootstrap collision) ---- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(251,250,247,.86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-2);
}
[data-bs-theme="dark"] .site-nav {
  background: rgba(15,21,20,.86);
}

.site-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.site-nav-links {
  display: flex;
  gap: 28px;
  font-size: 14px;
  color: var(--ink-2);
}
.site-nav-links a { text-decoration: none; }
.site-nav-links a:hover { color: var(--backer); }
.site-nav-cta {
  display: flex;
  gap: 10px;
  align-items: center;
}
.site-nav-cta .btn { border-radius: 999px; }
/* Brand lockup - shared by the public top-nav and the footer (the footer
   <a class="logo"> would otherwise be unstyled; .dx-card .logo is a separate
   dashboard component and is unaffected). */
.site-nav .logo,
footer .logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: -0.01em;
  font-size: 17px;
  color: var(--ink);
}
.site-nav .logo .mark,
footer .logo .mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: cover;
  /* reset Bootstrap's <mark>/.mark highlight (yellow bg + padding) */
  background: none;
  padding: 0;
  flex-shrink: 0;
}
/* Brand name reads ink (black, white in dark mode) with a green hyphen; no
   colour change on hover. */
.site-nav .logo span span,
footer .logo span span { color: var(--backer); }
/* Footer link hover - green. Scoped to <a> so the description paragraph and
   copyright line (also .text-body-tertiary, but not links) don't react.
   .text-body-tertiary sets colour with !important (§25 legacy shim), so the
   hover must use !important to win. */
footer a.text-body-tertiary:hover { color: var(--backer) !important; }


/* =====================================================================
   8. CORE COMPONENTS
   ===================================================================== */

/* ---- Eyebrow (eyebrow label pill) ---- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--backer-ink);
  background: var(--backer-soft);
  padding: 6px 12px;
  border-radius: 999px;
}

/* ---- Page head (breadcrumb + title + actions) ---- */
.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: calc(24px * var(--density));
  flex-wrap: wrap;
}
.page-crumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--ink-3);
  margin-bottom: 8px;
}
.page-crumb a { text-decoration: none; color: inherit; }
.page-crumb a:hover { color: var(--backer); }
.page-crumb .sep { color: var(--ink-4); font-size: 9px; }
/* Chevron delivered as a glyph so each crumb's markup is a bare <span class="sep">.
   ::before inherits the 9px size + --ink-4 colour above (matches the former inline <i>). */
.page-crumb .sep::before {
  content: "\f054";
  font-family: "Font Awesome 7 Free", "Font Awesome 6 Free", "Font Awesome 5 Free";
  font-weight: 900;
}

.page-title {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: clamp(26px, 2.4vw, 32px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 6px;
}
.page-title .suffix { color: var(--ink-3); font-weight: 400; }
.page-sub {
  font-size: 13.5px;
  color: var(--ink-3);
  max-width: 620px;
}
.page-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

/* ---- Typography-first data table ---- */
.dtable {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.dtable thead th {
  text-align: left;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 12px var(--card-pad);
  border-bottom: 1px solid var(--line-2);
  background: var(--surface-2);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}
.dtable thead th .fa-sort,
.dtable thead th .fa-sort-up,
.dtable thead th .fa-sort-down {
  margin-left: 4px;
  font-size: 9px;
  opacity: .6;
}
.dtable thead th.num { text-align: right; }
.dtable tbody td {
  padding: 13px var(--card-pad);
  border-bottom: 1px solid var(--line-2);
  color: var(--ink-2);
  vertical-align: middle;
}
.dtable tbody tr:last-child td { border-bottom: none; }
.dtable tbody tr { transition: background .1s; }
.dtable tbody tr:hover { background: var(--backer-softer); }
.dtable td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink);
  font-weight: 500;
}
.dtable td.primary { color: var(--ink); font-weight: 500; }
.dtable td.primary a { color: var(--ink); transition: color .1s; }
.dtable td.primary a:hover { color: var(--backer); }
.dtable td .sub {
  font-size: 11.5px;
  color: var(--ink-3);
  margin-top: 1px;
}

/* ---- .dtable-stack: a table that becomes a stack of cards below 1000px ----
   Each row is a card: its lead cell and chevron on the first line, its body
   cell below, its status last. Cells name their part: .cell-lead, .cell-chev,
   .cell-body, .cell-status; a .cell-date column is folded into the body cell,
   which carries it as data-date. An expanded message row (.js-expansion-row)
   flows under its card. Used by the "all interests / expressions" modals on
   the summary pages; a viewport query, as each is in a full-width modal. */
@media (max-width: 999px) {
  .dtable-stack,
  .dtable-stack thead,
  .dtable-stack tbody,
  .dtable-stack tr,
  .dtable-stack td,
  .dtable-stack th {
    display: block;
    width: 100%;
  }
  .dtable-stack thead { display: none; }
  .dtable-stack tr[hidden] { display: none; }
  .dtable-stack tbody {
    padding: 12px;
    background: var(--surface-2);
  }
  .dtable-stack tbody tr:not(.js-expansion-row) {
    background: var(--surface) !important;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 10px;
    box-shadow: 0 1px 2px rgba(0,0,0,.04);
    display: grid !important;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "lead   chev"
      "body   body"
      "status status";
    gap: 10px 12px;
  }
  .dtable-stack tbody td {
    padding: 0 !important;
    border: none !important;
  }
  .dtable-stack tbody td.cell-lead   { grid-area: lead; min-width: 0; }
  .dtable-stack tbody td.cell-chev   { grid-area: chev; text-align: right; }
  .dtable-stack tbody td.cell-body   { grid-area: body; min-width: 0; }
  .dtable-stack tbody td.cell-status { grid-area: status; }
  .dtable-stack tbody td.cell-date   { display: none; }
  .dtable-stack tbody td.cell-body[data-date]:not([data-date=""])::after {
    content: " | " attr(data-date);
    color: var(--ink-3);
    font-size: 12px;
    margin-left: 4px;
  }
  .dtable-stack tbody tr.js-expansion-row {
    background: transparent !important;
    border: none;
    border-radius: 0;
    padding: 0;
    margin-top: -10px;
    margin-bottom: 10px;
    box-shadow: none;
    display: block;
  }
  .dtable-stack tbody tr.js-expansion-row[hidden] { display: none !important; }
  .dtable-stack tbody tr.js-expansion-row td { padding: 0 14px 14px !important; }
  .dtable-stack tbody tr.js-expansion-row td:empty { display: none; }
}

/* ---- Person cell ---- */
.person {
  display: flex;
  align-items: center;
  gap: 10px;
}
.person .avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--backer-soft);
  color: var(--backer-ink);
  display: grid;
  place-items: center;
  font-size: 10.5px;
  font-weight: 700;
  flex-shrink: 0;
  letter-spacing: .02em;
}
.person.teal  .avatar { background: var(--backer-soft); color: var(--backer-ink); }
.person.amber .avatar { background: var(--amber-soft);  color: var(--amber); }
.person.plum  .avatar { background: var(--plum-soft);   color: var(--plum); }
.person.blue  .avatar { background: var(--blue-soft);   color: var(--blue); }
.person.green .avatar { background: var(--green-soft);  color: var(--green); }
/* Layout modifiers (set via cp_person's `variant=` flag):
   .fill - grow to fill a flex row alongside a sibling action cluster;
   .top  - top-align the avatar when the .who body wraps to multiple lines
           (the base rule centres it). */
.person.fill { flex: 1 1 auto; min-width: 0; }
.person.top  { align-items: flex-start; }
.person .who {
  display: grid;
  line-height: 1.3;
  min-width: 0;
}
.person .who b {
  font-size: 13px;
  color: var(--ink);
  font-weight: 500;
  overflow-wrap: anywhere;
}
/* Email / secondary line - grey, wraps inside the cell instead of forcing
   the column wider. `overflow-wrap: anywhere` lets long addresses break
   mid-word (e.g. after the @) rather than overflow horizontally. */
.person .who span {
  font-size: 11.5px;
  color: var(--ink-3);
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}
.person .who span a {
  color: inherit !important;
  text-decoration: none !important;
  pointer-events: none;
  font-weight: inherit;
}

/* ---- Pill / badge ---- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.5;
  white-space: nowrap;
}
.pill.teal  { background: var(--backer-soft); color: var(--backer-ink); }
.pill.amber { background: var(--amber-soft);  color: var(--amber); }
.pill.green { background: var(--green-soft);  color: var(--green); }
.pill.red   { background: var(--red-soft);    color: var(--red); }
.pill.plum  { background: var(--plum-soft);   color: var(--plum); }
.pill.blue  { background: var(--blue-soft);   color: var(--blue); }
.pill.indigo{ background: var(--indigo-soft); color: var(--indigo); }
.pill.ghost { background: var(--surface-2);   color: var(--ink-3); }

/* Funding-category colour palette - the 7 capital-stack categories. Each .cat-*
   class sets --c; every funding swatch / bar fill reads `background: var(--c)`.
   GLOBAL single source of truth for funding-category colour platform-wide:
   dashboard funding cards (.fr-*), the project / advisor-request capital stack
   (.pd-stack-*), the Express-Interest modal, the EM drawer funding swatches, the
   shortlist / preferred-select pages, the admin Lookups financing-types group
   headers + Reference -> Financing colours, AND the financing pills (Browse /
   My Projects / EM drawer) via `FINANCING_CATEGORY_PALETTE` (pipeline.py), whose
   `pill` token maps each category to the matching flat .pill colour name and
   whose `cat` token maps it to the .cat-* swatch here. Palette: Equity = green, Senior debt =
   blue, Subordinated debt = blue (lighter shade), Hybrid = grey, Working capital
   = blue (lightest shade), Government / Concessional = indigo, Structured / Other
   = amber. (The three Debt shades collapse to a single flat .pill.blue on pills,
   which can't express shades; the capital-stack bars carry the distinct shades.)
   The Subordinated / Working blue shades mix toward `--cat-tint` (white in light
   mode, the dark card surface in dark mode) so they don't blow out on dark. */
.cat-equity       { --c: var(--green); }
.cat-senior       { --c: var(--blue); }
.cat-subordinated { --c: color-mix(in srgb, var(--blue) 74%, var(--cat-tint)); }
.cat-hybrid       { --c: var(--ink-4); }
.cat-working      { --c: color-mix(in srgb, var(--blue) 54%, var(--cat-tint)); }
.cat-concessional { --c: var(--indigo); }
.cat-other        { --c: var(--amber); }

/* ---- Service chip (advisor service-type badge family) ----
   3-tier silhouette rule: sector = filled tile (.sector-ico),
   service = outlined chip with icon (.service-chip),
   stage = flat pill (.pill). See references/mocks/service_badge_palette.html. */
.service-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px 4px 9px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .01em;
  border: 1px solid var(--line);
  white-space: nowrap;
}
.service-chip .ico {
  width: 14px;
  display: inline-grid;
  place-items: center;
  font-size: 11px;
  flex-shrink: 0;
}
.service-chip.lg { padding: 6px 14px 6px 12px; font-size: 12.5px; gap: 8px; }
.service-chip.sm { padding: 2px 9px 2px 7px; font-size: 11px; gap: 5px; }
.service-chip.sm .ico { width: 12px; font-size: 10px; }

.service-chip.technical          { border-color: var(--backer); }
.service-chip.technical .ico     { color: var(--backer); }
.service-chip.legal              { border-color: var(--indigo); }
.service-chip.legal .ico         { color: var(--indigo); }
.service-chip.financial          { border-color: var(--amber); }
.service-chip.financial .ico     { color: var(--amber); }
.service-chip.environmental      { border-color: var(--green); }
.service-chip.environmental .ico { color: var(--green); }
.service-chip.regulatory         { border-color: var(--plum); }
.service-chip.regulatory .ico    { color: var(--plum); }
.service-chip.commercial         { border-color: var(--blue); }
.service-chip.commercial .ico    { color: var(--blue); }

.service-chip.solid.technical     { background: var(--backer-soft); color: var(--backer-ink); }
.service-chip.solid.legal         { background: var(--indigo-soft); color: var(--indigo); }
.service-chip.solid.financial     { background: var(--amber-soft);  color: var(--amber); }
.service-chip.solid.environmental { background: var(--green-soft);  color: var(--green); }
.service-chip.solid.regulatory    { background: var(--plum-soft);   color: var(--plum); }
.service-chip.solid.commercial    { background: var(--blue-soft);   color: var(--blue); }

/* ---- Role badge (monospaced uppercase pill) ---- */
.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 9px;
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-3);
  background: var(--surface-2);
  border-radius: 4px;
  font-family: var(--font-mono);
  letter-spacing: .02em;
}

/* ---- Service chips ---- */
.service-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}
.service-chips .chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 500;
  border: 1px solid var(--line-2);
}
.service-chips .chip .ico {
  color: var(--backer);
  font-size: 10px;
}

/* ---- Pager ---- */
/* Pagination - `.pager` wraps list.js-driven prev/next buttons and a numbered
   `<ul class="pagination">` that list.js fills with the template
   `<li><button class="page" type="button">N</button></li>`. The active <li>
   gets `.active`; disabled prev/next gets both `disabled` attr and class. */
.pager {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Every clickable cell - prev/next button and the per-number <button.page> -
   shares one 26×26 visual token. */
.pager > button,
.pager > .page-link,
.pager .pagination .page {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  min-width: 26px;
  padding: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 10px;
  font-family: var(--font-mono);
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
}
.pager > button:hover,
.pager > .page-link:hover,
.pager .pagination .page:hover {
  background: var(--surface-2);
  color: var(--ink);
}
.pager > button:disabled,
.pager > .page-link.disabled,
.pager > button.disabled {
  opacity: .4;
  cursor: not-allowed;
}

/* Numbered-pages list - inline row, no list bullets, `<li>` is just a wrapper. */
.pager .pagination {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.pager .pagination li {
  list-style: none;
  display: block;
  margin: 0;
  padding: 0;
}

.pager .pagination li.active > .page,
.pager .pagination li.active > .page:hover {
  background: var(--backer-soft);
  color: var(--backer);
  border-color: transparent;
}

/* ---- Empty state ---- */
.empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--ink-3);
  font-size: 13px;
}
.empty .glyph {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--ink-4);
  font-size: 16px;
  margin-bottom: 10px;
}
.empty h4 {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 18px;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin-bottom: 4px;
}
.empty p {
  margin: 0 0 14px;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}

/* ---- Inline contextual banner ---- */
.ib-banner,
.banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13px;
  background: var(--amber-soft);
  color: var(--amber);
  margin-bottom: 16px;
  border: 1px solid transparent;
}
.ib-banner.success,
.banner.success {
  background: var(--green-soft);
  color: var(--green);
}
.ib-banner .ico,
.banner .ico { font-size: 14px; }
.ib-banner a,
.banner a {
  color: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.ib-banner a:hover,
.banner a:hover { text-decoration: none; }
.ib-banner .x,
.banner .x {
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  opacity: .6;
}

/* Flash-message close button - Bootstrap's `.alert-dismissible .btn-close`
   defaults to `position: absolute` + `padding: 1.25rem 1rem`, which blows up
   the hit-target and breaks flex alignment inside our `d-flex` flash alert.
   Force it back in-flow and size it to match the icon/text line height. */
.alert .btn-close {
  position: static;
  box-sizing: border-box;
  width: 22px;
  height: 22px;
  padding: 6px;
  margin: 0 0 0 auto;
  background-size: 12px 12px;
  opacity: .55;
  flex-shrink: 0;
}
.alert .btn-close:hover,
.alert .btn-close:focus { opacity: .9; }

/* ---- Role tabs (dashboard profile page variant) ---- */
.role-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--line);
  margin: 24px 0 22px;
  overflow-x: auto;
}
.role-tabs button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 12px 2px;
  margin-right: 28px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-3);
  border-bottom: 2px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  font-family: inherit;
  transition: color .12s, border-color .12s;
}
.role-tabs button .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink-4);
}
.role-tabs button.active {
  color: var(--ink);
  border-bottom-color: var(--backer);
  font-weight: 600;
}
.role-tabs button.active .dot { background: var(--backer); }
.role-tabs button:hover:not(.active) { color: var(--ink-2); }


/* ---- Browse Projects: list + card shared chrome ----------------------
   Reusable pieces for list/card pages (Browse Projects, later adopted by
   project_list and advisor_requests). The column-hide rules below drive
   the Columns dropdown on Browse Projects; add new `col-hide-*` / `data-col`
   pairs in sync whenever a new toggleable column is added.             */

.page-title .count {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-3);
  background: var(--surface-2);
  padding: 3px 8px;
  border-radius: 6px;
  vertical-align: middle;
  margin-left: 10px;
  letter-spacing: 0;
}

/* Toolbar row */
.bp-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.bp-toolbar .spacer { flex: 1; }
/* Right-aligned actions cluster. `margin-left: auto` pushes it to the right of
   its row whether it shares row 1 with the search/filters or wraps to row 2 -
   this stops the view-toggle and columns picker from wrapping independently
   and landing on different rows around the 1300px wrap threshold. */
.bp-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.bp-search {
  position: relative;
  min-width: 260px;
  flex: 0 1 320px;
}
.bp-search input {
  width: 100%;
  padding: 9px 36px 9px 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  font-family: inherit;
  font-size: 13px;
  color: var(--ink);
  outline: none;
  transition: border-color .12s, box-shadow .12s;
}
.bp-search input::placeholder { color: var(--ink-4); }
.bp-search input:focus {
  border-color: var(--backer);
  box-shadow: 0 0 0 3px var(--backer-soft);
}
.bp-search .ico {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: var(--ink-4);
  pointer-events: none;
}
/* A part of a list page that a live search swaps (IB.wireLiveSearch), dimmed
   while a search is out: the rows on screen are the last query's. */
[data-live][aria-busy="true"] { opacity: .55; transition: opacity .15s .1s; }

.bp-search kbd {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--ink-3);
  background: var(--bg);
}

.fbar { display: flex; gap: 6px; flex-wrap: wrap; }

.fbtn,
.sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 11px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-2);
  outline: none;
  transition: border-color .12s, background .12s, color .12s, box-shadow .12s;
}
.fbtn:hover,
.sort-btn:hover { border-color: var(--ink-3); color: var(--ink); }
.fbtn:focus-visible,
.sort-btn:focus-visible,
.fbtn[aria-expanded="true"],
.sort-btn[aria-expanded="true"] {
  border-color: var(--backer);
  box-shadow: 0 0 0 3px var(--backer-soft);
  color: var(--ink);
}
.fbtn .ca,
.sort-btn .ca { font-size: 9px; color: var(--ink-4); }
.fbtn .filter-label,
.sort-btn .filter-label { color: inherit; }
.fbtn.has-value {
  border-color: var(--backer);
  background: var(--backer-soft);
  color: var(--backer-ink);
}
.fbtn.has-value .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--backer);
}
.fbtn.has-value .ca { color: var(--backer-ink); }
.fbtn .dot { display: none; }

/* A date filter in a filter bar (Admin -> Transactions): a .fbtn (the visible
   flatpickr field carries the input's classes, IB.initFlatpickr) sized for a date. */
input.fbtn { width: 128px; font-family: inherit; }
input.fbtn::placeholder { color: var(--ink-3); }

/* Column chooser dropdown - reuses Bootstrap's .dropdown-menu scaffold */
.col-chooser {
  min-width: 220px;
  padding: 6px;
}
.col-chooser .cc-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 12.5px;
  color: var(--ink-2);
  cursor: pointer;
  user-select: none;
}
.col-chooser .cc-item:hover { background: var(--surface-2); color: var(--ink); }
.col-chooser .cc-item input[type=checkbox] {
  width: 14px;
  height: 14px;
  accent-color: var(--backer);
  margin: 0;
}
.col-chooser .cc-reset {
  display: block;
  margin-top: 4px;
  padding: 6px 8px;
  border-top: 1px solid var(--line-2);
  font-size: 11.5px;
  color: var(--ink-3);
  text-align: right;
  background: transparent;
  border-left: none;
  border-right: none;
  border-bottom: none;
  width: 100%;
  cursor: pointer;
}
.col-chooser .cc-reset:hover { color: var(--backer); }

/* Segmented view toggle (list / card) + auto-collapse indicator */
.view-toggle {
  display: inline-flex;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
  position: relative;
}
.view-toggle button {
  border: none;
  background: transparent;
  padding: 6px 11px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  position: relative;
}
.view-toggle button.on {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
}
/* Inactive button: no green hover bleed from legacy .btn-outline-backer styling */
.view-toggle button:not(.on):hover { color: var(--ink-2); background: transparent; border-color: transparent; }
.view-toggle button:not(.on):focus,
.view-toggle button:not(.on):active { background: transparent; border-color: transparent; box-shadow: none; }
.view-toggle button.auto::after {
  content: 'auto';
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--amber-soft);
  color: var(--amber);
  font-size: 8.5px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
  letter-spacing: .04em;
}

/* Browse-table card (distinct from .card - borderless header, sticky th) */
.tcard {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow-x: auto;
  overflow-y: hidden;
}
.tcard .tbl { width: 100%; border-collapse: collapse; font-size: 13px; table-layout: auto; }
/* Per-column minimum widths so horizontal scroll kicks in once the column
   chooser adds enough columns to overflow the container. First (project) and
   last (actions) columns are pinned by usage; the rest carry a baseline 110-140px. */
.tcard .tbl th[data-col],
.tcard .tbl td[data-col] { min-width: 80px; white-space: nowrap; }
.tcard .tbl th[data-col="project"],
.tcard .tbl td[data-col="project"] { min-width: 250px; }
.tcard .tbl td[data-col="project"] .pname,
.tcard .tbl td[data-col="project"] .psub { max-width: 320px; }
.tcard .tbl th[data-col="actions"],
.tcard .tbl td[data-col="actions"] { min-width: 96px; text-align: right; }
.tcard .tbl th[data-col="funding"],
.tcard .tbl td[data-col="funding"] { min-width: 140px; white-space: normal; }
.tcard .tbl th[data-col="classification"],
.tcard .tbl td[data-col="classification"],
.tcard .tbl th[data-col="dealProcess"],
.tcard .tbl td[data-col="dealProcess"] { min-width: 140px; }
.tcard .tbl th[data-col="value"],
.tcard .tbl td[data-col="value"],
.tcard .tbl th[data-col="valueUsd"],
.tcard .tbl td[data-col="valueUsd"],
.tcard .tbl th[data-col="targetReturn"],
.tcard .tbl td[data-col="targetReturn"] { min-width: 120px; }
.tcard .tbl th[data-col="request"],
.tcard .tbl td[data-col="request"] { min-width: 300px; }
.tcard .tbl th[data-col="views"],
.tcard .tbl td[data-col="views"],
.tcard .tbl th[data-col="interest"],
.tcard .tbl td[data-col="interest"] { min-width: 80px; }
.tcard thead th {
  text-align: left;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-2);
  background: var(--surface-2);
  white-space: nowrap;
}
.tcard thead th:first-child { padding-left: 22px; }
.tcard thead th:last-child  { padding-right: 22px; }
/* Sort headers driven by list.js. List.js adds `.asc` / `.desc` to the
   active header on click; we paint the indicator via ::after so the markup
   stays clean (no `<span class="so">` etc.). */
.tcard thead th.sort { cursor: pointer; user-select: none; }
.tcard thead th.sort:hover { color: var(--ink); }
.tcard thead th.sort::after {
  content: '\2195';
  margin-left: 4px;
  font-size: 9px;
  opacity: .35;
  transition: opacity .12s, color .12s;
}
.tcard thead th.sort:hover::after { opacity: .8; }
.tcard thead th.sort.asc,
.tcard thead th.sort.desc { color: var(--backer); }
.tcard thead th.sort.asc::after  { content: '\2191'; opacity: 1; color: var(--backer); }
.tcard thead th.sort.desc::after { content: '\2193'; opacity: 1; color: var(--backer); }
.tcard thead th.num { text-align: right; }
.tcard tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line-2);
  color: var(--ink-2);
  vertical-align: middle;
}
.tcard tbody td:first-child { padding-left: 22px; }
.tcard tbody td:last-child  { padding-right: 22px; }
.tcard tbody tr:last-child td { border-bottom: none; }
.tcard tbody tr { transition: background .1s; }
.tcard tbody tr:hover { background: var(--backer-softer); }
.tcard tbody tr.featured { background: linear-gradient(90deg, rgba(176, 126, 42, .05) 0%, transparent 60%); }
.tcard tbody tr.featured:hover { background: linear-gradient(90deg, rgba(176, 126, 42, .08) 0%, var(--backer-softer) 60%); }
.tcard td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink);
  font-weight: 500;
  white-space: nowrap;
}
.tcard td.num .ccy { color: var(--ink-3); font-weight: 400; margin-right: 2px; }

/* Project cell (icon + title + sub-line) */
.pcell { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pcell .sector-ico {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  font-size: 14px;
  position: relative;
}
.pcell .ptext { min-width: 0; display: grid; line-height: 1.3; }
.pcell .ptext .pname {
  color: var(--ink);
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color .1s;
}
.pcell .ptext .pname:hover { color: var(--backer); }
.pcell .ptext .psub {
  font-size: 11.5px;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pcell .ptext .psub .dot {
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: var(--ink-4);
  flex-shrink: 0;
}

/* Featured star overlay on sector-ico */
.feat-star {
  position: absolute;
  top: -2px;
  right: -3px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--amber);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 7px;
  border: 2px solid var(--surface);
}

/* Country flag chip */
.flag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--ink-2);
}
.flag .fc {
  width: 22px;
  height: 14px;
  border-radius: 2px;
  border: 1px solid var(--line);
  display: inline-grid;
  place-items: center;
  background: var(--surface-2);
  font-size: 9px;
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: -.02em;
  flex-shrink: 0;
}

/* Stage pill with three-tier progress sliver */
.stage-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ink-2);
}
.stage-pill .sb {
  width: 30px;
  height: 4px;
  border-radius: 2px;
  background: var(--line);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}
.stage-pill .sb::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: var(--backer);
  border-radius: 2px;
}
.stage-pill.early .sb::after { width: 20%; background: var(--amber); }
.stage-pill.mid   .sb::after { width: 55%; background: var(--backer); }
.stage-pill.late  .sb::after { width: 85%; background: var(--green); }

/* Row actions (reveal on hover, except .save-btn which always renders at
   full opacity so the saved-state colour reads identically to the card-view
   heart - CSS opacity on a parent caps children, so the dim has to live on
   each non-save child instead of on the wrapper). */
.row-actions {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
  align-items: center;
}
.row-actions > :not(.save-btn) {
  opacity: .6;
  transition: opacity .1s;
}
.tcard tbody tr:hover .row-actions > :not(.save-btn) { opacity: 1; }
.row-actions button,
.row-actions a {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: var(--ink-3);
  display: inline-grid;
  place-items: center;
  font-size: 12px;
  cursor: pointer;
  text-decoration: none;
  transition: background .12s, color .12s;
}
.row-actions button:hover,
.row-actions a:hover { background: var(--backer-soft); color: var(--backer-ink); }
.row-actions .cancel-btn:hover { background: var(--red-soft); color: var(--red); }
.row-actions .save-btn.on { color: var(--red); }
.row-actions .save-btn.on:hover { background: var(--red-soft); color: var(--red); }

/* Published cell */
.pub {
  font-size: 12px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.pub.new { color: var(--green); font-weight: 500; }
.pub.new::before { content: '\2022'; margin-right: 3px; color: var(--green); }

/* Column hide rules - one per toggleable column slug. Keep in sync with the
   columnsConfig passed to IB.setupColumnChooser in the browse_projects template. */
.col-hide-subsector      [data-col="subsector"]      { display: none !important; }
.col-hide-country        [data-col="country"]        { display: none !important; }
.col-hide-stage          [data-col="stage"]          { display: none !important; }
.col-hide-value          [data-col="value"]          { display: none !important; }
.col-hide-funding        [data-col="funding"]        { display: none !important; }
.col-hide-published      [data-col="published"]      { display: none !important; }
.col-hide-valueUsd       [data-col="valueUsd"]       { display: none !important; }
.col-hide-classification [data-col="classification"] { display: none !important; }
.col-hide-revenueModel   [data-col="revenueModel"]   { display: none !important; }
.col-hide-targetReturn   [data-col="targetReturn"]   { display: none !important; }
.col-hide-dealProcess    [data-col="dealProcess"]    { display: none !important; }
.col-hide-sector         [data-col="sector"]         { display: none !important; }
.col-hide-service        [data-col="service"]        { display: none !important; }
.col-hide-status         [data-col="status"]         { display: none !important; }
.col-hide-views          [data-col="views"]          { display: none !important; }
.col-hide-interest       [data-col="interest"]       { display: none !important; }
.col-hide-deadline       [data-col="deadline"]       { display: none !important; }
.col-hide-developer      [data-col="developer"]      { display: none !important; }

/* Project card (grid view).
   Grid layout is `.ib-card-grid` on the `.ib-card-view` container with
   `.ib-card-item` wrappers around each `.project-card` (see the .ib-card-grid
   block below). `.project-card.h-100` makes sibling cards match height so the
   value/stage rail aligns across the row. */
.project-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color .12s, box-shadow .12s, transform .12s;
  position: relative;
}
.project-card:hover {
  border-color: var(--backer);
  box-shadow: 0 8px 22px -10px rgba(29, 71, 68, .18);
  transform: translateY(-1px);
}
.project-card.featured { border-color: rgba(176, 126, 42, .35); }
.project-card.featured::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(176, 126, 42, .06) 0%, transparent 45%);
  pointer-events: none;
}

/* Card media band (sector-tinted gradient + hatched overlay) */
.pc-media {
  position: relative;
  height: 120px;
  border-bottom: 1px solid var(--line-2);
  overflow: hidden;
  background: linear-gradient(135deg, var(--surface-2) 0%, var(--line) 100%);
}
.pc-media::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(135deg, transparent 0 12px, rgba(255, 255, 255, .35) 12px 13px);
}
.pc-media.economic { background: linear-gradient(135deg, #f6ecd6 0%, #eadcb8 100%); }
.pc-media.energy   { background: linear-gradient(135deg, #e0eee6 0%, #c5dfcf 100%); }
.pc-media.digital  { background: linear-gradient(135deg, #ece0f0 0%, #d6c4de 100%); }
.pc-media.social   { background: linear-gradient(135deg, #e3e9f2 0%, #c9d6e7 100%); }
.pc-sector {
  position: absolute;
  left: 14px;
  top: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, .85);
  backdrop-filter: blur(4px);
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink);
}
.pc-sector .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-4); }
.pc-sector.economic .dot { background: var(--amber); }
.pc-sector.energy   .dot { background: var(--green); }
.pc-sector.digital  .dot { background: var(--plum); }
.pc-sector.social   .dot { background: var(--blue); }
.pc-feat {
  position: absolute;
  right: 12px;
  top: 12px;
  background: var(--amber);
  color: #fff;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.pc-feat i { font-size: 8px; }
.pc-status {
  position: absolute;
  bottom: 12px;
  left: 14px;
}
.pill.pill-deadline { font-size: 10.5px; }
.pill.pill-deadline > i { margin-right: 4px; }
.pcell .pill.pill-deadline { margin-top: 4px; }
.pc-deadline { margin-top: 8px; }
.pc-foot .row-actions { gap: 2px; }
.pc-foot .row-actions > :not(.save-btn) { opacity: 1; }
.pc-save {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .92);
  border: none;
  color: var(--ink-3);
  display: grid;
  place-items: center;
  font-size: 12px;
  cursor: pointer;
  transition: color .12s, background .12s;
}
.pc-save:hover { color: var(--red); background: #fff; }
.pc-save.on { color: var(--red); }

.pc-body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pc-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.25;
  letter-spacing: -.005em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: none;
}
.pc-title:hover { 
  color: var(--backer); 
  text-decoration: none;
}
.pc-sub {
  font-size: 12px;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.pc-sub .sep { width: 2px; height: 2px; border-radius: 50%; background: var(--ink-4); }
.pc-sub i { color: var(--backer); font-size: 11px; margin-right: 4px; }
.pc-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.pc-tags .pill.more {
  background: transparent;
  color: var(--ink-3);
  border: 1px dashed var(--line);
  padding: 1px 6px;
}
.pc-tags .pill.more::before { display: none; }
.pc-value {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
  margin-top: auto;
}
.pc-value .vl {
  font-size: 10px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 600;
}
.pc-value .v {
  font-family: var(--font-mono);
  font-size: 17px;
  color: var(--ink);
  font-weight: 500;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.pc-value .v .ccy { font-size: 11px; color: var(--ink-3); font-weight: 400; margin-right: 3px; }
.pc-stg { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.pc-stg .stg-lbl {
  font-size: 10px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 600;
}
.pc-stg .stg-val { font-size: 12.5px; color: var(--ink-2); font-weight: 500; }

.pc-foot {
  padding: 10px 16px;
  border-top: 1px solid var(--line-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface-2);
  gap: 10px;
}
.pc-foot .meta {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-3);
  font-size: 11.5px;
  flex-wrap: wrap;
}
.pc-foot .meta span { display: inline-flex; align-items: center; gap: 4px; }
.pc-foot .meta i { color: var(--ink-4); font-size: 11px; }
/* Clock is always coloured (the card's anchor metric) */
.pc-foot .meta .clock i { color: var(--backer); }
/* Views / saves / interest only colour up when their count is non-zero (`.on`) */
.pc-foot .meta .views.on { color: var(--backer-ink); font-weight: 500; }
.pc-foot .meta .views.on i { color: var(--backer); }
.pc-foot .meta .saves.on { color: var(--backer-ink); font-weight: 500; }
.pc-foot .meta .saves.on i { color: var(--backer); }
.pc-foot .meta .interest.on { color: var(--backer-ink); font-weight: 500; }
.pc-foot .meta .interest.on b { color: var(--backer); font-weight: 700; }
.pc-foot .meta .interest.on i { color: var(--backer); }
.pc-foot .view {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  color: var(--backer);
  display: inline-grid;
  place-items: center;
  font-size: 12px;
  transition: background .12s, color .12s;
  text-decoration: none;
  flex-shrink: 0;
}
.pc-foot .view:hover { background: var(--backer-soft); color: var(--backer-ink); }

/* List/card visibility toggle (container-level) */
.ib-view-list .ib-card-view,
.ib-view-list .cgrid { display: none; }
.ib-view-card .ib-table-view,
.ib-view-card .tcard { display: none; }

/* Shared fluid card-grid track - the single source of truth for every card view
   on the platform: project_list / advisor_requests / browse_projects
   (.ib-card-grid) and the organisations directory (.dx-cards, defined later in
   this file). 330px minimum card width, capped at 3 columns - every column is
   the larger of 330px and one-third of the available row, so the grid shows 3
   columns on a wide row and drops 3 -> 2 -> 1 the instant a column would fall
   below 330px (and climbs back as the row widens). The outer `min(100%, ...)`
   guards against a single column overflowing on viewports narrower than 330px.
   The `2rem` is 2 inter-column gaps (gap is 1rem / 16px on both consumers) -
   keep it in sync if that gap ever changes. */
.ib-card-grid,
.dx-cards {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, max(330px, (100% - 2rem) / 3)), 1fr));
}
/* .ib-card-grid replaces the old Bootstrap `row-cols-1/sm-2/lg-3` breakpoints. */
.ib-card-grid {
  display: grid;
  gap: 1rem;
}
.ib-card-grid > .ib-card-item { display: flex; }
.ib-card-grid > .ib-card-item > .project-card { flex: 1; width: 100%; }

/* Second row of .bp-toolbar - hosts the columns picker so it appears below the
   right-aligned view toggle (dropdown would otherwise overlap the toggle on
   narrow viewports). Hidden in card view since the picker only acts on the
   table view. */
.bp-toolbar-row2 {
  flex-basis: 100%;
  display: flex;
  justify-content: flex-end;
}
.ib-view-card .bp-toolbar-row2 { display: none; }

/* Dark mode adjustments */
[data-bs-theme="dark"] .bp-search input { background: var(--surface); }
[data-bs-theme="dark"] .bp-search kbd { background: var(--surface-2); }
[data-bs-theme="dark"] .fbtn,
[data-bs-theme="dark"] .sort-btn { background: var(--surface); }
[data-bs-theme="dark"] .flag .fc { background: var(--ink-4); color: var(--ink); }
[data-bs-theme="dark"] .pc-media { background: linear-gradient(135deg, var(--surface-2) 0%, var(--line) 100%); }
[data-bs-theme="dark"] .pc-media.economic { background: linear-gradient(135deg, rgba(176,126,42,.25) 0%, rgba(176,126,42,.12) 100%); }
[data-bs-theme="dark"] .pc-media.energy   { background: linear-gradient(135deg, rgba(47,122,77,.30) 0%, rgba(47,122,77,.14) 100%); }
[data-bs-theme="dark"] .pc-media.digital  { background: linear-gradient(135deg, rgba(107,74,122,.30) 0%, rgba(107,74,122,.14) 100%); }
[data-bs-theme="dark"] .pc-media.social   { background: linear-gradient(135deg, rgba(44,74,120,.30) 0%, rgba(44,74,120,.14) 100%); }
[data-bs-theme="dark"] .pc-sector { background: rgba(0, 0, 0, .45); color: var(--ink); backdrop-filter: blur(4px); }
[data-bs-theme="dark"] .pc-save { background: rgba(0, 0, 0, .45); }
[data-bs-theme="dark"] .pc-save:hover { background: rgba(0, 0, 0, .6); color: var(--red); }
[data-bs-theme="dark"] .feat-star { border-color: var(--surface); }
[data-bs-theme="dark"] .tcard tbody tr.featured { background: linear-gradient(90deg, rgba(176, 126, 42, .12) 0%, transparent 60%); }
[data-bs-theme="dark"] .tcard tbody tr.featured:hover { background: linear-gradient(90deg, rgba(176, 126, 42, .18) 0%, var(--backer-softer) 60%); }


/* =====================================================================
   9. MODALS & FORMS
   Canonical modal chrome, form controls, chip pickers, and the sector-icon
   tile used on activity tables. Applied ON TOP of Bootstrap 5 modals so
   focus trap / backdrop / Escape keep working.

   Reference: references/mocks/profile_modals.html
   ===================================================================== */

/* ---- Sector-icon tile (activity tables, project cells) ---- */
.project-cell { display: flex; align-items: center; gap: 12px; }
.project-cell .who { line-height: 1.3; min-width: 0; }
.project-cell .who b { display: block; color: var(--ink); font-weight: 500; font-size: 13px; }
.project-cell .who b a { color: inherit; }
.project-cell .who b a:hover { color: var(--backer); }
.project-cell .who span { font-size: 11.5px; color: var(--ink-3); }

.sector-ico {
  flex-shrink: 0;
  width: 32px; height: 32px;
  border-radius: 8px;
  display: grid; place-items: center;
  font-size: 14px;
  background: var(--surface-2);
  color: var(--ink-3);
}
.sector-ico.economic { background: var(--amber-soft); color: var(--amber); }
.sector-ico.energy   { background: var(--green-soft); color: var(--green); }
.sector-ico.digital  { background: var(--plum-soft);  color: var(--plum);  }
.sector-ico.social   { background: var(--blue-soft);  color: var(--blue);  }

/* ---- Modal chrome (Bootstrap .modal-content and children get these classes) ---- */
.mf-frame {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-pop);
  display: flex;
  flex-direction: column;
}
.mf-frame::before {
  content: '';
  position: absolute;
  inset: -30px;
  background: radial-gradient(closest-side, rgba(45, 107, 102, .06), transparent 70%);
  z-index: -1;
  border-radius: 30px;
  pointer-events: none;
}

.mf-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--line-2);
}
.mf-head h4 {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: var(--ink);
}
.mf-head p {
  margin: 4px 0 0;
  color: var(--ink-3);
  font-size: 13px;
}

.mf-close {
  width: 30px; height: 30px;
  flex-shrink: 0;
  padding: 0;                 /* drop UA button padding so the glyph centres in the 30px box */
  border-radius: 8px;
  border: none;
  background: var(--surface-2);
  color: var(--ink-3);
  display: grid;
  place-items: center;
  line-height: 1;
  text-align: center;
  cursor: pointer;
  transition: background .12s, color .12s;
}
.mf-close > * { line-height: 1; }
.mf-close:hover { background: var(--line); color: var(--ink); }

.mf-body {
  padding: 20px 24px;
  flex: 1;
  overflow: auto;
}
/* Body paragraphs in info-style modals - tighter than default body, soft tone, brand-coloured bold runs. */
.mf-body .mf-info-p {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-2);
}
.mf-body .mf-info-p b { color: var(--backer); font-weight: 600; }

.mf-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 14px 24px;
  border-top: 1px solid var(--line-2);
  background: var(--surface-2);
}
.mf-foot .mf-foot-status {
  font-size: 12px;
  color: var(--ink-3);
}
/* Right-cluster wrapper for footer buttons. .mf-foot itself is
   justify-content: space-between, so a single child sits at flex-start;
   margin-left: auto pushes the cluster back to the right edge whether or
   not a .mf-foot-status sibling is present. */
.mf-foot .mf-foot-actions {
  display: flex;
  gap: 6px;
  margin-left: auto;
}

/* ---- Modal tabs (used inside .mf-body; flush to body edges) ---- */
.mf-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--line-2);
  margin: -4px -24px 16px;
}
.mf-tabs button {
  background: transparent;
  border: none;
  padding: 12px 24px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-3);
  border-bottom: 2px solid transparent;
  font-family: inherit;
  cursor: pointer;
  transition: color .12s, border-color .12s;
}
.mf-tabs button:hover { color: var(--ink); }
.mf-tabs button.on { color: var(--ink); border-color: var(--backer); font-weight: 600; }
.mf-tab-panel { display: none; }
.mf-tab-panel.on { display: block; }

/* ---- Form controls ---- */
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field > label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: 6px;
}
/* Pull the required-asterisk close to the label text so it reads as "Country*",
   not as a detached bullet. The 6px flex gap is preserved for other siblings
   (like the .opt "optional" tag). */
.field > label .req { color: var(--red); font-weight: 700; margin-left: -4px; }
.field > label .opt {
  color: var(--ink-4);
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  font-size: 11px;
}
.field .hint { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
/* Inline validation state for .field-wrapped controls. Used when client-side
   validation runs against a control that the browser cannot natively flag
   (e.g. a Choices.js-wrapped <select> whose original <select> is hidden). */
.field.has-error > input,
.field.has-error > textarea,
.field.has-error > select,
.field.has-error .choices__inner { border-color: var(--red); }
.field.has-error > input:focus,
.field.has-error > textarea:focus,
.field.has-error > select:focus { box-shadow: 0 0 0 3px rgba(169, 68, 46, .12); }
.field-error-msg { font-size: 11.5px; color: var(--red); margin-top: 2px; }

.field input[type=text],
.field input[type=email],
.field input[type=url],
.field input[type=number],
.field input[type=password],
.field input[type=search],
.field textarea,
.field select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  /* Explicit line-height (not `normal`) locks the control's box height so a
     browser autofill font swap can't recompute it and nudge the field on
     click. `normal` is font-dependent, which is the real cause of the jump. */
  line-height: 1.4;
  outline: none;
  transition: border-color .12s, box-shadow .12s;
}
.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--backer);
  box-shadow: 0 0 0 3px rgba(45, 107, 102, .12);
}
/* Keep autofilled fields on the surface colour instead of the browser's
   pale-blue autofill tint; the big inset shadow masks the native fill. */
.field input:-webkit-autofill,
.field textarea:-webkit-autofill,
.field select:-webkit-autofill {
  -webkit-text-fill-color: var(--ink);
  -webkit-box-shadow: 0 0 0 1000px var(--surface) inset;
  caret-color: var(--ink);
}
.field input:-webkit-autofill:focus,
.field textarea:-webkit-autofill:focus,
.field select:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 3px rgba(45, 107, 102, .12), 0 0 0 1000px var(--surface) inset;
}
.field input:disabled,
.field input[readonly],
.field textarea:disabled,
.field textarea[readonly],
.field select:disabled {
  background: var(--surface-2);
  color: var(--ink-3);
  border-color: var(--line-2);
  cursor: not-allowed;
}
.field textarea { resize: vertical; min-height: 92px; line-height: 1.55; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.char-meter {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--ink-3);
  margin-top: 4px;
}
.char-meter .bar {
  flex: 1;
  margin: 0 10px;
  height: 3px;
  border-radius: 3px;
  background: var(--line-2);
  overflow: hidden;
}
.char-meter .bar i {
  display: block;
  height: 100%;
  background: var(--backer);
  border-radius: 3px;
  transition: width .2s;
  width: 0;
}

.ghost-alert {
  display: flex;
  gap: 10px;
  padding: 11px 14px;
  background: var(--backer-softer);
  border: 1px solid var(--backer-soft);
  border-radius: 10px;
  font-size: 12.5px;
  color: var(--ink-2);
  margin-bottom: 14px;
}
.ghost-alert .ico { color: var(--backer); flex-shrink: 0; margin-top: 2px; }
.ghost-alert b { color: var(--ink); }

/* ---- Chip pickers (replace Choices.js multi-selects) ---- */
.chips-field .chips-box {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  background: var(--surface);
}
.chips-field .chips-group-label {
  width: 100%;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 4px 0 2px;
}
.chips-field .chips-group-label:first-child { margin-top: 0; }

.chipx {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--line-2);
  cursor: pointer;
  transition: background .1s, border-color .1s, color .1s;
  user-select: none;
}
.chipx:hover { background: var(--backer-soft); border-color: var(--backer-soft); color: var(--backer-ink); }
/* Selected state - raised specificity (two classes on the same element) so tier
   variants or parent-scoped overrides can't accidentally revert the teal fill. */
.chipx.chipx.on { background: var(--backer); color: #fff; border-color: var(--backer); }
.chipx.chipx.on:hover { background: var(--backer-ink); border-color: var(--backer-ink); }
.chipx .ico { font-size: 10px; }
.chipx.tier-region { font-weight: 600; }

/* ---- Geography picker: collapsible accordion + search + selected summary ---- */
.geo-picker {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  overflow: hidden;
}

.geo-summary {
  padding: 10px 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 44px;
  border-bottom: 1px solid var(--line-2);
  background: var(--surface-2);
}
.geo-summary-empty {
  font-size: 12px;
  color: var(--ink-4);
  font-style: italic;
  align-self: center;
}
.geo-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line-2);
  background: var(--surface);
}
.geo-search i { color: var(--ink-4); font-size: 12px; }
.geo-search input[type=search] {
  flex: 1;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  color: var(--ink);
  outline: none;
  padding: 2px 0;
}
.geo-search input[type=search]::placeholder { color: var(--ink-4); }

.geo-tree {
  max-height: 320px;
  overflow-y: auto;
}

.geo-region { border-bottom: 1px solid var(--line-2); }
.geo-region:last-child { border-bottom: none; }

.geo-region-header {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border: none;
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background .12s;
}
.geo-region-header:hover { background: var(--surface-2); }
.geo-region-header .caret {
  color: var(--ink-4);
  font-size: 10px;
  transition: transform .15s;
}
.geo-region.open .geo-region-header .caret { transform: rotate(90deg); }
.geo-region-header .name { flex: 1; }
.geo-region-header .count {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  color: var(--ink-3);
}
.geo-region-header.has-selection .count {
  color: var(--backer-ink);
  background: var(--backer-soft);
  padding: 2px 7px;
  border-radius: 4px;
}

.geo-region-body {
  display: none;
  padding: 0 14px 12px 32px;
  background: var(--surface-2);
}
.geo-region.open .geo-region-body { display: block; }

.geo-allrow {
  padding: 8px 0 10px;
  border-bottom: 1px solid var(--line-2);
  margin-bottom: 10px;
}

.geo-sub { margin-bottom: 10px; }
.geo-sub:last-child { margin-bottom: 0; }
.geo-sub-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 6px;
}
.geo-sub-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

/* ---- Invite-modal-specific ---- */
.domain-box {
  background: var(--surface-2);
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 14px;
}
.domain-box .lbl {
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 4px;
}
.domain-box .val {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--ink);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}
.domain-box .caption {
  font-size: 11.5px;
  color: var(--ink-3);
  margin-top: 6px;
}
.domain-box .caption code {
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--surface);
  padding: 1px 6px;
  border-radius: 4px;
}

.invite-list { display: flex; flex-direction: column; gap: 6px; }
.invite-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.invite-row input[type=email] {
  flex: 0 1 400px;
  min-width: 0;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color .12s, box-shadow .12s;
}
.invite-row input[type=email]:focus {
  border-color: var(--backer);
  box-shadow: 0 0 0 3px rgba(45, 107, 102, .12);
}
.invite-row .rm {
  width: 34px; height: 34px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--ink-4);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
  transition: background .12s, color .12s;
}
.invite-row .rm i { display: block; line-height: 1; }
.invite-row .rm:hover { color: var(--red); background: var(--red-soft); }
.invite-row:only-child .rm { display: none; }

.invite-add {
  margin-top: 8px;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px dashed var(--line);
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 12px;
  color: var(--ink-3);
  font-weight: 500;
  cursor: pointer;
  transition: border-color .12s, background .12s, color .12s;
}
.invite-add:hover {
  color: var(--backer);
  border-color: var(--backer-soft);
  background: var(--backer-softer);
}

/* The invite modal's Pending tab (in an .invite-list): one row per open team invitation. */
.invite-pending-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--surface);
}
.invite-pending-row .who { flex: 1; min-width: 0; }
.invite-pending-row .email {
  font-size: 13px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.invite-pending-row .meta { font-size: 11.5px; color: var(--ink-3); }
.invite-pending-row .acts { display: flex; gap: 4px; flex-shrink: 0; }



/* =====================================================================
   10. FORM WIZARD (.pf-*)
   Reusable multi-step form shell. Canonical reference: project_form.html.
   Any future wizard (saved-search create, investor onboarding, broker-
   agreement draft) should adopt this shell without adding new CSS.
   Derived from references/mocks/project_form_mockup.html.
   ===================================================================== */

/* --- Wizard frame ---------------------------------------------------- */
.pf-frame {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}
/* No overflow clip on the frame: it cut off any dropdown near a step's foot.
   Its tinted bands (the stepper on top, the foot below) round their own
   corners instead, one pixel inside the frame's border. */
.pf-frame { --pf-inner-radius: calc(var(--radius) - 1px); }
.pf-frame > .pf-stepper,
.pf-stepper > .pf-step:first-child { border-top-left-radius: var(--pf-inner-radius); }
.pf-frame > .pf-stepper,
.pf-stepper > .pf-step:last-child { border-top-right-radius: var(--pf-inner-radius); }
.pf-frame > .pf-foot { border-radius: 0 0 var(--pf-inner-radius) var(--pf-inner-radius); }

/* --- Stepper rail ---------------------------------------------------- */
.pf-stepper {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  position: relative;
  margin: 0;
  padding: 0;
  list-style: none;
}
.pf-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px;
  border: none;
  background: transparent;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  color: var(--ink-3);
  position: relative;
  transition: background .12s, color .12s;
  border-right: 1px solid var(--line);
  min-width: 0;
}
.pf-step:last-child { border-right: none; }
.pf-step:hover:not(.locked):not(:disabled) { background: var(--surface); color: var(--ink-2); }
.pf-step.locked,
.pf-step:disabled { cursor: not-allowed; opacity: .55; }
.pf-step-num {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink-3);
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  transition: background .12s, color .12s, border-color .12s;
}
.pf-step-text { display: grid; line-height: 1.2; min-width: 0; }
.pf-step-eyebrow {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-4);
}
.pf-step-label {
  font-size: 13px;
  font-weight: 500;
  color: inherit;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pf-step.done .pf-step-num {
  background: var(--backer-soft);
  border-color: var(--backer-soft);
  color: var(--backer);
  /* SVG check painted as a background image. ::before with FA glyph was unreliable
     because the inner <span> in the markup is a grid item that competes for the
     centred position; SVG bg-image is independent of font-loading state. */
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'><path d='M3 7.2L5.6 9.5L11 4' stroke='%232d6b66' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 14px 14px;
}
.pf-step.done .pf-step-num span { visibility: hidden; }
[data-bs-theme="dark"] .pf-step.done .pf-step-num {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'><path d='M3 7.2L5.6 9.5L11 4' stroke='%234ea49c' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
}
.pf-step.done { color: var(--ink-2); }
.pf-step.active {
  background: var(--surface);
  color: var(--ink);
}
.pf-step.active::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: var(--backer);
}
.pf-step.active .pf-step-num {
  background: var(--backer);
  border-color: var(--backer);
  color: #fff;
}
.pf-step.active .pf-step-eyebrow { color: var(--backer); }

/* --- Panel layout ---------------------------------------------------- */
.pf-panel { padding: 28px 32px 8px; }
.pf-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}
.pf-panel-head .ph-eyebrow {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--backer);
  margin-bottom: 8px;
}
.pf-panel-head h2 {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 24px;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin: 0 0 6px;
  line-height: 1.15;
}
.pf-panel-head .ph-sub {
  font-size: 13.5px;
  color: var(--ink-3);
  max-width: 560px;
  margin: 0;
  line-height: 1.5;
}
.pf-progress-mini {
  flex-shrink: 0;
  text-align: right;
  display: grid;
  gap: 4px;
  align-content: start;
}
.pf-progress-mini .pm-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
}
.pf-progress-mini .pm-count b { color: var(--ink); font-weight: 600; }
.pf-progress-mini .pm-bar {
  width: 160px;
  height: 4px;
  border-radius: 2px;
  background: var(--line-2);
  overflow: hidden;
}
.pf-progress-mini .pm-bar i { display: block; height: 100%; background: var(--backer); border-radius: 2px; transition: width .2s; }

/* --- Section grouping inside a panel --------------------------------- */
.pf-section { margin-bottom: 26px; }
.pf-section + .pf-section { padding-top: 26px; border-top: 1px solid var(--line-2); }
.pf-section-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.pf-section-head h3 {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0;
}
.pf-section-head .pf-section-hint {
  font-size: 12px;
  color: var(--ink-4);
}

/* --- Form grid (12-col) ---------------------------------------------- */
.pf-grid {
  display: grid;
  gap: 18px 16px;
  grid-template-columns: repeat(12, 1fr);
}
/* Align field cells to the top of their grid row so a field with an appended
   validation message doesn't stretch its row-mates to the same height. Only
   applies to .pf-field cells - bare .pf-col-* cells (e.g. the Step 2 lookup
   button which uses align-items:flex-end inside) keep their default stretch. */
.pf-grid > .pf-field { align-self: start; }
.pf-col-12 { grid-column: span 12; }
.pf-col-9  { grid-column: span 9; }
.pf-col-8  { grid-column: span 8; }
.pf-col-6  { grid-column: span 6; }
.pf-col-5  { grid-column: span 5; }
.pf-col-4  { grid-column: span 4; }
.pf-col-3  { grid-column: span 3; }

/* --- Field ---------------------------------------------------------- */
.pf-field { display: grid; gap: 6px; min-width: 0; }
.pf-field > label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.3;
  margin: 0;
}
.pf-field > label .req {
  color: var(--red);
  font-weight: 700;
  /* Negate the parent label's flex gap so the asterisk sits tight to the label text. */
  margin-left: -6px;
}
.pf-section-head h3 .req {
  color: var(--red);
  font-weight: 700;
  margin-left: 2px;
}
.pf-field > label .opt {
  color: var(--ink-4);
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  font-size: 11px;
  /* Same trick - keep the "(optional)" hint glued to the label text rather than floating in dead space. */
  margin-left: -2px;
}
/* Generic info trigger - used inside labels and in the timeline toolbar.
   Bootstrap modal triggers via data-bs-toggle. */
.info-i {
  display: inline-grid;
  place-items: center;
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 1px solid var(--line);
  font-size: 8px;
  line-height: 1;
  color: var(--ink-4);
  cursor: pointer;
  background: var(--surface);
  transition: color .12s, border-color .12s;
  text-transform: none;
  letter-spacing: 0;
  font-family: var(--font-mono);
  font-weight: 700;
  user-select: none;
  vertical-align: middle;
}
.info-i:hover {
  background: var(--backer);
  border-color: var(--backer);
  color: #fff;
}
.info-i.open {
  color: #fff;
  background: var(--backer);
  border-color: var(--backer);
  transform: scale(1.05);
}

.pf-field input[type=text],
.pf-field input[type=email],
.pf-field input[type=url],
.pf-field input[type=number],
.pf-field input[type=date],
.pf-field input[type=search],
.pf-field input[type=tel],
.pf-field textarea,
.pf-field select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color .12s, box-shadow .12s;
  -webkit-appearance: none;
  appearance: none;
}
.pf-field select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'><path d='M3 4.5L6 7.5L9 4.5' stroke='%236a7570' stroke-width='1.4' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px 12px;
  padding-right: 30px;
}
.pf-field input:focus,
.pf-field textarea:focus,
.pf-field select:focus {
  border-color: var(--backer);
  box-shadow: 0 0 0 3px rgba(45,107,102,.12);
}
.pf-field input:disabled,
.pf-field input[readonly],
.pf-field textarea:disabled,
.pf-field textarea[readonly],
.pf-field select:disabled {
  background: var(--surface-2);
  color: var(--ink-3);
  cursor: not-allowed;
}
.pf-field textarea { resize: vertical; min-height: 96px; line-height: 1.55; }
.pf-field .hint { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; line-height: 1.45; }
.pf-field .hint a { color: var(--backer); text-decoration: none; }
.pf-field .hint a:hover { text-decoration: underline; }
.pf-field .meter {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-4);
}
.pf-field .invalid-feedback,
.pf-field .ajax-error {
  font-size: 11.5px;
  color: var(--red);
  margin-top: 2px;
  line-height: 1.4;
}
.pf-field input.is-invalid,
.pf-field textarea.is-invalid,
.pf-field select.is-invalid { border-color: var(--red); }
/* flatpickr altInput puts .is-invalid on the hidden original <input>, so paint
   the visible alt field (same .pf-field) red too - keeps the advisor-request
   form's start/completion date validation legible after the flatpickr upgrade. */
.pf-field:has(input.is-invalid) input.flatpickr-input { border-color: var(--red); }
/* Input-group inputs hide their own border (`.pf-ig > input { border: none !important }`).
   Mirror the invalid state onto the `.pf-ig` wrapper so the red border still shows. */
.pf-field:has(input.is-invalid) > .pf-ig,
.pf-field:has(select.is-invalid) > .pf-ig { border-color: var(--red); box-shadow: 0 0 0 3px rgba(169,68,46,.12); }
/* Make ajax/validation feedback always render when a sibling control is invalid. */
.pf-field .invalid-feedback,
.pf-field .ajax-error { display: block; }

/* --- Choices.js inside .pf-field ------------------------------------- */
/* .pf-field styles its native inputs directly. When Choices.js wraps a
   <select> it inserts an <input type="search"> inside .choices__inner that
   would otherwise inherit the same border/padding, producing a nested
   "field inside a field" look. Paint the wrapper to match a .pf-field
   input and strip the inner search input back to plain text. */
.pf-field .choices { margin-bottom: 0; min-width: 0; }
.pf-field .choices__inner {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 5px 26px 1px 8px;
  min-height: 36px;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.35;
}
.pf-field .choices.is-focused .choices__inner,
.pf-field .choices.is-open .choices__inner {
  border-color: var(--backer);
  box-shadow: 0 0 0 3px rgba(45, 107, 102, .12);
}
.pf-field .choices__list--multiple .choices__item,
.pf-field .choices__list--multiple .choices__item.is-highlighted {
  background-color: var(--line-2);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 999px;
  padding: 3px 10px 3px 9px;
  font-size: 12px;
  font-weight: 500;
  margin: 2px 4px 2px 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.pf-field .choices__list--multiple .choices__item::before {
  content: "\f00c";
  font-family: "Font Awesome 7 Free", "Font Awesome 6 Free", "Font Awesome 5 Free";
  font-weight: 900;
  color: var(--green);
  font-size: 10px;
  line-height: 1;
}
.pf-field .choices__list--multiple .choices__item .choices__button {
  /* Force a near-black X in light mode (the chip background is light-grey, so a
     pale/white remove icon is unreadable). Explicit image, not just opacity. */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='21' height='21' viewBox='0 0 21 21'%3E%3Cg fill='%231a1a1a' fill-rule='evenodd'%3E%3Cpath d='M2.592.044l18.364 18.364-2.548 2.548L.044 2.592z'/%3E%3Cpath d='M0 18.364L18.364 0l2.548 2.548L2.548 20.912z'/%3E%3C/g%3E%3C/svg%3E");
  border-left-color: rgba(0, 0, 0, .15);
  opacity: .75;
  margin: 0 -2px 0 4px;
}
[data-bs-theme="dark"] .pf-field .choices__list--multiple .choices__item .choices__button {
  /* Dark chip -> light X. */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='21' height='21' viewBox='0 0 21 21'%3E%3Cg fill='%23e8eced' fill-rule='evenodd'%3E%3Cpath d='M2.592.044l18.364 18.364-2.548 2.548L.044 2.592z'/%3E%3Cpath d='M0 18.364L18.364 0l2.548 2.548L2.548 20.912z'/%3E%3C/g%3E%3C/svg%3E");
  border-left-color: rgba(255, 255, 255, .18);
  opacity: .65;
}
.pf-field .choices__list--multiple .choices__item .choices__button:hover { opacity: 1; }
/* Bump specificity to (0,0,2,1) so this override beats the generic
   `.pf-field input[type=search]` rule above - Choices.js renders the
   internal filter input as `<input type="search" class="choices__input">`,
   which would otherwise re-acquire the bordered field chrome. */
.pf-field input.choices__input {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 2px 0;
  margin: 0;
  min-height: 0;
  box-shadow: none;
  font-size: 13px;
  color: var(--ink);
  width: auto;
}
.pf-field input.choices__input:focus { box-shadow: none; border: 0; }
.pf-field .choices[data-type*=select-one]::after { right: 11px; }
.pf-field .choices__list--dropdown { border-color: var(--line); }

/* --- Choices.js inside .field (canonical modal form control) ----------- */
/* Match a Choices-wrapped <select> to the ~38px native .field control height
   (padding:9px 12px + 13px text); the vendor default .choices__inner is 44px,
   which would read taller than the field's sibling inputs. The global Choices
   theme already paints surface/border/8px-radius/dark-mode; this only sizes the
   control + centres the single-select value + strips the inner search input. */
.field .choices { margin-bottom: 0; min-width: 0; }
/* The select-one variant is targeted explicitly (specificity 0,0,3,0) so it beats
   the vendor's `.choices[data-type*=select-one] .choices__inner { padding-bottom }`
   (0,0,2,0) regardless of stylesheet load order - otherwise that bottom padding
   plus the value line-height inflates the control to ~45px. */
.field .choices__inner,
.field .choices[data-type*=select-one] .choices__inner {
  min-height: 38px;
  padding: 0 28px 0 11px;       /* no vertical padding - the value's line-height centres it */
  font-size: 13px;
  font-weight: 400;
  line-height: 36px;            /* fills the 38px border-box content area (38 - 2px border) */
}
.field .choices.is-focused .choices__inner,
.field .choices.is-open .choices__inner {
  border-color: var(--backer);
  box-shadow: 0 0 0 3px rgba(45, 107, 102, .12);
}
/* Single-select value sits dead-centre via the 36px line-height (no flex, which
   fights Choices' inline-block internals). */
.field .choices__list--single { padding: 0; width: 100%; }
.field .choices__list--single .choices__item { color: var(--ink); line-height: 36px; }
.field .choices[data-type*=select-one]::after { right: 12px; }
.field input.choices__input { background: transparent; border: 0; box-shadow: none; padding: 2px 0; line-height: normal; }

/* --- Input group (prefix/suffix addon) ------------------------------- */
.pf-ig {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
  transition: border-color .12s, box-shadow .12s;
}
.pf-ig:focus-within {
  border-color: var(--backer);
  box-shadow: 0 0 0 3px rgba(45,107,102,.12);
}
.pf-ig > input,
.pf-ig > select {
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  flex: 1;
  min-width: 0;
}
.pf-ig > input:focus, .pf-ig > select:focus { box-shadow: none !important; }
.pf-ig .pf-ig-addon {
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  background: var(--surface-2);
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  border-right: 1px solid var(--line-2);
  min-width: 52px;
  justify-content: center;
}
.pf-ig .pf-ig-addon.right {
  border-right: none;
  border-left: 1px solid var(--line-2);
}

/* --- Document checklist ---------------------------------------------- */
.pf-docs {
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-radius: 10px;
  padding: 16px 18px;
}
.pf-docs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px 28px;
}
.pf-doc-group .pf-doc-group-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px dashed var(--line);
}
.pf-doc-group .pf-doc-group-label .count {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  color: var(--ink-4);
  letter-spacing: 0;
  text-transform: none;
}
.pf-doc-group .pf-doc-group-label .count b { color: var(--backer); font-weight: 700; }
.pf-doc-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-size: 12.5px;
  color: var(--ink-2);
  cursor: pointer;
  user-select: none;
  margin: 0;
}
.pf-doc-row input[type=checkbox] {
  appearance: none;
  -webkit-appearance: none;
  width: 15px; height: 15px;
  border: 1.5px solid var(--line);
  border-radius: 4px;
  background-color: var(--surface);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 10px 10px;
  cursor: pointer;
  flex-shrink: 0;
  margin: 0;
  transition: background-color .12s, border-color .12s;
}
.pf-doc-row input[type=checkbox]:checked {
  background-color: var(--backer);
  border-color: var(--backer);
  /* SVG checkmark - ::after pseudo doesn't render on replaced elements like <input>, so we paint the tick as a background image instead. */
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'><path d='M2.5 6.2L4.8 8.5L9.5 3.5' stroke='white' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
}
.pf-doc-row input[type=checkbox]:checked + span { color: var(--ink); font-weight: 500; }

/* --- Map frame (Mapbox renders inside) ------------------------------ */
.pf-map {
  height: 320px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--backer-softer);
  overflow: hidden;
  position: relative;
}
/* Custom Mapbox marker - applied to a div passed to mapboxgl.Marker via { element }.
   Mapbox positions the parent via translate; we just paint the dot + pulse. */
.pf-map-pin {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--backer);
  border: 3px solid var(--surface);
  box-shadow: 0 0 0 0 rgba(45,107,102,.55);
  animation: pfPing 2.6s ease-out infinite;
  cursor: pointer;
}
@keyframes pfPing {
  0%   { box-shadow: 0 0 0 0 rgba(45,107,102,.55); }
  70%  { box-shadow: 0 0 0 16px rgba(45,107,102,0); }
  100% { box-shadow: 0 0 0 0 rgba(45,107,102,0); }
}

/* --- Geocode lookup status (Step 2) --------------------------------- */
.pf-geo-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
  white-space: nowrap;
}
.pf-geo-status .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--ink-4);
  flex-shrink: 0;
}
.pf-geo-status.ok    { color: var(--green); }
.pf-geo-status.ok    .dot { background: var(--green); }
.pf-geo-status.warn  { color: var(--amber); }
.pf-geo-status.warn  .dot { background: var(--amber); }
.pf-geo-status.error { color: var(--red); }
.pf-geo-status.error .dot { background: var(--red); }
.pf-geo-status.busy  { color: var(--ink-2); }
.pf-geo-status.busy  .dot { background: var(--amber); animation: pfSavingPulse 1s ease-in-out infinite; }

/* --- Financing structure table --------------------------------------- */
.pf-fs-table { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface); }
.pf-fs-head, .pf-fs-row {
  display: grid;
  grid-template-columns: 2fr 2fr 2fr 80px 36px;
  gap: 10px;
  align-items: center;
  padding: 10px 14px;
}
.pf-fs-head {
  background: var(--surface-2);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  border-bottom: 1px solid var(--line-2);
}
.pf-fs-head .num { text-align: right; }
.pf-fs-row { border-bottom: 1px solid var(--line-2); }
.pf-fs-row:last-of-type { border-bottom: none; }
.pf-fs-row select,
.pf-fs-row input[type=text],
.pf-fs-row input[type=number] {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-family: inherit;
  font-size: 12.5px;
  background: var(--surface);
  color: var(--ink);
  outline: none;
}
.pf-fs-row select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'><path d='M3 4.5L6 7.5L9 4.5' stroke='%236a7570' stroke-width='1.4' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 11px 11px;
  padding-right: 26px;
  -webkit-appearance: none;
  appearance: none;
}
.pf-fs-row select:focus,
.pf-fs-row input:focus {
  border-color: var(--backer);
  box-shadow: 0 0 0 3px rgba(45,107,102,.12);
}
.pf-fs-row .pf-ig { background: var(--surface); }
.pf-fs-row .pf-ig > input { padding: 7px 10px; font-size: 12.5px; }
.pf-fs-row .pf-ig .pf-ig-addon { padding: 0 9px; min-width: 44px; font-size: 11px; }
/* Higher specificity than `.pf-fs-row input[type=text]` above so the shaded
   read-only field treatment actually wins over the generic input baseline. */
.pf-fs-row input.pf-pct,
.pf-fs-row input[type=text].pf-pct {
  text-align: right;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-3);
  background: var(--surface-2);
  border: 1px dashed var(--line);
  border-radius: 6px;
  padding: 7px 8px;
  font-variant-numeric: tabular-nums;
  cursor: not-allowed;
}
.pf-fs-row input.pf-pct:focus { box-shadow: none; border-color: var(--line); }
/* Multi-party financing: club-eligible inline checkbox sitting in a .pf-field
   (the control area matches the 36px height of sibling inputs/selects). */
.pf-check-inline {
  display: flex; align-items: center; gap: 8px;
  height: 36px; font-size: 13px; color: var(--ink); font-weight: 500; cursor: pointer;
}
.pf-check-inline input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--backer); cursor: pointer; flex: none; }
/* Financing-card second row: tenor (+ conditional years/range) + syndication,
   with the stack-% pinned bottom-right. */
.pf-fs-row2 { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-top: 14px; }
.pf-fs-row2 > .pf-field { flex: 1 1 160px; min-width: 0; margin: 0; }
.pf-fs-pct { margin-left: auto; align-self: flex-end; padding-bottom: 9px; font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }
.pf-fs-pct [data-fs-pct] { font-family: var(--font-mono); color: var(--ink-2); font-weight: 500; }
.pf-fs-rm {
  width: 30px; height: 30px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--ink-4);
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  font-size: 11px;
}
.pf-fs-rm:hover { color: var(--red); background: var(--red-soft); }
.pf-fs-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--surface-2);
  border-top: 1px solid var(--line-2);
  font-size: 12px;
  color: var(--ink-3);
  gap: 16px;
  flex-wrap: wrap;
}
.pf-fs-foot .totals { display: flex; gap: 22px; font-family: var(--font-mono); }
.pf-fs-foot .totals b { color: var(--ink); font-weight: 600; }
/* Stack-total value reads in body ink (not the surrounding tertiary grey) but stays unbold. */
.pf-fs-foot .totals [data-fs-total] { color: var(--ink); }
.pf-fs-foot .totals .alloc.green { color: var(--green); }
.pf-fs-foot .totals .alloc.amber { color: var(--amber); }

.pf-add-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--ink-3);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color .12s, background .12s, color .12s;
}
.pf-add-row:hover { color: var(--backer); border-color: var(--backer-soft); background: var(--backer-softer); }

/* --- Stakeholder cards ----------------------------------------------- */
.pf-sh-count {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  font-size: 12px;
  color: var(--ink-3);
}
.pf-sh-count b { color: var(--ink); font-weight: 600; }
.pf-sh-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 12px;
  position: relative;
  transition: border-color .12s, box-shadow .12s;
}
.pf-sh-card:hover { border-color: var(--ink-4); }
/* An open dropdown overlays the cards below its own. */
.pf-sh-card:has(.choices.is-open) { z-index: 20; }
.pf-sh-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.pf-sh-num {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.pf-sh-chip {
  width: 22px; height: 22px;
  border-radius: 6px;
  background: var(--backer-soft);
  color: var(--backer);
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 700;
}
.pf-sh-rm {
  width: 28px; height: 28px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--ink-4);
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  font-size: 11px;
}
.pf-sh-rm:hover { color: var(--red); background: var(--red-soft); }

/* --- Timeline toolbar ------------------------------------------------ */
.pf-timeline-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.pf-toolbar-spacer { flex: 1; }
.pf-toolbar-hint { font-size: 11.5px; color: var(--ink-4); }
.pf-segmented {
  display: inline-flex;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}
.pf-segmented button {
  border: none;
  background: transparent;
  padding: 5px 11px;
  border-radius: 5px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-3);
  font-family: inherit;
  cursor: pointer;
}
.pf-segmented button.on {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(0,0,0,.05);
}
.pf-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--ink-2);
  cursor: pointer;
  user-select: none;
  margin: 0;
}
/* The checkbox is hidden from sight, not from the keyboard: it still takes
   focus, and the track shows the ring. */
.pf-switch { position: relative; }
.pf-switch input { position: absolute; width: 1px; height: 1px; opacity: 0; margin: 0; }
.pf-switch input:focus-visible + .track { box-shadow: 0 0 0 3px rgba(45, 107, 102, .25); }
.pf-switch .track {
  width: 30px; height: 17px;
  background: var(--line);
  border-radius: 999px;
  position: relative;
  transition: background .15s;
  flex-shrink: 0;
}
.pf-switch .track::after {
  content: '';
  position: absolute;
  left: 2px; top: 2px;
  width: 13px; height: 13px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0,0,0,.15);
  transition: left .15s;
}
.pf-switch input:checked + .track { background: var(--backer); }
.pf-switch input:checked + .track::after { left: 15px; }

/* --- Gantt frame (DHTMLX paints inside) ------------------------------ */
.pf-gantt {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
}

/* Locked milestone title (Financial Close) - visibly read-only chip-style. */
.pf-field input.fc-locked,
input.fc-locked {
  background: var(--surface-2);
  color: var(--ink-3);
  cursor: not-allowed;
  border-color: var(--line-2);
  font-style: italic;
}

/* --- Milestone colour-swatch picker (add / edit modal) -------------- */
.pf-colour-row {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
}
.pf-colour-swatch {
  display: inline-grid;
  place-items: center;
  width: 30px; height: 30px;
  border-radius: 8px;
  border: 2px solid transparent;
  background: var(--backer);
  cursor: pointer;
  padding: 0;
  transition: transform .1s, border-color .12s, box-shadow .12s;
  color: transparent;
}
.pf-colour-swatch.amber { background: var(--amber); }
.pf-colour-swatch.plum  { background: var(--plum); }
.pf-colour-swatch.green { background: var(--green); }
.pf-colour-swatch input[type=radio] {
  position: absolute;
  width: 0; height: 0;
  opacity: 0;
  pointer-events: none;
}
.pf-colour-swatch.on {
  border-color: var(--surface);
  box-shadow: 0 0 0 2px var(--backer), 0 1px 2px rgba(0,0,0,.1);
}
.pf-colour-swatch:hover { transform: translateY(-1px); }

/* --- Review summary -------------------------------------------------- */
.pf-review-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--backer-softer);
  border: 1px solid var(--backer-soft);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 22px;
}
.pf-review-banner .ico {
  width: 32px; height: 32px;
  flex-shrink: 0;
  border-radius: 8px;
  background: var(--backer-soft);
  color: var(--backer-ink);
  display: grid;
  place-items: center;
  font-size: 14px;
}
.pf-review-banner h4 { margin: 0 0 2px; font-size: 14px; color: var(--ink); font-weight: 600; }
.pf-review-banner p { margin: 0; font-size: 12.5px; color: var(--ink-2); line-height: 1.5; }
.pf-review-banner.warn { background: var(--amber-soft); border-color: var(--amber-soft); }
.pf-review-banner.warn .ico { background: var(--amber-soft); color: var(--amber); }

/* What still blocks publishing, each with a link to its step (api.project_preview). */
.pf-review-problems { margin: 6px 0 0; padding-left: 18px; font-size: 12.5px; color: var(--ink-2); line-height: 1.6; }
.pf-review-problems a { font-weight: 600; color: var(--ink); text-decoration: underline; margin-right: 4px; }

.pf-kv-list { display: grid; gap: 10px; }
.pf-kv {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 14px;
  align-items: baseline;
  font-size: 13px;
}
/* Widen the label column when the row keys are content (milestone titles in
   the review step's dated list) rather than short field names. */
.pf-kv-list.wide-k .pf-kv { grid-template-columns: 220px 1fr; }
.pf-kv .k {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.pf-kv .v { color: var(--ink); font-weight: 500; word-break: break-word; }
.pf-kv .v.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
/* --- Footer / actions ------------------------------------------------ */
.pf-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 32px;
  background: var(--surface-2);
  border-top: 1px solid var(--line);
}
.pf-foot .pf-save-status {
  flex: 1;
  text-align: center;
  font-size: 11.5px;
  color: var(--ink-3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--font-mono);
  min-height: 16px;
}
.pf-foot .pf-save-status .ok {
  width: 7px; height: 7px;
  background: var(--green);
  border-radius: 50%;
  display: inline-block;
}
.pf-foot .pf-save-status.saving .ok { background: var(--amber); animation: pfSavingPulse 1s ease-in-out infinite; }
.pf-foot .pf-save-status.error { color: var(--red); }
.pf-foot .pf-save-status.error .ok { background: var(--red); }
.pf-foot .pf-save-status.notice { color: var(--amber); }
.pf-foot .pf-save-status.notice .ok { background: var(--amber); }
@keyframes pfSavingPulse {
  0%, 100% { opacity: .4; }
  50%      { opacity: 1; }
}
.pf-foot .pf-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.btn-pf-prev,
.btn-pf-next,
.btn-pf-draft,
.btn-pf-submit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background .12s, border-color .12s, color .12s, transform .1s;
  line-height: 1.2;
}
.btn-pf-prev { background: transparent; color: var(--ink-2); border-color: var(--line); }
.btn-pf-prev:hover { background: var(--surface); color: var(--ink); border-color: var(--ink-3); }
.btn-pf-prev:disabled { opacity: .4; cursor: not-allowed; }
.btn-pf-draft { background: var(--surface); color: var(--ink-2); border-color: var(--line); }
.btn-pf-draft:hover { border-color: var(--ink-3); color: var(--ink); }
.btn-pf-next, .btn-pf-submit {
  background: var(--backer);
  color: #fff;
  box-shadow: 0 1px 0 rgba(0,0,0,.03), 0 8px 20px -12px rgba(45,107,102,.6);
}
.btn-pf-next:hover, .btn-pf-submit:hover { background: var(--backer-ink); transform: translateY(-1px); }
.btn-pf-next:disabled, .btn-pf-submit:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* --- Tab show/hide --------------------------------------------------- */
.pf-tab { display: none; }
.pf-tab.show { display: block; }


/* =====================================================================
   11. FIELD INFO POPOVER (.fi-pop)
   Click the (i) glyph to open an anchored popover next to the field.
   Replaces the previous Bootstrap modal pattern for field help.
   Shared header and footer across all variants. Footer is empty by design.
   Generic chrome - reusable on any form, not just the project wizard.
   ===================================================================== */
.fi-pop {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 500px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow:
    0 24px 56px -16px rgba(15, 22, 20, .25),
    0 6px 16px -8px rgba(15, 22, 20, .14),
    0 0 0 1px rgba(0, 0, 0, .02);
  z-index: 1050;
  opacity: 0;
  transform: translate(-50%, -50%) scale(.985);
  pointer-events: none;
  transition: opacity .16s ease, transform .18s cubic-bezier(.2, .7, .2, 1);
  overflow: hidden;
}
.fi-pop.open {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  pointer-events: auto;
}

/* Read-only field-guide gallery (admin Reference > Field guides).
   Renders every .fi-pop popover inline as a static card so an admin can read the
   live in-form help copy without triggering each one. Overrides the fixed-position,
   hidden-until-open chrome; the close button + empty footer are dropped. */
.fi-guide-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 14px;
  align-items: start;
}
.fi-guide-gallery .fi-pop {
  position: static;
  width: 100%;
  max-width: 100%;
  max-height: none;
  opacity: 1;
  transform: none;
  pointer-events: auto;
  box-shadow: none;
  transition: none;
}
.fi-guide-gallery .fi-pop-close,
.fi-guide-gallery .fi-pop-foot { display: none; }

/* Header (shared by all variants) */
.fi-pop-head {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(180deg, var(--backer-softer) 0%, var(--surface) 100%);
  border-bottom: 1px solid var(--line-2);
}
.fi-pop-head .ico {
  width: 36px; height: 36px;
  background: var(--backer);
  color: #fff;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 13px;
  box-shadow: 0 4px 10px -4px rgba(45, 107, 102, .55);
}
.fi-pop-head .titles { min-width: 0; }
.fi-pop-head .eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--backer);
  margin-bottom: 1px;
}
.fi-pop-head h4 {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 15px;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0;
  line-height: 1.25;
}

/* Close button. Always on the right edge of the header.
   Primary dismissal control alongside Esc and click-outside. */
.fi-pop-close {
  width: 26px; height: 26px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-3);
  border-radius: 6px;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 11px;
  transition: background .12s, color .12s, border-color .12s;
}
.fi-pop-close:hover {
  background: var(--surface-2);
  color: var(--ink);
  border-color: var(--ink-3);
}
.fi-pop-close:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--backer-softer);
}

/* Body. Asymmetric padding because the footer below provides bottom framing.
   Scrolls internally when content exceeds the popover's max-height. */
.fi-pop-body {
  padding: 14px 16px 12px;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
}
.fi-pop-head { flex: 0 0 auto; }
.fi-pop-foot { flex: 0 0 auto; }
.fi-pop-summary {
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-2);
  margin: 0 0 12px;
}
.fi-pop-summary b { color: var(--ink); font-weight: 600; }

/* Last-child rule lets every body shape sit cleanly above the footer */
.fi-pop-body > *:last-child { margin-bottom: 0; }

/* Variant A and B body block */
.fi-deflist {
  display: grid;
  gap: 8px;
  margin-bottom: 0;
}
.fi-def {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 10px;
  padding: 9px 10px;
  background: var(--surface-2);
  border-radius: 7px;
  border-left: 3px solid var(--backer);
  align-items: start;
  font-size: 12.5px;
}
.fi-def.amber { border-left-color: var(--amber); }
.fi-def.plum  { border-left-color: var(--plum); }
.fi-def.green { border-left-color: var(--green); }
.fi-def .term {
  font-weight: 600;
  color: var(--ink);
  font-size: 12px;
}
.fi-def .desc {
  color: var(--ink-2);
  line-height: 1.5;
}

/* Variant B chart block. Spaced from the deflist above. */
.fi-chart {
  margin-top: 12px;
  padding: 12px 12px 10px;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-radius: 8px;
}
.fi-chart-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 8px;
}
.fi-chart-row {
  display: grid;
  grid-template-columns: 70px 1fr 60px;
  align-items: center;
  gap: 10px;
  font-size: 10.5px;
  color: var(--ink-3);
  margin-bottom: 6px;
}
.fi-chart-row:last-child { margin-bottom: 0; }
.fi-chart-row .l { font-weight: 600; color: var(--ink-2); font-size: 11.5px; }
.fi-chart-row .r {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  text-align: right;
  font-size: 11px;
  color: var(--ink-3);
}
.fi-chart-row .bar {
  height: 6px;
  background: var(--surface);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}
.fi-chart-row .bar::after {
  content: '';
  position: absolute;
  left: 0; top: 0;
  height: 100%;
  width: var(--w, 30%);
  background: linear-gradient(90deg, var(--backer) 0%, var(--amber) 100%);
  border-radius: 3px;
}

/* Variant D step list */
.fi-steps {
  display: grid;
  gap: 0;
}
.fi-step {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  align-items: start;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line-2);
  font-size: 12.5px;
}
.fi-step:first-child { padding-top: 0; }
.fi-step:last-child { padding-bottom: 0; border-bottom: 0; }
.fi-step .num {
  width: 18px; height: 18px;
  background: var(--backer-softer);
  color: var(--backer);
  border-radius: 5px;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 10px;
}
.fi-step .body { color: var(--ink-2); line-height: 1.5; }
.fi-step .body b { color: var(--ink); font-weight: 600; }

/* Footer. Empty by design: a visual frame, no children. */
.fi-pop-foot {
  height: 38px;
  padding: 10px 16px;
  background: var(--surface-2);
  border-top: 1px solid var(--line-2);
}

/* Backdrop. Dims the page like a standard modal. */
.fi-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 22, 20, .45);
  z-index: 1040;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease;
}
.fi-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 760px) {
  .fi-pop { width: calc(100vw - 32px); max-width: 380px; }
}


/* =====================================================================
   12. INFORMATION-CARD INTERNALS - labels, kv rows, collapsibles
   Used by: project_detail, advisor_request_detail,
            *_shortlist, *_summary
   ===================================================================== */

/* Uppercase micro-label primitive. Replaces the per-template `cap()` /
   `kv_cell()` macros and the inline-styled label divs in detail pages. */
.cap {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 4px;
}

/* Stacked label+value row with a bottom divider. Used in the sticky
   right-rail summary cards on investor_summary / advisor_request_summary. */
.kv-row {
  padding: 14px 0;
  border-bottom: 1px solid var(--line-2);
}
.kv-row:last-child { border-bottom: 0; }

/* 2-up variant - Service+Instructed-by, Sector+Capacity, etc. */
.kv-row.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.kv-row .v {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.35;
}
.kv-row .v.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
.kv-row .v.unset { color: var(--ink-4); }
.kv-row a.v { color: var(--ink); text-decoration: none; transition: color .12s; }
.kv-row a.v:hover { color: var(--backer); text-decoration: none; }

/* Sticky right-rail card. Disabled at the lg breakpoint so it stops
   floating once the layout collapses to a single column. */
.kv-card-sticky {
  position: sticky;
  top: 18px;
}
@media (max-width: 991.98px) {
  .kv-card-sticky { position: static; }
}

/* Collapsible <details> block - chevron animation + hides the native
   marker. Replaces the duplicated #ar-summary-page / #inv-summary-page
   page-scoped chevron rules. */
.kv-collapse > summary { list-style: none; cursor: pointer; }
.kv-collapse > summary::-webkit-details-marker { display: none; }
.kv-collapse > summary.cap {
  margin-bottom: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.kv-collapse > summary .fa-chevron-right {
  transition: transform .15s ease;
}
.kv-collapse[open] > summary .fa-chevron-right {
  transform: rotate(90deg);
}


/* =====================================================================
   13. MAPBOX POPUP (.ib-map-pop-*)
   ---------------------------------------------------------------------
   Repaints the default mapbox-gl-js popup chrome to match backer.css
   surface / line / ink tokens. Markup contract (set by project-clusters.js
   and project-map.js): a `.ib-map-pop` flex column carrying a `.title`,
   optional `.sub` / `.meta` lines, and a trailing `.link` View action.
   ===================================================================== */
.mapboxgl-popup.ib-map-pop-wrap .mapboxgl-popup-content {
  background: var(--surface);
  color: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-pop);
  padding: 12px 14px 11px;
  font-family: var(--font-sans);
  font-size: 12.5px;
  line-height: 1.4;
}
.mapboxgl-popup.ib-map-pop-wrap.mapboxgl-popup-anchor-top .mapboxgl-popup-tip,
.mapboxgl-popup.ib-map-pop-wrap.mapboxgl-popup-anchor-top-left .mapboxgl-popup-tip,
.mapboxgl-popup.ib-map-pop-wrap.mapboxgl-popup-anchor-top-right .mapboxgl-popup-tip { border-bottom-color: var(--surface); }
.mapboxgl-popup.ib-map-pop-wrap.mapboxgl-popup-anchor-bottom .mapboxgl-popup-tip,
.mapboxgl-popup.ib-map-pop-wrap.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-tip,
.mapboxgl-popup.ib-map-pop-wrap.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-tip { border-top-color: var(--surface); }
.mapboxgl-popup.ib-map-pop-wrap.mapboxgl-popup-anchor-left .mapboxgl-popup-tip { border-right-color: var(--surface); }
.mapboxgl-popup.ib-map-pop-wrap.mapboxgl-popup-anchor-right .mapboxgl-popup-tip { border-left-color: var(--surface); }

.mapboxgl-popup.ib-map-pop-wrap .mapboxgl-popup-close-button {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  top: 4px; right: 4px;
  padding: 0;
  color: var(--ink-3);
  background: transparent;
  border: none;
  border-radius: 6px;
  font-size: 16px; line-height: 1;
  cursor: pointer;
  transition: background .12s, color .12s;
}
.mapboxgl-popup.ib-map-pop-wrap .mapboxgl-popup-close-button:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.ib-map-pop { display: flex; flex-direction: column; gap: 4px; padding-right: 16px; }
.ib-map-pop-title {
  font-size: 13.5px; font-weight: 600;
  color: var(--ink);
  letter-spacing: -.005em;
  line-height: 1.3;
}
.ib-map-pop-sub {
  font-size: 11.5px;
  color: var(--ink-3);
  line-height: 1.35;
  text-transform: capitalize;
}
.ib-map-pop-meta {
  font-size: 11px;
  color: var(--ink-3);
  text-transform: capitalize;
  letter-spacing: .01em;
}
.ib-map-pop-link {
  margin-top: 6px;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600;
  color: var(--backer);
  text-decoration: none;
  transition: color .12s;
}
.ib-map-pop-link i { font-size: 10px; transition: transform .15s; }
.ib-map-pop-link:hover { color: var(--backer-ink); }
.ib-map-pop-link:hover i { transform: translateX(2px); }


/* =====================================================================
   14. PAGE: HOMEPAGE
   Ported from home_revised.html. Classes renamed:
     .nav       -> .site-nav        (Section 7)
     .nav-*     -> .site-nav-*      (Section 7)
     .wrap      -> .container-backer (Section 6)
     .role-tabs -> .process-tabs    (homepage process section)
   Pill-shape buttons scoped to hero/router/final CTAs.
   ===================================================================== */

/* ---- Hero ---- */
.hero {
  padding: 48px 0 28px;
  position: relative;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 64px;
  align-items: center;
}
.hero h1 {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: clamp(44px, 5.2vw, 72px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 18px 0 22px;
  color: var(--ink);
  text-wrap: balance;
}
.hero-sub {
  font-size: 18px;
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 560px;
  margin-bottom: 28px;
}
.hero-ctas {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 34px;
}
.hero-ctas .btn { border-radius: 999px; padding: 14px 22px; font-size: 15px; }
.hero-ctas .btn-sm { padding: 10px 18px; font-size: 14px; }
.hero-ctas .hint {
  font-size: 13px;
  color: var(--ink-3);
  margin-left: 6px;
}

/* ---- Hero stats / trust row ---- */
.trust-row {
  display: flex;
  gap: 40px;
  align-items: center;
  padding-top: 24px;
  border-top: 1px solid var(--line-2);
  flex-wrap: wrap;
}
.trust-row .stat .n {
  font-family: var(--font-sans);
  font-size: 28px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.015em;
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.trust-row .stat .l {
  font-size: 12px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 4px;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .4; }
}

/* ---- Map pins (Infra-Maps preview snapshot on the homepage) ---- */
.pin {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--backer);
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 0 rgba(45,107,102,.45);
  animation: ping 2.6s ease-out infinite;
}
.pin.amber { background: var(--amber); animation-delay: .6s; }
.pin.plum  { background: var(--plum);  animation-delay: 1.2s; }
.pin.green { background: var(--green); animation-delay: .9s; }
.pin.blue  { background: var(--blue);  animation-delay: 1.8s; }
@keyframes ping {
  0%   { box-shadow: 0 0 0 0 rgba(45,107,102,.55); }
  70%  { box-shadow: 0 0 0 14px rgba(45,107,102,0); }
  100% { box-shadow: 0 0 0 0 rgba(45,107,102,0); }
}

/* ---- Audience router ---- */
.router {
  margin-top: 40px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  padding: 6px;
  display: flex;
  gap: 6px;
  box-shadow: 0 1px 0 rgba(0,0,0,.02);
  max-width: 560px;
}
.router button {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 10px 10px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background .15s, color .15s;
  font-family: inherit;
}
.router button .icon {
  /* Fixed centred box so all four FA glyphs share one footprint and line up
     vertically with the label regardless of each glyph's intrinsic metrics. */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  font-size: 15px;
  line-height: 1;
  flex-shrink: 0;
  opacity: .7;
}
.router button.active {
  background: var(--ink);
  color: var(--surface);
}
.router button.active .icon { opacity: 1; }
.router button:not(.active):hover {
  background: var(--backer-softer);
  color: var(--ink);
}

.router-panel {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  padding: 28px 30px;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 40px;
  align-items: center;
}
.router-panel h3 {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 28px;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
}
.router-panel p {
  color: var(--ink-2);
  margin: 0 0 18px;
  line-height: 1.55;
  font-size: 15px;
}
.router-panel .bullets {
  list-style: none;
  padding: 0;
  margin: 0 0 22px;
  display: grid;
  gap: 10px;
}
.router-panel .bullets li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 14px;
  color: var(--ink-2);
}
.router-panel .bullets .tick {
  color: var(--backer);
  margin-top: 2px;
  font-weight: 700;
}
.router-panel .actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.router-panel .btn { border-radius: 999px; }

.router-visual {
  background: var(--backer-softer);
  border-radius: 14px;
  padding: 22px;
  min-height: 280px;
  border: 1px solid var(--line-2);
  position: relative;
}

.mini-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: 0 1px 0 rgba(0,0,0,.01);
}
.mini-card h6 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.mini-card .row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 4px;
}
.mini-card .bar {
  height: 6px;
  background: var(--line-2);
  border-radius: 999px;
  margin-top: 10px;
  overflow: hidden;
}
.mini-card .bar i {
  display: block;
  height: 100%;
  background: var(--backer);
  border-radius: 999px;
}
.mini-card .tag-row {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.tag {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
}
.tag.green { background: var(--green-soft); color: var(--green); }
.tag.teal  { background: var(--backer-soft); color: var(--backer-ink); }
.tag.amber { background: var(--amber-soft); color: var(--amber); }
.tag.plum  { background: var(--plum-soft);  color: var(--plum); }

/* ---- Section head / eyebrow-driven section intro ---- */
.section-head {
  margin-bottom: 56px;
  max-width: 760px;
}
.section-head .eyebrow { margin-bottom: 16px; }
.section-head h2 {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: clamp(32px, 3.2vw, 44px);
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0 0 14px;
  color: var(--ink);
  text-wrap: balance;
}
.section-head p {
  color: var(--ink-2);
  font-size: 17px;
  line-height: 1.55;
  margin: 0;
}

/* ---- Pillars ---- */
.pillar {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 72px;
  align-items: center;
  padding: 48px 0;
  border-top: 1px solid var(--line-2);
}
.pillar:first-of-type {
  border-top: none;
  padding-top: 0;
}
.pillar.reverse .pillar-copy { order: 2; }

.pillar-copy .pillar-num {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 14px;
  color: var(--backer);
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.pillar-copy h3 {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 36px;
  letter-spacing: -0.02em;
  line-height: 1.08;
  margin: 0 0 14px;
}
/* Green hyphen in the Infra-Pipeline / -Analytics / -Maps pillar headings. */
.pillar-copy h3 span { color: var(--backer); }
.pillar-copy .lede {
  font-size: 16px;
  color: var(--ink-2);
  line-height: 1.6;
  margin: 0 0 22px;
}
.pillar-copy .feat { display: grid; gap: 12px; }
.pillar-copy .feat .f {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 14px;
  align-items: flex-start;
  padding: 12px 0;
  border-top: 1px dashed var(--line);
}
.pillar-copy .feat .f:first-child {
  border-top: none;
  padding-top: 0;
}
.pillar-copy .feat .f .k {
  font-size: 12px;
  color: var(--backer);
  font-weight: 700;
  letter-spacing: 0.06em;
  margin-top: 3px;
}
.pillar-copy .feat .f .v {
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.55;
}

.pillar-visual {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 22px;
  min-height: 380px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 30px 60px -40px rgba(29,71,68,.22);
}
.pv-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  font-size: 12px;
  color: var(--ink-3);
}
.pv-dots {
  display: flex;
  gap: 5px;
}
.pv-dots span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--line);
}
.pv-dots span:first-child  { background: #e5a0a0; }
.pv-dots span:nth-child(2) { background: #e3cf91; }
.pv-dots span:nth-child(3) { background: #9ec9a1; }

/* Pillar 1 - project rows */
.project-row {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 10px;
  background: var(--surface);
}
.project-row .thumb {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--green-soft);
  display: grid;
  place-items: center;
  color: var(--green);
  font-size: 16px;
}
.project-row .t {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.project-row .m {
  font-size: 11px;
  color: var(--ink-3);
  margin-top: 2px;
  display: flex;
  gap: 8px;
}
.project-row .val {
  text-align: right;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 18px;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.project-row .val small {
  display: block;
  font-family: var(--font-sans);
  font-size: 10px;
  color: var(--ink-3);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Pillar 2 - chart */
.chart-grid {
  position: relative;
  height: 260px;
  margin-top: 18px;
}
.chart-grid svg { width: 100%; height: 100%; }
.chart-legend {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 14px;
}
.chart-legend .k {
  display: flex;
  align-items: center;
  gap: 6px;
}
.chart-legend .sw {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

/* Pillar 3 - map snapshot */
.map-snap {
  height: 260px;
  background: var(--backer-softer);
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line-2);
}
.map-snap-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* Pins are positioned by inline left/top %; translate centres the dot on the point. */
.map-snap .pin {
  transform: translate(-50%, -50%);
  z-index: 1;
}

/* ---- Process (homepage variant) - renamed from .role-tabs ---- */
.process-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--line-2);
  flex-wrap: wrap;
}
.process-tabs button {
  background: transparent;
  border: none;
  padding: 14px 4px;
  margin-right: 36px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-3);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  letter-spacing: -0.005em;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: inherit;
}
.process-tabs button .r-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink-3);
  opacity: .4;
}
.process-tabs button.active {
  color: var(--ink);
  border-bottom-color: var(--backer);
}
.process-tabs button.active .r-dot {
  background: var(--backer);
  opacity: 1;
}
.process-tabs button:hover:not(.active) { color: var(--ink-2); }
.process-tabs .r-aux {
  margin-left: auto;
  font-size: 12px;
  color: var(--ink-3);
  align-self: center;
  padding-bottom: 10px;
}

.role-pane { display: none; }
.role-pane.active {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 72px;
  animation: fadeIn .25s ease;
}

.role-intro {
  font-size: 13px;
  color: var(--ink-2);
  margin: -4px 0 18px;
  line-height: 1.55;
  padding: 14px 16px;
  background: var(--backer-softer);
  border-left: 2px solid var(--backer);
  border-radius: 0 8px 8px 0;
}
.role-intro strong {
  color: var(--ink);
  font-weight: 600;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: none; }
}

/* ---- Coverage ---- */
.coverage-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.coverage-tabs button {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
  font-family: inherit;
}
.coverage-tabs button.active {
  background: var(--ink);
  color: var(--surface);
  border-color: var(--ink);
}

.coverage-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.cov-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px;
  position: relative;
  transition: transform .2s, box-shadow .2s;
}
.cov-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 40px -30px rgba(29,71,68,.3);
}
.cov-card .label {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 10px;
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
}
.cov-card h5 {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 22px;
  margin: 0 0 10px;
  letter-spacing: -0.015em;
}
.cov-card p {
  margin: 0;
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.5;
}
.lbl-green { background: var(--green-soft);  color: var(--green); }
.lbl-teal  { background: var(--backer-soft); color: var(--backer-ink); }
.lbl-amber { background: var(--amber-soft);  color: var(--amber); }
.lbl-red   { background: var(--red-soft);    color: var(--red); }

/* ---- Final CTA ---- */
.final {
  padding: 80px 0 40px;
}
.final-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}
.final-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 36px 32px;
  transition: transform .2s, box-shadow .2s;
}
.final-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 30px 60px -40px rgba(29,71,68,.3);
}
.final-card h3 {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 26px;
  margin: 12px 0 10px;
  letter-spacing: -0.015em;
}
.final-card p {
  color: var(--ink-2);
  margin: 0 0 22px;
  line-height: 1.55;
  font-size: 15px;
}
.final-card .btn { border-radius: 999px; }


/* =====================================================================
   14B. HOMEPAGE REWORK ADDITIONS
   New vocabulary for the reworked homepage (centred hero, static audience
   router, coming-soon pillar visuals, 3-phase How-it-works, 3-card pricing).
   Folded in from references/mocks/home-rework.css. Token-driven so dark
   mode holds. .cs-badge + @keyframes pulse/csPulse already exist above /
   in section 24C and are reused, not redefined.
   ===================================================================== */

/* ---- Hero: pre-launch fallback state ---- */
.trust-fallback {
  border-top: 1px solid var(--line-2);
  padding-top: 24px;
}

/* ---- Hero centred (single column, no right-hand panel) ---- */
.hero-grid.hero-centered {
  grid-template-columns: 1fr;
  justify-items: center;
  text-align: center;
}
.hero-grid.hero-centered > div { max-width: 760px; }
.hero-grid.hero-centered .hero-sub { margin-left: auto; margin-right: auto; }
.hero-grid.hero-centered .hero-ctas { justify-content: center; }
.hero-grid.hero-centered .trust-row { justify-content: center; }
.hero-grid.hero-centered .trust-fallback { text-align: center; }

/* Audience router strip centred under the hero */
.router { margin-left: auto; margin-right: auto; }

/* Mint highlight swash + teal italic on emphasised words in headings.
   Applied via class="swash" on the <em> (hero h1 / section-head h2), so a new
   emphasised word just gets the class - no per-section selector list to keep in
   sync. */
.swash {
  position: relative;
  white-space: nowrap;
  font-style: italic;
  color: var(--backer);
  font-weight: 500;
  background-image: linear-gradient(transparent 62%, rgba(127,202,179,.5) 62%, rgba(127,202,179,.5) 94%, transparent 94%);
  background-repeat: no-repeat;
  background-size: 100% 100%;
}

/* Centred section intros (matches the centred hero) */
#platform .section-head,
#coverage .section-head,
#process .section-head,
.pricing-cards .section-head {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

/* Centred coverage pill tabs */
#covTabs { justify-content: center; }

/* ---- "Coming soon" vocabulary ---- */
.soon-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--backer-ink);
  background: var(--backer-soft);
  border: 1px dashed color-mix(in srgb, var(--backer) 45%, transparent);
  padding: 3px 9px;
  border-radius: 999px;
}
.soon-pill .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--backer);
  animation: csPulse 2.2s ease-out infinite;
}
/* Tiny variant for .tag rows inside mini-cards / steps */
.tag.soon {
  background: transparent;
  color: var(--backer-ink);
  border: 1px dashed color-mix(in srgb, var(--backer) 45%, transparent);
}
/* "Beta": live but not finished (Infra-Maps) - the same pill, solid border.
   Small tag-row badges use the existing .tag.teal. */
.soon-pill.beta { border-style: solid; }

/* ---- Pillar 2 visual: intelligence-layer inputs diagram ---- */
.intel-flow { display: grid; gap: 14px; margin-top: 6px; }
.intel-srcs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.intel-src {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
}
.intel-src i {
  width: 26px; height: 26px;
  border-radius: 7px;
  display: grid; place-items: center;
  background: var(--backer-soft);
  color: var(--backer-ink);
  font-size: 11px;
  flex-shrink: 0;
}
.intel-src small {
  display: block;
  font-size: 10.5px;
  font-weight: 400;
  color: var(--ink-3);
  margin-top: 1px;
}
.intel-join {
  display: flex;
  justify-content: center;
  color: var(--ink-3);
  font-size: 12px;
  line-height: 1;
}
.intel-core {
  border: 1px solid color-mix(in srgb, var(--backer) 30%, transparent);
  border-radius: 12px;
  background: var(--backer-softer);
  padding: 18px 20px;
  text-align: center;
  position: relative;
}
.intel-core .t {
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
  margin-top: 10px;
}
.intel-core .d {
  font-size: 12px;
  color: var(--ink-2);
  margin-top: 3px;
  line-height: 1.5;
}
.intel-outs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}
.intel-outs .chip {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-2);
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  padding: 5px 11px;
}

/* ---- Pillar 3 visual: empty-of-data map ---- */
/* ---- Audience router: four static panes (no innerHTML swapping) ---- */
.router-panel[hidden] { display: none; }
.router-panel .panel-badge { margin-bottom: 12px; }
.router-panel .actions { align-items: center; }

/* ---- Process tabs: role panes hidden attr fallback ---- */
.role-pane[hidden] { display: none; }

/* ---- Final CTA: quiet closing line ---- */
.final-foot {
  text-align: center;
  margin-top: 28px;
  font-size: 13px;
  color: var(--ink-3);
}
.final-foot a { color: var(--backer); font-weight: 600; text-decoration: none; }
.final-foot a:hover { text-decoration: underline; }

/* ---- HOW IT WORKS: three-phase layout (replaces per-step hover panes) ----
   The role tabs still switch panes; each pane is now a 3-column phase grid.
   No step-visual column, so the active pane is block, not grid. */
#process .role-pane.active { display: block; }
#process .process-tabs { justify-content: center; }
#process .role-intro { margin: 0 auto 22px; max-width: 760px; text-align: center; }

.hiwC-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  /* Shared row tracks (subgrid below) so kicker / h3 / lede line up across the
     three cards - every card's first step then starts on the same line. The
     4th row (steps, or .hiwC-body: steps + the "Tracked on-platform" footer)
     is a flexible filler so all cards match the tallest card's height. */
  grid-template-rows: auto auto auto 1fr;
  column-gap: 20px;
  row-gap: 0;
}
.hiwC-phase {
  display: grid;
  grid-template-rows: subgrid;
  grid-row: span 4;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 26px 24px;
  position: relative;
}
/* "Coming soon" tag pinned to the top-right corner of the phase card */
.hiwC-soon {
  position: absolute;
  top: 16px;
  right: 16px;
}
.hiwC-kicker {
  font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
  font-weight: 700; color: var(--backer-ink); margin-bottom: 8px;
}
.hiwC-phase h3 { margin: 0 0 6px; font-size: 20px; font-weight: 600; letter-spacing: -0.015em; }
.hiwC-lede { margin: 0 0 20px; font-size: 13.5px; line-height: 1.5; color: var(--ink-2); max-width: 30ch; }
/* align-content:start keeps the steps packed at the top when the card is taller
   than its own content (it's stretched to match the tallest card), rather than
   distributing the slack between steps. */
.hiwC-steps { display: grid; gap: 16px; align-content: start; }
.hiwC-step { display: grid; grid-template-columns: 26px 1fr; gap: 12px; align-items: start; }
.hiwC-step .n {
  width: 26px; height: 26px; border-radius: 50%;
  border: 1.5px solid var(--backer); color: var(--backer);
  display: grid; place-items: center; font-size: 12px; font-weight: 600;
  margin-top: 1px; flex-shrink: 0; background: var(--surface);
}
.hiwC-step .t { font-size: 14px; font-weight: 600; color: var(--ink); line-height: 1.3; letter-spacing: -0.005em; }
.hiwC-step .t .tag.soon { vertical-align: middle; margin-left: 6px; }
.hiwC-step .s { font-size: 12.5px; color: var(--ink-3); margin-top: 4px; line-height: 1.5; }
.hiwC-step .s em { font-style: italic; color: var(--ink-2); }
/* A card with a footer: steps, then the footer pinned to the card bottom.
   The footer is in flow, so a long one grows the row rather than overlapping
   the steps; the gap is the least space between them. */
.hiwC-body { display: flex; flex-direction: column; gap: 16px; }
/* Lifecycle tracking note inside the Handover phase (progress/record-keeping,
   not deal management - the negotiation genuinely happens off-platform). */
.hiwC-track {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-2);
}
.hiwC-track-tag {
  display: block;
  width: fit-content;
  margin-bottom: 8px;
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--backer-ink);
  background: var(--backer-soft);
  padding: 3px 8px;
  border-radius: 999px;
}
.hiwC-track b { color: var(--ink); font-weight: 600; }

/* ---- PRICING: three model cards (Infra-Backer first), token-driven ---- */
.pricing-cards {
  padding: 40px 0;
}
.pricing-cards .section-head { margin-bottom: 36px; }
.p3-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; align-items: stretch; }
.p3-card {
  border: 1px solid var(--line); border-radius: 16px; background: var(--surface);
  padding: 26px 24px; display: flex; flex-direction: column;
}
.p3-card.feature {
  border-color: var(--backer); background: var(--backer-softer);
}
.p3-name { font-size: 14px; font-weight: 700; letter-spacing: 0.01em; color: var(--ink); margin-bottom: 4px; }
.p3-card.feature .p3-name { color: var(--backer-ink); }
.p3-sub { font-size: 12.5px; color: var(--ink-3); margin-bottom: 20px; }
.p3-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 13px; }
.p3-list li { display: grid; grid-template-columns: 16px 1fr; gap: 10px; font-size: 13.5px; color: var(--ink-2); line-height: 1.45; align-items: start; }
.p3-list li .ico { margin-top: 1px; font-size: 13px; line-height: 1.1; color: var(--ink-4); text-align: center; }
.p3-list li .ico.ok { color: var(--backer); font-weight: 700; }
.p3-list li .ico.no { color: var(--ink-4); }
.p3-list li .ico.neu { color: var(--ink-4); font-weight: 700; }
.p3-card.feature .p3-list li { color: var(--ink); }
.p3-card.feature .p3-list li .ico { color: var(--backer); }
.p3-list li b { font-weight: 600; color: var(--ink); }
.p3-foot { margin-top: 20px; padding-top: 16px; border-top: 1px dashed var(--line); font-size: 12px; color: var(--ink-3); line-height: 1.45; }
.pricing-cards .price-foot { font-size: 12px; color: var(--ink-3); line-height: 1.5; max-width: 640px; margin: 18px auto 0; text-align: center; }

/* ---- Accessibility ---- */
.router button:focus-visible,
.process-tabs button:focus-visible,
.coverage-tabs button:focus-visible {
  outline: 2px solid var(--backer);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .pulse, .pin, .soon-pill .dot, .cs-badge .dot { animation: none !important; }
  .role-pane.active { animation: none !important; }
  .cov-card, .final-card, .btn { transition: none !important; }
}

/* ---- Small screens ---- */
@media (max-width: 980px) {
  .intel-srcs { grid-template-columns: 1fr; }
  .router { max-width: none; }
  /* Single column: drop the subgrid so each card flows normally. */
  .hiwC-grid { grid-template-columns: 1fr; grid-template-rows: none; row-gap: 20px; }
  .hiwC-phase { display: block; grid-row: auto; }
  .p3-cards { grid-template-columns: 1fr; }
}

/* Small screens: the four role tabs (Developer / Investor / Advisor /
   Researcher) can't fit on one row much below the router's 560px max-width -
   the single-row layout overflows before the old 480px breakpoint, so stack
   into a 2x2 grid at the sm breakpoint instead. minmax(0,1fr) lets each cell
   shrink with the viewport rather than being forced wide by its label. */
@media (max-width: 576px) {
  .router {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }
  .process-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2px 12px;
  }
  .process-tabs button { margin-right: 0; justify-content: center; }
}


/* =====================================================================
   15. PAGE: PROFILE
   Ported from dashboard_profile.html. Profile hero, ident, stats, grid.
   ===================================================================== */
.profile-hero {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  padding: 4px 0 22px;
  flex-wrap: wrap;
}
.profile-avatar {
  width: 88px;
  height: 88px;
  border-radius: 18px;
  background: linear-gradient(140deg, var(--backer) 0%, #4ea49c 100%);
  color: #fff;
  display: grid;
  place-items: center;
  font-family: var(--font-sans);
  font-size: 32px;
  font-weight: 500;
  letter-spacing: -0.02em;
  box-shadow: 0 20px 40px -20px rgba(29,71,68,.4);
  position: relative;
  flex-shrink: 0;
}
.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}
.about-body-empty { color: var(--ink-3); }

/* Live mandate-match preview chip - clickable callout on the org profile About
   card + the settings org card. Count comes from matching_service over the
   Browse-visible set; links to "Create a saved search from my mandate". */
.mandate-match {
  display: flex; align-items: center; gap: 10px;
  margin-top: 16px; padding: 11px 14px;
  border: 1px solid var(--backer-soft); border-radius: 10px;
  background: var(--backer-softer);
  color: var(--ink); font-size: 13px; text-decoration: none;
  transition: background .12s, border-color .12s;
}
.mandate-match:hover { background: var(--backer-soft); border-color: var(--backer); }
.mandate-match .ico {
  width: 26px; height: 26px; border-radius: 7px;
  display: grid; place-items: center; flex-shrink: 0;
  background: var(--backer-soft); color: var(--backer-ink); font-size: 12px;
}
.mandate-match b { font-weight: 600; }
.mandate-match .go { margin-left: auto; color: var(--backer-ink); font-size: 11px; transition: transform .12s; }
.mandate-match:hover .go { transform: translateX(2px); }

.profile-avatar .verified {
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  border: 3px solid var(--bg);
  display: grid;
  place-items: center;
  font-size: 10px;
}

.profile-ident {
  flex: 1;
  min-width: 260px;
}
.profile-ident h1 {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: clamp(24px, 2.2vw, 30px);
  line-height: 1.1;
  letter-spacing: -0.015em;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.profile-ident h1 .role-badge {
  font-size: 10.5px;
  padding: 3px 10px;
}

.profile-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  font-size: 13px;
  color: var(--ink-2);
  margin-top: 10px;
}
.profile-meta .m {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.profile-meta .m .ico {
  color: var(--ink-4);
  font-size: 12px;
  width: 14px;
  display: grid;
  place-items: center;
}
.profile-meta a:hover { color: var(--backer); }
.profile-meta .sep { color: var(--line); }

.profile-stats {
  display: flex;
  gap: 36px;
  padding: 10px 0 0;
  border-top: 1px solid var(--line-2);
  margin-top: 14px;
}
.profile-stats .stat { display: grid; gap: 2px; }
.profile-stats .stat .n {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 22px;
  color: var(--ink);
  letter-spacing: -0.015em;
  line-height: 1.1;
}
.profile-stats .stat .l {
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 500;
}
.profile-stats .stat .l small {
  display: block;
  margin-top: 2px;
  text-transform: none;
  letter-spacing: 0;
  font-size: 11px;
  font-weight: 400;
  color: var(--ink-4);
}

.profile-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 22px;
}
.profile-grid.single { grid-template-columns: 1fr; }

/* Collapse to single column before the sidebar hides (at 900px).
   Between 900–1200px the expanded sidebar squeezes the right-column Team
   card below the .dtable min-width, causing horizontal overflow. */
@media (max-width: 1200px) {
  .profile-grid { grid-template-columns: 1fr; }
}

.about-body {
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.65;
  white-space: pre-line;
}


/* =====================================================================
   16. PAGE: ENGAGEMENT MANAGER (.em-*)
   Page-scoped styles for /pipeline/engagements: hero focus + pulse cards,
   list-view table, list/timeline view toggle, swimlane timeline view, and
   the slide-over detail drawer.
   ===================================================================== */

/* ---- Hero: focus tray + pulse strip ---- */
.em-hero {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 18px;
  margin-bottom: 28px;
  align-items: start;
}
.em-hero.solo { grid-template-columns: 1fr; }

.focus-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px 22px 18px;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}
.focus-card::before {
  content: ''; position: absolute; inset: 0 auto 0 0; width: 3px;
  background: linear-gradient(180deg, var(--amber) 0%, var(--backer) 100%);
}
.focus-card .fc-head {
  display: flex; align-items: center; gap: 10px; margin-bottom: 4px;
}
.focus-card .fc-head .eye {
  font-size: 10.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-3);
}
.focus-card .fc-head .num {
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  background: var(--amber-soft); color: var(--amber);
  padding: 2px 8px; border-radius: 999px;
}
.focus-card h2 {
  margin: 6px 0 14px;
  font-family: var(--font-sans); font-weight: 500;
  font-size: 22px; letter-spacing: -0.02em; line-height: 1.15;
  color: var(--ink);
  text-wrap: pretty;
}
.focus-card .fc-list { display: grid; gap: 10px; }
.focus-card .fc-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 12px;
  align-items: start;
  padding: 12px 0;
  border-top: 1px dashed var(--line-2);
  text-decoration: none; color: inherit;
}
.focus-card .fc-row:first-child { border-top: none; padding-top: 4px; }
.focus-card .fc-row:hover .what .act { color: var(--backer); }
.focus-card .fc-row .glyph {
  width: 28px; height: 28px; border-radius: 7px;
  display: grid; place-items: center; font-size: 12px;
  margin-top: 1px;
}
.focus-card .fc-row .glyph.amber { background: var(--amber-soft); color: var(--amber); }
.focus-card .fc-row .glyph.teal  { background: var(--backer-soft); color: var(--backer-ink); }
.focus-card .fc-row .glyph.red   { background: var(--red-soft); color: var(--red); }
.focus-card .fc-row .what {
  display: grid; gap: 3px; min-width: 0;
}
.focus-card .fc-row .what .proj {
  font-size: 10.5px; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; color: var(--ink-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.focus-card .fc-row .what .act {
  font-size: 13.5px; color: var(--ink); font-weight: 500;
  line-height: 1.35;
}
.focus-card .fc-row .what .sub {
  font-size: 11.5px; color: var(--ink-3); font-weight: 400;
  line-height: 1.4;
}
.focus-card .fc-row .when {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--ink-3); white-space: nowrap;
  padding-top: 14px;
}
.focus-card .fc-row .when.urgent { color: var(--red); font-weight: 600; }
.focus-card .fc-empty {
  padding: 22px 0 4px; text-align: center;
  color: var(--ink-3); font-size: 13px;
}

/* Pulse: compact KPI panel - same visual vocabulary as FocusCard */
.pulse-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px 24px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  position: relative;
}
.pulse-card .pc-head {
  display: flex; align-items: center; gap: 10px; margin-bottom: 4px;
}
.pulse-card .pc-head .eye {
  font-size: 10.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-3);
}
.pulse-card .pc-head .delta {
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  color: var(--green);
}
.pulse-card .pc-headline {
  margin: 6px 0 16px;
  font-family: var(--font-sans); font-weight: 500;
  font-size: 30px; letter-spacing: -0.02em; line-height: 1.05;
  color: var(--ink);
  display: flex; align-items: baseline; gap: 8px;
  flex-wrap: wrap;
}
.pulse-card .pc-headline .ccy {
  font-family: var(--font-mono); font-size: 12px;
  color: var(--ink-3); font-weight: 500;
  letter-spacing: 0.02em;
}
.pulse-card .pc-headline .sub {
  font-family: var(--font-sans); font-size: 13px; font-weight: 400;
  color: var(--ink-3); letter-spacing: 0;
}
.pulse-grid {
  display: grid;
  gap: 0;
}
.pulse-stat {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px dashed var(--line-2);
}
.pulse-stat:first-child { border-top: none; padding-top: 4px; }
.pulse-stat .l {
  font-size: 13px; color: var(--ink); font-weight: 500;
  line-height: 1.35;
  display: grid;
}
.pulse-stat .l span {
  font-size: 11.5px; color: var(--ink-3); font-weight: 400; margin-top: 2px;
}
.pulse-stat .v {
  font-family: var(--font-mono); font-size: 13px;
  color: var(--ink-2); font-weight: 500;
  white-space: nowrap;
}
.pulse-foot {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--ink-3);
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line-2);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.pulse-foot b { color: var(--ink-2); font-weight: 500; }
.pulse-foot .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--ink-4); }

/* ---- Page view toggle (sits in page-actions slot) ---- */
.em-view-toggle {
  display: inline-flex; background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 8px; padding: 3px; gap: 2px;
}
.em-view-toggle a, .em-view-toggle button {
  border: none; background: transparent; font-family: inherit;
  padding: 5px 10px; border-radius: 6px; font-size: 12px; font-weight: 600;
  color: var(--ink-3); cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  text-decoration: none;
}
.em-view-toggle .on {
  background: var(--surface); color: var(--ink);
  box-shadow: 0 1px 2px rgba(0,0,0,.05);
}

/* ---- Section header ---- */
.em-section { margin-top: 36px; }
.em-section + .em-section { margin-top: 32px; }
.em-section-head {
  display: flex; align-items: center; gap: 12px; margin-bottom: 10px;
}
.em-section-head h3 {
  margin: 0; font-size: 14px; font-weight: 600; color: var(--ink);
  letter-spacing: -0.005em;
  display: inline-flex; align-items: center; gap: 10px;
}
.em-section-head h3 .count {
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  color: var(--ink-3); background: var(--surface-2);
  padding: 2px 7px; border-radius: 4px;
}
.em-section-head .sub {
  font-size: 12.5px; color: var(--ink-3);
}
.em-section-head .right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

/* Timeline-view section heads ("Projects timeline" / "Service requests timeline"):
   indent so the h3 aligns with the first column heading ("Project" / "Service
   request") inside .em-tl-head .lbl (padding: 11px 18px). */
.em-section-head:has(+ .em-timeline) { padding-left: 18px; }

/* Major section header - for top-level Projects / Service requests groups */
.em-section + .em-section-projects,
.em-section + .em-section-requests { margin-top: 44px; }

.em-section-head--major {
  align-items: flex-start;
  padding-bottom: 14px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
  gap: 14px;
}
.em-section-head--major .em-section-title {
  flex: 1; min-width: 0;
}
.em-section-head--major h3 {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.015em;
}
.em-section-head--major .sub {
  display: block;
  margin-top: 4px;
}
.em-section-kind {
  width: 36px; height: 36px;
  border-radius: 9px;
  display: grid; place-items: center;
  font-size: 15px;
  flex-shrink: 0;
  margin-top: 2px;
}
.em-section-kind--project {
  background: var(--backer-soft);
  color: var(--backer-ink);
}
.em-section-kind--request {
  background: var(--amber-soft);
  color: var(--amber);
}

/* Sub-section header (e.g. "Closed projects") */
.em-section-sub { margin-top: 28px; }
/* Indent the heading by the same amount as the table's first-column padding
   (.em-table thead th:first-child { padding-left: 22px }) so "Closed
   projects" / "Closed requests" line up with the Project column header
   below. */
.em-section-sub h4 {
  font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 10px;
  padding-left: 22px;
  display: flex; align-items: center; gap: 8px;
}
.em-section-sub h4 span {
  font-family: var(--font-mono); font-size: 10px; font-weight: 500;
  color: var(--ink-4); background: var(--surface-2);
  padding: 1px 6px; border-radius: 4px;
}

/* ---- List view: redesigned engagement table ---- */
.em-table {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  box-shadow: var(--shadow-card);
}
.em-table table { width: 100%; border-collapse: collapse; font-size: 13px; }
.em-table thead th {
  text-align: left;
  font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-3); padding: 12px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line-2);
  white-space: nowrap;
}
.em-table thead th:first-child { padding-left: 22px; }
.em-table thead th:last-child  { padding-right: 22px; }
.em-table thead th.num, .em-table tbody td.num { text-align: right; }
.em-table thead th.sortable {
  cursor: pointer; user-select: none;
}
.em-table thead th.sortable:hover { color: var(--ink); }
.em-table thead th.sortable .so {
  margin-left: 6px; font-size: 9px; opacity: .5;
  display: inline-block; transition: opacity .12s, color .12s;
}
.em-table thead th.sortable:hover .so { opacity: 1; }
.em-table thead th.sorted { color: var(--backer); }
.em-table thead th.sorted .so { opacity: 1; color: var(--backer); }
/* list.js click-sort headers (`<th class="sort" data-sort="...">`). list.js
   adds `.asc` / `.desc` to the active header on click; we paint a small
   indicator via ::after so the markup stays clean. */
.em-table thead th.sort { cursor: pointer; user-select: none; }
.em-table thead th.sort:hover { color: var(--ink); }
.em-table thead th.sort::after {
  content: '\2195'; /* up-down arrow */
  margin-left: 6px;
  font-size: 9px;
  opacity: .35;
  transition: opacity .12s, color .12s;
}
.em-table thead th.sort:hover::after { opacity: .8; }
.em-table thead th.sort.asc,
.em-table thead th.sort.desc { color: var(--backer); }
.em-table thead th.sort.asc::after  { content: '\2191'; opacity: 1; color: var(--backer); }
.em-table thead th.sort.desc::after { content: '\2193'; opacity: 1; color: var(--backer); }
.em-table-foot {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 22px;
  border-top: 1px solid var(--line-2);
  background: var(--surface);
}
.em-table-foot .count {
  font-size: 12px; color: var(--ink-3);
}
.em-table-foot .pg-spacer { flex: 1; }
.em-table-foot .pg-nav {
  display: inline-flex; align-items: center; gap: 4px;
}
.em-table-foot .pg-nav button {
  background: var(--surface); border: 1px solid var(--line);
  width: 26px; height: 26px; min-width: 26px; border-radius: 6px;
  display: grid; place-items: center;
  padding: 0; margin: 0;
  cursor: pointer; color: var(--ink-2);
  font-size: 10px; font-family: var(--font-mono); font-weight: 600; line-height: 1;
  transition: border-color .12s, color .12s, background .12s;
}
.em-table-foot .pg-nav button:not(:disabled):hover {
  background: var(--surface-2); color: var(--ink);
}
.em-table-foot .pg-nav button:disabled {
  opacity: .4; cursor: not-allowed;
}
.em-table-foot .pg-nav .pg-list {
  display: inline-flex; align-items: center; gap: 2px;
}
.em-table-foot .pg-nav .pg-num.on,
.em-table-foot .pg-nav .pg-num.on:hover {
  background: var(--backer-soft); color: var(--backer);
  border-color: transparent;
}
.em-table-foot .pg-nav .pg-ellipsis {
  width: 16px; text-align: center;
  color: var(--ink-4); font-family: var(--font-mono); font-size: 12px;
}
.em-table tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-2);
  color: var(--ink-2);
  vertical-align: middle;
}
.em-table tbody td:first-child { padding-left: 22px; }
.em-table tbody td:last-child  { padding-right: 22px; }
.em-table tbody tr:last-child td { border-bottom: none; }
.em-table tbody tr { transition: background .1s; cursor: pointer; }
.em-table tbody tr:hover { background: var(--backer-softer); }
.em-table tbody tr.needs-action {
  background: linear-gradient(90deg, rgba(217,178,98,0.08) 0%, transparent 30%);
}
.em-table tbody tr.needs-action:hover {
  background: var(--backer-softer);
}

/* Project cell with sector glyph */
.em-pcell { display: flex; align-items: center; gap: 12px; min-width: 0; }
.em-pcell .glyph {
  width: 34px; height: 34px; border-radius: 9px;
  display: grid; place-items: center;
  font-size: 13px; flex-shrink: 0;
  position: relative;
}
/* Sector tints - match the .sector-ico palette already used elsewhere. */
.em-pcell .glyph.economic { background: var(--amber-soft); color: var(--amber); }
.em-pcell .glyph.energy   { background: var(--green-soft); color: var(--green); }
.em-pcell .glyph.digital  { background: var(--plum-soft);  color: var(--plum); }
.em-pcell .glyph.social   { background: var(--blue-soft);  color: var(--blue); }
.em-pcell .ptext { display: grid; line-height: 1.3; min-width: 0; }
.em-pcell .ptext .pname {
  font-size: 13px; font-weight: 600; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px;
  text-decoration: none;
}
.em-pcell .ptext .pname:hover { color: var(--backer); }
.em-pcell .ptext .psub {
  font-size: 11.5px; color: var(--ink-3);
  display: flex; align-items: center; gap: 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.em-pcell .ptext .psub .dot { width: 2px; height: 2px; border-radius: 50%; background: var(--ink-4); }

/* Counterparty: avatar + who */
.em-cp { display: flex; align-items: center; gap: 10px; }
.em-cp .av {
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 10.5px; font-weight: 700;
  background: var(--blue-soft); color: var(--blue);
  flex-shrink: 0;
}
.em-cp .av.amber { background: var(--amber-soft); color: var(--amber); }
.em-cp .av.plum  { background: var(--plum-soft);  color: var(--plum); }
.em-cp .av.teal  { background: var(--backer-soft); color: var(--backer-ink); }
.em-cp .av.green { background: var(--green-soft); color: var(--green); }
.em-cp .who { display: grid; line-height: 1.3; min-width: 0; }
.em-cp .who b { font-size: 13px; font-weight: 500; color: var(--ink); }
.em-cp .who span { font-size: 11.5px; color: var(--ink-3); }

/* Status pill */
.em-status {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 6px;
  font-size: 11px; font-weight: 600; line-height: 1.5;
  white-space: nowrap;
}
.em-status.draft         { background: var(--surface-2);   color: var(--ink-3); }
.em-status.live          { background: var(--backer-soft); color: var(--backer-ink); }
.em-status.awaiting_shortlist { background: var(--amber-soft); color: var(--amber); }
.em-status.shortlisted   { background: var(--blue-soft);   color: var(--blue); }
.em-status.shortlisting  { background: var(--blue-soft);   color: var(--blue); }
.em-status.preferred_bidder,
.em-status.preferred     { background: var(--plum-soft);   color: var(--plum); }
.em-status.in_due_diligence { background: var(--indigo-soft); color: var(--indigo); }
.em-status.funded        { background: var(--green-soft);  color: var(--green); }
.em-status.complete      { background: var(--green-soft);  color: var(--green); }
.em-status.cancelled     { background: var(--red-soft);    color: var(--red); }
.em-status.submitted      { background: var(--backer-soft); color: var(--backer-ink); }
.em-status.not_progressed,
.em-status.withdrawn      { background: var(--surface-2);   color: var(--ink-4); }
.em-status.revision_invited,
.em-status.reopened       { background: var(--amber-soft); color: var(--amber); }

/* Updated cell - relative time */
.em-when {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-3);
  white-space: nowrap;
}

/* Mono numeric cell */
.em-mono {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink);
  font-weight: 500;
  white-space: nowrap;
}
.em-mono .ccy { color: var(--ink-3); font-weight: 400; margin-right: 2px; }

/* Row CTA */
.em-cta {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 11px;
  border-radius: 7px; border: 1px solid var(--line);
  background: var(--surface);
  font-size: 12px; font-weight: 600; color: var(--ink-2);
  cursor: pointer; font-family: inherit;
  white-space: nowrap;
}
.em-cta:hover { border-color: var(--ink-3); color: var(--ink); }
.em-cta.primary { background: var(--backer); border-color: var(--backer); color: #fff; }
.em-cta.primary:hover { background: var(--backer-ink); border-color: var(--backer-ink); color: #fff; }
.em-cta.ghost { background: transparent; border-color: transparent; color: var(--ink-3); }
.em-cta.ghost:hover { background: var(--surface-2); color: var(--ink); border-color: var(--line); }

/* Empty state */
.em-empty {
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 38px 24px;
  text-align: center;
  color: var(--ink-3);
}
.em-empty h4 { font-size: 15px; font-weight: 600; color: var(--ink); margin: 0 0 6px; letter-spacing: -0.01em; }
.em-empty p { margin: 0 auto 14px; max-width: 360px; font-size: 13px; }

/* Engagement-manager filter bar reuses the shared .bp-toolbar / .bp-search /
   .fbar / .fbtn chrome from project_list (browse_projects). Only the Clear
   filters button is unique to the engagement manager - styled here to match
   the rest of the toolbar. */
.em-clear-filters {
  font-size: 11.5px; color: var(--ink-3); cursor: pointer;
  background: none; border: none; padding: 4px 6px;
  font-family: inherit;
}
.em-clear-filters:hover { color: var(--ink); text-decoration: underline; }

/* ---- Timeline (swimlane) view ---- */
.em-timeline {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.em-tl-head {
  display: grid;
  grid-template-columns: 320px 1fr;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  font-size: 10.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-3);
}
.em-tl-head .lbl { padding: 11px 18px; border-right: 1px solid var(--line); }
.em-tl-stages {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
}
.em-tl-stages .st {
  padding: 11px 8px; text-align: center;
  border-right: 1px solid var(--line);
  position: relative;
}
.em-tl-stages .st:last-child { border-right: none; }
.em-tl-stages .st.action { color: var(--amber); }

.em-tl-group {
  padding: 10px 18px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-3);
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 6px;
}
.em-tl-group.amber { color: var(--amber); }
.em-tl-group.muted { color: var(--ink-4); }

.em-tl-row {
  display: grid;
  grid-template-columns: 320px 1fr;
  border-bottom: 1px solid var(--line);
  min-height: 80px;
  cursor: pointer;
}
.em-tl-row:last-child { border-bottom: none; }
.em-tl-row:hover { background: var(--bg); }
.em-tl-row.needs-action { background: rgba(217,178,98,0.06); }
.em-tl-row.needs-action:hover { background: rgba(217,178,98,0.1); }

.em-tl-proj {
  padding: 14px 18px;
  border-right: 1px solid var(--line);
  display: flex; gap: 12px; align-items: center;
  min-width: 0;
}
/* Sector-tinted glyph - mirrors the .em-pcell .glyph palette so the
   timeline's project icon matches the row icon in the list view, and
   gives the absolute-positioned .feat-star a positioning context. */
.em-tl-proj .glyph {
  width: 34px; height: 34px; border-radius: 9px;
  display: grid; place-items: center;
  font-size: 13px; flex-shrink: 0;
  position: relative;
  background: var(--surface-2); color: var(--ink-3);
}
.em-tl-proj .glyph.economic { background: var(--amber-soft); color: var(--amber); }
.em-tl-proj .glyph.energy   { background: var(--green-soft); color: var(--green); }
.em-tl-proj .glyph.digital  { background: var(--plum-soft);  color: var(--plum); }
.em-tl-proj .glyph.social   { background: var(--blue-soft);  color: var(--blue); }
.em-tl-proj .ptext { min-width: 0; flex: 1; }
.em-tl-proj .pname {
  font-size: 13px; font-weight: 600; color: var(--ink);
  display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-decoration: none;
}
.em-tl-proj .psub {
  font-size: 11px; color: var(--ink-3);
  display: flex; align-items: center; gap: 6px; margin-top: 2px;
}
.em-tl-proj .psub .dot { width: 2px; height: 2px; border-radius: 50%; background: var(--ink-4); }
.em-tl-proj .pcp {
  font-size: 11px; color: var(--ink-3); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.em-tl-proj .pcp b { color: var(--ink-2); font-weight: 500; }

.em-tl-track {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
}
.em-tl-track::before {
  content: '';
  position: absolute;
  left: calc(100%/10); right: calc(100%/10);
  top: 50%;
  height: 2px;
  background: var(--line);
  border-radius: 2px;
}
.em-tl-track .em-tl-progress {
  position: absolute;
  left: calc(100%/10);
  top: 50%; height: 2px;
  background: var(--backer);
  border-radius: 2px;
  transform: translateY(-50%);
  z-index: 1;
}
.em-tl-track .col {
  height: 100%;
  border-right: 1px dashed var(--line-2);
  position: relative;
  z-index: 2;
  display: grid; place-items: center;
}
.em-tl-track .col:last-child { border-right: none; }
/* Cancelled track: trim the gray base line so it stops at the column
   holding the Cancelled pill. The template sets --em-cancel-right per row. */
.em-tl-track.track-dead::before {
  background: var(--line-2);
  right: var(--em-cancel-right, 10%);
}

.em-tl-node {
  width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface); border: 2px solid var(--line);
  font-size: 9px; color: var(--ink-4);
  z-index: 3; position: relative;
  cursor: pointer;
  transition: transform .12s;
}
.em-tl-node.done { background: var(--backer); border-color: var(--backer); color: #fff; }
.em-tl-node.current {
  background: #fff; border-color: var(--amber);
  color: var(--amber);
  box-shadow: 0 0 0 4px var(--amber-soft);
}
.em-tl-node.stalled {
  background: #fff; border-color: var(--amber);
  color: var(--amber);
  animation: tl-pulse 2.2s ease-out infinite;
}
@keyframes tl-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(217,178,98,0.5); }
  50%      { box-shadow: 0 0 0 6px rgba(217,178,98,0); }
}
.em-tl-node.failed { background: #fff; border-color: var(--ink-4); color: var(--ink-3); }
.em-tl-node.muted { opacity: .5; }

.em-tl-node-when {
  position: absolute;
  top: calc(50% + 16px);
  font-family: var(--font-mono); font-size: 10px;
  color: var(--ink-3);
  white-space: nowrap;
}

/* "N expressions" caption rendered ABOVE the icon on the Shortlisted
   column for project-level (developer) rows. Mirrors .em-tl-node-when. */
.em-tl-node-count {
  position: absolute;
  bottom: calc(50% + 16px);
  font-family: var(--font-mono); font-size: 10px;
  color: var(--ink-3);
  white-space: nowrap;
}

/* Cancelled pill rendered inline in the column AFTER the last completed
   stage on a cancelled row - replaces the old grid-following .em-tl-notprog. */
.em-tl-cancel {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  border: 1px solid transparent;
  z-index: 3; position: relative;
}

/* Engagement-level "Not progressed" terminal reuses the list-view .em-status
   chrome (grey pill, no icon) for visual consistency between views. The
   layering rule ensures it sits above the track-dead background overlay. */
.em-tl-track .em-status { z-index: 3; position: relative; }

.em-tl-loadmore {
  display: flex; justify-content: center;
  padding: 14px;
  background: var(--surface);
  border-top: 1px solid var(--line);
}
.em-tl-loadmore button {
  background: var(--surface-2); border: 1px solid var(--line);
  color: var(--ink-2); font-family: inherit; font-size: 12.5px; font-weight: 500;
  padding: 7px 16px; border-radius: 7px; cursor: pointer;
}
.em-tl-loadmore button:hover { border-color: var(--ink-4); color: var(--ink); }

/* Under 1100px the swimlane needs more horizontal room than the content
   column provides. Allow `.em-timeline` to scroll horizontally and pin a
   sensible min-width on the head + each row + the group separator so the
   five stage columns retain readable spacing. Extra bottom padding gives
   the native scrollbar breathing room under the last row. */
@media (max-width: 1099.98px) {
  .em-timeline {
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 14px;
  }
  .em-tl-head,
  .em-tl-row,
  .em-tl-group,
  .em-tl-loadmore {
    min-width: 940px;
  }
  .em-tl-group { box-sizing: border-box; }
}

/* ---- Detail drawer (slide-over right panel) ---- */
.em-drawer-backdrop {
  position: fixed; inset: 0;
  background: rgba(20, 24, 32, 0.32);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 50;
  animation: drawer-fade-in .18s ease-out;
}
.em-drawer {
  position: fixed; right: 0; top: 0; bottom: 0;
  width: min(600px, 96vw);
  background: var(--bg);
  border-left: 1px solid var(--line);
  box-shadow: -24px 0 48px -12px rgba(20, 24, 32, 0.18);
  z-index: 51;
  display: flex; flex-direction: column;
  animation: drawer-slide-in .22s cubic-bezier(.2,.8,.2,1);
}
@keyframes drawer-fade-in { from { opacity: 0 } to { opacity: 1 } }
@keyframes drawer-slide-in {
  from { transform: translateX(40px); opacity: 0 }
  to { transform: translateX(0); opacity: 1 }
}

.em-drawer-head {
  padding: 22px 28px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  position: relative;
  flex-shrink: 0;
}
.em-drawer-close {
  position: absolute; top: 16px; right: 16px;
  width: 32px; height: 32px; border-radius: 8px;
  background: transparent; border: 1px solid transparent;
  color: var(--ink-3); cursor: pointer;
  display: grid; place-items: center;
  font-size: 14px;
  transition: background .12s, border-color .12s;
}
.em-drawer-close:hover { background: var(--surface-2); border-color: var(--line); color: var(--ink); }

.em-drawer-head-top {
  display: flex; align-items: center; gap: 12px;
  padding-right: 40px;
}
.em-drawer-head-top .glyph {
  width: 34px; height: 34px; border-radius: 9px;
  font-size: 13px; flex-shrink: 0;
  display: grid; place-items: center;
  background: var(--surface-2); color: var(--ink-3);
  position: relative;
}
.em-drawer-head-top .ttl h2 .pd-featured {
  margin-left: 8px;
  vertical-align: middle;
}
/* Sector tints - mirror the .em-pcell .glyph palette so the drawer's icon
   matches the row icon for the same project. */
.em-drawer-head-top .glyph.economic { background: var(--amber-soft); color: var(--amber); }
.em-drawer-head-top .glyph.energy   { background: var(--green-soft); color: var(--green); }
.em-drawer-head-top .glyph.digital  { background: var(--plum-soft);  color: var(--plum); }
.em-drawer-head-top .glyph.social   { background: var(--blue-soft);  color: var(--blue); }
.em-drawer-head-top .ttl { flex: 1; min-width: 0; }
.em-drawer-head-top .ttl h2 {
  font-size: 14px; font-weight: 600; color: var(--ink);
  margin: 0; letter-spacing: 0;
  font-family: var(--font-sans); line-height: 1.3;
}
.em-drawer-head-top .ttl .sub {
  font-size: 11.5px; color: var(--ink-3); margin-top: 2px;
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.em-drawer-head-top .ttl .sub .dot {
  width: 2px; height: 2px; border-radius: 50%; background: var(--ink-4);
}

/* Status pill row inside drawer header */
.em-drawer-status {
  display: flex; align-items: center; gap: 18px;
  margin-top: 18px;
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.em-drawer-status .ds-block {
  display: flex; flex-direction: column; gap: 6px;
}
.em-drawer-status .ds-l {
  font-size: 9.5px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-3);
}
.em-drawer-status .ds-funded {
  margin-left: auto;
  padding-left: 16px;
  border-left: 1px solid var(--line);
}

/* Action area */
.em-drawer-actions {
  margin-top: 14px;
}
.em-drawer-buttons {
  display: flex; align-items: stretch; gap: 8px; flex-wrap: wrap;
}
.em-act {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 14px;
  border-radius: 8px;
  font-size: 12.5px; font-weight: 500;
  font-family: inherit; cursor: pointer;
  transition: all .12s;
  position: relative;
  text-decoration: none;
}
.em-act i { font-size: 11.5px; }
.em-act-primary {
  background: var(--backer); color: #fff;
  border: 1px solid var(--backer);
}
.em-act-primary:hover { background: var(--backer-ink); border-color: var(--backer-ink); color: #fff; }
/* An action on a list row (a Reopened engagement's "Express interest"). */
.em-row-act { display: inline-block; margin-left: 8px; font-size: 12px; font-weight: 600; color: var(--backer); text-decoration: underline; }
.em-act-ghost {
  background: var(--surface); color: var(--ink-2);
  border: 1px solid var(--line);
}
.em-act-ghost:hover { background: var(--surface-2); color: var(--ink); border-color: var(--ink-4); }
.em-act-ghost-warn {
  background: var(--surface); color: var(--ink-3);
  border: 1px solid var(--line);
}
.em-act-ghost-warn:hover {
  background: rgba(176, 38, 38, 0.05);
  border-color: rgba(176, 38, 38, 0.3);
  color: rgb(140, 30, 30);
}

/* Actions section (drawer body) - single stacked column of compact
   `.btn.btn-subtle.btn-sm` buttons in the emit order set by
   `_project_actions_section` / `_request_actions_section`.
   `align-items: flex-start` keeps each button at its natural width
   (no stretch) so the section reads as a list of pill-shaped chips. */
.em-detail-actions .em-actions-grid {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
}
/* Destructive variant - repaints `.btn-subtle` from teal-soft to red-soft.
   Used by the Cancel button (action dict carries `destructive: True`).
   Scoped under `.em-detail-actions` so it can't bleed into other surfaces. */
.em-detail-actions .em-actions-grid .btn-subtle.is-destructive {
  background: var(--red-soft);
  color: var(--red);
}
.em-detail-actions .em-actions-grid .btn-subtle.is-destructive:hover {
  background: var(--red);
  color: #fff;
}
/* Dark mode: --red is lightened (§2), so the solid-red hover fill needs dark
   ink, not white (mirrors the .btn-primary dark treatment). */
[data-bs-theme="dark"] .em-detail-actions .em-actions-grid .btn-subtle.is-destructive:hover {
  color: #0f1514;
}

/* Read-only banner for non-developers */
.em-drawer-readonly {
  margin-top: 14px;
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12px; color: var(--ink-2); line-height: 1.5;
}
.em-drawer-readonly i { color: var(--ink-3); font-size: 12px; margin-top: 2px; flex-shrink: 0; }

/* Drawer scroll body */
.em-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
}

/* Detail sections */
.em-detail-section { margin-bottom: 26px; }
.em-detail-section:last-child { margin-bottom: 0; }
.em-detail-section h4 {
  font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-3); margin: 0 0 12px;
  font-family: var(--font-sans);
}

/* Funding breakdown card - shared by Snapshot's "Funding requirement"
   and the Project-owner section's "Your funding offer". Drives the
   financing_breakdown() macro in pipeline/_engagements/_macros.html. */
.em-funding-card {
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  display: flex; flex-direction: column; gap: 10px;
}
.em-funding-row { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.em-funding-row-head {
  display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 13px; color: var(--ink); font-weight: 500;
}
.em-funding-swatch { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; background: var(--c, var(--ink-4)); }
.em-funding-sep, .em-funding-name { color: var(--ink-3); }
.em-funding-name { font-weight: 400; }
.em-funding-amount {
  font-size: 12.5px; color: var(--ink); font-weight: 500;
  font-family: var(--font-mono); margin-left: 18px;
}
.em-funding-pct { color: var(--ink-3); font-weight: 400; }

/* Inline counter-proposal badge in the "Your funding offer" h4. */
.em-cp-badge {
  font-size: 10px; padding: 1px 8px; letter-spacing: .04em;
  margin-left: 8px; vertical-align: middle;
}

/* Offer-line rows (drawer "Funding offer" + investor summary): per-line status
   pill right-aligned in the row head, awarded allocation + counter note as
   sub-lines under the offered amount. Reuses the .em-funding-* layout. */
.em-funding-row-head .em-offer-status { margin-left: auto; font-size: 10px; padding: 1px 8px; }
.em-offer-alloc { font-family: var(--font-mono); color: var(--green); font-weight: 600; }
.em-offer-note { font-size: 11.5px; color: var(--ink-2); margin-left: 18px; line-height: 1.5; }

/* Mark Funded modal - per-component editable final allocations (3-col grid) */
.em-funded-grid {
  display: grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr) 170px;
  gap: 12px 16px; align-items: center;
}
.em-funded-grid > .h {
  font-size: 10.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-3); padding-bottom: 4px; border-bottom: 1px solid var(--line-2);
}
.em-funded-grid > .h.amt { text-align: right; }
.em-funded-ft { display: flex; flex-direction: column; min-width: 0; }
.em-funded-ft b { font-size: 12.5px; color: var(--ink); font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.em-funded-ft span { font-size: 11px; color: var(--ink-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.em-funded-amt { display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
.em-funded-amt .ccy { font-size: 11px; color: var(--ink-3); font-family: var(--font-mono); }
.em-funded-amt input {
  width: 120px; height: 34px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: var(--ink); font-family: var(--font-mono);
  font-size: 13px; padding: 0 10px; text-align: right;
}
.em-funded-amt input:focus {
  outline: none; border-color: var(--backer); box-shadow: 0 0 0 3px rgba(45, 107, 102, .12);
}
.em-funded-total {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line-2); font-size: 13px;
}
.em-funded-total span { color: var(--ink-3); }
.em-funded-total strong { font-family: var(--font-mono); color: var(--ink); }

@media (max-width: 575.98px) {
  /* Collapse the grid to stacked cards: component + financing type on one row,
     the amount field full-width beneath. */
  .em-funded-grid { grid-template-columns: 1fr auto; gap: 6px 12px; }
  .em-funded-grid > .h { display: none; }
  .em-funded-grid > .em-funded-amt { grid-column: 1 / -1; justify-content: flex-start; }
  .em-funded-amt input { flex: 1 1 auto; width: auto; }
}

/* Counterparty card */
.em-detail-cp {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border-radius: 8px;
  border: 1px solid var(--line);
}
.em-detail-cp .av-lg {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 600; font-size: 13px;
  flex-shrink: 0;
  background: var(--blue-soft); color: var(--blue);
}
.em-detail-cp .av-lg.amber { background: var(--amber-soft); color: var(--amber); }
.em-detail-cp .av-lg.plum  { background: var(--plum-soft);  color: var(--plum); }
.em-detail-cp .av-lg.teal  { background: var(--backer-soft); color: var(--backer-ink); }
.em-detail-cp .av-lg.green { background: var(--green-soft); color: var(--green); }
.em-detail-cp .who-lg b {
  font-size: 13.5px; color: var(--ink); display: block; line-height: 1.25;
}
.em-detail-cp .who-lg span { font-size: 11.5px; color: var(--ink-3); }

/* Engagement-list inside the developer project hub drawer */
/* Section head with right-aligned action button (e.g. Counterparties Actions). */
.em-detail-section-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 8px;
}
.em-detail-section-head h4 { margin: 0; }

/* Counterparties Actions modal - bulk status table */
.em-cp-table {
  width: 100%; border-collapse: collapse;
  font-size: 13px;
}
.em-cp-table thead th {
  text-align: center;
  font-size: 10.5px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--ink-3);
  padding: 8px 10px; border-bottom: 1px solid var(--line);
}
.em-cp-table thead th.cp-col-name { text-align: left; padding-left: 4px; }
.em-cp-table tbody td {
  padding: 12px 10px; border-bottom: 1px solid var(--line-2);
  vertical-align: middle;
}
.em-cp-table tbody td.cp-col-name { padding-left: 4px; }
.em-cp-table tbody tr:last-child td { border-bottom: none; }
.em-cp-table .cp-cell { display: flex; align-items: center; gap: 10px; }
.em-cp-table .av-sm {
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 600; font-size: 11px;
  background: var(--blue-soft); color: var(--blue);
}
.em-cp-table .av-sm.amber { background: var(--amber-soft); color: var(--amber); }
.em-cp-table .av-sm.plum  { background: var(--plum-soft); color: var(--plum); }
.em-cp-table .av-sm.green { background: var(--green-soft); color: var(--green); }
.em-cp-table .av-sm.teal  { background: var(--backer-soft); color: var(--backer-ink); }
.em-cp-table .cp-name { font-weight: 600; color: var(--ink); }
.em-cp-table .cp-col-radio { width: 130px; text-align: center; }
.em-cp-table .cp-radio {
  display: inline-grid; place-items: center;
  width: 100%; height: 100%; cursor: pointer; padding: 6px;
}
.em-cp-table .cp-radio input { width: 16px; height: 16px; cursor: pointer; accent-color: var(--backer); }
.em-cp-table .cp-radio input:disabled { cursor: not-allowed; }
.em-cp-table .em-cp-row-locked { opacity: .55; }

/* All-not-progressed follow-up */
.em-cp-followup {
  margin-top: 14px;
  background: var(--amber-soft);
  border: 1px solid rgba(176,126,42,0.35);
  border-radius: 8px;
  padding: 14px;
}
.em-cp-followup-inner { display: flex; gap: 12px; align-items: flex-start; }
.em-cp-followup-inner i { color: var(--amber); font-size: 16px; margin-top: 2px; }
.em-cp-followup-inner b { display: block; font-size: 13px; color: var(--ink); margin-bottom: 4px; }
.em-cp-followup-inner p { margin: 0; font-size: 12.5px; color: var(--ink-2); }
.em-cp-followup-actions {
  display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px;
}

/* Counterparties: single card with stacked rows. */
.em-detail-engagements {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.em-detail-engagements .em-empty { padding: 18px 14px; }
.em-detail-eng-row {
  display: grid;
  grid-template-columns: 36px 1fr auto auto;
  gap: 12px; align-items: center;
  padding: 12px 14px;
}
.em-detail-engagements > .em-detail-eng-row:first-child { border-top: none; }
.em-detail-eng-row .av-lg {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 600; font-size: 12px;
  background: var(--blue-soft); color: var(--blue);
}
.em-detail-eng-row .meta b {
  font-size: 13px; color: var(--ink); display: block; line-height: 1.25;
  font-weight: 600;
}
.em-detail-eng-row .em-eng-date {
  font-size: 11.5px; color: var(--ink-3);
}
.em-detail-eng-row .actions { display: flex; gap: 6px; align-items: center; }

/* Modal "Show all" bar (10-row cap inside the bulk-update table). */
.em-cp-show-more {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 10px; padding: 8px 4px 0;
  border-top: 1px dashed var(--line);
  font-size: 12px; color: var(--ink-3);
}
.em-cp-show-more .btn-text { font-size: 12px; }

/* Milestones - read-only progress list. Self-contained: defines the full
   `.step` box here (the homepage `.step` chrome it once shared was removed). */
.em-detail-progress { display: grid; gap: 6px; }
.em-detail-progress .step {
  display: grid; grid-template-columns: 22px 1fr auto;
  gap: 10px; align-items: center;
  padding: 10px 14px;
  border-radius: 6px;
  background: var(--surface-2); border: 1px solid var(--line);
  cursor: default;
  transition: none;
}
.em-detail-progress .step:hover { background: var(--surface-2); }
.em-detail-progress .step.done {
  background: var(--green-soft);
  border-color: rgba(45,90,68,0.15);
}
.em-detail-progress .step.done:hover { background: var(--green-soft); }
.em-detail-progress .step.active {
  background: var(--amber-soft);
  border-color: rgba(176,126,42,0.25);
}
.em-detail-progress .step.active:hover { background: var(--amber-soft); }
/* Stalled (parent hasn't moved for >14d) is the same "current" state as
   active - the counterparty has no way to unblock it, so the visual cue
   should still read as "where the engagement currently sits" (amber)
   rather than dropping back to a neutral grey. */
.em-detail-progress .step.stalled {
  background: var(--amber-soft);
  border-color: rgba(176,126,42,0.25);
}
.em-detail-progress .step.stalled:hover { background: var(--amber-soft); }
.em-detail-progress .step.stalled .ico {
  background: #fff; border-color: var(--amber); color: var(--amber);
}
.em-detail-progress .step.muted {
  background: var(--surface-2); opacity: .65;
}
.em-detail-progress .step.muted:hover { background: var(--surface-2); }
/* Cancelled / not-progressed both read as "closed without success" - paint
   them in the neutral ghost-pill palette rather than red so the drawer
   doesn't look alarming. */
.em-detail-progress .step.cancelled {
  background: var(--surface-2);
  border-color: var(--line);
}
.em-detail-progress .step.cancelled:hover { background: var(--surface-2); }
.em-detail-progress .step.cancelled .ico {
  background: var(--ink-4); border-color: var(--ink-4); color: #fff;
}
.em-detail-progress .step.cancelled .lbl { color: var(--ink); font-weight: 600; }
.em-detail-progress .step .ico {
  width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; font-size: 10px;
  background: var(--surface); border: 1px solid var(--line);
  color: var(--ink-4);
}
.em-detail-progress .step.done .ico {
  background: var(--green-700, #2d5a44); border-color: var(--green-700, #2d5a44); color: #fff;
}
.em-detail-progress .step.active .ico {
  background: #fff; border-color: var(--amber); color: var(--amber);
}
.em-detail-progress .step .lbl {
  font-size: 12.5px; font-weight: 500; color: var(--ink);
}
.em-detail-progress .step .lbl span {
  font-size: 11px; font-weight: 400; color: var(--ink-3); margin-left: 6px;
}
.em-detail-progress .step .lbl .em-step-link {
  font-size: 11.5px; font-weight: 500; color: var(--backer);
  text-decoration: none; margin-left: 4px;
}
.em-detail-progress .step .lbl .em-step-link:hover { text-decoration: underline; }
.em-detail-progress .step .when {
  font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-3);
}

/* Snapshot stats */
.em-detail-stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.em-detail-stat {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 8px; padding: 12px 14px;
}
.em-detail-stat .l {
  font-size: 10px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-3); display: block; margin-bottom: 4px;
}
.em-detail-stat .v {
  font-size: 16px; font-weight: 500; color: var(--ink);
  font-family: var(--font-mono); letter-spacing: -0.01em;
}
.em-detail-stat .v .ccy {
  font-size: 10.5px; color: var(--ink-3); margin-right: 4px; font-weight: 500;
}

/* Activity timeline */
.em-detail-history {
  display: grid; gap: 0;
  padding-left: 4px;
  /* Activity feed shows every event - cap height + scroll the section
     independently so long histories don't push other drawer content
     off-screen. Subtle scrollbar matches the sidebar's `.sb-scroll`
     treatment. */
  max-height: min(60vh, 480px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
  /* Inset the right padding so scrollbar doesn't overlap the dot timeline. */
  padding-right: 6px;
}
.em-detail-history::-webkit-scrollbar { width: 6px; }
.em-detail-history::-webkit-scrollbar-track { background: transparent; }
.em-detail-history::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 3px;
}
.em-detail-history::-webkit-scrollbar-thumb:hover { background: var(--line-2); }
/* Each .ev draws its own segment of the connecting line. The first .ev's
   segment starts at its dot centre (16px from .ev top); the last .ev's
   segment ends at its dot centre. Middle .evs span the full row. This
   guarantees the line runs centre-to-centre regardless of row count or
   how tall any individual row's text wraps. */
.em-detail-history .ev {
  display: grid; grid-template-columns: 22px 1fr;
  gap: 12px; padding: 6px 0;
  position: relative;
}
.em-detail-history .ev::before {
  content: ''; position: absolute;
  /* Dot centre is at x=9 (margin-left 4 + radius 5). Subtract half the line
     width so the line is centred on the dot, not offset to its right edge. */
  left: 8.25px; top: 0; bottom: 0;
  width: 1.5px; background: var(--line);
  z-index: 0;
}
.em-detail-history .ev:first-child::before { top: 16px; }
.em-detail-history .ev:last-child::before { bottom: calc(100% - 16px); }
.em-detail-history .ev:only-child::before { display: none; }
.em-detail-history .ev .dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--line);
  margin-top: 5px; margin-left: 4px;
  z-index: 1;
}
.em-detail-history .ev.green .dot { background: var(--backer); border-color: var(--backer); }
.em-detail-history .ev.amber .dot { background: var(--amber); border-color: var(--amber); }
.em-detail-history .ev.blue  .dot { background: var(--blue);  border-color: var(--blue); }
.em-detail-history .ev.red   .dot { background: var(--red);   border-color: var(--red); }
.em-detail-history .ev.muted .dot { background: var(--ink-4); border-color: var(--ink-4); opacity: .6; }
.em-detail-history .ev.ghost .dot { background: var(--ink-4); border-color: var(--ink-4); opacity: .45; }
.em-detail-history .ev .what {
  font-size: 12.5px; color: var(--ink); line-height: 1.4;
}
.em-detail-history .ev .what a {
  color: var(--ink); font-weight: 600; text-decoration: none;
  transition: color .15s ease;
}
.em-detail-history .ev .what a:hover,
.em-detail-history .ev .what a:focus-visible {
  color: var(--backer); text-decoration: none;
}
.em-detail-history .ev .when {
  font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-3);
  margin-top: 1px;
}
.em-detail-history .ev .when .rel { color: var(--ink-4); margin-left: 2px; }

/* Drawer mount placeholder (kept empty until JS injects content) */
#em-drawer-mount:empty { display: none; }

/* Engagement Manager responsive */
@media (max-width: 1100px) {
  .em-hero { grid-template-columns: 1fr; }
}
@media (max-width: 800px) {
  .em-tl-head, .em-tl-row { grid-template-columns: 220px 1fr; }
  .em-section-head { flex-wrap: wrap; }
}


/* =====================================================================
   17. PAGE: PROJECT DETAIL (.pd-*, .eoi-*, .btn-pd-*)
   Page-scoped styles for /pipeline/projects/<id>.
   Prefixes:
     .pd-*    project detail (hero, layout, card, kv-grid, dr-grid,
              stack-bar, sh-table, metrics, cta-d, deadline,
              engage-*, toc)
     .eoi-*   express-interest modal chrome
     .btn-pd-* hero action buttons (primary, ghost)
   All tokens resolve to backer.css :root vars.
   ===================================================================== */

/* --- Detail hero ------------------------------------------- */
.pd-hero {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line-2);
  margin-bottom: 24px;
}
.pd-hero-ident { flex: 1; min-width: 0; }

.pd-hero-title {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: clamp(26px, 2.4vw, 34px);
  letter-spacing: -0.018em;
  line-height: 1.12;
  color: var(--ink);
  margin: 0 0 8px;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  text-wrap: balance;
}
.pd-featured {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  /* Token-based gradient so the badge stays legible in both light and dark
     modes - `--amber-soft` swaps to a translucent amber tint in dark mode
     and `--surface` swaps to the dark card surface. */
  background: linear-gradient(135deg, var(--amber-soft), var(--surface));
  color: var(--amber);
  border: 1px solid rgba(176,126,42,.25);
}

.pd-hero-devline {
  font-size: 13.5px;
  color: var(--ink-2);
  margin: 0 0 12px;
}
.pd-hero-devline .k {
  color: var(--ink-3);
  font-weight: 500;
}
/* Gap before each fact group after the first (Developer / Listed / etc.),
   replacing the old middot separator with clean whitespace. */
.pd-hero-devline .k:not(:first-child) { margin-left: 14px; }
.pd-hero-devline a,
.pd-hero-devline .v {
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}
.pd-hero-devline a { transition: color .12s; }
.pd-hero-devline a:hover { color: var(--backer); }
.pd-hero-devline .dot {
  display: inline-block;
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--ink-4);
  margin: 0 10px;
  vertical-align: 2px;
}

.pd-hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pd-hero-actions {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
}
.pd-hero-actions .row { display: flex; gap: 8px; margin: 0; --bs-gutter-x: 0; }

/* Detail-only primary button variant to match hero weight */
.btn-pd-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--backer);
  color: #fff;
  border: 1px solid var(--backer);
  border-radius: 8px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background .12s, transform .1s, box-shadow .12s;
  box-shadow: 0 1px 0 rgba(0,0,0,.03), 0 10px 22px -14px rgba(45,107,102,.55);
}
.btn-pd-primary:hover { background: var(--backer-ink); transform: translateY(-1px); color: #fff; }
.btn-pd-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  background: var(--surface);
  color: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: border-color .12s, color .12s;
}
.btn-pd-ghost:hover { border-color: var(--ink-3); color: var(--ink); }

/* --- Two-col layout --------------------------------------- */
.pd-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
}
.pd-main { min-width: 0; display: grid; gap: 20px; }
.pd-aside { min-width: 0; }
.pd-aside-inner {
  position: sticky;
  top: 20px;
  display: grid;
  gap: 16px;
}

/* --- Card (detail-specific, slightly different from .card) - */
.pd-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  /* Topbar (.app grid-template-rows row 1) is 56px; reserve a 24px breathing
     gap above the heading when an anchor link or browser hash jump scrolls
     the section into view. Native scroll-margin-top works for both anchor
     hash navigation and the smooth-scroll TOC click handler. */
  scroll-margin-top: 80px;
}
.pd-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line-2);
  background: var(--surface);
}
.pd-card-head h3 {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.pd-card-head h3 .ico {
  width: 24px; height: 24px;
  display: grid;
  place-items: center;
  background: var(--backer-soft);
  color: var(--backer);
  border-radius: 6px;
  font-size: 11px;
}
.pd-card-head .pd-head-aux {
  font-size: 11.5px;
  color: var(--ink-3);
  font-family: var(--font-mono);
}
.pd-card-head .pd-head-aux b { color: var(--ink); font-weight: 600; }
.pd-card-body { padding: 20px 22px; }
.pd-card-body.no-pad { padding: 0; }

/* --- Key-value grid --------------------------------------- */
.pd-kv-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px 26px;
}
.pd-kv-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.pd-kv-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.pd-kv-item {
  display: grid;
  /* Pack rows to the top so labels stay aligned when a sibling cell's value
     wraps and stretches the row taller than this cell needs. */
  align-content: start;
  gap: 5px;
  min-width: 0;
}
.pd-kv-item .k {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: inline-flex;
  /* Top-align so wrapping labels keep their `.info-i` glyph on the first line. */
  align-items: flex-start;
  gap: 6px;
  /* Reserve 2 lines so labels of varying length all occupy the same vertical
     slot. Without this, single-line labels collapse to ~13px while wrapping
     labels take ~26px, which causes values across a row to start at different
     y-positions even though the labels themselves all align to the row top. */
  line-height: 1.25;
  min-height: 26px;
}
.pd-kv-item .k .info-i {
  display: inline-grid;
  place-items: center;
  width: 13px; height: 13px;
  border-radius: 50%;
  border: 1px solid var(--line);
  font-size: 8px;
  color: var(--ink-4);
  cursor: help;
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  background: var(--surface);
  transition: color .12s, border-color .12s, background .12s;
  position: relative;
}
.pd-kv-item .k .info-i:hover,
.pd-kv-item .k .info-i:focus-visible {
  color: #fff;
  background: var(--backer);
  border-color: var(--backer);
  outline: none;
}
.pd-kv-item .k .info-i[data-tip]::before,
.pd-kv-item .k .info-i[data-tip]::after {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 4px);
  transition: opacity .14s ease, transform .14s ease;
  z-index: 50;
}
.pd-kv-item .k .info-i[data-tip]::before {
  content: attr(data-tip);
  width: max-content;
  max-width: 260px;
  padding: 9px 12px;
  background: var(--ink);
  color: #f4f6f5;
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: 0;
  text-transform: none;
  border-radius: 7px;
  text-align: left;
  white-space: normal;
  box-shadow: 0 12px 28px -10px rgba(0,0,0,.35);
}
.pd-kv-item .k .info-i[data-tip]::after {
  content: '';
  bottom: calc(100% + 4px);
  width: 0; height: 0;
  border: 5px solid transparent;
  border-top-color: var(--ink);
}
.pd-kv-item .k .info-i[data-tip]:hover::before,
.pd-kv-item .k .info-i[data-tip]:hover::after,
.pd-kv-item .k .info-i[data-tip]:focus-visible::before,
.pd-kv-item .k .info-i[data-tip]:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}
.pd-kv-item .v {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.35;
  min-height: 20px;
}
.pd-kv-item .v.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
.pd-kv-item .v.big {
  font-family: var(--font-sans);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.01em;
}
/* "Not specified" / "Not set" placeholder values. We use .unset (not .empty)
   because backer.css declares a global .empty empty-state class with
   48px / 24px padding intended for the empty-state illustration cards. */
.pd-kv-item .v.unset,
.pd-metrics .pd-metric .v.unset {
  color: var(--ink-3);
}
.pd-kv-item .v .sub {
  display: block;
  font-size: 11.5px;
  color: var(--ink-3);
  font-weight: 400;
  margin-top: 2px;
  font-family: var(--font-mono);
}

/* --- Description block ------------------------------------ */
.pd-desc {
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink-2);
  white-space: pre-line;
}
.pd-desc::first-letter {
  font-family: var(--font-sans);
  font-size: 34px;
  font-weight: 500;
  color: var(--backer);
  float: left;
  line-height: 1;
  padding: 4px 8px 0 0;
  letter-spacing: -0.015em;
}

/* --- Data-room checklist --------------------------------- */
.pd-dr-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px 28px;
}
.pd-dr-group .pd-dr-label {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px dashed var(--line);
  /* Reserve space for two-line category labels so all three group headers
     end at the same baseline regardless of label length. */
  min-height: 36px;
}
.pd-dr-group .pd-dr-label .count {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  color: var(--ink-4);
  letter-spacing: 0;
}
.pd-dr-group .pd-dr-label .count b { color: var(--backer); font-weight: 700; }
.pd-dr-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-size: 12.5px;
  color: var(--ink-2);
}
.pd-dr-row .tick {
  width: 15px; height: 15px;
  border-radius: 4px;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 8px;
}
.pd-dr-row .tick.on {
  background: var(--backer);
  color: #fff;
}
.pd-dr-row .tick.off {
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--ink-4);
  font-weight: 700;
}
.pd-dr-row.off { color: var(--ink-4); }

/* --- Capital stack visual + table ------------------------- */
.pd-stack-bar {
  display: flex;
  height: 20px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface-2);
  margin-bottom: 0;
  border: 1px solid var(--line-2);
}
.pd-stack-bar .seg {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  /* Keeps the inline % legible on the lighter family shades (cat-hybrid /
     cat-working) where white text would otherwise dip in contrast. */
  text-shadow: 0 1px 1px rgba(0, 0, 0, .28);
  position: relative;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 6px;
  transition: filter .12s;
  /* 7-category funding colour: .cat-* class on this element sets --c. */
  background: var(--c, var(--ink-4));
}
.pd-stack-bar .seg:hover { filter: brightness(1.1); }

.pd-stack-table {
  width: 100%;
  border-collapse: collapse;
}
.pd-stack-table thead th {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 10px 14px;
  text-align: left;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line-2);
  border-top: 1px solid var(--line-2);
}
.pd-stack-table thead th.num { text-align: right; }
.pd-stack-table tbody td {
  padding: 14px;
  border-bottom: 1px solid var(--line-2);
  font-size: 13px;
  color: var(--ink);
  vertical-align: middle;
}
.pd-stack-table tbody tr:last-child td { border-bottom: none; }
.pd-stack-table tbody td.num {
  text-align: right;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}
.pd-stack-table .cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}
.pd-stack-table .cat-chip .sw {
  width: 10px; height: 10px;
  border-radius: 3px;
  /* 7-category funding colour: .cat-* class on this element sets --c. */
  background: var(--c, var(--ink-4));
}

.pd-tax-note {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  background: var(--backer-softer);
  border: 1px solid var(--backer-soft);
  border-radius: 10px;
  margin-top: 16px;
}
.pd-tax-note .ico {
  width: 26px; height: 26px;
  border-radius: 6px;
  background: var(--backer-soft);
  color: var(--backer);
  display: grid;
  place-items: center;
  font-size: 11px;
  flex-shrink: 0;
}
.pd-tax-note .tx {
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.55;
}
.pd-tax-note .tx b { color: var(--ink); font-weight: 600; }

/* --- Stakeholders --------------------------------------- */
.pd-sh-table .ent {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.pd-sh-table .ent .avatar {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-2);
  flex-shrink: 0;
  letter-spacing: 0;
}
/* Per-row colour variants - applied via loop.index0 % 5 in the template
   so each project's stakeholder list rotates deterministically. */
.pd-sh-table .ent .avatar.amber { background: var(--amber-soft); color: var(--amber); border-color: rgba(176,126,42,.2); }
.pd-sh-table .ent .avatar.plum  { background: var(--plum-soft);  color: var(--plum);  border-color: rgba(107,74,122,.2); }
.pd-sh-table .ent .avatar.blue  { background: var(--blue-soft);  color: var(--blue);  border-color: rgba(79,124,164,.2); }
.pd-sh-table .ent .avatar.green { background: var(--green-soft); color: var(--green); border-color: rgba(87,140,99,.2); }
.pd-sh-table .ent .avatar.teal  { background: var(--backer-soft); color: var(--backer); border-color: var(--backer-soft); }
.pd-sh-table .ent .meta { min-width: 0; }
.pd-sh-table .ent .meta b {
  display: block;
  font-weight: 600;
  color: var(--ink);
  font-size: 13px;
}
.pd-sh-table .ent .meta span {
  display: block;
  font-size: 11.5px;
  color: var(--ink-3);
  margin-top: 2px;
}

/* --- Aside: metrics card -------------------------------- */
.pd-metrics {
  display: grid;
  gap: 0;
}
.pd-metrics .pd-metric {
  padding: 14px 22px;
  border-bottom: 1px solid var(--line-2);
  display: grid;
  gap: 3px;
}
.pd-metrics .pd-metric:last-child { border-bottom: none; }
.pd-metrics .pd-metric .l {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.pd-metrics .pd-metric .v {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 22px;
  color: var(--ink);
  letter-spacing: -0.015em;
  line-height: 1.1;
}
.pd-metrics .pd-metric .v.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 19px;
  font-weight: 500;
}
.pd-metrics .pd-metric .sub {
  font-size: 11.5px;
  color: var(--ink-3);
  font-family: var(--font-mono);
}

.pd-metric-hero {
  padding: 18px 22px 20px;
  background: linear-gradient(180deg, var(--backer-softer) 0%, var(--surface) 100%);
  border-bottom: 1px solid var(--line-2);
}
.pd-metric-hero .l {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--backer);
  margin-bottom: 4px;
}
.pd-metric-hero .v {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 30px;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.05;
}
.pd-metric-hero .sub {
  font-size: 12.5px;
  color: var(--ink-3);
  margin-top: 4px;
  font-family: var(--font-mono);
}

/* Variant D: Teal tint institutional */
.pd-cta-d {
  background: var(--backer-softer);
  border: 1px solid var(--backer-soft);
  border-radius: var(--radius);
  padding: 20px 22px;
}
.pd-cta-d-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.pd-cta-d-ico {
  width: 38px; height: 38px;
  background: var(--backer);
  color: #fff;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 14px;
  flex-shrink: 0;
}
.pd-cta-d-eyebrow {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--backer);
}
.pd-cta-d-title {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 18px;
  color: var(--ink);
  letter-spacing: -0.01em;
  margin-top: 1px;
}
.pd-cta-d-list {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  display: grid;
  gap: 6px;
}
.pd-cta-d-list li {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.4;
}
.pd-cta-d-list li i {
  color: var(--backer);
  font-size: 10px;
  margin-top: 4px;
  flex-shrink: 0;
}
.pd-cta-d-btn {
  display: block;
  width: 100%;
  text-align: center;
  padding: 11px 16px;
  background: var(--backer);
  color: #fff;
  border: 0;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background .12s, transform .1s;
}
.pd-cta-d-btn:hover { background: var(--backer-ink); color: #fff; text-decoration: none; transform: translateY(-1px); }
/* Stacked CTA buttons get auto-spacing so callers don't need inline margins.
   Scoped to .pd-cta-d so this only applies inside the CTA card; forms
   wrapping a button count too. */
.pd-cta-d .pd-cta-d-btn + .pd-cta-d-btn,
.pd-cta-d .pd-cta-d-btn + form,
.pd-cta-d form + .pd-cta-d-btn,
.pd-cta-d form + form { margin-top: 8px; }
/* Side-by-side action row variant (Edit + Withdraw interest). Buttons share
   the row evenly with tighter padding / type so they fit in the narrow CTA
   card width. Cancels the stacked-margin rule above. */
.pd-cta-d-actions {
  display: flex;
  gap: 8px;
}
.pd-cta-d-actions .pd-cta-d-btn {
  flex: 1 1 0;
  width: auto;
  padding: 10px;
  font-size: 12.5px;
}
.pd-cta-d .pd-cta-d-actions .pd-cta-d-btn + .pd-cta-d-btn { margin-top: 0; }
.pd-cta-d-foot {
  margin-top: 12px;
  font-size: 11.5px;
  color: var(--ink-3);
  text-align: center;
}
.pd-cta-d-foot b { color: var(--ink); font-weight: 600; }

/* --- Deadline emphasis in metrics ------------------------ */
.pd-metric-deadline {
  background: linear-gradient(135deg, var(--amber-soft) 0%, transparent 70%);
}
.pd-deadline-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid rgba(176,126,42,.22);
  border-radius: 8px;
}
.pd-deadline-countdown {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-right: 12px;
  border-right: 1px dashed rgba(176,126,42,.3);
}
.pd-deadline-countdown .num {
  font-family: var(--font-sans);
  font-size: 32px;
  font-weight: 500;
  color: var(--amber);
  letter-spacing: -0.025em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.pd-deadline-countdown .lbl {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--amber);
  line-height: 1.15;
}
.pd-deadline-date b {
  display: block;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.pd-deadline-date span {
  display: block;
  font-size: 10.5px;
  color: var(--ink-3);
  margin-top: 1px;
}

.pd-engage-card .pd-engage-stage {
  padding: 16px 22px;
  border-bottom: 1px solid var(--line-2);
}
.pd-engage-card .pd-engage-stage .l {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 6px;
}
.pd-engage-tracker {
  padding: 16px 22px;
  display: grid;
  gap: 4px;
}
.pd-engage-step {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 12px;
  padding: 6px 0;
  position: relative;
}
.pd-engage-step:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 9px;
  top: 22px;
  bottom: -6px;
  width: 2px;
  background: var(--line);
}
.pd-engage-step.done:not(:last-child)::before { background: var(--backer); }
.pd-engage-step .dot {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--line);
  display: grid;
  place-items: center;
  font-size: 8px;
  color: var(--ink-4);
  font-weight: 700;
  position: relative;
  z-index: 1;
}
.pd-engage-step.done .dot {
  background: var(--backer);
  border-color: var(--backer);
  color: #fff;
}
.pd-engage-step.current .dot {
  background: var(--surface);
  border-color: var(--backer);
  color: var(--backer);
  box-shadow: 0 0 0 3px rgba(45,107,102,.15);
}
/* Cancelled / not-progressed terminal marker: paints in the red palette so
   the dot reads in lock-step with the `.pill.red` cancelled status badge. */
.pd-engage-step.cancelled .dot {
  background: var(--red-soft);
  border-color: var(--red-soft);
  color: var(--red);
}
.pd-engage-step .stepbody { padding-top: 1px; }
.pd-engage-step .stepbody b {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 2px;
}
.pd-engage-step.pending .stepbody b { color: var(--ink-3); font-weight: 500; }
.pd-engage-step .stepbody span {
  font-size: 11px;
  color: var(--ink-3);
  font-family: var(--font-mono);
}

/* --- Section anchor nav ---------------------------------- */
.pd-toc {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px;
}
.pd-toc a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-3);
  text-decoration: none;
  transition: background .12s, color .12s;
}
.pd-toc a:hover { background: var(--surface-2); color: var(--ink); }
.pd-toc a.active {
  background: var(--backer-softer);
  color: var(--backer-ink);
  font-weight: 600;
}
.pd-toc a .num {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-4);
  letter-spacing: 0;
  min-width: 18px;
}
.pd-toc a.active .num { color: var(--backer); }

/* ============================================================
   EOI MODAL - Express interest dialog
   Layered on Bootstrap's .modal.fade > .modal-dialog > .modal-content.
   Bootstrap owns positioning, sizing, focus trap, backdrop, and the
   open/close transition. Do not re-introduce position/inset/transform
   rules on .eoi-modal.
   ============================================================ */
.eoi-modal {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 50px 100px -30px rgba(0,0,0,.45), 0 0 0 1px rgba(0,0,0,.04);
  overflow: hidden;
}

/* ── Modal header ── */
.eoi-head {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line-2);
  background: linear-gradient(180deg, var(--backer-softer) 0%, var(--surface) 100%);
}
.eoi-head .ico {
  width: 44px; height: 44px;
  background: var(--backer);
  color: #fff;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-size: 16px;
  box-shadow: 0 6px 14px -6px rgba(45,107,102,.6);
}
.eoi-head .titlebox h2 {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 20px;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 2px;
  line-height: 1.2;
}
.eoi-head .titlebox span {
  display: inline-block;
  font-size: 12px;
  color: var(--ink-3);
  font-family: var(--font-mono);
}
.eoi-close {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 14px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background .12s, color .12s, border-color .12s;
}
.eoi-close:hover { background: var(--surface-2); color: var(--ink); border-color: var(--ink-3); }

/* ── Context strip ── */
.eoi-context {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 22px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line-2);
  font-size: 12px;
}
.eoi-context .item { display: grid; gap: 1px; }
.eoi-context .item .l {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-4);
}
.eoi-context .item .v {
  font-weight: 600;
  color: var(--ink);
  font-size: 12.5px;
}
.eoi-context .sep {
  width: 1px; height: 24px;
  background: var(--line);
}
.eoi-context .right {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
}

/* ── Modal body ── */
.eoi-body {
  padding: 22px;
  overflow-y: auto;
  display: grid;
  gap: 22px;
}
.eoi-section { display: grid; gap: 10px; }
.eoi-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.eoi-section-head h3 {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}
.eoi-section-head h3 .num {
  width: 20px; height: 20px;
  background: var(--backer-soft);
  color: var(--backer);
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  display: grid;
  place-items: center;
}
.eoi-section-head .helper {
  font-size: 11.5px;
  color: var(--ink-3);
}

/* ── Counter-proposal toggle row ── */
.eoi-cp-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px dashed var(--line);
  border-radius: 10px;
  cursor: pointer;
  font-size: 12.5px;
  color: var(--ink-2);
  transition: border-color .12s, background .12s;
}
.eoi-cp-toggle:hover { border-color: var(--ink-4); }
.eoi-cp-toggle.is-disabled { opacity: .45; pointer-events: none; }
.eoi-cp-toggle input { margin: 0; accent-color: var(--backer); }
.eoi-cp-toggle b { color: var(--ink); font-weight: 600; }

/* Choices.js global theme. The vendor choices.min.css now loads BEFORE backer.css
   (each consuming page puts its <link> in {% block head_vendor_css %}, ahead of the
   backer.css <link> in the base layout), so equal-specificity rules win on cascade
   order with NO !important - the same approach already used for the Bootstrap CDN +
   flatpickr theme. A handful of !important are RETAINED where a higher-specificity
   vendor state/variant selector would otherwise win (each noted inline); dropping
   those would regress dark mode / the open-dropdown frame. */
.choices { font-size: 13px; font-family: var(--font-sans); }
.choices__inner { font-size: 13px; }
.choices__list--dropdown .choices__item,
.choices__list[aria-expanded] .choices__item { font-size: 13px; }
/* Open-list hover: subtle brand-green background, ink text (NOT green). The selector
   matches the vendor's own (0,3,0) highlight exactly, so load order decides. */
.choices__list--dropdown .choices__item--selectable.is-highlighted,
.choices__list[aria-expanded] .choices__item--selectable.is-highlighted {
  background-color: var(--backer-soft);
  color: var(--ink);
}
/* Dark-mode-aware text colour: the vendor paints these dark-on-white; re-point to
   ink (which switches per [data-bs-theme]). No vendor colour competitor, so order wins. */
.choices__inner,
.choices__list--dropdown,
.choices__list[aria-expanded],
.choices__list--single .choices__item,
.choices__list--dropdown .choices__item--selectable,
.choices__input,
.choices__input--cloned { color: var(--ink); }
/* Dark-mode-aware surfaces + the Bootstrap-dropdown frame (1px var(--line), 8px
   corners, no shadow - matches the .fbtn dropdowns). The control box keeps
   !important on background + border-radius: the vendor's higher-specificity
   `.choices.is-disabled .choices__inner` (0,2,0) repaints the bg grey, and its
   `.is-open` / `.is-flipped.is-open` rules (0,2,0+) square the corners off - we hold
   the on-surface 8px look in every state. border (colour/width) and the focus
   border-colour have only equal-or-lower vendor competitors, so they win on order. */
.choices__inner {
  background-color: var(--surface) !important;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm) !important;       /* 8px - same as --bs-dropdown-border-radius */
}
/* Input box keeps !important: `.choices[data-type*=select-one] .choices__input` (0,3,0)
   paints it #fff - a white field on the dark theme without this. */
.choices__input,
.choices__input--cloned { background-color: var(--surface) !important; }
.choices__list--dropdown,
.choices__list[aria-expanded] {
  background-color: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm) !important;       /* vendor .is-flipped (0,2,0) squares the corners */
  word-break: normal;                               /* vendor sets break-all - mid-word-breaks long option names */
}
/* Open-dropdown options: neutralise the vendor's 100px right-padding reserve on
   selectable items. That reserve is for the "Press to select" hint we disable
   everywhere via itemSelectText:'' (both IB.initChoices and the one bespoke
   new Choices in saved_searches.html), so it is dead space on every Choices page.
   Equal-specificity to the vendor rule; backer.css loads after, so order wins.
   Keeps the vendor's 10px vertical/left padding. */
.choices__list--dropdown .choices__item--selectable,
.choices__list[aria-expanded] .choices__item--selectable { padding-right: 12px; }
.choices.is-focused .choices__inner,
.choices.is-open .choices__inner {
  border-color: var(--backer);
}
/* Medium (500) weight on Choices controls/options (no vendor competitor). */
.pf-field .choices .choices__inner,
.pf-field .choices .choices__item,
#expressInterestModal .choices .choices__inner,
#expressInterestModal .choices .choices__item { font-weight: 500; }
/* Choices.js inside the Express Interest modal - match the wizard field chrome. */
#expressInterestModal .choices { margin-bottom: 0; min-width: 0; }
#expressInterestModal .choices__inner {
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
  min-height: 38px; padding: 4px 30px 4px 11px; font-size: 13px; font-weight: 400; line-height: 1.35;
}
#expressInterestModal .choices.is-focused .choices__inner,
#expressInterestModal .choices.is-open .choices__inner { border-color: var(--backer); box-shadow: 0 0 0 3px rgba(45,107,102,.12); }
#expressInterestModal .choices__list--single { padding: 4px 0; }
#expressInterestModal .choices__list--single .choices__item { color: var(--ink); }
#expressInterestModal .choices input.choices__input { background: transparent; border: 0; box-shadow: none; padding: 2px 0; font-size: 13px; color: var(--ink); }
#expressInterestModal .choices[data-type*=select-one]::after { right: 12px; }
/* Theme the open dropdown with surface/ink tokens so options (incl. disabled,
   e.g. Partial on a non-club component) stay legible in dark mode. */
#expressInterestModal .choices__list--dropdown { background: var(--surface); border-color: var(--line); }
#expressInterestModal .choices__list--dropdown .choices__item { color: var(--ink); }
#expressInterestModal .choices__list--dropdown .choices__item--disabled { color: var(--ink-4); opacity: 1; }

/* Multi-party financing: per-requirement offer cards (Express Interest modal) */
.eoi-offers { display: grid; gap: 8px; }
.eoi-offer { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); overflow: visible; position: relative; }
/* Open dropdowns must overlay the sibling cards / rows below them. */
#expressInterestModal .choices__list--dropdown { z-index: 40; }
#expressInterestModal .eoi-offer:has(.choices.is-open),
#expressInterestModal .eoi-propose-row:has(.choices.is-open) { position: relative; z-index: 20; }
.eoi-offer.is-on { border-color: var(--backer-soft); box-shadow: 0 0 0 3px var(--backer-softer); }
.eoi-offer-head { display: flex; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer; margin: 0; }
.eoi-offer-head input { display: none; }
.eoi-offer-head .check {
  flex: none; width: 20px; height: 20px; border-radius: 6px;
  border: 1.5px solid var(--line-2); background: var(--surface);
  position: relative; transition: background .12s, border-color .12s;
}
.eoi-offer-head input:checked + .check { background: var(--backer); border-color: var(--backer); }
.eoi-offer-head input:checked + .check::after {
  content: ''; position: absolute; left: 6px; top: 2px;
  width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.eoi-offer-sum { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.eoi-offer-sum .cat-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink); }
.eoi-offer-sum .cat-chip .sw { width: 10px; height: 10px; border-radius: 3px; background: var(--c, var(--ink-4)); }
.eoi-offer-meta { font-size: 12px; color: var(--ink-3); font-family: var(--font-mono); }
.eoi-club { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 10.5px; font-weight: 600; font-family: var(--font-sans); background: var(--green-soft); color: var(--green); }
.eoi-offer-fields { padding: 0 14px 14px; border-top: 1px solid var(--line-2); }
.eoi-offer-grid { display: grid; grid-template-columns: 1fr 1.4fr 1fr; gap: 10px; padding-top: 12px; }
.eoi-ff { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.eoi-ff > label, .eoi-offer-note-wrap > label, .eoi-offer-pricing-wrap > label {
  font-size: 10px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3);
}
.eoi-ff > label .opt, .eoi-offer-note-wrap > label .opt, .eoi-offer-pricing-wrap > label .opt { text-transform: none; letter-spacing: 0; color: var(--ink-4); font-weight: 400; }
.eoi-offer-fields select,
.eoi-offer-fields input[type=text],
.eoi-offer-fields textarea {
  width: 100%; padding: 9px 12px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 8px; font-family: inherit; font-size: 13px; color: var(--ink);
  outline: none; transition: border-color .12s, box-shadow .12s;
}
.eoi-offer-fields select {
  -webkit-appearance: none; appearance: none; padding-right: 30px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'><path d='M3 4.5L6 7.5L9 4.5' stroke='%236a7570' stroke-width='1.4' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 12px 12px;
}
.eoi-offer-fields select:focus,
.eoi-offer-fields input:focus,
.eoi-offer-fields textarea:focus { border-color: var(--backer); box-shadow: 0 0 0 3px var(--backer-softer); }
.eoi-offer-note-wrap,
.eoi-offer-pricing-wrap { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; }
.eoi-offer-fields input:disabled { background: var(--surface-2); color: var(--ink-3); cursor: not-allowed; }
/* Live character counter under note fields (mirrors the message-field counter). */
.eoi-cc { font-size: 11px; color: var(--ink-4); font-family: var(--font-mono); align-self: flex-end; }
/* Locked component card when the investor has switched to the propose-your-own path. */
.eoi-offer.is-locked { opacity: .45; }
.eoi-offer.is-locked .eoi-offer-head { cursor: not-allowed; }
/* Restructuring-counter rows: top line (category / instrument / amount / remove) + rationale on its own row */
.eoi-propose-row { margin-bottom: 12px; }
.eoi-propose-row + .eoi-propose-row { border-top: 1px solid var(--line-2); padding-top: 12px; }
.eoi-propose-top { display: grid; grid-template-columns: 1.3fr 1.5fr 1fr 28px; gap: 8px; align-items: center; }
.eoi-propose-note { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.eoi-propose-note .cp-note { flex: 1; }
.eoi-propose-row select,
.eoi-propose-row input {
  width: 100%; padding: 9px 12px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 8px; font-family: inherit; font-size: 13px; color: var(--ink); outline: none;
  transition: border-color .12s, box-shadow .12s;
}
.eoi-propose-row select {
  -webkit-appearance: none; appearance: none; padding-right: 30px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'><path d='M3 4.5L6 7.5L9 4.5' stroke='%236a7570' stroke-width='1.4' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 12px 12px;
}
.eoi-propose-row select:focus,
.eoi-propose-row input:focus { border-color: var(--backer); box-shadow: 0 0 0 3px var(--backer-softer); }
.eoi-propose-row .rm { width: 28px; height: 28px; border: none; background: transparent; color: var(--ink-4); cursor: pointer; border-radius: 6px; }
.eoi-propose-row .rm:hover { color: var(--red); background: var(--red-soft); }

.eoi-cp-rows {
  margin-top: 12px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
}
/* Visibility controlled by Bootstrap's .d-none on #counterProposalSection;
   the JS toggles d-none, not a custom .visible class. */
.eoi-cp-row {
  display: grid;
  grid-template-columns: 1.4fr 1.4fr 1.2fr .8fr 28px;
  gap: 8px;
  margin-bottom: 8px;
  align-items: center;
}
.eoi-cp-row select,
.eoi-cp-row input {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
  font-family: inherit;
  font-size: 12.5px;
  color: var(--ink);
  outline: none;
  transition: border-color .12s, box-shadow .12s;
}
.eoi-cp-row select:focus,
.eoi-cp-row input:focus {
  border-color: var(--backer);
  box-shadow: 0 0 0 3px var(--backer-softer);
}
.eoi-cp-row .pct-out {
  font-family: var(--font-mono);
  background: var(--surface-2);
  color: var(--ink-3);
  text-align: center;
}
/* Pin Choices.js wrapper to 36px and clear its 24px bottom margin so wrapped selects line up with plain inputs in the row grid. */
.eoi-cp-row .choices { margin-bottom: 0; min-width: 0; }
.eoi-cp-row .choices__inner {
  min-height: 36px !important;
  height: 36px;
  padding: 0 26px 0 10px !important;
  background: var(--surface) !important;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 400 !important;
  line-height: 1 !important;
  display: flex;
  align-items: center;
}
.eoi-cp-row .choices[data-type*=select-one] .choices__inner { padding-bottom: 0 !important; }
.eoi-cp-row .choices__list--single {
  padding: 0;
  width: 100%;
  display: flex;
  align-items: center;
}
.eoi-cp-row .choices__list--single .choices__item {
  font-size: 12.5px;
  line-height: 1;
}
.eoi-cp-row .choices[data-type*=select-one]::after { right: 10px; margin-top: -2px; }
.eoi-cp-row .rm {
  width: 28px; height: 28px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-4);
  cursor: pointer;
  font-size: 11px;
  transition: color .12s, background .12s, border-color .12s;
}
.eoi-cp-row .rm:hover { color: var(--red); background: var(--red-soft); border-color: rgba(169,68,46,.2); }
.eoi-cp-add {
  margin-top: 4px;
  background: none;
  border: none;
  color: var(--backer);
  font-weight: 600;
  font-size: 12.5px;
  cursor: pointer;
  padding: 6px 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.eoi-cp-add:hover { color: var(--backer-ink); }

/* ── Message field ── */
.eoi-msg-wrap { position: relative; }
.eoi-msg {
  width: 100%;
  min-height: 88px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-family: inherit;
  font-size: 13px;
  color: var(--ink);
  resize: vertical;
  outline: none;
  transition: border-color .12s, box-shadow .12s;
  line-height: 1.5;
}
.eoi-msg:focus {
  border-color: var(--backer);
  box-shadow: 0 0 0 3px var(--backer-softer);
}
.eoi-msg-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  font-size: 11px;
  color: var(--ink-3);
}
.eoi-msg-foot .count { font-family: var(--font-mono); }

/* ── Modal footer ── */
.eoi-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 22px;
  border-top: 1px solid var(--line-2);
  background: var(--surface-2);
}
.eoi-foot .legal {
  font-size: 11px;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: 6px;
}
.eoi-foot .legal i { color: var(--backer); }
.eoi-foot .right { display: flex; gap: 8px; }
.eoi-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 16px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background .12s, border-color .12s, color .12s, transform .1s;
}
.eoi-btn-ghost {
  background: transparent;
  color: var(--ink-3);
  border-color: var(--line);
}
.eoi-btn-ghost:hover { color: var(--ink); border-color: var(--ink-3); }
.eoi-btn-primary {
  background: var(--backer);
  color: #fff;
  border-color: var(--backer);
  box-shadow: 0 1px 0 rgba(0,0,0,.04), 0 8px 18px -10px rgba(45,107,102,.55);
}
.eoi-btn-primary:hover { background: var(--backer-ink); border-color: var(--backer-ink); transform: translateY(-1px); }

/* --- EOI empty state (no listed components) -------------- */
.eoi-empty {
  padding: 14px 16px;
  background: var(--surface-2);
  border: 1px dashed var(--line);
  border-radius: 10px;
  font-size: 12.5px;
  color: var(--ink-3);
}

/* --- EOI inline validation alert ------------------------- */
/* Hidden via Bootstrap's .d-none on #eoiValidationError; the JS toggles
   d-none. The display: flex below is the visible state - Bootstrap's
   `.d-none { display: none !important }` overrides it when hidden. */
.eoi-error {
  display: flex;
  gap: 8px;
  padding: 10px 14px;
  background: var(--amber-soft);
  border: 1px solid rgba(176,126,42,.25);
  border-radius: 8px;
  color: var(--amber);
  font-size: 12.5px;
  align-items: center;
}
.eoi-error i { font-size: 14px; }

/* Project Detail responsive */
@media (max-width: 720px) {
  .eoi-context { flex-wrap: wrap; gap: 10px 16px; }
  .eoi-context .right { margin-left: 0; }
  .eoi-cp-row { grid-template-columns: 1fr 1fr; gap: 6px; }
  .eoi-cp-row .rm { grid-column: 2; justify-self: end; }
}

@media (max-width: 1100px) {
  .pd-layout { grid-template-columns: 1fr; }
  .pd-aside-inner { position: static; }
  .pd-kv-grid { grid-template-columns: repeat(2, 1fr); }
  /* Aside (CTA + metrics + TOC + engagement tracker) stacks ABOVE main when
     the layout collapses to a single column. */
  .pd-main { order: 1; }
  .pd-aside { order: 0; }
}
@media (max-width: 700px) {
  .pd-hero { flex-direction: column; }
  /* Keep action buttons at their intrinsic size - do NOT stretch them across
     the full hero width when it collapses. */
  .pd-hero-actions { align-self: stretch; align-items: flex-end; }
  .pd-hero-actions .row { justify-content: flex-end; flex-wrap: wrap; }
}
@media (max-width: 680px) {
  .pd-dr-grid { grid-template-columns: 1fr; }
  .pd-kv-grid { grid-template-columns: 1fr; }
}

/* --- EOI deadline closed state ----------------------------------------- */
.pd-metric-deadline.closed { background: var(--surface-2); }
.pd-metric-deadline.closed .l { color: var(--ink-4); }

.pd-cta-d.closed { background: var(--surface-2); border-color: var(--line); }
.pd-cta-d.closed .pd-cta-d-ico { background: var(--ink-4); }
.pd-cta-d.closed .pd-cta-d-eyebrow { color: var(--ink-3); }
.pd-cta-d.closed .pd-cta-d-msg {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-2);
  margin: 0 0 14px;
}
.pd-cta-d.closed .pd-cta-d-btn[disabled] {
  opacity: .55;
  cursor: not-allowed;
  pointer-events: none;
}
.pd-cta-d.closed .pd-cta-d-btn.secondary {
  background: transparent;
  color: var(--ink-2);
  border: 1px solid var(--line);
  margin-top: 8px;
}
.pd-cta-d.closed .pd-cta-d-btn.secondary:hover {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--ink-3);
}

/* Hero "Closed for new EOIs" pill - sits inside .pd-hero-actions .row */
.pd-hero-closed-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink-3);
  border: 1px solid var(--line);
}

/* Closed state of the deadline metric tile renders a single value line */
.pd-metric-deadline.closed .v {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-3);
}


/* =====================================================================
   18. PAGE: ORGANISATIONS DIRECTORY (.dx-*, .active-filters)
   ---------------------------------------------------------------------
   Page-scoped chrome for /organisations. Reuses .em-table, .em-pcell,
   .em-status, .em-cta, .em-when, .em-mono, .em-view-toggle, .empty,
   .bp-toolbar, .bp-search, .fbtn, .service-chips .chip, .flag .fc,
   and .row-actions / .save-btn from earlier sections. Only the genuinely
   new components live here:
     - .dx-tabs / .dx-tab (audience pill tabs with count badges)
     - .dx-cards / .dx-card (org-grid with role-specific .inv-meta rows)
     - .vfd inline verified tick after the org name (list + card)
     - .active-filters strip (promoted as a general component)
   ===================================================================== */

/* ---- Audience tab strip ---- */
.dx-tabs {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.dx-tab {
  background: none; border: 1px solid transparent; cursor: pointer;
  padding: 7px 12px; border-radius: 8px;
  font-size: 13px; font-weight: 500; color: var(--ink-3);
  display: inline-flex; align-items: center; gap: 8px;
  font-family: inherit;
  text-decoration: none;
  transition: background .12s, color .12s, border-color .12s;
}
.dx-tab:hover { color: var(--ink-2); background: var(--surface-2); }
.dx-tab.on {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
  font-weight: 600;
  box-shadow: var(--shadow-card);
}
.dx-tab .num {
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  background: var(--surface-2); color: var(--ink-3);
  padding: 1px 7px; border-radius: 4px; letter-spacing: 0;
}
.dx-tab.on .num { background: var(--backer-soft); color: var(--backer-ink); }
.dx-tabs .spacer { flex: 1; }

/* ---- Org-cell extensions on .em-pcell ---- */
/* Monogram glyph variant - used when an org has no FA icon. Five tone cycles. */
.em-pcell .glyph.monogram {
  font-size: 12px; font-weight: 700; letter-spacing: .02em;
  border: 1px solid rgba(0,0,0,.04);
}
.em-pcell .glyph.monogram.blue  { background: var(--blue-soft);  color: var(--blue); }
.em-pcell .glyph.monogram.amber { background: var(--amber-soft); color: var(--amber); }
.em-pcell .glyph.monogram.plum  { background: var(--plum-soft);  color: var(--plum); }
.em-pcell .glyph.monogram.green { background: var(--green-soft); color: var(--green); }
.em-pcell .glyph.monogram.teal  { background: var(--backer-soft); color: var(--backer-ink); }

/* Verified-organisation mark - inline green tick after the org name in both the
   list row (.pname) and the card (.dx-card-name). Sourced from the admin
   is_verified toggle; mirrors the admin org-table idiom (.org-table .nm .verified).
   Its own colour wins over the inherited link colour on hover. */
.em-pcell .pname .vfd,
.dx-card .dx-card-name .vfd {
  color: var(--green);
  font-size: 12px;
  margin-left: 5px;
  vertical-align: baseline;
}

/* Type pill colour map (extends .em-status). */
.em-status.investor  { background: var(--blue-soft);  color: var(--blue); }
.em-status.advisor   { background: var(--plum-soft);  color: var(--plum); }
.em-status.developer { background: var(--backer-soft); color: var(--backer-ink); }
.em-status.bank,
.em-status.dfi,
.em-status.government,
.em-status.researcher,
.em-status.other { background: var(--surface-2); color: var(--ink-3); }

/* ---- Active-filters strip (promoted as a general component) ---- */
.active-filters {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin: -4px 0 14px;
  font-size: 12px; color: var(--ink-3);
}
.active-filters .lbl {
  font-size: 10.5px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--ink-3);
}
.active-filters .chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 6px 4px 10px;
  border-radius: 999px;
  background: var(--backer-soft); color: var(--backer-ink);
  font-size: 12px; font-weight: 600;
}
.active-filters .chip .rm,
.active-filters .chip button {
  width: 18px; height: 18px; border-radius: 50%;
  border: none; background: none; color: var(--backer-ink);
  display: grid; place-items: center;
  cursor: pointer; font-size: 9px;
  opacity: .65;
  text-decoration: none;
}
.active-filters .chip .rm:hover,
.active-filters .chip button:hover { opacity: 1; background: rgba(0,0,0,.05); color: var(--backer-ink); }
.active-filters .clear {
  margin-left: auto;
  background: none; border: none; cursor: pointer;
  font-family: inherit; font-size: 12px; color: var(--ink-3);
}
.active-filters .clear:hover { color: var(--ink); text-decoration: underline; }

/* Small uppercase eyebrow used inline inside .em-pcell .psub on the directory
   list view (precedes a headline value, separated by a .dot). Matches .cap
   visually but omits the bottom margin so it stays inline in a flex row. */
.dx-headline-cap {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* ---- Card grid ---- */
/* `grid-template-columns` (the fluid 330px-min, capped-at-3 track) is shared
   with `.ib-card-grid` - see the card-view block earlier in this file. Only the
   directory-specific deltas live here. `width: 100%` keeps the grid filling the
   `.ib-card-view` wrapper rather than shrinking to content width. */
.dx-cards {
  display: grid;
  gap: 16px;
  margin-bottom: 22px;
  width: 100%;
}
/* Stretch the card down to match the tallest sibling in its grid row. The
   grid already stretches `.ib-card-item` (the wrapper used by list.js), but
   `.dx-card` inside it would otherwise size to its own content and short-fall
   on advisor cards (2 .inv-meta rows) when sat next to investor / developer
   cards (3 rows) on the All tab. */
.dx-cards > .ib-card-item { display: flex; }
.dx-cards > .ib-card-item > .dx-card { flex: 1; width: 100%; }

/* ---- Org card ---- */
.dx-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-card);
  display: flex; flex-direction: column;
  position: relative;
  overflow: hidden;
  transition: border-color .12s, box-shadow .12s;
}
.dx-card:hover {
  border-color: var(--backer);
  box-shadow: 0 4px 12px rgba(0,0,0,.06);
}
.dx-card .dx-card-body {
  padding: 18px 20px 14px;
  flex: 1;
}
/* Title link - sits inside <h3>, inherits typography but suppresses underline. */
.dx-card .dx-card-name {
  color: var(--ink);
  text-decoration: none;
}
.dx-card .dx-card-name:hover { color: var(--backer); }
/* Save heart - matches .pc-save (browse_projects card chrome). */
.dx-card .dx-card-save {
  position: absolute;
  top: 12px; right: 12px;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .92);
  border: none;
  color: var(--ink-3);
  display: grid; place-items: center;
  font-size: 12px;
  cursor: pointer;
  z-index: 2;
  transition: color .12s, background .12s;
}
.dx-card .dx-card-save:hover { color: var(--red); background: #fff; }
.dx-card .dx-card-save.on { color: var(--red); }
[data-bs-theme="dark"] .dx-card .dx-card-save {
  background: rgba(0, 0, 0, .35);
}
[data-bs-theme="dark"] .dx-card .dx-card-save:hover { background: rgba(0, 0, 0, .55); }
.dx-card .card-top {
  display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px;
  padding-right: 40px;  /* leave room for the heart */
}
.dx-card .logo {
  width: 44px; height: 44px; border-radius: 10px;
  display: grid; place-items: center;
  font-size: 14px; font-weight: 700; letter-spacing: .02em;
  flex-shrink: 0;
  border: 1px solid rgba(0,0,0,.04);
}
.dx-card .logo.blue  { background: var(--blue-soft);  color: var(--blue); }
.dx-card .logo.amber { background: var(--amber-soft); color: var(--amber); }
.dx-card .logo.plum  { background: var(--plum-soft);  color: var(--plum); }
.dx-card .logo.green { background: var(--green-soft); color: var(--green); }
.dx-card .logo.teal  { background: var(--backer-soft); color: var(--backer-ink); }
.dx-card .ttl { flex: 1; min-width: 0; }
.dx-card h3 {
  font-size: 14.5px; font-weight: 600; color: var(--ink);
  margin: 0; line-height: 1.3;
  word-break: break-word;
}
.dx-card .meta {
  font-size: 11.5px; color: var(--ink-3);
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
  margin-top: 3px;
}
.dx-card .meta .dot { width: 2px; height: 2px; border-radius: 50%; background: var(--ink-4); }
.dx-card .blurb {
  font-size: 12.5px; color: var(--ink-2); line-height: 1.5;
  margin: 0 0 14px;
  /* Fixed 2-line slot. We deliberately avoid `-webkit-box` + line-clamp here
     because that display mode collapses to its content height and ignores
     `height` / `min-height`, so 1-line descriptions render shorter than the
     reserved slot. `truncate(200)` upstream keeps content short; the rare
     3rd line is clipped by `overflow: hidden`. Cards with no description
     render an `<span class="unset">Not specified</span>` placeholder. */
  height: 38px;
  overflow: hidden;
}

/* Role-specific labelled rows.
   Advisor cards only have 2 rows (Services, Jurisdictions) vs 3 on investor /
   developer cards (Ticket/Mandate/Geography and Sectors/Sub-sectors/Geography).
   The min-height reserves space for a phantom 3rd row so advisor cards on the
   advisor-only tab don't render visibly shorter than the same cards in mixed
   rows on the All tab. (3 rows × 22px + 2 × 10px gap + 14px padding ≈ 100px.) */
.dx-card .inv-meta {
  display: grid; gap: 10px;
  padding: 10px 0 4px;
  border-top: 1px solid var(--line-2);
  margin-bottom: 4px;
  min-height: 100px;
  align-content: start;
}
.dx-card .inv-meta .row {
  display: grid; grid-template-columns: 84px 1fr; gap: 12px;
  align-items: baseline;
  min-height: 22px;
}
.dx-card .inv-meta .l {
  font-size: 9.5px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-3);
}
.dx-card .inv-meta .v {
  font-size: 12.5px; color: var(--ink); font-weight: 500;
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px;
  min-width: 0;
}
.dx-card .inv-meta .v.mono { font-family: var(--font-mono); font-size: 13px; }
/* "Not specified" placeholder - same font, weight, size and tone regardless
   of whether the parent `.v` is sans (Mandate, Geography, Services, ...) or
   `.v.mono` (Ticket). Without the explicit font-family override the mono
   parent inherits Fira Mono and reads visibly different from the rest. */
.dx-card .inv-meta .v .unset,
.dx-card .inv-meta .v.mono .unset,
.dx-card .blurb .unset {
  color: var(--ink-4);
  font-family: var(--font-sans);
  font-style: italic;
  font-weight: 400;
  font-size: 12px;
}
.dx-card .inv-meta .v .more {
  font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-3);
  padding: 2px 6px; border-radius: 999px;
  border: 1px dashed var(--line);
  background: transparent;
}

/* Card foot - mirrors .pc-foot from browse_projects (full-width banded
   footer with .meta strip on the left and the view-profile eye link on
   the right). All children share a single 28px vertical centreline. */
.dx-card .card-foot {
  padding: 8px 16px;
  border-top: 1px solid var(--line-2);
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
}
.dx-card .card-foot > * { align-self: center; }
.dx-card .card-foot .meta {
  display: flex; align-items: center; gap: 12px;
  color: var(--ink-3);
  font-size: 11.5px;
  line-height: 1;
  flex-wrap: nowrap;
}
.dx-card .card-foot .meta span {
  display: inline-flex; align-items: center; gap: 5px; line-height: 1;
}
.dx-card .card-foot .meta i { color: var(--ink-4); font-size: 11px; line-height: 1; }
.dx-card .card-foot .meta b { line-height: 1; }
.dx-card .card-foot .meta .clock i { color: var(--backer); }
.dx-card .card-foot .meta .engagements.on { color: var(--backer-ink); font-weight: 500; }
.dx-card .card-foot .meta .engagements.on b { color: var(--backer); font-weight: 700; }
.dx-card .card-foot .meta .engagements.on i { color: var(--backer); }
.dx-card .card-foot .view {
  width: 28px; height: 28px;
  border-radius: 7px;
  color: var(--backer);
  display: inline-grid; place-items: center;
  font-size: 12px;
  text-decoration: none;
  flex-shrink: 0;
  transition: background .12s, color .12s;
}
.dx-card .card-foot .view:hover { background: var(--backer-soft); color: var(--backer-ink); }

/* Directory list rows are NOT wholly clickable - only the .pname link
   and the .row-actions buttons are interactive. Override the .em-table
   inherited cursor + hover-tint so rows don't look like buttons. */
#organisationsDirectoryTable tbody tr { cursor: default; }
#organisationsDirectoryTable tbody tr:hover { background: transparent; }

/* Mini chip used inside .dx-card .inv-meta value rows. Tighter than
   .service-chips because the value column shares 84px with the row label. */
.dx-mini-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: 999px;
  background: var(--surface-2); color: var(--ink-2);
  font-size: 11px; font-weight: 500;
  border: 1px solid var(--line-2);
}

/* Geography .flag tweaks for the directory table cell. */
.flag .lbl { color: var(--ink-2); font-size: 12px; }
.flag.dx-flag-multi .lbl { color: var(--ink-3); font-size: 11.5px; }

/* ---- In-cell chip cluster (sector coverage column) ---- */
.dx-cell-chips {
  display: inline-flex; flex-wrap: wrap; gap: 5px;
  align-items: center; max-width: 220px;
}
.dx-cell-chips .chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 11px; font-weight: 500;
  border: 1px solid var(--line-2);
}
.dx-cell-chips .chip .ico { color: var(--backer); font-size: 7px; }
.dx-cell-chips .more {
  font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-3);
  padding: 2px 6px; border-radius: 999px;
  border: 1px dashed var(--line);
}

/* Em-dash for non-applicable cells */
.dx-cell-na { color: var(--ink-4); }

/* Responsive: at narrower widths, hide the Joined column for breathing room */
@media (max-width: 1100px) {
  .em-table .col-joined { display: none; }
}


/* =====================================================================
   19. PAGE: SAVED SEARCHES (.ss-*)
   ===================================================================== */

/* Summary strip - aggregate stats card pinned above the form/cards list.
   Mirrors the outcome-strip pattern from *_summary pages. Goes on a
   .card-body so it inherits .card's chrome but overrides the default column
   flex-direction inherited from .card. */
.ss-summary { margin-bottom: 18px; }
.ss-summary-body {
  display: flex !important;
  flex-direction: row;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 14px var(--card-pad) !important;
}
.ss-summary-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1 1 280px;
}
.ss-summary-ico {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--backer-soft);
  color: var(--backer);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 15px;
}
.ss-summary-head {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.ss-summary-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
}
.ss-summary-sub {
  font-size: 11.5px;
  color: var(--ink-3);
  margin-top: 2px;
}
.ss-summary-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.ss-summary-pills .pill strong { font-weight: 600; }

/* Page-head form-toggle close button - lives in .pf-panel-head, pushed right. */
.ss-form-head-close { margin-left: auto; }

/* Section heading row between the form and the cards list. */
.ss-section-head {
  margin: 28px 0 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ss-section-head h2 {
  font-size: 22px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -.015em;
  margin: 0;
}
.ss-section-head .ss-section-sub {
  font-size: 13px;
  color: var(--ink-3);
  margin: 0;
}

/* Saved-search card row - full-width, 2-column internal grid (body + rail). */
.ss-card {
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 0;
  margin-bottom: 14px;
  overflow: hidden;
}
.ss-card-body {
  padding: 18px 22px;
  min-width: 0;
}
.ss-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.ss-card-title {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  margin: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ss-card-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.ss-card-chips .pill.ghost i { font-size: 9px; color: var(--ink-4); }
.ss-card-chips .pill.mono { font-family: var(--font-mono); }
.ss-card-meta {
  font-size: 11.5px;
  color: var(--ink-3);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.ss-card-meta .sep { color: var(--ink-4); }
.ss-card-meta .new-dot i {
  font-size: 6px;
  color: var(--green);
  margin-right: 4px;
  vertical-align: middle;
}

/* Right rail - match-count stat, View link, icon actions. */
.ss-card-rail {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border-left: 1px solid var(--line-2);
  background: var(--surface-2);
  min-width: 180px;
}
.ss-card-rail-stat { text-align: center; }
.ss-card-rail-stat .n {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -.01em;
  line-height: 1;
}
.ss-card-rail-stat .l {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-top: 4px;
}
.ss-card-rail-view {
  font-size: 12px;
  padding: 4px 8px;
}
.ss-card-rail-view i {
  margin-left: 4px;
  margin-right: 0;
  font-size: 9px;
}
.ss-card-rail-actions {
  display: flex;
  gap: 4px;
}
.ss-card-rail-actions form { display: inline; }
.ss-card-rail-actions .btn-icon.is-muted { color: var(--backer); }
.ss-card-rail-actions .btn-icon.ss-danger:hover {
  background: var(--red-soft);
  color: var(--red);
}

/* Muted + zero-match modifier states. */
.ss-card.muted { opacity: .82; }
.ss-card.muted .ss-card-rail-stat .n { color: var(--ink-4); }
.ss-card.zero .ss-card-rail-stat .n { color: var(--ink-4); }
.ss-card.zero .ss-card-rail-view {
  color: var(--ink-4);
  pointer-events: none;
}

/* Amber-soft "broaden criteria" hint, only rendered when match count is 0. */
.ss-card-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--amber-soft);
  color: var(--ink-2);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12.5px;
  line-height: 1.5;
  margin-bottom: 12px;
}
.ss-card-hint i {
  color: var(--amber);
  font-size: 11px;
  flex-shrink: 0;
}
.ss-card-hint .btn-text {
  font-size: 12.5px;
  padding: 0;
  line-height: inherit;
  vertical-align: baseline;
}

/* Responsive: under 900px the rail collapses underneath the body as a
   horizontal strip with a top border instead of a left border. */
@media (max-width: 900px) {
  .ss-card { grid-template-columns: 1fr; }
  .ss-card-rail {
    border-left: 0;
    border-top: 1px solid var(--line-2);
    flex-direction: row;
    justify-content: flex-start;
    min-width: 0;
    padding: 12px 18px;
    gap: 14px;
  }
  .ss-card-rail-stat {
    display: flex;
    align-items: baseline;
    gap: 6px;
    text-align: left;
  }
  .ss-card-rail-stat .n { font-size: 20px; }
  .ss-card-rail-stat .l { margin-top: 0; }
  .ss-card-rail-view { margin-left: auto; }
}
@media (max-width: 560px) {
  .ss-card-rail { flex-direction: column; align-items: stretch; }
  .ss-card-rail-view { width: 100%; margin-left: 0; text-align: center; }
  .ss-card-rail-actions { justify-content: center; }
  .ss-summary-body { flex-direction: column; align-items: flex-start; gap: 12px; }
  .ss-summary-pills { width: 100%; }
}


/* =====================================================================
   20. PAGE: ADMIN
   Ported from references/mocks/{overview,users,organisations,activity,
   lookups}.html. Most rules are page-scoped under #admin-page so they
   can't leak into other pages that use the same selectors (.pager,
   .kv-row, .row-actions etc. all exist globally with different chrome).
   ===================================================================== */

#admin-page { --row-gap: 14px; }

/* ── 20A. Shared admin chrome ──────────────────────────────────────────── */

/* Status tab cards used by Users + Organisations pages */
#admin-page .stat-tabs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}
#admin-page .stat-tabs.tabs-4 { grid-template-columns: repeat(4, 1fr); }
#admin-page .stat-tabs.tabs-6 { grid-template-columns: repeat(6, 1fr); }
#admin-page .stat-tab {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  cursor: pointer;
  transition: all .12s;
  text-decoration: none;
  color: inherit;
  display: block;
  position: relative;
}
#admin-page .stat-tab:hover { background: var(--backer-softer); }
#admin-page .stat-tab.on,
#admin-page .stat-tab.on:hover {
  border-color: var(--backer);
  background: var(--surface);
}
#admin-page .stat-tab .lbl {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: 6px;
}
#admin-page .stat-tab .lbl .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink-4);
  display: inline-block;
}
#admin-page .stat-tab.amber .lbl .dot { background: var(--amber); }
#admin-page .stat-tab.green .lbl .dot { background: var(--green); }
#admin-page .stat-tab.red   .lbl .dot { background: var(--red); }
#admin-page .stat-tab.blue  .lbl .dot { background: var(--blue); }
#admin-page .stat-tab .v {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 24px;
  line-height: 1;
  margin-top: 8px;
  color: var(--ink);
  letter-spacing: -0.01em;
}
#admin-page .stat-tab .sub {
  font-size: 11px;
  color: var(--ink-3);
  margin-top: 4px;
  font-family: var(--font-mono);
}

/* Users page: org cell typography mirrors .user-cell - bold name + grey
   country sub-line. */
#admin-page .u-table td.org-cell .org-link { text-decoration: none; }
#admin-page .u-table td.org-cell .org-link b {
  font-size: 13px;
  color: var(--ink);
  font-weight: 500;
}
#admin-page .u-table td.org-cell .org-link:hover b { color: var(--backer); }
#admin-page .u-table td.org-cell .org-sub {
  font-size: 11.5px;
  color: var(--ink-3);
  line-height: 1.3;
  margin-top: 2px;
}

/* Clear-filters link sits inside .fbar - vertically aligned with .fbtn (36px). */
#admin-page .bp-clear-filters {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 8px;
  font-size: 12.5px;
  color: var(--ink-3);
  text-decoration: none;
  background: transparent;
  border: 0;
}
#admin-page .bp-clear-filters:hover { color: var(--ink); }

/* Manage-user modal: section labels + account-actions grid. */
#editUserModal .admin-section-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 12px;
}
#editUserModal .admin-section-actions {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line-2);
}
#editUserModal .admin-actions-grid {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}
#editUserModal .admin-act-btn {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  font-weight: 500;
  text-align: left;
}
#editUserModal .admin-act-btn i { width: 14px; text-align: center; }
#editUserModal .admin-act-btn[hidden] { display: none; }

/* Bulk action bar (selected-row toolbar).
   Light card-style surface to match the admin toolbar above it. Brand-tinted
   left border serves as the "active selection" cue. */
#admin-page .bulk-bar {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-left: 3px solid var(--backer);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  box-shadow: var(--shadow-card);
}
#admin-page .bulk-bar .count {
  background: var(--backer-soft);
  color: var(--backer-ink);
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 600;
  font-family: var(--font-mono);
  font-size: 12px;
  white-space: nowrap;
}
#admin-page .bulk-bar .label {
  font-size: 11.5px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  white-space: nowrap;
}
#admin-page .bulk-bar .spacer { flex: 1; }
#admin-page .bulk-bar button {
  background: var(--surface);
  color: var(--ink-2);
  border: 1px solid var(--line);
  padding: 6px 11px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background .12s, border-color .12s, color .12s;
}
#admin-page .bulk-bar button:hover {
  background: var(--backer-soft);
  border-color: var(--backer);
  color: var(--backer-ink);
}
#admin-page .bulk-bar button.danger { color: var(--red); border-color: var(--red-soft); }
#admin-page .bulk-bar button.danger:hover {
  background: var(--red-soft);
  border-color: var(--red);
  color: var(--red);
}
#admin-page .bulk-bar button.clear {
  border-color: transparent;
  background: transparent;
  color: var(--ink-3);
}
#admin-page .bulk-bar button.clear:hover { background: var(--surface-2); color: var(--ink); }
/* Disabled (e.g. Approve / Reactivate with no eligible verified row selected).
   pointer-events stay on so the explanatory title tooltip still shows. */
#admin-page .bulk-bar button:disabled { opacity: .42; cursor: not-allowed; }
#admin-page .bulk-bar button:disabled:hover {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink-2);
}
#admin-page .bulk-bar .divider {
  width: 1px;
  height: 22px;
  background: var(--line);
  margin: 0 2px;
}

/* Admin pages use the canonical global `.pager` token (tight 4px button cluster) -
   no page-scoped override. The old `#admin-page .pager` rule (space-between / gap:0 /
   padding) dated from the removed `.pag-buttons` era when `.pager` was the OUTER
   count+buttons bar; the admin_pager macro now supplies its own `d-flex
   justify-content-between` wrapper, so that override only distorted the button cluster
   (spread out + touching numbers) versus every other Family-1 pager. Removed 2026-06-05.
   `.pag-buttons` legacy cluster was removed 2026-06-04 when admin_activity migrated to
   the canonical `.pager` + `<ul class="pagination">` family (admin_pager macro). */

/* Row-action button class. Composes with the existing global .row-actions
   container (section 8). The mocks redeclared .row-actions identically;
   only the .ra-btn child class is new. */
#admin-page .row-actions .ra-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
  display: grid;
  place-items: center;
  font-size: 11px;
  color: var(--ink-3);
  cursor: pointer;
}
#admin-page .row-actions .ra-btn:hover {
  border-color: var(--ink-3);
  color: var(--ink);
  background: var(--surface-2);
}
#admin-page .row-actions .ra-btn.primary {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}
#admin-page .row-actions .ra-btn.primary:hover {
  background: var(--backer-ink);
  border-color: var(--backer-ink);
}
#admin-page .row-actions .ra-btn.danger:hover {
  background: var(--red-soft);
  border-color: var(--red);
  color: var(--red);
}
/* Keep urgent row-actions visible (pending users etc.) */
#admin-page tr.pending .row-actions,
#admin-page .row-actions.always { opacity: 1; }


/* ── 20B. Overview page ────────────────────────────────────────────────── */

/* Alert strip */
#admin-page .ad-alerts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 22px;
}
#admin-page .ad-alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
}
#admin-page .ad-alert::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--ink-4);
}
#admin-page .ad-alert.amber::before { background: var(--amber); }
#admin-page .ad-alert.red::before   { background: var(--red); }
#admin-page .ad-alert.teal::before  { background: var(--backer); }
#admin-page .ad-alert.green::before { background: var(--green); }
#admin-page .ad-alert .ico {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 13px;
}
#admin-page .ad-alert.amber .ico { background: var(--amber-soft);  color: var(--amber); }
#admin-page .ad-alert.red   .ico { background: var(--red-soft);    color: var(--red); }
#admin-page .ad-alert.teal  .ico { background: var(--backer-soft); color: var(--backer-ink); }
#admin-page .ad-alert.green .ico { background: var(--green-soft);  color: var(--green); }
#admin-page .ad-alert .num {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 22px;
  line-height: 1;
  color: var(--ink);
  letter-spacing: -0.01em;
}
#admin-page .ad-alert .num .unit {
  font-size: 12px;
  color: var(--ink-3);
  font-weight: 500;
  margin-left: 4px;
}
#admin-page .ad-alert .lbl {
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 4px;
}
#admin-page .ad-alert .lbl a {
  color: var(--backer);
  font-weight: 500;
  text-decoration: none;
}
#admin-page .ad-alert .lbl a:hover { text-decoration: underline; }

/* KPI strip */
#admin-page .ad-kpis {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 22px;
}
#admin-page .ad-kpi {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px 12px;
}
#admin-page .ad-kpi .lbl {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 8px;
}
#admin-page .ad-kpi .v {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 24px;
  line-height: 1;
  letter-spacing: -0.015em;
  color: var(--ink);
}
#admin-page .ad-kpi .v .ccy {
  font-size: 13px;
  color: var(--ink-3);
  font-weight: 500;
  margin-right: 3px;
}
#admin-page .ad-kpi .delta {
  font-size: 11px;
  font-weight: 600;
  color: var(--green);
  margin-left: 6px;
  font-family: var(--font-mono);
}
#admin-page .ad-kpi .delta.down { color: var(--red); }
#admin-page .ad-kpi .delta.flat { color: var(--ink-4); }
#admin-page .ad-kpi .spark { margin-top: 10px; height: 28px; display: block; }
#admin-page .ad-kpi .sub { font-size: 11px; color: var(--ink-3); margin-top: 8px; }

/* Click-through wrapper for KPI sparklines. Resets native <button> chrome so
   the sparkline reads as a static block, but adds a subtle hover affordance
   + pointer cursor so the click is discoverable. */
#admin-page .ad-spark-trigger {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background-color 120ms ease;
}
#admin-page .ad-spark-trigger:hover { background: var(--backer-softer); }
#admin-page .ad-spark-trigger:focus-visible {
  outline: 2px solid var(--backer);
  outline-offset: 2px;
}

/* Funnel "Details" trigger - sits in `.card-aux` slot, repaints brand teal
   on hover to match the directory's `All →` ghost link convention. */
#admin-page .ad-chart-trigger {
  border: 0;
  background: transparent;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-3);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: color 120ms ease, background-color 120ms ease;
}
#admin-page .ad-chart-trigger:hover {
  color: var(--backer);
  background: var(--backer-softer);
}

/* Chart-modal count/value/% toggle. Reuses `.view-toggle` chrome; right-
   aligned inside the flex-column modal body via `align-self: flex-end`
   (inline on the element). Service-request funnel hides the Value button
   via `[hidden]`. */
#adminChartModal .ad-chart-toggle button[hidden] { display: none; }

/* Role pulse bars */
#admin-page .role-rows { display: flex; flex-direction: column; gap: 8px; }
#admin-page .role-row {
  display: grid;
  grid-template-columns: 110px 1fr 50px;
  gap: 12px;
  align-items: center;
}
#admin-page .role-row .role {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink);
  font-weight: 500;
}
#admin-page .role-row .role .ico {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-size: 11px;
}
#admin-page .role-row .role.developer .ico  { background: var(--backer-soft); color: var(--backer-ink); }
#admin-page .role-row .role.investor .ico   { background: var(--blue-soft);   color: var(--blue); }
#admin-page .role-row .role.advisor .ico    { background: var(--plum-soft);   color: var(--plum); }
#admin-page .role-row .role.researcher .ico { background: var(--amber-soft);  color: var(--amber); }
#admin-page .role-row .role.admin .ico      { background: var(--green-soft);  color: var(--green); }
#admin-page .role-row .bar-track {
  background: var(--surface-2);
  height: 10px;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}
#admin-page .role-row .bar-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  background: var(--backer);
  border-radius: 6px;
}
#admin-page .role-row .bar-fill.blue  { background: var(--blue); }
#admin-page .role-row .bar-fill.plum  { background: var(--plum); }
#admin-page .role-row .bar-fill.amber { background: var(--amber); }
#admin-page .role-row .bar-fill.green { background: var(--green); }
#admin-page .role-row .bar-fill .pending {
  position: absolute;
  right: -4px; top: -2px; bottom: -2px;
  width: 6px;
  background: var(--amber);
  border-radius: 3px;
  opacity: .9;
}
#admin-page .role-row .num {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink);
  text-align: right;
  font-weight: 500;
}

/* Funnel */
#admin-page .funnel {
  display: flex;
  align-items: stretch;
  gap: 6px;
  padding: 4px 0 8px;
}
#admin-page .funnel .stage { flex: 1; min-width: 0; }
#admin-page .funnel .stage .lbl {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#admin-page .funnel .stage .bar {
  height: 64px;
  border-radius: 8px;
  background: var(--surface-2);
  /* Grid layout so the trailing numbers (value + pct on the project funnel,
     count + pct on the service funnel) share a single baseline-aligned row
     at the bottom of the bar. The previous flex-column + absolute-positioned
     `.pct` produced a 2px vertical drift between siblings because each cell
     anchored to a different reference line (padding-bottom vs `bottom: 6px`). */
  display: grid;
  grid-template-columns: 1fr auto;
  align-content: end;
  align-items: baseline;
  column-gap: 8px;
  row-gap: 2px;
  padding: 8px 10px;
  position: relative;
  transition: background .15s;
  cursor: default;
}
/* Project funnel: `.sub` is present, so `.v` (the big count) gets its own
   row spanning both columns and `.sub` + `.pct` sit on the row below. */
#admin-page .funnel .stage .bar:has(.sub) .v { grid-column: 1 / -1; }
#admin-page .funnel .stage .bar:hover { background: var(--backer-softer); }
/* Funnel bar tones mirror app/utils.py LIFECYCLE_PILL_CLASSES so the funnel
   stays in lock-step with every other lifecycle pill on the platform. */
#admin-page .funnel .stage .bar.draft       { background: var(--surface-2); }
#admin-page .funnel .stage .bar.live        { background: var(--backer-soft); }
#admin-page .funnel .stage .bar.awaiting    { background: var(--amber-soft); }
#admin-page .funnel .stage .bar.shortlisted { background: var(--blue-soft); }
#admin-page .funnel .stage .bar.preferred   { background: var(--plum-soft); }
#admin-page .funnel .stage .bar.dd          { background: var(--indigo-soft); }
#admin-page .funnel .stage .bar.funded      { background: var(--green-soft); }
#admin-page .funnel .stage .v {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 18px;
  line-height: 1;
  color: var(--ink);
}
#admin-page .funnel .stage .v .ccy {
  font-size: 11px;
  color: var(--ink-3);
  font-weight: 500;
  margin-right: 2px;
}
#admin-page .funnel .stage .sub {
  font-size: 10px;
  color: var(--ink-3);
  font-family: var(--font-mono);
  /* margin-top is now handled by the grid `row-gap` on `.bar`. */
}
#admin-page .funnel .stage .bar .pct {
  /* Static positioning so `.pct` participates in the grid and shares a
     baseline with its sibling on the same row (`.sub` on project, `.v` on
     service). Previously absolute with `bottom: 6px` which was 2px out of
     line with the in-flow numbers above. */
  font-size: 10px;
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-weight: 500;
  justify-self: end;
}
#admin-page .funnel .arr {
  display: grid;
  place-items: center;
  color: var(--ink-4);
  font-size: 11px;
  padding-bottom: 12px;
}

/* Funnel card body wrapper - the 14px-top / card-pad-side / 18px-bottom
   padding that wraps the .funnel + funnel-foot inside the two funnel cards.
   Was previously inlined twice via `style="padding:14px var(--card-pad) 18px"`. */
#admin-page .funnel-body { padding: 14px var(--card-pad) 18px; }

/* Funnel-foot stat pair: small label + monospace number, repeated 6 times
   per funnel. Was previously 12 inline `style="..."` declarations inside
   the `funnel_foot` Jinja macro. The `.spacer` modifier pushes the
   Cancelled cell to the right via `margin-left: auto`; `.cancelled` recolours
   the number red. */
#admin-page .funnel-foot {
  margin-top: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--line-2);
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
}
#admin-page .funnel-stat { font-size: 12px; color: var(--ink-3); }
#admin-page .funnel-stat.spacer { margin-left: auto; }
#admin-page .funnel-stat .num {
  color: var(--ink);
  font-weight: 600;
  font-family: var(--font-mono);
  margin-left: 4px;
}
#admin-page .funnel-stat.cancelled .num { color: var(--red); }

/* Status mini-grid under "Users by role" - 4 stat cells (Active / Pending /
   Suspended / Rejected) with a big number + mono sub-line each. Was
   previously inlined as one outer grid + four pairs of `style="..."`. */
#admin-page .users-by-role-body { padding: 6px var(--card-pad) 18px; }
#admin-page .kpi-mini-grid {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line-2);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
#admin-page .kpi-mini .v {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 20px;
  color: var(--ink);
}
#admin-page .kpi-mini.amber .v { color: var(--amber); }
#admin-page .kpi-mini .sub {
  font-size: 11px;
  color: var(--ink-3);
  margin-top: 2px;
  font-family: var(--font-mono);
}

/* Flex-fill wrapper inside each `.ad-alert` row - the body sits between
   the icon tile and (in older variants) a trailing CTA. Was previously
   inlined 4× as `style="flex:1;min-width:0;"`. */
#admin-page .ad-alert .body { flex: 1; min-width: 0; }

/* `.pill.on-primary` - semi-transparent white pill used inside a teal
   primary button (e.g. the Approve queue CTA). `.pill.ghost` is too low-
   contrast on a brand-teal background; this variant inverts. */
#admin-page .btn-primary .pill.on-primary,
.btn-primary .pill.on-primary {
  background: rgba(255, 255, 255, .18);
  color: #fff;
  margin-left: 6px;
  padding: 1px 7px;
}

/* `.empty.compact` - tighter padding variant for empty states rendered
   inside the top-list cards (28px vs the default 48px from §3). */
.empty.compact { padding: 28px; }

/* `.toplist .ct.subtle` - micro-typography for the New-sign-ups date
   column. The default `.toplist .ct` is 12px mono for numeric counts;
   relative-time strings read better at 10.5px with the lighter weight. */
#admin-page .toplist .ct.subtle {
  font-size: 10.5px;
  color: var(--ink-3);
  font-weight: 400;
}

/* New-sign-ups card foot - tightens the base `.card-foot` padding +
   font-size for the "Last 7 days | N active / pending" caption line.
   All other base rules (border-top, color, display, justify-content)
   are inherited from `.card-foot`. */
#admin-page .signups-foot {
  padding: 12px var(--card-pad);
  font-size: 11.5px;
}

/* Chart-modal body - flex column so the count/value/% toggle sits above
   the chart container with a fixed gap. The toggle right-aligns via
   `align-self: flex-end`. */
#adminChartModal .modal-body { display: flex; flex-direction: column; gap: 12px; padding-top: 14px; }
#adminChartModal .ad-chart-toggle { align-self: flex-end; }

/* Activity feed */
#admin-page .feed { display: flex; flex-direction: column; }
#admin-page .feed .row {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  gap: 12px;
  padding: 11px var(--card-pad);
  border-bottom: 1px solid var(--line-2);
  align-items: flex-start;
}
#admin-page .feed .row:last-child { border-bottom: 0; }
#admin-page .feed .row:hover { background: var(--backer-softer); }
#admin-page .feed .row .ico {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  display: grid;
  place-items: center;
  font-size: 9px;
  margin-top: 2px;
}
#admin-page .feed .row.ok .ico    { background: var(--green-soft);  color: var(--green); }
#admin-page .feed .row.alert .ico { background: var(--amber-soft);  color: var(--amber); }
#admin-page .feed .row.info .ico  { background: var(--backer-soft); color: var(--backer-ink); }
#admin-page .feed .row.user .ico  { background: var(--blue-soft);   color: var(--blue); }
#admin-page .feed .row.warn .ico  { background: var(--red-soft);    color: var(--red); }
#admin-page .feed .row .text {
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.4;
}
#admin-page .feed .row .text b { color: var(--ink); font-weight: 500; }
#admin-page .feed .row .text .meta { color: var(--ink-3); }
#admin-page .feed .row .when {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
  white-space: nowrap;
  padding-top: 2px;
}

/* Donut */
#admin-page .donut {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 22px;
  align-items: center;
}
#admin-page .donut-svg { width: 140px; height: 140px; }
#admin-page .donut .legend {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12.5px;
}
#admin-page .donut .legend .sw {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}
#admin-page .donut .legend .nm { color: var(--ink-2); }
#admin-page .donut .legend .pct {
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  min-width: 36px;
  text-align: right;
}
#admin-page .donut .legend .ct {
  color: var(--ink);
  font-weight: 500;
  font-family: var(--font-mono);
  font-size: 11.5px;
  min-width: 30px;
  text-align: right;
}

/* Top list (orgs / users / actions). Sized to content but capped so long
   lists scroll instead of blowing out the card. ~5 rows are visible at
   rest; the rest reveal on scroll. Caps the void problem on h-100 cards
   in mixed-height rows (the tallest sibling sets the row height, so the
   void caused by a tall sibling shrinks once the tall one is capped). */
#admin-page .toplist {
  display: flex;
  flex-direction: column;
  max-height: 220px;
  overflow-y: auto;
}
/* `.tl-row` (toplist row) - bespoke class so we avoid colliding with the
   Bootstrap `.row` grid utility. The previous `.row` name was
   inheriting display/flex/margin/width defaults from Bootstrap that no
   amount of specificity-bumping could reliably override at runtime; cells
   ended up 100% wide and stacked vertically. */
#admin-page .toplist .tl-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 10px;
  padding: 9px var(--card-pad);
  align-items: center;
  border-bottom: 1px solid var(--line-2);
}
/* `.no-rank` variant - drops the leading 28px rank column for lists where
   the rank cell would just carry a status dot (e.g. New sign-ups). */
#admin-page .toplist.no-rank .tl-row { grid-template-columns: 1fr auto; }
#admin-page .toplist .tl-row:last-child { border-bottom: 0; }
#admin-page .toplist .tl-row:hover { background: var(--backer-softer); }
#admin-page .toplist .rank {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-4);
  text-align: center;
}
#admin-page .toplist .nm {
  font-size: 13px;
  color: var(--ink);
  font-weight: 500;
  line-height: 1.3;
}
#admin-page .toplist .sub { font-size: 11px; color: var(--ink-3); }
#admin-page .toplist .ct {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink);
  font-weight: 500;
}

/* Sparklines */
#admin-page .spark-line { stroke: var(--backer); stroke-width: 1.5; fill: none; }
#admin-page .spark-fill { fill: var(--backer-soft); opacity: .8; }
#admin-page .spark-line.amber { stroke: var(--amber); }
#admin-page .spark-fill.amber { fill: var(--amber-soft); }
#admin-page .spark-line.plum  { stroke: var(--plum); }
#admin-page .spark-fill.plum  { fill: var(--plum-soft); }
#admin-page .spark-line.blue  { stroke: var(--blue); }
#admin-page .spark-fill.blue  { fill: var(--blue-soft); }
#admin-page .spark-line.green { stroke: var(--green); }
#admin-page .spark-fill.green { fill: var(--green-soft); }

/* card-head right-slot tab toggle (Overview funnel + role card tabs) */
#admin-page .card-aux-tabs {
  display: inline-flex;
  background: var(--surface-2);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}
#admin-page .card-aux-tabs button {
  border: 0;
  background: transparent;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink-3);
  cursor: pointer;
}
#admin-page .card-aux-tabs button.on {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
  font-weight: 600;
}
#admin-page .card-aux-tabs button:hover:not(.on) { color: var(--ink-2); }

#admin-page .stack > * + * { margin-top: 18px; }


/* ── 20C. Users page ───────────────────────────────────────────────────── */

/* Outer scroll container for the users table - parallel to `.tcard` but
   reusing the standard `.card` chrome (header doesn't need the borderless
   sticky-th treatment that .tcard adds). */
#admin-page .u-table-card { padding: 0; overflow-x: auto; overflow-y: hidden; }
#admin-page .u-table { table-layout: auto; }
#admin-page .dtable th[data-col="chk"],          /* a bulk table's tick column (fm.bulk_bar) */
#admin-page .dtable td[data-col="chk"] {
  width: 36px;
  padding-right: 0 !important;
}
#admin-page .dtable [data-col="chk"] input[type="checkbox"] {
  accent-color: var(--backer);
  width: 14px;
  height: 14px;
  cursor: pointer;
}
#admin-page .u-table td.user-cell { min-width: 230px; }
#admin-page .u-table td.org-cell  { min-width: 180px; }
#admin-page .u-table .verif {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  font-size: 11px;
  color: var(--ink-3);
}
#admin-page .u-table .verif .yes { color: var(--green); }
#admin-page .u-table .verif .no  { color: var(--ink-4); }
#admin-page .u-table .verif .bad { color: var(--amber); }
#admin-page .u-table tr.pending td:first-child   { box-shadow: inset 3px 0 0 var(--amber); }
#admin-page .u-table tr.suspended td             { opacity: .68; }
#admin-page .u-table tr.suspended td:first-child { box-shadow: inset 3px 0 0 var(--ink-4); }

#admin-page .last-seen {
  font-size: 11.5px;
  color: var(--ink-3);
  font-family: var(--font-mono);
}
#admin-page .last-seen.fresh { color: var(--green); }
#admin-page .last-seen.stale { color: var(--amber); }

#admin-page .risk {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  color: var(--amber);
  margin-left: 6px;
}
#admin-page .risk.danger { color: var(--red); }


/* ── 20D. Organisations page ──────────────────────────────────────────── */

#admin-page .org-table td.name-cell { min-width: 240px; }
/* Numeric columns (Members / Projects / Deals) - compact so the table fits at
   common desktop widths without horizontal scroll. */
#admin-page .org-table th.num,
#admin-page .org-table td.num { width: 64px; text-align: right; white-space: nowrap; }
#admin-page .org-table td.name-cell .org-row {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 12px;
  align-items: center;
}
#admin-page .org-table .org-mark {
  width: 40px;
  height: 40px;
  border-radius: 9px;
  background: var(--surface-2);
  display: grid;
  place-items: center;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 13px;
  color: var(--ink-2);
  letter-spacing: .02em;
}
#admin-page .org-table .org-mark.teal  { background: var(--backer-soft); color: var(--backer-ink); }
#admin-page .org-table .org-mark.blue  { background: var(--blue-soft);   color: var(--blue); }
#admin-page .org-table .org-mark.plum  { background: var(--plum-soft);   color: var(--plum); }
#admin-page .org-table .org-mark.amber { background: var(--amber-soft);  color: var(--amber); }
#admin-page .org-table .org-mark.green { background: var(--green-soft);  color: var(--green); }
#admin-page .org-table .nm {
  font-size: 13.5px;
  color: var(--ink);
  font-weight: 500;
  line-height: 1.3;
  display: flex;
  align-items: center;
  gap: 6px;
}
#admin-page .org-table .nm .org-link {
  color: inherit;
  text-decoration: none;
  transition: color .12s;
}
#admin-page .org-table .nm .org-link:hover { color: var(--backer); }
#admin-page .org-table .nm .verified { color: var(--green); font-size: 11px; }
#admin-page .org-table .nm .verified.no { color: var(--ink-4); }
#admin-page .org-table .domain {
  font-size: 11.5px;
  color: var(--ink-3);
  font-family: var(--font-mono);
}
#admin-page .org-table .role-mix { display: inline-flex; gap: 3px; }

/* "Fix URL" action - surfaces only on rows whose slug has drifted from the
   current name (see admin.admin_organisations `_slug_drift`). */
#admin-page .org-table .slug-fix {
  margin-left: 8px;
  padding: 1px 7px;
  border: 1px solid var(--amber);
  border-radius: 999px;
  background: var(--amber-soft);
  color: var(--amber);
  font-family: var(--font-sans);
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
  vertical-align: middle;
}
#admin-page .org-table .slug-fix:hover { filter: brightness(0.96); }
#admin-page .org-table .slug-fix i { font-size: 9px; }

#admin-page tr.flagged td:first-child { box-shadow: inset 3px 0 0 var(--amber); }


/* ── 20E. Activity page ───────────────────────────────────────────────── */

#admin-page .activity-card { padding: 18px var(--card-pad); }
#admin-page .activity-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  align-items: stretch;
}
#admin-page .heatmap-wrap { font-size: 12px; color: var(--ink-3); }
#admin-page .heatmap {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-top: 10px;
}
#admin-page .heatmap .cell {
  aspect-ratio: 1;
  border-radius: 2px;
  background: var(--surface-2);
  display: block;
  cursor: pointer;
  text-decoration: none;
  transition: transform .12s, box-shadow .12s;
}
/* Level palette shared by heatmap day-cells and the foot legend swatches. */
#admin-page .heatmap .cell.l1, #admin-page .heatmap-legend .cell.l1 { background: var(--backer-softer); }
#admin-page .heatmap .cell.l2, #admin-page .heatmap-legend .cell.l2 { background: var(--backer-soft); }
#admin-page .heatmap .cell.l3, #admin-page .heatmap-legend .cell.l3 { background: var(--backer); opacity: .65; }
#admin-page .heatmap .cell.l4, #admin-page .heatmap-legend .cell.l4 { background: var(--backer); }
#admin-page .heatmap .cell:hover {
  transform: scale(1.18);
  box-shadow: 0 0 0 1px var(--backer);
}
#admin-page .heatmap .cell.active {
  box-shadow: 0 0 0 1px var(--backer);
  transform: scale(1.12);
}
#admin-page .heatmap-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
}
#admin-page .heatmap-legend {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--ink-3);
}
#admin-page .heatmap-legend .cell {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: var(--surface-2);
}

#admin-page .top-list h4 {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 10px;
}
#admin-page .top-list .row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 5px 0;
}
#admin-page .top-list .row + .row { border-top: 1px solid var(--line-2); }
#admin-page .top-list .nm { font-size: 12.5px; color: var(--ink); font-weight: 500; }
#admin-page .top-list .sub { font-size: 11px; color: var(--ink-3); }
#admin-page .top-list .ct {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink);
  font-weight: 500;
}

#admin-page .ta-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 4px 0;
}
#admin-page .ta-row + .ta-row { border-top: 1px solid var(--line-2); }
#admin-page .ta-row .nm {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-2);
}
#admin-page .ta-row .ct {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink);
  font-weight: 500;
}

/* Audit log feed */
#admin-page .log-section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
/* Left column of the two-column activity layout: holds the feed card + the pager,
   so the pager sits OUTSIDE the card (matching admin_users / admin_organisations)
   while staying in the left grid column. min-width:0 lets the 1fr track shrink so
   the card's overflow:hidden clipping still applies (a grid item defaults to
   min-width:auto, which would otherwise blow the track out on wide content). */
#admin-page .act-feed-col { min-width: 0; }
#admin-page .log-day {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px var(--card-pad);
  background: var(--surface-2);
  border-bottom: 1px solid var(--line-2);
  font-size: 11.5px;
  color: var(--ink-3);
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
}
#admin-page .log-day:not(:first-child) { border-top: 1px solid var(--line-2); }
#admin-page .log-day .ct {
  font-family: var(--font-mono);
  color: var(--ink-3);
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
}

#admin-page .log-row {
  position: relative;
  display: grid;
  grid-template-columns: 78px 32px 1fr auto;
  gap: 14px;
  padding: 13px var(--card-pad);
  border-bottom: 1px solid var(--line-2);
  align-items: flex-start;
}
#admin-page .log-row:last-child { border-bottom: 0; }
#admin-page .log-row:hover { background: var(--backer-softer); cursor: pointer; }
#admin-page .log-row.selected { background: var(--backer-soft); }
#admin-page .log-row.selected::after {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--backer);
}
#admin-page .log-time {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-3);
  padding-top: 2px;
  line-height: 1.4;
}
#admin-page .log-time b { color: var(--ink); font-weight: 500; display: block; }
#admin-page .log-ico {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 12px;
  flex-shrink: 0;
}
#admin-page .log-row.ok     .log-ico { background: var(--green-soft);  color: var(--green); }
#admin-page .log-row.warn   .log-ico { background: var(--amber-soft);  color: var(--amber); }
#admin-page .log-row.info   .log-ico { background: var(--backer-soft); color: var(--backer-ink); }
#admin-page .log-row.user   .log-ico { background: var(--blue-soft);   color: var(--blue); }
#admin-page .log-row.danger .log-ico { background: var(--red-soft);    color: var(--red); }
#admin-page .log-row.admin  .log-ico { background: var(--plum-soft);   color: var(--plum); }
#admin-page .log-body .ttl {
  font-size: 13px;
  color: var(--ink);
  font-weight: 500;
  line-height: 1.35;
}
#admin-page .log-body .ttl b { color: var(--ink); }
#admin-page .log-body .ttl .action-code {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-3);
  background: var(--surface-2);
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 6px;
}
#admin-page .log-body .sub { font-size: 11.5px; color: var(--ink-3); margin-top: 3px; }
#admin-page .log-meta {
  text-align: right;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-3);
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: flex-end;
}
#admin-page .log-meta .ip    { color: var(--ink-3); }
#admin-page .log-meta .actor { color: var(--ink-2); font-size: 11px; }

#admin-page .act-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 18px;
  align-items: start;
}

/* Audit detail drawer */
#admin-page .ad-detail {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  position: sticky;
  top: 80px;
}
#admin-page .ad-detail .ad-detail-head {
  padding: 16px var(--card-pad);
  border-bottom: 1px solid var(--line-2);
}
#admin-page .ad-detail .ad-detail-head h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 4px;
}
#admin-page .ad-detail .ad-detail-head .when {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-3);
}
#admin-page .ad-detail .ad-detail-body { padding: 4px 0 12px; }
/* Page-scope .kv-row inside the drawer so the global section-16 .kv-row
   chrome (used by *_summary pages) doesn't leak in. */
#admin-page .ad-detail .kv-row {
  padding: 10px var(--card-pad);
  border-bottom: 0;
}
#admin-page .ad-detail .json-payload {
  margin: 12px var(--card-pad) 4px;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-2);
  line-height: 1.5;
  overflow-x: auto;
  white-space: pre;
}
#admin-page .ad-detail .json-payload .k { color: var(--plum); }
#admin-page .ad-detail .json-payload .s { color: var(--green); }
#admin-page .ad-detail .json-payload .n { color: var(--blue); }
#admin-page .ad-detail .ad-detail-foot {
  padding: 12px var(--card-pad);
  border-top: 1px solid var(--line-2);
  display: flex;
  gap: 8px;
}


/* ── 20F. Lookups page ─────────────────────────────────────────────────── */

#admin-page .ref-layout {
  display: grid;
  grid-template-columns: 244px 1fr;
  gap: 18px;
  align-items: start;
}
#admin-page .ref-rail {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 6px;
  position: sticky;
  top: 80px;
}
#admin-page .ref-rail .group-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 12px 12px 6px;
}
#admin-page .ref-rail a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 7px;
  color: var(--ink-2);
  font-size: 13px;
  text-decoration: none;
  transition: background .12s, color .12s;
}
#admin-page .ref-rail a:hover { background: var(--surface-2); color: var(--ink); }
#admin-page .ref-rail a.on {
  background: var(--backer-soft);
  color: var(--backer-ink);
  font-weight: 500;
}
#admin-page .ref-rail a .ico {
  width: 16px;
  color: var(--ink-4);
  font-size: 11px;
  text-align: center;
}
#admin-page .ref-rail a.on .ico { color: var(--backer); }
#admin-page .ref-rail a .ct {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-4);
}
#admin-page .ref-rail a.on .ct { color: var(--backer-ink); }
#admin-page .ref-rail hr {
  border: 0;
  border-top: 1px solid var(--line-2);
  margin: 6px 6px;
}

#admin-page .ref-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
#admin-page .ref-head .info h2 {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 22px;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin: 0 0 4px;
}
#admin-page .ref-head .info .meta {
  font-size: 12px;
  color: var(--ink-3);
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}
#admin-page .ref-head .info .meta .seed { font-family: var(--font-mono); }
#admin-page .ref-head .info .meta .seed b { color: var(--ink); font-weight: 500; }

#admin-page .ref-stat-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
#admin-page .ref-stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
}
#admin-page .ref-stat .lbl {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 5px;
}
#admin-page .ref-stat .v {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 18px;
  color: var(--ink);
  letter-spacing: -0.01em;
}
#admin-page .ref-stat .v.muted { color: var(--ink-3); }

#admin-page .lk-table td.slug-cell {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-3);
}
#admin-page .lk-table td.used {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-3);
}
#admin-page .lk-table tr.locked td {
  background: var(--surface-2);
  opacity: .85;
}
#admin-page .lk-table tr.locked td:first-child { box-shadow: inset 3px 0 0 var(--ink-4); }
#admin-page .lk-table tr.editing td { background: var(--backer-softer); }
#admin-page .lk-table tr.editing td:first-child { box-shadow: inset 3px 0 0 var(--backer); }

#admin-page .swatch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
#admin-page .swatch .sw {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  border: 1px solid var(--line);
}

/* Mirror the canonical `.field` control (neutral border; green ring only on
   focus) - matches project_form.html so admin settings reads as normal form
   fields / dropdowns rather than perpetually-focused green boxes. */
#admin-page .inline-input {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink);
  width: 100%;
  outline: none;
  font-family: inherit;
  transition: border-color .12s, box-shadow .12s;
}
#admin-page .inline-input:focus {
  border-color: var(--backer);
  box-shadow: 0 0 0 3px rgba(45, 107, 102, .12);
}
#admin-page select.inline-input {
  /* No-JS fallback caret (Choices.js wraps + hides the native select when it
     loads; this keeps a sane select if the vendor JS is unavailable). */
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='none' stroke='%237a8a88' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' d='M3 4.5L6 7.5L9 4.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}
/* Choices.js-wrapped boolean selects on /admin/settings - cap width + match the
   .inline-input text fields' height so each row reads consistently. The global
   "Choices.js global theme" supplies the surface/border/caret; this only sizes. */
#admin-page .kv-row .choices { margin-bottom: 0; min-width: 0; max-width: 180px; }
#admin-page .kv-row .choices__inner,
#admin-page .kv-row .choices[data-type*=select-one] .choices__inner {
  min-height: 38px;
  padding: 0 28px 0 12px;
  font-size: 13px;
  line-height: 36px;
}
#admin-page .kv-row .choices__list--single { padding: 0; }
#admin-page .kv-row .choices.is-focused .choices__inner,
#admin-page .kv-row .choices.is-open .choices__inner {
  border-color: var(--backer);
  box-shadow: 0 0 0 3px rgba(45, 107, 102, .12);
}
#admin-page .save-cluster {
  display: inline-flex;
  gap: 4px;
}
#admin-page .save-cluster .btn-save {
  background: var(--backer);
  color: #fff;
  border: 0;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}
#admin-page .save-cluster .btn-cancel {
  background: transparent;
  color: var(--ink-3);
  border: 0;
  padding: 5px 8px;
  font-size: 11.5px;
  cursor: pointer;
}

/* ── Lookups: grouped classification + drag reorder + reference view ──── */
#admin-page .lk-group-card { margin-bottom: 14px; padding: 0; overflow: hidden; }
#admin-page .lk-group-head h3 { display: inline-flex; align-items: center; gap: 2px; text-transform: capitalize; }
#admin-page .lk-group-dot {
  width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-right: 4px;
}
/* Financing-category colour key on the group header - reads var(--c) set by the
   .cat-* class (the 7-category capital-stack palette). A faint border keeps the
   lighter family shades legible against the card surface. */
#admin-page .lk-group-head h3 .lk-group-sw {
  width: 13px; height: 13px; border-radius: 4px; display: inline-block;
  margin: 0 6px 0 2px; flex: 0 0 auto;
  background: var(--c, var(--ink-4));
  border: 1px solid color-mix(in srgb, var(--c, var(--ink-4)) 55%, var(--line));
}
#admin-page .lk-group-head .card-aux { display: inline-flex; align-items: center; gap: 10px; }

/* Grouped lookup tables (sectors, financing types) stack one <table> per group.
   With auto layout each stacked table sizes its columns independently, so the
   'Type' column width drifted between categories. Fixed layout + percentage
   content columns makes every stacked table line up AND spread to fill: only
   Actions (the icon cluster) keeps a fixed px width; the name + 'Used in'
   columns share the rest proportionally so 'Used in' is no longer pinned narrow.
   Non-grouped lookups keep auto layout. */
#admin-page .lk-table-fixed { table-layout: fixed; width: 100%; min-width: 520px; }
#admin-page .lk-table-fixed .col-used { width: 24%; }
#admin-page .lk-table-fixed .col-actions { width: 120px; }
/* The min-width only bites at the smallest widths - the card scrolls there
   rather than crushing the spread columns. */
#admin-page .lk-group-card .card-body { overflow-x: auto; }

/* drag handle + dragging state */
#admin-page .lk-row[draggable="true"] { cursor: default; }
#admin-page .lk-grip {
  width: 34px; text-align: center; color: var(--ink-4);
  cursor: grab; user-select: none;
}
#admin-page .lk-grip:active { cursor: grabbing; }
#admin-page tr.lk-dragging { opacity: .5; background: var(--backer-softer); }
#admin-page tr.lk-row td { transition: background .12s; }

#admin-page .lk-actions .ra-btn { width: 26px; height: 26px; }
#admin-page .lk-actions .ra-btn[disabled] { opacity: .35; cursor: not-allowed; }
/* Delete button uses the project-form .pf-sh-rm boxless trash (transparent until
   a red-soft hover); size it to match the 26px action cluster + carry the
   in-use disabled state. */
#admin-page .lk-actions .pf-sh-rm { width: 26px; height: 26px; }
/* Reclaim the red hover: the generic `.row-actions button:hover` rule (teal)
   otherwise out-specifies the base `.pf-sh-rm:hover` because of its element
   selector, so the trash went green. This id-scoped rule wins it back. */
#admin-page .lk-actions .pf-sh-rm:hover { color: var(--red); background: var(--red-soft); }
#admin-page .lk-actions .pf-sh-rm[disabled] { opacity: .35; cursor: not-allowed; }
#admin-page .lk-actions .pf-sh-rm[disabled]:hover { background: transparent; color: var(--ink-4); }

/* stacked, boxless up/down move control (spinner-style) */
#admin-page .lk-move-stack {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  margin-right: 2px;
}
#admin-page .lk-move-btn {
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  width: 18px;
  height: 11px;
  display: flex;
  justify-content: center;
  font-size: 13px;
  line-height: 1;
  color: var(--ink-4);
  cursor: pointer;
}
#admin-page .lk-move-btn.up   { align-items: flex-end; }
#admin-page .lk-move-btn.down { align-items: flex-start; }
#admin-page .lk-move-btn:hover { color: var(--backer); }

/* geography filter selects reuse .fbtn silhouette as a no-JS fallback (Choices.js
   hides the native <select> and renders its own control - see below). */
#admin-page .bp-toolbar select.fbtn {
  appearance: auto;
  min-width: 120px;
  max-width: 220px;
}

/* Geography filter dropdowns are Choices.js single-selects (the platform-standard
   searchable dropdown). Lock the control to the .fbtn / search-box height (~36px)
   and drop the vendor's 24px bottom margin + 44px min-height so the toolbar row
   stays aligned. flex-centre the single value since we zero the vertical padding. */
#admin-page #geoToolbar .choices {
  margin-bottom: 0;
  min-width: 160px;
  max-width: 240px;
  flex: 0 0 auto;
}
#admin-page #geoToolbar .choices__inner {
  min-height: 36px;
  height: 36px;
  padding: 0 28px 0 12px;
  display: flex;
  align-items: center;
}
#admin-page #geoToolbar .choices__list--single { padding: 0; }
#admin-page #geoToolbar .choices[data-type*=select-one]::after { right: 12px; }
/* A locked child filter (parent not yet chosen) shows "Choose <parent> first" -
   mute it so it reads as not-yet-available (the global theme keeps disabled
   controls on --surface, so opacity is what signals the disabled state here). */
#admin-page #geoToolbar .choices.is-disabled { opacity: .55; }
/* The dropdown-option resets (word-break:normal + neutralising the vendor's
   100px right-padding reserve) now live in the global "Choices.js global theme"
   block - they apply to every Choices page, not just this toolbar. */

/* reference (code-defined) read-only list */
#admin-page .lk-ref-list { display: flex; flex-direction: column; }
#admin-page .lk-ref-head {
  font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-3); padding: 14px var(--card-pad) 6px;
  border-top: 1px solid var(--line-2);
}
#admin-page .lk-ref-list .lk-ref-head:first-child { border-top: 0; }
#admin-page .lk-ref-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px var(--card-pad); border-top: 1px solid var(--line-2);
}
#admin-page .lk-ref-list .lk-ref-row:first-child { border-top: 0; }
#admin-page .lk-ref-sw {
  width: 16px; height: 16px; border-radius: 4px; flex: 0 0 auto;
  border: 1px solid var(--line);
  /* Financing-colours rows carry a .cat-* class that sets --c; read it straight
     (mirrors .lk-group-sw) so the swatch needs no inline background. Rows with
     an explicit `swatch` css-var still set background inline; --c is unset for
     them so this falls through harmlessly. */
  background: var(--c, transparent);
}
#admin-page .lk-ref-sw-none { background: var(--surface-2); }
#admin-page .lk-ref-ico {
  width: 16px; text-align: center; color: var(--ink-3); flex: 0 0 auto; font-size: 13px;
}
#admin-page .lk-ref-label { font-size: 13px; font-weight: 500; color: var(--ink); }
#admin-page .lk-ref-sub {
  font-family: var(--font-mono); font-size: 11px; color: var(--ink-4); margin-left: auto;
}
/* Reference 'Used in' chip - right-most, distinct from the mono slug to its left. */
#admin-page .lk-ref-used {
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 600;
  color: var(--ink-3); background: var(--surface-2);
  border: 1px solid var(--line-2); border-radius: 999px;
  padding: 2px 9px; flex: 0 0 auto; white-space: nowrap;
}
/* When a row has no slug, the chip still right-aligns. */
#admin-page .lk-ref-row .lk-ref-label + .lk-ref-used { margin-left: auto; }

/* Count-bearing reference lists (lifecycle / service types / static dropdowns /
   roles / map palettes) lay out as three aligned columns - indicator+label | slug |
   count chip - so the mono slug and the 'Used in' chip sit in their own columns down
   the list rather than lumping together at the right edge. The label column takes
   its text's width and the slug column the rest, where a long value (Map palettes'
   technology list) wraps rather than squeezing the label. slug + count are pinned
   to columns 3/4 so the count stays in its own column even on rows that carry no
   slug (e.g. Investor type / AUM band). */
#admin-page .lk-ref-list.has-counts .lk-ref-row {
  display: grid;
  grid-template-columns: 16px auto minmax(110px, 1fr) 128px;
  column-gap: 14px;
}
#admin-page .lk-ref-list.has-counts .lk-ref-sub {
  grid-column: 3; margin-left: 0; justify-self: end; text-align: right;
}
#admin-page .lk-ref-list.has-counts .lk-ref-used { grid-column: 4; justify-self: end; }


/* ── 20G. Responsive (admin) ──────────────────────────────────────────── */

@media (max-width: 1180px) {
  #admin-page .ad-kpis        { grid-template-columns: repeat(3, 1fr); }
  #admin-page .ad-alerts      { grid-template-columns: repeat(2, 1fr); }
  #admin-page .activity-grid  { grid-template-columns: 1fr; gap: 18px; }
  #admin-page .act-layout     { grid-template-columns: 1fr; }
  #admin-page .ad-detail      { position: relative; top: 0; }
}
@media (max-width: 1024px) {
  #admin-page .stat-tabs,
  #admin-page .stat-tabs.tabs-6          { grid-template-columns: repeat(2, 1fr); }
  #admin-page .ref-layout                { grid-template-columns: 1fr; }
  #admin-page .ref-rail                  { position: relative; top: 0; }
  #admin-page .u-table td.org-cell,
  #admin-page .u-table th.org-col        { display: none; }
}
@media (max-width: 720px) {
  #admin-page .ad-kpis   { grid-template-columns: repeat(2, 1fr); }
  #admin-page .ad-alerts { grid-template-columns: 1fr; }
}


/* =====================================================================
   21. PAGE: DEVELOPER DASHBOARD
       (.dev-*, .lc-*, .fund-*, .qa-row, .activity-row, .bars, .donut,
       .legend-list, .map-mock, .map-pin, .dev-sector, .fc) - all
       page-scoped under #dev-overview.
       Ported from references/mocks/overview_developer_preview.html.
   ===================================================================== */
#dev-overview { --card-pad-tight: 18px; }

/* Section block - reuses .em-section spacing/heads */
#dev-overview .dev-section { margin-top: 32px; }
#dev-overview .dev-section-head {
  display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px;
}
#dev-overview .dev-section-head h3 {
  margin: 0; font-size: 14px; font-weight: 600; color: var(--ink);
  letter-spacing: -0.005em;
  display: inline-flex; align-items: center; gap: 10px;
}
#dev-overview .dev-section-head h3 .count {
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  color: var(--ink-3); background: var(--surface-2);
  padding: 2px 7px; border-radius: 4px; letter-spacing: 0;
}
#dev-overview .dev-section-head .sub {
  font-size: 12.5px; color: var(--ink-3);
}
#dev-overview .dev-section-head .grow { flex: 1; }

/* The right-aligned action link in a dev-section-head or a card-head sits
   alongside the h3 heading - paint it at the same 14px / 600 / --ink as
   the heading so the two read as a matched pair, and drop the .btn-text
   y-padding so the baseline stays tight against the head row. */
#dev-overview .dev-section-head .btn-text,
#dev-overview .card-head .btn-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.005em;
  padding: 0;
  text-decoration: none;
}
#dev-overview .dev-section-head .btn-text:hover,
#dev-overview .card-head .btn-text:hover { color: var(--backer); }

/* 2- and 3-column grids */
#dev-overview .dev-grid-2  { display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; }
#dev-overview .dev-grid-3  { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 18px; }
#dev-overview .dev-grid-2b { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

/* Card variations for the breakdown panels */
#dev-overview .dev-mini-card { padding: 18px 20px; }
#dev-overview .dev-mini-card .ch-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 14px;
}
#dev-overview .dev-mini-card .ch-head h4 {
  margin: 0; font-size: 13.5px; font-weight: 600; color: var(--ink);
  letter-spacing: -0.005em;
}
#dev-overview .dev-mini-card .ch-head .sub {
  font-size: 11px; color: var(--ink-3); font-weight: 400;
  letter-spacing: 0;
}
/* Tighter than the page-level .view-toggle (Browse Projects etc.) so the
   segmented control fits next to the .ch-head h4 without dominating it. */
#dev-overview .sector-toggle { padding: 2px; border-radius: 8px; }
#dev-overview .sector-toggle button {
  padding: 3px 9px; font-size: 11px; font-weight: 500; border-radius: 6px;
}

/* Recent activity feed */
#dev-overview .activity-list { display: flex; flex-direction: column; }
#dev-overview .activity-row {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  gap: 12px;
  align-items: start;
  padding: 12px 0;
  border-top: 1px dashed var(--line-2);
  color: inherit; text-decoration: none;
}
#dev-overview .activity-row:first-child { border-top: none; padding-top: 4px; }
#dev-overview .activity-row:hover .title { color: var(--backer); }
#dev-overview .activity-row .ico {
  width: 30px; height: 30px; border-radius: 8px;
  display: grid; place-items: center; font-size: 12px;
  background: var(--surface-2); color: var(--ink-3);
  margin-top: 1px;
}
/* Palette is held in lock-step with .nf-ico (notifications) so the same
   event renders identically on the recent-activity feed and the
   /notifications row. Driven by utils.AUDIT_ACTION_VISUAL. */
#dev-overview .activity-row .ico.teal   { background: var(--backer-soft); color: var(--backer-ink); }
#dev-overview .activity-row .ico.amber  { background: var(--amber-soft);  color: var(--amber); }
#dev-overview .activity-row .ico.green  { background: var(--green-soft);  color: var(--green); }
#dev-overview .activity-row .ico.plum   { background: var(--plum-soft);   color: var(--plum); }
#dev-overview .activity-row .ico.blue   { background: var(--blue-soft);   color: var(--blue); }
#dev-overview .activity-row .ico.red    { background: var(--red-soft);    color: var(--red); }
#dev-overview .activity-row .ico.indigo { background: var(--indigo-soft); color: var(--indigo); }
#dev-overview .activity-row .ico.ghost  { background: var(--surface-2);   color: var(--ink-3); border: 1px solid var(--line); }
#dev-overview .activity-row .body { min-width: 0; }
#dev-overview .activity-row .title {
  font-size: 13px; color: var(--ink); font-weight: 500;
  line-height: 1.3; transition: color .1s;
  display: block;
}
#dev-overview .activity-row .msg {
  font-size: 11.5px; color: var(--ink-3); margin-top: 2px;
  line-height: 1.4;
}
#dev-overview .activity-row .when {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--ink-3); white-space: nowrap;
  padding-top: 2px;
}

/* Quick actions card */
#dev-overview .quick-actions {
  display: flex; flex-direction: column; gap: 2px;
}
#dev-overview .qa-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 4px; border-top: 1px dashed var(--line-2);
  color: var(--ink); text-decoration: none;
  font-size: 13px; font-weight: 500;
  transition: color .1s;
}
#dev-overview .qa-row:first-child { border-top: none; }
#dev-overview .qa-row:hover { color: var(--backer); }
#dev-overview .qa-row:hover .qa-ico { color: var(--backer); border-color: var(--backer); }
#dev-overview .qa-row .qa-ico {
  width: 28px; height: 28px; border-radius: 7px;
  display: grid; place-items: center; font-size: 11px;
  border: 1px solid var(--line); color: var(--ink-3);
  flex-shrink: 0; transition: all .1s;
  background: var(--surface);
}
#dev-overview .qa-row .qa-ico.qa-ico-primary {
  color: var(--backer); border-color: var(--backer-soft);
  background: var(--backer-soft);
}
#dev-overview .qa-row .qa-ico.qa-ico-plum {
  color: var(--plum); border-color: var(--plum-soft);
  background: var(--plum-soft);
}
#dev-overview .qa-row .qa-sub {
  margin-left: auto; font-size: 11px; color: var(--ink-3); font-weight: 400;
}
/* The chevron is always pushed to the right edge. On rows that render a
   `.qa-sub` count the sub supplies the auto margin and the chevron just needs
   an 8px gap after it; on rows whose (conditional) sub is absent the chevron's
   own auto margin keeps it right-aligned - so it can never bunch up against
   the label when a count is zero. */
#dev-overview .qa-row .qa-go {
  margin-left: auto; color: var(--ink-4); font-size: 10px;
}
#dev-overview .qa-row .qa-sub + .qa-go { margin-left: 8px; }
/* Drops the card-body top padding under the Quick actions head so the
   first .qa-row borders sit flush with the head's bottom rule. */
#dev-overview .qa-body { padding-top: 6px; }

/* Welcome-line org name - softer-weight ink-2 to match the page-sub
   surrounding text without a stand-alone strong-weight emphasis. */
#dev-overview .dev-org-name { color: var(--ink-2); font-weight: 500; }

/* Trailing arrow glyph on .btn-text links (Full map, View all, etc.). */
#dev-overview .btn-text .dev-arrow { font-size: 9px; margin-left: 4px; }

/* Map frame */
#dev-overview #dashboard-map {
  width: 100%; height: 320px;
  border-radius: 0 0 var(--radius) var(--radius);
  background: linear-gradient(135deg, var(--surface-2) 0%, var(--backer-softer) 100%);
}
/* Mock map background - production renders the real Mapbox into #dashboard-map */
#dev-overview .map-mock {
  width: 100%; height: 320px; border-radius: 0 0 var(--radius) var(--radius);
  background:
    radial-gradient(circle at 28% 42%, rgba(45,107,102,.12) 0%, transparent 38%),
    radial-gradient(circle at 62% 55%, rgba(45,107,102,.10) 0%, transparent 32%),
    radial-gradient(circle at 78% 30%, rgba(45,107,102,.08) 0%, transparent 28%),
    linear-gradient(180deg, var(--backer-softer) 0%, var(--surface-2) 100%);
  position: relative; overflow: hidden;
}
#dev-overview .map-mock::before {
  content: ''; position: absolute; inset: 0;
  background:
    linear-gradient(90deg, transparent 0, transparent calc(100% - 1px), var(--line-2) 100%) 0 0 / 48px 48px,
    linear-gradient(0deg, transparent 0, transparent calc(100% - 1px), var(--line-2) 100%) 0 0 / 48px 48px;
  opacity: .35; pointer-events: none;
}
#dev-overview .map-pin {
  position: absolute; width: 12px; height: 12px; border-radius: 50%;
  background: var(--backer); border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(45,107,102,.3), 0 2px 6px rgba(45,107,102,.4);
  cursor: pointer; transition: transform .15s;
}
#dev-overview .map-pin:hover { transform: scale(1.4); z-index: 2; }
#dev-overview .map-pin.amber { background: var(--amber); box-shadow: 0 0 0 1px rgba(176,126,42,.3), 0 2px 6px rgba(176,126,42,.4); }
#dev-overview .map-pin.plum  { background: var(--plum);  box-shadow: 0 0 0 1px rgba(107,74,122,.3), 0 2px 6px rgba(107,74,122,.4); }
#dev-overview .map-pin.green { background: var(--green); box-shadow: 0 0 0 1px rgba(47,122,77,.3),  0 2px 6px rgba(47,122,77,.4); }

/* Sector legend */
#dev-overview .legend-list { display: grid; gap: 8px; margin-top: 14px; }
#dev-overview .legend-row {
  display: grid; grid-template-columns: 12px 1fr auto auto;
  gap: 10px; align-items: center; font-size: 12px;
}
#dev-overview .legend-row .swatch {
  width: 10px; height: 10px; border-radius: 3px;
  background: var(--ink-4);
}
/* Sector palette - aligned to the site-wide `.sector-ico` canonical:
   economic=amber, energy=green, digital=plum, social=blue. */
#dev-overview .legend-row .swatch.economic { background: var(--amber); }
#dev-overview .legend-row .swatch.energy   { background: var(--green); }
#dev-overview .legend-row .swatch.digital  { background: var(--plum);  }
#dev-overview .legend-row .swatch.social   { background: var(--blue);  }
#dev-overview .legend-row .lbl { color: var(--ink-2); }
#dev-overview .legend-row .count {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--ink-3); min-width: 24px; text-align: right;
}
#dev-overview .legend-row .pct {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--ink); font-weight: 500;
  min-width: 36px; text-align: right;
}
/* Optional funding column - only used on the investor sector mix legend. */
#dev-overview .legend-list:has(.legend-row .amt) .legend-row {
  grid-template-columns: 12px 1fr auto auto auto;
}
#dev-overview .legend-row .amt {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--ink-3); font-weight: 500;
  min-width: 52px; text-align: right;
}

/* Sector icon tile reuse */
#dev-overview .dev-sector {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 8px;
  flex-shrink: 0; font-size: 13px;
}
/* Sector tints - match the site-wide `.sector-ico` canonical palette so
   the dashboard glyph reads the same as the same project's chip elsewhere. */
#dev-overview .dev-sector.economic { background: var(--amber-soft); color: var(--amber); }
#dev-overview .dev-sector.energy   { background: var(--green-soft); color: var(--green); }
#dev-overview .dev-sector.digital  { background: var(--plum-soft);  color: var(--plum);  }
#dev-overview .dev-sector.social   { background: var(--blue-soft);  color: var(--blue);  }

/* Country flag chip (page-scoped variant of the global .flag .fc) */
#dev-overview .fc {
  display: inline-block; width: 18px; height: 13px;
  background: var(--surface-2); border: 1px solid var(--line);
  margin-right: 6px; border-radius: 2px; vertical-align: -1px;
  font-size: 9px; line-height: 11px; text-align: center;
  color: var(--ink-3); font-family: var(--font-mono); font-weight: 600;
}
#dev-overview .fc.other { font-weight: 500; color: var(--ink-3); }

/* Bars - simple HTML-rendered bar charts (no ECharts dependency) */
#dev-overview .bars { display: grid; gap: 12px; }
#dev-overview .bar-row {
  display: grid; grid-template-columns: 1fr auto;
  gap: 10px; align-items: center;
  font-size: 12px; color: var(--ink-2);
}
#dev-overview .bar-row .lbl-line {
  display: flex; flex-direction: column; gap: 4px; min-width: 0;
}
#dev-overview .bar-row .lbl-line .lbl-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
#dev-overview .bar-row .lbl-line .lbl-row .lbl {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-transform: capitalize;
}
#dev-overview .bar-row .lbl-line .lbl-row .val {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--ink-3); flex-shrink: 0;
}
#dev-overview .bar-row .track {
  height: 6px; background: var(--surface-2); border-radius: 3px;
  overflow: hidden; width: 100%;
}
#dev-overview .bar-row .fill {
  height: 100%; border-radius: 3px;
  background: var(--backer); transition: width .3s;
}
#dev-overview .bar-row.alt    .fill { background: var(--amber); }
#dev-overview .bar-row.plum   .fill { background: var(--plum); }
#dev-overview .bar-row.blue   .fill { background: var(--blue); }
#dev-overview .bar-row.green  .fill { background: var(--green); }
#dev-overview .bar-row.indigo .fill { background: var(--indigo); }
#dev-overview .bar-row.muted  .fill { background: var(--ink-4); }

/* Portfolio mode (Count / Funding) - bars carry --w-count and --w-funding
   custom properties; the active mode picks which one drives the fill width
   and which of .v-count / .v-funding is visible in the value cell. */
#dev-overview[data-portfolio-mode="count"]   .bar-row .fill { width: var(--w-count, 0%); }
#dev-overview[data-portfolio-mode="funding"] .bar-row .fill { width: var(--w-funding, 0%); }
#dev-overview[data-portfolio-mode="count"]   .bar-row .val .v-funding,
#dev-overview[data-portfolio-mode="count"]   .legend-row .pct .v-funding { display: none; }
#dev-overview[data-portfolio-mode="funding"] .bar-row .val .v-count,
#dev-overview[data-portfolio-mode="funding"] .legend-row .pct .v-count   { display: none; }

/* Portfolio toggle on the section head - slightly more presence than the
   in-card .sector-toggle since it lives next to the section heading. */
#dev-overview .portfolio-toggle { padding: 2px; border-radius: 8px; }
#dev-overview .portfolio-toggle button {
  padding: 3px 10px; font-size: 11px; font-weight: 500; border-radius: 6px;
}

/* Stage Mix + Geography 3-way toggles share the in-card .sector-toggle
   sizing so all three breakdown cards have matching toggle chrome. */
#dev-overview .stage-toggle,
#dev-overview .geo-toggle { padding: 2px; border-radius: 8px; }
#dev-overview .stage-toggle button,
#dev-overview .geo-toggle button {
  padding: 3px 8px; font-size: 11px; font-weight: 500; border-radius: 6px;
}

/* Allow the ch-head to wrap when the 3-way toggle would otherwise push the
   heading off the row at the narrower breakdown-card widths. */
#dev-overview .dev-mini-card .ch-head { flex-wrap: wrap; row-gap: 6px; }

/* Sector mix - interactive ECharts donut.
   The chart paints itself; .sector-chart is just the box ECharts mounts
   into. The empty-state variant renders a centred "0 Active" placeholder
   without loading the chart library at all. */
#dev-overview .sector-chart {
  width: 100%;
  height: 220px;
  margin: 4px 0 2px;
}
#dev-overview .sector-chart-empty {
  height: 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
#dev-overview .donut-num {
  font-family: var(--font-sans); font-weight: 500;
  font-size: 22px; color: var(--ink); letter-spacing: -0.01em;
  line-height: 1;
}
#dev-overview .donut-sub {
  font-size: 10px; color: var(--ink-3);
  letter-spacing: .06em; text-transform: uppercase;
  font-weight: 600;
}
#dev-overview .donut-num.muted { color: var(--ink-4); }
#dev-overview .donut-empty-note {
  color: var(--ink-3); font-size: 12px;
  text-align: center; padding-top: 6px;
}
#dev-overview .dev-empty {
  color: var(--ink-3); font-size: 12px;
  text-align: center; padding: 24px 0;
}
#dev-overview .dev-empty.tall { padding: 32px 0; }
#dev-overview .map-mock-note {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  color: var(--ink-3); font-size: 12px;
  text-align: center; padding: 24px;
}

/* Hash-anchored EM sections - skip past the sticky topbar when /
   /pipeline/engagements#em-section-projects is navigated to from
   the dashboard quick actions. */
#em-section-projects,
#em-section-requests { scroll-margin-top: 80px; }

/* Pipeline progression - dual-track lifecycle timeline */
#dev-overview .lc-card { padding: 20px 22px 22px; }
#dev-overview .lc-lanes { display: flex; flex-direction: column; }
#dev-overview .lc-lane {
  display: grid;
  grid-template-columns: 168px 1fr;
  gap: 22px;
  align-items: stretch;
  padding: 18px 0;
  border-top: 1px dashed var(--line-2);
}
#dev-overview .lc-lane:first-child { border-top: none; padding-top: 6px; }
#dev-overview .lc-lane:last-child { padding-bottom: 4px; }

#dev-overview .lc-lane-head {
  padding-right: 18px;
  border-right: 1px solid var(--line-2);
  display: flex; flex-direction: column;
}
#dev-overview .lc-lane-head .eye {
  font-size: 10.5px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-3);
}
#dev-overview .lc-lane-head .num {
  font-family: var(--font-sans); font-weight: 500;
  font-size: 28px; letter-spacing: -0.01em; line-height: 1;
  color: var(--ink); margin: 8px 0 4px;
}
#dev-overview .lc-lane-head .num .of {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--ink-3); font-weight: 500; margin-left: 4px;
  letter-spacing: 0; vertical-align: 4px;
}
#dev-overview .lc-lane-head .sub {
  font-size: 11.5px; color: var(--ink-3); line-height: 1.4;
}
#dev-overview .lc-lane-head .foot {
  margin-top: auto; padding-top: 10px;
  font-size: 11px; color: var(--ink-3);
  display: flex; align-items: center; gap: 6px;
}
#dev-overview .lc-lane-head .foot.warn { color: var(--amber); font-weight: 500; }
#dev-overview .lc-lane-head .foot i { font-size: 10px; }

#dev-overview .lc-track {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  position: relative;
  min-width: 0;
}

#dev-overview .lc-stage {
  display: flex; flex-direction: column; gap: 6px;
  min-width: 0;
}
#dev-overview .lc-stage-head {
  display: flex; align-items: center; gap: 7px;
  font-size: 11px; font-weight: 600; color: var(--ink-2);
  padding: 6px 9px;
  background: var(--surface-2);
  border-radius: 5px;
  text-transform: capitalize;
  letter-spacing: 0;
}
#dev-overview .lc-stage-head .dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--ink-4);
  flex-shrink: 0;
}
#dev-overview .lc-stage-head .lbl {
  flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#dev-overview .lc-stage-head .n {
  font-family: var(--font-mono); font-size: 10.5px;
  color: var(--ink-3); font-weight: 500;
  flex-shrink: 0;
}
#dev-overview .lc-stage.live        .lc-stage-head .dot { background: var(--backer); }
#dev-overview .lc-stage.shortlisted .lc-stage-head .dot { background: var(--blue); }
#dev-overview .lc-stage.preferred   .lc-stage-head .dot { background: var(--plum); }
#dev-overview .lc-stage.dd          .lc-stage-head .dot { background: var(--amber); }
#dev-overview .lc-stage.closed      .lc-stage-head .dot { background: var(--green); }

#dev-overview .lc-chips { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
#dev-overview .lc-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 9px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 5px;
  text-decoration: none;
  line-height: 1.25;
  transition: border-color .1s, background .1s;
  min-width: 0;
}
#dev-overview .lc-chip:hover {
  border-color: var(--backer);
  background: var(--backer-softer);
}
#dev-overview .lc-chip .body {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 1px;
}
#dev-overview .lc-chip .nm {
  min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-size: 11.5px; color: var(--ink); font-weight: 500;
}
#dev-overview .lc-chip .svc {
  font-size: 10px; color: var(--ink-3); font-weight: 400;
  letter-spacing: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#dev-overview .lc-chip .age {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--ink-3); flex-shrink: 0;
}
#dev-overview .lc-chip.urgent { border-color: var(--amber-soft); }
#dev-overview .lc-chip.urgent .age { color: var(--amber); font-weight: 600; }
#dev-overview .lc-chip.more {
  background: transparent; border-style: dashed;
  color: var(--ink-3); justify-content: center;
  font-size: 11px; font-weight: 500;
}
#dev-overview .lc-chip.more:hover { color: var(--backer); border-color: var(--backer); background: transparent; }
#dev-overview .lc-empty {
  font-size: 11px; color: var(--ink-4);
  padding: 8px 9px; text-align: center;
  border: 1px dashed var(--line-2); border-radius: 5px;
}

/* Funding coverage card */
#dev-overview .fund-list { display: flex; flex-direction: column; }
/* Pin the funding footer (pager + .fund-foot legend) to the bottom of the card.
   The base .card is already a flex column whose .card-body grows to fill the
   card height (see §"Pin .card-foot to the bottom" near the top of this file),
   so when the adjacent Recent activity card stretches the .dev-grid-2b row the
   funding body already fills it. This card keeps its list + pager + legend in one
   .card-body, so we only need to make THAT body a flex column and let the row
   list grow - which pushes the trailing pager + legend flush to the bottom.
   No-op on the full-width admin card (no surplus height). */
#dev-overview .card-body[data-funding-card] { display: flex; flex-direction: column; }
#dev-overview .card-body[data-funding-card] > .fund-list { flex: 1 1 auto; }
/* Each funding row is a native <details class="fr-row" name="fund-acc">
   accordion. The dashed divider is on the row; the 13px padding lives on the
   <summary> so the collapsed and expanded states share one rhythm. */
#dev-overview .fr-row { border-top: 1px dashed var(--line-2); }
#dev-overview .fr-row:first-child { border-top: none; }
#dev-overview .fr-row.dash-first { border-top: none; }
#dev-overview .mand-row.dash-first { border-top: none; padding-top: 4px; }
#dev-overview .fund-list-2col { display: grid; grid-template-columns: 1fr 1fr; column-gap: 28px; row-gap: 0; }
@media (max-width: 1099.98px) {
  #dev-overview .fund-list-2col { grid-template-columns: 1fr; }
}

#dev-overview .fund-head {
  display: flex; align-items: center; gap: 10px;
  font-size: 12.5px;
}
#dev-overview .fund-head .nm {
  flex: 1; min-width: 0;
  font-weight: 500; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-decoration: none;
}
#dev-overview .fund-head .nm:hover { color: var(--backer); }
#dev-overview .fund-head .amounts {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--ink-3); flex-shrink: 0;
  letter-spacing: 0;
}
#dev-overview .fund-head .amounts .have { color: var(--ink); font-weight: 500; }
#dev-overview .fund-head .amounts .sep { margin: 0 3px; color: var(--ink-4); }
#dev-overview .fund-head .pct {
  font-family: var(--font-mono); font-size: 11px;
  font-weight: 600; padding: 2px 7px; border-radius: 4px;
  background: var(--surface-2); color: var(--ink-2);
  flex-shrink: 0; min-width: 46px; text-align: center;
}
#dev-overview .fund-head .pct.full  { background: var(--green-soft);  color: var(--green); }
#dev-overview .fund-head .pct.short { background: var(--amber-soft);  color: var(--amber); }
#dev-overview .fund-head .pct.gap   { background: var(--red-soft);    color: var(--red); }

/* Collapsed <summary>: head (reuses .fund-head) + combined bar + status line,
   stacked 8px apart. The native disclosure marker is hidden; the chevron in
   .fund-head rotates on [open]. */
#dev-overview .fr-summary {
  list-style: none;
  display: grid; gap: 8px; width: 100%;
  padding: 13px 0; cursor: pointer;
}
#dev-overview .fr-summary::-webkit-details-marker { display: none; }
#dev-overview .fr-summary:hover .nm { color: var(--backer); }
#dev-overview .fr-summary:focus-visible { outline: 2px solid var(--backer); outline-offset: 3px; border-radius: 6px; }
#dev-overview .fr-chev {
  color: var(--ink-4); font-size: 10px; width: 12px;
  text-align: center; flex-shrink: 0; transition: transform .18s;
}
#dev-overview .fr-row[open] .fr-chev { transform: rotate(90deg); }

/* Combined bar: each segment's width = its category's share of the total ask;
   the pale .ghost spans the whole segment (the ask) and the solid .fill
   (offered) grows from the left. Solid = funded, pale = shortfall, per
   category and overall. No separator, no target marker (per design). */
#dev-overview .fr-bar { height: 16px; background: var(--surface-2); border-radius: 5px; display: flex; overflow: hidden; }
#dev-overview .fr-bar .seg { height: 100%; position: relative; flex-shrink: 0; cursor: pointer; }
#dev-overview .fr-bar .seg .ghost { position: absolute; inset: 0; background: var(--c); opacity: .2; }
#dev-overview .fr-bar .seg .fill  { position: absolute; left: 0; top: 0; bottom: 0; background: var(--c); }
#dev-overview .fr-bar .seg:hover .ghost,
#dev-overview .fr-bar .seg:hover .fill { filter: brightness(1.1); }

/* Status sub-line under the bar: "{funded}/{asked} categories funded" + the
   Over/Gap/Fully-funded tag (or the investor lifecycle pill) + any "no ask"
   mismatch tags. */
#dev-overview .fr-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-family: var(--font-mono); font-size: 10px; color: var(--ink-3); }
#dev-overview .fr-sub .grow { flex: 1; }
#dev-overview .fr-sub .tag      { font-weight: 500; }
#dev-overview .fr-sub .tag.gap  { color: var(--red); }
#dev-overview .fr-sub .tag.over { color: var(--green); }
#dev-overview .fr-sub .tag.full { color: var(--green); }
#dev-overview .fr-sub .tag.mis  { color: var(--amber); }

/* Expanded detail: one normalised track per category (100% = that category's
   own ask). Ghost = ask, fill = offered toward ask, green nub = over-
   subscription, hatch = an offered category with no ask. */
#dev-overview .fr-detail-inner { padding: 4px 0 16px; display: grid; gap: 8px; }
#dev-overview .fr-detail-inner .cap { font-family: var(--font-mono); font-size: 9px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-4); margin: 0; }
/* Fixed numbers column (not auto) so every expanded track is the same length
   regardless of how long its "currency X / X" figure is - the third column is
   pinned, so the 1fr track resolves identically on every row. */
#dev-overview .fr-cat { display: grid; grid-template-columns: 140px 1fr 104px; gap: 11px; align-items: center; }
#dev-overview .fr-cat .clbl { display: flex; align-items: center; gap: 7px; min-width: 0; font-size: 11px; color: var(--ink-2); }
#dev-overview .fr-cat .clbl .dot { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; background: var(--c); }
#dev-overview .fr-cat .clbl .lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#dev-overview .fr-cat.miss .clbl { color: var(--amber); }
#dev-overview .fr-track { height: 13px; border-radius: 4px; background: var(--surface-2); position: relative; overflow: hidden; }
#dev-overview .fr-track .ghost { position: absolute; inset: 0; background: var(--c); opacity: .16; }
#dev-overview .fr-track .fill  { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px 0 0 4px; background: var(--c); }
#dev-overview .fr-track .over  { position: absolute; right: 0; top: 0; bottom: 0; width: 3px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--green); }
#dev-overview .fr-track .hatch { position: absolute; inset: 0; background-image: repeating-linear-gradient(45deg, var(--red) 0 1.5px, transparent 1.5px 5px); opacity: .5; }
#dev-overview .fr-cat .nums { font-family: var(--font-mono); font-size: 10px; color: var(--ink-3); text-align: right; white-space: nowrap; }
#dev-overview .fr-cat .nums .o { color: var(--ink); font-weight: 500; }
#dev-overview .fr-cat .nums .o.met { color: var(--green); }
/* The .cat-* funding-category palette moved to the shared component library
   (just after the .pill colour variants) - it's a platform-wide token, not
   dashboard-only. The #dev-overview .fr-* rules below consume it via var(--c). */
#dev-overview .fund-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px var(--card-pad) 0;
  margin: 6px calc(-1 * var(--card-pad)) 0;
  border-top: 1px solid var(--line-2);
  font-size: 11px; color: var(--ink-3);
}
#dev-overview .fund-foot .legend { display: flex; gap: 14px; flex-wrap: wrap; }
#dev-overview .fund-foot .legend .t { display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-mono); letter-spacing: 0; }
#dev-overview .fund-foot .legend .t .sw { width: 8px; height: 8px; border-radius: 2px; background: var(--c); }
/* Dashboard reuses .em-table-foot chrome for its pagination but the cards
   don't have the EM table's 22px row gutter, so drop the horizontal padding
   when the foot is also marked .dash-pager. Vertical padding stays. */
#dev-overview .em-table-foot.dash-pager { padding-left: 0; padding-right: 0; }
/* Card-foot hint (mock: "click a row | solid offered | pale shortfall"). */
#dev-overview .fund-foot .hint { margin-left: auto; font-family: var(--font-mono); font-size: 10px; color: var(--ink-3); }
#dev-overview .fund-foot .hint b { color: var(--ink-2); font-weight: 600; }

/* Funding card interactivity. Combined-bar segments are hover-targets for the
   singleton .fund-tip tooltip (styled to match the sector-donut ECharts
   tooltip); footer legend chips are <button>s that toggle a whole capital-stack
   family off across every row's bar + expanded tracks via .is-off-<token>
   classes on [data-funding-card] (one per member swatch of the family). */
/* Reset native button chrome on the legend chips so they read identically to
   the previous <span> rendering. */
#dev-overview .fund-foot .legend .t {
  appearance: none;
  background: transparent; border: 0; padding: 0;
  font-size: 11px; color: inherit;
  cursor: pointer;
  transition: opacity .15s;
}
#dev-overview .fund-foot .legend .t:hover { color: var(--ink); }
#dev-overview .fund-foot .legend .t:focus-visible {
  outline: 2px solid var(--backer-soft); outline-offset: 3px; border-radius: 3px;
}
/* Filtered state - chip dims to ~40% so it still reads as "this swatch
   exists" but is clearly toggled off. */
#dev-overview .fund-foot .legend .t[aria-pressed="false"] { opacity: 0.4; }
#dev-overview .fund-foot .legend .t[aria-pressed="false"] .sw { filter: grayscale(0.4); }
/* Hide matching swatches across the card - both the collapsed bar segment and
   the expanded per-category track row. display:none cleanly removes them; the
   remaining segments keep their fixed %-widths so the ask proportions stay
   anchored. One .is-off-<token> per swatch (the legend toggles all members of
   a family at once). */
/* `#dev-overview` prefix bumps these past the id-scoped `#dev-overview .fr-cat
   { display: grid }` base rule so the expanded category rows actually hide
   (a class-only selector would lose the cascade and leave them visible). */
#dev-overview [data-funding-card].is-off-cat-equity       .fr-bar .seg.cat-equity,
#dev-overview [data-funding-card].is-off-cat-equity       .fr-cat.cat-equity,
#dev-overview [data-funding-card].is-off-cat-hybrid       .fr-bar .seg.cat-hybrid,
#dev-overview [data-funding-card].is-off-cat-hybrid       .fr-cat.cat-hybrid,
#dev-overview [data-funding-card].is-off-cat-senior       .fr-bar .seg.cat-senior,
#dev-overview [data-funding-card].is-off-cat-senior       .fr-cat.cat-senior,
#dev-overview [data-funding-card].is-off-cat-subordinated .fr-bar .seg.cat-subordinated,
#dev-overview [data-funding-card].is-off-cat-subordinated .fr-cat.cat-subordinated,
#dev-overview [data-funding-card].is-off-cat-working      .fr-bar .seg.cat-working,
#dev-overview [data-funding-card].is-off-cat-working      .fr-cat.cat-working,
#dev-overview [data-funding-card].is-off-cat-concessional .fr-bar .seg.cat-concessional,
#dev-overview [data-funding-card].is-off-cat-concessional .fr-cat.cat-concessional,
#dev-overview [data-funding-card].is-off-cat-other        .fr-bar .seg.cat-other,
#dev-overview [data-funding-card].is-off-cat-other        .fr-cat.cat-other { display: none; }

/* Singleton tooltip - styled to match the ECharts sector-donut tooltip so
   the funding-card hover and the sector-donut hover feel like one system.
   Lives on document.body so card overflow doesn't clip it. */
.fund-tip {
  position: fixed; z-index: 1000;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 10px;
  font-family: var(--font-sans);
  font-size: 12px; color: var(--ink);
  box-shadow: var(--shadow-pop);
  pointer-events: none;
  white-space: nowrap;
  line-height: 1.35;
}
.fund-tip[hidden] { display: none; }
.fund-tip .ft-head { font-weight: 600; }
.fund-tip .ft-amt {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--ink-2); margin-top: 2px;
}

/* My active expressions (advisor dashboard) - tabular row list with
   sector-tinted glyph, service-coloured tag, competitor dots, status pill
   and relative-time chip. Same `.mand-*` shape as the preview mock at
   references/mocks/overview_advisor_preview.html. */
#dev-overview .mand-list { display: flex; flex-direction: column; }
#dev-overview .mand-row {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  gap: 12px;
  align-items: start;
  padding: 14px 0;
  border-top: 1px dashed var(--line-2);
  color: inherit; text-decoration: none;
}
#dev-overview .mand-row:first-child { border-top: none; padding-top: 4px; }
#dev-overview .mand-row:last-child  { padding-bottom: 4px; }
#dev-overview .mand-row:hover .title { color: var(--backer); }
/* Top-align the sector glyph + right-rail status pill to the first line
   of .title - matches the activity-list row treatment so the title row
   reads as the anchor regardless of whether .meta wraps. */
#dev-overview .mand-row .dev-sector {
  width: 30px; height: 30px; font-size: 13px;
  margin-top: 1px;
}
#dev-overview .mand-row > .pill { margin-top: 1px; }
#dev-overview .mand-row .body { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
#dev-overview .mand-row .title {
  font-size: 13px; color: var(--ink); font-weight: 500;
  line-height: 1.3; transition: color .1s;
}
#dev-overview .mand-row .meta {
  font-size: 11.5px; color: var(--ink-3);
  line-height: 1.4;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
#dev-overview .mand-row .meta .dot-sep {
  width: 3px; height: 3px; border-radius: 50%;
  background: var(--ink-4); flex-shrink: 0;
}
/* Responsive */
@media (max-width: 1100px) {
  #dev-overview .dev-grid-2,
  #dev-overview .dev-grid-2b { grid-template-columns: 1fr; }
  #dev-overview .dev-grid-3  { grid-template-columns: repeat(2,1fr); }
  #dev-overview .lc-lane { grid-template-columns: 1fr; }
  #dev-overview .lc-lane-head {
    padding-right: 0; padding-bottom: 14px;
    border-right: none; border-bottom: 1px dashed var(--line-2);
    flex-direction: row; align-items: baseline; gap: 14px; flex-wrap: wrap;
  }
  #dev-overview .lc-lane-head .num { margin: 0; }
  #dev-overview .lc-lane-head .foot { margin-top: 0; padding-top: 0; }
}
@media (max-width: 800px) {
  #dev-overview .lc-track { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  #dev-overview .dev-grid-3 { grid-template-columns: 1fr; }
}


/* =====================================================================
   22. PAGE: NOTIFICATIONS (.nf-*)
   The row primitive (.nf-row / .nf-ico / .nf-body / .nf-title / .nf-msg /
   .nf-meta / .nf-cat-pill / .nf-actions) is unscoped so it can be reused
   by the full /notifications page (#nf-page) AND the topbar bell dropdown
   (.nf-dd). Page-shell rules (day dividers, segmented tabs, card-foot
   pager, category-summary cluster, page-title count chip) stay under
   #nf-page. Dropdown-only chrome lives under .nf-dd at the bottom. All
   declarations compose tokens already defined in §1-2.
   ===================================================================== */

/* ---- Shared row primitive (page + dropdown) ---- */

/* Notification row. */
.nf-row {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 14px;
  align-items: flex-start;
  padding: 14px 22px;
  border-bottom: 1px solid var(--line-2);
  position: relative;
  transition: background .12s;
}
.nf-row:last-child { border-bottom: none; }
.nf-row:hover { background: var(--backer-softer); }

/* Unread state: brand left rail + raised paper. */
.nf-row.unread { background: var(--surface-2); }
.nf-row.unread:hover { background: var(--backer-soft); }
.nf-row.unread::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--backer);
}

/* Icon tile - palette mirrors backer.css .person.* + .pill.* tones. */
.nf-ico {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 14px;
  flex-shrink: 0;
}
.nf-ico.teal   { background: var(--backer-soft); color: var(--backer-ink); }
.nf-ico.amber  { background: var(--amber-soft);  color: var(--amber); }
.nf-ico.plum   { background: var(--plum-soft);   color: var(--plum); }
.nf-ico.blue   { background: var(--blue-soft);   color: var(--blue); }
.nf-ico.green  { background: var(--green-soft);  color: var(--green); }
.nf-ico.red    { background: var(--red-soft);    color: var(--red); }
.nf-ico.indigo { background: var(--indigo-soft); color: var(--indigo); }
.nf-ico.ghost  { background: var(--surface-2);   color: var(--ink-3); border: 1px solid var(--line); }

/* Body. */
.nf-body { min-width: 0; line-height: 1.4; }
.nf-title {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink);
  margin: 0 0 2px;
  letter-spacing: -0.005em;
}
.nf-row.unread .nf-title { font-weight: 600; }
.nf-title a { color: inherit; text-decoration: none; }
.nf-title a:hover { color: var(--backer); }
.nf-msg {
  font-size: 12.5px;
  color: var(--ink-2);
  margin: 0 0 6px;
  overflow-wrap: anywhere;
}
.nf-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11.5px;
  color: var(--ink-3);
  flex-wrap: wrap;
}
.nf-meta .when {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: -.01em;
}
/* Separator dot between facts in a multi-fact meta line. The bell dropdown and
   the /notifications inbox dropped their dot (pill + time read fine on the
   gap), but the admin /admin/notifications oversight row keeps it - its meta
   line carries four facts (recipient / category / time / type). */
.nf-meta .dot {
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--ink-4);
  display: inline-block;
}
.nf-cat-pill { padding: 1px 7px; font-size: 10px; }

/* Right-side actions cluster. */
.nf-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}
.nf-actions .btn-text {
  padding: 2px 0;
  font-size: 12px;
  color: var(--ink-3);
  border: 0;
  background: transparent;
  cursor: pointer;
}
.nf-actions .mark-read-btn {
  color: var(--backer);
  font-weight: 700;
}
.nf-actions .mark-read-btn:hover { color: var(--backer-ink); }
.nf-actions .btn-text:disabled,
.nf-actions .nf-read-label {
  opacity: .4;
  cursor: default;
  color: var(--ink-3);
  font-weight: 500;
}
.nf-actions .nf-read-label:hover { color: var(--ink-3); }


/* ---- /notifications page shell (#nf-page only) ---- */

#nf-page .nf-title-count {
  font-family: var(--font-mono);
  font-size: .72em;
  letter-spacing: 0;
  color: var(--ink-3);
}
#nf-page .nf-mark-all-form { display: inline; margin: 0; }
#nf-page .nf-pager-info { font-size: 12px; color: var(--ink-3); }
#nf-page .nf-perpage { font-size: 12px; color: var(--ink-4); font-family: var(--font-mono); }

/* Segmented filter (All / Unread) - composed from existing surface tokens. */
#nf-page .nf-tabs {
  display: inline-flex;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}
#nf-page .nf-tabs a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-3);
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
}
#nf-page .nf-tabs a:hover { color: var(--ink); }
#nf-page .nf-tabs a.on {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
#nf-page .nf-tabs a .count {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-3);
  background: var(--surface);
  padding: 1px 5px;
  border-radius: 4px;
}
#nf-page .nf-tabs a.on .count { background: var(--backer-soft); color: var(--backer-ink); }

/* Day-divider strip inside the list. */
#nf-page .nf-day {
  padding: 10px var(--card-pad);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  background: var(--surface-2);
  border-bottom: 1px solid var(--line-2);
}

/* Inbox card-head category-count cluster. */
#nf-page .nf-cat-summary {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
#nf-page .nf-cat-summary-pill {
  font-size: 11px;
  padding: 2px 9px;
}
#nf-page .nf-cat-summary-pill strong {
  font-family: var(--font-mono);
  font-weight: 600;
  margin-right: 2px;
}

/* Pager footer alignment. */
#nf-page .card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

/* Mobile: collapse the right-actions column under the body. */
@media (max-width: 575.98px) {
  #nf-page .nf-row {
    grid-template-columns: 36px 1fr;
    grid-template-areas: "ico body" "ico actions";
    row-gap: 6px;
    padding: 14px 16px;
  }
  #nf-page .nf-ico { grid-area: ico; }
  #nf-page .nf-body { grid-area: body; }
  #nf-page .nf-actions { grid-area: actions; flex-direction: row; align-items: center; }
}


/* ---- Topbar bell dropdown (.nf-dd) ---- */

/* Frame - overrides Bootstrap's .dropdown-menu padding/border to match
   the .card chrome used elsewhere in the topbar. */
.dropdown-menu.nf-dd {
  width: 380px;
  min-width: 380px;
  max-width: calc(100vw - 32px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-pop);
  overflow: hidden;
}

/* Head - compact bar with title + Mark all read. */
.nf-dd-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-2);
  background: var(--surface);
}
.nf-dd-head .nf-dd-title {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.005em;
}
.nf-dd-head .nf-dd-mark-all {
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--backer);
  cursor: pointer;
}
.nf-dd-head .nf-dd-mark-all:hover { color: var(--backer-ink); }
.nf-dd-head .nf-dd-mark-all:disabled {
  opacity: .35;
  cursor: default;
  color: var(--ink-3);
  font-weight: 500;
}

/* Scrollable list region. */
.nf-dd-list {
  max-height: 22rem;
  overflow-y: auto;
}

/* Empty + loading states. */
.nf-dd-empty {
  text-align: center;
  padding: 36px 18px;
  color: var(--ink-3);
}
.nf-dd-empty .glyph {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--ink-4);
  font-size: 14px;
  margin-bottom: 8px;
}
.nf-dd-empty p { margin: 0; font-size: 12px; }

/* Row variant - tighter padding, no message wrap, no per-row mark-read
   button (header carries Mark all read; clicking the row marks-read +
   navigates). */
.nf-dd .nf-row {
  padding: 11px 14px;
  grid-template-columns: 32px 1fr;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}
.nf-dd .nf-row:last-child { border-bottom: none; }
.nf-dd .nf-ico { width: 32px; height: 32px; font-size: 12px; }
.nf-dd .nf-title {
  font-size: 12.5px;
  margin-bottom: 1px;
  /* clamp to one line. */
  display: -webkit-box;
  -webkit-line-clamp: 1;
  line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.nf-dd .nf-msg {
  font-size: 11.5px;
  margin-bottom: 4px;
  /* clamp to two lines. */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.nf-dd .nf-meta { gap: 8px; font-size: 10.5px; }
.nf-dd .nf-meta .when { font-size: 10px; }
.nf-dd .nf-cat-pill { padding: 1px 6px; font-size: 9.5px; }

/* Footer link - "View all". */
.nf-dd-foot {
  display: block;
  padding: 10px 14px;
  text-align: center;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--backer);
  text-decoration: none;
  border-top: 1px solid var(--line-2);
  background: var(--surface);
}
.nf-dd-foot:hover { color: var(--backer-ink); background: var(--backer-softer); }

/* Unread-count badge on the bell icon. */
.tb-icon-btn .notif-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  min-width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  border: 2px solid var(--surface);
  box-sizing: content-box;
}


/* =====================================================================
   23. PAGE: PROFILE SETTINGS (.ps-*)
   Page-scoped under #ps-page. Two-column shell with a sticky section nav
   on the left and anchored sections on the right. Composes existing
   primitives (.card, .field, .pill, .dtable, .view-toggle, .ghost-alert,
   .profile-hero from §15, the .sector-ico from §9). Declarations
   below resolve to tokens from §1-2 only.
   ===================================================================== */

#ps-page { padding-bottom: 40px; }

/* ---- Single-column shell: horizontal nav bar on top, sections below ---- */
.ps-shell { display: block; }

/* ---- Section nav: a sticky horizontal "sliding" bar pinned under the topbar.
   The link row scrolls horizontally (overflow-x) when it can't fit, and stays
   pinned vertically just below the 56px sticky topbar as the page scrolls. */
.ps-nav {
  position: sticky;
  top: 56px;            /* directly under the 56px sticky topbar */
  z-index: 5;           /* below the topbar (z-index:10), above section cards */
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 8px 0;
  margin-bottom: 24px;
  background: var(--bg);    /* opaque so scrolled content doesn't show through */
  border-bottom: 1px solid var(--line-2);
  scrollbar-width: thin;
}
/* Group labels ("Personal", "Plan" ...) only read as a vertical-rail header;
   the nav is now always a horizontal slider, so they're hidden. */
.ps-nav .ps-nav-label { display: none; }
.ps-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--ink-2);
  text-decoration: none;
  transition: background .12s, color .12s;
  white-space: nowrap;
}
.ps-nav a .ico {
  width: 16px;
  display: grid;
  place-items: center;
  font-size: 12px;
  color: var(--ink-4);
}
.ps-nav a:hover { background: var(--surface-2); color: var(--ink); }
.ps-nav a.on {
  background: var(--backer-soft);
  color: var(--backer-ink);
  font-weight: 600;
}
.ps-nav a.on .ico { color: var(--backer-ink); }
.ps-nav a.danger.on { background: var(--red-soft); color: var(--red); }
.ps-nav a.danger.on .ico { color: var(--red); }
.ps-nav .ps-nav-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-4);
  padding: 14px 12px 4px;
}
.ps-nav .ps-nav-label:first-child { padding-top: 4px; }

/* ---- Sections ---- */
.ps-section {
  /* Clear the 56px topbar + the ~56px sticky horizontal nav so an anchored
     jump doesn't tuck the section head under the nav bar. */
  scroll-margin-top: 116px;
  margin-bottom: 28px;
}
.ps-section-head { margin-bottom: 12px; }
.ps-section-head h2 {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 20px;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.ps-section-head p {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--ink-3);
  max-width: 640px;
}

/* ---- Avatar uploader row (Account card) ---- */
.ps-avatar-row {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 4px 0 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line-2);
}
.ps-avatar {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: linear-gradient(140deg, var(--backer) 0%, #4ea49c 100%);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 500;
  font-size: 22px;
  letter-spacing: -0.02em;
  box-shadow: 0 12px 24px -16px rgba(29,71,68,.5);
  flex-shrink: 0;
}
.ps-avatar-uploader-text b {
  display: block;
  font-size: 13.5px;
  color: var(--ink);
  font-weight: 500;
}
.ps-avatar-uploader-text span {
  font-size: 12px;
  color: var(--ink-3);
}
.ps-avatar-actions { display: flex; gap: 8px; }

/* ---- KV rows (Account status, Organisation card, etc.) ---- */
.ps-kv {
  display: grid;
  grid-template-columns: minmax(100px, 130px) minmax(0, 1fr);
  gap: 6px 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-2);
  font-size: 13px;
  align-items: center;
}
.ps-kv:last-child { border-bottom: none; }
.ps-kv .k { color: var(--ink-3); font-size: 12px; }
.ps-kv .v { color: var(--ink); min-width: 0; word-break: break-word; }
.ps-kv .v.mono { font-family: var(--font-mono); font-size: 12.5px; word-break: break-all; }
.ps-kv .v.unset { color: var(--ink-4); }
/* Below 1280px (when the Account/Org cards squeeze inside col-lg-4 / col-md-6
   tracks) the fixed key column wastes width. Stack labels above values so
   the value can use the full card width. */
@media (max-width: 1279.98px) {
  .ps-kv { grid-template-columns: 1fr; gap: 2px; padding: 8px 0; }
  .ps-kv .k { font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }
}

/* ---- Plan hero (Subscription card) ---- */
.ps-plan {
  background: linear-gradient(135deg, #173e3b 0%, #245854 70%, #2d6b66 100%);
  color: #e3ecea;
  border-radius: var(--radius);
  padding: 24px 26px 22px;
  position: relative;
  overflow: hidden;
}
.ps-plan::after {
  content: '';
  position: absolute;
  right: -80px;
  top: -80px;
  width: 280px;
  height: 280px;
  background: radial-gradient(closest-side, rgba(95,189,179,.18), transparent 70%);
  pointer-events: none;
}
.ps-plan-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.ps-plan-eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #93cbc4;
}
.ps-plan h3 {
  margin: 4px 0 6px;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 22px;
  letter-spacing: -0.015em;
  color: #fff;
}
.ps-plan-amount {
  font-family: var(--font-mono);
  font-size: 13px;
  color: #c5d8d5;
}
.ps-plan-amount b {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 18px;
  color: #fff;
}
.ps-plan-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(95,189,179,.18);
  color: #aae0d8;
  border: 1px solid rgba(95,189,179,.32);
}
.ps-plan-badge .dot { width: 6px; height: 6px; border-radius: 50%; background: #6fdcc9; }
.ps-plan-badge.amber { background: rgba(217,156,40,.18); color: #f3d28a; border-color: rgba(217,156,40,.32); }
.ps-plan-badge.amber .dot { background: var(--amber); }
.ps-plan-badge.ghost { background: rgba(255,255,255,.10); color: #d6e0de; border-color: rgba(255,255,255,.18); }
.ps-plan-badge.ghost .dot { background: #aab8b6; }
.ps-plan-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}
@media (max-width: 660px) { .ps-plan-grid { grid-template-columns: 1fr 1fr; } }
.ps-plan-stat .l {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #8ebab4;
}
.ps-plan-stat .v {
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 14px;
  color: #fff;
}
.ps-plan-stat .v.sans {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 16px;
  letter-spacing: -0.01em;
}
.ps-plan-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ps-plan .btn-on-dark {
  background: #fff;
  color: #143b38;
  border: 1px solid #fff;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
}
.ps-plan .btn-on-dark:hover:not([disabled]) {
  background: #e8efed;
  border-color: #e8efed;
  color: #143b38;
}
.ps-plan .btn-on-dark[disabled] { opacity: .55; cursor: not-allowed; }
.ps-plan .btn-on-dark-ghost {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255,255,255,.32);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
}
.ps-plan .btn-on-dark-ghost:hover:not([disabled]) {
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.55);
}
.ps-plan .btn-on-dark-ghost[disabled] { opacity: .55; cursor: not-allowed; }

/* ---- Featured-listing inline picker (on the dark plan surface) ---- */
.ps-plan-note {
  font-size: 12.5px;
  line-height: 1.5;
  color: #c5d8d5;
  margin: 0 0 16px;
}
.ps-plan-warn {
  font-size: 12px;
  line-height: 1.5;
  color: #f3d28a;
  background: rgba(217,156,40,.14);
  border: 1px solid rgba(217,156,40,.30);
  border-radius: 8px;
  padding: 8px 11px;
  margin: 0 0 14px;
}
.ps-plan-form {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.ps-plan-form label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1 1 200px;
  min-width: 0;
}
.ps-plan-form label > span {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #8ebab4;
}
.ps-plan-form select {
  width: 100%;
  background: rgba(255,255,255,.08);
  color: #fff;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  font-family: var(--font-sans);
}
.ps-plan-form select:focus {
  outline: none;
  border-color: rgba(255,255,255,.55);
  box-shadow: 0 0 0 3px rgba(95,189,179,.18);
}
.ps-plan-form select option { color: #143b38; }
.ps-plan-active-list {
  margin-top: 16px;
  display: grid;
  gap: 6px;
}
.ps-plan-active-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: #d6e0de;
}
.ps-plan-active-row i { color: var(--amber); font-size: 11px; }

/* ---- Inline form message (e.g. change-password AJAX result) ---- */
.ps-inline-msg {
  margin-top: 12px;
  font-size: 12.5px;
  line-height: 1.5;
  padding: 8px 11px;
  border-radius: 8px;
}
.ps-inline-msg.ok {
  color: var(--green);
  background: var(--green-soft);
  border: 1px solid var(--green-soft);
}
.ps-inline-msg.err {
  color: var(--red);
  background: var(--red-soft);
  border: 1px solid var(--red-soft);
}

/* ---- Feature checklist (Premium "What you get") ---- */
.ps-features { display: grid; gap: 10px; }
.ps-feat {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.ps-feat .ico {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 12px;
  background: var(--backer-soft);
  color: var(--backer-ink);
}
.ps-feat.locked .ico { background: var(--surface-2); color: var(--ink-4); }
.ps-feat .body { line-height: 1.4; min-width: 0; }
.ps-feat .body b { display: block; font-weight: 500; color: var(--ink); font-size: 13px; }
.ps-feat .body span { font-size: 12px; color: var(--ink-3); }

/* ---- Row primitive (2FA, Sessions) ---- */
.ps-row {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--line-2);
}
.ps-row:last-child { border-bottom: none; }
.ps-row .ico-tile {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--ink-3);
  display: grid;
  place-items: center;
  font-size: 14px;
}
.ps-row .ico-tile.green { background: var(--green-soft); color: var(--green); }
.ps-row .ico-tile.amber { background: var(--amber-soft); color: var(--amber); }
.ps-row .ico-tile.backer { background: var(--backer-soft); color: var(--backer-ink); }
.ps-row .meat b {
  display: block;
  font-weight: 500;
  font-size: 13.5px;
  color: var(--ink);
}
.ps-row .meat span { font-size: 12px; color: var(--ink-3); }
.ps-row .ps-row-actions { display: flex; gap: 6px; }
.ps-row.this {
  background: var(--backer-softer);
  margin: 0 calc(-1 * var(--card-pad));
  padding-left: var(--card-pad);
  padding-right: var(--card-pad);
  border-left: 3px solid var(--backer);
}

/* ---- Notification matrix ---- */
.ps-matrix-scroll { width: 100%; overflow-x: auto; }
.ps-matrix {
  width: 100%;
  min-width: 460px;
  border-collapse: collapse;
  font-size: 13px;
}
.ps-matrix thead th {
  text-align: left;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-2);
  background: var(--surface-2);
}
.ps-matrix thead th.ch { text-align: center; width: 88px; }
.ps-matrix tbody td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--line-2);
  vertical-align: middle;
}
.ps-matrix tbody td.ch { text-align: center; }
.ps-matrix tbody tr:last-child td { border-bottom: none; }
.ps-matrix .what b { display: block; font-weight: 500; color: var(--ink); }
.ps-matrix .what span { display: block; font-size: 12px; color: var(--ink-3); }

/* ---- Notification email matrix (3 sections, per-row frequency) ---- */
.ps-noti-group { border-bottom: 1px solid var(--line); }
.ps-noti-group:last-child { border-bottom: none; }
.ps-noti-group-head {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  padding: 14px 0 4px;
}
.ps-noti-group:first-child .ps-noti-group-head { padding-top: 2px; }
.ps-noti-group-head b {
  font-size: 11px; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: var(--ink-2);
}
.ps-noti-group-head span { font-size: 12px; color: var(--ink-3); }
.ps-soon {
  display: inline-flex; align-items: center; gap: 5px;
  margin-top: 5px; font-size: 11.5px; color: var(--amber);
}
.ps-alwayson {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 500; color: var(--ink-3); white-space: nowrap;
}
.ps-freq {
  font: inherit; font-size: 13px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 8px; padding: 6px 10px; min-width: 108px; cursor: pointer;
}
.ps-freq:focus-visible {
  outline: none; border-color: var(--backer);
  box-shadow: 0 0 0 3px rgba(45, 107, 102, .12);
}
.ps-freq-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 500; color: var(--backer);
  text-decoration: none; white-space: nowrap;
}
.ps-freq-link:hover { color: var(--backer-ink); }
.ps-freq-link i { font-size: 10px; }

/* Notification matrix rows align to the card-body padding (no extra gutter). */
.ps-noti-group .ps-matrix tbody td { padding-left: 0; padding-right: 0; }
.ps-noti-group .ps-matrix tbody td.ch { text-align: right; white-space: nowrap; }

/* The frequency <select>s are Choices.js-wrapped (platform dropdown). Size the
   control to ~34px + right-align it in the cell. The global Choices theme paints
   surface/border/radius/dark-mode; this only sizes + positions. The native
   `.ps-freq` rules above stay as the no-JS fallback. */
/* margin-left:auto pins the control to the right of the cell; text-align:left
   keeps the value + option text reading normally (the cell's text-align:right,
   which positions the .ps-alwayson chip / link, would otherwise right-align the
   text inside the dropdown). */
#ps-page .ps-noti-group .choices { margin: 0 0 0 auto; min-width: 0; width: 126px; text-align: left; }
#ps-page .ps-noti-group .choices__inner,
#ps-page .ps-noti-group .choices[data-type*=select-one] .choices__inner {
  min-height: 34px; padding: 0 28px 0 11px;
  font-size: 13px; font-weight: 400; line-height: 32px;
}
#ps-page .ps-noti-group .choices.is-focused .choices__inner,
#ps-page .ps-noti-group .choices.is-open .choices__inner {
  border-color: var(--backer); box-shadow: 0 0 0 3px rgba(45, 107, 102, .12);
}
#ps-page .ps-noti-group .choices__list--single { padding: 0; width: 100%; }
#ps-page .ps-noti-group .choices__list--single .choices__item { color: var(--ink); line-height: 32px; }
#ps-page .ps-noti-group .choices[data-type*=select-one]::after { right: 12px; }

/* ---- Danger zone rows ---- */
.ps-danger-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  row-gap: 8px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line-2);
}
.ps-danger-row:last-child { border-bottom: none; }
/* The deactivate modal's list of what will happen (or what stops it). */
.ps-effects { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 8px; }
.ps-effects li { display: flex; gap: 10px; font-size: 13px; color: var(--ink-2); line-height: 1.45; }
.ps-effects li i { color: var(--ink-4); margin-top: 3px; }
.ps-effects.blocked li i { color: var(--amber); }
.ps-danger-row .meat b {
  display: block;
  font-weight: 500;
  color: var(--ink);
  font-size: 13.5px;
}
.ps-danger-row .meat p {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: var(--ink-3);
  max-width: 520px;
}

/* ---- Misc chips ---- */
.ps-chip-static {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 12px;
}
.ps-chip-static .ico { color: var(--ink-4); font-size: 10px; }

/* ---- Backup-codes grid ---- */
.ps-codes {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
  padding: 14px;
  background: var(--surface-2);
  border-radius: 10px;
}
@media (max-width: 660px) { .ps-codes { grid-template-columns: repeat(2, 1fr); } }
.ps-codes code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink);
  text-align: center;
  padding: 8px 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  letter-spacing: 1px;
}
.ps-codes code.used { color: var(--ink-4); text-decoration: line-through; background: transparent; }

/* Allow any .dtable or wide block inside a no-pad card body on the settings
   page to scroll horizontally rather than pushing its card wider. Without
   this rule the Recent sign-in + Billing tables can blow past the card at
   narrow widths and force the whole content column to overflow. */
#ps-page .card-body.no-pad { overflow-x: auto; }

/* Personal-details form fields sit inside a Bootstrap `.row.g-3` grid that
   already supplies a 12px gap between rows. The default `.field` 16px bottom
   margin double-pads on top of that, leaving the form looking loose. Zero
   the margin inside this form so the `.g-3` gap is the only spacing. */
#psAccountForm .row .field { margin-bottom: 0; }
/* Prevent the plan amount line ("USD 4,800 / year | billed yearly") from
   refusing to wrap inside a 500px column. */
#ps-page .ps-plan-amount { line-height: 1.5; }

/* ---- Narrow-viewport tweaks for the settings page ---- */
/* Tablet (sidebar collapsed, content card sits at ~660px wide). */
@media (max-width: 767.98px) {
  /* Stack the Account-card avatar row so the monogram + text + actions each
     get the full card width instead of fighting for 36% slices each. */
  #ps-page .ps-avatar-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  #ps-page .ps-avatar-actions { width: 100%; }
}
/* Phone - keep the hero readable when the sidebar is off-canvas. */
@media (max-width: 600px) {
  #ps-page .profile-hero {
    gap: 14px;
    padding-bottom: 16px;
  }
  /* The big 88px hero monogram crowds the title on phones; trim it without
     touching the org-profile hero which reuses the same class. */
  #ps-page .profile-avatar {
    width: 64px;
    height: 64px;
    font-size: 24px;
    border-radius: 14px;
  }
  #ps-page .profile-avatar .verified { width: 20px; height: 20px; font-size: 9px; }
  #ps-page .profile-ident { min-width: 0; flex: 1 1 100%; }
  #ps-page .profile-ident h1 { font-size: 22px; gap: 8px; }
  /* Drop the meta to a single column - flex-wrap was producing awkward
     two-up rows on phone widths. */
  #ps-page .profile-meta {
    display: grid;
    gap: 6px;
    margin-top: 8px;
  }
  /* Two-up stat grid so the four hero tiles don't wrap into a four-row stack. */
  #ps-page .profile-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 22px;
  }
  /* Section heads tighten. */
  #ps-page .ps-section-head h2 { font-size: 18px; }
  /* Reduce the dark subscription card padding so its content has room to
     breathe inside a ~444px content column. */
  #ps-page .ps-plan { padding: 18px 16px 16px; }
  #ps-page .ps-plan h3 { font-size: 18px; }
  #ps-page .ps-plan-grid { gap: 12px; }
  #ps-page .ps-plan-actions { gap: 6px; }
  #ps-page .ps-plan .btn-on-dark,
  #ps-page .ps-plan .btn-on-dark-ghost { padding: 7px 10px; font-size: 12px; }
}


/* =====================================================================
   24. PAGE: INVESTOR SHORTLIST (.sl-*)
   Redacted per-component shortlist (multi-party financing). Page-scoped
   under #inv-shortlist-page. Offer rows are flex (not a rigid grid) so the
   amount always pins to the right edge and the instrument never hogs the
   row; rows wrap cleanly on narrow viewports.
   ===================================================================== */
#inv-shortlist-page { padding-bottom: 96px; }

/* Component group */
#inv-shortlist-page .sl-group { border-bottom: 1px solid var(--line); }
#inv-shortlist-page .sl-group:last-child { border-bottom: none; }
#inv-shortlist-page .sl-group-head {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 16px var(--card-pad) 12px;
}
#inv-shortlist-page .sl-swatch {
    width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; margin-top: 4px;
    /* 7-category funding colour: .cat-* class on this element sets --c. */
    background: var(--c, var(--ink-4));
}
#inv-shortlist-page .sl-group-title { flex: 1; min-width: 0; }
#inv-shortlist-page .sl-group-title .t {
    font-size: 14px; font-weight: 600; color: var(--ink); letter-spacing: -.01em;
}
#inv-shortlist-page .sl-group-title .t .inst { color: var(--ink-3); font-weight: 400; }
#inv-shortlist-page .sl-group-meta {
    margin-top: 4px; display: flex; flex-wrap: wrap; gap: 6px 14px;
    font-size: 11.5px; color: var(--ink-3);
}
#inv-shortlist-page .sl-group-meta .mono { font-family: var(--font-mono); color: var(--ink-2); font-weight: 500; }

/* Coverage row */
#inv-shortlist-page .sl-coverage {
    display: flex; align-items: center; gap: 12px;
    padding: 0 var(--card-pad) 12px;
}
#inv-shortlist-page .sl-cov-track {
    flex: 1; height: 6px; border-radius: 4px; background: var(--surface-2);
    overflow: hidden; min-width: 80px;
}
#inv-shortlist-page .sl-cov-fill {
    height: 100%; border-radius: 4px; background: var(--backer);
    transition: width .18s ease;
}
#inv-shortlist-page .sl-cov-fill.is-over { background: var(--blue); }
#inv-shortlist-page .sl-cov-fill.is-gap { background: var(--amber); }
#inv-shortlist-page .sl-cov-fill.is-none { background: var(--line); }
#inv-shortlist-page .sl-cov-text { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }
#inv-shortlist-page .sl-cov-text .mono { font-family: var(--font-mono); color: var(--ink-2); font-weight: 500; }

/* Offer lines - flex row: checkbox + ref + mode are content-sized, the
   instrument truncates (never grows), the amount pins right via margin-auto. */
#inv-shortlist-page .sl-offers { padding: 0 var(--card-pad) 14px; display: flex; flex-direction: column; gap: 8px; }
#inv-shortlist-page .sl-offer {
    display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px;
    padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
    background: var(--surface); cursor: pointer; transition: background .12s, border-color .12s;
}
#inv-shortlist-page .sl-offer:hover { border-color: var(--ink-4); }
#inv-shortlist-page .sl-offer.is-draft { border-color: var(--backer); background: var(--backer-softer); }
#inv-shortlist-page .sl-offer input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--backer); cursor: pointer; flex: 0 0 auto; }
#inv-shortlist-page .sl-offer .sl-ref { font-size: 12px; font-weight: 600; color: var(--ink); flex: 0 0 auto; min-width: 50px; }
#inv-shortlist-page .sl-offer > .pill { flex: 0 0 auto; }
#inv-shortlist-page .sl-offer .sl-inst {
    font-size: 12px; color: var(--ink-3);
    flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
#inv-shortlist-page .sl-offer .sl-amt {
    font-size: 12.5px; font-family: var(--font-mono); font-weight: 500; color: var(--ink);
    flex: 0 0 auto; margin-left: auto; text-align: right; white-space: nowrap;
}
#inv-shortlist-page .sl-offer .sl-note {
    flex: 1 0 100%; margin-left: 26px; font-size: 11.5px; color: var(--ink-2); line-height: 1.5;
    background: var(--surface-2); border-left: 2px solid var(--amber); border-radius: 0 6px 6px 0;
    padding: 7px 10px; white-space: pre-wrap;
}
#inv-shortlist-page .sl-empty {
    font-size: 12px; color: var(--ink-4); font-style: italic;
    padding: 10px 12px; border: 1px dashed var(--line); border-radius: 10px;
}

/* Proposed (unbound) group */
#inv-shortlist-page .sl-proposed-note {
    font-size: 11.5px; color: var(--ink-3); padding: 0 var(--card-pad) 12px; line-height: 1.5;
}

/* Fee bar */
#inv-shortlist-page .sl-feebar {
    position: sticky; bottom: 0; z-index: 20;
    background: var(--surface); border-top: 1px solid var(--line);
    box-shadow: 0 -4px 16px rgba(0,0,0,.05);
    border-radius: 0 0 var(--radius) var(--radius);
    padding: 14px var(--card-pad);
    display: flex; align-items: center; gap: 22px; flex-wrap: wrap;
}
#inv-shortlist-page .sl-fee-stat .l {
    font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); font-weight: 600;
}
#inv-shortlist-page .sl-fee-stat .v { font-size: 15px; font-weight: 500; color: var(--ink); font-family: var(--font-mono); margin-top: 2px; }
#inv-shortlist-page .sl-fee-stat .v.fee { color: var(--backer); }
#inv-shortlist-page .sl-feebar .sl-fee-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }

/* Helper legend */
#inv-shortlist-page .sl-legend { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 18px; }

@media (max-width: 991.98px) {
    #inv-shortlist-page .sl-legend { grid-template-columns: 1fr; }
}
@media (max-width: 659px) {
    /* Amount drops onto its own line, indented under the offer body so the
       row reads top-to-bottom rather than crushing the figure left. */
    #inv-shortlist-page .sl-offer .sl-amt { margin-left: 26px; flex-basis: 100%; text-align: left; }
    #inv-shortlist-page .sl-feebar { gap: 14px; }
    #inv-shortlist-page .sl-feebar .sl-fee-actions { margin-left: 0; width: 100%; }
    #inv-shortlist-page .sl-feebar .sl-fee-actions > * { flex: 1; justify-content: center; }
}


/* =====================================================================
   24A. PAGE: ADVISOR-REQUEST SHORTLIST  -  card-pick (.av-*)
   Binary card-pick that mirrors the investor shortlist (#inv-shortlist-page
   .sl-offer) vocabulary: tick a card to shortlist, leave it unticked = not
   progressed. Page-scoped under #ar-shortlist-page. Uses backer.css tokens.
   ===================================================================== */
#ar-shortlist-page { padding-bottom: 96px; }
#ar-shortlist-page .page-crumb { margin-bottom: 14px; }

/* Card list ----------------------------------------------------------- */
#ar-shortlist-page .av-list {
  display: flex; flex-direction: column; gap: 8px;
  padding: 14px var(--card-pad) 16px;
}

#ar-shortlist-page .av-card {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px;
  padding: 13px 16px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface); cursor: pointer;
  transition: background .12s, border-color .12s, box-shadow .12s;
}
#ar-shortlist-page .av-card:hover { border-color: var(--ink-4); }
#ar-shortlist-page .av-card.is-shortlisted { border-color: var(--backer); background: var(--backer-softer); }
#ar-shortlist-page .av-card:focus-visible { outline: 2px solid var(--backer); outline-offset: 2px; }

/* Native checkbox - accent matches the investor .sl-offer checkbox.
   pointer-events:none so the whole card (the click target) drives state. */
#ar-shortlist-page .av-check {
  width: 18px; height: 18px; accent-color: var(--backer);
  flex: 0 0 auto; pointer-events: none;
}

/* Identity block (reuses the global .person cell). flex-basis:0 so the
   person shrinks first and the meta/chevron never wrap to a 2nd line. */
#ar-shortlist-page .av-card .person { flex: 1 1 0; min-width: 0; }
#ar-shortlist-page .av-card .person .who { min-width: 0; grid-template-columns: minmax(0, 1fr); }
#ar-shortlist-page .av-card .person .who b {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block;
}

/* Right-hand meta: jurisdiction flag + submitted date */
#ar-shortlist-page .av-meta { display: flex; align-items: center; gap: 14px; flex: 0 0 auto; }
#ar-shortlist-page .av-meta .flag { white-space: nowrap; }
#ar-shortlist-page .av-date {
  font-size: 12px; color: var(--ink-3); font-family: var(--font-mono); white-space: nowrap;
}

/* Message expand chevron - borderless, subtle (full message opens in .av-note) */
#ar-shortlist-page .av-chev {
  width: 28px; height: 28px; flex: 0 0 auto; border-radius: 7px;
  border: none; background: transparent; color: var(--ink-4); cursor: pointer;
  display: grid; place-items: center; font-size: 11px;
  transition: background .12s, color .12s;
}
#ar-shortlist-page .av-chev:hover { color: var(--ink); background: var(--surface-2); }

/* Expanded message panel (full width within the card). flex-basis subtracts
   the 30px indent and box-sizing:border-box folds the padding + 3px left
   border into that width, so indent + panel = the card content box exactly
   (no overflow past the card border). */
#ar-shortlist-page .av-note {
  flex: 1 0 calc(100% - 30px); box-sizing: border-box; margin-left: 30px;
  background: var(--surface-2); border-left: 3px solid var(--backer);
  border-radius: 0 8px 8px 0; padding: 11px 14px;
}
#ar-shortlist-page .av-note p {
  margin: 0; font-size: 13px; color: var(--ink-2); line-height: 1.55; white-space: pre-wrap;
}

/* Bottom action bar - mirrors #inv-shortlist-page .sl-feebar, minus the fee
   block (advisors carry no broker fee). Sticky to the bottom of the card. */
#ar-shortlist-page .av-feebar {
  position: sticky; bottom: 0; z-index: 20;
  background: var(--surface); border-top: 1px solid var(--line);
  box-shadow: 0 -4px 16px rgba(0,0,0,.05);
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 14px var(--card-pad);
  display: flex; align-items: center; gap: 28px; flex-wrap: wrap;
}
/* Group the two stats so the actions' margin-left:auto can only push the
   action cluster right - the stats stay adjacent and left-aligned, and wrap
   together as one unit rather than the second stat drifting to the edge. */
#ar-shortlist-page .av-fee-stats { display: flex; align-items: center; gap: 28px; }
#ar-shortlist-page .av-fee-stat .l {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--ink-3); font-weight: 600;
}
#ar-shortlist-page .av-fee-stat .v {
  font-size: 19px; font-weight: 500; color: var(--ink);
  font-family: var(--font-mono); margin-top: 2px;
}
#ar-shortlist-page .av-fee-stat .v.go { color: var(--backer); }
#ar-shortlist-page .av-feebar .av-fee-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }

/* Helper legend (3-up, collapses to 1 col on narrow) */
#ar-shortlist-page .legend-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 18px; }

@media (max-width: 991.98px) {
  #ar-shortlist-page .legend-grid { grid-template-columns: 1fr; }
}
@media (max-width: 659px) {
  /* Jurisdiction + date drop onto their own line under the org name (indented
     30px past the checkbox), so a long org name isn't crowded by the meta on
     the smallest screens. The chevron stays top-right of line 1; the expanded
     message (order:4) stays last. flex-basis subtracts the 30px indent so the
     meta line doesn't overflow the card. */
  #ar-shortlist-page .av-meta { order: 3; flex: 1 0 calc(100% - 30px); margin-left: 30px; gap: 10px; }
  #ar-shortlist-page .av-note { order: 4; }
  #ar-shortlist-page .av-feebar { gap: 14px; }
  #ar-shortlist-page .av-fee-stats { gap: 14px; }
  #ar-shortlist-page .av-feebar .av-fee-actions { margin-left: 0; width: 100%; }
  #ar-shortlist-page .av-feebar .av-fee-actions > * { flex: 1; justify-content: center; }
}


/* =====================================================================
   24B. PAGE: PREFERRED-BIDDER SELECT (.pb-*)
   Per-component preferred-bidder designation (multi-party financing).
   Page-scoped under #pref-select-page. One group per FinancingRequirement;
   each offer row carries a pick control + an allocation input (currency
   input-group) shown when the offer is selected.
   ===================================================================== */
#pref-select-page .pb-group { border-bottom: 1px solid var(--line); padding: 16px var(--card-pad); }
#pref-select-page .pb-group:last-child { border-bottom: none; }
#pref-select-page .pb-group-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
#pref-select-page .pb-swatch { width: 12px; height: 12px; border-radius: 3px; flex: 0 0 auto; margin-top: 3px; background: var(--c, var(--ink-4)); }
#pref-select-page .pb-group-title { flex: 1; min-width: 0; }
#pref-select-page .pb-group-title .t { font-size: 13.5px; font-weight: 600; color: var(--ink); }
#pref-select-page .pb-group-meta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 3px; font-size: 11.5px; color: var(--ink-3); }
#pref-select-page .pb-group-meta .mono { font-family: var(--font-mono); color: var(--ink-2); font-weight: 500; }

#pref-select-page .pb-offers { display: flex; flex-direction: column; gap: 8px; }
#pref-select-page .pb-offer { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; transition: border-color .12s, background .12s; }
#pref-select-page .pb-offer.is-selected { border-color: var(--backer); background: var(--backer-softer); }
#pref-select-page .pb-pick { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; cursor: pointer; margin: 0; }
#pref-select-page .pb-check { width: 16px; height: 16px; accent-color: var(--backer); cursor: pointer; flex: 0 0 auto; }
#pref-select-page .pb-who { font-size: 12.5px; font-weight: 600; color: var(--ink); flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#pref-select-page .pb-pick > .pill { flex: 0 0 auto; }
#pref-select-page .pb-inst { font-size: 12px; color: var(--ink-2); flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#pref-select-page .pb-amt { font-family: var(--font-mono); font-size: 12px; font-weight: 600; color: var(--ink); flex: 0 0 auto; margin-left: auto; white-space: nowrap; }
#pref-select-page .pb-alloc { display: flex; align-items: center; gap: 8px; margin: 10px 0 0 26px; }
#pref-select-page .pb-alloc > label { font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
#pref-select-page .pb-alloc-ig { display: flex; align-items: stretch; height: 32px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); overflow: hidden; }
#pref-select-page .pb-alloc-ig:focus-within { border-color: var(--backer); box-shadow: 0 0 0 3px rgba(45,107,102,.12); }
#pref-select-page .pb-alloc-cur { display: flex; align-items: center; padding: 0 8px; background: var(--surface-2); border-right: 1px solid var(--line); font-size: 11px; font-weight: 600; color: var(--ink-3); }
#pref-select-page .pb-alloc-input { width: 130px; border: 0; background: transparent; padding: 0 10px; font-family: var(--font-mono); font-size: 12.5px; color: var(--ink); text-align: right; }
#pref-select-page .pb-alloc-input:focus { outline: none; }
#pref-select-page .pb-alloc-pct { font-family: var(--font-mono); font-size: 11.5px; font-weight: 600; color: var(--ink-3); white-space: nowrap; }
#pref-select-page .pb-extra { display: flex; flex-wrap: wrap; gap: 14px; margin: 8px 0 0 26px; font-size: 11.5px; color: var(--ink-3); }
#pref-select-page .pb-group-foot { display: flex; justify-content: flex-end; gap: 8px; align-items: baseline; margin-top: 10px; font-size: 11.5px; color: var(--ink-3); }
#pref-select-page .pb-group-foot .pb-total-lbl { text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
#pref-select-page .pb-group-foot .mono { font-family: var(--font-mono); color: var(--ink-2); font-weight: 500; }
#pref-select-page .pb-group-foot.is-over .mono { color: var(--amber); }

#pref-select-page .pb-actionbar { display: flex; align-items: center; gap: 22px; padding: 16px var(--card-pad); border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
#pref-select-page .pb-actionbar-stat .l { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); font-weight: 600; }
#pref-select-page .pb-actionbar-stat .v { font-family: var(--font-mono); font-size: 16px; font-weight: 600; color: var(--ink); }
#pref-select-page .pb-actionbar-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }

@media (max-width: 659px) {
    /* Offer row stacks into exactly two lines: checkbox + investor name fill
       the first (the name's flex-basis = 100% minus the 16px box + 10px gap, so
       the next sibling is forced to wrap), then the mode pill + instrument +
       amount flow together on the second line (amount still pinned right). */
    #pref-select-page .pb-who { flex-basis: calc(100% - 26px); }
    /* Drop the 26px body indent so the allocation field lines up with the mode
       pill at the row's left edge (the pill wraps to the start of line two). */
    #pref-select-page .pb-alloc { margin-left: 0; }
}
@media (max-width: 640px) {
    #pref-select-page .pb-actionbar { flex-wrap: wrap; gap: 14px; }
    #pref-select-page .pb-actionbar-actions { margin-left: 0; width: 100%; }
    #pref-select-page .pb-actionbar-actions > * { flex: 1; justify-content: center; }
}


/* =====================================================================
   24C. PAGE: COMING SOON (.cs-*)
   ---------------------------------------------------------------------
   Polished placeholder panel rendered by the shared coming_soon() macro
   (components/_coming_soon.html). Used by Infra-Analytics + Infra-Maps in
   v1. Ported from references/mocks/Coming Soon Page.html; reconciled to
   the project's loaded fonts (--font-sans, no Fraunces) and color-mix(in
   srgb). Top-aligned, not vertically centred. The .cs-* prefix is unique
   so no #id scope is needed.
   ===================================================================== */
.cs-wrap { display: flex; align-items: flex-start; justify-content: center; padding: 8px 0 40px; }
.cs-panel {
  position: relative; width: 100%; max-width: 600px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(0,0,0,.02), 0 30px 60px -42px rgba(29,71,68,.4);
}
.cs-motif {
  position: absolute; inset: 0; pointer-events: none; opacity: .7;
  background:
    radial-gradient(ellipse 70% 55% at 50% 0%, color-mix(in srgb, var(--backer) 13%, transparent) 0%, transparent 62%),
    radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--backer) 24%, transparent) 1px, transparent 1.6px) 0 0 / 26px 26px;
  -webkit-mask-image: radial-gradient(ellipse 82% 62% at 50% 6%, #000 0%, transparent 72%);
  mask-image: radial-gradient(ellipse 82% 62% at 50% 6%, #000 0%, transparent 72%);
}
.cs-inner { position: relative; z-index: 1; padding: 54px 52px 44px; text-align: center; }
.cs-badge {
  display: inline-flex; align-items: center; font-family: var(--font-mono);
  font-size: 11px; letter-spacing: .13em; text-transform: uppercase; color: var(--backer-ink);
  background: var(--backer-soft); border: 1px solid color-mix(in srgb, var(--backer) 24%, transparent);
  padding: 7px 13px; border-radius: 999px;
}
@keyframes csPulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--backer) 45%, transparent); }
  70%  { box-shadow: 0 0 0 9px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.cs-icon {
  width: 66px; height: 66px; margin: 26px auto 22px; border-radius: 17px;
  background: linear-gradient(140deg, var(--backer) 0%, var(--sidebar-accent) 100%); color: #fff;
  display: grid; place-items: center; font-size: 25px;
  box-shadow: 0 14px 26px -12px color-mix(in srgb, var(--backer) 70%, transparent), inset 0 1px 0 rgba(255,255,255,.2);
}
.cs-title {
  font-family: var(--font-sans); font-weight: 500; font-size: clamp(26px, 3vw, 33px);
  letter-spacing: -.02em; line-height: 1.12; color: var(--ink); margin: 0 0 12px;
}
.cs-desc {
  font-size: 15px; line-height: 1.6; color: var(--ink-2); max-width: 42ch;
  margin: 0 auto 26px; text-wrap: pretty;
}
.cs-roadmap { margin-top: 32px; padding-top: 26px; border-top: 1px solid var(--line-2); text-align: left; }
.cs-roadmap-h {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-3); margin-bottom: 15px; text-align: center;
}
.cs-roadmap ul { list-style: none; margin: 0 auto; padding: 0; display: flex; flex-direction: column; gap: 12px; max-width: 430px; }
.cs-roadmap li { display: flex; gap: 11px; align-items: flex-start; font-size: 13.5px; color: var(--ink-2); line-height: 1.5; }
.cs-roadmap li i { color: var(--backer); font-size: 14px; margin-top: 2px; flex-shrink: 0; }
@media (max-width: 560px) {
  .cs-inner { padding: 40px 26px 34px; }
}


/* =====================================================================
   25. RESPONSIVE
   Merged from both mocks (900px + 600px breakpoints).
   ===================================================================== */
@media (max-width: 980px) {
  .hero-grid,
  .router-panel,
  .final-grid { grid-template-columns: 1fr; gap: 32px; }

  .pillar { grid-template-columns: 1fr; gap: 28px; }
  .pillar.reverse .pillar-copy { order: 0; }
  .coverage-grid { grid-template-columns: repeat(2, 1fr); }
  .role-pane.active { grid-template-columns: 1fr; gap: 32px; }
  .site-nav-links { display: none; }

  /* Form wizard collapse */
  .pf-stepper { grid-template-columns: repeat(3, 1fr); }
  .pf-step { border-bottom: 1px solid var(--line); }
  .pf-step:nth-child(3n) { border-right: none; }
  .pf-step:nth-last-child(-n+3) { border-bottom: none; }
  .pf-stepper > .pf-step:last-child { border-top-right-radius: 0; }
  .pf-stepper > .pf-step:nth-child(3) { border-top-right-radius: var(--pf-inner-radius); }
  .pf-docs-grid { grid-template-columns: 1fr; }
  .pf-fs-head, .pf-fs-row { grid-template-columns: 1fr; }
  .pf-fs-head { display: none; }
  .pf-panel { padding: 22px 20px 4px; }
  .pf-foot { padding: 14px 20px; flex-wrap: wrap; }
  .pf-foot .pf-save-status { order: 3; flex-basis: 100%; text-align: center; }
  .pf-panel-head { flex-direction: column; gap: 12px; }
  .pf-progress-mini { align-self: flex-start; text-align: left; }
  .pf-grid [class*="pf-col-"] { grid-column: span 12; }
}

/* Below the auto-collapse threshold (matches IB.setupViewToggle's
   autoCollapseBelow=1100), card view is forced regardless of preference, so
   the list/card toggle is moot - hide it entirely. The toolbar's flex-wrap
   reflows the remaining controls (search, filters, sort) cleanly. */
@media (max-width: 1099.98px) {
  .bp-toolbar .view-toggle { display: none; }
}

/* Horizontal scroll on list-view tables.
   Sidebar 244px (uncollapsed) / 68px (rail) plus 64px of .app-content padding
   leaves a content area of:
     - viewport 1500 uncollapsed: 1500 - 244 - 64 = 1192px
     - viewport 1350 rail:        1350 -  68 - 64 = 1218px
   Setting `min-width` on the table to those values forces it past the content
   area at exactly the user-specified thresholds, so `.tcard` /  `.em-table`
   show their horizontal scrollbar. Column widths themselves are untouched -
   `width: 100%` still drives proportional sizing when the container is wide
   enough to accommodate the table. */
@media (max-width: 1499.98px) {
  .app:not(.rail) .tcard .tbl,
  .app:not(.rail) .em-table table,
  .app:not(.rail) #admin-page .u-table,
  .app:not(.rail) #admin-page .org-table { min-width: 1192px; }
}
@media (max-width: 1349.98px) {
  .app.rail .tcard .tbl,
  .app.rail .em-table table,
  .app.rail #admin-page .u-table,
  .app.rail #admin-page .org-table { min-width: 1218px; }
}

@media (max-width: 900px) {
  .app {
    /* `minmax(0, 1fr)` (not bare `1fr`) lets the single content track shrink
       below its min-content size. Without this, descendants that assert a
       min-width (e.g. `.em-tl-row` at 940px, `.em-table table` at 1192px)
       push the whole grid track past the viewport and produce a page-level
       horizontal scrollbar - the desktop grid at line 373 uses the same
       trick. See CLAUDE.md for the rationale. */
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 56px 1fr;
    grid-template-areas:
      "topbar"
      "content";
  }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-100%);
    width: 260px;
    transition: transform .2s;
  }
  .sidebar.open {
    transform: none;
    box-shadow: var(--shadow-pop);
  }
  .tb-hamburger { display: grid; }
  .tb-search { display: none; }
  .app-content { padding: 20px 16px 80px; }
  .profile-grid { grid-template-columns: 1fr; }
  .profile-stats { gap: 24px; flex-wrap: wrap; }
  .page-head { flex-direction: column; align-items: stretch; }
  .page-actions { justify-content: flex-start; }
  .container-backer { padding: 0 16px; }
}

@media (max-width: 600px) {
  .tb-user .who { display: none; }
  .profile-stats { gap: 18px 26px; }
  .role-tabs button { margin-right: 18px; }
  .process-tabs button { margin-right: 18px; }
}


/* =====================================================================
   26. PRINT
   ===================================================================== */
@media print {
  .sidebar,
  .topbar,
  .site-nav,
  .tb-hamburger,
  .sb-backdrop { display: none !important; }

  .app {
    grid-template-columns: 1fr;
    grid-template-areas: "content";
  }
  .app-content { padding: 0; max-width: none; }
  .card, .cov-card, .mini-card, .pillar-visual {
    box-shadow: none;
    border-color: #ccc;
  }
}


/* =====================================================================
   14C. PAGE: LEGAL (.legal-*)
   ---------------------------------------------------------------------
   In-page navigation chrome for the public legal pages (privacy / terms
   / cookies / disclaimer). The two-column layout drops the sticky TOC
   into the previously-empty left gutter; everything else reuses the
   design-system tokens. The TOC collapses (display:none) <=991.98px so
   the article takes the full width. Scrollspy wiring lives in
   static/js/pages/public.js (initLegalToc).
   ===================================================================== */
.legal-layout {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  gap: 48px;
  align-items: start;
}

/* Sticky table of contents - lives in the previously-empty gutter */
.legal-toc {
  position: sticky;
  top: 24px;
  align-self: start;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding-right: 8px;
}
.legal-toc-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 12px 12px;
}
.legal-toc a {
  display: block;
  padding: 6px 12px;
  border-left: 2px solid var(--line-2);
  color: var(--ink-3);
  font-size: 12.5px;
  line-height: 1.4;
  text-decoration: none;
  transition: color .12s, border-color .12s, background .12s;
}
.legal-toc a:hover {
  color: var(--ink);
  border-left-color: var(--ink-3);
}
.legal-toc a.active {
  color: var(--backer);
  border-left-color: var(--backer);
  font-weight: 600;
  background: var(--backer-softer);
}

/* Section headings - real <h2>s sized to match the old <h6> look so the
   visual design is unchanged while the document outline is correct. */
.legal-h {
  font-size: 1rem;        /* matches Bootstrap h6 */
  font-weight: 700;
  line-height: 1.4;
  scroll-margin-top: 84px; /* clear the 68px sticky .site-nav + 16px gap */
  margin: 28px 0 8px;
}
.legal-h:first-of-type { margin-top: 8px; }

/* Anchor affordance - a # that appears on hover */
.legal-h .anchorjs-link {
  opacity: 0;
  margin-left: 8px;
  color: var(--backer);
  text-decoration: none;
  font-weight: 400;
  transition: opacity .12s;
}
.legal-h:hover .anchorjs-link { opacity: 1; }

/* Collapse the TOC on narrower viewports - content takes full width. The
   parent's px-lg-7 gutter only applies >=lg, so restore a base inline padding
   here (the removed Bootstrap row/col scaffold previously supplied it). */
@media (max-width: 991.98px) {
  .legal-layout { grid-template-columns: 1fr; gap: 0; padding-inline: 16px; }
  .legal-toc { display: none; }
}
/* The five-column cookie tables can't fit a phone: scroll them in their own
   box rather than widening the page. min-width: 0 stops the grid column
   growing to the widest table. */
.legal-layout > article { min-width: 0; }
@media (max-width: 575.98px) {
  .legal-layout article table { display: block; overflow-x: auto; }
}
/* (smooth scroll for these anchor jumps lives on the global `html` rule, §3 BASE) */


/* =====================================================================
   SECTION 25: LEGACY COMPATIBILITY
   ---------------------------------------------------------------------
   Base components (grid, modals, dropdowns, forms, tables, utilities,
   reboot, dark-mode primitives) now come from the Bootstrap 5.3.8 CDN.
   ===================================================================== */

/* --- 25.1 Extended spacing scale (Bootstrap's scale stops at 5) --- */
.my-6 { margin-top: 2.5rem !important; margin-bottom: 2.5rem !important; }
.pe-6 { padding-right: 2.5rem !important; }
.py-6 { padding-top: 2.5rem !important; padding-bottom: 2.5rem !important; }
.py-7 { padding-top: 3rem !important; padding-bottom: 3rem !important; }
.py-9 { padding-top: 4rem !important; padding-bottom: 4rem !important; }
@media (min-width: 992px) {
  .px-lg-7 { padding-right: 3rem !important; padding-left: 3rem !important; }
  .py-lg-9 { padding-top: 4rem !important; padding-bottom: 4rem !important; }
}

/* --- 25.2 Dark-mode theme toggle (both base templates) --- */
.theme-control-toggle .theme-control-toggle-label {
  height: 2rem; width: 2rem;
  display: flex; align-items: center; justify-content: center;
  background-color: var(--amber-soft); color: var(--amber);
  border-radius: 50%; cursor: pointer;
  transition: all 0.2s ease-in-out;
}
.theme-control-toggle .theme-control-toggle-label:hover { background-color: var(--amber); color: #fff; }
[data-bs-theme="dark"] .theme-control-toggle .theme-control-toggle-label { background-color: var(--backer-soft); color: var(--backer); }
[data-bs-theme="dark"] .theme-control-toggle .theme-control-toggle-label:hover { background-color: var(--backer); color: #0f1514; }
.theme-control-toggle .theme-control-toggle-input { display: none; }
.theme-control-toggle .theme-control-toggle-input:checked ~ .theme-control-toggle-dark { display: none; }
.theme-control-toggle .theme-control-toggle-input:not(:checked) ~ .theme-control-toggle-light { display: none; }

/* --- 25.3 (removed) Form icon input group - was auth-page-only; the auth
       redesign (§14D) replaced it with .inp-shell / .lead. --- */

/* --- 25.4 Flex helpers (applied to Bootstrap flex containers) --- */
.flex-center { align-items: center; justify-content: center; }
.flex-between-center { justify-content: space-between; align-items: center; }
.flex-1 { flex: 1; }

/* --- 25.5 Misc legacy utilities --- */
.border-translucent { border-color: var(--line) !important; }
.dropdown-caret-none::after,
.dropdown-caret-none::before { display: none !important; }
.text-transform-none { text-transform: none !important; }
/* Subtle alert variants - flash messages + the impersonation banner. The base
   `.alert` comes from the Bootstrap CDN (padding/border/radius); these only set the
   colour. Both base templates build the flash class dynamically as
   `alert-subtle-{{ cat }}` (success / danger / warning / info). Light + dark: the
   backer accent on its soft pair - the accent bases now carry per-mode dark values
   (§2), so the semantic text colour stays legible on the dark soft background with
   no per-consumer --ink override needed. */
.alert-subtle-success   { color: var(--green);       background-color: var(--green-soft);  border-color: var(--green-soft); }
.alert-subtle-danger    { color: var(--red);         background-color: var(--red-soft);    border-color: var(--red-soft); }
.alert-subtle-warning   { color: var(--amber);       background-color: var(--amber-soft);  border-color: var(--amber-soft); }
.alert-subtle-info      { color: var(--blue);        background-color: var(--blue-soft);   border-color: var(--blue-soft); }
.alert-subtle-primary   { color: var(--backer-ink);  background-color: var(--backer-soft); border-color: var(--backer-soft); }
.alert-subtle-secondary { color: var(--ink-2);       background-color: var(--surface-2);   border-color: var(--line); }

/* --- 25.6 Password reveal toggle (auth pages) --- */
[data-password-toggle] .hide { display: none; }
[data-password-toggle].show-password .hide { display: block; }
[data-password-toggle].show-password .show { display: none; }

/* --- 25.7 list.js sort indicators on admin .table-list tables
       (browse/EM tables use .tcard/.em-table arrows; scope to .table-list
        so those don't get a second arrow) --- */
.table-list .sort[data-sort] { white-space: nowrap; cursor: pointer; }
.table-list .sort[data-sort]::after {
  content: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNyIgaGVpZ2h0PSI5IiB2aWV3Qm94PSIwIDAgNyA5IiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBkPSJNMy4xNDkgMC42NDY3NjhDMy4zNDM2NiAwLjQ1NDg4NSAzLjY1NjM0IDAuNDU0ODg1IDMuODUxIDAuNjQ2NzY4TDYuMTMxNTEgMi44OTQ2OUM2LjQ0OTk4IDMuMjA4NjIgNi4yMjc2OSAzLjc1MDc4IDUuNzgwNSAzLjc1MDc4SDEuMjE5NUMwLjc3MjMwNyAzLjc1MDc4IDAuNTUwMDE4IDMuMjA4NjIgMC44Njg0OTUgMi44OTQ2OUwzLjE0OSAwLjY0Njc2OFoiIGZpbGw9IiM2RTc4OTEiLz4KPHBhdGggZD0iTTMuMTQ5IDguMTU0MDFDMy4zNDM2NiA4LjM0NTkgMy42NTYzNCA4LjM0NTkgMy44NTEgOC4xNTQwMUw2LjEzMTUxIDUuOTA2MDlDNi40NDk5OCA1LjU5MjE2IDYuMjI3NjkgNS4wNSA1Ljc4MDUgNS4wNUgxLjIxOTVDMC43NzIzMDcgNS4wNSAwLjU1MDAxOCA1LjU5MjE2IDAuODY4NDk1IDUuOTA2MDlMMy4xNDkgOC4xNTQwMVoiIGZpbGw9IiM2RTc4OTEiLz4KPC9zdmc+Cg==");
  margin-left: 0.25rem;
}
.table-list .sort[data-sort].asc::after {
  content: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNyIgaGVpZ2h0PSI5IiB2aWV3Qm94PSIwIDAgNyA5IiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBkPSJNMy4xNDkgOC4xNTQwMUMzLjM0MzY2IDguMzQ1OSAzLjY1NjM0IDguMzQ1OSAzLjg1MSA4LjE1NDAxTDYuMTMxNTEgNS45MDYwOUM2LjQ0OTk4IDUuNTkyMTYgNi4yMjc2OSA1LjA1IDUuNzgwNSA1LjA1SDEuMjE5NUMwLjc3MjMwNyA1LjA1IDAuNTUwMDE4IDUuNTkyMTYgMC44Njg0OTUgNS45MDYwOUwzLjE0OSA4LjE1NDAxWiIgZmlsbD0iIzZFNzg5MSIvPgo8L3N2Zz4K") !important;
  margin-top: -1px !important;
}
.table-list .sort[data-sort].desc::after {
  content: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNyIgaGVpZ2h0PSI5IiB2aWV3Qm94PSIwIDAgNyA5IiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBkPSJNMy4xNDkgMC42NDY3NjhDMy4zNDM2NiAwLjQ1NDg4NSAzLjY1NjM0IDAuNDU0ODg1IDMuODUxIDAuNjQ2NzY4TDYuMTMxNTEgMi44OTQ2OUM2LjQ0OTk4IDMuMjA4NjIgNi4yMjc2OSAzLjc1MDc4IDUuNzgwNSAzLjc1MDc4SDEuMjE5NUMwLjc3MjMwNyAzLjc1MDc4IDAuNTUwMDE4IDMuMjA4NjIgMC44Njg0OTUgMi44OTQ2OUwzLjE0OSAwLjY0Njc2OFoiIGZpbGw9IiM2RTc4OTEiLz4KPC9zdmc+Cg==") !important;
}

/* --- 25.8 Homepage editorial chrome (home.html + contact.html) --- */
.home-page h1, .home-page h2, .home-page h3, .home-page .home-display {
  font-family: 'DM Sans', system-ui, sans-serif;
  font-weight: 700; letter-spacing: -0.02em; line-height: 1.08;
}
.home-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--backer-ink); background: var(--backer-soft);
  padding: 6px 12px; border-radius: 999px;
}

/* --- 25.9 Legacy class shims (folded from backer-bridge.css) --- */
/* --backer / --backer-ink both carry per-mode dark values (§2), so these resolve
   to a legible brand teal in dark mode on their own - no --ink override needed. */
.text-backer,
.text-backer-emphasis { color: var(--backer) !important; }
.text-backer-light    { color: var(--backer-ink); opacity: .8; }

.bg-backer         { background-color: var(--backer) !important; color: #fff; }
.bg-backer-subtle  { background-color: var(--backer-soft) !important; }

.link-backer { color: var(--backer); text-decoration: none; }
.link-backer:hover,
.link-backer:focus { color: var(--backer-ink); }

.btn-backer {
  background: var(--backer);
  color: #fff;
  border-color: var(--backer);
  box-shadow: 0 1px 0 rgba(0,0,0,.03), 0 8px 20px -12px rgba(45,107,102,.6);
}
.btn-backer:hover,
.btn-backer:focus {
  background: var(--backer-ink);
  border-color: var(--backer-ink);
  color: #fff;
  transform: translateY(-1px);
}
[data-bs-theme="dark"] .btn-backer { color: #0f1514; }
[data-bs-theme="dark"] .btn-backer:hover { color: #0f1514; }

.btn-outline-backer {
  background: transparent;
  color: var(--backer);
  border: 1px solid var(--backer);
}
.btn-outline-backer:hover,
.btn-outline-backer:focus {
  background: var(--backer);
  color: #fff;
  border-color: var(--backer);
}
[data-bs-theme="dark"] .btn-outline-backer:hover { color: #0f1514; }

.btn-subtle-backer {
  background: var(--backer-soft);
  color: var(--backer-ink);
  border-color: transparent;
}
.btn-subtle-backer:hover,
.btn-subtle-backer:focus {
  background: var(--backer);
  color: #fff;
}
[data-bs-theme="dark"] .btn-subtle-backer:hover { color: #0f1514; }

.alert-outline-backer {
  background: transparent;
  border: 1px solid var(--backer);
  color: var(--backer-ink);
  border-radius: 10px;
  padding: 12px 16px;
}

.text-body-tertiary   { color: var(--ink-3) !important; }
.text-body-emphasis   { color: var(--ink)   !important; }
.text-body-secondary  { color: var(--ink-2) !important; }
.text-body-quaternary { color: var(--ink-4) !important; }

.fs-6  { font-size: 1rem !important; }
.fs-7  { font-size: .875rem !important; }
.fs-8  { font-size: .8125rem !important; }
.fs-9  { font-size: .75rem !important; }
.fs-10 { font-size: .6875rem !important; }


/* ===================================================================
   §26  FLATPICKR - brand recolour + dark-mode surfaces
   ------------------------------------------------------------------
   The vendored material_green theme (vendors/flatpickr/themes/
   material_green.css) is loaded BEFORE backer.css in base_dashboard.html,
   so these same-specificity rules win on cascade order. We recolour the
   material_green accent (#1bbc9b) to the brand teal --backer token and
   rebase every calendar surface onto backer tokens, so the picker themes
   automatically in light AND dark mode from one rule set. Loaded last in
   the file, in keeping with the §25 "shims stay the final word" ordering.
   =================================================================== */

/* Popup frame */
.flatpickr-calendar {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-pop);
  color: var(--ink);
}
.flatpickr-calendar.arrowTop:before    { border-bottom-color: var(--line); }
.flatpickr-calendar.arrowTop:after     { border-bottom-color: var(--backer); }
.flatpickr-calendar.arrowBottom:before { border-top-color: var(--line); }
.flatpickr-calendar.arrowBottom:after  { border-top-color: var(--surface); }

/* Month header + weekday strip (brand teal) */
.flatpickr-months .flatpickr-month,
.flatpickr-weekdays,
span.flatpickr-weekday,
.flatpickr-current-month .flatpickr-monthDropdown-months,
.flatpickr-current-month .flatpickr-monthDropdown-months .flatpickr-monthDropdown-month {
  background: var(--backer);
}
/* (month-header text/fill stays #fff from the base material_green theme) */
span.flatpickr-weekday { color: rgba(255, 255, 255, .85); }
.flatpickr-months .flatpickr-prev-month:hover,
.flatpickr-months .flatpickr-next-month:hover { color: rgba(255, 255, 255, .6); }
.flatpickr-months .flatpickr-prev-month:hover svg,
.flatpickr-months .flatpickr-next-month:hover svg { fill: rgba(255, 255, 255, .85); }

/* Calendar body surface */
.flatpickr-innerContainer { background: var(--surface); border-bottom-color: var(--line); }
.flatpickr-days { border-left-color: var(--line); border-right-color: var(--line); }
.flatpickr-time,
.flatpickr-time input,
.flatpickr-am-pm { background: var(--surface); color: var(--ink); }
.numInputWrapper span { border-color: var(--line); }

/* Day cells */
.flatpickr-day { color: var(--ink); }
.flatpickr-day:hover,
.flatpickr-day:focus,
.flatpickr-day.prevMonthDay:hover,
.flatpickr-day.nextMonthDay:hover,
.flatpickr-day.prevMonthDay:focus,
.flatpickr-day.nextMonthDay:focus {
  background: var(--surface-2);
  border-color: var(--surface-2);
}
.flatpickr-day.today { border-color: var(--backer); }
.flatpickr-day.today:hover,
.flatpickr-day.today:focus {
  background: var(--backer);
  border-color: var(--backer);
  color: #fff;
}
.flatpickr-day.selected,
.flatpickr-day.selected:hover,
.flatpickr-day.selected:focus,
.flatpickr-day.startRange,
.flatpickr-day.endRange {
  background: var(--backer);
  border-color: var(--backer);
  color: #fff;
}
.flatpickr-day.flatpickr-disabled,
.flatpickr-day.flatpickr-disabled:hover,
.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay,
.flatpickr-day.notAllowed,
.flatpickr-day.notAllowed.prevMonthDay,
.flatpickr-day.notAllowed.nextMonthDay { color: var(--ink-4); }


/* =====================================================================
   14D. PAGE: AUTH (.auth-*)

   Centred-card auth screens (sign-in/up, recovery, 2FA, status), ported
   from references/mocks/auth_pages_mockup.html. Everything resolves to
   existing tokens. The mock's .eyebrow + heading-swash map to the global
   .eyebrow (§8) and .swash (§14B) - reused, not redeclared. Icons are
   Font Awesome (loaded site-wide); the password toggle reuses the global
   [data-password] mechanism + the §25.6 .show/.hide glyph swap.
   ===================================================================== */

/* ---- Frame ---- */
.auth-wrap {
  min-height: calc(100vh - 220px);
  display: grid;
  place-items: center;
  padding: 56px 24px 72px;
}
.auth-card { width: 100%; max-width: 432px; }
.auth-card.wide { max-width: 512px; }

/* Centred header block on the form screens (intro centred, fields stay
   left). .center pages (status screens) centre everything. */
.auth-card:not(.center) .auth-brandmark { margin-left: auto; margin-right: auto; }
.auth-card:not(.center) .auth-head { text-align: center; }
.auth-card:not(.center) .auth-head .auth-sub { margin-left: auto; margin-right: auto; }
.auth-card.center { text-align: center; }
.auth-card.center .auth-brandmark,
.auth-card.center .auth-medal { margin-left: auto; margin-right: auto; }
.auth-card.center .auth-sub { margin-left: auto; margin-right: auto; }

/* ---- Brandmark + head ---- */
.auth-brandmark {
  width: 40px; height: 40px; border-radius: 10px; margin-bottom: 24px;
  object-fit: cover; display: block;
}
.auth-head { margin-bottom: 28px; }
.auth-head .eyebrow { margin-bottom: 16px; white-space: nowrap; }
.auth-h1 {
  font-family: var(--font-sans); font-weight: 500; letter-spacing: -.025em;
  line-height: 1.08; font-size: clamp(30px, 3.4vw, 38px); color: var(--ink);
  margin: 0; text-wrap: balance;
}
.auth-sub {
  margin: 14px 0 0; color: var(--ink-2); font-size: 15.5px; line-height: 1.55;
  max-width: 44ch;
}

/* ---- Fields ---- */
.auth-form { display: flex; flex-direction: column; gap: 17px; }
.fld { display: flex; flex-direction: column; gap: 7px; }
.fld.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.fld > label { font-size: 12px; font-weight: 600; letter-spacing: .02em; color: var(--ink-2); }

.inp-shell { position: relative; display: flex; align-items: center; flex-wrap: wrap; }
/* The validation message is rendered *inside* the flex .inp-shell; force it onto
   its own full-width line below the input rather than squeezing in beside it. */
.inp-shell .invalid-feedback {
  flex: 0 0 100%; width: 100%; margin-top: 3px;
  font-size: 12px; line-height: 1.4; color: var(--red);
}
.inp {
  width: 100%; height: 48px; padding: 0 15px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--surface); color: var(--ink);
  font-size: 15px; font-family: inherit; transition: border-color .12s, box-shadow .12s;
}
.inp:focus { outline: none; border-color: var(--backer); box-shadow: 0 0 0 3px var(--backer-soft); }
.inp::placeholder { color: var(--ink-4); }
.inp.is-invalid { border-color: var(--red); }
.inp.is-invalid:focus { box-shadow: 0 0 0 3px var(--red-soft); }
.inp[readonly] { background: var(--surface-2); color: var(--ink-2); }
/* A line under a sign-up field: the organisation the email's domain joins. */
.fld-note { display: flex; align-items: baseline; gap: 7px; font-size: 12px; color: var(--ink-3); }
.fld-note[hidden] { display: none; }
.fld-note i { color: var(--backer); font-size: 11px; }
.fld-note b { color: var(--ink); font-weight: 600; }
.inp-shell.ico .inp { padding-left: 42px; }
.inp-shell .lead {
  position: absolute; left: 15px; color: var(--ink-4); display: grid;
  place-items: center; pointer-events: none; font-size: 15px;
}
.inp-shell .inp:focus ~ .lead { color: var(--backer); }
.inp-shell.pwd .inp { padding-right: 46px; }
.pwd-toggle {
  position: absolute; right: 6px; height: 36px; width: 36px; border: 0;
  background: transparent; color: var(--ink-4); cursor: pointer;
  border-radius: 8px; display: grid; place-items: center; font-size: 16px;
}
.pwd-toggle:hover { color: var(--ink-2); background: var(--surface-2); }

/* Native select rendered as .inp - caret via inline SVG (theme-neutral grey). */
select.inp {
  appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%236a7570' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 15px center; padding-right: 38px;
}

/* Choices.js-wrapped select inside an .inp-shell (e.g. the sign-up city picker)
   sized to match the 48px native .inp / select.inp sitting next to it. The
   global Choices theme (§"Choices.js global theme") sets an 8px/44px control;
   this overrides the height/radius/padding/type to the auth field. */
.auth-form .inp-shell .choices { width: 100%; margin-bottom: 0; min-width: 0; }
.auth-form .inp-shell .choices__inner {
  min-height: 48px; display: flex; align-items: center; flex-wrap: nowrap;
  border-radius: 10px !important; padding: 0 38px 0 15px; font-size: 15px; font-weight: 400;
}
.auth-form .inp-shell .choices__list--single { padding: 0; width: 100%; }
.auth-form .inp-shell .choices__list--single .choices__item { font-size: 15px; line-height: 1.2; }
.auth-form .inp-shell .choices input.choices__input { font-size: 15px; padding: 2px 0; }
.auth-form .inp-shell .choices.is-focused .choices__inner,
.auth-form .inp-shell .choices.is-open .choices__inner {
  border-color: var(--backer); box-shadow: 0 0 0 3px var(--backer-soft);
}
.auth-form .inp-shell .choices[data-type*=select-one]::after { right: 15px; }

/* ---- Rows / links / actions ---- */
.auth-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-top: -2px;
}
.chk {
  display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px;
  color: var(--ink-2); cursor: pointer; user-select: none;
}
.chk input { width: 16px; height: 16px; accent-color: var(--backer); margin: 0; cursor: pointer; }
.lnk { color: var(--backer-ink); font-weight: 600; font-size: 13.5px; text-decoration: none; }
.lnk:hover { color: var(--backer); text-decoration: underline; text-underline-offset: 2px; }

.auth-submit {
  width: auto; min-width: 50%; align-self: center; white-space: nowrap;
  justify-content: center; padding: 14px 28px; font-size: 15px; font-weight: 600;
  margin-top: 3px;
}

.auth-alt {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  flex-wrap: wrap; text-align: center; margin-top: 22px; font-size: 13.5px;
  color: var(--ink-3);
}
.auth-alt a {
  display: inline-flex; align-items: center; gap: 6px; color: var(--backer-ink);
  font-weight: 600; text-decoration: none;
}
.auth-alt a:hover { color: var(--backer); }

.auth-foot-note {
  display: flex; gap: 10px; align-items: flex-start; margin-top: 20px;
  padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--line-2);
  border-radius: 10px; font-size: 12.5px; color: var(--ink-3); line-height: 1.5;
}
.auth-foot-note > .fa-circle-info { color: var(--backer); margin-top: 1px; }

.auth-terms {
  display: flex; gap: 9px; align-items: flex-start; font-size: 13px;
  color: var(--ink-2); line-height: 1.5;
}
.auth-terms input { width: 16px; height: 16px; accent-color: var(--backer); margin-top: 2px; flex-shrink: 0; cursor: pointer; }
.auth-terms a { color: var(--backer-ink); font-weight: 600; text-decoration: none; }
.auth-terms a:hover { color: var(--backer); }

/* ---- Password requirements checklist (sign-up / reset) ---- */
.pw-reqs {
  margin-top: 4px; margin-bottom: 4px; padding: 11px 13px; background: var(--surface-2);
  border: 1px solid var(--line-2); border-radius: 10px;
}
.pw-reqs ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.pw-req {
  display: flex; align-items: flex-start; gap: 8px; font-size: 12px; line-height: 1.45;
  color: var(--ink-3); transition: color .12s;
}
.pw-req i { font-size: 12px; margin-top: 2px; flex-shrink: 0; color: var(--ink-4); }
.pw-req .req-tick { display: none; }
.pw-req.met { color: var(--green); }
.pw-req.met .req-dot { display: none; }
.pw-req.met .req-tick { display: inline-block; color: var(--green); }

/* ---- Role picker (sign-up) ---- */
.role-pick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 20px; }
.role-pick button {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 13px 6px; border: 1px solid var(--line); border-radius: 11px;
  background: var(--surface); color: var(--ink-3); font: inherit; font-size: 11.5px;
  font-weight: 600; cursor: pointer; transition: .12s;
}
.role-pick button > .fa-solid { font-size: 18px; }
.role-pick button:hover { border-color: var(--ink-4); color: var(--ink-2); }
.role-pick button.on {
  border-color: var(--backer); background: var(--backer-soft);
  color: var(--backer-ink); box-shadow: 0 0 0 3px var(--backer-softer);
}

/* ---- Status screens (medallion + actions) ---- */
.auth-medal {
  width: 66px; height: 66px; border-radius: 50%; display: grid;
  place-items: center; margin-bottom: 24px; font-size: 28px;
}
.auth-medal.teal  { background: var(--backer-soft); color: var(--backer-ink); }
.auth-medal.green { background: var(--green-soft);  color: var(--green); }
.auth-medal.amber { background: var(--amber-soft);  color: var(--amber); }
.auth-actions { display: flex; flex-direction: column; gap: 12px; margin-top: 28px; }
.auth-actions .btn {
  width: auto; align-self: center; white-space: nowrap; justify-content: center;
  padding: 13px 30px; font-weight: 600;
}

/* ---- 2FA: code field + QR + manual key ---- */
.code-inp {
  text-align: center; font-family: var(--font-mono); font-size: 30px;
  font-weight: 500; letter-spacing: .42em; padding-left: .42em; height: 62px;
}
.qr-frame {
  display: inline-grid; place-items: center; padding: 16px; background: #fff;
  border: 1px solid var(--line); border-radius: 14px;
}
.qr-frame img, .qr-frame svg { display: block; max-width: 200px; height: auto; }
.key-chip {
  display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-mono);
  font-size: 13px; color: var(--ink); background: var(--surface-2);
  border: 1px solid var(--line-2); border-radius: 9px; padding: 9px 13px; letter-spacing: .04em;
}
.key-chip button {
  border: 0; background: transparent; color: var(--ink-4); cursor: pointer;
  font: inherit; font-size: 11px; font-weight: 600; padding: 2px 4px;
}
.key-chip button:hover { color: var(--backer); }

@media (max-width: 520px) {
  .fld.two { grid-template-columns: 1fr; }
  .role-pick { grid-template-columns: repeat(2, 1fr); }
}

/* =====================================================================
   28. INFRA-MAPS - INVESTMENT FLOWS (#inv-flows-page, .if-*)

   Page chrome for the live Investment Flows choropleth (maps/investment_flows.html
   + static/js/maps/investment-flows.js). Map-shell grid, floating overlays
   (metric toggle / legend / year slider), and the click-to-pin time-series panel.
   Uses the platform tokens (--backer, --surface, --surface-2, --line, --ink,
   --ink-3); the inline hex fallbacks are belt-and-braces only.
   ===================================================================== */

#inv-flows-page { display: flex; flex-direction: column; gap: 16px; }

.if-shell { width: 100%; }

/* --- map frame --- */
.if-map-wrap {
  position: relative;
  border: 1px solid var(--line, #e4e7e6);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface-2, #f7f6f2);
  /* Floor matches the .if-map clamp floor so the token / no-token states (the
     latter has no .if-map) are the same height and leave no grey gap. */
  min-height: 520px;
}
/* Explicit height instead of position:absolute/inset:0 - the absolute approach
   collides with Mapbox's own `.mapboxgl-map { position: relative }` (equal
   specificity, mapbox-gl.css loads later and wins), collapsing the container so
   the canvas has no box to fill. An explicit height sidesteps the conflict and
   matches the working dashboard map. The wrap (position:relative) still anchors
   the absolutely-positioned overlays. */
.if-map { width: 100%; height: clamp(520px, 72vh, 780px); }
.if-error {
  position: absolute; inset: 0; display: grid; place-items: center;
  padding: 24px; text-align: center; color: var(--ink-3, #6a7570);
  font: 500 13px/1.5 var(--font-sans);
}

/* --- overlays --- */
.if-overlay {
  position: absolute; z-index: 3;
  background: color-mix(in srgb, var(--surface, #fff) 92%, transparent);
  backdrop-filter: blur(6px);
  border: 1px solid var(--line, #e4e7e6);
  border-radius: 10px;
  padding: 8px;
  box-shadow: 0 2px 10px rgba(20,30,40,0.06);
}
/* sizes to the metric-button row (capped), with the legend spanning beneath */
.if-overlay-tl { top: 12px; left: 12px; max-width: min(380px, calc(100% - 24px)); }
.if-overlay-bottom {
  bottom: 12px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px;
  padding: 8px 14px; width: min(520px, calc(100% - 24px));
}
/* legend sits beneath the metric buttons, divided by a hairline */
.if-legend-block {
  margin-top: 9px; padding-top: 9px;
  border-top: 1px solid var(--line, #e4e7e6);
}

/* --- metric toggle --- */
.if-metric { display: flex; flex-wrap: wrap; }       /* a .view-toggle that wraps in the overlay */
.if-metric button { white-space: nowrap; }

/* --- year slider + play --- */
.if-play {
  border: 1px solid var(--line, #e4e7e6); background: var(--surface, #fff);
  color: var(--backer, #2d6b66); font: 600 12px/1 var(--font-sans);
  padding: 7px 14px; border-radius: 7px; cursor: pointer; min-width: 64px;
}
.if-play:hover { background: var(--surface-2, #f7f6f2); }
.if-slider { flex: 1; accent-color: var(--backer, #2d6b66); cursor: pointer; }
.if-year {
  font: 700 14px/1 var(--font-sans); color: var(--ink, #111714);
  font-variant-numeric: tabular-nums; min-width: 42px; text-align: right;
}

/* --- legend --- */
.if-legend-unit {
  font: 600 10px/1.3 var(--font-sans); color: var(--ink-3, #6a7570);
  margin-bottom: 6px; text-transform: none;
}
.if-legend-ramp { height: 10px; border-radius: 3px; }
.if-legend-labels {
  display: flex; justify-content: space-between;
  font: 500 9.5px/1 var(--font-sans); color: var(--ink-3, #6a7570);
  margin-top: 4px; font-variant-numeric: tabular-nums;
}

/* --- slide-out country panel --- */
/* Absolutely-positioned drawer over the right edge of the map, hidden
   (translated off-screen) until a country is clicked. The map itself stays
   full width; the drawer overlays it. */
/* The slide-out detail panel's width - also where the map controls move to
   while it is open (Energy Assets). */
:root { --if-panel-w: min(360px, 86%); }
.if-panel {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: var(--if-panel-w);
  background: var(--surface, #fff);
  border-left: 1px solid var(--line, #e4e7e6);
  padding: 18px;
  display: flex; flex-direction: column; gap: 12px;
  transform: translateX(101%);
  transition: transform .3s cubic-bezier(.4, 0, .2, 1);
  z-index: 5; overflow-y: auto;
}
.if-panel.open { transform: translateX(0); }
.if-panel-close {
  position: absolute; top: 10px; right: 12px;
  border: 0; background: transparent;
  font-size: 22px; line-height: 1; color: var(--ink-3, #6a7570);
  cursor: pointer; padding: 0 4px;
}
.if-panel-close:hover { color: var(--ink, #111714); }
.if-panel-head { padding-right: 22px; }
.if-panel-title { margin: 0; font: 700 17px/1.25 var(--font-sans); color: var(--ink, #111714); }
.if-panel-sub {
  margin-top: 3px; font: 600 10.5px/1.3 var(--font-sans);
  color: var(--ink-3, #6a7570); text-transform: uppercase; letter-spacing: .04em;
}
.if-panel-figs { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.if-panel-value {
  font: 700 24px/1 var(--font-sans); color: var(--backer, #2d6b66);
  font-variant-numeric: tabular-nums;
}
.if-panel-value .if-panel-value-yr {
  font: 600 12px/1 var(--font-sans); color: var(--ink-3, #6a7570); margin-left: 6px;
}
.if-panel-rank {
  font: 600 11px/1 var(--font-sans); color: var(--ink-3, #6a7570);
  background: var(--surface-2, #f7f6f2); border: 1px solid var(--line, #e4e7e6);
  border-radius: 999px; padding: 4px 9px; font-variant-numeric: tabular-nums;
}
.if-chart-cap {
  margin-top: 14px; font: 600 10px/1.3 var(--font-sans);
  color: var(--ink-3, #6a7570); text-transform: uppercase; letter-spacing: .04em;
}
/* fills the remaining panel height under the header + caption */
.if-chart { width: 100%; flex: 1 1 auto; min-height: 280px; margin-top: 4px; }

/* --- footers under the map (Sources, Explanatory notes) --- */
.if-foot-sec {
  margin-top: 16px;
  border: 1px solid var(--line, #e4e7e6);
  border-radius: var(--radius, 12px);
  background: var(--surface, #fff);
  padding: 16px 18px;
}
.if-foot-h {
  margin: 0 0 10px; font: 700 11px/1.2 var(--font-sans);
  text-transform: uppercase; letter-spacing: .05em; color: var(--ink, #111714);
}
.if-foot-body { margin: 0; font: 400 13px/1.6 var(--font-sans); color: var(--ink-2, #3b4743); }
.if-foot-body a { color: var(--backer, #2d6b66); }
.if-notes {
  margin: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 22px;
}
@media (max-width: 760px) { .if-notes { grid-template-columns: 1fr; } }
.if-note dt { font: 700 13px/1.3 var(--font-sans); color: var(--ink, #111714); }
.if-note dt span { font-weight: 500; color: var(--ink-3, #6a7570); }
.if-note dd { margin: 3px 0 0; font: 400 12.5px/1.55 var(--font-sans); color: var(--ink-2, #3b4743); }
.if-note-key {
  margin: 14px 0 0; padding-top: 14px; border-top: 1px solid var(--line, #e4e7e6);
  font: 400 12.5px/1.6 var(--font-sans); color: var(--ink-2, #3b4743);
}



/* =====================================================================
   28B. INFRA-MAPS - ASSET MAPS (.asset-map-page, .ea-*)

   Page chrome for a sector's asset map - Energy Assets and every later
   sector (maps/asset_map.html + static/js/maps/asset-map.js); .ea-* is the
   asset-map family, named after the first one. The page is a flex column that fills the
   remaining viewport height, so the map grows with the window. Reuses the §28
   slide-out panel (.if-panel) and error frame (.if-error) and the §28D shared
   map chrome (the Filters / Layers dock, sections, tick rows, swatches);
   what is .ea-* here is page-only: count badge, search, region tree, status
   dots, marker-size key and the detail facts list. Tokens only; hex
   fallbacks are belt-and-braces.
   ===================================================================== */

.asset-map-page {
  display: flex; flex-direction: column; gap: 12px;
  flex: 1 1 auto; min-height: 0;
}

/* compact head so the map gets the height */
.ea-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.ea-head .page-title { margin-bottom: 0; }
.ea-head .ea-pilot { vertical-align: middle; margin-left: 8px; font-size: 11px; }
.ea-head-actions { display: flex; gap: 8px; flex: none; }
.ea-src-n {
  display: inline-block; min-width: 16px; padding: 0 4px; margin-left: 2px;
  border-radius: 999px; background: var(--backer-soft, #e9f1f0); color: var(--backer-ink, #1d4b47);
  font: 700 10px/16px var(--font-sans); text-align: center;
}

/* map frame - fills the rest of the page */
.ea-map-wrap {
  position: relative; flex: 1 1 auto; min-height: 420px;
  border: 1px solid var(--line, #e4e7e6); border-radius: 12px; overflow: hidden;
  background: var(--surface-2, #f7f6f2);
}
/* The Pipeline map (maps/pipeline_map.html) shares this page chrome. */
#ea-map, #pipeline-map { position: absolute; inset: 0; }
/* Full screen (Mapbox control) takes the whole page: header, map frame and modals. */
.asset-map-page:fullscreen { background: var(--bg, #fbfaf7); padding: 12px 16px 16px; }
/* The open detail panel covers the right edge: slide the zoom / full-screen
   controls to its left so they stay reachable... */
.ea-map-wrap .mapboxgl-ctrl-top-right,
.ea-map-wrap .mapboxgl-ctrl-bottom-right { transition: right .3s cubic-bezier(.4, 0, .2, 1); }
/* ...and the attribution (bottom-right), which must stay readable (licences). */
.ea-map-wrap:has(.if-panel.open) .mapboxgl-ctrl-top-right,
.ea-map-wrap:has(.if-panel.open) .mapboxgl-ctrl-bottom-right { right: var(--if-panel-w); }
@media (prefers-reduced-motion: reduce) {
  .ea-map-wrap .mapboxgl-ctrl-top-right, .ea-map-wrap .mapboxgl-ctrl-bottom-right { transition: none; }
}

/* count badge (top-centre; bottom-centre on narrower maps - §28D) */
.ea-count {
  position: absolute; z-index: 3;
  background: color-mix(in srgb, var(--surface, #fff) 94%, transparent);
  backdrop-filter: blur(6px);
  border: 1px solid var(--line, #e4e7e6); border-radius: 10px;
  box-shadow: 0 2px 10px rgba(20,30,40,.06);
  top: 12px; left: 50%; transform: translateX(-50%);
  padding: 6px 12px; white-space: nowrap;
  font: 500 12px/1.2 var(--font-sans); color: var(--ink-2, #3b4743);
  font-variant-numeric: tabular-nums;
}
.ea-count b { color: var(--ink, #111714); font-weight: 700; }
.ea-count[hidden] { display: none; }

/* A refusal said over the map (asset-map.js `notice`): the account is asking
   faster than its allowance, or its map access is paused. Under the count
   badge; with it at the bottom on narrower maps. */
.ea-notice {
  position: absolute; z-index: 4;
  top: 50px; left: 50%; transform: translateX(-50%);
  max-width: min(440px, calc(100% - 32px));
  padding: 8px 14px; text-align: center;
  background: var(--surface, #fff);
  border: 1px solid color-mix(in srgb, var(--amber, #b7791f) 45%, var(--line, #e4e7e6));
  border-radius: 10px; box-shadow: 0 4px 16px rgba(20,30,40,.12);
  font: 500 12.5px/1.4 var(--font-sans); color: var(--ink, #111714);
}
.ea-notice[hidden] { display: none; }
/* A note that is no warning (the Pipeline map's "no projects to show"). */
.ea-notice.is-info { border-color: var(--line, #e4e7e6); }
/* The check a heavy user is asked to pass (#eaChallengeModal): room for
   Turnstile's widget, so the modal does not jump when it is drawn. */
.ea-challenge-widget { min-height: 68px; margin: 12px 0 4px; }

.ea-tree.collapsed .map-caret { transform: rotate(180deg); }

.ea-search, .ea-range input {
  width: 100%; border: 1px solid var(--line, #e4e7e6); border-radius: 7px;
  background: var(--surface, #fff); color: var(--ink, #111714);
  padding: 6px 9px; font: 400 12px/1.3 var(--font-sans);
}
.ea-search:focus, .ea-range input:focus {
  outline: 2px solid var(--backer-soft, #dcebe8); border-color: var(--backer, #2d6b66);
}
/* find-a-site results: a list under the search box, not a map filter */
.ea-search-wrap { position: relative; }
.ea-search-results {
  margin-top: 4px; max-height: 240px; overflow-y: auto;
  border: 1px solid var(--line, #e4e7e6); border-radius: 7px; background: var(--surface, #fff);
}
.ea-search-results .ea-note { margin: 0; padding: 8px 9px; }
.ea-search-hit {
  display: block; width: 100%; text-align: left; border: 0; background: transparent;
  padding: 6px 9px; border-top: 1px solid var(--line-2, #eef0ef); cursor: pointer;
}
.ea-search-hit:first-child { border-top: 0; }
.ea-search-hit:hover, .ea-search-hit:focus { background: var(--backer-softer, #f1f7f6); outline: none; }
.ea-search-name { display: block; font: 600 12px/1.3 var(--font-sans); color: var(--ink, #111714); }
.ea-search-meta { display: block; font: 400 11px/1.3 var(--font-sans); color: var(--ink-3, #6b736f); }
/* a site found through another source's record of it: that source's name for it */
.ea-search-via { font-style: italic; overflow-wrap: anywhere; }
/* the chooser a click on markers drawn over one another opens (asset-map.js) */
.ea-stack { max-height: 260px; overflow-y: auto; margin: -2px -4px; }
.ea-stack-head { margin: 0 0 4px; padding: 0 9px; font: 600 11px/1.3 var(--font-sans); color: var(--ink-3, #6b736f); }

/* status key: filled = operating, fading = earlier in the pipeline (mirrors marker opacity) */
.ea-status-dot {
  width: 10px; height: 10px; border-radius: 50%; flex: none;
  background: var(--backer, #2d6b66); box-shadow: 0 0 0 1px rgba(0,0,0,.08);
}
.ea-status-dot.construction { opacity: .8; }
.ea-status-dot.pre_construction { opacity: .6; }
.ea-status-dot.announced { opacity: .42; }
/* ...and, on a map that draws lines, a sample of how a line of that status
   is drawn: one of the line swatches (.map-swatch.is-line / .is-dashed /
   .is-dotted), the kind given by the script (LINE_STATUSES in asset-map.js) */
.ea-status-line { --sw: var(--ink-3, #6b736f); --sw-h: 2px; margin-left: -2px; }

/* two-level tick-box tree: region > country. The parent row is a tick box
   (all / some / none of its children) plus a separate chevron that shows or
   hides them. */
.ea-tree-list { display: flex; flex-direction: column; gap: 2px; }
.ea-tree-head { display: flex; align-items: center; gap: 2px; }
.ea-tree-head .map-check { flex: 1; min-width: 0; font-weight: 600; color: var(--ink, #111714); }
.ea-tree-toggle {
  flex: none; border: 0; background: transparent; cursor: pointer;
  padding: 4px 6px; border-radius: 5px; line-height: 1;
}
.ea-tree-toggle:hover { background: var(--surface-2, #f7f6f2); }
.ea-tree-toggle .map-caret { margin-left: 0; }
.ea-tree-body { padding-left: 2px; border-left: 1px solid var(--line, #e4e7e6); margin-left: 10px; }
.ea-tree.collapsed .ea-tree-body { display: none; }
/* a sub-sector listed by type (the Sub-sector filter): its row reads as the
   sub-sector rows beside it, with its types beneath */
#ea-tech .ea-tree-head .map-check { font-weight: inherit; color: inherit; }

.ea-range { display: flex; align-items: center; gap: 6px; font: 500 11px/1 var(--font-sans); color: var(--ink-3, #6a7570); }
.ea-range-unit { font-weight: 600; }
.ea-note { margin: 2px 0 0; font: 400 10.5px/1.45 var(--font-sans); color: var(--ink-3, #6a7570); }

/* marker-size key */
.ea-scale-svg circle { fill: none; stroke: var(--ink-3, #6a7570); stroke-width: 1; }
.ea-scale-svg line { stroke: var(--line, #e4e7e6); stroke-width: 1; }
.ea-scale-svg text {
  fill: var(--ink-3, #6a7570); font: 600 9.5px var(--font-sans); dominant-baseline: middle;
}
.ea-scale-svg line { stroke-dasharray: 2 2; }


/* detail panel facts + source line */
.ea-facts { margin: 4px 0 0; display: grid; grid-template-columns: max-content 1fr; gap: 8px 14px; }
.ea-facts dt { font: 600 11px/1.4 var(--font-sans); color: var(--ink-3, #6a7570); }
.ea-facts dd { margin: 0; font: 500 13px/1.4 var(--font-sans); color: var(--ink, #111714); overflow-wrap: anywhere; }
.ea-panel-source {
  margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line, #e4e7e6);
  font: 500 11px/1.5 var(--font-sans); color: var(--ink-3, #6a7570);
}
/* one line per source of what the panel says: the site's own, then each
   other source that supplied one of its facts */
.ea-panel-source-line { display: block; overflow-wrap: anywhere; }
.ea-panel-source-line + .ea-panel-source-line { margin-top: 3px; }
#ea-panel .if-panel-figs { align-items: center; }
/* The detail's sections stack as the panel's own flex items (its gap between
   them, none while there are no sections). */
.ea-panel-sections { display: contents; }
/* a multi-phase site's phase list; phases outside the ticked statuses dim */
.ea-phases-head { margin: 0 0 6px; font: 700 11px/1.4 var(--font-sans); color: var(--ink-3, #6a7570); text-transform: uppercase; letter-spacing: .04em; }
.ea-phase {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 7px 0;
  border-top: 1px solid var(--line, #e4e7e6);
}
.ea-phase-name { font: 600 12.5px/1.35 var(--font-sans); color: var(--ink, #111714); overflow-wrap: anywhere; }
.ea-phase-cap { font: 600 12.5px/1.35 var(--font-sans); color: var(--ink, #111714); text-align: right; white-space: nowrap; }
.ea-phase-meta { grid-column: 1 / -1; font: 500 11px/1.4 var(--font-sans); color: var(--ink-3, #6a7570); }
.ea-phase.is-out { opacity: .5; }
/* co-located sites: each row jumps to that site */
.ea-coloc-item {
  display: grid; grid-template-columns: auto 1fr; gap: 1px 8px; width: 100%; padding: 7px 0;
  border: 0; border-top: 1px solid var(--line, #e4e7e6); background: none; text-align: left; cursor: pointer;
}
.ea-coloc-item:hover .ea-coloc-name, .ea-coloc-item:focus-visible .ea-coloc-name { text-decoration: underline; }
.ea-coloc-item .map-swatch { grid-row: 1 / 3; align-self: center; }
.ea-coloc-name { font: 600 12.5px/1.35 var(--font-sans); color: var(--ink, #111714); overflow-wrap: anywhere; }
.ea-coloc-meta { font: 500 11px/1.4 var(--font-sans); color: var(--ink-3, #6a7570); }
.ea-coloc-tag { padding: 0 6px; margin-left: 4px; font-size: 10px; vertical-align: 1px; }
/* fuel split of a mixed-fuel site (coal + biomass units, ...) */
.ea-split { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 0; font: 500 12px/1.4 var(--font-sans);
  color: var(--ink-2, #3b4541); }
.ea-split-item { display: inline-flex; align-items: center; gap: 5px; }
#ea-panel-tech { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
/* a facet with no matches under the current filters */
.map-check.is-empty { opacity: .45; }

/* sources modal: never taller than three quarters of the window - a long
   list (Energy Assets' ran to 2,500 px) scrolls inside it */
#eaSourcesModal .modal-content { max-height: 75vh; }
#eaSourcesModal .modal-body { overflow-y: auto; min-height: 0; }
.ea-source { padding: 12px 0; border-top: 1px solid var(--line, #e4e7e6); }
.ea-source:first-child { border-top: 0; padding-top: 0; }
.ea-source-title { margin: 0; font: 700 14px/1.3 var(--font-sans); color: var(--ink, #111714); }
.ea-source-meta { margin: 3px 0 0; font: 600 11px/1.4 var(--font-sans); color: var(--ink-3, #6a7570); }
.ea-source-credit { margin: 6px 0 0; font: 500 12px/1.45 var(--font-sans); color: var(--ink-2, #3d4642); }
.ea-source-links { margin: 6px 0 0; display: flex; gap: 14px; font: 600 12px/1 var(--font-sans); }
/* a source's coverage caveat (the grid overlay: OSM mapping varies by country) */
.ea-source-caveat { margin: 6px 0 0; font: 500 12px/1.45 var(--font-sans); color: var(--ink-3, #6a7570); }
.ea-source-note { margin-top: 14px; }
/* "Map overlays" block (grid overlay credit + data date) */
.ea-source-group {
  margin: 16px 0 4px; padding-top: 12px; border-top: 1px solid var(--line, #e4e7e6);
  font: 700 10.5px/1.2 var(--font-sans); text-transform: uppercase; letter-spacing: .05em;
  color: var(--ink-3, #6a7570);
}
.ea-source-group + .ea-source { border-top: 0; padding-top: 6px; }

/* Below 900px the count badge moves to bottom-centre so it can't meet an
   open Filters / Layers panel (272px from the left). */
@media (max-width: 900px) {
  .ea-count { top: auto; bottom: 12px; }
  .ea-notice { top: auto; bottom: 50px; }
}
@media (max-width: 760px) {
  .ea-map-wrap { min-height: 60vh; }
}

/* reduced motion: no slide on the panel (Investment Flows' and the asset maps') */
@media (prefers-reduced-motion: reduce) {
  .if-panel { transition: none; }
}

/* =====================================================================
   28C. ADMIN - DATA SOURCES (#admin-page .ds-*)

   admin/admin_data_sources.html (source cards + upload + history),
   admin_data_source_import.html (preview / diff / apply) and
   admin_data_source_assets.html (records table + edit modal). Builds on the
   shared admin chrome (§ admin: .stat-tabs, .dtable, .pill, .mf-*).
   ===================================================================== */

#admin-page .ds-sector { margin: 18px 0 8px; }
/* anchor targets (#general, #sector-<x>, #history, #overlay-<slug>, #source-<slug>) clear the sticky topbar */
#admin-page .ds-sector, #admin-page .ds-card { scroll-margin-top: 80px; }

/* Collapsible source card: summary row always visible, body holds the detail
   + that source's own upload form. */
#admin-page .ds-card { padding: 0; margin-bottom: 12px; overflow: hidden; }
#admin-page .ds-card-head {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; width: 100%;
  border: 0; background: transparent; cursor: pointer; text-align: left;
  padding: 14px 18px;
}
#admin-page .ds-card-head:hover { background: var(--surface-2); }
#admin-page .ds-head-meta {
  margin-left: auto; font: 500 12px/1.2 var(--font-sans); color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
#admin-page .ds-head-meta b { color: var(--ink); }
#admin-page .ds-caret { font-size: 11px; color: var(--ink-3); transition: transform .2s; }
#admin-page .ds-card.collapsed .ds-caret { transform: rotate(180deg); }
#admin-page .ds-card.collapsed .ds-card-body { display: none; }
#admin-page .ds-card-body {
  display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px;
  padding: 4px 18px 18px; border-top: 1px solid var(--line);
}
@media (max-width: 900px) { #admin-page .ds-card-body { grid-template-columns: 1fr; } }
#admin-page .ds-title { font: 700 15px/1.3 var(--font-sans); color: var(--ink); }
#admin-page .ds-desc { margin: 10px 0 12px; font-size: 12.5px; color: var(--ink-3); }

/* add / edit source form */
/* Two-column modal form grid - shared by the source form and the record editor. */
.ds-form-grid, .ds-edit-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.ds-form-grid .ds-span-2, .ds-edit-grid .ds-span-2 { grid-column: 1 / -1; }
@media (max-width: 576px) { .ds-form-grid, .ds-edit-grid { grid-template-columns: 1fr; } }
.ds-form-grid { align-items: start; }   /* keep field boxes level across the row */
.ds-form-grid .field { margin-bottom: 14px; }
.ds-status-picker ul, .ds-country-picker ul {
  list-style: none; margin: 0; padding: 0; display: grid; gap: 2px 12px;
}
.ds-status-picker ul { grid-template-columns: 1fr; }
.ds-country-picker ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ds-status-picker li, .ds-country-picker li {
  display: flex; align-items: center; gap: 7px; font: 500 12.5px/1.6 var(--font-sans);
}
.ds-status-picker input, .ds-country-picker input { accent-color: var(--backer); }
/* a status the selected importer never reports */
.ds-status-picker li.is-unused { opacity: .45; }
.ds-country-picker {
  max-height: 180px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 10px; margin-top: 6px;
}
.ds-country-search { margin-top: 2px; }

/* "Add data source": the file identifies the importer and prefills the form */
.ds-detect {
  padding: 12px 14px; margin-bottom: 16px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--line);
}
.ds-detect-status { margin: 8px 0 0; font: 600 12px/1.45 var(--font-sans); color: var(--ink-3); }
.ds-detect-status.is-ok { color: var(--backer); }
.ds-detect-status.is-error { color: var(--red); }
#admin-page .ds-history-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
#admin-page .ds-meta {
  margin: 0 0 14px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 20px;
}
#admin-page .ds-meta dt { font: 600 10.5px/1.3 var(--font-sans); text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); }
#admin-page .ds-meta dd { margin: 2px 0 0; font-size: 13px; color: var(--ink); }
#admin-page .ds-links { display: flex; gap: 8px; flex-wrap: wrap; }
#admin-page .ds-muted { color: var(--ink-3); font-size: 12px; }
#admin-page .ds-upload { border-left: 1px solid var(--line); padding-left: 20px; }
@media (max-width: 900px) { #admin-page .ds-upload { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 14px; } }
#admin-page .ds-upload .field { margin-bottom: 12px; }
#admin-page .ds-upload input[type=file] { font-size: 12px; color: var(--ink-2); max-width: 100%; }
#admin-page .ds-upload .hint { margin-top: 8px; font-size: 11.5px; color: var(--ink-3); }
#admin-page .ds-upload-btn { margin-top: 2px; }
#admin-page .ds-empty, #admin-page .ds-empty-row { padding: 24px; text-align: center; color: var(--ink-3); font-size: 12.5px; }
#admin-page .ds-file { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#admin-page .ds-error { margin-top: 4px; max-width: 320px; font-size: 11.5px; color: var(--red); white-space: normal; }
#admin-page .ds-ref { font-variant-numeric: tabular-nums; color: var(--ink-3); white-space: nowrap; }
#admin-page .ds-name { min-width: 200px; max-width: 280px; }
#admin-page .ds-states .pill + .pill { margin-left: 4px; }
#admin-page .ds-release { margin-left: 8px; font-weight: 500; font-size: 15px; color: var(--ink-3); }

/* import preview */
#admin-page .ghost-alert { margin-bottom: 14px; }
#admin-page .ds-alert-danger .ico { color: var(--red); }
#admin-page .ds-unmapped { padding: 16px 18px; margin-bottom: 14px; }
#admin-page .ds-map-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 6px 0; border-top: 1px solid var(--line); }
#admin-page .ds-map-row select { border: 1px solid var(--line); border-radius: 7px; padding: 4px 8px; font-size: 12.5px; background: var(--surface); color: var(--ink); }
#admin-page .ds-map-src { font-size: 13px; }
#admin-page .ds-diff { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; font-size: 12.5px; }
#admin-page .ds-diff .ds-f { display: inline-block; min-width: 120px; color: var(--ink-3); font-weight: 600; font-size: 11.5px; }
#admin-page .ds-diff s { color: var(--ink-3); }
#admin-page .ds-diff .fa-arrow-right { font-size: 10px; color: var(--ink-4); margin: 0 4px; }
/* `flex-direction: row` is explicit: `.card` sets `column`, which otherwise
   stacks the bar and stretches the release field to the card's full height. */
#admin-page .ds-apply {
  display: flex; flex-direction: row; align-items: flex-end; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; padding: 16px 18px; margin-top: 16px;
}
#admin-page .ds-apply .field { flex: 0 1 340px; max-width: 420px; margin-bottom: 0; }
#admin-page .ds-apply-actions { display: flex; gap: 8px; }
#admin-page .ds-stale-ack {
  display: flex; align-items: center; gap: 8px; flex: 1 1 100%;
  font: 600 12.5px/1.4 var(--font-sans); color: var(--red); cursor: pointer;
}
#admin-page .ds-stale-ack input { accent-color: var(--red); }
#admin-page .ds-plain { font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }

/* Lookups: colour values shown as a swatch, and the Map-palettes sub-headings */
#admin-page .lk-dot {
  display: inline-block; width: 12px; height: 12px; border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0,0,0,.12); margin-right: 7px; vertical-align: -2px;
}
#admin-page .lk-colour { width: 64px; height: 32px; padding: 2px; }
/* dashed info card (lk_note macro) */
#admin-page .lk-note { padding: 14px var(--card-pad); background: var(--surface-2); border-style: dashed; }
#admin-page .lk-note.is-top { margin-bottom: 14px; }
#admin-page .lk-note.is-below { margin-top: 14px; }
#admin-page .lk-note-row { display: flex; gap: 10px; align-items: center; font-size: 12.5px; color: var(--ink-2); }
#admin-page .lk-note-row > i { color: var(--ink-3); }
#admin-page .lk-ref-subhead {
  padding: 8px 14px 2px; font: 700 10px/1.2 var(--font-sans);
  text-transform: uppercase; letter-spacing: .05em; color: var(--ink-4);
}

/* Duplicates review (admin_data_source_duplicates.html) */
#admin-page .stat-tabs.tabs-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 700px) { #admin-page .stat-tabs.tabs-3 { grid-template-columns: 1fr; } }
/* A review table sized to fit, so it deliberately isn't a `.u-table` (those
   take a 1192px min-width and scroll, which would hide the decision column).
   Fixed layout; widths live on the <colgroup>. */
#admin-page .dup-sectors { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
#admin-page .dup-sectors a.pill { text-decoration: none; }
#admin-page .dup-table { table-layout: fixed; min-width: 860px; }
#admin-page .dup-table col.c-score { width: 64px; }
#admin-page .dup-table col.c-evidence { width: 22%; }
#admin-page .dup-table col.c-decision { width: 150px; }
#admin-page .dup-table th, #admin-page .dup-table td { padding-left: 12px; padding-right: 12px; }
#admin-page .dup-table td { vertical-align: top; }
#admin-page .dup-rec { font-size: 13px; overflow-wrap: anywhere; }
/* which source each side of a pair comes from (its short name) */
#admin-page .dup-src { padding: 1px 6px; margin-right: 4px; font-size: 10.5px; }
/* two-pin satellite thumbnail per pair (D defers, M is the master) */
#admin-page .dup-map {
  display: block; width: 100%; max-width: 240px; height: auto; aspect-ratio: 240 / 150;
  margin-bottom: 6px; border-radius: 6px; border: 1px solid var(--line, #e4e7e6);
  background: var(--surface-2, #f7f6f2); object-fit: cover;
}
#admin-page .dup-rec-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; margin-top: 4px; }
#admin-page .dup-rec-actions form { margin: 0; }
#admin-page .dup-rec-actions .btn { padding-left: 0; }
/* A review row's other records at the same source site (one decision for all). */
#admin-page .dup-site { margin-top: 2px; font-size: 11.5px; }
#admin-page .dup-mates { margin-top: 6px; padding-top: 5px; border-top: 1px dashed var(--line); font-size: 12px; overflow-wrap: anywhere; }
#admin-page .dup-facts { display: flex; flex-wrap: wrap; gap: 2px 10px; margin-top: 3px; font-size: 11.5px; color: var(--ink-2); }
#admin-page .dup-evidence { display: flex; flex-wrap: wrap; gap: 4px; }
#admin-page .dup-score {
  display: inline-block; min-width: 34px; padding: 3px 7px; border-radius: 7px; text-align: center;
  font: 700 12.5px/1.2 var(--font-sans); font-variant-numeric: tabular-nums;
  background: var(--surface-2); color: var(--ink-2);
}
#admin-page .dup-score.is-high { background: var(--backer-softer); color: var(--backer); }
#admin-page .dup-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
#admin-page .dup-actions .btn { white-space: nowrap; }
#admin-page .dup-actions form { margin: 0; }

/* records edit modal */
.ds-locked { margin-bottom: 14px; padding: 10px 12px; border-radius: 8px; background: var(--amber-soft, #f8efdc); }
.ds-locked-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12.5px; padding: 2px 0; }

/* General section: map overlay cards (grid) + the release preview */
#admin-page .ds-stat-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 3px; font-size: 12.5px; }
#admin-page .ds-stat-list .lk-dot { margin-right: 6px; }
#admin-page .ds-check-row.is-fail td { background: var(--red-soft, #fbeaea); }
#admin-page .ds-check-row.is-warn td { background: var(--amber-soft, #f8efdc); }

/* =====================================================================
   28E. ADMIN - ASSETS (#admin-page .as-*)

   admin/admin_assets.html (the master asset list) and admin_asset.html (one
   asset: facts, units, source records, Compare sources, and its edit
   forms). They reuse §28C's .ds-* cells, .ds-edit-grid and .dup-src source
   pill and add only the asset page's own layout.
   ===================================================================== */

/* the list: one line per other source that lists the site */
#admin-page .as-linked { font-size: 12.5px; white-space: nowrap; }
#admin-page .as-linked > div + div { margin-top: 3px; }
#admin-page .dup-src + .ds-ref { font-size: 12px; }

/* one asset: facts beside where they come from, then full-width tables */
#admin-page .as-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start;
  margin-bottom: 16px;
}
@media (max-width: 1100px) { #admin-page .as-grid { grid-template-columns: 1fr; } }
#admin-page .as-card { margin-bottom: 16px; }
#admin-page .as-grid .card-head, #admin-page .as-card .card-head { padding: 14px 18px; }
#admin-page .as-f { width: 190px; color: var(--ink-3); font-weight: 600; font-size: 12.5px; white-space: nowrap; }
#admin-page .as-facts td, #admin-page .as-compare td { vertical-align: top; overflow-wrap: anywhere; }
#admin-page .as-side { padding-bottom: 16px; }
#admin-page .as-side .ds-meta { grid-template-columns: 1fr; padding: 4px 18px 0; margin-bottom: 0; }
#admin-page .as-mates { margin: 14px 18px 0; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13px; }
#admin-page .as-mates > div + div { margin-top: 8px; }
/* Compare sources: a column per source; a value that differs from the asset's */
#admin-page .as-compare th { vertical-align: bottom; min-width: 150px; }
#admin-page .as-compare .as-diff { background: var(--amber-soft, #f8efdc); }
/* editing: "Clear" beside a value Infra-Backer states; a card head's button */
#admin-page .as-clear .btn { padding: 0 6px; font-size: 12px; }
#admin-page .as-card .card-head .as-head-action { margin-left: auto; }

/* =====================================================================
   28F. ADMIN - SETTINGS (#admin-page .st-*)

   admin/admin_settings.html: one card per section of settings_registry,
   each its own form; a row is the setting's label, help and meta beside
   its control. Reuses .pf-switch and .pf-ig (§10), .dtable and .pill (§8),
   .inline-input and .ghost-alert (§20, §9).
   ===================================================================== */

#admin-page.st-page { max-width: 1080px; }
#admin-page .st-card { margin-bottom: 16px; }
#admin-page .st-intro { margin: 0; padding: 12px var(--card-pad) 0; font-size: 12.5px; color: var(--ink-3); }
#admin-page .st-rows { padding: 0 var(--card-pad); }

/* a row: label, help and meta | control */
#admin-page .st-row {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 12px 32px;
  padding: 18px 0; border-top: 1px solid var(--line-2);
}
#admin-page .st-row:first-child { border-top: 0; }
@media (max-width: 900px) { #admin-page .st-row { grid-template-columns: 1fr; } }
#admin-page .st-label-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
#admin-page .st-label-line label, #admin-page .st-name { margin: 0; font-size: 13.5px; font-weight: 600; color: var(--ink); }
#admin-page .st-mod { font-size: 10.5px; }
#admin-page .st-help { margin: 4px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--ink-3); }
#admin-page .st-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 8px; font-size: 11px; color: var(--ink-4); }
#admin-page .st-meta code { padding: 0; background: none; font-size: 10.5px; color: var(--ink-4); }
#admin-page .st-control { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; }
#admin-page .st-num { width: 280px; max-width: 100%; }
#admin-page .st-num input { padding: 9px 12px; font-size: 13px; background: transparent; color: var(--ink); outline: none; }
#admin-page .st-hint { font-size: 11.5px; color: var(--ink-4); }
#admin-page .st-error { font-size: 12px; font-weight: 500; color: var(--red); }
#admin-page .st-row.has-error .pf-ig,
#admin-page .st-row.has-error .inline-input:not([disabled]) { border-color: var(--red); }
#admin-page .st-reset { align-self: flex-start; padding: 0; border: 0; font-size: 12px; color: var(--ink-3); }
#admin-page .st-reset .fa-rotate-left { margin-right: 3px; font-size: 10px; }

#admin-page .st-switch-state { min-width: 22px; font-weight: 600; }

/* the domain blocklist and its check */
#admin-page .st-domains { min-height: 180px; resize: vertical; font-family: var(--font-mono); font-size: 12px; }
#admin-page .st-check { width: 100%; margin-top: 8px; padding-top: 12px; border-top: 1px dashed var(--line); }
#admin-page .st-check-label { display: block; margin-bottom: 6px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
#admin-page .st-check-line { display: flex; gap: 8px; max-width: 440px; }
#admin-page .st-check-out { min-height: 18px; margin-top: 6px; font-size: 12px; color: var(--ink-3); }
#admin-page .st-check-out.is-blocked { color: var(--red); }
#admin-page .st-check-out.is-allowed { color: var(--green); }

/* the map guard: its label above, the form full width */
#admin-page .st-label-wide, #admin-page .st-guard { grid-column: 1 / -1; }
#admin-page .st-guard { display: flex; flex-direction: column; align-items: stretch; gap: 8px; }
#admin-page .st-guard-switches { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 900px) { #admin-page .st-guard-switches { grid-template-columns: 1fr; } }
#admin-page .st-guard-switch {
  display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px;
  border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface-2);
}
#admin-page .st-guard-text b { display: block; font-size: 12.5px; color: var(--ink); }
#admin-page .st-guard-text span { display: block; margin-top: 2px; font-size: 11.5px; line-height: 1.45; color: var(--ink-3); }
#admin-page .st-guard-head { margin-top: 10px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
#admin-page .st-guard-head span { margin-left: 6px; font-weight: 400; color: var(--ink-4); }
#admin-page .st-grid-wrap { overflow-x: auto; border: 1px solid var(--line-2); border-radius: 10px; }
#admin-page .st-grid { margin: 0; }
#admin-page .st-grid td { vertical-align: middle; }
#admin-page .st-grid th.num, #admin-page .st-grid td.num { width: 160px; }
@media (max-width: 600px) {
  #admin-page .st-grid th.num, #admin-page .st-grid td.num { width: 92px; padding-left: 6px; padding-right: 6px; }
  #admin-page .st-grid td:first-child { min-width: 120px; }
}
#admin-page .st-cell { padding: 6px 10px; font-size: 12.5px; text-align: right; font-variant-numeric: tabular-nums; }
#admin-page .st-cell::placeholder { color: var(--ink-4); }
#admin-page .st-sub { margin-left: 4px; font-size: 11px; color: var(--ink-4); }

/* the foot: unsaved changes, Discard, Save */
#admin-page .st-dirty { font-weight: 600; color: var(--amber); }
#admin-page .st-dirty .fa-circle { margin-right: 4px; font-size: 7px; vertical-align: middle; }
#admin-page .st-foot-actions { display: flex; gap: 8px; margin-left: auto; }

/* the environment: read-only tiles */
#admin-page .st-env {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  border-radius: 0 0 var(--radius) var(--radius); overflow: hidden;
}
/* a hairline right and below each tile; the card's edge hides the outer ones */
#admin-page .st-env-item {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 14px var(--card-pad);
  box-shadow: 1px 0 0 var(--line-2), 0 1px 0 var(--line-2); margin: 0 -1px -1px 0;
}
#admin-page .st-env-note { padding: 0; background: none; font-size: 10.5px; color: var(--ink-4); overflow-wrap: anywhere; }

/* Advanced: the map guard as JSON, collapsed */
#admin-page .st-advanced summary { cursor: pointer; list-style: none; border-bottom: 0; }
#admin-page .st-advanced summary::-webkit-details-marker { display: none; }
#admin-page .st-advanced details[open] > summary { border-bottom: 1px solid var(--line-2); }
#admin-page .st-adv-body { display: flex; flex-direction: column; gap: 10px; padding: 14px var(--card-pad); }
#admin-page .st-json { resize: vertical; font-family: var(--font-mono); font-size: 12px; }
#admin-page .st-defaults { font-size: 11.5px; color: var(--ink-3); }
#admin-page .st-defaults pre { margin: 6px 0 0; font-family: var(--font-mono); font-size: 11px; }
#admin-page .st-error-list { margin: 6px 0 0; padding-left: 18px; }
#admin-page .st-orphans code { font-size: 11.5px; }

/* =====================================================================
   28D. MAP CHROME (SHARED) (.map-dock, .map-panel, .map-sec, .map-check,
        .map-swatch)

   Page-agnostic chrome for every Infra-Maps page: the top-left dock that
   holds the Filters and Layers buttons side by side with their panels
   beneath (opening one collapses the other - IB.MapDock), collapsible panel
   sections, tick rows with counts, and legend swatches (dot, small dot,
   line, dashed line, dotted line). Built by static/js/maps/layers-panel.js
   and the page's own filter markup. The dock sits inside the map frame, so
   it comes with the map into full screen, and its max-height leaves the
   bottom corners to the Mapbox logo and attribution.
   ===================================================================== */

.map-dock {
  position: absolute; top: 12px; left: 12px; z-index: 3;
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  max-height: calc(100% - 64px); max-width: calc(100% - 24px);
  pointer-events: none;           /* the empty part of the dock is still map */
}
.map-dock > * { pointer-events: auto; }
.map-dock-bar { display: flex; gap: 6px; flex: none; align-self: flex-start; }
.map-dock-bar .map-panel-toggle, .map-panel {
  background: color-mix(in srgb, var(--surface, #fff) 94%, transparent);
  backdrop-filter: blur(6px);
  border: 1px solid var(--line, #e4e7e6); border-radius: 10px;
  box-shadow: 0 2px 10px rgba(20,30,40,.06);
}
.map-panel-toggle {
  display: inline-flex; align-items: center; gap: 7px; flex: none;
  cursor: pointer; padding: 8px 11px;
  font: 600 12px/1 var(--font-sans); color: var(--ink, #111714);
}
.map-panel-toggle:hover { background: var(--surface, #fff); }
.map-panel-toggle[aria-expanded="true"] { border-color: var(--backer, #2d6b66); }
.map-panel-toggle .map-caret { margin-left: 2px; }
.map-panel-toggle[aria-expanded="false"] .map-caret { transform: rotate(180deg); }
/* active-overlay count on the Layers button */
.map-count {
  display: inline-block; min-width: 16px; padding: 0 4px; border-radius: 999px;
  background: var(--backer, #2d6b66); color: #fff;
  font: 700 10px/16px var(--font-sans); text-align: center;
}
.map-panel {
  width: 272px; max-width: 100%; min-height: 0; flex: 0 1 auto;
  display: flex; flex-direction: column;
}
.map-panel[hidden] { display: none; }
.map-panel-body {
  overflow-y: auto; padding: 10px 12px 12px;
  display: flex; flex-direction: column; gap: 10px;
}
.map-caret { margin-left: auto; font-size: 10px; color: var(--ink-3, #6a7570); transition: transform .2s; }

/* collapsible section: chevron sits directly right of the heading */
.map-sec { border-top: 1px solid var(--line, #e4e7e6); padding-top: 8px; }
.map-sec:first-of-type { border-top: 0; padding-top: 0; }
.map-sec-head {
  display: flex; align-items: center; gap: 6px; width: 100%;
  border: 0; background: transparent; cursor: pointer; padding: 2px 0 6px;
  font: 700 10px/1.2 var(--font-sans); text-transform: uppercase; letter-spacing: .05em;
  color: var(--ink-3, #6a7570);
}
.map-sec-meta {
  margin-left: auto; font-weight: 600; letter-spacing: 0; text-transform: none;
  font-size: 10.5px; color: var(--backer, #2d6b66);
}
.map-sec-head .map-caret { margin-left: 4px; }
.map-sec.collapsed .map-caret { transform: rotate(180deg); }
.map-sec.collapsed .map-sec-body { display: none; }
.map-sec-body { display: flex; flex-direction: column; gap: 6px; }
/* "Select all / none" over a section's tick rows (Filters and Layers) */
.map-all {
  align-self: flex-start; border: 0; background: transparent; padding: 0; cursor: pointer;
  font: 600 10.5px/1 var(--font-sans); color: var(--backer, #2d6b66);
}

.map-checks { display: flex; flex-direction: column; gap: 1px; }
.map-check {
  display: flex; align-items: center; gap: 7px; cursor: pointer;
  padding: 3px 4px; border-radius: 5px;
  font: 500 12px/1.3 var(--font-sans); color: var(--ink-2, #3b4743);
}
.map-check:hover { background: var(--surface-2, #f7f6f2); }
.map-check input { accent-color: var(--backer, #2d6b66); margin: 0; flex: none; }
.map-check-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-check-wide .map-check-label { white-space: normal; }
.map-check-n { font-size: 10.5px; color: var(--ink-4, #97a09c); font-variant-numeric: tabular-nums; }

/* Swatches. `--sw` carries the colour; the default is a dot (asset markers). */
.map-swatch {
  --sw: var(--ink-4, #97a09c);
  display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none;
  background: var(--sw); box-shadow: 0 0 0 1px rgba(0,0,0,.08);
}
/* substation dot: small, with a dark outline */
.map-swatch.is-small { width: 7px; height: 7px; margin: 0 2px; box-shadow: 0 0 0 1px rgba(20,20,20,.6); }
.map-swatch.is-line { width: 18px; height: var(--sw-h, 4px); border-radius: 2px; box-shadow: none; }
.map-swatch.is-dashed, .map-swatch.is-dotted { width: 18px; height: 3px; border-radius: 0; box-shadow: none; }
.map-swatch.is-dashed { background: repeating-linear-gradient(90deg, var(--sw) 0 5px, transparent 5px 8px); }
.map-swatch.is-dotted { background: repeating-linear-gradient(90deg, var(--sw) 0 2px, transparent 2px 5px); }
.map-swatch.is-faded { opacity: .6; }

/* overlay popups (grid, pipelines): voltages / units keep their case ("kV", "bcm/y") */
.ib-map-pop.is-plain .ib-map-pop-sub, .ib-map-pop.is-plain .ib-map-pop-meta { text-transform: none; }
.ib-map-pop-facts { margin: 2px 0 0; padding: 0; list-style: none; font-size: 11.5px; color: var(--ink-2); }
.ib-map-pop-facts li { line-height: 1.45; }
/* a pipeline's segment name, under its tracker / status line */
.ib-map-pop-seg { margin-top: 1px; font-size: 11.5px; color: var(--ink-3); }

@media (max-width: 760px) {
  /* full width bar the map controls' column (top-right); an open panel
     takes at most 60% of the map's height */
  .map-dock { right: 54px; max-height: 60%; }
  .map-panel { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .map-caret { transition: none; }
}

/* =====================================================================
   INTEREST / PRE-REGISTRATION FORM (.ib-interest)
   ---------------------------------------------------------------------
   public/_interest_card.html - the form shared by the LAUNCH_PHASE=landing
   page card (interest_landing.html adds the page chrome + .card frame
   under #lp) and the LAUNCH_PHASE=preregister #preregisterModal
   (components/preregister_modal.html). Temporary: removed with the launch
   gate at full launch (DEFERRED.md 8.4).
   ===================================================================== */
.ib-preregister-dialog { max-width: 600px; }

.ib-interest { position: relative; text-align: left; }

/* Off-screen honeypot input (interest card, contact modal, sign-up). */
.ib-hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

.ib-interest .seg-label {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-3); margin: 0 0 9px;
}
.ib-interest .role-seg {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px;
  background: var(--backer-softer); border: 1px solid var(--line-2); border-radius: 12px; padding: 5px;
}
.ib-interest .role-seg button {
  border: 0; background: transparent; cursor: pointer; font-family: inherit;
  padding: 9px 6px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--ink-2);
  display: flex; align-items: center; justify-content: center; gap: 7px;
  transition: background .14s, color .14s, box-shadow .14s;
}
.ib-interest .role-seg button .ic { font-size: 12px; opacity: .7; }
.ib-interest .role-seg button.on {
  background: var(--surface); color: var(--backer-ink);
  box-shadow: 0 1px 0 rgba(0,0,0,.02), 0 6px 16px -10px rgba(29,71,68,.4);
}
.ib-interest .role-seg button.on .ic { opacity: 1; color: var(--backer); }
.ib-interest .role-seg button:not(.on):hover { color: var(--ink); }

.ib-interest .hook {
  display: flex; gap: 9px; align-items: flex-start; min-height: 42px; margin: 14px 2px 18px;
  font-size: 13.5px; line-height: 1.45; color: var(--ink-2);
}
.ib-interest .hook .swatch {
  width: 3px; align-self: stretch; border-radius: 999px; background: var(--mint, #7fcab3); flex-shrink: 0; margin-top: 1px;
}

.ib-interest .divider { height: 1px; background: var(--line-2); margin: 0 0 20px; }

.ib-interest .fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ib-interest .field { display: flex; flex-direction: column; gap: 6px; margin: 0; }
.ib-interest .field.full { grid-column: 1 / -1; }
.ib-interest .field label {
  font-size: 12px; font-weight: 600; color: var(--ink-2); letter-spacing: -.005em;
  display: flex; align-items: center; gap: 6px; margin: 0;
}
.ib-interest .field label .opt { font-weight: 500; color: var(--ink-4); font-size: 11px; }
.ib-interest .field input,
.ib-interest .field textarea {
  font-family: inherit; font-size: 14.5px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; outline: none;
  transition: border-color .14s, box-shadow .14s; width: 100%;
}
.ib-interest .field textarea { resize: vertical; min-height: 64px; line-height: 1.5; }
.ib-interest .field input::placeholder,
.ib-interest .field textarea::placeholder { color: var(--ink-4); }
.ib-interest .field input:focus,
.ib-interest .field textarea:focus { border-color: var(--backer); box-shadow: 0 0 0 3px rgba(45,107,102,.14); }
.ib-interest .field input.err,
.ib-interest .field textarea.err { border-color: var(--red, #c0392b); }
.ib-interest .field-err { font-size: 11.5px; color: var(--red, #c0392b); margin-top: 1px; }

.ib-interest .consent {
  display: flex; gap: 9px; align-items: flex-start; margin: 16px 2px 0;
  font-size: 12.5px; color: var(--ink-2); line-height: 1.5;
}
.ib-interest .consent input { margin-top: 2px; flex-shrink: 0; accent-color: var(--backer); }
.ib-interest .consent a { color: var(--backer); font-weight: 600; }

/* Turnstile widget host - also used unscoped in the contact modal. */
.ib-turnstile { margin-top: 16px; }

.ib-interest .submit {
  margin-top: 18px; width: 100%; border: 0; cursor: pointer; background: var(--backer); color: #fff;
  font-family: inherit; font-weight: 600; font-size: 15px; letter-spacing: -.005em; padding: 14px 22px; border-radius: 11px;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  transition: background .15s, transform .12s, box-shadow .15s; box-shadow: 0 10px 24px -14px rgba(29,71,68,.7);
}
.ib-interest .submit:hover { background: var(--backer-ink); }
.ib-interest .submit:active { transform: translateY(1px); }

.ib-interest .sent { text-align: center; padding: 18px 8px 10px; }
.ib-interest .sent .tick {
  width: 46px; height: 46px; border-radius: 50%; background: var(--backer-soft); color: var(--backer);
  display: grid; place-items: center; font-size: 20px; margin: 0 auto 16px; border: 1px solid #cfe3e0;
}
.ib-interest .sent h3 { margin: 0 0 8px; font-size: 20px; font-weight: 600; letter-spacing: -.015em; color: var(--ink); }
.ib-interest .sent p { margin: 0 auto; font-size: 14.5px; color: var(--ink-2); max-width: 34ch; line-height: 1.5; }

@media (max-width: 640px) {
  .ib-interest .role-seg { grid-template-columns: 1fr 1fr; }
  .ib-interest .fields { grid-template-columns: 1fr; }
}
