/* ===================================================================
   TribeCity — design system
   Inspired by Cloudflare / Linear: neutral surfaces, single accent,
   tight type, lots of whitespace.
   =================================================================== */

/* Self-hosted Inter (latin) — no render-blocking round-trip to Google.
   font-display: optional — the browser gives the font a tiny window to load;
   if it's not ready it uses the fallback for THIS load and never swaps mid-page.
   That kills the FOUT reflow (text + sidebar "turning around" when Inter swaps
   in). Combined with <link rel=preload> in <head> + immutable caching, Inter is
   normally ready before first paint and is always cached on repeat visits, so
   there's no layout shift. The fallback stack is metric-similar to limit drift
   on the rare first-load miss. */
@font-face {
  font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: optional;
  src: url('/public/fonts/inter-latin-400-normal.woff2?v=1') format('woff2');
}
@font-face {
  font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: optional;
  src: url('/public/fonts/inter-latin-500-normal.woff2?v=1') format('woff2');
}
@font-face {
  font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: optional;
  src: url('/public/fonts/inter-latin-600-normal.woff2?v=1') format('woff2');
}
@font-face {
  font-family: 'Inter'; font-style: normal; font-weight: 700; font-display: optional;
  src: url('/public/fonts/inter-latin-700-normal.woff2?v=1') format('woff2');
}

:root {
  /* Deep-navy console. The ground is blue; ORANGE stays the action colour —
     every button, active nav item and focus ring. Orange on navy is a true
     complementary pair, so the CTA reads louder here than it ever did on white. */
  --bg:        #060607;
  --surface:   #141416;
  --surface-2: #1c1c1f;
  --border:    rgba(255,255,255,.09);
  --border-2:  rgba(255,255,255,.06);
  --text:      #f4efeb;
  --text-2:    #a6a5a6;
  --text-3:    #767578;
  --accent:    #ff5b1f;     /* TribeCity orange — the ONE action colour */
  --accent-soft: rgba(255,91,31,.15);
  --ember:     #c2410c;     /* ambient only: the wash + informational glow */
  --success:   #1aa971;
  --success-soft: rgba(26,169,113,.10);
  --success-fg:   #7fcfae;
  --danger:    #f2556a;
  --danger-soft: rgba(242,85,106,.11);
  --danger-fg:    #e8969f;
  --warning:   #f59e0b;
  --warning-soft: rgba(245,158,11,.11);
  --warning-fg:   #dcbc6e;
  --info:      #60a5fa;
  --info-soft: rgba(96,165,250,.11);
  --purple:    #a78bfa;
  --purple-soft: rgba(167,139,250,.11);
  --shadow-1: 0 1px 2px rgba(0,0,0,.35), 0 2px 10px rgba(0,0,0,.28);
  --radius:    6px;
  --radius-sm: 4px;
  --tex-grain: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20width%3D'220'%20height%3D'220'%3E%20%3Cfilter%20id%3D'g'%20x%3D'0'%20y%3D'0'%20width%3D'100%25'%20height%3D'100%25'%3E%20%3CfeTurbulence%20type%3D'fractalNoise'%20baseFrequency%3D'0.82'%20numOctaves%3D'4'%20stitchTiles%3D'stitch'%2F%3E%20%3CfeColorMatrix%20type%3D'saturate'%20values%3D'0'%2F%3E%20%3C%2Ffilter%3E%3Crect%20width%3D'220'%20height%3D'220'%20filter%3D'url(%23g)'%20opacity%3D'0.42'%2F%3E%3C%2Fsvg%3E");
  --tex-dots:  url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20width%3D'34'%20height%3D'34'%3E%20%3Ccircle%20cx%3D'2'%20cy%3D'2'%20r%3D'1.5'%20fill%3D'%23d7d7da'%20opacity%3D'0.12'%2F%3E%20%3Ccircle%20cx%3D'19'%20cy%3D'19'%20r%3D'1.4'%20fill%3D'%23ffffff'%20opacity%3D'0.08'%2F%3E%3C%2Fsvg%3E");
  --tex-hatch: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20width%3D'96'%20height%3D'96'%3E%20%3Cpath%20d%3D'M-24%2024%20L24%20-24%20M0%2096%20L96%200%20M72%20120%20L120%2072'%20stroke%3D'%23ffffff'%20stroke-width%3D'1.1'%20opacity%3D'0.028'%20fill%3D'none'%2F%3E%3C%2Fsvg%3E");
  /* One glass recipe, used by every panel — cards, KPI tiles, header, sidebar,
     slide-overs, menus. Defining it once is why they can't drift apart again.
     The sheen rakes at 135deg to match the light direction in the desk photo
     (top-left), instead of the flat top-to-bottom wash it replaced. */
  --glass-sheen: linear-gradient(135deg,
                   rgba(255,255,255,.135) 0%,
                   rgba(255,255,255,.052) 30%,
                   rgba(255,255,255,.014) 58%,
                   rgba(255,255,255,.070) 100%);
--tex-frost: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='140'%20height='140'%3E%20%3Cfilter%20id='fr'%20x='0'%20y='0'%20width='100%25'%20height='100%25'%3E%20%3CfeTurbulence%20type='fractalNoise'%20baseFrequency='1.15'%20numOctaves='3'%20stitchTiles='stitch'/%3E%20%3CfeColorMatrix%20type='saturate'%20values='0'/%3E%20%3C/filter%3E%3Crect%20width='140'%20height='140'%20filter='url(#fr)'%20opacity='0.16'/%3E%3C/svg%3E");
  /* Frost is a BALANCE, not a dial. The tint is what you look THROUGH; the blur
     is how softly. They are set independently on purpose: blur is low (14) so
     the desk photo stays SHARP through a panel rather than dissolving, while
     the tint is the more prominent .40 so panels still read as a surface and
     text has something solid to sit on. Raising the tint is the cheap lever --
     it buys legibility without giving up the sharpness the low blur bought. The
     grain is what separates "frosted" from merely "out of focus", and
     brightness() makes the panel catch light like real glass. */
  --glass-tint:  rgba(18,18,22,.40);
  --glass-bg:    var(--tex-frost), var(--glass-sheen), var(--glass-tint);
  --glass-blur:  blur(14px) saturate(190%) brightness(1.10);
  /* Tribe photos are cropped to this everywhere — cards, hero, anywhere else
     one appears. Uploads are stored untouched; the crop is presentational, so
     changing this reframes every image at once instead of needing re-uploads. */
  --tribe-img-ratio: 16 / 9;
  --sidebar-w: 230px;
}


* { box-sizing: border-box; }

/* ── Hover easing ─────────────────────────────────────────────────────────
   Every hover state used to snap. These are the properties hover actually
   changes, eased on a standard-ease curve so the change reads as a response
   rather than a flicker.

   Declared HERE, near the top, on purpose: a component that needs its own
   timing (drawers, the slide-over) declares `transition` later in the file and
   simply wins on source order. Listing properties explicitly rather than
   `transition: all` keeps layout and paint properties out of it. */
a, button, summary, label.mdd-btn,
.btn, .icon-btn, .tab, .pill, .chip, .card,
.prail-row, .prail-out, .mdd-opt, .funnel-chip, .fork-chip,
.row-clickable, .feed-item, .stat-cell, .tbl tbody tr {
  transition:
    background-color .16s cubic-bezier(.4, 0, .2, 1),
    border-color     .16s cubic-bezier(.4, 0, .2, 1),
    color            .16s cubic-bezier(.4, 0, .2, 1),
    box-shadow       .16s cubic-bezier(.4, 0, .2, 1),
    opacity          .16s cubic-bezier(.4, 0, .2, 1),
    transform        .16s cubic-bezier(.4, 0, .2, 1);
}

@media (prefers-reduced-motion: reduce) {
  a, button, summary, label.mdd-btn,
  .btn, .icon-btn, .tab, .pill, .chip, .card,
  .prail-row, .prail-out, .mdd-opt, .funnel-chip, .fork-chip,
  .row-clickable, .feed-item, .stat-cell, .tbl tbody tr { transition: none; }
}
html, body { margin: 0; padding: 0; }
/* Always reserve the scrollbar gutter so navigating between a short page (no
   scrollbar) and a tall one (scrollbar) doesn't shove the whole layout — incl.
   the sidebar — sideways. Eliminates the horizontal "jump" on page changes. */
html { scrollbar-gutter: stable; }
body {
  background: var(--bg);
  /* The signature: a teal bloom off the top-left and a colder navy pool to the
     right, fixed so it stays put while content scrolls over it. This is the
     "blue area" — atmosphere, never a surface anything has to be legible on. */
  /* JPEG line first as the fallback; anything modern takes the WebP line below.
     The scrim is doing real work: the photo has bright warm highlights top-left
     that text cannot survive on its own. Grain stays on top of the photo so the
     glass still has fine detail to refract at close range. */
  /* Scrim lightened (.54/.68 -> .40/.54) so more of the photo comes through.
     Cards are all glass over this, so the floor they sit on is what gives the
     page depth — too heavy a scrim and the whole thing reads as flat black. */
  background-image: linear-gradient(rgba(6,6,7,.40), rgba(6,6,7,.54)), url('img/desk.jpg');
  background-image:
    /* Scrim, grain, photo. The warm radial blooms that used to sit between the
       scrim and the grain are gone — they tinted the whole floor orange, which
       fought the accent colour rather than supporting it. */
    linear-gradient(rgba(6,6,7,.40), rgba(6,6,7,.54)),
    var(--tex-grain),
    url('img/desk.webp');
  background-size: auto, 220px 220px, cover;
  background-position: center, 0 0, center center;
  background-attachment: fixed;
  background-repeat: no-repeat, repeat, no-repeat;
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-variant-numeric: tabular-nums;
}
a { color: var(--text); text-decoration: none; }
a:hover { color: var(--text-2); }

/* ---- Layout ---- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w);
  background:
    /* Neutral sheen. The 160deg wash used to start orange, which put a warm
       cast down the whole left edge of every page. */
    linear-gradient(160deg, rgba(255,255,255,.030) 0%, rgba(255,255,255,.012) 30%, rgba(255,255,255,0) 60%, rgba(255,255,255,.016) 100%),
    rgba(14,14,17,.58);
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  border-right: 1px solid var(--border);
  position: fixed; inset: 0 auto 0 0;
  padding: 16px 12px;
  display: flex; flex-direction: column;
  overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
}
.brand {
  font-weight: 700; font-size: 15px; letter-spacing: -0.02em;
  padding: 10px 10px 14px;
  margin-bottom: 12px;
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--border-2);   /* closes the masthead */
}
.brand .brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
/* The ark mark replaces the old accent dot. Inline SVG on currentColor so it
   takes the accent from the theme rather than being a fixed-colour asset. The
   artwork is wide and sits low in its viewBox, so it gets a wider box than a
   square glyph would and a hair of optical lift to sit on the text baseline. */
.brand .brand-mark {
  width: 28px; height: 28px; flex: 0 0 auto;
  color: #fff; display: block;
}
.brand .brand-name { font-weight: 700; color: var(--text); font-size: 15px; }
.brand .brand-sub {
  font-weight: 500; font-size: 10.5px; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .09em;
}
.nav-section { margin-top: 10px; }
.nav-section h6 {
  font-size: 11px; font-weight: 600; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .08em;
  padding: 0 10px; margin: 12px 0 4px;
}
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 3px;
  color: var(--text-2); font-weight: 500;
  font-size: 13.5px;
}
.nav a .ico {
  width: 16px; height: 16px;
  flex-shrink: 0;
  color: var(--text-3);
}
.nav a:hover .ico { color: var(--text); }
.nav a.active .ico { color: var(--accent); }
/* Candidate header stats strip */
.cand-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 4px;
  margin: 8px 0 24px; overflow: hidden;
}
.cand-stats .stat {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  padding: 12px 14px;
}
.cand-stats .stat .lbl {
  font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em;
  font-weight: 600; margin-bottom: 4px;
}
.cand-stats .stat .val {
  font-size: 16px; font-weight: 700; color: var(--text); letter-spacing: -0.01em;
}
.cand-stats .stat .val.muted { color: var(--text-3); font-weight: 500; }
.cand-stats .stat.accent .val { color: var(--accent); }
.cand-stats .stat.success .val { color: var(--success); }
/* Row-as-link — qrow with data-href becomes clickable to a detail page.
   Inner <a> / button / .actions stop propagation so they fire their own actions. */
.qrow.qrow-link { cursor: pointer; transition: background .12s; }
.qrow.qrow-link:hover { background: var(--surface-2); }

/* Pagination */
.pagination { display: flex; align-items: center; gap: 6px; margin-top: 16px; justify-content: center; }
.pagination a, .pagination span {
  padding: 6px 11px; border-radius: 3px; font-size: 13px;
  color: var(--text-2); text-decoration: none; border: 1px solid var(--border);
}
.pagination a:hover { background: var(--surface-2); color: var(--text); }
.pagination .current { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; }
.pagination .ellipsis { border: none; color: var(--text-3); }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.active { background: var(--accent-soft); color: var(--accent); }
/* Count badges: muted by default — only the primary work queue gets accent. */
.nav a .badge-n {
  margin-left: auto; background: var(--surface-2); color: var(--text-2);
  font-size: 11px; padding: 1px 7px; border-radius: 3px; font-weight: 600;
}
.nav a .badge-n.badge-accent { background: var(--accent); color: #fff; }
.sidebar-footer {
  margin-top: auto; padding: 12px 10px;
  border-top: 1px solid var(--border);
  font-size: 12px; color: var(--text-3);
}
.sb-user { display: flex; align-items: center; gap: 8px; }
.sb-user-meta { min-width: 0; flex: 1; }
.sb-user-name { font-weight: 600; color: var(--text); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-user-role { font-size: 11px; color: var(--text-3); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-signout {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 4px; flex-shrink: 0;
  background: transparent; border: 1px solid transparent;
  color: var(--text-3); cursor: pointer;
}
.sb-signout:hover { background: var(--surface-2); color: var(--text); }

.main {
  margin-left: var(--sidebar-w);
  flex: 1; min-width: 0;
  padding: 84px 36px 60px;  /* top clears the fixed .app-header (58px) */
}
/* Back button on inner pages — sits above the page title */
.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; border: 1px solid var(--border);
  color: var(--text-2); font-size: 13px; font-weight: 500;
  font-family: inherit; cursor: pointer;
  padding: 6px 12px; border-radius: 4px; margin-bottom: 18px;
}
.back-link:hover { background: var(--surface-2); color: var(--text); }
.back-link svg { flex-shrink: 0; }

/* ---- Mobile menu (hamburger + off-canvas sidebar) ---- */
.menu-toggle { display: none; }
.sidebar-scrim { display: none; }
@media (max-width: 1024px) {
  .menu-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; border-radius: 5px; flex: 0 0 auto;
    background: var(--surface); border: 1px solid var(--border);
    color: var(--text); cursor: pointer; appearance: none; -webkit-appearance: none;
  }
  .sidebar {
    transform: translateX(-100%);
    transition: transform .22s ease;
    z-index: 150; box-shadow: 2px 0 20px rgba(0,0,0,.14);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-scrim {
    display: block; position: fixed; inset: 0;
    background: rgba(0,0,0,.42); opacity: 0; pointer-events: none;
    transition: opacity .22s ease; z-index: 145;
  }
  .sidebar-scrim.open { opacity: 1; pointer-events: auto; }
  .main { margin-left: 0; padding: 74px 14px 48px; }
  .app-header { left: 0; padding: 0 14px; gap: 8px; }  /* full width; hamburger lives inside now */
  .app-header .back-link { font-size: 0; gap: 0; padding: 7px 9px; }   /* arrow-only Back on mobile */
  .app-header .back-link svg { width: 17px; height: 17px; }
  .kpis { grid-template-columns: 1fr 1fr; }
  /* New task rows + section heads stay comfortable on narrow screens. */
  .cc-section { margin: 22px 0 11px; }
  .trow { gap: 10px; padding: 12px 14px; }
  .trow-right .btn { padding: 5px 11px; }
}
.topbar {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 22px;
}
.crumbs { color: var(--text-3); font-size: 13px; }
.crumbs a { color: var(--text-3); }
.crumbs a:hover { color: var(--text); }
.crumbs .sep { margin: 0 6px; color: var(--border); }

/* ---- Type ---- */
h1.page-title {
  font-size: 22px; font-weight: 700;
  letter-spacing: -0.025em; margin: 0 0 4px;
}
.page-sub { color: var(--text-3); font-size: 13.5px; margin: 0 0 22px; }
h2.section-title {
  font-size: 12px; font-weight: 600; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .08em;
  margin: 28px 0 10px;
}

/* ---- Card ---- */
.card {
  /* Apple-style vibrancy: the panel is genuinely TRANSLUCENT and the blur does
     the work. saturate() is the half everyone forgets — it re-saturates the
     colour bleeding up from the wash so the glass looks lit rather than grey.
     The two inset lines are the tell: a bright top edge catching the light and
     a dark bottom edge, which is what reads as "thickness". */
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0,0,0,.40);
  overflow: hidden;
}
.card-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-2);
  display: flex; align-items: center; gap: 12px;
}
.card-head h3 {
  margin: 0; font-size: 14px; font-weight: 600;
  letter-spacing: -0.005em;
}
.card-head .meta { color: var(--text-3); font-size: 12.5px; }
.card-head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.card-body { padding: 16px 18px; }
.card-tight .card-body { padding: 0; }

/* ---- Collapsible cards (details/summary) ---- */
details.card-collapse > summary.card-head {
  cursor: pointer; user-select: none; list-style: none;
  border-bottom: none;
}
details.card-collapse > summary.card-head::-webkit-details-marker { display: none; }
details.card-collapse[open] > summary.card-head { border-bottom: 1px solid var(--border-2); }
details.card-collapse > summary.card-head:hover h3 { color: var(--text); }
details.card-collapse .chev {
  margin-left: auto; color: var(--text-3); font-size: 18px; font-weight: 600;
  transform: rotate(0deg); transition: transform .15s ease; line-height: 1;
}
details.card-collapse[open] .chev { transform: rotate(90deg); }
details.card-collapse > summary.card-head .right { margin-left: 0; }

/* ---- KPI tiles ---- */
.kpis { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-bottom: 22px; }
.kpi {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px;
  display: flex; flex-direction: column;
}
/* Number and its label sit together on one baseline at the BOTTOM of the tile:
   "63  Hopper". The old stacked label + descriptive sub-line were noise. */
.kpi-foot { display: flex; align-items: baseline; gap: 9px; margin-top: auto; min-width: 0; }
.kpi .label {
  font-size: 11.5px; font-weight: 600; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .07em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.kpi .value { font-size: 28px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.1; }
.kpi .sub   { display: none; }
.kpi.accent .value { color: var(--accent); }
.kpi.success .value { color: var(--success); }
.kpi.danger .value { color: var(--danger); }
.kpi.purple .value { color: var(--purple); }

/* Clickable KPI tiles (buttons / anchors styled as KPIs) */
.kpi-clickable {
  font: inherit; text-align: left; cursor: pointer; text-decoration: none;
  display: block; width: 100%; color: inherit;
  transition: background .12s ease;
}
button.kpi-clickable { -webkit-appearance: none; appearance: none; }
.kpi-clickable:hover { background: var(--surface-2); }
.kpi-clickable:focus-visible { outline: 2px solid var(--text-3); outline-offset: 2px; }

/* ---- Today command center ---------------------------------------------- */
.kpi-ic { width: 30px; height: 30px; border-radius: 4px; display: flex; align-items: center; justify-content: center; margin-bottom: 11px; }
.kpi-ic svg { width: 17px; height: 17px; }

.cc-search { position: relative; margin-bottom: 22px; max-width: 560px; }
.cc-search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--text-3); pointer-events: none; }
.cc-search input.input { width: 100%; min-height: var(--ctl-h); font-size: 15px; padding: 0 14px 0 42px; }

.cc-section { display: flex; align-items: center; gap: 10px; margin: 28px 0 13px; }
.cc-section .cc-ic { width: 26px; height: 26px; border-radius: 4px; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.cc-section .cc-ic svg { width: 15px; height: 15px; }
.cc-section h2 { font-size: 14.5px; font-weight: 700; margin: 0; letter-spacing: -0.01em; color: var(--text); }
.cc-section .cc-count { margin-left: auto; font-size: 12.5px; color: var(--text-3); }

.card-ic { width: 25px; height: 25px; border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; margin-right: 9px; vertical-align: middle; flex: 0 0 auto; }
.card-ic svg { width: 14px; height: 14px; }
.card-head h3 { display: flex; align-items: center; }

/* Task row — leading icon, body, trailing action. */
.trow { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 13px; padding: 12px 16px; border-top: 1px solid var(--border-2); text-decoration: none; transition: background .12s ease; }
.trow:hover { background: var(--surface-2); }
.trow-ic { width: 34px; height: 34px; border-radius: 4px; display: flex; align-items: center; justify-content: center; font-size: 14px; flex: 0 0 auto; }
.trow-ic svg { width: 16px; height: 16px; }
.trow-body { min-width: 0; }
.trow-title { font-size: 13.5px; font-weight: 600; color: var(--text); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trow-sub { font-size: 12px; color: var(--text-3); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trow-quote { font-size: 12.5px; color: var(--text-2); margin-top: 3px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: normal; }
.trow-right { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.cc-empty { padding: 22px 16px; color: var(--text-3); font-size: 13px; }
.cc-grid { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
@media (max-width: 860px) { .cc-grid { grid-template-columns: 1fr; } }

/* ---- App header (fixed top bar: bell + user menu) --------------------- */
.app-header {
  position: fixed; top: 0; left: var(--sidebar-w); right: 0; z-index: 60;
  height: 58px; display: flex; align-items: center; gap: 12px;
  padding: 0 36px; background: var(--glass-bg);
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border);
}
.topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.app-header .back-link { margin: 0; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.topbar-bell { position: relative; width: 38px; height: 38px; border-radius: 5px; display: flex; align-items: center; justify-content: center; color: var(--text-2); border: 1px solid var(--border); background: var(--glass-bg); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); flex: 0 0 auto; cursor: pointer; appearance: none; -webkit-appearance: none; font: inherit; }
.topbar-bell:hover { background: var(--surface-2); color: var(--text); }
.topbar-bell svg { width: 19px; height: 19px; }
.topbar-bell-badge { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 4px; background: var(--accent); color: #fff; font-size: 10.5px; font-weight: 700; display: flex; align-items: center; justify-content: center; border: 2px solid var(--surface); box-sizing: border-box; }

.topbar-user { position: relative; }
.topbar-user-btn { display: flex; align-items: center; gap: 8px; padding: 4px 8px 4px 4px; border-radius: 5px; border: 1px solid var(--border); background: var(--glass-bg); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); cursor: pointer; color: var(--text); }
.topbar-user-btn:hover { background: var(--surface-2); }
.topbar-avatar { width: 28px; height: 28px; border-radius: 4px; background: var(--accent); color: #fff; font-weight: 700; font-size: 11.5px; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.topbar-user-name { font-size: 13px; font-weight: 600; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-user-btn .chev { width: 14px; height: 14px; color: var(--text-3); flex: 0 0 auto; }

.topbar-user-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 210px; background: var(--glass-bg); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 8px 28px rgba(0,0,0,.14); padding: 6px; z-index: 400; display: none; }
.topbar-user-menu.open { display: block; }
.topbar-user-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--border-2); margin-bottom: 4px; }
.topbar-user-head .name { font-weight: 700; font-size: 13.5px; }
.topbar-user-head .role { font-size: 12px; color: var(--text-3); text-transform: capitalize; margin-top: 1px; }
.topbar-user-menu a, .topbar-user-menu button { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; padding: 8px 10px; border-radius: 4px; font-size: 13px; color: var(--text); text-decoration: none; background: none; border: none; cursor: pointer; font-family: inherit; }
.topbar-user-menu a:hover, .topbar-user-menu button:hover { background: var(--surface-2); }
.topbar-user-menu button.danger { color: var(--danger); }

@media (max-width: 680px) { .topbar-user-name { display: none; } }
/* Mobile header override — MUST come after the base .app-header rule above so
   it wins on source order: full width (sidebar is off-canvas), hamburger inside. */
@media (max-width: 1024px) {
  .app-header { left: 0; right: 0; padding: 0 12px; gap: 8px; }
}

/* ---- Slide-over panel (slides in from the right; for drill-in lists) ---- */
.slideover {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(560px, 94vw); background: var(--glass-bg);
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  border-left: 1px solid var(--border); z-index: 150;
  transform: translateX(100%); transition: transform .24s ease;
  display: flex; flex-direction: column;
  box-shadow: -8px 0 28px rgba(0,0,0,.16);
}
.slideover.open { transform: translateX(0); }
.slideover-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--border);
}
.slideover-head h3 { margin: 0; }
.slideover-body { padding: 0; overflow: auto; flex: 1; }
.slideover-scrim {
  position: fixed; inset: 0; background: rgba(15,18,24,.42);
  opacity: 0; pointer-events: none; transition: opacity .2s ease; z-index: 149;
}
.slideover-scrim.open { opacity: 1; pointer-events: auto; }

/* ---- Tribe review panel (slides from right; z-index below drawers so invite/reject stack on top) ---- */
.tribe-panel-scrim {
  position: fixed; inset: 0; background: rgba(15,18,24,.42);
  opacity: 0; pointer-events: none; transition: opacity .2s ease; z-index: 87;
}
.tribe-panel-scrim.open { opacity: 1; pointer-events: auto; }
.tribe-panel {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(860px, 96vw); background: var(--glass-bg);
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  border-left: 1px solid var(--border); z-index: 88;
  display: flex; flex-direction: column;
  transform: translateX(110%); transition: transform .22s ease;
  box-shadow: -6px 0 32px rgba(0,0,0,.18);
}
.tribe-panel.open { transform: translateX(0); }
.tribe-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 15px 20px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.tribe-panel-head h3 { margin: 0; font-size: 15px; }
.tribe-panel-body { flex: 1; overflow-y: auto; }

/* Tribe settings toolbar — row of buttons that each open a slide-over popup. */
.tribe-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tribe-toolbar .tt-on { color: var(--success); font-weight: 700; font-size: 11px; }

/* ---- Candidate engagement: suggested next move + lifecycle timeline ---- */
.eng-next {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  flex-wrap: wrap; padding: 11px 14px; border-radius: 5px; margin-bottom: 18px;
}
.eng-next-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.eng-next-label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; opacity: .7; }
.eng-next-action { font-size: 13.5px; font-weight: 600; }

.eng-timeline {
  display: flex; align-items: flex-start; gap: 0;
  overflow-x: auto; padding: 4px 2px 2px; -webkit-overflow-scrolling: touch;
}
.eng-tl-node {
  position: relative; flex: 1 0 auto; min-width: 88px;
  display: flex; flex-direction: column; align-items: center; text-align: center; padding: 0 6px;
}
/* Connector line running left→right behind the dots. */
.eng-tl-node::before {
  content: ''; position: absolute; top: 13px; left: -50%; width: 100%; height: 2px;
  background: var(--border); z-index: 0;
}
.eng-tl-node:first-child::before { display: none; }
.eng-tl-dot {
  position: relative; z-index: 1; width: 28px; height: 28px; border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; line-height: 1; color: #fff; background: var(--text-3);
  box-shadow: 0 0 0 3px var(--surface);
}
.eng-start .eng-tl-dot { background: #94a3b8; }
.eng-us    .eng-tl-dot { background: #6366f1; }   /* indigo — our outreach */
.eng-them  .eng-tl-dot { background: #10b981; }   /* green — their engagement */
.eng-tl-label { margin-top: 7px; font-size: 12px; font-weight: 600; color: var(--text); line-height: 1.25; }
.eng-tl-date  { margin-top: 2px; font-size: 11px; color: var(--text-3); }

.eng-legend { display: flex; gap: 18px; margin-top: 12px; font-size: 11.5px; color: var(--text-3); flex-wrap: wrap; }
.eng-key { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }
.eng-key-us { background: #6366f1; }
.eng-key-them { background: #10b981; }
.eng-key-up { background: transparent; border: 1.5px dashed var(--text-3); }

/* Vertical lifecycle timeline — spine of dots + connecting line; opens/clicks
   nest beneath their email, replies interject as accent rows. */
.eng-tlv { display: flex; flex-direction: column; padding: 2px 0; }
.eng-tlv-row { position: relative; display: flex; gap: 12px; padding: 0 0 14px; }
.eng-tlv-row::before {
  content: ''; position: absolute; left: 13px; top: 22px; bottom: -6px; width: 2px;
  background: var(--border); z-index: 0;
}
.eng-tlv-row:last-child::before { display: none; }
.eng-tlv-dot {
  position: relative; z-index: 1; flex: 0 0 auto; width: 28px; height: 28px; border-radius: 5px;
  display: flex; align-items: center; justify-content: center; font-size: 13px; line-height: 1;
  color: #fff; background: var(--text-3); box-shadow: 0 0 0 3px var(--surface);
}
.eng-tlv-row.eng-start .eng-tlv-dot { background: #94a3b8; }
.eng-tlv-row.eng-us    .eng-tlv-dot { background: #6366f1; }
.eng-tlv-row.eng-them  .eng-tlv-dot { background: #10b981; }
.eng-tlv-row.eng-upcoming .eng-tlv-dot { background: var(--surface-2); color: var(--text-3); border: 1.5px dashed var(--text-3); }
.eng-tlv-row.eng-replyrow .eng-tlv-dot { background: var(--accent); }
.eng-tlv-main { flex: 1 1 auto; min-width: 0; padding-top: 4px; }
.eng-tlv-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.eng-tlv-label { font-size: 13px; font-weight: 600; color: var(--text); }
.eng-tlv-row.eng-upcoming .eng-tlv-label { color: var(--text-3); font-weight: 500; }
.eng-tlv-row.eng-replyrow .eng-tlv-label { color: var(--accent); }
.eng-tlv-date { font-size: 11.5px; color: var(--text-3); margin-left: auto; }
.eng-tlv-sub { margin-top: 3px; font-size: 11.5px; display: flex; gap: 10px; flex-wrap: wrap; }
.eng-tlv-sub.muted { color: var(--text-3); }
.eng-submark.ok  { color: #10b981; }
.eng-submark.hot { color: #6366f1; font-weight: 600; }
.eng-tlv-link { color: var(--accent); text-decoration: none; font-weight: 600; }
.eng-tlv-link:hover { text-decoration: underline; }

/* Next-move banner gets a border so inline border-color applies; the actionable
   state adds a thick accent edge + a gentle pulse to pull the eye there. */
.eng-next { position: relative; border: 1px solid var(--border); }
.eng-next-go { border-left-width: 4px; animation: engPulse 2.4s ease-out infinite; }
@keyframes engPulse {
  0%   { box-shadow: 0 0 0 0 rgba(124,58,237,.28); }
  70%  { box-shadow: 0 0 0 7px rgba(124,58,237,0); }
  100% { box-shadow: 0 0 0 0 rgba(124,58,237,0); }
}
@media (prefers-reduced-motion: reduce) {
  .eng-next-go, .eng-suggested .eng-tl-dot { animation: none; }
}

/* Distinct follow-up action button (violet) — stands apart from the blue/green
   primary/ghost buttons so "do something" reads as its own thing. */
.btn-followup {
  background: #7c5cf6; color: #fff;
  border: 1px solid #6d28d9; font-weight: 600; letter-spacing: .01em;
  padding: 10px 20px; font-size: 14px; border-radius: 4px;
  transition: background .12s ease;
}
.btn-followup:hover:not([disabled]) { background: #8b5cf6; color: #fff; }
.btn-followup:active:not([disabled]) { background: #5b21b6; }
.btn-followup[disabled] { opacity: .5; cursor: not-allowed; }
/* Small variant for the per-send rows — still clearly the violet action. */
.btn-followup.btn-sm { padding: 5px 12px; font-size: 12px; border-radius: 4px; }

/* ---- Pipeline funnel strip ---- */
/* Stage chips read left-aligned like every other card in the app — count first,
   then its label on the same baseline ("63  Invited"). Centered text was the odd
   one out and made the funnel look unrelated to the tables beneath it. */
.funnel-chip .fc-count,
.funnel-chip.ok .fc-count, .funnel-chip.hot .fc-count,

/* "Finished" fork — two terminal states (New member / Lost) stacked into one
   funnel slot; each is its own clickable card that drills into that group. */
@media (max-width: 1024px) { .funnel-arrow { display: none; } .funnel-chip { min-width: 44%; margin: 3px; } }

/* Upcoming / suggested roadmap nodes — ghosted so the future of the journey is
   visible without competing with what's already happened. */
.eng-upcoming .eng-tl-dot {
  background: var(--surface); color: var(--text-3);
  border: 2px dashed var(--text-3); box-shadow: 0 0 0 3px var(--surface);
}
.eng-upcoming .eng-tl-label { color: var(--text-3); font-weight: 500; }
.eng-upcoming .eng-tl-date  { color: var(--text-3); font-style: italic; }
.eng-upcoming::before { opacity: .45; }
.eng-suggested .eng-tl-dot {
  background: #ede9fe; color: #7c3aed; border: 2px solid #7c3aed;
  animation: engPulse 2.4s ease-out infinite;
}
.eng-suggested .eng-tl-label,
.eng-suggested .eng-tl-date { color: #7c3aed; font-style: normal; font-weight: 600; }

/* Follow-up drawer — context panel (who / why / where things stand). */
.fu-context {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 5px;
  padding: 12px 14px; margin-bottom: 16px; display: flex; flex-direction: column; gap: 7px;
}
.fu-ctx-row { display: flex; gap: 12px; font-size: 13px; line-height: 1.45; }
.fu-ctx-k { flex: 0 0 74px; color: var(--text-3); font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding-top: 2px; }
.fu-ctx-v { flex: 1; min-width: 0; color: var(--text); }

/* ---- Candidate actions dropdown items ---- */
.cand-action-item {
  display: block; width: 100%; text-align: left; padding: 8px 14px;
  background: none; border: none; cursor: pointer; font-size: 13.5px;
  color: var(--text); line-height: 1.4; white-space: nowrap;
}
.cand-action-item:hover { background: var(--surface-2); }

/* Pending-outreach rows inside the slide-over */
.po-list { display: flex; flex-direction: column; }
.po-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 20px; border-bottom: 1px solid var(--border);
  color: inherit; text-decoration: none;
}
.po-row:hover { background: var(--surface-2); color: inherit; }
.po-main { min-width: 0; }
.po-co { font-weight: 600; color: var(--text); font-size: 14px; }
.po-sub { font-size: 12.5px; color: var(--text-2); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.po-engage { text-align: right; font-size: 13px; white-space: nowrap; flex-shrink: 0; }
.po-engage span { margin-left: 6px; }

/* ---- Lazy-load skeletons ---- */
.lazy-loading { opacity: .85; }
.skel-row {
  display: grid; gap: 14px; padding: 15px 16px;
  border-bottom: 1px solid var(--border); align-items: center;
  grid-template-columns: minmax(0,2fr) 1.2fr 1fr 90px;
}
.skel-bar {
  height: 11px; border-radius: 3px;
  background: linear-gradient(90deg, var(--surface-2) 25%, #ececef 37%, var(--surface-2) 63%);
  background-size: 400% 100%; animation: skel 1.4s ease infinite;
}
.skel-bar.short { width: 55%; }
.skel-bar.tiny  { width: 35%; height: 9px; margin-top: 5px; }
@keyframes skel { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.lazy-error { padding: 28px 16px; text-align: center; color: var(--text-3); font-size: 13.5px; }
.lazy-error .btn { margin-left: 8px; }

/* ===================================================================
   Entrance animations — page sections + lazy-loaded rows stream in
   with a soft staggered fade-up for a smooth, premium SaaS feel.
   Fully gated behind prefers-reduced-motion so it never fights a11y.
   =================================================================== */
@media (prefers-reduced-motion: no-preference) {
  @keyframes contentIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  @keyframes rowIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  /* Top-level page blocks (cards, KPI strips, headings) cascade in.
     Overlays that live inside the page content (modals, slide-over panels and
     their scrims) are EXCLUDED — they rely on their own fixed/centering
     transform, which this animation's transform would otherwise clobber.

     fill-mode is `backwards` (NOT `both`): the `from` state applies during the
     stagger delay so there's no flash, but once the animation finishes the
     element reverts to its natural style with NO lingering transform. A
     persistent transform would create a stacking context on every card and
     trap escaping UI (e.g. the candidate "Actions ▾" dropdown) behind later
     cards. Since the `to` state equals the natural style, there's no visual
     jump at the end. */
  .main > *:not(.drawer):not(.drawer-backdrop):not(.tribe-panel):not(.tribe-panel-scrim):not(.slideover):not(.slideover-scrim) {
    animation: contentIn .5s cubic-bezier(.16,.84,.44,1) backwards;
  }
  .main > *:nth-child(1) { animation-delay: .02s; }
  .main > *:nth-child(2) { animation-delay: .07s; }
  .main > *:nth-child(3) { animation-delay: .12s; }
  .main > *:nth-child(4) { animation-delay: .17s; }
  .main > *:nth-child(5) { animation-delay: .22s; }
  .main > *:nth-child(6) { animation-delay: .27s; }
  .main > *:nth-child(7) { animation-delay: .32s; }
  .main > *:nth-child(n+8) { animation-delay: .37s; }

  /* Rows swapped in by the lazy loader get a JS-staggered delay (inline style).
     `backwards` for the same reason as above — no lingering transform/stacking
     context after the row settles. */
  .lazy-row-in { animation: rowIn .45s cubic-bezier(.16,.84,.44,1) backwards; }
}

/* ---- Centered modal (class names kept as .drawer for back-compat) ---- */
.drawer-backdrop {
  position: fixed; inset: 0; background: rgba(3,8,15,.62);
  opacity: 0; pointer-events: none; transition: opacity .16s ease; z-index: 90;
  backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
}
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -48%) scale(.97);
  width: min(740px, 96vw); max-height: 92vh;
  /* Deliberately heavier than a card: a drawer floats over busy content, not
     over the photo, so it needs its own opacity to stay readable. It keeps the
     frost grain and out-blurs the base recipe so it still reads as the topmost
     pane of glass rather than a less-frosted one. */
  background:
    var(--tex-frost),
    var(--glass-sheen),
    rgba(19,19,22,.72);
  backdrop-filter: blur(56px) saturate(190%) brightness(1.06);
  -webkit-backdrop-filter: blur(56px) saturate(190%) brightness(1.06);
  border: 1px solid var(--border);
  border-radius: 4px; z-index: 100;
  display: flex; flex-direction: column;
  box-shadow: 0 24px 70px rgba(0,0,0,.58);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .16s ease, transform .16s ease, visibility .16s;
}
.drawer.open {
  opacity: 1; visibility: visible; pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}
/* Side variant — slides in from the right (notifications bell). Higher
   specificity (.drawer.drawer-side[.open]) beats the centered-modal rules. */
.drawer.drawer-side {
  top: 0; right: 0; left: auto; bottom: 0;
  transform: translateX(100%);
  width: min(400px, 100vw); height: 100vh; max-height: none;
  border-radius: 0; border: none; border-left: 1px solid var(--border);
  box-shadow: -10px 0 40px rgba(0,0,0,.16);
}
.drawer.drawer-side.open { transform: translateX(0); }
.drawer-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; padding: 18px 20px 14px; border-bottom: 1px solid var(--border);
}
.drawer-body { padding: 18px 20px 20px; overflow: auto; flex: 1; min-height: 0; }
/* Form that fills a modal: fields scroll in .drawer-body, buttons stay pinned
   in .drawer-foot so long forms never push the actions off-screen. */
.drawer-form { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.drawer-foot {
  display: flex; gap: 8px; justify-content: flex-end; align-items: center;
  padding: 14px 20px; border-top: 1px solid var(--border);
  background: var(--surface); border-radius: 0 0 6px 6px; flex-shrink: 0;
}
.drawer-row {
  border: 1px solid var(--border); border-radius: 4px;
  padding: 10px 12px; background: var(--surface);
}
.drawer-row:hover { background: var(--surface-2); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: var(--ctl-h); padding: 0 14px; border-radius: 4px; border: 1px solid transparent;
  font-size: 13px; font-weight: 500; white-space: nowrap;
  background: var(--surface); color: var(--text);
  border-color: var(--border); cursor: pointer;
  font-family: inherit;
}
.btn:hover { background: var(--surface-2); }
/* Button hierarchy — exactly three tiers plus two semantic colors:
   PRIMARY   .btn-primary / .btn-accent  → solid dark, the ONE main action per view
   SECONDARY .btn (default)              → outlined neutral
   TERTIARY  .btn-ghost                  → borderless text
   Semantic: .btn-success (positive: Invite/Send) · .btn-danger (destructive) */
.btn-primary, .btn-accent { background: var(--accent); color: #fff; border-color: var(--accent); box-shadow: 0 4px 14px rgba(255,91,31,.22); }
.btn-primary:hover, .btn-accent:hover { background: #ff6f3c; border-color: #ff6f3c; color: #fff; }
.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-success:hover { background: #168459; color: #fff; }
.btn-danger  { background: transparent; color: var(--danger-fg); border-color: var(--danger); }
.btn-danger:hover  { background: var(--danger-soft); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-sm { min-height: var(--ctl-h-sm); padding: 0 12px; font-size: 12.5px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---- Pills / Badges ---- */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 3px;
  font-size: 11.5px; font-weight: 500;
  border: 1px solid transparent;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 99px; background: currentColor; opacity: .85; }
.pill.pending  { background: var(--accent-soft); color: #ffa274; }
.pill.review   { background: var(--accent-soft); color: #ffa274; }
.pill.approved { background: var(--success-soft); color: var(--success-fg); }
.pill.rejected { background: var(--danger-soft); color: var(--danger-fg); }
.pill.danger   { background: var(--danger-soft); color: var(--danger-fg); }
.pill.contacted{ background: var(--purple-soft); color: var(--purple); }
.pill.no_contact { background: rgba(255,255,255,.07); color: var(--text-2); }
.pill.filled   { background: var(--success-soft); color: var(--success-fg); }
.pill.unfilled { background: rgba(255,255,255,.07); color: var(--text-2); }
.pill.in_progress { background: var(--info-soft); color: var(--info); }
.pill.paused   { background: var(--warning-soft); color: var(--warning-fg); }
.pill.muted    { background: rgba(255,255,255,.07); color: var(--text-2); }
.pill.muted::before { display: none; }

/* ---- Table ---- */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td { padding: 11px 18px; text-align: left; border-bottom: 1px solid var(--border-2); }
.tbl thead th {
  font-size: 11.5px; font-weight: 600; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .06em;
  background: var(--surface-2);
}
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl td a.row-link { color: var(--text); font-weight: 500; }
.tbl td a.row-link:hover { color: var(--text); }
.tbl tr.row-clickable { cursor: pointer; }

/* ---- Forms ---- */
/* Inputs, selects, and buttons that sit side-by-side share the same heights:
   38px regular, 32px for the -sm variants. textarea is exempt (multiline). */
.input, select, textarea,
input[type="text"], input[type="email"], input[type="search"],
input[type="password"], input[type="url"], input[type="number"], input[type="tel"] {
  width: 100%; padding: 8px 11px;
  /* Darker than --surface on purpose: a field sits INSIDE a card, so it has to
     recede below the card plane. Matching --surface made them invisible. */
  background: rgba(0,0,0,.30);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 4px; font-size: 13px; color: var(--text);
  font-family: inherit; line-height: 1.4;
}
/* :not(textarea) matters. A <textarea class="input"> matched this selector and
   got height:38px, which min-height:80px then clamped — so every textarea in
   the app rendered ~80px tall and rows="14"/"22" did nothing. */
.input:not(textarea), select,
input[type="text"], input[type="email"], input[type="search"],
input[type="password"], input[type="url"], input[type="number"], input[type="tel"] {
  min-height: var(--ctl-h); padding-top: 0; padding-bottom: 0;
}
textarea { min-height: 80px; padding-top: 9px; padding-bottom: 9px; }
.input:focus, select:focus, textarea:focus,
input[type="text"]:focus, input[type="email"]:focus, input[type="search"]:focus,
input[type="password"]:focus, input[type="url"]:focus, input[type="number"]:focus, input[type="tel"]:focus {
  /* A 3px orange halo around every select and search box was the loudest thing
     on the page the moment you clicked anything. The border alone is enough to
     say "focused" — quieter, and it never bleeds outside the control. */
  outline: none;
  border-color: rgba(255,255,255,.34);
  box-shadow: none;
  background-color: rgba(255,255,255,.05);
}
input::placeholder, textarea::placeholder { color: var(--text-3); }
.input-sm, select.input-sm { min-height: var(--ctl-h-sm); padding: 0 10px; font-size: 12.5px; }
.priority-input { width: 60px; height: 32px; padding: 0 6px; text-align: right; }
label.field { display: block; font-size: 12px; color: var(--text-3); margin-bottom: 4px; font-weight: 500; }

/* Vertical form row used on /settings + the role/filled modals */
.form-row { margin-bottom: 14px; }
.form-row > label { display: block; font-size: 12.5px; color: var(--text-2, var(--text-3)); margin-bottom: 6px; font-weight: 600; }
.form-row > label .small { font-weight: 400; color: var(--text-3); }
.form-row > .small { margin-top: 6px; color: var(--text-3); font-size: 12px; line-height: 1.45; }
.form-row > input[type="checkbox"] { width: auto; margin-right: 6px; vertical-align: middle; }
.form-row > textarea { min-height: 80px; resize: vertical; line-height: 1.5; }

/* Tab strip — used on /settings */
/* Segmented control, not underlines. The track is a single inset well and the
   active tab is a raised chip inside it, so the control reads as one object
   with one thing selected — clearer than a row of links with a coloured edge. */
.tabs {
  display: inline-flex; gap: 2px; padding: 3px;
  background: rgba(0,0,0,.26);
  border: 1px solid var(--border);
  border-radius: 6px;
  width: fit-content; max-width: 100%; flex-wrap: wrap;
}
.tabs .tab {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 14px; font-size: 13px; font-weight: 500;
  color: var(--text-2); text-decoration: none;
  border-radius: 4px; border: 1px solid transparent;
  transition: background .14s, color .14s, border-color .14s;
}
.tabs .tab svg { width: 15px; height: 15px; flex-shrink: 0; }
.tabs .tab:hover { color: var(--text); background: rgba(255,255,255,.05); }
.tabs .tab.tab-active {
  color: var(--text);
  background: var(--glass-sheen), rgba(255,255,255,.085);
  border-color: rgba(255,255,255,.11);
  font-weight: 600;
}

/* ---- The standard identity block (fragments/identity.php) ----
   One shape for a person+company across every list in the app. Fixed three-line
   rhythm so rows never shift, whether or not a contact has been found yet. */
/* Compact card rows (Today's Hopper / My queue) carry the identity block in
   place of their old icon+title markup, so they match the big tables. */
.trow.trow-ident { grid-template-columns: minmax(0,1fr) auto; }

.ident { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ident-body { min-width: 0; }
/* The identity tile carries the fit score. Fixed square, tabular figures, so a
   column of them lines up whether the score is 8 or 100. Banded to match
   App::scoreBands() — the same thresholds the score filter uses. */
.ident-avatar {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border);
  font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}
.ident-avatar.band-strong { background: rgba(16,185,129,.16); border-color: rgba(16,185,129,.42); color: #8fd9b6; }
.ident-avatar.band-good   { background: rgba(255,91,31,.13);  border-color: rgba(255,91,31,.36);  color: #ffb694; }
.ident-avatar.band-weak   { background: rgba(255,255,255,.05); border-color: var(--border-2); color: var(--text-3); }
.ident-avatar.band-none   { border-style: dashed; color: var(--text-3); opacity: .75; }
/* Callers with no score data keep the original glyph tile. */
.ident-avatar.band-icon { color: var(--text-3); }
.ident-avatar.band-icon svg { width: 16px; height: 16px; }
.ident-line1 { display: flex; align-items: baseline; gap: 7px; min-width: 0; }
.ident-name {
  font-weight: 600; font-size: 14px; color: var(--text); text-decoration: none;
  letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
a.ident-name:hover { color: var(--accent); }
.ident-gap {
  flex: 0 0 auto; font-size: 10px; font-weight: 600; color: #92400e;
  background: var(--warning-soft); color: var(--warning-fg); border-radius: 5px; padding: 1px 7px; white-space: nowrap;
}
.ident-line2 {
  font-size: 12px; color: var(--text-2); margin-top: 1px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* Company reads as a link, not a heading — blue, not bold, and it goes
   straight to their website so you can look them up without leaving the row. */
.ident-co { color: #6aa9f0; text-decoration: none; font-weight: 500; }
.ident-co:hover { text-decoration: underline; }
.ident-co.is-plain { color: var(--text-2); font-weight: 500; }
.ident-ctx { color: var(--text-3); }

/* Tribe / role — its own column now, not jumbled into the person's line. */
.col-sent { min-width: 0; line-height: 1.3; font-variant-numeric: tabular-nums; }
.col-tribe { min-width: 0; line-height: 1.3; }
.col-tribe > div:first-child { font-weight: 500; color: var(--text-2); }
/* The role can be long ("Corporate Travel & Events"); the column has a min
   width and the role is allowed a second line rather than being clipped. */
.col-tribe > div:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.col-tribe > div:last-child { font-size: 11.5px; overflow-wrap: anywhere; }

/* Contact-information cell (fragments/contact-cell.php): email over phone, with
   a check when SalesIntel verified the record — so a paid, verified contact is
   visually distinct from one scraped off the web. */
.col-contact { min-width: 0; }
.col-contact .cc-row { display: flex; align-items: center; gap: 5px; min-width: 0; }
.col-contact .cc-val { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.col-contact .cc-phone { color: var(--text-3); margin-top: 1px; font-variant-numeric: tabular-nums; }
.col-contact .cc-ok {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  width: 15px; height: 15px; border-radius: 50%;
  background: rgba(26,169,113,.30); color: #8fd9ba; font-size: 9.5px; font-weight: 700; line-height: 1;
}

/* Row-end "open this candidate" affordance — replaces the ambiguous
   follow-up/status button pair in list views. */
.row-open {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 4px; flex: 0 0 auto;
  color: var(--text-3); text-decoration: none; border: 1px solid transparent;
  transition: color .12s, background .12s, border-color .12s, transform .12s;
}
.row-open svg { width: 17px; height: 17px; }
.row-open:hover {
  color: var(--accent); background: var(--surface-2);
  border-color: var(--border); transform: translateX(1px);
}

/* Table + grid-row headers read left-aligned like the data beneath them. */
.qrow-head > div,
.tbl thead th { text-align: left; }
/* Header cells never wrap: a two-line title visually breaks alignment with the
   single-line data beneath it, which reads as "the columns don't line up". */
.qrow-head > div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Same horizontal padding as .qrow (16px) — only the vertical differs. */
.qrow-head { padding: 10px 16px; }
.qrow-head > div.num,
.tbl thead th.num { text-align: right; }

/* Icon-only reject on the review queue — quieter than a full red button so the
   primary "Invite" action carries the row's visual weight. */
.btn-reject-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; flex: 0 0 auto; padding: 0;
  background: transparent; border: 1px solid var(--border);
  border-radius: 4px; color: var(--text-3); cursor: pointer;
  transition: color .12s, border-color .12s, background .12s;
}
.btn-reject-icon svg { width: 15px; height: 15px; }
.btn-reject-icon:hover {
  color: var(--danger); border-color: var(--danger);
  background: rgba(239, 68, 68, .07);
}

/* Count badge inside a tab (home tabs + candidate tabs). */
.tab-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px; margin-left: 3px;
  border-radius: 4px; background: var(--surface-2); color: var(--text-2);
  font-size: 11px; font-weight: 600; line-height: 1; vertical-align: middle;
}
.tabs .tab.tab-active .tab-count { background: var(--accent); color: #fff; }
.tabs .tab .tab-count { background: rgba(255,255,255,.08); }

/* In-page tab panels (candidate page). Reuses .hide, but scope a hard rule so
   it works even where .hide isn't defined. */
.ctab-panel.hide { display: none !important; }

/* Notes popover (hopper rows on /today). */
.notes-icon {
  display: inline-flex; align-items: center; gap: 3px;
  border: 1px solid var(--border); background: var(--surface);
  border-radius: 3px; padding: 3px 7px; font-size: 11px; cursor: pointer;
  color: var(--text-2); line-height: 1;
}
.notes-icon:hover { border-color: var(--accent); color: var(--accent); }
.notes-pop {
  position: fixed; z-index: 400; max-width: 340px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 5px;
  box-shadow: 0 8px 30px rgba(0,0,0,.16); padding: 10px 12px; font-size: 12.5px;
}
.notes-pop .np-item { padding: 6px 0; border-top: 1px solid var(--border-2); }
.notes-pop .np-item:first-child { border-top: none; padding-top: 0; }

/* ---- Progress bar ---- */
.bar { height: 6px; background: var(--border-2); border-radius: 2px; overflow: hidden; }
.bar > .fill { height: 100%; background: linear-gradient(90deg, var(--success), #4ade80); border-radius: 2px; transition: width .25s; }
.bar.accent > .fill { background: linear-gradient(90deg, var(--accent), #ffa073); }

/* ---- Sparkline (inline icon) ---- */
.spark { display: inline-flex; align-items: end; gap: 2px; height: 16px; }
.spark span { width: 3px; background: var(--text-3); border-radius: 1px; }

/* ---- Tribe grid (compact) ---- */
.tribe-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.tribe-tile {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px;
  display: block; color: inherit;
  transition: border-color .12s, transform .12s;
}
.tribe-tile:hover { background: var(--surface-2); color: inherit; }
.tribe-tile h4 { margin: 0 0 8px; font-size: 14.5px; font-weight: 600; letter-spacing: -0.01em; display: flex; align-items: center; }
.tribe-tile h4 .pct { margin-left: auto; color: var(--text-3); font-size: 12px; font-weight: 500; }
.tribe-tile .stats { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 12.5px; color: var(--text-3); margin-top: 8px; }
.tribe-tile .stats strong { color: var(--text); font-weight: 600; }
.tribe-tile .stats > div { white-space: nowrap; }
.tribe-tile .stats .pill { white-space: nowrap; flex: 0 0 auto; }

/* ---- Candidate row (action queue) ---- */
.qrow {
  display: grid;
  grid-template-columns: minmax(0, 2fr) 1fr 1fr 90px 80px auto;
  gap: 22px; align-items: center;
  /* Horizontal padding MUST be identical on .qrow and .qrow-head or every
     column sits offset from its title. Set here only — never inline. */
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-2);
}
.qrow > * { min-width: 0; }
.qrow:last-child { border-bottom: 0; }
.qrow:hover { background: var(--surface-2); }
.qrow .co { display: flex; flex-direction: column; min-width: 0; }
.qrow .co .co-name { font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qrow .co .co-meta { color: var(--text-3); font-size: 12px; }
.qrow .role { color: var(--text-2); font-size: 13px; min-width: 0; }
.qrow .role .role-tribe { color: var(--text-3); font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; }
.qrow .person { font-size: 12.5px; }
.qrow .person .pn { color: var(--text); font-weight: 500; }
.qrow .person .pt { color: var(--text-3); font-size: 11.5px; }
.qrow .rating { font-size: 13px; color: var(--text-2); }
.qrow .score { font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.qrow .actions { display: flex; gap: 6px; justify-content: flex-end; }
/* Arrow sits in a narrow fixed column at the right edge; the data columns are
   proportional so the row fills its width evenly. */
.qrow .col-actions { justify-self: end; }

/* ---- Candidate detail people grid ---- */
.people-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.person-card {
  /* A card again — but an inset panel, not another sheet of glass. Glass inside
     glass was the strange doubled look; no card at all was worse. */
  background: rgba(0,0,0,.20);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: none;
}
.people-grid { display: flex; flex-direction: column; gap: 10px; }
.person-card .pn { font-weight: 600; }
.person-card .pt { color: var(--text-3); font-size: 12px; }
.person-card .links { margin-top: 8px; font-size: 12.5px; display: flex; flex-direction: column; gap: 2px; }
.person-card .links a { color: var(--info); }
.person-card .meta { margin-top: 8px; font-size: 11.5px; color: var(--text-3); }

/* Legacy .scrim modal kept only for any older modal callers — slide-out drawers
   (.drawer + #drawer-backdrop) are the canonical pattern now. */
.scrim {
  position: fixed; inset: 0; background: rgba(15,15,20,.45);
  display: none; align-items: center; justify-content: center;
  z-index: 50;
}
.scrim.open { display: flex; }
.drawer .row-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }

/* ---- Decision feed ---- */
.feed { display: flex; flex-direction: column; }
.feed-item {
  padding: 12px 18px; border-bottom: 1px solid var(--border-2);
  display: flex; gap: 10px; align-items: center;
}
.feed-item .pill { align-self: center; flex-shrink: 0; }
.feed-item:last-child { border-bottom: 0; }
.feed-item .what { flex: 1; min-width: 0; }
.feed-item .what .head { display: flex; gap: 8px; align-items: center; }
.feed-item .what .head .co-name { font-weight: 600; }
.feed-item .what .head .role { color: var(--text-3); font-size: 12px; }
.feed-item .what .reason { color: var(--text-2); font-size: 13px; margin-top: 2px; }
.feed-item .when { color: var(--text-3); font-size: 11.5px; white-space: nowrap; }

/* ---- Lesson card ---- */
.lesson-grid { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
@media (max-width: 900px) { .lesson-grid { grid-template-columns: 1fr; } }
.lesson-card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 16px; }
.lesson-card h4 { margin: 0 0 10px; font-size: 13px; font-weight: 600; }
.lesson-list { display: flex; flex-direction: column; gap: 8px; }
.lesson-list .item { font-size: 13px; color: var(--text-2); border-left: 3px solid var(--border); padding-left: 10px; }
.lesson-list .item.approved { border-color: var(--success); }
.lesson-list .item.rejected { border-color: var(--danger); }
.lesson-list .item .head { font-weight: 600; color: var(--text); font-size: 13px; }

/* ---- Empty states ---- */
.empty {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 38px 24px;
  text-align: center; color: var(--text-3);
  background: var(--surface);
}
.empty .e-title { color: var(--text); font-weight: 600; font-size: 15px; margin-bottom: 6px; }

/* ---- Coverage indicator ---- */
.cov {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 600;
}
.cov .dots { display: inline-flex; gap: 2px; }
.cov .dot { width: 8px; height: 8px; border-radius: 2px; background: var(--border); }
.cov .dot.ok { background: var(--success); }
.cov .dot.missing { background: rgba(255,255,255,.10); }
.cov .dot.failed { background: var(--danger); }
.cov .dot.deferred { background: rgba(255,255,255,.16); outline: 1px dashed var(--text-3); outline-offset: -1px; }
.cov.lg .dot { width: 11px; height: 11px; border-radius: 3px; }
.cov .pct { color: var(--text-2); font-variant-numeric: tabular-nums; }
.cov.high .pct { color: var(--success); }
.cov.mid .pct { color: var(--warning); }
.cov.low .pct { color: var(--danger); }

.cov-bar { display: flex; gap: 2px; height: 6px; }
.cov-bar > div { flex: 1; background: var(--border-2); border-radius: 1px; }
.cov-bar > div.ok { background: var(--success); }
.cov-bar > div.failed { background: var(--danger); }
.cov-bar > div.deferred { background: rgba(255,255,255,.16); }

.source-row {
  display: grid; grid-template-columns: 16px 1fr auto auto;
  gap: 12px; padding: 10px 14px;
  border-bottom: 1px solid var(--border-2); align-items: center;
}
.source-row:last-child { border-bottom: 0; }
.source-row .src-status {
  width: 10px; height: 10px; border-radius: 3px;
}
.source-row .src-status.ok { background: var(--success); }
.source-row .src-status.missing { background: var(--border); }
.source-row .src-status.failed { background: var(--danger); }
.source-row .src-status.not_found { background: var(--warning); }
.source-row .src-status.not_available, .source-row .src-status.deferred { background: rgba(255,255,255,.16); outline: 1px dashed var(--text-3); outline-offset: -1px; }
.source-row .src-label { font-weight: 500; font-size: 13px; }
.source-row .src-tier {
  font-size: 10.5px; font-weight: 700; padding: 1px 6px;
  border-radius: 4px; background: var(--surface-2); color: var(--text-3);
}
.source-row .src-tier.S { background: var(--accent-soft); color: #ffa274; }
.source-row .src-tier.A { background: #eff5ff; color: var(--info); }
.source-row .src-tier.B { background: #f5ecff; color: var(--purple); }

/* ---- Utility ---- */
.row { display: flex; gap: 12px; }
.row.wrap { flex-wrap: wrap; }
.row.center { align-items: center; }
.row.between { justify-content: space-between; }
.col { display: flex; flex-direction: column; gap: 12px; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }
.muted { color: var(--text-3); }
.small { font-size: 12.5px; }
.flex1 { flex: 1; min-width: 0; }
.mt-1{margin-top:4px}.mt-2{margin-top:8px}.mt-3{margin-top:12px}.mt-4{margin-top:16px}.mt-6{margin-top:24px}
.mb-1{margin-bottom:4px}.mb-2{margin-bottom:8px}.mb-3{margin-bottom:12px}.mb-4{margin-bottom:16px}.mb-6{margin-bottom:24px}
/* A utility whose whole job is to override, so it has to actually win. Any
   component declaring its own `display` later in this file silently defeated a
   plain `.hide` — which is why toggling a filter on the tribe roster grid did
   nothing at all. Nothing sets a non-empty inline display on a .hide element,
   so this is safe. */
.hide { display: none !important; }

/* ============================================================================
   MOBILE LAYER — phones & small tablets (≤ 720px)
   Everything below the desktop styles so it wins on the cascade. Goals:
   data tables and action rows reflow into stacked cards, every multi-column
   grid collapses, toolbars/tabs stop overflowing, and filter controls fold
   into a "Filters" dropdown (wired in app.js). Nothing scrolls horizontally.
   ========================================================================== */

/* Global overflow guards — nothing escapes the viewport width. Runs across the
   whole tablet+mobile range (≤1024) so dense multi-column rows/tables become
   readable cards instead of cramped grids; the 768–1024 tablet block below then
   re-opens two-column splits so tablets feel roomier than phones. */
@media (max-width: 1024px) {
  html, body { overflow-x: hidden; }
  .main { min-width: 0; max-width: 100vw; padding: 74px 13px 40px; }
  img, svg, video, canvas, table, pre, code { max-width: 100%; }
  pre { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: pre-wrap; word-break: break-word; }
  /* Form controls never exceed the viewport, even with inline pixel widths
     (filter selects/search boxes carry style="width:180px|220px" etc.). */
  input, select, textarea { max-width: 100% !important; }
  /* Inline max-width caps (truncated subject lines, etc.) shouldn't exceed
     the card on a phone. */
  [style*="max-width:"] { max-width: 100% !important; }

  h1.page-title { font-size: 19px; }
  .page-sub { font-size: 13px; }

  /* Cards flush to the edges reclaim ~36px of width on a phone. */
  .card-head { flex-wrap: wrap; padding: 12px 14px; row-gap: 10px; }
  .card-head h3 { font-size: 13.5px; }
  .card-head .meta { font-size: 12px; }
  .card-head .right { margin-left: 0; width: 100%; flex-wrap: wrap; gap: 8px; position: relative; }
  .card-body { padding: 14px; }

  /* ---- Collapse EVERY multi-column grid ---- */
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi .value { font-size: 22px; }
  .tribe-grid,
  .people-grid,
  .lesson-grid { grid-template-columns: 1fr; }
  .cand-stats { grid-template-columns: 1fr 1fr; }
  /* Inline 2-/3-column grids written as style="grid-template-columns:..."
     (add-person modal, candidate company/people split, settings form rows). */
  [style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
  /* Pending cockpit: the wide 8-column row is force-stacked to one column above.
     Hide the now-meaningless uppercase header, give each stacked cell breathing
     room so a row reads as a little card, and drop the empty trailing cells. */
  .qrow-head { display: none !important; }
  .qrow-pending { row-gap: 7px !important; padding: 13px 14px !important; align-items: stretch !important; }
  .qrow-pending > div:empty { display: none; }
  /* Flex rows wrap instead of squeezing their children to nothing. */
  .row { flex-wrap: wrap; }
  /* Discovery source rows: dot + label on line one, the tier/tries/rate meta
     wraps underneath instead of forcing a 6-column grid off-screen. */
  .source-row { display: flex !important; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
  .source-row > .src-status { flex: 0 0 auto; }
  .source-row > div:nth-child(2) { flex: 1 1 60%; min-width: 0; }
  .source-row > span { flex: 0 0 auto; text-align: left !important; }

  /* ---- Candidate / queue rows (.qrow) → compact decision cards ----
     Show only what's needed to decide whether to tap in. The detail page
     carries the full breakdown. !important beats the inline display:grid. */
  .qrow { display: block !important; padding: 12px 14px; position: relative; }
  .qrow > div,
  .qrow > a { margin-bottom: 4px; min-width: 0; }
  .qrow > div:last-child,
  .qrow > a:last-child { margin-bottom: 0; }
  .qrow .co .co-name { white-space: normal; font-size: 15px; }
  .qrow .person .pn { font-size: 13.5px; }
  .qrow .actions { justify-content: flex-start; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
  .qrow .actions .btn { flex: 1 1 auto; min-width: 120px; }
  /* Column-header strips are meaningless once the grid is stacked. */
  .qrow-head { display: none !important; }

  /* Review queue → identity + score + Invite/Reject. Drop the ratings
     breakdown, the email column, and the coverage chip (all on the detail page).
     Target by class, not nth-child: column positions shift when the row layout
     changes and index-based rules silently hide the wrong cell. */
  .qrow-review .rating,
  .qrow-review .col-tribe,
  .qrow-review .col-contact,
  .qrow-review .role,
  .qrow-review .col-cov { display: none; }
  .qrow-review .score { font-size: 12.5px; color: var(--text-3); }
  .qrow-review .score::before { content: "Score "; }

  /* Pipeline rows → name+company + stage pill + the action buttons. Hide the
     "waiting" column and the email/subject/owner preview lines, but KEEP the
     actions (col 4) so you can follow up / reply / change status from a phone. */
  /* Class-targeted, never nth-child: column positions shift whenever a row
     layout changes, and index rules then hide the wrong cell silently. */
  .qrow-pending .col-wait,
  .qrow-pending .col-contact,
  .qrow-pending .col-tribe { display: none; }
  .qrow-pending .col-actions { text-align: left !important; margin-top: 10px; }
  .qrow-pending .col-actions > .row { justify-content: flex-start !important; gap: 8px; }
  /* Bigger touch target for the primary follow-up/reply action; the ghost
     "Status" button stays compact so a lone action doesn't stretch full-width. */
  .qrow-pending .col-actions .btn-followup,
  .qrow-pending .col-actions .btn-primary { padding: 9px 16px; }
  /* Queue rows (Today) hide the same secondary columns on a phone. */
  .qrow-queue .col-contact,
  .qrow-queue .col-tribe { display: none; }

  /* Backlog → company + contact + the "Add email" CTA. Drop the role column. */
  .qrow-backlog .role { display: none; }

  /* Recent-decisions feed (pill · what · when) → the date+Undo column wraps
     to its own line under the company, instead of colliding with the role. */
  .feed-item { flex-wrap: wrap; }
  .feed-item .what .head { flex-wrap: wrap; gap: 2px 8px; }
  .feed-item .when { flex: 1 1 100%; margin-top: 4px; }

  /* Emails queue (.em-item) → company + status + the Edit/Copy button.
     Drop the "updated …" timestamp column. */
  .em-item .qrow > div:nth-child(2) { display: none; }

  /* ---- HTML data tables (.tbl) → compact cards ----
     First cell is the card title; cells marked .m-hide are dropped; the rest
     show as quiet lines (no loud uppercase column labels). */
  .tbl thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .tbl, .tbl tbody, .tbl tr, .tbl td { display: block; width: 100% !important; }
  .tbl tr {
    border: 1px solid var(--border); border-radius: 5px;
    margin-bottom: 8px; padding: 10px 14px; background: var(--surface);
  }
  .tbl tr:last-child { margin-bottom: 0; }
  .tbl td {
    border: none; padding: 1px 0; text-align: left !important; word-break: break-word;
  }
  /* First visible cell = bold card title. */
  .tbl td:first-child { font-weight: 600; font-size: 14.5px; margin-bottom: 2px; }
  .tbl td:first-child a { color: var(--text); }
  .tbl td:not(:first-child) { font-size: 12.5px; color: var(--text-2); }
  /* Real action cells (revoke, disable, etc.) stay as a wrapped button row. */
  .tbl td.actions { display: flex !important; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
  .tbl td.actions .btn { flex: 1 1 auto; }
  /* Full-width spanning cells (users access-editor detail row) stay plain. */
  .tbl td[colspan] { padding: 0; }
  /* Secondary cells hidden on phones — declared LAST so it beats td.actions
     for cells that are both an action and secondary (e.g. People "Edit"). */
  .tbl td.m-hide { display: none !important; }

  /* ---- Tabs & button toolbars: scroll horizontally, never stack ---- */
  /* The base .tabs has flex-wrap:wrap, which made the Today / New prospects /
     Follow-ups tabs stack on a phone. Force a single scrollable row instead. */
  .tabs {
    display: flex; flex-wrap: nowrap; width: 100%;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none;                 /* Firefox: hide the bar, keep the scroll */
  }
  .tabs::-webkit-scrollbar { display: none; }   /* WebKit: same */
  .tabs .tab { white-space: nowrap; flex: 0 0 auto; }
  .tribe-toolbar { flex-wrap: wrap; gap: 8px; }
  .tribe-toolbar .btn { flex: 1 1 auto; }

  /* Pagination stays centered and wraps cleanly. */
  .pagination { flex-wrap: wrap; }

  /* Drawers / slide-overs go full-width on a phone. */
  .drawer, .slideover { width: 100% !important; max-width: 100vw; }

  /* Candidate Actions ▾ menu: on a phone the button sits on the left of the
     header, so the right-anchored dropdown ran off the left edge. Anchor it
     left and cap its width so it never spills off either side. */
  #candActionsMenu { right: auto !important; left: 0 !important; max-width: calc(100vw - 28px); }

  /* ---- Filter dropdown (enhanced by app.js) ---- */
  /* The "Filters" toggle is hidden on desktop, shown here. */
  .filters-toggle { display: inline-flex !important; align-items: center; gap: 6px; }
  /* Collapsed: the filter controls hide until the toggle opens them. */
  .filter-pop {
    display: none; position: absolute; top: calc(100% + 6px); right: 0; left: 0;
    z-index: 40; flex-direction: column; gap: 8px;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border);
    border-radius: 5px; padding: 12px; box-shadow: var(--shadow-2, 0 8px 24px rgba(0,0,0,.12));
  }
  .right.filters-open .filter-pop { display: flex; }
  .filter-pop > select,
  .filter-pop > input { width: 100% !important; }

  /* ---- Recently-added components ---- */
  /* Today action queues (Follow-ups / Hopper / Replies) → compact stacked cards;
     the action buttons go full-width and left-aligned. */
  .qrow-queue > div:last-child {
    justify-content: flex-start !important; flex-wrap: wrap; gap: 8px;
    margin-top: 10px; width: 100%;
  }
  .qrow-queue > div:last-child .btn { flex: 1 1 auto; padding: 9px 14px; }
  .qrow-queue .co-name { font-size: 15px; white-space: normal; }

  /* Tab bars (home + candidate): tighter so icon + label + badge fit more
     before the row needs to scroll. */
  .tabs .tab { padding: 9px 11px; gap: 5px; font-size: 13px; }
  .tabs .tab svg { width: 14px; height: 14px; }

  /* Notes popover never exceeds the viewport. */
  .notes-pop { max-width: min(340px, calc(100vw - 24px)); }

  /* The Today search + Add-person row: let the button drop below the search
     instead of squeezing it on the narrowest phones. */
  .cc-search { max-width: none; }
}

/* ---- Tablet tier (768–1024px) — the middle ground between desktop and mobile.
   The sidebar is off-canvas here (≤1024 rules above) so content gets the full
   width; this block then makes it roomier than the phone layout: KPIs flow 3-up,
   inline 2-column splits (company/people, form rows) stay TWO columns instead of
   collapsing to one, and content padding opens up a little. ---- */
@media (min-width: 768px) and (max-width: 1024px) {
  .main { padding: 80px 24px 52px; }
  /* KPIs: auto-fit a few across instead of the phone's forced 2-up. */
  .kpis { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
  /* Keep inline 2-/3-column grids at TWO columns on a tablet (mobile forces 1).
     .qrow rows are display:block at this width, so this only affects the
     candidate company/people split, the add-person drawer, and settings forms. */
  [style*="grid-template-columns"] { grid-template-columns: 1fr 1fr !important; }
  .cand-stats { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
  /* The Today action-queue cards read better two-up on a tablet. */
  .qrow-queue { max-width: none; }
}

/* Desktop (≥1025px): the filter controls live inline (display:contents lets the
   wrapper vanish so its children flow in the .right flexbox exactly as before),
   and the mobile/tablet toggle button is hidden. */
.filters-toggle { display: none; }
@media (min-width: 1025px) {
  .filter-pop { display: contents; }
}

/* --- Chunk 3: role_mode multi UI ---------------------------------- */
.badge-multi { background: #4f46e5; color: #fff; padding: 2px 10px; border-radius: 5px; font-size: 12px; font-weight: 600; }
.stat-strip { background: var(--glass-bg); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); border: 1px solid var(--border); padding: 14px 18px; border-radius: 4px; margin-bottom: 18px; font-size: 15px; }
.stat-strip strong { color: #4f46e5; font-size: 18px; }
.people-list { list-style: none; padding: 0; margin: 24px 0; }
.person-card { padding: 14px; border-bottom: 1px solid #e5e7eb; }
.person-head strong { color: #111; font-size: 15px; }
.person-contact { margin-top: 4px; font-size: 14px; color: #4b5563; }
.badge-warning { background: var(--warning-soft); color: var(--warning-fg); padding: 1px 8px; border-radius: 5px; font-size: 11px; margin-left: 6px; }

/* ---- Status-change popup (reuses .drawer centered-modal positioning) ---- */
.status-modal { max-width: 440px; }
.status-modal .icon-btn {
  background: none; border: 0; cursor: pointer; font-size: 16px;
  color: var(--text-2); line-height: 1; padding: 4px 6px; border-radius: 3px;
}
.status-modal .icon-btn:hover { background: var(--surface-2); color: var(--text); }
.status-modal .field { display: flex; flex-direction: column; gap: 4px; }
.status-modal .field-label { font-size: 12px; font-weight: 600; color: var(--text-2); }
.status-modal .field-hint { font-size: 11px; color: var(--text-3); }

/* Pills for the new pipeline statuses (class = raw status string) */
.pill.attended_event { background: #e0e7ff; color: #3730a3; }
.pill.hopper         { background: #fef3c7; color: #92400e; }
.pill.new_member     { background: #d1fae5; color: #065f46; }
.pill.lost           { background: #f3f4f6; color: #6b7280; }

/* Visible keyboard focus everywhere — orange, matching the action colour. */
a:focus-visible, button:focus-visible, .btn:focus-visible,
[tabindex]:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* CUSTOM SELECT. A native <select> ignores an author height in several engines,
   which is why the tribe filter never lined up with the search box next to it.
   appearance:none makes height authoritative and lets us draw our own chevron
   in a tinted well, so it reads as a deliberate control rather than an OS widget. */
select, select.input, select.input-sm {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2024%2024'%20fill%3D'none'%20stroke%3D'%23a6a5a6'%20stroke-width%3D'2.4'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%3E%3Cpath%20d%3D'm6%209%206%206%206-6'%2F%3E%3C%2Fsvg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 11px 11px;
  padding-right: 32px;
  cursor: pointer;
  text-overflow: ellipsis;
}
select:hover { border-color: rgba(255,255,255,.20); }
select::-ms-expand { display: none; }
select option { background: #14141a; color: var(--text); }

/* HEIGHT PARITY, declared in one place so a filter row can never drift again:
   every control that sits in a card toolbar is exactly the same height. */
.card-head .right select,
.card-head .right input[type="search"],
.card-head .right .search-wrap > input[type="search"],
.card-head .right .input { min-height: var(--ctl-h-sm); box-sizing: border-box; }

/* Collapsible card. <summary> is display:list-item by default, so the native
   triangle has to be removed in two places before .card-head's flex applies. */
details.card > summary { list-style: none; cursor: pointer; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::marker { content: ""; }
details.card > summary::after {
  content: ""; margin-left: 8px; width: 9px; height: 9px; flex: 0 0 auto;
  border-right: 2px solid var(--text-3); border-bottom: 2px solid var(--text-3);
  transform: rotate(45deg) translate(-2px,-2px);
  transition: transform .15s ease;
}
details.card[open] > summary::after { transform: rotate(-135deg) translate(-2px,-2px); }
details.card > summary:hover::after { border-color: var(--text-2); }

/* Delivery state. The dot carries it at a glance; green = it went out, red =
   it came back. The only blue in the interface is the company website link. */
.sent-state { display: flex; align-items: center; gap: 6px; font-weight: 500; color: var(--success-fg); }
.sent-state .sent-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); flex: 0 0 auto; }
.sent-state.is-bounced { color: var(--danger-fg); }
.sent-state.is-bounced .sent-dot { background: var(--danger); }

/* Stage tones for the pipeline row. Without these every stage inherited the
   green "email sent" colour, so Closed and Invited rendered as success. */
.sent-state.tone-plain { color: var(--text-2); }
.sent-state.tone-plain .sent-dot { background: var(--text-3); }
.sent-state.tone-good { color: var(--success-fg); }
.sent-state.tone-good .sent-dot { background: var(--success); }
.sent-state.tone-bad { color: var(--danger-fg); }
.sent-state.tone-bad .sent-dot { background: var(--danger); }
.sent-state.tone-warn { color: #e0a53d; }
.sent-state.tone-warn .sent-dot { background: #e0a53d; }
.sent-state.tone-dim { color: var(--text-3); }
.sent-state.tone-dim .sent-dot { background: var(--text-3); opacity: .55; }

/* Contact column: an icon per channel so a row is scannable without reading it,
   and an explicit dash when a channel is genuinely absent. A blank gap reads as
   "not loaded"; a dash reads as "we looked and there is nothing there". */
.col-contact .cc-row { display: flex; align-items: center; gap: 6px; min-width: 0; }
.col-contact .cc-ic { flex: 0 0 auto; width: 13px; height: 13px; color: var(--text-3); display: inline-flex; }
.col-contact .cc-ic svg { width: 13px; height: 13px; }
.col-contact .cc-row.is-empty .cc-ic { opacity: .45; }
.col-contact .cc-none { color: var(--text-3); }
.col-contact .cc-val { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sent-state.is-waiting { color: var(--warning-fg); }
.sent-state.is-waiting .sent-dot { background: var(--warning); }

/* Inline search field with a leading icon. .cc-search is the big command-bar
   variant; this is the small one that sits in a card toolbar. */
.search-wrap { position: relative; display: inline-flex; align-items: center; }
.search-wrap > svg {
  position: absolute; left: 9px; width: 14px; height: 14px;
  color: var(--text-3); pointer-events: none;
}
.search-wrap > input[type="search"] { padding-left: 30px; }

/* ---- Candidate hero: the person is the subject, company is context ---- */
.cand-hero { display: flex; align-items: center; gap: 14px; min-width: 0; }
.cand-hero-avatar {
  flex: 0 0 auto; width: 44px; height: 44px; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--glass-bg); border: 1px solid var(--border); color: var(--text-2);
}
.cand-hero-avatar svg { width: 22px; height: 22px; }
.cand-hero-avatar.is-empty { color: var(--text-3); border-style: dashed; }
.cand-hero-sub {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  margin-top: 3px; font-size: 13.5px; color: var(--text-2); min-width: 0;
}
.cand-hero-sub .sep { color: var(--text-3); }

/* ---- Candidate action bar ---- */
.cand-actions {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 14px; border-radius: var(--radius);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border);
}
.cand-actions-primary { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cand-actions-secondary { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-wrap: wrap; }
@media (max-width: 700px) {
  .cand-actions-secondary { margin-left: 0; }
  .cand-hero-avatar { width: 38px; height: 38px; }
}

/* A card that carries a photograph. The scrim is heavier than the page scrim
   because card text sits directly on it with no glass panel in between. */
.card.card-photo {
  /* No scrim: the photograph is shown exactly as-is. Legibility is bought with
     a text-shadow on the text itself rather than by dimming the image. */
  /* Vertically centred: the 38% offset was cropping the photo off-centre, so
     the banner showed the top of the frame rather than its middle. */
  background: url('img/actions-bg.webp') center center / cover no-repeat, var(--glass-tint);
  backdrop-filter: none; -webkit-backdrop-filter: none;
}
.card.card-photo .card-head { border-bottom-color: rgba(255,255,255,.14); }
.card.card-photo .card-head h3,
.card.card-photo .cc-empty {
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,.85), 0 0 14px rgba(0,0,0,.55);
}

/* ---- Activity chart ---- */
.chart-wrap { width: 100%; height: 240px; overflow: hidden; }
.chart-wrap svg { width: 100%; height: 100%; display: block; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 18px; margin-bottom: 10px; }
.chart-key { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-2); }
.chart-key .chart-swatch { width: 9px; height: 9px; border-radius: 2px; flex: 0 0 auto; }
.chart-key strong { color: var(--text); font-weight: 600; }
.chart-axis { display: flex; justify-content: space-between; margin-top: 6px; font-size: 11.5px; color: var(--text-3); }

/* ---- Welcome hero: the photograph carries this block, so no scrim. Text is
   kept legible with a shadow instead of by dimming the image. ---- */
.welcome-hero {
  position: relative; overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: url('img/actions-bg.webp') center 42% / cover no-repeat, var(--glass-tint);
  min-height: 190px;
  display: flex; align-items: flex-end;
}
.welcome-inner { padding: 26px 28px; max-width: 640px; display: flex; align-items: center; gap: 18px; }
.welcome-eyebrow {
  font-size: 11.5px; font-weight: 600; letter-spacing: .10em; text-transform: uppercase;
  color: rgba(255,255,255,.82); text-shadow: 0 1px 4px rgba(0,0,0,.9);
  margin-bottom: 6px;
}
.welcome-title {
  margin: 0; font-size: 30px; font-weight: 700; letter-spacing: -.025em; line-height: 1.15;
  color: #fff; text-shadow: 0 2px 10px rgba(0,0,0,.85), 0 0 26px rgba(0,0,0,.55);
}
.welcome-sub {
  margin: 8px 0 0; font-size: 14px; color: rgba(255,255,255,.90);
  text-shadow: 0 1px 6px rgba(0,0,0,.85);
}
@media (max-width: 700px) {
  .welcome-hero { min-height: 150px; }
  .welcome-inner { padding: 20px; }
  .welcome-title { font-size: 23px; }
}

/* ---- Shared lazy-list pager ---- */
.lazy-pager {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 12px 18px; border-top: 1px solid var(--border);
  font-size: 12.5px; color: var(--text-3);
}
.lazy-pager .lp-count strong { color: var(--text-2); font-weight: 600; }
/* Count and page-size sit together on the LEFT — they are both "what am I
   looking at". Prev/Next is the only thing that belongs on the right. */
.lazy-pager .lp-per { display: flex; align-items: center; gap: 4px; }
.lazy-pager .lp-nav { margin-left: auto; }
.lazy-pager .lp-per-label { margin-right: 3px; }
.lazy-pager .lp-size {
  min-width: 26px; text-align: center; padding: 3px 7px; border-radius: 4px;
  color: var(--text-2); text-decoration: none; border: 1px solid transparent;
}
.lazy-pager .lp-size:hover { background: rgba(255,255,255,.06); color: var(--text); }
.lazy-pager .lp-size.is-on {
  /* Neutral, not orange. Orange is the action colour; a per-page setting is not
     an action, and painting it accent made every list look like it had a
     pending call to action in the footer. */
  background: rgba(255,255,255,.10); color: var(--text);
  border-color: var(--border); font-weight: 600;
}
.lazy-pager .lp-nav { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.lazy-pager .lp-page { padding: 0 6px; }
.lazy-pager .btn.is-disabled { opacity: .35; pointer-events: none; }
@media (max-width: 700px) {
  .lazy-pager .lp-nav { margin-left: 0; }
}

/* Identity and actions share one line. No backdrop-filter here on purpose:
   backdrop-filter creates a STACKING CONTEXT, which trapped the Actions
   dropdown behind later cards no matter how high its z-index was. */
.cand-topbar {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; position: relative; z-index: 40;
}
.cand-topbar .cand-hero { flex: 1 1 320px; min-width: 0; }
.cand-topbar .cand-actions {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: none; border: 0; padding: 0; box-shadow: none;
  backdrop-filter: none; -webkit-backdrop-filter: none;
  flex: 0 0 auto;
}
.cand-topbar .cand-actions-primary,
.cand-topbar .cand-actions-secondary { display: flex; align-items: center; gap: 8px; margin-left: 0; }
#candActionsMenu { z-index: 500; }

/* Company + people, one card split into two panes. */
.cand-split { display: grid; grid-template-columns: 1.25fr 1fr; }
.cand-split > .cand-pane { padding: 16px 18px; min-width: 0; }
.cand-split > .cand-pane + .cand-pane { border-left: 1px solid var(--border-2); }
.cand-pane-title {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em;
  color: var(--text-3); margin-bottom: 10px;
}
@media (max-width: 900px) {
  .cand-split { grid-template-columns: 1fr; }
  .cand-split > .cand-pane + .cand-pane { border-left: 0; border-top: 1px solid var(--border-2); }
}

/* Count beside a card title. */
.hd-count { color: var(--text-3); font-weight: 500; margin-left: 5px; }

/* ---- Pipeline flow chart ---- */
.flow-wrap { width: 100%; overflow-x: auto; }
.flow-wrap svg { width: 100%; min-width: 900px; height: auto; display: block; }
.flow-node { cursor: pointer; }
.flow-node rect { transition: fill .13s ease, stroke .13s ease; }
.flow-node:hover rect { fill: rgba(255,255,255,.11); stroke: rgba(255,255,255,.34); }
.flow-node:focus-visible rect { stroke: var(--accent); stroke-width: 2; }
.flow-node-count {
  fill: var(--text); font-size: 19px; font-weight: 700; letter-spacing: -.02em;
  font-family: inherit;
}
.flow-node-label { fill: var(--text-2); font-size: 11.5px; font-family: inherit; }
.flow-edge-label {
  fill: var(--text-3); font-size: 10.5px; font-family: inherit;
  text-transform: uppercase; letter-spacing: .06em;
}

/* The two ways an email gets written, side by side: prebuilt template vs the
   guidance Claude drafts from. Equal columns so neither reads as the default. */
/* Both columns are the SAME HEIGHT, and stay that way when either flips to
   MCP: the grid stretches, the card is a flex column, and whichever pane is
   visible grows to fill it. Without this the shorter mode collapsed its column
   and the two cards jumped every time you toggled. */
.tmpl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: stretch; }
.tmpl-card { display: flex; flex-direction: column; }
.tmpl-card > .card-body { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.tmpl-card > .card-body > form { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.tmpl-card .tmpl-pane { flex: 1; min-height: 0; flex-direction: column; }
.tmpl-card .tmpl-pane-template { display: flex; }
.tmpl-card .tmpl-body { flex: 1; min-height: 150px; max-height: 260px; }
.tmpl-card .mcp-inst { flex: 1; max-height: none; }
@media (max-width: 1000px) { .tmpl-grid { grid-template-columns: 1fr; } }

/* ---- Candidate status: where they are, in one line ---- */
.eng-status { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 12px; }
.eng-status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--text-3); flex: 0 0 auto; }
.eng-status-dot.is-good { background: var(--success); }
.eng-status-dot.is-warn { background: var(--warning); }
.eng-status-dot.is-bad  { background: var(--danger); }
.eng-status-label { font-size: 15px; font-weight: 600; color: var(--text); letter-spacing: -.01em; }

/* Coverage summary lifted out of the dossier card so "how well do we know
   this person" sits next to "where are they". Links down to the full list. */
.eng-coverage {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 9px 12px; margin-bottom: 14px; text-decoration: none;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: rgba(255,255,255,.03);
}
.eng-coverage:hover { background: rgba(255,255,255,.06); }
.eng-coverage-label { font-size: 12px; color: var(--text-2); font-weight: 500; }
.eng-coverage-bar {
  flex: 1 1 120px; min-width: 90px; height: 5px; border-radius: 2px;
  background: rgba(255,255,255,.10); overflow: hidden;
}
.eng-coverage-bar > span { display: block; height: 100%; background: var(--accent); border-radius: 2px; }
.eng-coverage-num { font-size: 12px; color: var(--text-3); white-space: nowrap; }

/* Collapsed history */
.eng-history > summary {
  cursor: pointer; list-style: none; font-size: 12.5px; color: var(--text-2);
  padding: 7px 0; user-select: none;
}
.eng-history > summary::-webkit-details-marker { display: none; }
.eng-history > summary::marker { content: ""; }
.eng-history > summary::before { content: "▸ "; color: var(--text-3); }
.eng-history[open] > summary::before { content: "▾ "; }
.eng-history > summary:hover { color: var(--text); }

/* Mode switch: a small two-option control in the card header. Card-level
   setting, so it sits with the card title rather than inside the email. */
.tmpl-modes {
  display: inline-flex; gap: 3px; padding: 3px;
  background: rgba(0,0,0,.28); border: 1px solid var(--border); border-radius: 5px;
}
.tmpl-mode {
  padding: 4px 11px; border-radius: 3px; cursor: pointer;
  font-size: 11.5px; font-weight: 600; color: var(--text-3);
  border: 1px solid transparent; transition: background .13s, color .13s, border-color .13s;
}
.tmpl-mode input { position: absolute; opacity: 0; pointer-events: none; }
.tmpl-mode:hover { color: var(--text-2); }
.tmpl-mode.is-on {
  background: rgba(255,255,255,.09); border-color: rgba(255,255,255,.13); color: var(--text);
}

/* Body field is the point of the card — give it real room. */
.tmpl-body { min-height: 340px; resize: vertical; line-height: 1.55; }

/* Merge-field chips: click to insert at the cursor. */
.mf-legend { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; margin-top: 10px; }
.mf-legend .mf-label { font-size: 11.5px; color: var(--text-3); margin-right: 2px; }
.mf-chip {
  font-family: ui-monospace, monospace; font-size: 11px; line-height: 1;
  padding: 5px 7px; border-radius: 4px; cursor: pointer;
  background: rgba(255,255,255,.05); color: var(--text-2);
  border: 1px solid var(--border);
}
.mf-chip:hover { background: var(--accent-soft); color: #ffa274; border-color: rgba(255,91,31,.32); }

/* Preview */
.mfp-subject {
  font-weight: 600; font-size: 15px; color: var(--text);
  padding-bottom: 12px; margin-bottom: 14px; border-bottom: 1px solid var(--border);
}
.mfp-body { white-space: pre-wrap; font-size: 14px; line-height: 1.65; color: var(--text-2); }
/* One pane at a time: choosing MCP shows the instructions Claude follows,
   choosing Template shows the fields that get sent. */
.tmpl-pane { display: none; }
.mcp-inst {
  background: rgba(0,0,0,.24); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 14px 16px; font-size: 13px; line-height: 1.65; color: var(--text-2);
  max-height: 360px; overflow-y: auto;
}

/* Welcome card sits in the Today grid. Text anchors to the TOP-left of the
   card, and the greeting is the largest type on the page — it is the first
   thing you should read. */
.welcome-banner { display: flex; align-items: flex-start; min-height: 172px; }
.welcome-banner .welcome-inner { padding: 26px 28px 22px; }
.welcome-banner .welcome-eyebrow { font-size: 12px; letter-spacing: .12em; margin-bottom: 8px; }
.welcome-banner .welcome-title { font-size: 42px; line-height: 1.05; letter-spacing: -.03em; }
.welcome-banner .welcome-sub { font-size: 14.5px; margin-top: 10px; }
@media (max-width: 900px) { .welcome-banner .welcome-title { font-size: 30px; } }

/* "Waiting on you". A row is either a real number you can act on, or it says
   plainly that it is not built yet — a greyed zero would read as "all clear". */
.attn-list { display: flex; flex-direction: column; gap: 2px; padding: 6px; }
.attn-row {
  display: flex; align-items: center; gap: 14px; padding: 12px 12px;
  border-radius: var(--radius-sm); text-decoration: none; color: inherit;
}
a.attn-row:hover { background: rgba(255,255,255,.05); }
.attn-num {
  flex: 0 0 auto; min-width: 44px; text-align: center;
  font-size: 26px; font-weight: 700; letter-spacing: -.02em; color: var(--text);
}
.attn-body { min-width: 0; flex: 1; }
.attn-title { font-size: 13.5px; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 8px; }
.attn-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.attn-go { color: var(--text-3); font-size: 15px; }
a.attn-row:hover .attn-go { color: var(--accent); }
.attn-row.is-soon .attn-num { color: var(--text-3); }
.attn-row.is-soon .attn-title { color: var(--text-2); }
.attn-soon {
  font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
  padding: 2px 6px; border-radius: 3px;
  background: rgba(255,255,255,.06); color: var(--text-3);
}

/* ---- Process map (docs) — documentation, not navigation: nothing here is
   clickable, so no hover or cursor affordances. ---- */
.pmap-wrap { width: 100%; overflow-x: auto; }
.pmap-wrap svg { width: 100%; min-width: 1040px; height: auto; display: block; }
.pmap-label { fill: var(--text); font-size: 13px; font-weight: 600; font-family: inherit; }
.pmap-note  { fill: var(--text-3); font-size: 10.5px; font-family: inherit; }
.pmap-edge  {
  fill: var(--text-3); font-size: 10.5px; font-family: inherit;
  text-transform: uppercase; letter-spacing: .06em;
}

/* ---- Candidate page: content left, controls in one rail card right ----
   The rail is a SINGLE full-height card divided into labelled sections, not a
   stack of small cards — the previous version read as unrelated fragments. */
.cand-layout { display: grid; grid-template-columns: minmax(0,1fr) 320px; gap: 18px; align-items: start; }
.cand-main { min-width: 0; }
.cand-rail { min-width: 0; position: sticky; top: 76px; }

/* Extra sheen so the rail lifts off the page — it is the control surface. */
.rail-card {
  background:
    linear-gradient(150deg, rgba(255,255,255,.13) 0%, rgba(255,255,255,.035) 34%,
                    rgba(255,255,255,.012) 62%, rgba(255,255,255,.05) 100%),
    rgba(22,22,27,.60);
  padding: 4px 0;
}
.rail-sec { padding: 14px 16px; border-bottom: 1px solid var(--border-2); }
.rail-sec:last-of-type { border-bottom: 0; }
.rail-sec-title {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .09em;
  color: var(--text-3); margin-bottom: 9px;
}
.rail-decide { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rail-decide .btn { width: 100%; justify-content: center; }
.rail-status { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--text); }
.rail-note-line { font-size: 12.5px; color: var(--text-3); }
.rail-sec form { margin: 0; }
.rail-sec select { width: 100%; }
.rail-note { min-height: 74px; resize: vertical; font-size: 13px; }

.rail-action {
  display: block; width: 100%; text-align: left; margin-bottom: 6px;
  padding: 9px 11px; border-radius: var(--radius-sm);
  background: rgba(255,255,255,.05); border: 1px solid var(--border);
  color: var(--text-2); font-size: 12.5px; font-family: inherit; cursor: pointer;
}
.rail-action:hover { background: rgba(255,255,255,.09); color: var(--text); }
.rail-action.is-danger { color: var(--danger-fg); border-color: rgba(242,85,106,.28); }
.rail-action.is-danger:hover { background: var(--danger-soft); }

.rail-more { border-top: 1px solid var(--border-2); }
.rail-more > summary {
  list-style: none; cursor: pointer; padding: 11px 16px;
  font-size: 11.5px; color: var(--text-3);
}
.rail-more > summary::-webkit-details-marker { display: none; }
.rail-more > summary::marker { content: ""; }
.rail-more > summary::before { content: "▸ "; }
.rail-more[open] > summary::before { content: "▾ "; }
.rail-more > summary:hover { color: var(--text-2); }
.rail-more-body { padding: 0 16px 14px; }

@media (max-width: 1100px) {
  .cand-layout { grid-template-columns: 1fr; }
  .cand-rail { position: static; }
}

/* Company facts: one line per real fact, not six label/value rows. Address and
   Location were saying the same thing; employees + revenue are one thought. */
.co-facts { display: flex; flex-direction: column; gap: 9px; }
.co-fact { display: flex; align-items: flex-start; gap: 9px; min-width: 0; }
.co-fact .co-ic { flex: 0 0 auto; width: 15px; text-align: center; color: var(--text-3); font-size: 12px; line-height: 1.5; }
.co-fact > span:last-child, .co-fact > a { min-width: 0; overflow-wrap: anywhere; }
.co-firm { color: var(--text-2); }

/* "Why this person" — the scores were a meta line in a card header. They are
   the reason the outreach exists, so they lead the page. */
.why-scores { display: flex; align-items: flex-end; gap: 26px; flex-wrap: wrap; margin-bottom: 14px; }
.why-score { min-width: 0; }
.why-score-wide { flex: 1 1 220px; }
.why-num { font-size: 32px; font-weight: 700; letter-spacing: -.03em; line-height: 1; color: var(--text); }
.why-lbl { font-size: 11.5px; color: var(--text-3); margin-top: 6px; display: flex; align-items: center; gap: 8px; }
.why-bar { height: 7px; border-radius: 3px; background: rgba(255,255,255,.10); overflow: hidden; }
.why-bar > span { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.why-link { color: var(--text-3); text-decoration: underline; }
.why-link:hover { color: var(--accent); }
.why-rationale { margin: 0; font-size: 14px; line-height: 1.65; color: var(--text-2); }

/* Stage strip: how far through the pipeline this person is, always visible.
   Completed steps are filled and connected; the rest are hollow. */
.stage-strip { display: flex; list-style: none; margin: 0 0 14px; padding: 0; flex-wrap: wrap; gap: 0; }
.stage-step {
  position: relative; flex: 1 1 0; min-width: 92px;
  padding: 0 6px 0 0; display: flex; flex-direction: column; gap: 4px;
}
.stage-step .stage-dot {
  width: 11px; height: 11px; border-radius: 50%; flex: 0 0 auto;
  background: transparent; border: 2px solid rgba(255,255,255,.18);
}
.stage-step.is-done .stage-dot { background: var(--accent); border-color: var(--accent); }
/* Connector runs from each dot to the next. */
.stage-step::before {
  content: ""; position: absolute; left: 11px; top: 5px; right: 0; height: 2px;
  background: rgba(255,255,255,.12);
}
.stage-step:last-child::before { display: none; }
.stage-step.is-done::before { background: var(--accent); opacity: .55; }
.stage-name { font-size: 11.5px; font-weight: 600; color: var(--text-3); }
.stage-step.is-done .stage-name { color: var(--text); }
.stage-when { font-size: 10.5px; color: var(--text-3); }
@media (max-width: 620px) { .stage-step { min-width: 78px; } }

/* ---- Scrollbars ----------------------------------------------------------
   The OS default is a chunky light-grey bar that looks pasted onto a dark UI. */
* { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.18) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.16);
  border-radius: 99px;
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.30); background-clip: content-box; }
::-webkit-scrollbar-corner { background: transparent; }

/* Icon inside a button — sized to the label, never a stray block. */
.btn-ic { display: inline-flex; align-items: center; margin-right: 6px; flex: 0 0 auto; }
.btn-ic svg { width: 14px; height: 14px; display: block; }

/* ---- Candidate drawer ---------------------------------------------------- */
/* The drawer carries the ENTIRE candidate view — two columns and all tabs — so
   it takes essentially the whole viewport. The earlier 1180px cap squeezed a
   two-column layout into roughly half the screen for no reason. */
/* SPECIFICITY: `.drawer.drawer-side` is 0,2,0 and sets width:min(400px,100vw).
   A bare `.cand-drawer` (0,1,0) lost that fight silently, which is why the
   drawer stayed narrow no matter what value was set here. */
.drawer.drawer-side.cand-drawer { width: 94vw; max-width: 1200px; }
.cand-drawer .cand-layout { grid-template-columns: minmax(0,1fr) 272px; gap: 24px; }
@media (max-width: 1100px) { .cand-drawer .cand-layout { grid-template-columns: 1fr; } }

/* Recent notes in the rail, under the quick-note box. */
.rail-notes { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.rail-note-item { padding: 8px 10px; border-radius: var(--radius-sm); background: rgba(255,255,255,.04); }
.rail-note-body { font-size: 12.5px; color: var(--text-2); line-height: 1.5; }
.rail-note-meta { font-size: 10.5px; color: var(--text-3); margin-top: 4px; }
.cd-loading { padding: 28px 4px; color: var(--text-3); font-size: 13px; }
.cd-head { display: flex; align-items: center; gap: 13px; margin-bottom: 14px; }
.cd-name { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -.02em; color: var(--text); }
.cd-sub { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-top: 3px; font-size: 13px; color: var(--text-2); }
.cd-sub .sep { color: var(--text-3); }
.cd-status { display: flex; align-items: center; gap: 9px; margin-bottom: 14px; }
.cd-status-label { font-size: 14.5px; font-weight: 600; color: var(--text); }
.cd-decide { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 18px; }
.cd-decide .btn { width: 100%; justify-content: center; }
.cd-warn {
  font-size: 12.5px; color: var(--danger-fg); background: var(--danger-soft);
  border: 1px solid rgba(242,85,106,.26); border-radius: var(--radius-sm);
  padding: 9px 12px; margin-bottom: 18px;
}
.cd-sec { padding: 14px 0; border-top: 1px solid var(--border-2); }
.cd-sec-title {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .09em;
  color: var(--text-3); margin-bottom: 10px;
}
.cd-contact { padding: 8px 0; }
.cd-contact + .cd-contact { border-top: 1px dashed var(--border-2); }
.cd-contact-name { font-size: 13.5px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.cd-foot { padding-top: 16px; border-top: 1px solid var(--border-2); margin-top: 4px; }

/* Tighter icon/label gap, and a calmer green that matches the desaturated
   status fills rather than shouting next to them. */
.btn-ic { margin-right: 4px; }
.btn-success {
  background: rgba(26,169,113,.20); border-color: rgba(26,169,113,.42); color: #7fcfae;
  box-shadow: none;
}
.btn-success:hover { background: rgba(26,169,113,.30); border-color: rgba(26,169,113,.55); color: #9fe0c4; }

/* ---- Stat band: one segmented strip, not a row of floating cards ---------
   Every cell is a reading of the same window, so they share one surface with
   hairline dividers instead of each carrying its own border and shadow. */
.stat-band {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-1); overflow: hidden;
}
.stat-cell { padding: 16px 18px; min-width: 0; border-right: 1px solid var(--border-2); }
.stat-cell:last-child { border-right: 0; }
.stat-num {
  font-size: 24px; font-weight: 700; letter-spacing: -.025em; line-height: 1.1; color: var(--text);
}
.stat-num.is-good { color: var(--success-fg); }
.stat-num.is-warn { color: var(--warning-fg); }
.stat-num.is-bad  { color: var(--danger-fg); }
.stat-lbl { font-size: 11.5px; color: var(--text-3); margin-top: 5px; }
@media (max-width: 1000px) {
  .stat-band { grid-auto-flow: row; grid-template-columns: 1fr 1fr; grid-auto-columns: auto; }
  .stat-cell:nth-child(2n) { border-right: 0; }
  .stat-cell { border-bottom: 1px solid var(--border-2); }
}
@media (max-width: 560px) {
  .stat-band { grid-template-columns: 1fr; }
  .stat-cell { border-right: 0; }
}

/* Reusable segmented control for range pickers — the old version was three
   loose buttons where the active one was a solid orange block. */
.seg {
  display: inline-flex; gap: 2px; padding: 3px;
  background: rgba(0,0,0,.28); border: 1px solid var(--border); border-radius: 6px;
}
.seg-opt {
  padding: 5px 12px; border-radius: 4px; text-decoration: none;
  font-size: 12px; font-weight: 600; color: var(--text-3);
  border: 1px solid transparent; white-space: nowrap;
  transition: background .13s, color .13s, border-color .13s;
}
.seg-opt:hover { color: var(--text-2); background: rgba(255,255,255,.05); }
.seg-opt.is-on {
  background: rgba(255,255,255,.09); border-color: rgba(255,255,255,.13); color: var(--text);
}

/* Person channels: always list every channel. A missing one is shown struck
   through rather than omitted — an absent row is indistinguishable from a
   row that has not loaded. */
.pc-links { display: flex; flex-direction: column; gap: 5px; margin-top: 7px; }
.pc-line { display: flex; align-items: center; gap: 7px; font-size: 12.5px; min-width: 0; }
.pc-ic { flex: 0 0 auto; width: 14px; text-align: center; color: var(--text-3); font-size: 11px; }
.pc-line.is-missing .pc-ic { opacity: .4; }
.pc-none { color: var(--text-3); font-style: italic; }
.pc-tag {
  font-size: 9.5px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-3); background: rgba(255,255,255,.06);
  padding: 1px 5px; border-radius: 3px;
}

/* Send-email button in the rail — the primary thing you do from here. */
.rail-send {
  display: block; width: 100%; text-align: left; cursor: pointer;
  padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--accent-soft); border: 1px solid rgba(255,91,31,.34);
  color: var(--text); font-family: inherit;
}
.rail-send:hover { background: rgba(255,91,31,.22); border-color: rgba(255,91,31,.48); }
.rail-send-title { display: block; font-size: 13px; font-weight: 600; }
.rail-send-sub { display: block; font-size: 11px; color: var(--text-3); margin-top: 2px; }

.tok-prefix { color: var(--text-2); }
.tok-hint {
  margin-left: 6px; font-size: 10px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-3); background: rgba(255,255,255,.06);
  padding: 1px 5px; border-radius: 3px; cursor: help;
}

/* Selects should look like selects: real chevron, and enough right padding
   that a long value never runs under it. */
.rail-sec select, .cand-rail select { padding-right: 34px; }

/* The save button appears once there is something to save. */
.rail-note-save { display: none; }
.rail-note-save.is-on { display: flex; }

/* Rail matches the height of the content beside it. */
.cand-layout { align-items: start; }
.cand-rail { display: block; }
/* Each rail section is its own card — one tall wrapper made unrelated controls
   look like a single form. */
.rail-card { padding: 14px 16px; }
.rail-card .rail-sec { padding: 0; border: 0; }

/* Current step: the stage plus the one action that moves it. */
.rail-step { background: rgba(255,255,255,.035); }
.rail-step-now {
  display: flex; align-items: center; gap: 9px; margin-bottom: 10px;
  font-size: 15px; font-weight: 600; color: var(--text);
}

/* Fit card — one big number, the supporting readings beside it. */
.fit-card { padding: 16px 18px; }
.fit-scores { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.fit-main { flex: 0 0 auto; }
.fit-num { font-size: 40px; font-weight: 700; letter-spacing: -.035em; line-height: 1; color: var(--text); }
.fit-lbl { font-size: 11.5px; color: var(--text-3); margin-top: 5px; }
.fit-side { flex: 1 1 220px; min-width: 180px; }
.fit-row { display: flex; justify-content: space-between; font-size: 12.5px; padding: 3px 0; }
.fit-k { color: var(--text-3); }
.fit-v { color: var(--text); font-weight: 600; }
.fit-bar { height: 6px; border-radius: 3px; background: rgba(255,255,255,.10); overflow: hidden; margin-top: 8px; }
.fit-bar > span { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.fit-rat { margin: 14px 0 0; font-size: 13.5px; line-height: 1.6; color: var(--text-2); }

/* Conversation empty state: the panel used to render as blank space, which
   reads as broken rather than "nothing here yet". */
.conv-empty {
  padding: 40px 24px; text-align: center; color: var(--text-3);
  border: 1px dashed var(--border); border-radius: var(--radius);
  background: rgba(255,255,255,.02);
}
.conv-empty .conv-empty-title { font-size: 14px; font-weight: 600; color: var(--text-2); margin-bottom: 5px; }

/* Company & people reads brighter than the rest of the drawer — it is the
   substance of the page, so it gets more of the sheen. */
.cand-drawer .fit-card { background: var(--glass-sheen), rgba(255,255,255,.075); }

/* ── Next steps: three reachability states ──────────────────────────────────
   The rail's job is to answer "can I move this person forward, and how". That
   answer is not binary: a SalesIntel address is safe to send to, a scraped one
   is a guess worth reading first, and no address at all is a dead end. Showing
   the same neutral button for all three let people fire off mail to addresses
   nobody had ever verified. */
.rail-step-go {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
}
.rail-step-ready { font-size: 13px; color: var(--text-2); }

.rail-alert {
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 12.5px;
  line-height: 1.5;
  margin-bottom: 12px;
  border: 1px solid transparent;
}
.rail-alert strong { display: block; margin-bottom: 2px; font-size: 12.5px; }
.rail-alert.is-warn {
  background: rgba(214,158,46,.13);
  border-color: rgba(214,158,46,.38);
  color: #e8c37a;
}
.rail-alert.is-warn strong { color: #f0cf8e; }
.rail-alert.is-blocked {
  background: rgba(214,69,69,.13);
  border-color: rgba(214,69,69,.40);
  color: #eda0a0;
}
.rail-alert.is-blocked strong { color: #f2b4b4; }

/* Blocked send stays visible rather than disappearing — the absence of a
   button reads as a rendering bug, a greyed one reads as a rule. */
.rail-send.is-disabled,
.rail-send[disabled] {
  background: rgba(255,255,255,.04);
  border-color: var(--border-2);
  color: var(--text-3);
  cursor: not-allowed;
  opacity: .65;
}
.rail-send.is-disabled:hover,
.rail-send[disabled]:hover {
  background: rgba(255,255,255,.04);
  border-color: var(--border-2);
}

/* ── Fit card: score, readings, and the person they describe ───────────────
   The score used to float alone above an unrelated Company card, so "82" never
   said 82 for whom. The contact it judges now sits inside the same card. */
.fit-stat { }
.fit-side { display: flex; gap: 28px; flex: 1 1 auto; }
.fit-stat-v { font-size: 21px; font-weight: 650; color: var(--text); line-height: 1.1; }
.fit-stat-of { font-size: 12px; font-weight: 500; color: var(--text-3); margin-left: 3px; }
.fit-stat-k { font-size: 11.5px; color: var(--text-3); margin-top: 4px; }

.fit-who {
  margin-top: 16px; padding-top: 15px;
  border-top: 1px solid var(--border-2);
}
.fit-who-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; margin-bottom: 10px;
}
.fit-who-name { font-size: 16px; font-weight: 650; color: var(--text); }
.fit-who-title { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.fit-who-tags { display: flex; gap: 5px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.fit-who-tags .pill { font-size: 10px; white-space: nowrap; }
.fit-who-lines { display: flex; flex-wrap: wrap; gap: 6px 26px; }
.fit-who-lines .pc-line { font-size: 13px; }

/* Rail: one card for "who owns this and where is it going", one for the ways
   it leaves the pipeline. Sections inside a card are separated by a rule, not
   by being separate cards — a column of one-control boxes read as clutter. */
.rail-manage .rail-sec-title.mt-3 {
  margin-top: 16px; padding-top: 14px;
  border-top: 1px solid var(--border-2);
}
.rail-more-body { display: flex; flex-direction: column; gap: 7px; }
.rail-more-body form { margin: 0; }
.rail-action {
  display: block; width: 100%; text-align: left;
  padding: 9px 11px; font-size: 12.5px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border-2); border-radius: var(--radius-sm);
  color: var(--text-2); cursor: pointer;
}
.rail-action:hover { background: rgba(255,255,255,.08); color: var(--text); }
.rail-action.is-danger { color: #eda0a0; border-color: rgba(214,69,69,.30); }
.rail-action.is-danger:hover { background: rgba(214,69,69,.14); border-color: rgba(214,69,69,.45); }

/* ── Send email drawer ─────────────────────────────────────────────────────
   It opens from inside the candidate drawer, so it has to clear it — a modal
   that renders behind the thing that opened it reads as "the button is broken",
   which is exactly how this was reported. */
.drawer-email + .drawer-backdrop, .drawer-backdrop.is-top { z-index: 210; }

.drawer-x {
  background: none; border: 0; cursor: pointer;
  font-size: 24px; line-height: 1; padding: 0 4px;
  color: var(--text-3); flex-shrink: 0;
}
.drawer-x:hover { color: var(--text); }

.em-form { display: flex; flex-direction: column; min-height: 0; flex: 1; }

/* To and Subject read as mail headers, not as a form to fill in. */
.em-head { border-bottom: 1px solid var(--border); }
.em-row {
  display: flex; align-items: center; gap: 10px;
  padding: 0 20px; height: 44px;
  border-bottom: 1px solid var(--border-2);
}
.em-row:last-child { border-bottom: 0; }
.em-lbl {
  flex: 0 0 58px; font-size: 12px; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .04em;
}
.em-in {
  flex: 1; min-width: 0; height: 100%;
  background: none; border: 0; outline: none; box-shadow: none;
  color: var(--text); font-size: 14px;
}
.em-in:focus { background: none; border: 0; box-shadow: none; }

.em-body { flex: 1; min-height: 0; display: flex; }
.em-text {
  flex: 1; width: 100%; resize: none;
  background: none; border: 0; outline: none; box-shadow: none;
  border-radius: 0;
  padding: 18px 20px; font-size: 14px; line-height: 1.65; color: var(--text);
  font-family: inherit;
}
.em-text:focus { background: none; border: 0; box-shadow: none; }

.em-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  padding: 12px 20px; border-top: 1px solid var(--border);
}
.em-foot-left, .em-foot-right { display: flex; align-items: center; gap: 8px; }

/* The one-line email form in the rail's blocked/unverified notices. */
.rail-email-form { display: flex; gap: 6px; margin-top: 2px; }
.rail-email-form .input { flex: 1; min-width: 0; }

/* ── Candidate drawer head ─────────────────────────────────────────────────
   There is no header row any more. A "Candidate" label above a card that opens
   with the person's full name said the same thing twice, and "Full page" led to
   a second copy of what you were already reading. What is left is the close
   control, floated over the top-right corner of the scrolling body. */
.cand-drawer .cd-close {
  position: absolute; top: 16px; right: 20px; z-index: 3;
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--border-2); border-radius: var(--radius-sm);
  color: var(--text-2); font-size: 13px; cursor: pointer;
}
.cand-drawer .cd-close:hover { background: rgba(255,255,255,.12); color: var(--text); }

/* Room above the name so it does not start hard against the drawer edge, and
   enough right padding on the first row that it clears the close button. */
.cand-drawer .drawer-body { padding: 34px 26px 34px; }
.cand-drawer .drawer-body > .crumbs { padding-right: 44px; }
.cand-drawer .cand-topbar { padding-right: 46px; }

/* ── Shared list header ────────────────────────────────────────────────────
   Title on the left, every filter grouped hard right in one row. The markup
   shipped before these rules did, so the filters were rendering as a raw
   left-aligned pile immediately after the heading. */
.list-head { flex-wrap: nowrap; gap: 12px; }
.list-head h3 {
  display: flex; align-items: center; gap: 7px;
  white-space: nowrap; flex: 0 0 auto;
}
.list-head .hd-count {
  font-size: 11.5px; font-weight: 600; color: var(--text-3);
  background: rgba(255,255,255,.07);
  border-radius: 20px; padding: 2px 8px;
}
.list-filters {
  margin-left: auto;
  display: flex; align-items: center; justify-content: flex-end;
  gap: 7px; flex-wrap: nowrap; min-width: 0;
}
/* One height, predictable widths — filters that each sized themselves read as
   a row of mismatched boxes. */
.list-filters .input,
.list-filters select,
.list-filters input[type="search"] { min-height: var(--ctl-h-sm); box-sizing: border-box; }
.list-filters select { width: auto; min-width: 118px; max-width: 168px; }
.list-filters .lf-search { width: 210px; }
.list-filters .search-wrap { flex: 0 1 210px; min-width: 130px; }
.list-filters .search-wrap > input { width: 100%; }

@media (max-width: 900px) {
  .list-head { flex-wrap: wrap; }
  .list-filters { width: 100%; flex-wrap: wrap; justify-content: flex-start; }
  .list-filters .search-wrap { flex: 1 1 100%; }
  .list-filters .lf-search { width: 100%; }
}

/* ── Fit dial ──────────────────────────────────────────────────────────────
   A bare "82" never showed what it was 82 out of. The ring draws the score
   against the 100 it is measured on, and the two supporting readings sit to its
   right instead of stacked underneath. */
.fit-scores { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.fit-dial { position: relative; flex: 0 0 auto; width: 96px; height: 96px; }
.fit-dial svg { width: 100%; height: 100%; display: block; }
.fit-dial-track { fill: none; stroke: rgba(255,255,255,.09); stroke-width: 7; }
.fit-dial-arc {
  fill: none; stroke-width: 7; stroke-linecap: round;
  stroke: var(--accent);
  transition: stroke-dasharray .5s ease;
}
.fit-dial.is-strong .fit-dial-arc { stroke: var(--success); }
.fit-dial.is-good   .fit-dial-arc { stroke: var(--accent); }
.fit-dial.is-weak   .fit-dial-arc { stroke: #d69e2e; }
.fit-dial.is-none   .fit-dial-arc { stroke: transparent; }
.fit-dial-mid {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.fit-dial-mid .fit-num {
  font-size: 27px; font-weight: 700; letter-spacing: -.03em; line-height: 1;
  color: var(--text);
}
.fit-dial-mid .fit-lbl { font-size: 9.5px; color: var(--text-3); margin-top: 3px; letter-spacing: .03em; }

.fit-side { display: flex; gap: 30px; flex: 1 1 auto; }

/* ── Contact lines are the edit affordance ────────────────────────────────
   Editing a contact detail belongs on the detail, not in a form somewhere else
   on the page — the rail's copy of it sat directly above Send and read as part
   of it. */
.pc-edit {
  display: inline-flex; align-items: center; gap: 7px;
  background: none; border: 0; border-radius: var(--radius-sm);
  padding: 5px 8px; margin: -5px -8px;
  font: inherit; font-size: 13px; color: var(--text-2);
  cursor: pointer; text-align: left; max-width: 100%;
}
.pc-edit:hover { background: rgba(255,255,255,.07); color: var(--text); }
.pc-edit .pc-val { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-edit .pc-none { color: var(--text-3); font-style: italic; }
.pc-edit .pc-pen { opacity: 0; font-size: 11px; color: var(--text-3); flex-shrink: 0; }
.pc-edit:hover .pc-pen { opacity: 1; }
.pc-edit.is-missing .pc-ic { opacity: .45; }

/* ── One-field editor ─────────────────────────────────────────────────────── */
.cf-form { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; margin: 0; }
.cf-body { padding: 18px 20px; }
.cf-body .input { width: 100%; }
.cf-foot {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 12px 20px; border-top: 1px solid var(--border);
}

/* ── History is a record, not a control panel ─────────────────────────────── */
.eng-tlv-date { margin-left: auto; font-size: 11.5px; color: var(--text-3); white-space: nowrap; }
.eng-tlv-head { display: flex; align-items: baseline; gap: 10px; }
.eng-tlv-sub { margin-top: 3px; font-size: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.eng-submark { font-size: 11.5px; }
.eng-submark.ok  { color: var(--success); }
.eng-submark.hot { color: var(--accent); }
.eng-submark.bad { color: #eda0a0; }

/* Terminal actions sit at the foot of the rail, deliberately quiet: recessed
   rather than a stack of full-width buttons shouting for the same attention as
   Send. */
.rail-terminal { background: rgba(0,0,0,.16); }
.rail-terminal .rail-sec-title { color: var(--text-3); }
.rail-terminal .rail-action {
  background: none; border-color: transparent;
  padding: 7px 9px; color: var(--text-3);
}
.rail-terminal .rail-action:hover {
  background: rgba(255,255,255,.06); border-color: var(--border-2); color: var(--text-2);
}
.rail-terminal .rail-action.is-danger { color: var(--text-3); }
.rail-terminal .rail-action.is-danger:hover {
  background: rgba(214,69,69,.12); border-color: rgba(214,69,69,.34); color: #eda0a0;
}

/* ── Email composer as a pane, not a second modal ──────────────────────────
   Opening a centred dialog on top of a side drawer stacked two overlays with
   two different geometries — you lost track of what you were even looking at.
   The composer slides in over the record and Back returns you to it.

   These are `fixed` with the drawer's own geometry rather than `absolute`
   inside it. Absolute made the pane's box depend on which ancestor happened to
   be positioned and on .drawer-body's `overflow: auto` — so when the pane was
   still nested in the scrolling body it was clipped on the right and widened
   the scroll area, shoving the record sideways. Fixed + explicit geometry has
   no such dependency: it renders the same whether the pane sits in the drawer,
   in the drawer body, or on the standalone candidate page. */
.drawer.drawer-email,
.drawer.drawer-cf,
.drawer.drawer-preview {
  position: fixed;
  top: 0; bottom: 0; right: 0; left: auto;
  width: 94vw; max-width: 1200px; height: 100%; max-height: none;
  margin: 0;
  transform: translateX(100%);
  transition: transform .26s cubic-bezier(.32,.72,0,1);
  border: 0; border-left: 1px solid var(--border); border-radius: 0;
  backdrop-filter: none; -webkit-backdrop-filter: none;
  background: var(--surface);
  display: flex; flex-direction: column;
  overflow: hidden;
  z-index: 220;
}
.drawer.drawer-cf { max-width: 480px; z-index: 240; }
.drawer.drawer-preview { z-index: 230; }

.drawer.drawer-email.open,
.drawer.drawer-cf.open,
.drawer.drawer-preview.open { transform: translateX(0); }

/* Each pane owns its own padding — inheriting .cand-drawer .drawer-body's
   34px/26px pushed the fields past the right edge. */
.drawer.drawer-email > .drawer-head,
.drawer.drawer-cf > .drawer-head,
.drawer.drawer-preview > .drawer-head,
.drawer.drawer-email > form > .drawer-head,
.drawer.drawer-cf > form > .drawer-head {
  align-items: center; padding: 16px 20px 14px; flex-shrink: 0;
}

.em-back {
  display: inline-flex; align-items: center; gap: 5px;
  background: none; border: 0; cursor: pointer; padding: 4px 8px 4px 0;
  color: var(--text-3); font: inherit; font-size: 13px;
}
.em-back:hover { color: var(--text); }
.em-back svg { width: 15px; height: 15px; }

@media (prefers-reduced-motion: reduce) {
  .drawer.drawer-email,
  .drawer.drawer-cf,
  .drawer.drawer-preview { transition: none; }
}

/* Emails log: expanding a row shows what we sent, read as an email rather than
   re-presented as a form. Editing lives in the candidate drawer. */
.em-expand { padding: 0 18px 18px; border-bottom: 1px solid var(--border-2); }
.em-read-subject {
  font-size: 14px; font-weight: 600; color: var(--text);
  padding: 12px 0 10px; border-bottom: 1px solid var(--border-2);
}
.em-read-body {
  padding: 14px 0; font-size: 13.5px; line-height: 1.65; color: var(--text-2);
  max-height: 340px; overflow-y: auto;
}
.em-read-foot { display: flex; justify-content: flex-end; }

/* ── Next steps carries the status's actions ───────────────────────────────
   Invite and Reject used to sit in the page header, far from the status that
   decides whether they even apply. They belong with the step. */

.rail-step-go { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rail-step-go .btn { flex: 1 1 auto; justify-content: center; }
.rail-reject {
  background: none; border: 0; padding: 6px 4px;
  font: inherit; font-size: 12.5px; color: var(--text-3);
  cursor: pointer; flex: 0 0 auto;
}
.rail-reject:hover { color: #eda0a0; text-decoration: underline; }

/* Two rare state changes, as a footer rather than a card of buttons. */
.rail-footer {
  display: flex; flex-wrap: wrap; gap: 4px 14px;
  padding: 14px 4px 0; margin-top: 4px;
  border-top: 1px solid var(--border-2);
}
.rail-footer form { margin: 0; }
.rail-quiet {
  background: none; border: 0; padding: 2px 0;
  font: inherit; font-size: 12px; color: var(--text-3);
  cursor: pointer; text-decoration: underline; text-decoration-color: transparent;
}
.rail-quiet:hover { color: var(--text-2); text-decoration-color: currentColor; }
.rail-quiet.is-danger:hover { color: #eda0a0; }

/* ── Timeline: done is a check, and every event carries its time ─────────── */
.eng-tlv-row .eng-tlv-dot.is-done {
  background: var(--success); color: #fff;
  border: 0; font-size: 12px; font-weight: 700;
}
.eng-tlv-subject {
  margin-top: 3px; font-size: 13px; color: var(--text-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ── Contact lines belong to the person, not the whitespace ──────────────── */
.fit-who-lines {
  display: flex; flex-direction: column; gap: 1px;
  margin-top: 12px; padding: 4px 0 0;
  border-top: 1px solid var(--border-2);
}
.fit-who-lines .pc-edit {
  display: grid; grid-template-columns: 18px minmax(0,1fr) auto;
  align-items: center; gap: 10px;
  width: 100%; margin: 0; padding: 8px 10px;
  border-radius: var(--radius-sm);
}
.fit-who-lines .pc-ic {
  width: 18px; text-align: center; color: var(--text-3);
  font-size: 13px; font-style: normal;
}

/* ── Long rationales clamp to three lines ────────────────────────────────── */
.fit-rat { margin: 14px 0 0; }
.fit-rat-text {
  margin: 0; font-size: 13.5px; line-height: 1.6; color: var(--text-2);
}
.fit-rat.is-clamped .fit-rat-text {
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden;
}
.fit-rat-more {
  background: none; border: 0; padding: 5px 0 0;
  font: inherit; font-size: 12.5px; font-weight: 600; color: var(--accent);
  cursor: pointer;
}
.fit-rat-more:hover { text-decoration: underline; }

/* Panes are hoisted to be direct children of the drawer, so their own head and
   footer own their padding — they must not inherit .cand-drawer .drawer-body's
   34px/26px, which pushed content past the right edge. */
.drawer-email .em-head, .drawer-email .em-foot { flex-shrink: 0; }
.drawer-email .em-body { flex: 1 1 auto; min-height: 0; }
.drawer-email .em-text { overflow: auto; }
.drawer-cf .cf-body { flex: 1 1 auto; }
.drawer-preview .drawer-body { padding: 0; }

/* ── Users: reference on the left, the roster on the right ─────────────────
   The create form used to occupy the top of the page permanently — a form for
   something done once a quarter, above the thing you actually came to read. */
.users-layout {
  display: grid; grid-template-columns: 272px minmax(0, 1fr);
  gap: 20px; align-items: stretch;   /* roles column matches the roster's height */
}
.users-side { display: flex; }
.users-side > .card { flex: 1 1 auto; }
/* Same lighter, lit-from-above panel the drawer rail uses, so a reference
   column reads as a different KIND of surface from the data table beside it. */
.roles-card {
  background:
    linear-gradient(150deg, rgba(255,255,255,.13) 0%, rgba(255,255,255,.035) 34%,
                    rgba(255,255,255,.012) 62%, rgba(255,255,255,.05) 100%),
    rgba(22,22,27,.60);
}
.role-cant { display: block; margin-top: 4px; color: var(--text-3); opacity: .8; }
@media (max-width: 1000px) { .users-layout { grid-template-columns: 1fr; } }

.role-def + .role-def { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border-2); }
.role-name { margin-bottom: 5px; }
.role-copy { margin: 0; font-size: 12.5px; line-height: 1.55; color: var(--text-3); }

.ability-list { margin: 0; font-size: 12.5px; }
.ability-list dt { font-weight: 600; color: var(--text-2); margin-top: 10px; }
.ability-list dt:first-child { margin-top: 0; }
.ability-list dd { margin: 3px 0 0; color: var(--text-3); line-height: 1.5; }

/* Icon-only row actions. Two full text buttons per row made every row look
   like it was asking to be disabled or deleted. */
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; padding: 0;
  background: none; border: 1px solid transparent; border-radius: var(--radius-sm);
  color: var(--text-3); cursor: pointer;
}
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn:hover { background: rgba(255,255,255,.08); color: var(--text); border-color: var(--border-2); }
.icon-btn.is-danger:hover { background: rgba(214,69,69,.14); color: #eda0a0; border-color: rgba(214,69,69,.38); }

/* ── Waiting on you: each queue is a card row you can walk into ────────────
   The four KPI tiles and this list were two renderings of the same question,
   stacked one above the other. This is the surviving one, so its rows have to
   carry the tiles' weight: icon, count, what it means, and a way in. */
.attn-list { gap: 8px; padding: 10px; }
.attn-row {
  gap: 14px; padding: 14px 14px;
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border-2);
}
a.attn-row:hover {
  background: rgba(255,255,255,.07);
  border-color: var(--border);
}
.attn-ic {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.07); color: var(--text-2);
}
.attn-ic svg { width: 17px; height: 17px; }
.attn-num { min-width: 38px; font-size: 24px; }
/* An empty queue is good news, so it should read as settled, not as a zero
   shouting for attention alongside the ones that do need work. */
.attn-row.is-clear { opacity: .58; }
.attn-row.is-clear .attn-num { color: var(--text-3); font-weight: 600; }
a.attn-row.is-clear:hover { opacity: 1; }

/* ── Header quick action ───────────────────────────────────────────────────
   Adding someone by hand used to exist only on Home and /today, so from the
   pipeline you had to navigate away to do it. */
.topbar-add {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; padding: 0;
  background: none; border: 1px solid transparent; border-radius: var(--radius-sm);
  color: var(--text-2); cursor: pointer;
}
.topbar-add .ico { width: 18px; height: 18px; }
.topbar-add:hover { background: rgba(255,255,255,.08); color: var(--text); border-color: var(--border-2); }

/* Find people — deliberately understated (matches the outlined top-bar
   buttons); a small green icon cue signals a positive action without shouting. */
.topbar-start {
  display: inline-flex; align-items: center; gap: 7px;
  height: 34px; padding: 0 11px;
  background: none; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font: inherit; font-size: 13px; font-weight: 500;
  color: var(--text-2); cursor: pointer;
}
.topbar-start svg { flex: 0 0 auto; color: #16a34a; }
.topbar-start:hover { background: rgba(255,255,255,.08); color: var(--text); border-color: var(--border-2); }
@media (max-width: 640px) { .topbar-start .topbar-start-label { display: none; } .topbar-start { padding: 0; width: 34px; justify-content: center; } }

/* Running state: swap the play glyph for a circular loader. */
.topbar-start-spin { display: none; }
.topbar-start.loading .topbar-start-play { display: none; }
.topbar-start.loading .topbar-start-spin {
  display: inline-block; width: 15px; height: 15px; flex: 0 0 auto;
  border: 2px solid var(--border-2, rgba(255,255,255,.25)); border-top-color: #16a34a;
  border-radius: 50%; animation: spin 0.7s linear infinite;
}
.topbar-start.loading { color: var(--text); cursor: pointer; }
.spin-sm {
  display: inline-block; width: 18px; height: 18px; flex: 0 0 auto;
  border: 2px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Discovery drawer bits */
.disc-tribes { display: flex; flex-wrap: wrap; gap: 6px; }
.disc-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border: 1px solid var(--border); border-radius: 999px;
  font-size: 12.5px; cursor: pointer; user-select: none; background: var(--surface);
}
.disc-chip input { margin: 0; }
.disc-chip:has(input:checked) { border-color: var(--accent); background: var(--accent-soft, rgba(59,130,246,.1)); color: var(--text); }
.disc-prog-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; gap: 8px; }
.disc-bar { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.disc-bar-fill { height: 100%; width: 0; background: var(--accent); border-radius: 999px; transition: width .4s ease; }
.disc-bar-fill.indet { width: 40% !important; animation: discIndet 1.1s ease-in-out infinite; }
@keyframes discIndet { 0% { margin-left: -40%; } 100% { margin-left: 100%; } }
.disc-live { color: var(--text-2); margin-top: 8px; }
.pill.warn { background: #fef3c7; color: #92400e; }

/* Live progress feed inside the "Find people" running panel */
.disc-feed {
  list-style: none; margin: 10px 0 0; padding: 10px 0 0; border-top: 1px solid var(--border);
  max-height: 220px; overflow-y: auto; font-size: 12.5px; line-height: 1.45;
}
.disc-feed li {
  position: relative; padding: 3px 0 3px 16px; color: var(--text-2);
}
.disc-feed li::before {
  content: ""; position: absolute; left: 3px; top: 10px;
  width: 5px; height: 5px; border-radius: 50%; background: var(--border);
}
.disc-feed li:last-child { color: var(--text); font-weight: 500; }
.disc-feed li:last-child::before { background: var(--accent); }
.disc-count {
  background: var(--accent-soft, rgba(59,130,246,.12)); color: var(--accent);
  padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap;
}

/* ── Quick links: where you go, above the work waiting for you ───────────
   One glass card holding four flat links, rather than four separate glass
   tiles — nested glass on glass was the doubled look, and four bordered boxes
   in a row competed with the "Waiting on you" cards directly below them. */
.ql-card { padding: 8px; }
.quick-links {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px;
}
@media (max-width: 900px) { .quick-links { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 520px) { .quick-links { grid-template-columns: 1fr; } }
.ql {
  display: flex; align-items: center; gap: 11px;
  padding: 12px 13px; border-radius: var(--radius-sm);
  background: none; border: 0;
  text-decoration: none; color: inherit; min-width: 0;
}
.ql:hover { background: rgba(255,255,255,.06); }
.ql-ic {
  flex: 0 0 auto; width: 32px; height: 32px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.07); color: var(--text-2);
}
.ql-ic svg { width: 16px; height: 16px; }
.ql:hover .ql-ic { background: rgba(255,91,31,.16); color: var(--accent); }
.ql-text { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.ql-label { font-size: 13.5px; font-weight: 600; color: var(--text); }
.ql-sub {
  font-size: 11.5px; color: var(--text-3); margin-top: 1px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ql-go { color: var(--text-3); font-size: 14px; flex-shrink: 0; opacity: 0; }
.ql:hover .ql-go { color: var(--accent); opacity: 1; }

/* ── Emails log rows ──────────────────────────────────────────────────── */
.em-head-row { cursor: pointer; }
.em-head-row:hover { background: rgba(255,255,255,.035); }
.em-toggle .em-toggle-close { display: none; }
.em-item.is-open .em-toggle .em-toggle-open { display: none; }
.em-item.is-open .em-toggle .em-toggle-close { display: inline; }
.em-read-meta {
  padding-top: 12px; font-size: 12px; color: var(--text-3);
}

/* ── Access pickers (users table) ───────────────────────────────
   Access used to occupy a second full-width row under every user, which doubled
   the table's height and buried the actual roster. It is two dropdowns in the
   user's own row now. Each one submits when it closes, so setting three tribes
   costs one reload rather than three. */
.ucell-access { white-space: nowrap; }
.acc-inline { display: inline-flex; gap: 6px; margin: 0; }
.mdd { position: relative; display: inline-block; }
.mdd-btn {
  display: inline-flex; align-items: baseline; gap: 5px;
  padding: 4px 9px; border-radius: var(--radius-sm); cursor: pointer;
  background: rgba(255,255,255,.04); border: 1px solid var(--border-2);
  font-size: 12px; color: var(--text-2); user-select: none; list-style: none;
  max-width: 190px;
}
.mdd-btn::-webkit-details-marker { display: none; }
.mdd-btn::after { content: 'be'; color: var(--text-3); font-size: 10px; margin-left: 2px; }
.mdd-btn:hover { border-color: var(--border); }
.mdd[open] > .mdd-btn { border-color: var(--accent); color: var(--text); }
.mdd-cap { color: var(--text-3); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.mdd-val { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mdd-pop {
  position: absolute; top: calc(100% + 4px); left: 0; z-index: 60;
  min-width: 190px; max-height: 260px; overflow-y: auto;
  padding: 5px; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: 0 10px 30px rgba(0,0,0,.45);
}
.mdd-opt {
  display: flex; align-items: center; gap: 7px; cursor: pointer;
  padding: 5px 8px; border-radius: var(--radius-sm);
  font-size: 12.5px; color: var(--text-2); white-space: nowrap;
}
.mdd-opt:hover { background: rgba(255,255,255,.06); }
.mdd-opt.is-all { border-bottom: 1px solid var(--border-2); margin-bottom: 3px; padding-bottom: 7px; }
/* "All" overrides the individual picks, so show them as moot rather than
   letting someone tick tribes that cannot take effect. */
.mdd-pop:has(.is-all input:checked) .mdd-opt:not(.is-all) { opacity: .4; }

/* ── Tribe hero ────────────────────────────────────────────────────────────
   The page used to open with a bare H1, a rename button, a stat line and four
   settings buttons before anything about the tribe itself. */
.tribe-hero { display: flex; gap: 20px; padding: 0; overflow: hidden; align-items: stretch; }
@media (max-width: 760px) { .tribe-hero { flex-direction: column; } }

.tribe-hero-img {
  position: relative; flex: 0 0 280px; max-width: 280px; align-self: flex-start;
  background-color: rgba(255,255,255,.05);
  border-radius: var(--radius); overflow: hidden;
}
/* The photo sizes the tile — whole image shown, never cropped, and no dead
   letterbox band because the box now follows the image's own height. */
.tribe-hero-photo { display: block; width: 100%; height: auto; }
@media (max-width: 760px) {
  .tribe-hero-img { flex: 0 0 auto; width: 100%; align-self: stretch; }
}
.tribe-hero-img.is-empty {
  aspect-ratio: var(--tribe-img-ratio);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3);
}
.tribe-hero-img.is-empty svg { width: 34px; height: 34px; }
.tribe-hero-upload { position: absolute; right: 10px; bottom: 10px; margin: 0; }
.tribe-img-btn {
  display: inline-block; cursor: pointer;
  padding: 5px 11px; border-radius: var(--radius-sm);
  background: rgba(10,10,12,.72); border: 1px solid var(--border);
  color: var(--text-2); font-size: 11.5px; font-weight: 600;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.tribe-img-btn:hover { background: rgba(10,10,12,.9); color: var(--text); }

.tribe-hero-body { flex: 1; min-width: 0; padding: 20px 22px; display: flex; flex-direction: column; }
.tribe-hero-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tribe-hero-sub { margin: 6px 0 12px; font-size: 13px; color: var(--text-3); }
.tribe-hero-bar {
  height: 5px; border-radius: 3px; background: rgba(255,255,255,.09);
  overflow: hidden; margin-bottom: 16px;
}
.tribe-hero-bar > span { display: block; height: 100%; background: var(--accent); border-radius: 3px; }

.tribe-hero-stats { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.ths {
  display: flex; flex-direction: column; gap: 2px;
  padding: 9px 14px; min-width: 82px;
  background: rgba(255,255,255,.045); border: 1px solid var(--border-2);
  border-radius: var(--radius-sm); text-align: left;
  color: inherit; font: inherit; cursor: default;
}
button.ths { cursor: pointer; }
button.ths:hover { background: rgba(255,255,255,.09); border-color: var(--border); }
.ths-v { font-size: 20px; font-weight: 700; letter-spacing: -.02em; color: var(--text); line-height: 1.1; }
.ths-l { font-size: 11px; color: var(--text-3); }
.ths.is-accent .ths-v { color: var(--accent); }

/* A tab whose content is configured gets a dot rather than a count. */
.tab-dot {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--success); margin-left: 6px; vertical-align: middle;
}

/* ── Tribe tiles carry their picture ─────────────────────────────────────── */
.tt-img {
  display: block; height: auto; aspect-ratio: var(--tribe-img-ratio);
  margin: -14px -16px 12px;
  background-size: cover; background-position: center;
  background-color: rgba(255,255,255,.05);
  border-radius: var(--radius) var(--radius) 0 0;
}
.tt-img.is-empty {
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; font-weight: 700; color: rgba(255,255,255,.16);
}

/* ── Roster & pipeline: who is in, and what still needs doing ─────────────── */
.tr-split { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.25fr); gap: 16px; align-items: start; }
@media (max-width: 1000px) { .tr-split { grid-template-columns: 1fr; } }
.tr-card { display: flex; flex-direction: column; }
.tr-list { max-height: 560px; overflow-y: auto; }
.tr-row {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px; border-bottom: 1px solid var(--border-2);
  text-decoration: none; color: inherit;
}
.tr-row:last-child { border-bottom: 0; }
a.tr-row:hover, .tr-row-wide:hover { background: rgba(255,255,255,.04); }
.tr-main { flex: 1; min-width: 0; text-decoration: none; color: inherit; }
.tr-name { font-size: 13.5px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-sub { font-size: 11.5px; color: var(--text-2); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-score { flex: 0 0 auto; }
.tr-when { flex: 0 0 auto; font-size: 11.5px; color: var(--text-3); }

/* "Still in play" is a table, not a list: person, role, contact, score, stage.
   Without columns you could not compare two rows, which is the only reason to
   look at this side of the split. */
.tr-grid {
  display: grid;
  grid-template-columns: minmax(0,1.15fr) minmax(0,.8fr) minmax(0,1.1fr) 58px 146px;
  gap: 10px; align-items: center;
  padding: 10px 16px; border-bottom: 1px solid var(--border-2);
}
.tr-grid-head {
  position: sticky; top: 0; z-index: 1;
  background: var(--surface-2);
  font-size: 10.5px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .04em; color: var(--text-2);
}
.tr-grid-row:hover { background: rgba(255,255,255,.04); }
.tr-grid .tr-main { text-decoration: none; color: inherit; min-width: 0; }
.tr-role, .tr-contact { min-width: 0; overflow: hidden; }
.tr-contact a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.tr-status { margin: 0; min-width: 0; }
.tr-status select { width: 100%; }

@media (max-width: 1240px) {
  /* Contact is the first thing to go: it is on the candidate record anyway. */
  .tr-grid { grid-template-columns: minmax(0,1.2fr) minmax(0,.9fr) 58px 140px; }
  .tr-grid > .tr-contact { display: none; }
  .tr-grid-head > div:nth-child(3) { display: none; }
}
@media (max-width: 720px) {
  .tr-grid { grid-template-columns: minmax(0,1fr) 58px; row-gap: 8px; }
  .tr-grid > .tr-role { display: none; }
  .tr-grid-head { display: none; }
  .tr-status { grid-column: 1 / -1; }
}

/* Shared score chip, used on People and the tribe roster. */
.score-chip {
  display: inline-block; min-width: 30px; text-align: center;
  padding: 2px 7px; border-radius: 20px;
  font-size: 11.5px; font-weight: 600;
}
.score-chip.is-strong { background: rgba(26,169,113,.15); color: #8fd9b6; }
.score-chip.is-good   { background: rgba(255,91,31,.15);  color: #ffb694; }
.score-chip.is-weak   { background: rgba(255,255,255,.07); color: var(--text-3); }


/* ── Pipeline rail (/pending) ──────────────────────────────────────────────
   The count leads each row in a box on the left — it is what you scan for, and
   right-aligned at the far edge it was separated from the label it belongs to.

   No spine, no coloured status dots. With real data only two rows ever carried
   colour, so the dots read as decoration; and once Replied and Registered moved
   to the list as columns there is no branching left for a spine to draw. */
.prail {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 4px 14px 8px;
}
.prail-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; padding: 10px 2px; border-bottom: 1px solid var(--border-2); margin-bottom: 4px;
}
.prail-title { font-size: 12px; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; }
.prail-total { font-size: 12px; color: var(--text-3); }

.prail-row {
  display: grid; grid-template-columns: 62px minmax(0, 1fr) auto;
  align-items: center; gap: 14px;
  padding: 8px 6px; border-radius: var(--radius-sm);
  text-decoration: none; color: var(--text-2);
}
.prail-row + .prail-row { border-top: 1px solid rgba(255,255,255,.045); }
.prail-row:hover { background: rgba(255,255,255,.05); }
.prail-row.is-on { background: rgba(255,91,31,.10); box-shadow: inset 0 0 0 1px rgba(255,91,31,.38); }

/* Tabular figures so the boxes stay the same width whatever the digits. */
.prail-num {
  display: flex; align-items: center; justify-content: center;
  min-height: 40px; padding: 4px 6px;
  border: 1px solid var(--border-2); border-radius: var(--radius-sm);
  background: rgba(255,255,255,.045);
  font-size: 18px; font-weight: 700; letter-spacing: -.02em;
  color: var(--text); font-variant-numeric: tabular-nums;
}
.prail-row.is-empty .prail-num { color: var(--text-3); font-weight: 500; background: none; }
.prail-row.is-empty .prail-note { opacity: .75; }

/* Colour is reserved for the one row that is a worklist right now. */
.prail-row.is-act .prail-num {
  border-color: rgba(224,165,61,.45); background: rgba(224,165,61,.12); color: #f0c884;
}
.prail-row.is-act .prail-label { font-weight: 600; }

.prail-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.prail-label { font-size: 13.5px; color: var(--text); display: flex; align-items: center; gap: 7px; }
.prail-note { font-size: 11.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }


/* Terminal states: the score, not a step. */

/* Row pager — sits under any table carrying data-rowpage. */
.rowpager {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  padding: 9px 14px; border-top: 1px solid var(--border-2);
}
.rowpager-info { font-size: 12px; color: var(--text-3); }
.rowpager-nav { display: flex; align-items: center; gap: 8px; }

/* API usage: the day's traffic chart beside the SalesIntel budget panel.
   Deliberately not 50/50 — the budget is a control you glance at, the chart is
   the thing you read. */
.api-split {
  display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px;
  align-items: stretch;            /* both columns end on the same line */
}
.api-split > .card { height: 100%; display: flex; flex-direction: column; }
.api-split > .card > .card-body { flex: 1 1 auto; }
@media (max-width: 1100px) { .api-split { grid-template-columns: minmax(0, 1fr); } }

/* SalesIntel budget readings. Label across the top, then the track and its
   number side by side — the number used to be jammed into the label, which put
   the figure you want furthest from the bar it describes. */
.sib-body { display: flex; flex-direction: column; gap: 14px; }
.sib-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: 'label label' 'track value';
  gap: 5px 10px; align-items: center;
}
.sib-label { grid-area: label; font-size: 11.5px; color: var(--text-3); }
.sib-track {
  grid-area: track; height: 8px; border-radius: 5px; overflow: hidden;
  background: rgba(255,255,255,.07);
}
.sib-track i { display: block; height: 100%; border-radius: 5px; }
.sib-track.is-ok   i { background: #10b981; }
.sib-track.is-warm i { background: #f59e0b; }
.sib-track.is-hot  i { background: var(--danger); }
.sib-val {
  grid-area: value; font-size: 12px; color: var(--text-3);
  white-space: nowrap; font-variant-numeric: tabular-nums;
}
.sib-val strong { color: var(--text); font-weight: 700; }
.sib-note { margin-top: auto; padding-top: 6px; }

.caps-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; margin-bottom: 4px; }
.caps-grid .field { display: flex; flex-direction: column; gap: 4px; }
.sib-check { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-top: 8px; }

/* Process-map legend: matches the amber dot drawn on manual-intervention nodes. */
.pmap-legend { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.pmap-dot { width: 9px; height: 9px; border-radius: 50%; background: #e0a53d; display: inline-block; }

/* Roles reference column: one block per role, most-privileged first, with a
   rule between them so three answers don't read as one paragraph. */
.roles-body { display: flex; flex-direction: column; gap: 0; }
.roles-body .role-def { padding: 14px 0; border-top: 1px solid var(--border-2); }
.roles-body .role-def:first-child { padding-top: 2px; border-top: 0; }
.roles-body .role-def:last-child { padding-bottom: 2px; }
.role-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.role-head .role-name { font-weight: 600; color: var(--text); font-size: 13.5px; }
.roles-body .role-copy { margin: 0 0 4px; font-size: 12.5px; line-height: 1.55; color: var(--text-3); }
.roles-body .role-cant { color: var(--text-3); opacity: .78; margin-bottom: 0; }

/* Tribe grants in the create-user drawer. */
.grant-list {
  display: flex; flex-direction: column; gap: 2px;
  max-height: 220px; overflow-y: auto;
  border: 1px solid var(--border-2); border-radius: var(--radius-sm); padding: 6px;
}
.grant-opt {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 5px 8px; border-radius: var(--radius-sm); font-size: 13px; color: var(--text-2);
}
.grant-opt:hover { background: rgba(255,255,255,.06); }

/* Per-tribe geo overrides. Blank inherits the global, so each field advertises
   which state it is in rather than leaving you to guess from an empty box. */
.geo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.geo-field .field { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.geo-help { font-size: 11.5px; color: var(--text-3); margin-top: 4px; line-height: 1.45; }
.geo-flag, .geo-inherit {
  font-size: 10px; text-transform: uppercase; letter-spacing: .05em;
  padding: 1px 6px; border-radius: 20px; white-space: nowrap; font-weight: 500;
}
.geo-flag { background: rgba(255,91,31,.16); color: #ffb694; border: 1px solid rgba(255,91,31,.34); }
.geo-inherit { background: rgba(255,255,255,.05); color: var(--text-3); border: 1px solid var(--border-2); }

/* Page header with a scope control on the right. The control belongs beside the
   title because it scopes the whole page, not just the list beneath it. */
.page-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 14px;
}
.page-head-tools { display: flex; align-items: center; gap: 8px; margin: 0; }
.page-head-tools .input-sm { min-width: 150px; }

/* ── Profile images ───────────────────────────────────────────────────────
   Optional, so every avatar has an initial fallback — an empty circle reads as
   a broken image rather than "none set". */
.uavatar, .welcome-avatar {
  border-radius: 50%; object-fit: cover; flex: 0 0 auto;
  background: rgba(255,255,255,.07); border: 1px solid var(--border-2);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-2); font-weight: 700; overflow: hidden;
}
.uavatar { width: 32px; height: 32px; font-size: 13px; }
.welcome-avatar { width: 64px; height: 64px; font-size: 24px; }
.ucell-id { display: flex; align-items: center; gap: 10px; min-width: 0; }
.uavatar-edit { display: block; color: var(--text-3); text-decoration: none; font-size: 11.5px; }
.uavatar-edit:hover { color: var(--accent); }
.uavatar-preview {
  display: block; width: 96px; height: 96px; border-radius: 50%;
  object-fit: cover; margin-bottom: 14px; border: 1px solid var(--border-2);
}

/* Replied / Registered columns on the pipeline list. These are facts about a
   person rather than stages, so they read as a quiet yes/dash — except
   Registered, which is the outcome we actually want, and a reply still awaiting
   an answer, which is the one thing here that needs a human. */
.col-flag { display: flex; }
.flag-no { color: var(--text-3); opacity: .5; }
.flag-yes {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 600;
  background: rgba(255,255,255,.06); border: 1px solid var(--border-2); color: var(--text-2);
}
.flag-yes.is-win { background: rgba(16,185,129,.14); border-color: rgba(16,185,129,.38); color: #8fd9b6; }
.flag-yes.is-hot { background: rgba(255,91,31,.15); border-color: rgba(255,91,31,.38); color: #ffb694; }

/* The Replied column carries two readings, so it stacks. */
.col-flag { flex-direction: column; align-items: flex-start; gap: 2px; justify-content: center; }
.flag-meta { font-size: 11px; color: var(--text-3); line-height: 1.3; }

/* Past the stale window. Kept grey and unbolded — amber bold shouted on every
   older row, and almost every row here is older. The tint is the whole signal. */
.sent-stale { color: var(--text-3); }
.sent-stale::after {
  content: ''; display: inline-block; width: 5px; height: 5px; border-radius: 50%;
  background: rgba(224,165,61,.75); margin-left: 6px; vertical-align: middle;
}

/* Follow-up due: a NOTICE on the Invited row, not a step of its own. Sits at
   the right-hand end of that row, so it reads as "and this many are overdue"
   rather than as the next thing in the process. */

/* Event column states. RSVP is a promise, Attended is the outcome we want,
   Missed is the one worth noticing. */
.flag-yes.is-rsvp { background: rgba(255,255,255,.06); border-color: var(--border-2); color: var(--text-2); }
.flag-yes.is-miss { background: rgba(224,165,61,.14); border-color: rgba(224,165,61,.36); color: #f0c884; }

/* Timestamps riding along with an engagement mark. */
.eng-submark-when { opacity: .65; margin-left: 5px; font-weight: 400; }

/* Needs strip — the worklist, above the stages. Every tile is a verb. */
.need-strip { display: flex; gap: 8px; flex-wrap: wrap; padding: 10px 2px 12px; }
.need-tile {
  display: flex; flex-direction: column; gap: 1px; min-width: 96px;
  padding: 8px 12px; border-radius: var(--radius-sm); text-decoration: none;
  background: rgba(255,255,255,.045); border: 1px solid var(--border-2); color: var(--text-2);
}
.need-tile:hover { border-color: var(--border); background: rgba(255,255,255,.07); }
.need-num { font-size: 19px; font-weight: 700; letter-spacing: -.02em; color: var(--text); font-variant-numeric: tabular-nums; }
.need-label { font-size: 11.5px; color: var(--text-3); }
.need-tile.t-hot { background: rgba(255,91,31,.12); border-color: rgba(255,91,31,.34); }
.need-tile.t-hot .need-num { color: #ffb694; }
.need-tile.t-due { background: rgba(224,165,61,.11); border-color: rgba(224,165,61,.32); }
.need-tile.t-due .need-num { color: #f0c884; }
.need-tile.is-empty { opacity: .45; }
.need-tile.is-empty .need-num { color: var(--text-3); font-weight: 500; }
.need-tile.is-on { box-shadow: inset 0 0 0 1px var(--accent); }
/* Nothing to do about these — present for the arithmetic, not for clicking. */
.need-tile.is-wait { background: none; border-style: dashed; cursor: default; }
.need-tile.is-wait .need-num { color: var(--text-3); font-weight: 500; }
.prail-head-2 { margin-top: 2px; }

/* Needs pill on the row — same vocabulary as the strip in the header. */
.need-pill {
  display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 20px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
  background: rgba(255,255,255,.06); border: 1px solid var(--border-2); color: var(--text-2);
}
.need-pill.n-answer   { background: rgba(255,91,31,.15);  border-color: rgba(255,91,31,.38);  color: #ffb694; }
.need-pill.n-followup { background: rgba(224,165,61,.14); border-color: rgba(224,165,61,.36); color: #f0c884; }
.need-pill.n-email    { background: rgba(224,165,61,.10); border-color: rgba(224,165,61,.28); color: #e6c08a; }
/* An annotation on the stage, not a state of its own. */
.stage-miss {
  font-size: 10.5px; color: var(--text-3); padding: 1px 6px; border-radius: 20px;
  background: rgba(255,255,255,.05); border: 1px solid var(--border-2); white-space: nowrap;
}

/* ── Funnel chips (pipeline header) ───────────────────────────────────────
   Restored from git: these were removed when the header was briefly a
   vertical rail, which left the reverted chip layout unstyled. */
/* ---- Pipeline funnel strip ---- */
.funnel { display: flex; align-items: stretch; gap: 0; flex-wrap: wrap; }
.funnel-arrow { display: flex; align-items: center; color: var(--text-3); padding: 0 6px; font-size: 15px; user-select: none; }
.funnel-chip {
  flex: 1 1 0; min-width: 110px; text-decoration: none;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 14px; text-align: center;
  transition: border-color .12s, transform .08s, box-shadow .12s;
}
.funnel-chip:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0,0,0,.05); }
.funnel-chip .fc-count { font-size: 22px; font-weight: 700; line-height: 1.1; letter-spacing: -.02em; }
.funnel-chip .fc-label { font-size: 11.5px; color: var(--text-2); margin-top: 3px; font-weight: 600; }
.funnel-chip.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.funnel-chip.ok      .fc-count { color: #166534; }
.funnel-chip.hot     .fc-count { color: #1e40af; }
.funnel-chip.due     .fc-count { color: #b45309; }
.funnel-chip.due.on  { border-color: #f59e0b; box-shadow: 0 0 0 1px #f59e0b inset; }
.funnel-chip.success .fc-count { color: #10b981; }
.funnel-chip.muted   .fc-count { color: var(--text-3); }
.funnel-fork { flex: 1 1 0; min-width: 128px; display: flex; flex-direction: column; gap: 6px; }
.fork-chip {
  flex: 1; display: flex; align-items: center; gap: 9px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 6px 12px; text-decoration: none;
  transition: border-color .12s, transform .08s, box-shadow .12s;
}
.fork-chip:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0,0,0,.05); }
.fork-chip .fork-count { font-size: 19px; font-weight: 700; line-height: 1; letter-spacing: -.02em; min-width: 18px; }
.fork-chip .fork-label { font-size: 11px; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.fork-chip.win  .fork-count { color: #10b981; }
.fork-chip.lost .fork-count { color: var(--text-3); }
.fork-chip.win.on  { border-color: #10b981; box-shadow: 0 0 0 1px #10b981 inset; }
.fork-chip.lost.on { border-color: var(--text-3); box-shadow: 0 0 0 1px var(--text-3) inset; }


/* Rail bits restored: the "needs you" tag and the closed-out footer. */
.prail-tag {
  font-size: 10px; text-transform: uppercase; letter-spacing: .05em;
  padding: 1px 6px; border-radius: 20px; white-space: nowrap; font-weight: 500;
  background: rgba(224,165,61,.15); color: #f0c884; border: 1px solid rgba(224,165,61,.34);
}
.prail-foot {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 6px; padding: 12px 6px 4px; border-top: 1px solid var(--border-2);
}
.prail-foot-label { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; }

/* Follow-up due: a NOTICE on the Invited row, not a step of its own. Sits at
   the right-hand end of that row so it reads as "and this many are overdue".
   It lives inside the row's <a>, so it is a span with a JS handler — a nested
   anchor is invalid and browsers unnest it. */
.prail-state {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px; border-radius: 20px; white-space: nowrap;
  font-size: 12px; color: #f0c884; cursor: pointer;
  background: rgba(224,165,61,.10); border: 1px solid rgba(224,165,61,.30);
}
.prail-state strong { font-weight: 700; font-variant-numeric: tabular-nums; }
.prail-state:hover { background: rgba(224,165,61,.18); border-color: rgba(224,165,61,.55); }
.prail-state.is-on { background: rgba(224,165,61,.22); border-color: rgba(224,165,61,.65); color: #ffdca8; }

/* ── Pipeline row: four columns and the arrow ─────────────────────────────
   Contact carries how we reach them AND when we last did — those belong
   together. Status carries where they are, with replies and missed events as
   small marks rather than columns of their own. */
.col-contact-wrap { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.touch-line { font-size: 11px; color: var(--text-3); line-height: 1.3; }
.touch-line.is-stale { color: #e0a53d; }

.col-status { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.status-marks { display: flex; gap: 5px; flex-wrap: wrap; }
.status-marks:empty { display: none; }
.mark {
  font-size: 10.5px; color: var(--text-3); padding: 1px 7px; border-radius: 20px;
  background: rgba(255,255,255,.05); border: 1px solid var(--border-2); white-space: nowrap;
}
.mark.is-hot { background: rgba(255,91,31,.15); border-color: rgba(255,91,31,.38); color: #ffb694; }

/* Pipeline row columns. Each answers one question, so none of them stack two
   unrelated facts the way Status was doing. */
.col-email, .col-event, .col-outreach {
  min-width: 0; display: flex; flex-direction: column; gap: 2px; justify-content: center;
}
.flag-yes.is-bad { background: rgba(239,68,68,.14); border-color: rgba(239,68,68,.38); color: #f6a9a9; }

/* Email column: the outreach on top, what came back underneath. */
.email-result { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* "Not registered" is a real answer, not an absence — but it is the resting
   state for most rows, so it stays quiet enough not to compete with the ones
   that mean something happened. */
.flag-yes.is-none {
  background: none; border-color: var(--border-2); color: var(--text-3); font-weight: 500;
}

/* Last outreach: what we sent reads as the fact (green, it happened), when we
   sent it reads as the measure — and only that half turns amber when it has
   been quiet too long. */
.touch-what { color: var(--success-fg); font-weight: 600; }
/* A bounced send is not good news, so it does not get the green. */
.touch-what.is-bad { color: var(--danger-fg); }
.touch-when { color: var(--text-3); margin-left: 6px; }
.touch-when.is-stale { color: #e0a53d; font-weight: 600; }
.touch-line { display: flex; align-items: baseline; flex-wrap: wrap; }

/* Inactive-members toggle on the tribe roster. */
.tr-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-3); cursor: pointer; }
.tr-toggle input { margin: 0; }
.tr-row.is-out { opacity: .62; }

/* ── Roles table ──────────────────────────────────────────────────────────
   Priority is a slider because the number only means something relative to the
   other roles — a box you type 60 into tells you nothing about where 60 sits. */
.pri-form { display: flex; align-items: center; gap: 8px; justify-content: flex-end; margin: 0; }
.pri-range { width: 92px; accent-color: var(--accent); cursor: pointer; }
.pri-out { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--text-2); min-width: 2.5ch; text-align: right; }
.seat-input { width: 62px; text-align: center; }
.rd-impact {
  font-size: 12.5px; color: var(--text-2); line-height: 1.5; margin-bottom: 14px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  background: rgba(239,68,68,.08); border: 1px solid rgba(239,68,68,.28);
}

/* Tribe settings: where we look beside who we look for. */
.tribe-settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 20px; align-items: start; }
.settings-box {
  border: 1px solid var(--border-2); border-radius: var(--radius-sm);
  padding: 12px 14px; margin-top: 14px;
}
.settings-box legend { font-size: 12.5px; font-weight: 600; color: var(--text-2); padding: 0 4px; }
.settings-opt { display: flex; align-items: flex-start; gap: 8px; margin: 8px 0; font-size: 13px; line-height: 1.45; }
.settings-opt input { margin-top: 3px; flex: 0 0 auto; }

/* Users table: three icon actions on one line, never wrapping. */
.users-main .tbl td.actions { display: flex; align-items: center; justify-content: flex-end; gap: 4px; white-space: nowrap; }
.users-main .tbl td.actions form { margin: 0; display: inline-flex; }
.nowrap { white-space: nowrap; }
.icon-btn.is-set { color: var(--accent); }
.uavatar-btn { padding: 0; border: 0; background: none; cursor: pointer; line-height: 0; flex: 0 0 auto; }
.uavatar-btn:hover .uavatar { border-color: var(--accent); }

/* Roles table, calmed down. Filled/seats replaces what used to be three columns
   (Filled by, Status, Seats); the names move under the role where there is room
   for them, and "to review" rides on the role rather than owning a column. */
.role-review {
  display: inline-block; margin-left: 8px; font-size: 10.5px; font-weight: 600;
  padding: 1px 7px; border-radius: 20px; text-decoration: none; white-space: nowrap;
  background: rgba(255,91,31,.15); border: 1px solid rgba(255,91,31,.36); color: #ffb694;
}
.role-who {
  font-size: 11.5px; color: var(--text-3); margin-top: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 34ch;
}
.seat-form { display: inline-flex; align-items: center; gap: 4px; margin: 0; justify-content: flex-end; }
.seat-filled { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text-2); }
.seat-filled.is-full { color: #8fd9b6; }
.seat-sep { color: var(--text-3); }
.icon-btn.is-danger:hover { color: var(--danger); }

/* Follow-ups list: why it is on your desk, and what to do about it. */
.col-why, .col-do { min-width: 0; display: flex; align-items: center; }
.col-do { color: var(--text-2); font-weight: 500; line-height: 1.35; }

/* Closed-out totals. Same shape as the stage rows above so they read as things
   you click, not as a caption under the list. */
.prail-foot { display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--border-2); }
.prail-end {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: var(--radius-sm); text-decoration: none;
  border: 1px solid var(--border-2); background: rgba(255,255,255,.03); color: var(--text-2);
}
.prail-end:hover { border-color: var(--border); background: rgba(255,255,255,.06); }
.prail-end.is-on { box-shadow: inset 0 0 0 1px var(--accent); }
.prail-end-num {
  font-size: 17px; font-weight: 700; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums; color: var(--text); min-width: 2.5ch;
}
.prail-end-num.is-win { color: #8fd9b6; }
.prail-end-label { font-size: 12.5px; color: var(--text-3); }

/* Row actions on New prospects: invite, reject, open. */
.icon-btn.is-go:hover { color: var(--success-fg); }

/* ---- Member avatar -------------------------------------------------------
   A round face beside each active member. The image sits ON TOP of the
   initials rather than replacing them, so if it fails to load (onerror removes
   the <img>) the initials are already underneath — no flash of empty circle
   and no second request. */
.tr-avatar {
  position: relative;
  flex: 0 0 auto;
  width: 32px; height: 32px;
  border-radius: 50%;
  overflow: hidden;
  display: inline-grid;
  place-items: center;
  margin-right: 10px;
  background: hsl(var(--av-hue, 210) 42% 30%);
  border: 1px solid rgba(255,255,255,.10);
}
.tr-avatar img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;          /* crop, never squash a face */
  border-radius: 50%;
}
.tr-avatar-initials {
  font-size: 11.5px; font-weight: 600; letter-spacing: .02em;
  color: hsl(var(--av-hue, 210) 55% 88%);
  user-select: none;
}
/* The roster row is a flex line; the avatar needs the name block to still take
   the remaining width. */
.tr-row { display: flex; align-items: center; }
.tr-row .tr-main { flex: 1 1 auto; min-width: 0; }

/* ---- Event cards ---------------------------------------------------------
   An event is a date, a name and a headcount — recognised at a glance rather
   than scanned in columns, so it gets a card with the date block leading. */
.ev-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 14px;
}
.ev-card {
  display: grid;
  grid-template-columns: 58px 1fr;
  grid-template-areas: "date body" "date actions";
  gap: 4px 14px;
  padding: 14px;
  border: 1px solid var(--border-2);
  border-radius: 12px;
  background: var(--surface);
}
.ev-card.is-default { border-color: var(--success); box-shadow: 0 0 0 1px var(--success) inset; }
.ev-card.is-past    { opacity: .62; }

.ev-date {
  grid-area: date;
  display: grid; place-content: center center;
  align-self: start;
  width: 58px; height: 58px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  text-align: center;
  line-height: 1.05;
}
.ev-day { display: block; font-size: 21px; font-weight: 700; }
.ev-mon { display: block; font-size: 10.5px; letter-spacing: .08em; color: var(--text-2); }

.ev-body  { grid-area: body; min-width: 0; }
.ev-title {
  font-weight: 600; font-size: 15px; margin-bottom: 4px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.ev-meta {
  font-size: 12.5px; color: var(--text-2);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 3px;
}
.ev-actions {
  grid-area: actions;
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  margin-top: 10px;
}
@media (max-width: 520px) {
  .ev-card { grid-template-columns: 46px 1fr; }
  .ev-date { width: 46px; height: 46px; }
  .ev-day  { font-size: 17px; }
}

/* ── Person card header ────────────────────────────────────────────────────
   Tags used to stack in a column beside the name, so a long title and three
   pills fought over one row and pushed each other out of the card. Name and
   title own the first line; tags wrap beneath them in one flow. */
.pc-head { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.pc-who { min-width: 0; }
.pc-who .pn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-who .pt {
  font-size: 12px; color: var(--text-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pc-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; min-width: 0; }
.pc-tags .pill { font-size: 10px; white-space: nowrap; }
.pc-conf { font-size: 10px; color: var(--text-3); white-space: nowrap; }

/* Contact rows inside a person card can hold long addresses. */
.person-card .pc-line { min-width: 0; }
.person-card .pc-line a,
.person-card .pc-line span:not(.pc-ic) {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
}

/* ── Source playbook: each row opens to explain itself ────────────────────
   Every source already carried a plain-English "how", the tool it uses and a
   URL hint — none of it was rendered, so the page reported a success rate for
   a step it never explained. */
.src-item { border-bottom: 1px solid var(--border-2); }
.src-item:last-child { border-bottom: 0; }
.src-item > summary {
  cursor: pointer; list-style: none;
  align-items: center;
}
.src-item > summary::-webkit-details-marker { display: none; }
.src-item > summary::marker { content: ""; }
.src-item > summary:hover { background: rgba(255,255,255,.04); }
.src-chev {
  color: var(--text-3); font-size: 17px; line-height: 1;
  transition: transform .15s ease; justify-self: end;
}
.src-item[open] > summary .src-chev { transform: rotate(90deg); }
.src-item[open] > summary { background: rgba(255,255,255,.045); }

.src-detail { padding: 4px 18px 18px 40px; background: rgba(0,0,0,.14); }
.src-facts {
  margin: 0; display: grid; grid-template-columns: 150px minmax(0,1fr);
  gap: 5px 14px; font-size: 12.5px;
}
.src-facts dt { color: var(--text-3); }
.src-facts dd { margin: 0; color: var(--text-2); min-width: 0; }
.src-url {
  font-size: 11.5px; background: rgba(255,255,255,.06);
  padding: 1px 6px; border-radius: 4px; word-break: break-all;
}
.src-warn { color: #eda0a0; }
.src-how {
  margin: 12px 0 0; padding-top: 12px; border-top: 1px solid var(--border-2);
  font-size: 12.5px; line-height: 1.6; color: var(--text-3);
}
@media (max-width: 760px) {
  .src-facts { grid-template-columns: 1fr; gap: 2px; }
  .src-facts dt { margin-top: 8px; }
  .src-detail { padding-left: 18px; }
}

/* A template is on when it has words in it — there is no separate switch to
   keep in agreement with the body any more. The flag just reports that. */
.tmpl-flag {
  font-size: 10.5px; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; padding: 3px 9px; border-radius: 99px;
  background: rgba(255,255,255,.07); color: var(--text-3);
}
.tmpl-flag.is-on { background: rgba(26,169,113,.15); color: #8fd9b6; }
.tmpl-card .card-head { align-items: flex-start; }
.tmpl-card .card-head .meta { margin-top: 2px; }

/* ============================================================
   MOBILE FOUNDATION (sweep, 2026-08)
   Global small-screen safety net. Page-specific polish layers
   on top of this; the app shell (hamburger + off-canvas nav)
   already handles ≤1024px, so this targets CONTENT breakage.
   ============================================================ */

/* Nothing scrolls the whole page sideways — wide children (tables, funnels,
   code blocks) must scroll inside their own container instead. */
body { overflow-x: hidden; }
img, video, canvas { max-width: 100%; height: auto; }

@media (max-width: 640px) {
  /* Tighter gutters + softer card corners read better on a phone. */
  .main { padding-left: 12px; padding-right: 12px; }
  .card { border-radius: 14px; }

  /* Headings step down one notch so they stop wrapping mid-title. */
  h1.page-title, .page-title { font-size: 20px; line-height: 1.2; }
  .page-sub { font-size: 13px; }

  /* KPI tiles and the funnel go single-column instead of squeezing. */
  .kpis { grid-template-columns: 1fr; }
  .funnel-chip { min-width: 100%; }

  /* Comfortable, thumb-sized tap targets everywhere. */
  .btn { min-height: 40px; }
  .btn.btn-sm, .btn-sm { min-height: 34px; }
  .nav a { min-height: 42px; }

  /* Wide data tables never break the page — they scroll in a rail. */
  .table-wrap, .scroll-x, .funnel { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* ===== Dense rows → real cards on mobile ==============================
     .qrow is the shared row grid on 9 pages (prospects, pipeline, people,
     backlog, emails, tribe roster, today, category, notifications). On a phone
     each ROW becomes its own tidy stacked card: name on top, contact + tribe/
     role beneath, a status pill, the open-arrow pinned top-right, and any
     action buttons as a full-width footer. Cells share the same class names
     across pages (identity → .col-contact → .col-tribe → .col-score/.score →
     .col-sent → .col-actions/.row-open), so one design fixes every page. */

  /* Strip the outer glass frame off list containers so the row-cards stand on
     the page instead of nesting card-in-card. Matches the skeleton too, so the
     frame doesn't flash in before the rows lazy-load. */
  .card:has(.qrow-link),
  .card:has(.skel-row) {
    background: none; border-color: transparent; box-shadow: none;
    backdrop-filter: none; -webkit-backdrop-filter: none;
  }

  .qrow.qrow-head { display: none; }          /* the column header row */

  .qrow.qrow-link {
    display: block; position: relative;
    padding: 13px 46px 13px 14px;             /* right gutter for the arrow */
    margin: 0 0 9px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(255,255,255,.045);        /* subtle solid fill on the dark page */
  }
  .qrow.qrow-link:last-child { margin-bottom: 0; }
  .qrow.qrow-link:hover,
  .qrow.qrow-link:active { background: rgba(255,255,255,.08); }

  /* SIMPLE card = three things only. Whitelist: hide EVERY cell, then show the
     identity (name + company), the status pill, and the actions. Contact,
     tribe/role, fit score, "Event / no event", "Why", "no contact" — all the
     dense-table columns — are gone on mobile. Tap the card for the full record. */
  .qrow.qrow-link > * { display: none; margin: 0; }
  .qrow.qrow-link > .ident,
  .qrow.qrow-link > .col-sent,
  .qrow.qrow-link > .col-actions { display: block; width: auto; min-width: 0; }

  /* Identity: no score-avatar tile, name is the title and wraps (never cut off). */
  .qrow.qrow-link .ident-avatar { display: none; }
  .qrow.qrow-link .ident { display: block; padding-right: 4px; }
  .qrow.qrow-link .ident-name { white-space: normal; font-size: 15px; line-height: 1.3; font-weight: 600; }
  .qrow.qrow-link .ident-gap { display: none; }          /* drop the "no contact" tag */
  .qrow.qrow-link .ident-line2 { margin-top: 2px; font-size: 12.5px; }

  /* Status pill sits right under the name — its better home on mobile. */
  .qrow.qrow-link .col-sent { margin-top: 9px; }

  /* The open-arrow is consistent on every page → pin it top-right. */
  .qrow.qrow-link .row-open {
    position: absolute; top: 10px; right: 9px;
    width: 32px; height: 32px; z-index: 1;
  }

  /* Action buttons (pipeline / follow-ups) become a full-width footer. When
     .col-actions holds only the now-absolute arrow it has no flow content and
     collapses to nothing, so only real buttons add the footer + spacing. */
  .qrow.qrow-link .col-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; justify-self: auto; }
  .qrow.qrow-link .col-actions:has(.btn) { margin-top: 12px; width: 100%; }
  .qrow.qrow-link .col-actions .btn { flex: 1 1 auto; min-height: 38px; }

  /* Loading skeleton matches the stacked card shape (no layout jump). */
  .skel-row { grid-template-columns: 1fr; gap: 8px; }

  /* Data tables (.tbl) on api-usage, users, runs, devices, learning, mcp-setup,
     discovery, tribe: the table itself becomes a horizontal scroll rail instead
     of forcing columns off-screen. Cells keep their line; swipe to see more. */
  .tbl { display: block; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tbl thead th, .tbl td { white-space: nowrap; }
}

/* ── Reports ───────────────────────────────────────────────────────────────
   Read-only roll-ups. Deliberately dense: this page answers "is this working
   and where is it leaking", which is a reading task, not a queue. */
.rpt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 900px) { .rpt-grid { grid-template-columns: 1fr; } }

.rpt-funnel { display: flex; flex-direction: column; gap: 14px; }
.rpt-fstep { display: grid; grid-template-columns: 190px minmax(0,1fr) 230px; gap: 14px; align-items: center; }
@media (max-width: 820px) {
  .rpt-fstep { grid-template-columns: 1fr; gap: 4px; }
}
.rpt-flabel { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 13px; }
.rpt-flabel strong { font-size: 16px; color: var(--text); }
.rpt-fbar { height: 22px; border-radius: 4px; background: rgba(255,255,255,.05); overflow: hidden; }
.rpt-fbar > span {
  display: block; height: 100%; border-radius: 4px;
  background: linear-gradient(90deg, var(--accent), rgba(255,91,31,.55));
}
.rpt-fconv { font-size: 12px; color: var(--text-3); text-align: right; }
@media (max-width: 820px) { .rpt-fconv { text-align: left; } }
/* A stage that loses most of what reaches it is the finding, so say so. */
.rpt-fconv .is-weak { color: #e8c37a; font-weight: 600; }

.rpt-facts { margin: 0; display: grid; grid-template-columns: 150px minmax(0,1fr); gap: 7px 14px; font-size: 13px; }
.rpt-facts dt { color: var(--text-3); }
.rpt-facts dd { margin: 0; color: var(--text-2); }
.rpt-facts dd strong { color: var(--text); }
.rpt-bad { color: #eda0a0; }

.rpt-reason + .rpt-reason { margin-top: 11px; }
.rpt-reason-head { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; margin-bottom: 4px; }
.rpt-reason-head strong { color: var(--text); }
.rpt-minibar { height: 5px; border-radius: 3px; background: rgba(255,255,255,.06); overflow: hidden; }
.rpt-minibar > span { display: block; height: 100%; background: rgba(214,158,46,.55); border-radius: 3px; }

.rpt-axis { font-size: 10px; fill: var(--text-3); }

/* Printing a report should produce the report, not the application around it. */
@media print {
  .sidebar, .app-header, .list-filters, .drawer, .drawer-backdrop { display: none !important; }
  .main { padding: 0 !important; }
  .card { break-inside: avoid; border-color: #ccc !important; }
}

/* Funnel drawn as a tapering shape: the narrowing IS the finding, and
   left-aligned bars made a 90% step and a 12% step look like neighbours. */
.rpt-funnel-wrap svg { width: 100%; height: auto; display: block; }
.rpt-fn-label { font-size: 13px; font-weight: 650; fill: #fff; }
.rpt-fn-count { font-size: 11px; fill: rgba(255,255,255,.82); }
.rpt-fn-conv  { font-size: 11px; fill: var(--text-3); }
.rpt-fn-conv.is-weak { fill: #e8c37a; font-weight: 600; }

/* One bar for the whole population — joined / open / closed at a glance. */
.rpt-split-bar {
  display: flex; height: 30px; border-radius: 6px; overflow: hidden;
  background: rgba(255,255,255,.05);
}
.rpt-split-bar > span { display: block; height: 100%; }
.rpt-split-keys { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 12px; font-size: 12.5px; }
.rpt-split-key { display: inline-flex; align-items: center; gap: 7px; color: var(--text-2); }
.rpt-split-key strong { color: var(--text); }

/* ── Geography ─────────────────────────────────────────────────────────────
   Every candidate is in Utah, so a state-shaded map would be one solid block.
   The variation is along the Wasatch Front, so cities get dots. */
.geo-split { display: grid; grid-template-columns: minmax(0,1fr) 280px; gap: 22px; align-items: start; }
@media (max-width: 900px) { .geo-split { grid-template-columns: 1fr; } }
.geo-map svg { width: 100%; height: auto; max-height: 460px; display: block; }
.geo-legend { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; margin-top: 10px; }
.geo-list-title {
  font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-3); margin-bottom: 10px;
}
.geo-row + .geo-row { margin-top: 11px; }
.geo-row-head { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; margin-bottom: 4px; }
.geo-row-head strong { color: var(--text); }
.geo-row-sub { font-size: 11px; color: var(--success); margin-top: 3px; }

/* ── Native <dialog> ───────────────────────────────────────────────────────
   A <dialog> defaults to `background: canvas; color: canvastext` — white on
   white against this theme. The role Edit / Mark filled / Delete popups set a
   border and a radius but never a background, so they rendered as white boxes
   with invisible text. Style the element itself so every dialog inherits it. */
dialog {
  background: var(--glass-sheen), rgba(19,19,22,.94);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0,0,0,.55);
  padding: 0;
}
dialog::backdrop { background: rgba(4,4,6,.62); backdrop-filter: blur(2px); }
dialog h3, dialog h4 { color: var(--text); }
dialog .muted, dialog .small.muted { color: var(--text-3); }
dialog input, dialog textarea, dialog select { color: var(--text); }
dialog .dlg-head {
  padding: 16px 18px 12px; border-bottom: 1px solid var(--border);
}
dialog .dlg-body { padding: 16px 18px; }
dialog .dlg-foot {
  padding: 12px 18px; border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 8px;
}

/* ── Roles table ───────────────────────────────────────────────────────────
   Seats first, then the role. You scan this table asking "what still needs
   filling", so the number that answers it should not be off to the right past
   a long role name. */
.role-tbl th.col-seats, .role-tbl td.col-seats { width: 92px; }
.role-tbl th.col-pri,   .role-tbl td.col-pri   { width: 128px; }
.role-tbl th.col-act,   .role-tbl td.col-act   { width: 116px; }

.seat-form { display: inline-flex; align-items: center; gap: 3px; margin: 0; }
.seat-filled {
  min-width: 22px; text-align: right; font-weight: 700; font-size: 14px; color: var(--text);
}
.seat-filled.is-full { color: var(--success); }
.seat-sep { color: var(--text-3); }
.seat-input {
  width: 42px; padding: 0 4px; text-align: center;
  background: rgba(255,255,255,.04); border-color: var(--border-2);
}

/* Priority as a tier you can scan, with the exact number still editable. */
.pri-cell { display: inline-flex; align-items: center; gap: 7px; margin: 0; }
.pri-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.pri-dot.t-crit { background: #e06c6c; }
.pri-dot.t-high { background: var(--accent); }
.pri-dot.t-norm { background: #6aa9f0; }
.pri-dot.t-low  { background: rgba(255,255,255,.22); }
.pri-num {
  width: 52px; padding: 0 6px; text-align: center;
  background: rgba(255,255,255,.04); border-color: var(--border-2);
}
.pri-tier { font-size: 11px; color: var(--text-3); min-width: 46px; }

/* Row actions: quiet until you reach for them. Three loud buttons on every row
   made a 25-row table look like 75 things demanding a decision. */
.role-tbl td.col-act { white-space: nowrap; }
.role-tbl td.col-act .icon-btn { opacity: .42; }
.role-tbl tr:hover td.col-act .icon-btn { opacity: 1; }
.role-tbl td.col-act .icon-btn:focus-visible { opacity: 1; }

/* ── Categories cards (tribe page) ────────────────────────────────────────
   One card per category. Left: the category (its name opens the edit popup) +
   how full it is. Right: the ONE person who most needs you — avatar, name and
   current stage — as a single link that opens the candidate drawer. A card with
   an unhandled reply is highlighted; a filled category tints light green. */
.role-cards { display: flex; flex-direction: column; gap: 10px; padding: 12px 16px 16px; }
.role-card {
  display: grid;
  grid-template-columns: minmax(150px, 0.85fr) minmax(0, 2fr);
  align-items: center; column-gap: 16px; row-gap: 12px;
  padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px;
  background: transparent; transition: border-color .15s, background .15s, box-shadow .15s;
}
/* The category icon circle on the far left — click to change it. */
.cat-icon {
  flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.10); border: 1px solid var(--border);
  cursor: pointer; padding: 0; font-size: 20px; line-height: 1;
  transition: border-color .12s, transform .12s;
}
.cat-icon span { display: block; }
.cat-icon:hover { border-color: var(--accent); transform: scale(1.05); }
.cat-icon.is-static { cursor: default; }
.cat-icon.is-static:hover { border-color: var(--border); transform: none; }
/* Flat category icons render as an inline SVG inside the circle. */
.cat-icon svg, .cat-svg { width: 20px; height: 20px; color: var(--text); }
/* Tribe name — a plain line under the position, not a badge. */
.rc-tribe { display: block; margin-top: 2px; font-size: 11px; font-weight: 500; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Icon picker grid (shared dialog) — scrolls when the set is long. */
.icon-grid {
  display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px;
  max-height: 46vh; overflow-y: auto; padding-right: 4px;
}
.icon-choice {
  aspect-ratio: 1; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface-2); cursor: pointer; font-size: 20px; line-height: 1;
  display: flex; align-items: center; justify-content: center; transition: border-color .1s, background .1s;
}
.icon-choice:hover { border-color: var(--accent); background: var(--surface); }
.icon-choice svg { width: 22px; height: 22px; color: var(--text-2); }
.icon-choice:hover svg { color: var(--text); }
@media (max-width: 560px) { .icon-grid { grid-template-columns: repeat(6, 1fr); } }

/* Email-template section headers (Message / Sender details / Signature) + the
   required-field cues. */
.tmpl-section-label {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-3); margin-bottom: 8px;
}
.tmpl-req {
  font-size: 9.5px; font-weight: 700; text-transform: none; letter-spacing: 0;
  padding: 1px 7px; border-radius: 20px; background: #f59e0b; color: #241a00; margin-left: 4px;
}
.tmpl-section-label.is-warn { color: #f5c977; }
.tmpl-need { font-size: 12px; color: #f5c977; margin-top: 8px; font-weight: 500; }
.input.is-invalid { border-color: rgba(245,158,11,.6); background: rgba(245,158,11,.06); }

/* ── Event picker (Email tab card + popup) ─────────────────────────────── */
.ev-current { display: flex; align-items: center; gap: 14px; }
.ev-thumb {
  flex: 0 0 auto; width: 72px; height: 54px; border-radius: 10px; overflow: hidden;
  position: relative; background: linear-gradient(135deg, var(--surface-2), rgba(255,91,31,.18));
  display: flex; align-items: center; justify-content: center;
}
.ev-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ev-thumb-ph { font-size: 22px; opacity: .8; }
.ev-thumb:not(.is-empty) .ev-thumb-ph { display: none; }
.ev-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; max-height: 60vh; overflow-y: auto; padding-right: 4px; }
.ev-item { margin: 0; }
.ev-btn {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 10px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface); cursor: pointer; transition: border-color .12s, background .12s;
}
.ev-btn:hover { border-color: var(--accent); background: var(--surface-2); }
.ev-item.is-default .ev-btn { border-color: var(--accent); }
.ev-item.is-past .ev-btn { opacity: .55; }
.ev-btn .ev-thumb { width: 64px; height: 48px; }
.ev-meta { min-width: 0; }
.ev-title { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 620px) { .ev-grid { grid-template-columns: 1fr; } }

/* Candidate Next-steps: the two "remove" paths (Lost vs Not a fit). */
.rail-remove { display: flex; gap: 8px; margin-top: 12px; }
.rail-rm-btn {
  flex: 1; padding: 7px 10px; border-radius: 8px; text-align: center;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2);
  font-size: 12.5px; font-weight: 600; cursor: pointer; line-height: 1.25;
  display: flex; flex-direction: column; gap: 1px;
  transition: border-color .12s, color .12s, background .12s;
}
.rail-rm-btn:hover { border-color: var(--text-3); color: var(--text); }
.rail-rm-btn.is-danger:hover { border-color: var(--danger); color: var(--danger); background: rgba(220,38,38,.06); }
.rail-rm-sub { font-size: 10px; font-weight: 400; color: var(--text-3); }

/* Centered Lost / Not-a-fit decision modal. */
.remove-dialog {
  max-width: 440px; width: 92%; border: none; border-radius: 14px; padding: 0;
  background: var(--surface); color: var(--text); box-shadow: 0 24px 60px rgba(0,0,0,.5);
}
.remove-dialog::backdrop { background: rgba(0,0,0,.55); }
.rmd-body { padding: 22px; }
.role-card:hover { border-color: rgba(255,255,255,.18); background: rgba(255,255,255,.02); }
/* Filled → greyed out and receded (still clickable; brightens on hover). */
.role-card.rc-full { background: var(--surface-2); border-color: var(--border); opacity: .62; }
.role-card.rc-full:hover { opacity: 1; }
/* Needs attention (unhandled reply) → YELLOW tint + a yellow rail down the edge. */
.role-card.rc-attn {
  /* No card highlight at all — the blue "Follow-up" / "Needs reply" badge IS the
     notice. Same (transparent) background as every other row. */
  border-color: var(--border); background: transparent;
}

.rc-cat { min-width: 0; }
.rc-cat-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rc-name {
  font: inherit; font-weight: 650; font-size: 14.5px; color: var(--text);
  background: none; border: 0; padding: 0; cursor: pointer; text-align: left;
}
.rc-name:hover { text-decoration: underline; }
.rc-state {
  font-size: 10px; font-weight: 700; padding: 1px 8px; border-radius: 20px;
  text-transform: uppercase; letter-spacing: .03em;
}
.rc-state.is-open     { background: rgba(255,255,255,.06); color: var(--text-3); }
.rc-state.is-filled   { background: rgba(26,169,113,.16); color: #8fd9b6; }
.rc-state.is-progress { background: rgba(255,91,31,.15);  color: #ffb694; }
.rc-state.is-paused   { background: rgba(245,158,11,.15); color: #f5c977; }
.rc-cat-meta {
  margin-top: 5px; font-size: 12px; color: var(--text-3);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.rc-seats { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--text-2); }
.rc-seats.is-full { color: var(--text-3); }
.rc-who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 24ch; }
.rc-review {
  font-size: 10.5px; font-weight: 600; padding: 1px 7px; border-radius: 20px;
  text-decoration: none; white-space: nowrap;
  background: rgba(255,91,31,.15); border: 1px solid rgba(255,91,31,.36); color: #ffb694;
}

/* Right: the featured person, one link that opens the candidate drawer. */
.rc-next { min-width: 0; }
.rc-person { display: flex; align-items: center; gap: 12px; min-width: 0; text-decoration: none; color: inherit; }
.rc-person .tr-avatar { width: 36px; height: 36px; }
/* On THIS page only, the person avatars are all neutral grey (not per-name hues). */
.role-card .tr-avatar { background: hsl(220 8% 44%); }
.role-card .tr-avatar-initials { color: hsl(220 12% 88%); }
.rc-person-txt { min-width: 0; flex: 1 1 0; }
.rc-person-name {
  display: block; font-weight: 600; font-size: 13.5px; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rc-person:hover .rc-person-name { text-decoration: underline; }
.rc-person-sub {
  display: block; font-size: 11.5px; color: var(--text-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rc-person-role {
  display: block; font-size: 10.5px; color: var(--text-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rc-stage-wrap { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex: 0 0 104px; }
.rc-stage-label {
  font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-3);
}
.rc-stage {
  font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: 20px;
  white-space: nowrap; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border);
}
.rc-stage.stage-pending_review { background: rgba(255,255,255,.06); color: var(--text-2); }
.rc-stage.stage-contacted      { background: rgba(96,165,250,.15); color: #9ec5fe; border-color: rgba(96,165,250,.30); }
.rc-stage.stage-registered,
.rc-stage.stage-attended_event { background: rgba(26,169,113,.16); color: #8fd9b6; border-color: rgba(26,169,113,.32); }
.rc-stage.stage-hopper         { background: rgba(255,91,31,.15);  color: #ffb694; border-color: rgba(255,91,31,.32); }
.rc-stage.stage-followup       { background: rgba(96,165,250,.16);  color: #9ec5fe; border-color: rgba(96,165,250,.34); }
.rc-stage.stage-backlog        { background: rgba(245,158,11,.14); color: #f5c977; border-color: rgba(245,158,11,.30); }
.rc-stage.stage-filled         { background: rgba(26,169,113,.16); color: #8fd9b6; border-color: rgba(26,169,113,.30); }
.rc-attn-badge {
  font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  padding: 1px 7px; border-radius: 20px; white-space: nowrap;
  background: rgba(96,165,250,.16); color: #9ec5fe; border: 1px solid rgba(96,165,250,.30);
}
.rc-attn-badge.is-soft { background: rgba(255,255,255,.09); color: var(--text-2); }

/* The open affordance: a round bordered button, with a divider separating it
   from the status column. */
.rc-open {
  position: relative; flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface-2);
  display: inline-flex; align-items: center; justify-content: center; color: var(--text-3);
  margin-left: 6px; transition: color .12s, border-color .12s, background .12s;
}
.rc-open::before {
  content: ""; position: absolute; left: -9px; top: 50%; transform: translateY(-50%);
  width: 1px; height: 26px; background: var(--border);
}
.rc-open svg { width: 16px; height: 16px; }
.rc-person:hover .rc-open { color: var(--text-2); border-color: var(--text-3); background: var(--surface); }
/* Review/queue boards: the fit score takes the avatar's slot (a number reads
   faster than a face here), and contact info gets its own column right of the name. */
.rc-score {
  flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; line-height: 1;
  background: rgba(255,255,255,.06); color: var(--text-3); border: 1px solid transparent;
}
.rc-score.is-strong { background: rgba(26,169,113,.16); color: #8fd9b6; border-color: rgba(26,169,113,.30); }
.rc-score.is-good   { background: rgba(255,91,31,.15);  color: #ffb694; border-color: rgba(255,91,31,.28); }
.rc-score.is-weak   { background: rgba(255,255,255,.07); color: var(--text-2); }
.rc-score.is-none   { background: rgba(255,255,255,.05); color: var(--text-3); }
/* Contact column — sits to the right of the name, one line per channel. */
.rc-contact-col {
  flex: 1 1 0; min-width: 0; max-width: 30ch;
  display: flex; flex-direction: column; gap: 2px; align-items: flex-start;
  padding-left: 14px; border-left: 1px solid var(--border);
}
/* Each contact channel is a row: icon + value (or a dash when we don't have it). */
.rc-cinfo { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-3); min-width: 0; max-width: 100%; }
.rc-cicon { width: 12px; height: 12px; flex: 0 0 auto; color: var(--text-3); opacity: .5; }
.rc-ctext { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.rc-contact-col .rc-cemail .rc-ctext { color: var(--text-2); font-size: 11.5px; }
.rc-contact-col .rc-cphone .rc-ctext { color: var(--text-3); }
.rc-cinfo.is-empty { opacity: .5; }
.rc-dash { color: var(--text-3); }
/* SalesIntel reveal-verified tick — sits next to the name. */
.rc-verified { color: #37c98a; font-weight: 800; font-size: 12px; }
/* Follow-ups board: the reason (why) with a blue "send a follow-up" prompt below. */
.rc-reason { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; flex: 0 0 auto; max-width: 22ch; }
.rc-reason-why { font-size: 10.5px; color: var(--text-3); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-reason-cta {
  font-size: 10.5px; font-weight: 700; color: #9ec5fe; white-space: nowrap;
  background: rgba(96,165,250,.14); border: 1px solid rgba(96,165,250,.32);
  padding: 2px 9px; border-radius: 20px;
}

/* Fit-score ring wrapping the profile circle — the ring fills clockwise with the
   score (green when strong), the number sits in the corner. */
.rc-avatar-score {
  position: relative; flex: 0 0 auto; width: 44px; height: 44px;
  border-radius: 50%; padding: 3px; box-sizing: border-box;
  background: conic-gradient(var(--ring, var(--text-3)) var(--pct, 0%), rgba(255,255,255,.10) 0);
}
.rc-avatar-score.is-strong { --ring: #37c98a; }
.rc-avatar-score.is-good   { --ring: #ff8a5b; }
.rc-avatar-score.is-weak   { --ring: #b9c0cc; }
.rc-avatar-score.is-none   { --ring: rgba(255,255,255,.16); }
.rc-avatar-score .tr-avatar { width: 100%; height: 100%; }
.rc-score-num {
  position: absolute; right: -4px; bottom: -4px;
  min-width: 19px; height: 17px; padding: 0 4px; box-sizing: border-box;
  border-radius: 10px; background: var(--surface); border: 1px solid var(--border);
  font-size: 9.5px; font-weight: 800; line-height: 15px; text-align: center; color: var(--text);
}

/* Flat divider rows (queue pages: waiting-for-you / follow-ups / hopper / backlog)
   — no card chrome, just a hairline between rows so a long list stays scannable. */
.role-cards--flat { gap: 0; padding: 2px 6px 6px; }
.role-cards--flat .role-card {
  border: 0; border-bottom: 1px solid var(--border); border-radius: 0;
  background: transparent; padding: 12px 8px;
}
.role-cards--flat .role-card:hover { background: rgba(255,255,255,.02); }
.role-cards--flat .role-card.rc-attn { background: transparent; }
.role-cards--flat .role-card:last-child { border-bottom: 0; }
.role-cards--flat .empty { border-bottom: 0; }

/* Mobile: the role row carries a lot of columns. Rather than squeeze them across,
   lay the card out as three clean rows — identity + open on top, contact next,
   then the status/action pills — so nothing strands off-screen or floats with big
   gaps. Flexbox wrap does the work: the full-width items force a new row. */
@media (max-width: 620px) {
  .role-cards { padding: 10px 10px 12px; }
  .role-card { gap: 10px; }

  .rc-person { flex-wrap: wrap; align-items: center; row-gap: 11px; column-gap: 12px; }
  .rc-avatar-score, .rc-score { flex: 0 0 auto; order: 0; }
  .rc-person-txt { flex: 1 1 auto; min-width: 0; order: 1; }
  .rc-open { order: 2; margin-left: auto; }
  .rc-open::before { display: none; }          /* drop the divider — no column to its left now */

  /* Row 2 — contact spans the full width, channels laid out inline. */
  .rc-contact-col {
    order: 3; flex: 1 1 100%; max-width: none;
    border-left: 0; padding-left: 0;
    flex-direction: row; flex-wrap: wrap; gap: 5px 18px; align-items: center;
  }
  .rc-reason { order: 3; flex: 1 1 100%; max-width: none; }

  /* Row 3 — status + action pills, side by side and left-aligned. The tiny
     uppercase labels are dropped here; the pills read on their own. */
  .rc-stage-wrap, .rc-signals {
    flex-direction: row; align-items: center; gap: 6px; flex: 0 0 auto; flex-basis: auto;
  }
  .rc-stage-wrap { order: 5; }
  .rc-signals    { order: 6; }
  .rc-stage-label { display: none; }
  .rc-event { display: none; }
  .rc-contact-col .rc-cinfo.is-empty { display: none; }   /* drop the lonely "— " channel */
}
/* Legacy stacked score+contact under the name (kept for any non-scored contexts). */
.rc-person-contact { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.rc-quick { display: flex; gap: 6px; margin-top: 8px; }
.rc-quick-btn {
  padding: 4px 10px; border-radius: 7px; border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text-2); font-size: 11.5px; font-weight: 600; cursor: pointer;
  transition: border-color .12s, color .12s, background .12s;
}
.rc-quick-btn:hover { border-color: var(--text-3); color: var(--text); }
.rc-quick-btn.is-danger:hover { border-color: var(--danger); color: var(--danger); background: rgba(220,38,38,.06); }

.rc-more-wrap { display: flex; justify-content: center; margin-top: 12px; }
.rc-empty { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; font-size: 12.5px; color: var(--text-3); }
.rc-empty-txt { flex: 1 1 auto; min-width: 0; }
.rc-empty-find { flex: 0 0 auto; margin-left: auto; }
.rc-empty-filled { color: #8fd9b6; }
.rc-empty-filled svg { width: 16px; height: 16px; }

/* Bottom bar: the total on the left, the page controls pushed to the right. */
.role-pager {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; padding: 10px 16px 14px;
}
.role-pager-count { font-size: 12.5px; color: var(--text-3); }
.role-pager-count strong { color: var(--text-2); font-weight: 600; }
.role-pager .pagination { margin: 0; padding-left: 0; }

/* ── Tribe tab "Set up" alert badge — louder than the dot for must-do items. */
.tab-alert {
  display: inline-block; margin-left: 7px; vertical-align: middle;
  font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  padding: 1px 7px; border-radius: 20px; background: #f59e0b; color: #241a00;
}

/* ── Tribe Overview tab: setup checklist (left) + every category (right). ── */
.ov-grid { display: grid; grid-template-columns: minmax(280px, 360px) 1fr; gap: 16px; align-items: start; }
.ov-setup { position: sticky; top: 12px; }
.ov-steps { display: flex; flex-direction: column; }
.ov-step { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-top: 1px solid var(--border); }
.ov-step:first-child { border-top: 0; }
.ov-check {
  flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--border); color: #8fd9b6;
}
.ov-step.is-done .ov-check { background: rgba(26,169,113,.16); border-color: rgba(26,169,113,.4); }
.ov-check svg { width: 13px; height: 13px; }
.ov-step-body { flex: 1; min-width: 0; }
.ov-step-title { font-weight: 600; font-size: 13.5px; color: var(--text); }
.ov-step.is-done .ov-step-title { color: var(--text-2); }
.ov-step-desc { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.ov-step .btn { flex: 0 0 auto; box-shadow: none; }
.ov-cats { max-height: calc(100vh - 210px); overflow-y: auto; }

/* Home action bars — a few destinations, each leading with its live number. */
.action-bars { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.action-bar {
  display: flex; align-items: center; gap: 13px; padding: 14px 16px;
  border: 1px solid var(--border); border-radius: 12px;
  background: var(--glass-bg); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  text-decoration: none; color: inherit; transition: border-color .12s, background .12s;
}
.action-bar:hover { border-color: var(--accent); }
.ab-ic { flex: 0 0 auto; width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; color: var(--text-3); }
.ab-ic svg { width: 21px; height: 21px; }
.ab-num { flex: 0 0 auto; font-size: 25px; font-weight: 800; line-height: 1; color: var(--text-2); font-variant-numeric: tabular-nums; min-width: 1ch; }
.action-bar.has-num .ab-num { color: var(--text); }   /* white, not orange */
.ab-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.ab-label { font-weight: 650; font-size: 14px; color: var(--text); }
.ab-sub { font-size: 11.5px; color: var(--text-3); }
.ab-go { flex: 0 0 auto; color: var(--text-3); font-size: 16px; transition: transform .12s, color .12s; }
.action-bar:hover .ab-go { color: var(--accent); transform: translateX(2px); }

/* Home queues (Follow-ups / Invited / Hopper / Replies) as little person cards. */
.pq-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(315px, 1fr)); gap: 12px; padding: 14px 16px; }
.pq-card {
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface);
  padding: 13px 14px; display: flex; flex-direction: column; gap: 10px; transition: border-color .12s;
}
.pq-card:hover { border-color: rgba(255,255,255,.18); }
.pq-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.pq-head .ident { min-width: 0; }
.pq-stage {
  flex: 0 0 auto; font-size: 11px; font-weight: 600; color: var(--text-2); white-space: nowrap;
  padding: 2px 9px; border-radius: 20px; background: var(--surface-2);
  display: inline-flex; align-items: center; gap: 6px;
}
.pq-stage.is-over { background: var(--danger-soft); color: var(--danger-fg); }
.pq-bounce { font-size: 9px; font-weight: 700; color: var(--danger); text-transform: uppercase; letter-spacing: .03em; }
.pq-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid var(--border); padding-top: 9px; min-width: 0; }
.pq-foot > :first-child { min-width: 0; }
.pq-open { flex: 0 0 auto; color: var(--text-3); display: inline-flex; }
.pq-open svg { width: 18px; height: 18px; }
.pq-card:hover .pq-open { color: var(--accent); }

/* New Prospects layout — left rail (queues) + main board. */
.np-layout { display: grid; grid-template-columns: minmax(220px, 280px) 1fr; gap: 16px; align-items: start; }
.np-side { position: sticky; top: 12px; display: flex; flex-direction: column; gap: 12px; }
.np-queues { display: flex; flex-direction: column; gap: 8px; }
.np-queue {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface);
  text-decoration: none; color: inherit; transition: border-color .12s, background .12s;
}
.np-queue:hover { border-color: var(--accent); background: var(--surface-2); }
.np-q-n { font-size: 22px; font-weight: 800; line-height: 1; color: var(--text-2); font-variant-numeric: tabular-nums; min-width: 1.4ch; text-align: right; }
.np-queue.is-accent .np-q-n { color: var(--accent); }
.np-q-l { font-size: 13px; font-weight: 600; color: var(--text); }
.np-main { min-width: 0; }
@media (max-width: 900px) {
  .np-layout { grid-template-columns: 1fr; }
  .np-side { position: static; }
  .np-queues { flex-direction: row; flex-wrap: wrap; }
  .np-queue { flex: 1 1 140px; }
}

@media (max-width: 900px) {
  .ov-grid { grid-template-columns: 1fr; }
  .ov-setup { position: static; }
  .ov-cats { max-height: none; }
}

@media (max-width: 760px) {
  .role-card { grid-template-columns: 1fr; gap: 10px 12px; }
  .role-card .rc-next { grid-column: 1 / -1; }
}

/* ── Pipeline flow ─────────────────────────────────────────────────────────
   Shared by Docs (explaining the pipeline) and Reports (measuring it), so
   the diagram you read and the numbers you check are the same shape. */
/* === PIPELINE FLOW === */
.flow { display: grid; gap: 0; }
.flow-step {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 22px;
  display: grid; grid-template-columns: 56px 1fr; gap: 18px;
  align-items: start; position: relative;
}
.flow-step .num-circle {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700;
}
.flow-step.muted-step .num-circle { background: var(--text-3); }
.flow-step h3 { margin: 0 0 4px; font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.flow-step .descr { color: var(--text-3); font-size: 13px; margin: 0 0 10px; }
.flow-step .body { font-size: 13.5px; color: var(--text-2); }
.flow-step .who {
  position: absolute; top: 18px; right: 22px;
  font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
  padding: 3px 8px; border-radius: 99px;
}
.who.you { background: var(--accent-soft); color: var(--accent); }
.who.claude { background: var(--info-soft); color: var(--info); }
.who.system { background: rgba(255,255,255,.07); color: var(--text-2); }
/* The outreach track has a fourth actor the discovery track never had: the
   candidate. Their steps are the ones you cannot make happen. */
.who.them { background: rgba(26,169,113,.15); color: #8fd9b6; }

/* A fork, not a step. The outreach track turns on two questions — did they
   reply, and did they show — and drawing either as a straight line was the
   lie that hid the branch nobody follows up on. */
.flow-fork {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: rgba(255,255,255,.03); padding: 16px 18px;
}
.fork-q {
  font-size: 13px; font-weight: 700; color: var(--text);
  margin-bottom: 12px; text-align: center;
}
.fork-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 760px) { .fork-cols { grid-template-columns: 1fr; } }
.fork-branch {
  border: 1px solid var(--border-2); border-radius: var(--radius-sm);
  padding: 13px 15px; background: rgba(0,0,0,.16);
}
.fork-branch.is-yes { border-color: rgba(26,169,113,.34); }
.fork-branch.is-no  { border-color: rgba(214,158,46,.30); }
.fork-head { margin-bottom: 8px; }
.fork-tag {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; padding: 3px 9px; border-radius: 99px;
}
.fork-branch.is-yes .fork-tag { background: rgba(26,169,113,.15); color: #8fd9b6; }
.fork-branch.is-no  .fork-tag { background: rgba(214,158,46,.15); color: #e8c37a; }
.fork-body { font-size: 13px; line-height: 1.6; color: var(--text-2); }
.fork-join {
  margin-top: 12px; text-align: center;
  font-size: 12px; color: var(--text-3);
}


/* ── Reports: the pipeline flow carrying real numbers ─────────────────────
   Same shape as the docs diagram, because it is the same pipeline — one
   explains it, the other measures it. */
.flow-count {
  margin-left: 8px; font-size: 20px; font-weight: 700;
  letter-spacing: -.02em; color: var(--accent);
}
.flow-bar {
  height: 7px; border-radius: 4px; margin: 10px 0 9px;
  background: rgba(255,255,255,.06); overflow: hidden;
}
.flow-bar > span {
  display: block; height: 100%; border-radius: 4px;
  background: linear-gradient(90deg, var(--accent), rgba(255,91,31,.5));
}
.flow-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; font-size: 12.5px; }
.flow-weak { color: #e8c37a; }
.flow-fix {
  flex: 1 1 100%; margin-top: 8px; padding: 8px 11px;
  background: rgba(214,158,46,.10); border: 1px solid rgba(214,158,46,.28);
  border-radius: var(--radius-sm); font-size: 12.5px; color: #e8c37a;
}
/* The arrow between steps carries the loss, so the gap between two boxes is
   where the number you care about lives. */
.flow-arrow-lbl {
  display: flex; align-items: center; gap: 10px;
  padding-left: 28px; height: 34px;
}
.flow-drop { font-size: 12px; color: var(--text-3); }
.flow-drop.is-weak { color: #e8c37a; font-weight: 600; }

/* The one-paragraph answer, above the seven steps that justify it. */
.rundown {
  padding: 14px 16px; border-radius: var(--radius);
  background: rgba(255,91,31,.07); border: 1px solid rgba(255,91,31,.24);
}
.rundown-title {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--accent); margin-bottom: 6px;
}
.rundown p { margin: 0; font-size: 13.5px; line-height: 1.65; color: var(--text-2); }
.rundown strong { color: var(--text); }

/* ── Report map: counties, zoom, clickable cities ─────────────────────────── */
.geo-map { position: relative; }
#utahSvg {
  width: 100%; height: auto; max-height: 460px; display: block;
  cursor: grab; touch-action: none;
}
#utahSvg.is-dragging { cursor: grabbing; }

.geo-county {
  stroke: rgba(255,255,255,.16); stroke-width: 1;
  transition: fill .15s ease;
}
.geo-county.has-people { stroke: rgba(255,255,255,.26); }

.geo-dot { cursor: pointer; outline: none; }
.geo-dot circle:first-child { transition: fill .12s ease, stroke-width .12s ease; }
.geo-dot:hover circle:first-child,
.geo-dot:focus-visible circle:first-child {
  fill: rgba(255,91,31,.55); stroke-width: 2.5;
}
.geo-dot:focus-visible { filter: drop-shadow(0 0 0 2px var(--accent)); }

.geo-tools {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  display: flex; flex-direction: column; gap: 4px;
  background: rgba(10,10,12,.72); border: 1px solid var(--border-2);
  border-radius: var(--radius-sm); padding: 3px;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.geo-tools .icon-btn { width: 26px; height: 26px; }
.geo-tools .icon-btn svg { width: 14px; height: 14px; }

/* Top cities are buttons, so the list and the map open the same thing. */
button.geo-row {
  display: block; width: 100%; text-align: left;
  background: none; border: 0; padding: 7px 8px; margin: 0 -8px;
  border-radius: var(--radius-sm); cursor: pointer; color: inherit; font: inherit;
}
button.geo-row:hover { background: rgba(255,255,255,.06); }

/* The people behind one dot. */
.geo-people-meta {
  padding: 12px 18px; border-bottom: 1px solid var(--border-2);
  font-size: 12.5px; color: var(--text-3);
}
.geo-joined { color: var(--success); font-weight: 600; }
.geo-people { display: flex; flex-direction: column; }
.geo-person {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 18px; border-bottom: 1px solid var(--border-2);
  text-decoration: none; color: inherit;
}
.geo-person:hover { background: rgba(255,255,255,.04); }
.geo-person-main { flex: 1; min-width: 0; }
.geo-person-name { font-size: 13.5px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.geo-person-sub { font-size: 11.5px; color: var(--text-2); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- Toggle switch (used for the per-tribe Automation card) ---- */
.switch { position: relative; display: inline-flex; align-items: center; gap: 11px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .switch-track {
  width: 34px; height: 20px; border-radius: 999px; flex: 0 0 auto; position: relative;
  background: var(--surface-2); border: 1px solid var(--border);
  transition: background .16s ease, border-color .16s ease;
}
.switch .switch-track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.3);
  transition: transform .16s ease;
}
.switch input:checked + .switch-track { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .switch-track::after { transform: translateX(14px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── Roles table, tightened ────────────────────────────────────────────────
   A 100-role tribe is a scrolling problem before it is anything else, so the
   rows are as short as they can be while staying clickable. */
.role-tbl td, .role-tbl th { padding-top: 7px; padding-bottom: 7px; }
.role-tbl td { vertical-align: middle; }
.role-tbl .role-who {
  font-size: 11px; color: var(--text-3); margin-top: 1px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40ch;
}
.role-tbl .role-review { font-size: 11px; margin-left: 8px; }
.role-tbl .row-link { font-size: 13.5px; }

/* Priority: a slider, because the number only means anything next to the other
   roles. The dot keeps the column scannable without reading every value. */
.pri-cell { display: inline-flex; align-items: center; gap: 8px; margin: 0; width: 100%; }
.pri-range {
  flex: 1; min-width: 60px; height: 4px; padding: 0; margin: 0;
  appearance: none; -webkit-appearance: none;
  background: rgba(255,255,255,.12); border-radius: 3px; border: 0; cursor: pointer;
}
.pri-range::-webkit-slider-thumb {
  appearance: none; -webkit-appearance: none;
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--surface); cursor: grab;
}
.pri-range::-moz-range-thumb {
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--surface); cursor: grab;
}
.pri-range.t-crit::-webkit-slider-thumb { background: #e06c6c; }
.pri-range.t-crit::-moz-range-thumb     { background: #e06c6c; }
.pri-range.t-norm::-webkit-slider-thumb { background: #6aa9f0; }
.pri-range.t-norm::-moz-range-thumb     { background: #6aa9f0; }
.pri-range.t-low::-webkit-slider-thumb  { background: rgba(255,255,255,.4); }
.pri-range.t-low::-moz-range-thumb      { background: rgba(255,255,255,.4); }
.pri-out {
  min-width: 24px; text-align: right; font-size: 11.5px;
  color: var(--text-3); font-variant-numeric: tabular-nums;
}

/* Pagination reads left-to-right like the rest of the page. It was centred,
   which put it nowhere near the rows it belongs to. */
.pagination { justify-content: flex-start; padding-left: 18px; }

/* ── Reports: the pipeline as a chart ─────────────────────────────────────
   Seven stat cards were accurate and a page of reading; this answers the same
   question in one look. */
.rpt-flowchart svg { width: 100%; height: auto; display: block; }
.rpc-count { font-size: 15px; font-weight: 700; fill: var(--text); }
.rpc-label { font-size: 10px; fill: var(--text-3); }
.rpc-conv  { font-size: 11px; font-weight: 600; fill: var(--text-2); }
.rpc-conv.is-weak, .rpc-drop.is-weak { fill: #e8c37a; }
.rpc-drop  { font-size: 10px; fill: var(--text-3); }
.rpc-node  { cursor: default; }

/* The map card carries the page, so it gets room to breathe at the top. */
.geo-card { margin-top: 6px; }
.geo-card .card-body { padding: 20px 22px 22px; }
.geo-card .geo-split { gap: 26px; }

/* ── Reports: tighter, sharper, less cloudy ────────────────────────────────
   This page is read, not worked, so it can be denser than the queues. Corners
   come in and the glass is dialled back — a report should read like paper. */
.rpt-page .card,
.geo-card, .rpt-flowchart, .rundown, .rpt-standing {
  border-radius: 6px;
}
.rpt-page .card {
  background: var(--glass-sheen), rgba(18,18,22,.55);
  backdrop-filter: blur(10px) saturate(150%);
  -webkit-backdrop-filter: blur(10px) saturate(150%);
}
.rpt-page .card-head { padding: 12px 16px; }
.rpt-page .card-body { padding: 14px 16px; }
.rpt-page .stat-band { border-radius: 6px; }

/* Top cities scroll instead of stretching the card to fit them, which is what
   left the map column with dead space beside it. */
.geo-list {
  max-height: 460px; overflow-y: auto;
  padding-right: 6px;
}
.geo-split { align-items: stretch; }

/* The population split, now inside the pipeline card. */
.rpt-standing {
  margin-top: 16px; padding-top: 14px;
  border-top: 1px solid var(--border-2);
}
.rpt-standing .rpt-split-bar { height: 22px; border-radius: 5px; }

/* The trend runs the full width of the page — it is a time series, and
   squeezing it made a twelve-week trend look like noise. */


/* ---- Home header background picker (Today welcome banner) ---- */
.welcome-bg-btn {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  width: 34px; height: 34px; border-radius: 8px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(10,10,12,.55); border: 1px solid rgba(255,255,255,.28); color: #fff;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: background .12s, transform .12s;
}
.welcome-bg-btn:hover { background: rgba(10,10,12,.8); transform: translateY(-1px); }
.welcome-bg-btn svg { width: 18px; height: 18px; }
.hdrbg-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.hdrbg-cell { margin: 0; }
.hdrbg-thumb {
  display: block; width: 100%; height: 84px; border-radius: 10px; cursor: pointer;
  background-size: cover; background-position: center; padding: 0;
  border: 2px solid var(--border); transition: border-color .12s, transform .12s;
}
.hdrbg-thumb:hover { transform: translateY(-2px); border-color: var(--text-3); }
.hdrbg-thumb.is-active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.hdrbg-default {
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); color: var(--text-2); font-size: 12.5px; font-weight: 600;
}

/* The population split is context under the chart, not a chart of its own —
   it was a 22px slab competing with the pipeline above it. */
.rpt-standing .rpt-split-bar { height: 9px; border-radius: 5px; }
.rpt-standing .rpt-split-keys { gap: 14px; margin-top: 8px; font-size: 12px; }
.rpt-standing { margin-top: 14px; padding-top: 12px; }

/* Each node carries its share of intake, so a box reads on its own without
   tracing back to the first one. */
.rpc-share { font-size: 9px; fill: var(--text-3); }
.rpc-count { font-size: 17px; }
.rpc-label { font-size: 10.5px; }

/* ── Reports: give the charts the page ────────────────────────────────────
   The charts were not getting bigger because their frames were pinned in CSS —
   enlarging a viewBox only rescales the coordinate system inside the same box.
   These set the frame itself. */
.rpt-page { margin-inline: -14px; }          /* claw back some of .main's padding */
@media (max-width: 1100px) { .rpt-page { margin-inline: 0; } }

/* The headline six get air above them and above the map below. */
.rpt-page .stat-band { margin-top: 18px; margin-bottom: 20px; }
.rpt-page .stat-cell { padding-block: 16px; }

/* The pipeline gets real height rather than a strip. */
.rpt-flowchart { min-height: 230px; }
.rpt-flowchart svg { width: 100%; height: 100%; min-height: 230px; }

/* The trend is a time series — it earns the most vertical room on the page. */
.rpt-trend-wrap { width: 100%; height: 380px; overflow: hidden; }
.rpt-trend-wrap svg { width: 100%; height: 100%; display: block; }


/* Nodes read as nodes, not pills. */
.rpc-node rect { transition: fill .15s ease, stroke .15s ease; }
.rpc-node:hover rect { stroke-width: 2; }

/* The city list scrolls within the map's height, so the two columns end level
   instead of one leaving a ledge. */
.geo-card .geo-list { max-height: 460px; }

/* ---- Automation card: one row per stage (toggle + its number) ---- */
.auto-opt {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  flex-wrap: wrap; padding: 13px 0; border-bottom: 1px solid var(--border-2);
}
.auto-opt:last-of-type { border-bottom: 0; }
.auto-opt .switch { font-weight: 500; font-size: 14.5px; }
.auto-num { display: inline-flex; align-items: center; gap: 8px; color: var(--text-3); font-size: 12.5px; white-space: nowrap; }
.auto-num input { width: 74px; }


/* ── Framed shell ──────────────────────────────────────────────────────────
   The app becomes an inset module with the wallpaper running full-bleed
   behind and around it. Every rule here is ADDITIVE — it overrides the flat
   full-bleed shell defined earlier rather than editing it, so deleting this
   block restores the old look exactly.

   Desktop only. At <=1024px the sidebar is already a slide-over drawer, and a
   frame on a phone just wastes the screen, so the whole thing is scoped to
   the wide breakpoint and narrow screens keep today's behaviour untouched.

   The mechanism worth knowing: backdrop-filter makes .app-frame a containing
   block for its position:fixed descendants. That is the whole trick — the
   sidebar and header are fixed, and this is what makes them pin to the frame
   instead of to the viewport. Remove the filter and both escape to the window
   edges. */
@media (min-width: 1025px) {
  :root {
    --shell-inset-y: 3vh;    /* breathing room above and below the module */
    --shell-inset-x: 2.5vw;  /* kept tight — the module wants to be wide     */
    --shell-radius: 14px;
    --sidebar-gap: 12px;     /* how far the sidebar floats off the frame     */
  }

  /* The frame is fixed, so the document itself has nothing left to scroll.
     .main takes over as the scrolling element (see below). */
  html, body { height: 100%; overflow: hidden; }

  .app-frame {
    position: fixed;
    inset: var(--shell-inset-y) var(--shell-inset-x);
    border: 1px solid var(--border);
    border-radius: var(--shell-radius);
    overflow: hidden;
    background: rgba(14,14,18,.74);
    backdrop-filter: blur(26px) saturate(160%);
    -webkit-backdrop-filter: blur(26px) saturate(160%);
    box-shadow: 0 24px 60px rgba(0,0,0,.42);
  }

  .app-frame > .layout { height: 100%; min-height: 0; }

  /* The sidebar floats: inset on all four sides with its own corners, rather
     than running edge to edge with a dividing border. */
  .sidebar {
    inset: var(--sidebar-gap) auto var(--sidebar-gap) var(--sidebar-gap);
    border: 1px solid var(--border);
    border-right: 1px solid var(--border);
    border-radius: 10px;
  }

  /* Header and content both start clear of the floating sidebar. */
  .app-header { left: calc(var(--sidebar-w) + var(--sidebar-gap) * 2); right: 0; }
  .main {
    margin-left: calc(var(--sidebar-w) + var(--sidebar-gap) * 2);
    height: 100%;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}

/* ── Shell refinements ─────────────────────────────────────────────────────
   Additive, like the frame block above it: these override earlier rules
   rather than editing them, so the whole section can be deleted to revert. */

/* Back sits in the content flow now, not in the fixed bar, so it scrolls away
   with the page. Rendered only on subpages — home has nowhere to go back to. */
.page-back {
  display: inline-flex; align-items: center; gap: 6px;
  margin: 0 0 16px;
  height: 32px; padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  color: var(--text-2); cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 500;
}
.page-back:hover { background: var(--surface-2); color: var(--text); }
.page-back svg { flex: 0 0 auto; }

/* Toolbar controls go fully round — pills for the two that carry a label,
   true circles for the icon-only ones. */
.topbar-start {
  border-radius: 999px;
  padding: 0 16px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
}
.topbar-start:hover { background: var(--surface-2); color: var(--text); }
.topbar-bell,
.topbar-add { border-radius: 50%; }
.topbar-user-btn { border-radius: 999px; padding: 4px 14px 4px 4px; }
.topbar-avatar { border-radius: 50%; }

@media (min-width: 1025px) {
  /* Lighter, glassier module. The flat near-black panel was heavier than the
     wallpaper behind it; a raised base tone plus a diagonal sheen puts the
     glass back — the sheen is what reads as a surface catching light, and
     without it the frame is just a dark rectangle. */
  .app-frame {
    background:
      linear-gradient(160deg, rgba(255,255,255,.060) 0%, rgba(255,255,255,.020) 42%, rgba(255,255,255,0) 70%, rgba(255,255,255,.032) 100%),
      rgba(41,43,54,.52);
    backdrop-filter: blur(30px) saturate(175%);
    -webkit-backdrop-filter: blur(30px) saturate(175%);
  }
}

/* ── Wallpaper, softened ───────────────────────────────────────────────────
   The photograph moves onto its own fixed layer so it can carry a blur. A
   filter on <body> would blur the entire page, content included, which is why
   this has to be split in two:

     body::before   the photograph, blurred
     body::after    the scrim and the grain, left sharp

   Blurring them together turns the grain to mush, and the grain is what keeps
   the floor from reading as a flat gradient once the photo goes soft. */
:root { --bg-blur: 10px; }

body { background-image: none; }

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  z-index: -2;
  background: url('img/desk.jpg') center center / cover no-repeat;
  filter: blur(var(--bg-blur));
  /* Overscan: a blur samples past its own edge, so a layer sized exactly to
     the viewport shows a soft grey band down all four sides. */
  transform: scale(1.08);
}

body::after {
  z-index: -1;
  background-image:
    linear-gradient(rgba(6,6,7,.40), rgba(6,6,7,.54)),
    var(--tex-grain);
  background-size: auto, 220px 220px;
  background-position: center, 0 0;
  background-repeat: no-repeat, repeat;
}

/* ── Header strip: no bar, just a bubble ───────────────────────────────────
   The full-width bar is gone. The strip still reserves the space and holds
   position, but it is invisible and transparent to the mouse — only its
   children take clicks, so the page scrolls normally under the empty stretch
   between them. The controls carry their own container instead. */
.app-header {
  background: none;
  backdrop-filter: none; -webkit-backdrop-filter: none;
  border-bottom: 0;
  pointer-events: none;
}
.app-header > * { pointer-events: auto; }

.topbar-right {
  gap: 4px;
  padding: 5px 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: 0 6px 18px rgba(0,0,0,.20);
}

/* Inside the bubble the controls drop their own borders and fills — a row of
   bordered pills inside a bordered pill reads as clutter. They light up on
   hover instead. */
.topbar-right .topbar-start,
.topbar-right .topbar-bell,
.topbar-right .topbar-add,
.topbar-right .topbar-user-btn {
  border-color: transparent;
  background: none;
  backdrop-filter: none; -webkit-backdrop-filter: none;
  box-shadow: none;
}
.topbar-right .topbar-start:hover,
.topbar-right .topbar-bell:hover,
.topbar-right .topbar-add:hover,
.topbar-right .topbar-user-btn:hover {
  background: rgba(255,255,255,.075);
  color: var(--text);
}

@media (min-width: 1025px) {
  /* Gloss dialled back. The sheen is now a hint rather than a highlight, and
     saturation drops to near-neutral so the module stops looking wet. */
  .app-frame {
    background:
      linear-gradient(160deg, rgba(255,255,255,.020) 0%, rgba(255,255,255,.007) 45%, rgba(255,255,255,0) 75%, rgba(255,255,255,.010) 100%),
      rgba(34,36,45,.58);
    backdrop-filter: blur(22px) saturate(118%);
    -webkit-backdrop-filter: blur(22px) saturate(118%);
    box-shadow: 0 20px 50px rgba(0,0,0,.38);
  }
}

/* WebP for anything that understands it — 95KB against 160KB for the same
   picture. Browsers that don't parse image-set() drop this declaration whole
   and keep the JPEG from the shorthand above, so it degrades on its own. */
body::before {
  background-image: image-set(url('img/desk.webp') type('image/webp'),
                              url('img/desk.jpg')  type('image/jpeg'));
}

/* ── Sidebar footer controls ───────────────────────────────────────────────
   Find people, add, notifications and the account menu moved out of the top
   bar and down here. The .sidebar-footer slot already existed and was already
   pinned to the bottom with margin-top:auto — it just had nothing in it. */
.sidebar-footer { display: flex; flex-direction: column; gap: 8px; }

/* Find people gets the full width — it is the one action here with a label. */
.sidebar-footer .topbar-start {
  width: 100%; height: 36px;
  justify-content: center;
}

/* Account fills the row; add and notifications sit beside it as icons. */
.sb-actions { display: flex; align-items: center; gap: 6px; }
.sb-actions .topbar-user { position: relative; flex: 1; min-width: 0; }
.sb-actions .topbar-user-btn { width: 100%; }
.sb-actions .topbar-user-name { max-width: none; }
.sb-actions .topbar-add,
.sb-actions .topbar-bell { flex: 0 0 auto; }

/* The menu opens UPWARD — anchored at the bottom of the screen there is no
   room beneath it, and it would otherwise be clipped by the frame. */
.sb-actions .topbar-user-menu {
  top: auto; bottom: calc(100% + 8px);
  left: 0; right: auto;
  min-width: 0; width: 100%;
}

@media (min-width: 1025px) {
  /* Nothing is left in the header on desktop — the hamburger inside it only
     appears at <=1024px — so it stops reserving 58px at the top of every
     page and the content starts where the content should start. */
  .app-header { display: none; }
  .main { padding-top: 28px; }

  /* Gloss down again: the sheen is now barely there and saturation is close
     to neutral, so the panel reads as a surface rather than a polished one. */
  .app-frame {
    background:
      linear-gradient(160deg, rgba(255,255,255,.012) 0%, rgba(255,255,255,.004) 45%, rgba(255,255,255,0) 75%, rgba(255,255,255,.006) 100%),
      rgba(34,36,45,.58);
    backdrop-filter: blur(20px) saturate(106%);
    -webkit-backdrop-filter: blur(20px) saturate(106%);
  }
}

/* Wallpaper blur eased back — enough to keep it as atmosphere, not so much
   that the photograph stops being a photograph. */
:root { --bg-blur: 5px; }

/* ── Glass, dialled right down ─────────────────────────────────────────────
   The old recipe layered a frost noise texture and a 135deg sheen over the
   tint, then pushed saturate(190%) brightness(1.10) through the backdrop. On
   one panel that reads as glass; on a page full of cards it piles up into
   visual noise and every card fights the one next to it.

   What is left is the part that was actually doing the work: a translucent
   tint and a modest blur. No texture, no sheen, near-neutral saturation. */
:root {
  --glass-bg:   rgba(20,21,26,.52);
  --glass-blur: blur(12px) saturate(112%);
}

/* Drawers keep more weight — they float over live content and have to stay
   readable — but they lose the texture-and-sheen stack for the same reason. */
.drawer {
  background: rgba(19,19,22,.80);
  backdrop-filter: blur(34px) saturate(115%);
  -webkit-backdrop-filter: blur(34px) saturate(115%);
}

/* ── Controls float at the top right ───────────────────────────────────────
   Back in the corner where they belong, but as a cluster rather than a bar:
   it reserves no width and no height, so it cannot push content down. Set in
   from the edge so it reads as floating ON the module, not welded to it. */
@media (min-width: 1025px) {
  .app-header {
    display: flex;
    top: 18px; right: 18px; left: auto;
    width: auto; height: auto;
    padding: 0;
  }
  /* Just enough to clear the cluster — was 84px when this was a full bar. */
  .main { padding-top: 60px; }

  /* Even glass, no diagonal highlight. A raking sheen across a panel this
     large is what was reading as "off" — it lights one corner and not the
     others, which nothing physical does at this scale. */
  .app-frame {
    background: rgba(34,36,45,.58);
    backdrop-filter: blur(20px) saturate(104%);
    -webkit-backdrop-filter: blur(20px) saturate(104%);
  }
}

/* Softly rounded, not pill-shaped. */
.topbar-right {
  gap: 4px;
  padding: 5px 6px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: 0 8px 22px rgba(0,0,0,.24);
}
.topbar-right .topbar-start,
.topbar-right .topbar-add,
.topbar-right .topbar-bell,
.topbar-right .topbar-user-btn { border-radius: 8px; }
.topbar-right .topbar-start { padding: 0 12px; }
.topbar-avatar { border-radius: 6px; }

/* ── Saturation to 80% ─────────────────────────────────────────────────────
   Below 100% the backdrop is DEsaturated — colour bleeding up through the
   glass gets pulled toward grey instead of pushed away from it, so panels
   read as calm rather than lit. Applied to all three glass surfaces so they
   agree; one left at 112% next to two at 80% is what makes glass look wrong. */
:root { --glass-blur: blur(12px) saturate(80%); }

.drawer {
  backdrop-filter: blur(34px) saturate(80%);
  -webkit-backdrop-filter: blur(34px) saturate(80%);
}

@media (min-width: 1025px) {
  .app-frame {
    backdrop-filter: blur(20px) saturate(80%);
    -webkit-backdrop-filter: blur(20px) saturate(80%);
  }

  /* ── Controls clamp into the top-right corner ────────────────────────────
     Not floating any more: pinned hard to the top edge and the right edge of
     the module, running left only as far as its own contents and then going
     straight up. Top and right borders come off because there is nothing to
     divide against — the frame's own edge is already there — which is what
     sells it as attached rather than laid on top.

     One rounded corner, bottom-left: the only corner that meets content. The
     other three are either flush with the frame or clipped by its radius. */
  .app-header {
    display: flex;
    top: 0; right: 0; left: auto;
    width: auto; height: auto;
    padding: 0;
  }

  .topbar-right {
    padding: 9px 14px;
    border: 1px solid var(--border);
    border-top: 0;
    border-right: 0;
    border-radius: 0 0 0 14px;
    box-shadow: -6px 6px 18px rgba(0,0,0,.22);
  }

  /* Clears the bar. Content on the left starts higher than the bar's underside
     would allow, but a wide table would otherwise slide under it. */
  .main { padding-top: 60px; }
}

/* ── Sidebar: thinner tint, heavier blur ───────────────────────────────────
   It was a near-solid slab — rgba(14,14,17,.58) over a 12px blur — so the
   wallpaper behind it barely registered and it read as a painted panel rather
   than glass.

   The two moves work together and have to: dropping the tint alone would let
   the photo through sharp enough to fight the nav labels, so the blur goes up
   as the opacity comes down. More of the background is visible, but only as
   colour and shape, which is what keeps the text legible. The tone goes a
   little darker to buy back the contrast the lower opacity gives away. */
.sidebar {
  background: rgba(10,10,13,.42);
  backdrop-filter: blur(28px) saturate(80%);
  -webkit-backdrop-filter: blur(28px) saturate(80%);
}

/* ── Top-right bar: borders back, height down ──────────────────────────────
   Two fixes that are really one. The controls had their borders and fills
   stripped when this was a pill-shaped bubble — inside a small floating pill
   a row of bordered buttons was clutter. Clamped into the corner it is a bar,
   not a pill, and a bar full of borderless buttons just reads as flat, so the
   borders come back.

   The height is what was pushing content down: 38px buttons plus 18px of
   padding made a 57px bar, and .main had to clear all of it. Taking the
   controls to 32px and trimming the padding gets that to ~46px, so the
   content starts meaningfully higher without tucking underneath. */
.topbar-right .topbar-start,
.topbar-right .topbar-add,
.topbar-right .topbar-bell,
.topbar-right .topbar-user-btn {
  border: 1px solid var(--border);
  background: var(--glass-bg);
  backdrop-filter: none; -webkit-backdrop-filter: none;
}
.topbar-right .topbar-start:hover,
.topbar-right .topbar-add:hover,
.topbar-right .topbar-bell:hover,
.topbar-right .topbar-user-btn:hover {
  background: var(--surface-2);
  border-color: var(--border-2);
  color: var(--text);
}

@media (min-width: 1025px) {
  .topbar-right { padding: 7px 12px; gap: 6px; }

  .topbar-right .topbar-start { height: 32px; padding: 0 12px; }
  .topbar-right .topbar-add,
  .topbar-right .topbar-bell { width: 32px; height: 32px; }
  .topbar-right .topbar-user-btn { padding: 3px 10px 3px 3px; }
  .topbar-right .topbar-avatar { width: 26px; height: 26px; }

  /* Clears the shorter bar with a hair to spare, and nothing more. */
  .main { padding-top: 48px; }
}

/* ── Back button, matched to the tabs ──────────────────────────────────────
   It was a 999px pill, which is why it read as odd: nothing else in the app
   is pill-shaped, so it looked like a control borrowed from somewhere else.
   Same 4px radius, padding, weight and hover behaviour as .tabs .tab, so it
   belongs to the same family as everything around it. */
.page-back {
  height: auto;
  padding: 7px 12px;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.045);
  backdrop-filter: none; -webkit-backdrop-filter: none;
  color: var(--text-2);
  font-size: 13px; font-weight: 500;
  transition: background .14s, color .14s, border-color .14s;
}
.page-back:hover {
  background: rgba(255,255,255,.085);
  border-color: rgba(255,255,255,.14);
  color: var(--text);
}

/* ── Lift the dark ─────────────────────────────────────────────────────────
   Taking the sheen off earlier went too far. A flat tint over a dark photo has
   nothing catching light, so every panel reads as a hole rather than a
   surface. The sheen comes back — but as a soft white lift, not the hard
   135deg rake that looked wet. */
:root {
  --glass-bg:
    linear-gradient(160deg, rgba(255,255,255,.050) 0%, rgba(255,255,255,.016) 45%, rgba(255,255,255,.028) 100%),
    rgba(22,23,29,.46);
}

/* Sidebar gets the same lift plus room to breathe — it was the darkest, most
   cramped surface on screen. */
.sidebar {
  padding: 20px 14px;
  background:
    linear-gradient(160deg, rgba(255,255,255,.058) 0%, rgba(255,255,255,.020) 42%, rgba(255,255,255,.034) 100%),
    rgba(16,17,22,.36);
}

@media (min-width: 1025px) {
  /* The module lifts with everything else, or it reads as a dark hole behind
     panels that are now catching light. */
  .app-frame {
    background:
      linear-gradient(160deg, rgba(255,255,255,.030) 0%, rgba(255,255,255,.010) 50%, rgba(255,255,255,.018) 100%),
      rgba(38,40,50,.52);
  }
}

/* Wallpaper blur down 30% (5px -> 3.5px) — more of the photograph reads
   through while it still sits back as atmosphere. */
:root { --bg-blur: 3.5px; }

/* ── Blur, not gloss ───────────────────────────────────────────────────────
   The white sheen goes back off. Every one of these surfaces is now a flat
   tint doing nothing but holding text, with the blur carrying the whole
   effect — more blur, no shine. That is the trade asked for, and it is the
   more honest one: gloss fakes a light source the photo behind it does not
   have, whereas blur is just what glass actually does. */
:root { --glass-bg: rgba(20,21,26,.50); }

.sidebar {
  background: rgba(12,13,17,.40);
  backdrop-filter: blur(30px) saturate(80%);
  -webkit-backdrop-filter: blur(30px) saturate(80%);
}

@media (min-width: 1025px) {
  /* No background at all — the module is pure blur over the wallpaper. There
     is no tint layer left, so the blur is doing every bit of the work and is
     raised to carry it. */
  .app-frame {
    background: none;
    backdrop-filter: blur(26px) saturate(80%);
    -webkit-backdrop-filter: blur(26px) saturate(80%);
  }

  /* ── Top-right controls, back to full size ──────────────────────────────
     These were taken down to 32px in a tight bar to win back vertical space.
     That trade is off: the buttons go back to a comfortable 38px with real
     padding and spacing between them, and .main clears the taller bar again.
     A ~59px bar costs the top of each page ~12px more than the compact one,
     which is the price of controls that do not feel cramped. */
  .topbar-right { padding: 10px 14px; gap: 8px; }

  .topbar-right .topbar-start { height: 38px; padding: 0 16px; }
  .topbar-right .topbar-add,
  .topbar-right .topbar-bell { width: 38px; height: 38px; }
  .topbar-right .topbar-user-btn { padding: 4px 12px 4px 4px; }
  .topbar-right .topbar-avatar { width: 30px; height: 30px; }

  .main { padding-top: 60px; }
}

/* ── The blue comes back: saturation over 100% ─────────────────────────────
   This is where it went. saturate() UNDER 100% desaturates the backdrop, so
   at 80% the colour bleeding up through the glass was being dragged toward
   grey — which is exactly the flatness that appeared. Over 100% it pushes the
   other way and the cool cast in the photo reads through the panels again.

   120%, not the 190% it started at: 190% was what made everything look
   lacquered. This is the half of the original recipe that was doing the good
   work, without the half that was not. The tint also leans a touch bluer so
   the panels stay cool even where the photo behind them is warm. */
:root {
  --glass-bg:   rgba(18,20,28,.50);
  --glass-blur: blur(12px) saturate(120%);
}

.drawer {
  backdrop-filter: blur(34px) saturate(120%);
  -webkit-backdrop-filter: blur(34px) saturate(120%);
}

/* Darker again, and re-saturated with everything else. */
.sidebar {
  background: rgba(9,10,15,.54);
  backdrop-filter: blur(30px) saturate(120%);
  -webkit-backdrop-filter: blur(30px) saturate(120%);
}

@media (min-width: 1025px) {
  /* Still no tint layer — the frame is pure blur, now carrying the colour
     through rather than washing it out. */
  .app-frame {
    background: none;
    backdrop-filter: blur(26px) saturate(120%);
    -webkit-backdrop-filter: blur(26px) saturate(120%);
  }
}

/* ── Frost back on ─────────────────────────────────────────────────────────
   The original recipe stacked three things and they got removed together,
   which was the mistake — they do different jobs:

     --tex-frost    fine noise. This is what reads as FROSTED glass rather
                    than merely out-of-focus glass. It is what was missed.
     --glass-sheen  a raking white highlight. This is what read as gloss.
     tint           the colour you look through.

   Frost and tint come back; the sheen stays off. Frosted, not lacquered. */
:root { --glass-bg: var(--tex-frost), rgba(18,20,28,.50); }

.drawer { background: var(--tex-frost), rgba(19,19,22,.78); }

.sidebar { background: var(--tex-frost), rgba(9,10,15,.54); }

@media (min-width: 1025px) {
  /* Texture only — no colour layer, so the module keeps the pure-blur look
     that worked while picking up the same grain as everything else. */
  .app-frame { background: var(--tex-frost); }
}

/* ── Frost on the module ───────────────────────────────────────────────────
   Texture alone was not enough: with no tint under it the grain had nothing
   to sit ON, so the frame still read as a plain blur. A light tint goes back
   underneath — far lighter than the .74 slab this started as, just enough to
   give the frost a surface and stop the module dissolving into the wallpaper. */
@media (min-width: 1025px) {
  .app-frame { background: var(--tex-frost), rgba(28,30,39,.34); }
}

/* ── Glass restored to the original recipe ─────────────────────────────────
   Taken verbatim from the pre-frame stylesheet rather than re-guessed. What
   had gone missing, in order of how much it mattered:

     brightness(1.10)  DROPPED ENTIRELY. This is the "too dark". It lifts the
                       backdrop so a panel catches light like real glass; with
                       it gone, every surface sat lower than the wallpaper
                       behind it no matter what the tint was doing.
     saturate(190%)    the real original — 120% was a guess, and it is the
                       saturation that carries the colour cast through.
     --glass-sheen     the third layer of the stack; frost is the grain, sheen
                       is the light on it. Frost alone reads as dirt.
     tint .40 not .50  lighter, so more of the photo comes through.

   All three surfaces go back to what they were, so they agree again. */
:root {
  --glass-tint: rgba(18,18,22,.40);
  --glass-bg:   var(--tex-frost), var(--glass-sheen), var(--glass-tint);
  --glass-blur: blur(14px) saturate(190%) brightness(1.10);
}

.sidebar {
  background:
    linear-gradient(160deg, rgba(255,255,255,.030) 0%, rgba(255,255,255,.012) 30%, rgba(255,255,255,0) 60%, rgba(255,255,255,.016) 100%),
    rgba(14,14,17,.58);
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
}

.drawer {
  background:
    var(--tex-frost),
    var(--glass-sheen),
    rgba(19,19,22,.72);
  backdrop-filter: blur(56px) saturate(190%) brightness(1.06);
  -webkit-backdrop-filter: blur(56px) saturate(190%) brightness(1.06);
}

@media (min-width: 1025px) {
  /* The frame did not exist in the original, so it joins the same family: the
     full three-layer stack over a light tint, with brightness slightly under
     the panels' so cards still read as sitting ON it rather than in it. */
  .app-frame {
    background:
      var(--tex-frost),
      var(--glass-sheen),
      rgba(24,25,32,.34);
    backdrop-filter: blur(26px) saturate(190%) brightness(1.06);
    -webkit-backdrop-filter: blur(26px) saturate(190%) brightness(1.06);
  }
}

/* Wallpaper blur eased once more: 3.5px -> 2.5px. */
:root { --bg-blur: 2.5px; }

/* ── Flash toast ───────────────────────────────────────────────────────────
   Bottom-left, over everything, gone on its own. Replaces the per-view card
   that used to shove the page down to announce something momentary. */
.toast {
  position: fixed;
  left: 22px; bottom: 22px;
  z-index: 500;
  display: flex; align-items: center; gap: 10px;
  max-width: min(420px, calc(100vw - 44px));
  padding: 11px 12px 11px 13px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--success);
  border-radius: 8px;
  background: var(--tex-frost), var(--glass-sheen), rgba(19,19,22,.82);
  backdrop-filter: blur(30px) saturate(170%) brightness(1.06);
  -webkit-backdrop-filter: blur(30px) saturate(170%) brightness(1.06);
  box-shadow: 0 16px 40px rgba(0,0,0,.46);
  color: var(--text); font-size: 13px; line-height: 1.4;
  /* Starts down and transparent; .in is added on the next frame so the
     transition actually runs instead of being skipped on first paint. */
  opacity: 0; transform: translateY(10px);
  transition: opacity .2s ease, transform .2s ease;
}
.toast.in { opacity: 1; transform: translateY(0); }
.toast-ic { flex: 0 0 auto; width: 17px; height: 17px; color: var(--success); display: inline-flex; }
.toast-ic svg { width: 17px; height: 17px; }
.toast-text { min-width: 0; flex: 1; }
.toast-x {
  flex: 0 0 auto; width: 22px; height: 22px; border-radius: 5px;
  border: 0; background: none; color: var(--text-3);
  cursor: pointer; font: inherit; font-size: 11px; line-height: 1;
}
.toast-x:hover { background: rgba(255,255,255,.09); color: var(--text); }
.toast.toast-err { border-left-color: var(--danger); }
.toast.toast-err .toast-ic { color: var(--danger); }

@media (prefers-reduced-motion: reduce) {
  .toast { transition: opacity .2s ease; transform: none; }
  .toast.in { transform: none; }
}

/* Lighter scrim over the wallpaper — more of the photograph, less black. */
body::after {
  background-image:
    linear-gradient(rgba(6,6,7,.22), rgba(6,6,7,.34)),
    var(--tex-grain);
}

/* Sidebar darker: .58 -> .70, and a slightly cooler, deeper base. The white
   sheen and the blur are kept exactly as they were — the point is to sink the
   panel so the active nav item and the brand mark read louder against it, not
   to flatten it back out. */
.sidebar {
  background:
    linear-gradient(160deg, rgba(255,255,255,.030) 0%, rgba(255,255,255,.012) 30%, rgba(255,255,255,0) 60%, rgba(255,255,255,.016) 100%),
    rgba(10,10,14,.70);
}

/* ── Account menu: readable, and clear of the bar ──────────────────────────
   It was inheriting --glass-bg, whose tint is .40 — fine for a card sitting on
   a photo, far too thin for a menu floating over live page content, which read
   straight through it. It gets the drawer's weight instead: an opaque-enough
   tint over its own heavy blur, so whatever is behind it turns to texture
   rather than competing text.

   It also sat 6px off the bar, which read as attached to it. 10px and a real
   shadow separate the two. */
.topbar-user-menu {
  top: calc(100% + 10px);
  min-width: 226px;
  background: var(--tex-frost), var(--glass-sheen), rgba(19,19,22,.88);
  backdrop-filter: blur(40px) saturate(180%) brightness(1.05);
  -webkit-backdrop-filter: blur(40px) saturate(180%) brightness(1.05);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 18px 46px rgba(0,0,0,.52);
  padding: 7px;
}

@media (min-width: 1025px) {
  /* Tighter gutter between the sidebar and the content. The sidebar already
     floats 12px off the frame, so 36px of padding on top of that put content
     nearly 50px from the panel — more of a gap than a gutter. */
  .main { padding-left: 22px; }
}

/* Module tint set to a near-black at 52%, as specified. Frost and sheen stay
   on top of it; the backdrop-filter is untouched. */
@media (min-width: 1025px) {
  .app-frame {
    background: var(--tex-frost), var(--glass-sheen), rgb(3 3 3 / 52%);
  }
}

/* Module tint updated to a cooler, slightly lighter near-black at 57%. */
@media (min-width: 1025px) {
  .app-frame {
    background: var(--tex-frost), var(--glass-sheen), rgb(19 21 24 / 57%);
  }
}

/* ── Header becomes a real bar again ───────────────────────────────────────
   Not fixed, not clamped to the corner: it sits IN the flow at the top of the
   content column, so it is exactly as wide as the content beneath it and it
   scrolls away with the page instead of following you down. Back lives in it
   on the left, the controls on the right.

   Being in the flow is also why .main's top padding drops right back — the bar
   occupies real space now rather than hovering over reserved space. */
@media (min-width: 1025px) {
  .app-header {
    position: static;
    display: flex;
    align-items: center;
    gap: 12px;
    top: auto; right: auto; left: auto;
    width: auto; height: auto;
    margin: 0 0 20px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--tex-frost), var(--glass-sheen), rgb(19 21 24 / 57%);
    backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
    pointer-events: auto;
  }

  /* The bar carries the container now, so the right-hand group stops being one
     of its own — nested containers were the part that looked odd. */
  .topbar-right {
    padding: 0;
    gap: 6px;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    backdrop-filter: none; -webkit-backdrop-filter: none;
  }

  .main { padding-top: 22px; }
}

/* Back is a bar control now, so it loses the block margin it had in the flow. */
.app-header .page-back { margin: 0; }

/* Wallpaper blur eased again: 2.5px -> 1.5px. */
:root { --bg-blur: 1.5px; }

/* ── Controls float again, as a pill ───────────────────────────────────────
   Back to fixed, inset from the top-right corner, fully rounded.

   This also fixes the dropdown. As an in-flow bar the header lived inside
   .main, and .main has overflow-y:auto — which clips absolutely positioned
   descendants. The account menu was being cut off by its own scroll container.
   Fixed positioning takes the header out of .main's box entirely, so there is
   nothing left to clip it. */
@media (min-width: 1025px) {
  .app-header {
    position: fixed;
    top: 18px; right: 18px; left: auto;
    width: auto; height: auto;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    backdrop-filter: none; -webkit-backdrop-filter: none;
    /* The strip holds no width of its own; only the pill takes clicks, so the
       empty space around it never intercepts anything. */
    pointer-events: none;
  }
  .app-header > * { pointer-events: auto; }

  /* The pill: fully rounded, its own glass, its own shadow. */
  .topbar-right {
    padding: 6px 8px;
    gap: 6px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--tex-frost), var(--glass-sheen), rgb(19 21 24 / 72%);
    backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
    box-shadow: 0 10px 28px rgba(0,0,0,.32);
  }

  /* Round contents to match the shell they sit in. */
  .topbar-right .topbar-start,
  .topbar-right .topbar-add,
  .topbar-right .topbar-bell,
  .topbar-right .topbar-user-btn { border-radius: 999px; }
  .topbar-right .topbar-avatar { border-radius: 50%; }

  /* The pill floats over the top-right corner, which is empty on every page —
     titles and Back are left-aligned — so content does not need to clear it. */
  .main { padding-top: 26px; }
}

/* Back is a flow control again, so its bottom margin returns. */
.page-back { margin: 0 0 16px; }

/* Wallpaper blur back up: 1.5px -> 4px. At 1.5px the photo was sharp enough to
   compete with the content sitting on it. */
:root { --bg-blur: 4px; }

@media (min-width: 1025px) {
  /* Pulled in off the right edge — 18px sat it almost against the frame. */
  .app-header { top: 20px; right: 28px; }

  /* Harder corners, matching the rest of the platform: 10px on the shell, 6px
     inside it, the same relationship cards and drawers use. Fully round read
     as a control borrowed from elsewhere. */
  .topbar-right { border-radius: 10px; }
  .topbar-right .topbar-start,
  .topbar-right .topbar-add,
  .topbar-right .topbar-bell,
  .topbar-right .topbar-user-btn { border-radius: 6px; }
  .topbar-right .topbar-avatar { border-radius: 5px; }
}

/* Scrim lightened again: .22/.34 -> .14/.24. This is the dark overlay ON the
   wallpaper — the photo itself was never the dark part. */
body::after {
  background-image:
    linear-gradient(rgba(6,6,7,.14), rgba(6,6,7,.24)),
    var(--tex-grain);
}

/* ── Controls at the foot of the sidebar ───────────────────────────────────
   Moved out of the floating pill. The pill never sat right because it was a
   free-floating object with no relationship to anything around it — every
   attempt to size and place it was guesswork against the content behind it.
   In the sidebar it inherits a column that already has a width, a rhythm and
   an edge, so it is measured against something.

   Find and Add are the two actions that CREATE work, so they sit side by side
   as equals. The account menu and notifications are the quieter row below. */
.sidebar-footer { display: flex; flex-direction: column; gap: 8px; }

/* Two peers, equal width, no matter how long the labels get. */
.sb-primary { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.sb-primary > * { min-width: 0; }
.sidebar-footer .topbar-start,
.sidebar-footer .topbar-add {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; height: 34px; padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--glass-bg);
  color: var(--text-2);
  font: inherit; font-size: 12.5px; font-weight: 500;
  cursor: pointer;
}
.sidebar-footer .topbar-start:hover,
.sidebar-footer .topbar-add:hover { background: var(--surface-2); color: var(--text); }
.sidebar-footer .topbar-add svg,
.sidebar-footer .topbar-start svg { width: 15px; height: 15px; flex: 0 0 auto; }
.sb-btn-label { white-space: nowrap; }
/* The label would otherwise wrap or clip in a half-width button. */
.sidebar-footer .topbar-start-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Account fills the row; notifications sit beside it. */
.sb-actions { display: flex; align-items: center; gap: 6px; }
.sb-actions .topbar-user { position: relative; flex: 1; min-width: 0; }
.sb-actions .topbar-user-btn { width: 100%; border-radius: 6px; }
.sb-actions .topbar-user-name { max-width: none; }
.sb-actions .topbar-bell { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 6px; }

/* Anchored at the bottom of the screen, the menu has to open UPWARD. */
.sb-actions .topbar-user-menu {
  top: auto; bottom: calc(100% + 8px);
  left: 0; right: auto;
  width: 100%; min-width: 0;
}

@media (min-width: 1025px) {
  /* Nothing left in the header on desktop — the hamburger inside it only shows
     at <=1024px — so it stops occupying the top of every page. */
  .app-header { display: none; }
  .main { padding-top: 22px; }
}

/* ── Filter rebalance: less saturation, more light ─────────────────────────
   190% was pushing the colour bleeding through the glass well past anything
   the photo actually contains, which is the over-saturated look. 130% still
   carries the cast without inventing it.

   Brightness goes the other way — 1.10 was doing too little to lift panels off
   a dark backdrop. Note this multiplies the backdrop: 1.8 would be nearly
   double and would blow the glass out to near-white, so this is 1.18. Say the
   word if you want it pushed further and I will keep going in steps. */
:root { --glass-blur: blur(14px) saturate(130%) brightness(1.18); }

.drawer {
  backdrop-filter: blur(56px) saturate(130%) brightness(1.14);
  -webkit-backdrop-filter: blur(56px) saturate(130%) brightness(1.14);
}

.topbar-user-menu {
  backdrop-filter: blur(40px) saturate(130%) brightness(1.12);
  -webkit-backdrop-filter: blur(40px) saturate(130%) brightness(1.12);
}

.toast {
  backdrop-filter: blur(30px) saturate(130%) brightness(1.12);
  -webkit-backdrop-filter: blur(30px) saturate(130%) brightness(1.12);
}

@media (min-width: 1025px) {
  .app-frame {
    backdrop-filter: blur(26px) saturate(125%) brightness(1.12);
    -webkit-backdrop-filter: blur(26px) saturate(125%) brightness(1.12);
  }
}

/* ── Account row: full width, real photo ───────────────────────────────────
   The bell is gone, so nothing shares the row and the account button takes all
   of it. Notifications moved into the menu itself — the bell was the only way
   into that drawer, so removing it without a replacement would have stranded
   them. */
.sb-actions { display: block; }
.sb-actions .topbar-user { width: 100%; }
.sb-actions .topbar-user-btn { width: 100%; justify-content: flex-start; }
/* Pushes the chevron to the far edge so the row reads as one full-width
   control rather than a button with slack after it. */
.sb-actions .topbar-user-btn .chev { margin-left: auto; }

/* The photo where one is set; the initials block stays the fallback. */
.topbar-avatar-img {
  object-fit: cover;
  display: block;
  flex: 0 0 auto;
  background: var(--surface-2);
}

/* Unread count on the menu row, standing in for the badge the bell carried. */
.topbar-user-menu .menu-count {
  margin-left: auto;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px;
  background: var(--accent); color: #fff;
  font-size: 10.5px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}

/* ══ EXPERIMENT: panels take their colour FROM the backdrop ════════════════
   Delete from here to the end of the file to revert. Nothing above is touched.

   The problem this is aimed at: every surface carried a FIXED tint —
   rgba(18,18,22,…) on cards, rgba(9,10,15,…) on the sidebar — while the
   wallpaper can be any of eleven photographs. A cool grey panel sitting on a
   warm photo reads as disconnected no matter which value is chosen, and the
   sidebar looked like a different material from the cards because it literally
   was a different colour. Changing the background made it worse because the
   panels did not move with it.

   The fix is to stop specifying a colour at all. Darkening is done with
   brightness() INSIDE the backdrop-filter instead of an rgba overlay on top,
   so a panel is a darkened, blurred slice of whatever is actually behind it.
   It cannot clash with the wallpaper, because it IS the wallpaper. Swap the
   photo and every surface re-tints itself to match, for free.

   Frost and sheen stay — they are colourless and are what makes it read as
   glass rather than as a dimmed rectangle. */
:root {
  --glass-bg:   var(--tex-frost), var(--glass-sheen);
  --glass-blur: blur(16px) saturate(115%) brightness(.46);
}

/* Same material as the cards, a shade deeper so the nav still sits back. This
   is the part that should stop feeling like a different component. */
.sidebar {
  background: var(--tex-frost), var(--glass-sheen);
  backdrop-filter: blur(30px) saturate(115%) brightness(.34);
  -webkit-backdrop-filter: blur(30px) saturate(115%) brightness(.34);
}

@media (min-width: 1025px) {
  /* The module is the lightest step, so cards read as sitting ON it. */
  .app-frame {
    background: var(--tex-frost), var(--glass-sheen);
    backdrop-filter: blur(26px) saturate(115%) brightness(.62);
    -webkit-backdrop-filter: blur(26px) saturate(115%) brightness(.62);
  }
}

/* With every panel darkening its own backdrop, the global scrim is no longer
   carrying legibility — so the wallpaper can finally be bright. More blur
   keeps it from competing now that it is no longer dimmed. */
:root { --bg-blur: 9px; }

body::after {
  background-image:
    linear-gradient(rgba(6,6,7,.06), rgba(6,6,7,.12)),
    var(--tex-grain);
}

/* ── Contrast floor, without reintroducing a hue ───────────────────────────
   brightness() alone was the mistake: it SCALES what is behind, so over a dark
   photo a panel goes dark and over a bright one it stays bright. There is no
   floor, which is exactly the inconsistent contrast that showed up.

   A neutral BLACK layer fixes that — it is a fixed darkness the photo cannot
   undo. Black is the one tint with no hue to clash: it darkens without ever
   pulling the panel blue or warm, which is what the rgba(18,18,22) tints were
   doing. So: black for guaranteed contrast, saturate() to keep the colour of
   whatever shows through, brightness() only as a gentle extra pull.

   Cards stay the readable step; sidebar deeper so nav sits back; frame lighter
   so cards read as sitting on it. */
:root {
  --glass-bg:   var(--tex-frost), var(--glass-sheen), rgba(0,0,0,.50);
  --glass-blur: blur(16px) saturate(125%) brightness(.78);
}

.sidebar {
  background: var(--tex-frost), var(--glass-sheen), rgba(0,0,0,.62);
  backdrop-filter: blur(30px) saturate(125%) brightness(.70);
  -webkit-backdrop-filter: blur(30px) saturate(125%) brightness(.70);
}

@media (min-width: 1025px) {
  .app-frame {
    background: var(--tex-frost), var(--glass-sheen), rgba(0,0,0,.34);
    backdrop-filter: blur(26px) saturate(125%) brightness(.86);
    -webkit-backdrop-filter: blur(26px) saturate(125%) brightness(.86);
  }
}

/* A little scrim back: it is the cheapest guarantee that a very bright photo
   never starts from full white underneath everything. */
body::after {
  background-image:
    linear-gradient(rgba(6,6,7,.14), rgba(6,6,7,.22)),
    var(--tex-grain);
}

/* ── Full-bleed shell, floating sidebar ────────────────────────────────────
   The module loses its margins and fills the viewport: no inset, no corners,
   no border, no shadow. What it does NOT lose is its backdrop-filter — that is
   still what blurs the wallpaper behind everything, and it is also still what
   makes .app-frame the containing block for the fixed sidebar. Take the filter
   away and the shell falls apart; take only the inset away and it does not.

   The sidebar keeps floating: inset on all four sides with its own corners,
   now against the screen edge rather than the module's. That contrast — a
   floating panel on an edge-to-edge ground — is the whole look here. */
@media (min-width: 1025px) {
  .app-frame {
    inset: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  /* A touch more room now that it floats against the screen edge, where a
     tight gap reads as a mistake rather than a gap. */
  .sidebar {
    inset: 14px auto 14px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
  }

  .app-header { left: calc(var(--sidebar-w) + 28px); }
  .main { margin-left: calc(var(--sidebar-w) + 28px); }
}

/* ── Lighter, deeper blur, and an actual glow ──────────────────────────────
   Three separate moves, because "not glassy enough" is three problems:

     lighter   black floor eased on every surface, brightness raised toward 1
     blurrier  a bigger backdrop blur is what separates frosted glass from a
               dark rectangle — at 16px the backdrop was still legible enough
               to read as "dimmed page", not "glass"
     glow      an inset hairline along the top edge and a dark one along the
               bottom. This is the part that was missing: real glass catches a
               highlight on its top edge and shades on its lower one, and that
               pair is what the eye reads as THICKNESS rather than a flat film. */
:root {
  --glass-bg:   var(--tex-frost), var(--glass-sheen), rgba(0,0,0,.32);
  --glass-blur: blur(28px) saturate(135%) brightness(.98);
}

.card,
.kpi {
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.10),
    inset 0 -1px 0 rgba(0,0,0,.22),
    0 10px 30px rgba(0,0,0,.34);
}

.sidebar {
  background: var(--tex-frost), var(--glass-sheen), rgba(0,0,0,.44);
  backdrop-filter: blur(42px) saturate(135%) brightness(.90);
  -webkit-backdrop-filter: blur(42px) saturate(135%) brightness(.90);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.09),
    0 12px 34px rgba(0,0,0,.30);
}

@media (min-width: 1025px) {
  .app-frame {
    background: var(--tex-frost), var(--glass-sheen), rgba(0,0,0,.20);
    backdrop-filter: blur(34px) saturate(135%) brightness(1.02);
    -webkit-backdrop-filter: blur(34px) saturate(135%) brightness(1.02);
  }
}

/* ── Drop the inset edge lines, keep the glow ──────────────────────────────
   The inset hairlines are gone. They were meant to read as the thickness of
   the glass, but at these radii they draw as a second border just inside the
   real one — which is the doubled, outlined look, not depth.

   The glassiness itself is untouched: the light tint, the deep blur and the
   sheen are all still doing the work. Only the drawn lines go. */
.card,
.kpi { box-shadow: 0 10px 30px rgba(0,0,0,.34); }

.sidebar { box-shadow: 0 12px 34px rgba(0,0,0,.30); }

/* Darker ground behind everything — the panels stay light, the floor drops,
   which is what widens the separation between them. */
body::after {
  background-image:
    linear-gradient(rgba(6,6,7,.34), rgba(6,6,7,.46)),
    var(--tex-grain);
}

/* ── Margins back: the module sits inside the wallpaper again ──────────────
   Inset, corners, border and shadow all return, so the background photograph
   runs around the outside of the app rather than only behind it. The sidebar
   keeps floating — now against the module's edge again rather than the
   screen's, which is the arrangement that read best. */
@media (min-width: 1025px) {
  .app-frame {
    inset: var(--shell-inset-y) var(--shell-inset-x);
    border: 1px solid var(--border);
    border-radius: var(--shell-radius);
    box-shadow: 0 20px 50px rgba(0,0,0,.38);
  }

  /* Darker than anything else on screen. The nav is chrome, not content — it
     should sit UNDER the cards in the visual order, and it was reading at
     roughly their weight, which is what made it feel oddly prominent. */
  .sidebar {
    background: var(--tex-frost), var(--glass-sheen), rgba(0,0,0,.66);
    backdrop-filter: blur(42px) saturate(125%) brightness(.72);
    -webkit-backdrop-filter: blur(42px) saturate(125%) brightness(.72);
  }
}

/* ── The cool tint returns ─────────────────────────────────────────────────
   Two changes per surface, and they do different things:

     the tint layer goes from pure black to a blue-black. Same alpha, so the
     contrast floor set earlier is unchanged — only the hue moves. This is what
     brings the cast back on a neutral or cool photo.

     a faint blue wash sits above it. Needed because the tint alone disappears
     over a warm photograph: the backdrop pushes it back toward amber and the
     panel stops reading blue at all. The wash is a fixed cool layer that
     survives whatever the wallpaper is doing, which is what makes the feel
     consistent across all eleven images.

   Kept deliberately light — this is a tint, not a colour. */
:root {
  --glass-bg:
    var(--tex-frost),
    var(--glass-sheen),
    linear-gradient(rgba(96,140,215,.060), rgba(96,140,215,.032)),
    rgba(9,15,30,.34);
}

@media (min-width: 1025px) {
  .sidebar {
    background:
      var(--tex-frost),
      var(--glass-sheen),
      linear-gradient(rgba(96,140,215,.055), rgba(96,140,215,.028)),
      rgba(7,12,26,.68);
  }

  .app-frame {
    background:
      var(--tex-frost),
      var(--glass-sheen),
      linear-gradient(rgba(96,140,215,.050), rgba(96,140,215,.026)),
      rgba(10,16,32,.22);
  }
}

/* ── Same cool cast, roughly a quarter of the strength ─────────────────────
   The wash drops from .060 to .015, and the tint's hue pulls most of the way
   back toward neutral (9,15,30 -> 5,8,14). Both were overdone.

   Alphas on the tint layer are untouched again, so the contrast floor still
   does not move — this is purely how much colour is in it. At this strength
   it should register as "cool" rather than as "blue": noticeable if you look
   for it, invisible if you are not. */
:root {
  --glass-bg:
    var(--tex-frost),
    var(--glass-sheen),
    linear-gradient(rgba(96,140,215,.015), rgba(96,140,215,.008)),
    rgba(5,8,14,.34);
}

@media (min-width: 1025px) {
  .sidebar {
    background:
      var(--tex-frost),
      var(--glass-sheen),
      linear-gradient(rgba(96,140,215,.013), rgba(96,140,215,.007)),
      rgba(4,6,12,.68);
  }

  .app-frame {
    background:
      var(--tex-frost),
      var(--glass-sheen),
      linear-gradient(rgba(96,140,215,.012), rgba(96,140,215,.006)),
      rgba(5,8,15,.22);
  }
}

/* Sidebar deeper again: tint .68 -> .80, backdrop pulled to .62. The faint
   cool wash and the blur stay as they are — only the darkness moves, so it
   sinks further behind the cards without changing material. */
@media (min-width: 1025px) {
  .sidebar {
    background:
      var(--tex-frost),
      var(--glass-sheen),
      linear-gradient(rgba(96,140,215,.013), rgba(96,140,215,.007)),
      rgba(4,6,12,.80);
    backdrop-filter: blur(42px) saturate(125%) brightness(.62);
    -webkit-backdrop-filter: blur(42px) saturate(125%) brightness(.62);
  }
}

/* Wallpaper lifted 50%. This goes on the photo layer itself rather than the
   scrim above it, so it is a true exposure change on the image — the scrim
   stays where it is and keeps tempering the highlights.

   The blur has to be restated: filter is a single property, so setting
   brightness alone would drop the blur entirely. */
body::before {
  filter: blur(var(--bg-blur)) brightness(1.5);
}

/* Module down 10%: brightness 1.02 -> .92. Done on the filter rather than the
   tint so the frame darkens uniformly with whatever is behind it, instead of
   laying more flat black over a photo that was just brightened. */
@media (min-width: 1025px) {
  .app-frame {
    backdrop-filter: blur(34px) saturate(135%) brightness(.92);
    -webkit-backdrop-filter: blur(34px) saturate(135%) brightness(.92);
  }
}

/* Module background set as specified — the wash now runs from a faint cool top
   to a black bottom, so the frame carries a vertical gradient of its own. */
@media (min-width: 1025px) {
  .app-frame {
    background: var(--tex-frost), var(--glass-sheen), linear-gradient(rgba(96, 140, 215, .012), rgb(0 0 0 / 26%)), rgba(5, 8, 15, .22);
  }
}

/* Cards drop their --glass-bg layer. The backdrop-filter, border and shadow
   stay, so a card is now purely a blurred, darkened slice of the module
   beneath it with no tint of its own. Scoped to .card only — KPI tiles, menus
   and the toast still take the token. */
.card { background: none; }

/* Sidebar goes neutral: the cool wash layer is dropped and the tint moves off
   the blue-black (4,6,12) onto true black. It is the darkest surface in the
   app, and a hue reads strongest exactly where a surface is heaviest — which
   is why the wash showed here and stayed invisible on the lighter panels.
   Frost, sheen and blur are untouched. */
@media (min-width: 1025px) {
  .sidebar {
    background:
      var(--tex-frost),
      var(--glass-sheen),
      rgba(0,0,0,.82);
  }
}

/* Side margins off: the module runs edge to edge horizontally and keeps its
   top and bottom gap, so the wallpaper shows as bands above and below rather
   than a full surround. Background, blur, border and radius all stay — this is
   only the inset. */
@media (min-width: 1025px) {
  .app-frame { inset: var(--shell-inset-y) 0; }
}

/* Full bleed: no inset on any side, no corners. The border and shadow go with
   them — pressed against the viewport edge a 1px border draws as a hairline
   box around the whole screen, and a drop shadow has nowhere to fall. The
   background stack and the blur stay, so the module still tints and blurs the
   wallpaper; it just has no visible edge of its own any more. */
@media (min-width: 1025px) {
  .app-frame {
    inset: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
}

/* ── 1. Module overlay ~15% darker ─────────────────────────────────────────
   Done on brightness rather than the tint so it darkens WITH the wallpaper
   instead of laying more flat black over a photo that is being brightened. */
@media (min-width: 1025px) {
  .app-frame {
    backdrop-filter: blur(34px) saturate(135%) brightness(.78);
    -webkit-backdrop-filter: blur(34px) saturate(135%) brightness(.78);
  }
}

/* ── 2. Kill the card pop-in ───────────────────────────────────────────────
   Cards were fading AND sliding in on every page load, staggered up to .37s.
   The slide is what made it look broken rather than merely animated: moving a
   backdrop-filter element forces the browser to re-sample its backdrop every
   frame, and the blur renders wrong — or not at all — for the duration, then
   snaps to correct at the end. That snap is the "background pops in".

   Rows keep their entrance: they sit inside an already-painted card and carry
   no backdrop-filter of their own, so nothing re-rasterises. */
@media (prefers-reduced-motion: no-preference) {
  .main > *:not(.drawer):not(.drawer-backdrop):not(.tribe-panel):not(.tribe-panel-scrim):not(.slideover):not(.slideover-scrim) {
    animation: none;
  }
  .main > *:nth-child(1),
  .main > *:nth-child(2),
  .main > *:nth-child(3),
  .main > *:nth-child(4),
  .main > *:nth-child(5),
  .main > *:nth-child(6),
  .main > *:nth-child(7),
  .main > *:nth-child(n+8) { animation-delay: 0s; }
}

/* ── 3. Cards get their glass back, everywhere ─────────────────────────────
   .card had been set to `background: none` while trying the no-fill look, so
   cards were carrying only a blur while KPI tiles, menus and the toast still
   had the full treatment — which is why a few panels looked like the
   background "didn't apply" to them. One token, so every card matches.

   .card.card-photo is (0,2,0) and still wins, keeping its own image. */
.card { background: var(--glass-bg); }

/* ── 4. Nav counts, softened ───────────────────────────────────────────────
   A solid accent fill with white text is the loudest thing the sidebar can
   draw, and it was shouting next to labels that are quiet grey. Same treatment
   as the soft pills on Home: a 15% accent wash with accent-tinted text, so it
   still reads as "there is something here" without the glare. */
.nav a .badge-n.badge-accent {
  background: var(--accent-soft);
  color: #ffa274;
  font-weight: 700;
}

/* 10px of left padding on the module. Worth knowing this moves the sidebar
   too: .app-frame has a backdrop-filter, which makes it the containing block
   for its fixed children, and that containing block is the PADDING box — so
   the floating sidebar starts 10px further in as well, which is the point. */
@media (min-width: 1025px) {
  .app-frame { padding-left: 10px; }

  /* 5px more above and below the nav, same 14px either side. */
  .sidebar { padding: 25px 14px; }
}

/* Sidebar inner padding back to where it was, with a shorter top: the 10px on
   the frame is what pushes the panel in from outside, so it does not need
   padding of its own to do that job. Top trimmed to 14px so the brand mark
   sits closer to the panel's edge; sides and bottom left alone. */
@media (min-width: 1025px) {
  .sidebar { padding: 14px 14px 20px; }
}

/* More air around the sidebar panel — all of it OUTSIDE, so the nav's own
   contents do not move:
     frame padding-left  10px -> 20px   (space to the left of the panel)
     sidebar inset       14px -> 18px   (space above, below, and off the frame)
     main margin         +28px -> +38px (gap between the panel and the content)
   The panel now sits 20 + 18 = 38px in from the screen edge. */
@media (min-width: 1025px) {
  .app-frame { padding-left: 20px; }

  .sidebar { inset: 18px auto 18px 18px; }

  .app-header { left: calc(var(--sidebar-w) + 38px); }
  .main       { margin-left: calc(var(--sidebar-w) + 38px); }
}

/* A little more air above the sidebar panel — top only, so the bottom stays
   anchored where it is. */
@media (min-width: 1025px) {
  .sidebar { inset: 26px auto 18px 18px; }
}

/* Spacing pass: panel sits lower and further in, with a wider gutter to the
   content. All outer — the nav's own padding is untouched.
     top inset          26px -> 31px
     frame padding-left 20px -> 28px
     gutter to content  +38px -> +50px */
@media (min-width: 1025px) {
  .app-frame { padding-left: 28px; }
  .sidebar   { inset: 31px auto 18px 18px; }

  .app-header { left: calc(var(--sidebar-w) + 50px); }
  .main       { margin-left: calc(var(--sidebar-w) + 50px); }
}

/* Gutter between the sidebar and the content cut by 30px: +50px -> +20px. */
@media (min-width: 1025px) {
  .app-header { left: calc(var(--sidebar-w) + 20px); }
  .main { margin-left: calc(var(--sidebar-w) + 20px); }
}

/* Panel up 4px: top inset 31px -> 27px. */
@media (min-width: 1025px) {
  .sidebar { inset: 27px auto 18px 18px; }
}

/* Other way: more top margin, not less. 31px -> 35px. */
@media (min-width: 1025px) {
  .sidebar { inset: 35px auto 18px 18px; }
}

/* The gutter was being measured from the wrong origin. .main's margin starts at
   the frame's content box, but the sidebar is inset 18px from that same edge —
   so `sidebar-w + 20px` left a real gap of about 2px, not 20px. The sidebar's
   own inset has to be in the sum:
       18px (inset) + 230px (width) + 20px (gap) = 268px
   Expressed with the tokens so it survives a change to either one. */
@media (min-width: 1025px) {
  .sidebar { inset: 31px auto 18px 18px; }

  .app-header { left: calc(18px + var(--sidebar-w) + 20px); }
  .main       { margin-left: calc(18px + var(--sidebar-w) + 20px); }
}

/* Back to 35px, then 2px closer to the top: 33px. */
@media (min-width: 1025px) {
  .sidebar { inset: 33px auto 18px 18px; }
}

/* Gutter, correctly this time.
   The two edges are measured from DIFFERENT origins, which is what I had wrong:
     .sidebar is fixed, so it positions against the frame's PADDING box  -> 0
     .main's margin starts at the frame's CONTENT box                    -> 28px
   So the frame's padding-left was being added on top of the margin, pushing
   content further out rather than closer.

     sidebar right edge = 18px inset + 230px width          = 248px
     content left edge  = 28px padding + margin
     for a 20px gap:      margin = 18 + 230 + 20 - 28       = 240px */
@media (min-width: 1025px) {
  .app-header { left: calc(18px + var(--sidebar-w) + 20px - 28px); }
  .main       { margin-left: calc(18px + var(--sidebar-w) + 20px - 28px); }
}

/* Tighter still: 20px gap -> 8px. */
@media (min-width: 1025px) {
  .app-header { left: calc(18px + var(--sidebar-w) + 8px - 28px); }
  .main       { margin-left: calc(18px + var(--sidebar-w) + 8px - 28px); }
}

/* Sidebar 3px closer to the top: 33px -> 30px. */
@media (min-width: 1025px) {
  .sidebar { inset: 30px auto 18px 18px; }
}

/* ── Brand block: no top or left padding ───────────────────────────────────
   Was `padding: 10px 10px 14px` — 10px top and 10px left. Both go; the right
   and bottom stay, so the mark sits flush to the panel's own padding edge and
   the rule under it keeps its breathing room.

   This alone lifts everything in the sidebar by 10px, which is most of what
   made the top feel heavy: the gap above the mark was the sidebar's inset PLUS
   its padding PLUS this. */
.brand { padding: 0 10px 14px 0; }

/* And the panel itself moves up: inset 30px -> 22px. */
@media (min-width: 1025px) {
  .sidebar { inset: 22px auto 18px 18px; }
}

/* ── Sidebar wider, gutter matched to the page grid ────────────────────────
   Width 230px -> 244px (+14).

   The gap to the content becomes 12px, which is not an arbitrary pick: it is
   the same `gap` .kpis uses between tiles, so the space between the panel and
   the content column now reads as part of the same rhythm as the space between
   the cards inside it.

   Because the gutter is expressed against var(--sidebar-w), widening the panel
   moves the content across by exactly the same amount — the gap stays put
   instead of having to be re-tuned. */
@media (min-width: 1025px) {
  :root { --sidebar-w: 244px; }

  .app-header { left: calc(18px + var(--sidebar-w) + 12px - 28px); }
  .main       { margin-left: calc(18px + var(--sidebar-w) + 12px - 28px); }
}

/* ── The gap was two values, not one ───────────────────────────────────────
   .main carries `padding-left: 22px` on desktop as well as its margin, so the
   visible distance from the sidebar was margin + padding = 12 + 22 = 34px.
   Every adjustment to the margin was being added to a padding I had left in
   place, which is why the gap never landed where the arithmetic said.

   Padding-left goes to zero so ONE value controls this distance. The margin is
   that value, and it stays at 12px to match the .kpis grid gap. Top, right and
   bottom padding are untouched. */
@media (min-width: 1025px) {
  .main { padding-left: 0; }
}

/* Gap between the sidebar and the content: 12px -> 22px. Single value now that
   .main's padding-left is zero, so this is the whole distance. */
@media (min-width: 1025px) {
  .app-header { left: calc(18px + var(--sidebar-w) + 22px - 28px); }
  .main       { margin-left: calc(18px + var(--sidebar-w) + 22px - 28px); }
}

/* ── Reports: drop the negative margin ─────────────────────────────────────
   .rpt-page had `margin-inline: -14px` to claw back part of .main's 36px side
   padding. .main's padding-left is now 0, so that negative margin drags the
   page out past its own column — 14px into the sidebar gutter on the left and
   14px past the content edge on the right.

   That overflow is what broke scrolling, not the charts: a child wider than
   .main forces its computed overflow-x from visible to auto, and the frame
   clips what spills, so the page ends up in a container that can neither show
   the overflow nor scroll cleanly.

   Zero here. The charts stay full-width because their SVGs are width:100% —
   they were never relying on this to size themselves. */
@media (min-width: 1025px) {
  .rpt-page { margin-inline: 0; }
}

/* ── Nothing changes instantly on hover ────────────────────────────────────
   Interactive surfaces get a short transition on the properties that actually
   change under the cursor. 140ms — comfortably above the 50ms floor, still
   quick enough to feel responsive rather than laggy.

   Wrapped in :where() so the whole rule carries ZERO specificity. Anything
   that already declares its own transition (the tabs, the buttons, the back
   link) keeps it and is not overridden; this only fills in the gaps.

   Only paint properties are listed. Transitioning transform or filter here
   would re-rasterise backdrop-filter panels on hover, which is the same thing
   that made cards pop on load. */
:where(
  a, button, select, input, textarea, summary,
  .qrow, .trow, .card, .kpi, .pill, .badge-n, .tab, .nav a,
  .hdrbg-thumb, .topbar-start, .topbar-add, .topbar-bell, .topbar-user-btn,
  .page-back, .btn, .chip, .seg-opt, .row-clickable,
  [data-href], [role="button"], [data-open-drawer]
) {
  transition:
    background-color .14s ease,
    border-color     .14s ease,
    color            .14s ease,
    box-shadow       .14s ease,
    opacity          .14s ease;
}

/* ── Appearance themes ─────────────────────────────────────────────────────
   A theme re-points the accent, and the accent is already the single colour
   the whole app draws its "this is live / this is yours" signal from — active
   nav, count badges, primary buttons, the avatar, the sidebar's glint. So a
   theme is a handful of variables, not a restyle.

   Deliberately NOT themed: --success and --danger. Those carry meaning; a
   theme that recoloured "overdue" red into violet would break the one thing
   colour is doing usefully here.

   Set on <body data-theme="..."> — see layout.php. */
body[data-theme="ember"]  { --accent: #f97316; --accent-soft: rgba(249,115,22,.15); --theme-glint: rgba(249,115,22,.10); }
body[data-theme="ocean"]  { --accent: #3b82f6; --accent-soft: rgba(59,130,246,.16); --theme-glint: rgba(59,130,246,.12); }
body[data-theme="forest"] { --accent: #10b981; --accent-soft: rgba(16,185,129,.16); --theme-glint: rgba(16,185,129,.11); }
body[data-theme="violet"] { --accent: #8b5cf6; --accent-soft: rgba(139,92,246,.17); --theme-glint: rgba(139,92,246,.13); }
body[data-theme="slate"]  { --accent: #64748b; --accent-soft: rgba(100,116,139,.20); --theme-glint: rgba(100,116,139,.12); }
body[data-theme="rose"]   { --accent: #f43f5e; --accent-soft: rgba(244,63,94,.15);  --theme-glint: rgba(244,63,94,.11); }

/* The sidebar picks up the theme as a faint wash over its existing tint, so
   the nav reads as part of the scheme instead of a neutral slab beside it.
   Falls back to fully transparent, which is the untouched default. */
@media (min-width: 1025px) {
  .sidebar {
    background:
      var(--tex-frost),
      var(--glass-sheen),
      linear-gradient(160deg, var(--theme-glint, transparent), transparent 68%),
      rgba(0,0,0,.82);
  }
}

/* Same glint on the module, at about a third the strength — enough to tie the
   two together without tinting the content sitting on it. */
@media (min-width: 1025px) {
  .app-frame {
    background:
      var(--tex-frost),
      var(--glass-sheen),
      linear-gradient(rgba(96,140,215,.012), rgb(0 0 0 / 26%)),
      linear-gradient(160deg, var(--theme-glint, transparent), transparent 55%),
      rgba(5, 8, 15, .22);
  }
}

/* Swatches in the Appearance picker. */
.theme-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); gap: 8px; }
.theme-cell { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.theme-swatch {
  width: 100%; height: 46px; border-radius: 9px; cursor: pointer;
  border: 1px solid var(--border); position: relative;
}
.theme-swatch.is-active { border-color: #fff; box-shadow: 0 0 0 2px rgba(255,255,255,.22); }
.theme-name { font-size: 11.5px; color: var(--text-2); }

/* Reachability flags on a prospect row.
   Yellow, not red: "we have no way to contact this person" is a gap to fill,
   not an error — the row is still a real prospect worth chasing. Red is
   reserved for things that have gone wrong. */
.pill-nocontact {
  background: rgba(245,158,11,.16);
  color: #fbbf24;
  font-size: 10px; font-weight: 600; white-space: nowrap;
  border: 1px solid rgba(245,158,11,.28);
}
.pill-noemail {
  background: rgba(245,158,11,.10);
  color: #d9a441;
  font-size: 10px; font-weight: 600; white-space: nowrap;
}

/* ── Radii back in step with the restored scale ────────────────────────────
   These were sized against the briefly-larger scale (11px/9px). With the
   tokens back at 6px/4px they were the roundest things on screen, which is the
   inconsistency rather than a look. Expressed as the tokens so they follow
   automatically next time. */
@media (min-width: 1025px) {
  .topbar-right { border-radius: var(--radius); }
  .topbar-right .topbar-start,
  .topbar-right .topbar-add,
  .topbar-right .topbar-bell,
  .topbar-right .topbar-user-btn { border-radius: var(--radius-sm); }
  .topbar-right .topbar-avatar { border-radius: var(--radius-sm); }
  .sidebar { border-radius: 8px; }   /* one step up: it is a panel, not a control */
}
.theme-swatch { border-radius: var(--radius); }
.toast        { border-radius: var(--radius); }

/* My tribes on Home: fixed viewport, scrolls internally. Without this the card
   grows with the number of tribes and the one next to it stops lining up. */
.tribe-grid-scroll {
  max-height: 372px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* ── Home layout ───────────────────────────────────────────────────────────
   Five quick links across, not four-plus-a-widow. The fifth was wrapping onto
   its own row, which is what made them look stacked. */
.quick-links { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1100px) { .quick-links { grid-template-columns: repeat(3, minmax(0,1fr)); } }
@media (max-width: 700px)  { .quick-links { grid-template-columns: repeat(2, minmax(0,1fr)); } }

/* Hopper two-thirds, Waiting on you one-third. Hopper is the card you WORK —
   a list of people with actions — so it gets the width; Waiting on you is a
   set of counts you scan, which reads fine narrow. */
.home-split { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; align-items: start; }
.home-split > .card { margin-bottom: 0; }
@media (max-width: 1100px) { .home-split { grid-template-columns: 1fr; } }

/* My tribes: three across, and tall enough to show three rows of them before
   it scrolls — so the card fills its space instead of being a letterbox. */
.tribe-grid-scroll {
  max-height: 660px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.tribe-grid-scroll .tribe-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1100px) { .tribe-grid-scroll .tribe-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 700px)  { .tribe-grid-scroll .tribe-grid { grid-template-columns: 1fr; } }

/* Hopper rows now carry contact and tribe as well as the name and the clock. */
.trow.trow-hopper {
  display: grid;
  grid-template-columns: minmax(0,1.35fr) minmax(0,1fr) minmax(120px,0.6fr) auto;
  gap: 12px;
  align-items: center;
}
@media (max-width: 1300px) {
  /* Tribe is the first thing to go: it is the least useful of the three when
     space is short, since the hopper is usually worked one tribe at a time. */
  .trow.trow-hopper { grid-template-columns: minmax(0,1.4fr) minmax(0,1fr) auto; }
  .trow.trow-hopper .col-tribe { display: none; }
}

/* ── Home rows, corrected ──────────────────────────────────────────────────
   Row 1: Waiting on you (narrow, left) then Hopper (wide, right). Waiting on
   you is five counts — it does not need width. Hopper is a list of people you
   act on, so it takes the two-thirds.

   Row 2: My tribes and All people, equal halves. */
.home-split { grid-template-columns: 1fr 2fr; }
.home-split.home-split-even { grid-template-columns: 1fr 1fr; }
@media (max-width: 1100px) {
  .home-split,
  .home-split.home-split-even { grid-template-columns: 1fr; }
}

/* Two tiles across inside a half-width card. Three fitted when this card had
   the full width; at half it would put them under 180px and the image, title,
   bar and stats stop fitting. */
.home-split-even .tribe-grid-scroll .tribe-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.home-split-even .tribe-grid-scroll { max-height: 560px; }

/* Both cards in a row start at the same top edge and keep their own height. */
.home-split > .card { align-self: start; }

/* ── Home rows: collapse far later ─────────────────────────────────────────
   The breakpoint was 1100px of VIEWPORT, but the content column is roughly
   310px narrower than the window — sidebar (244) + frame padding (28) + the
   panel's inset (18) + the gutter (22). So a 1100px window leaves .main about
   790px, which fits two columns comfortably, yet the rule fired and stacked
   everything into a single column.

   880px viewport ~= 570px of content, which is genuinely where two columns
   stop working. Above that, the two rows stay two rows. */
@media (min-width: 881px) {
  .home-split                  { grid-template-columns: 1fr 2fr; }
  .home-split.home-split-even  { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 880px) {
  .home-split,
  .home-split.home-split-even  { grid-template-columns: 1fr; }
}

/* Clear separation between the two rows regardless of the mb-4 utility. */
.home-split { margin-bottom: 18px; }

/* ── The actual cause of the four-across layout ────────────────────────────
   .cc-grid is `grid-template-columns: 1fr 1fr`, and the two home rows are its
   children — so each row was being placed in ONE of its columns, side by side.
   Two 2-column grids sitting in two columns is four cards across.

   Each row spans the full width of .cc-grid instead, so they stack and their
   own columns do the dividing. This is what makes them rows at all; the
   breakpoint work before it was never going to help. */
.cc-grid > .home-split { grid-column: 1 / -1; }

/* ── Rows: both cards the same height ──────────────────────────────────────
   `align-self: start` was letting each card keep its natural height, which is
   why the shorter one stopped short of its neighbour. Stretch is the default;
   removing the override is the fix.

   For the height to be shared, the taller card's content has to scroll inside
   it rather than set the height — so each card becomes a flex column and its
   scrolling body takes the leftover space. min-height:0 is the part that makes
   a flex child actually allowed to shrink and scroll. */
.home-split > .card { align-self: stretch; display: flex; flex-direction: column; }
.home-split > .card > .card-head { flex: 0 0 auto; }
.home-split > .card > .card-body,
.home-split > .card > [data-lazy] { min-height: 0; }

/* My tribes: the scroll area fills whatever height the row settles on instead
   of a fixed cap, so it matches All people beside it. */
.home-split-even .tribe-grid-scroll {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
}

/* Three tiles across, even at half width. At ~170px the tile has to give up
   its generous padding and the image has to get shorter, or the name, bar and
   stats stop fitting. */
.home-split-even .tribe-grid-scroll .tribe-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.home-split-even .tribe-tile { padding: 12px 12px; }
.home-split-even .tribe-tile .tt-img { margin: -10px -10px 9px; aspect-ratio: 16 / 8; }
.home-split-even .tribe-tile h4 { font-size: 12.5px; margin-bottom: 6px; }
.home-split-even .tribe-tile h4 .pct { font-size: 11px; }
.home-split-even .tribe-tile .stats { font-size: 11px; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.home-split-even .tribe-tile .stats .pill { font-size: 9.5px; }

/* The people list scrolls too, so neither card dictates the row's height. */
.home-split-even > .card > [data-lazy] { flex: 1 1 auto; overflow-y: auto; }

/* ── Row gap: one source, not two ──────────────────────────────────────────
   .cc-grid contributes a 16px row-gap AND .home-split carries its own bottom
   margin, so the space between the two rows was ~34px — the "weird gap".
   The grid's row gap goes; the margin is the single spacing value. */
.cc-grid { row-gap: 0; }
.home-split { margin-bottom: 14px; }
.home-split:last-child { margin-bottom: 0; }

/* ── My tribes takes its height FROM All people ────────────────────────────
   Both cards stretch to the row's height, and the row is as tall as its
   tallest item — so whichever card has more content wins, and with 10 tribes
   that was My tribes pushing the row past All people.

   `flex-basis: 0` is what settles it: a flex child with a zero basis does not
   contribute its content height to the card, so the tribes card measures as
   just its header. All people keeps `auto`, so IT sets the row height and the
   tribe grid scrolls inside whatever that turns out to be. */
.home-split-even .tribe-grid-scroll { flex: 1 1 0; min-height: 0; max-height: none; overflow-y: auto; }
.home-split-even > .card > [data-lazy] { flex: 1 1 auto; overflow-y: auto; min-height: 0; }

/* ── Sidebar Find / Add: stop the label clipping ───────────────────────────
   These sit two-up in a 244px panel, so each button is about 105px. At 10px
   side padding plus a 15px icon and a 6px gap, the label had 64px — and "Find
   people" needs about 62. Two pixels of headroom means it clipped to
   "Find peo…" on any rendering variance, which is what the ellipsis was
   hiding rather than solving.

   Padding down to 7px and the gap to 4px gives 72px: an actual margin. The
   overflow rule goes with it — a label that no longer overflows should not
   carry the machinery for truncating itself, and keeping it would just hide
   the next regression the same way. */
.sidebar-footer .topbar-start,
.sidebar-footer .topbar-add {
  padding: 0 7px;
  gap: 4px;
}
.sidebar-footer .topbar-start-label,
.sidebar-footer .sb-btn-label {
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}

/* ── Fields get room to breathe ────────────────────────────────────────────
   Inputs, selects and search boxes were 38px (32px in toolbars) with their
   vertical padding zeroed — the height did all the centring, so at 13px type
   there were only a few pixels above and below the text. That is what reads as
   clunky and cramped.

   Heights go up rather than padding, because these fields centre their text by
   height; adding padding to a fixed-height, border-box field just shrinks the
   content area instead of adding space. The small variant stays genuinely
   smaller than the base so toolbars still read as secondary. */
.input:not(textarea), select,
input[type="text"], input[type="email"], input[type="search"],
input[type="password"], input[type="url"], input[type="number"], input[type="tel"] {
  min-height: var(--ctl-h);
}

.input-sm, select.input-sm { min-height: var(--ctl-h-sm); padding: 0 12px; }

/* Toolbar fields inside a card head were pinned to 32px separately. */
.card-head .right .input,
.list-filters .input,
.list-head .input { min-height: var(--ctl-h-sm); }

/* A textarea grows with its rows, so it takes real padding instead. */
textarea { padding-top: 12px; padding-bottom: 12px; }

/* The search icon centres on the field's height — it was positioned for 32px. */
.search-wrap svg { top: 50%; transform: translateY(-50%); }

/* ── Buttons match the fields they sit beside ──────────────────────────────
   A 32px .btn-sm next to a 36px .input-sm sat 4px short and made the whole
   toolbar look misaligned. Same story for full-size buttons next to 44px
   fields. Heights are matched to the control they line up with, not set
   independently. */
.btn-sm { min-height: var(--ctl-h-sm); }

.card-head .right .btn,
.list-filters .btn,
.list-head .btn { min-height: var(--ctl-h-sm); }

/* Inside a form row the fields are full height, so the buttons are too. */
.form-row .btn,
.drawer-form .drawer-foot .btn { min-height: var(--ctl-h); }

/* The toolbar lines its controls up on the same centre line. */
.card-head .right,
.list-filters { align-items: center; }

/* ── One height for every toolbar control ──────────────────────────────────
   The small variant was losing to my own base rule: that rule lists
   `input[type="search"]`, an element+attribute selector at (0,1,1), while
   `.input-sm` is a single class at (0,1,0). Higher specificity wins regardless
   of order, so selects obeyed .input-sm and the search box did not — 36px next
   to 44px, with a 36px button beside both.

   These selectors are (0,2,0) or better, so they beat the attribute selector
   outright rather than relying on source order.

   40px for all three: more room than the 36 they were meant to get, and one
   number for fields, dropdowns and buttons that sit on the same line. */
.input.input-sm,
select.input.input-sm,
input.input.input-sm,
input[type="search"].input-sm,
input[type="text"].input-sm,
select.input-sm { min-height: var(--ctl-h-sm); padding: 0 12px; }

.btn.btn-sm { min-height: var(--ctl-h-sm); }

.card-head .right .btn,
.card-head .right .input,
.list-filters .btn,
.list-filters .input,
.list-head .btn,
.list-head .input { min-height: var(--ctl-h-sm); }

/* The search box wraps its input, so the wrapper has to grow with it. */
.search-wrap { display: inline-flex; align-items: center; }
.search-wrap .input { min-height: var(--ctl-h-sm); }

/* ── Control heights, settled in one place ─────────────────────────────────
   Toolbar controls were 32px originally; my 40/44px pass was too much and, worse,
   it only landed where my selector happened to outrank whatever else set a
   height. Heights are set in this file at (0,1,0), (0,1,1), (0,2,0), (0,2,1)
   and (0,3,0) across different rules, so a single-class override silently
   missed the Invited toolbar and several others.

   This block lists the higher-specificity selectors EXPLICITLY, so it ties or
   beats every one of them and — being last — wins outright. One height, every
   header, no exceptions:

     toolbars (inputs, selects, search, buttons)  36px   (was 32)
     full-size form fields                        40px   (was 38)

   Both are one notch up from the originals: a little more breathing room than
   before, without the bulk of the 44px attempt. */
.input-sm,
.input.input-sm,
select.input-sm,
select.input.input-sm,
input.input.input-sm,
input[type="search"].input-sm,
input[type="text"].input-sm,
.search-wrap .input,
.card-head .right .input,
.card-head .right select,
.card-head .right .btn,
.list-head .input,
.list-head select,
.list-head .btn,
.list-filters .input,
.list-filters select,
.list-filters .btn,
.list-filters input[type="search"],
.btn-sm,
.btn.btn-sm {
  min-height: var(--ctl-h-sm);
}

/* Full-size fields: 38 -> 40. Buttons on the same line match them. */
.input:not(.input-sm):not(textarea),
select:not(.input-sm),
input[type="text"]:not(.input-sm),
input[type="email"], input[type="password"],
input[type="url"], input[type="number"], input[type="tel"],
input[type="search"]:not(.input-sm) {
  min-height: var(--ctl-h);
}
.form-row .btn, .drawer-form .drawer-foot .btn { min-height: var(--ctl-h); }

/* Textarea keeps padding rather than height, but eased back with the rest. */
textarea { padding-top: 10px; padding-bottom: 10px; }

/* ── Two sizes, and buttons match fields at both ───────────────────────────
   Chasing this container by container was the wrong approach: the Save button
   on Events sits in a plain <form class="row"> next to a full-size select and
   belongs to no toolbar selector at all, so it stayed 38px beside a 40px field.

   The rule is simply that a button is the same height as the field it sits
   next to. Two pairs, and it holds wherever the markup puts them:

       base    fields 40px   buttons 40px
       small   fields 36px   buttons 36px  */
.btn { min-height: var(--ctl-h); }
.btn-sm, .btn.btn-sm { min-height: var(--ctl-h-sm); }

/* Any control in a header takes the small size, however it is nested and
   whether or not someone remembered the btn-sm class. */
.card-head .btn, .card-head .input, .card-head select,
.list-head .btn, .list-head .input, .list-head select,
.list-filters .btn, .list-filters .input, .list-filters select,
.card-head .right .btn, .card-head .right .input, .card-head .right select {
  min-height: var(--ctl-h-sm);
}

/* Rows that line a field up with a button keep both at the base size. */
.form-row .btn, .drawer-foot .btn, form.row > .btn { min-height: var(--ctl-h); }

/* ── Search box: height and icon ───────────────────────────────────────────
   `.search-wrap > input[type="search"]` is (0,2,1) and pinned 32px, which
   outranked every (0,2,0) toolbar rule — so a search box inside .list-filters
   stayed small while the selects beside it grew. Matching that specificity and
   going one better settles it.

   The icon is absolutely positioned inside a flex wrapper, so it was already
   centred by align-items. My top:50%/translateY(-50%) added a SECOND centring
   on top of that and knocked it off — reverted to `top: auto` so the wrapper
   does the job alone. Its left offset and the input's matching padding scale
   with the taller field. */
.search-wrap > input[type="search"],
.search-wrap > input[type="search"].input,
.search-wrap > .input,
.search-wrap > input {
  min-height: var(--ctl-h-sm);
  padding-left: 32px;
}
.search-wrap > svg {
  top: auto;
  transform: none;
  left: 10px;
}

/* ── Control sizing: two numbers, one place ────────────────────────────────
   Every height on a button, input, select or search box in this file now
   resolves through one of these two variables. That is the point: there were
   competing declarations at five different specificities, so overriding one
   never reached the others and each fix landed on some toolbars and missed the
   rest. With every declaration pointing at the same variable, specificity
   stops mattering — whichever rule wins produces the same number.

   Change these two values to resize every control in the app. */
:root {
  --ctl-h:    34px;   /* forms, drawers, standalone buttons */
  --ctl-h-sm: 30px;   /* toolbars: card heads, list filters, search */
}

/* Dropdowns need horizontal room too — they carry a chevron on the right, so
   the text was running into it. */
select, select.input { padding: 0 30px 0 12px; }
select.input-sm      { padding: 0 28px 0 11px; }
.input, input[type="text"], input[type="email"], input[type="search"],
input[type="password"], input[type="url"], input[type="number"], input[type="tel"] { padding-left: 12px; padding-right: 12px; }
.search-wrap > input[type="search"] { padding-left: 32px; }
.btn    { padding: 0 14px; }
.btn-sm { padding: 0 12px; }

/* ── One rule decides header control height ────────────────────────────────
   Everything above now sets min-height, so no control is clamped by a rule it
   never knew about — that mutual clamping is what kept knocking these out of
   line with each other.

   This is the single place that makes controls in a header agree, and it uses
   !important on purpose: the point is to end the specificity contest, not win
   another round of it. Anything sitting in a card head, list head or filter
   row is exactly this tall, whatever else the file says about it.

   Buttons keep inline-flex centring, so a fixed height here centres the label
   without needing padding to match. */
.card-head .btn,
.card-head .input,
.card-head select,
.card-head input,
.card-head textarea.input-sm,
.list-head .btn,
.list-head .input,
.list-head select,
.list-head input,
.list-filters .btn,
.list-filters .input,
.list-filters select,
.list-filters input,
.search-wrap > input {
  height: var(--ctl-h-sm) !important;
  min-height: var(--ctl-h-sm) !important;
  line-height: normal;
}

/* Same idea for a form row: field and button agree, nothing else has a say. */
.form-row .btn,
.drawer-foot .btn,
form.row > .btn,
form.row > .input,
form.row > select {
  height: var(--ctl-h) !important;
  min-height: var(--ctl-h) !important;
}

/* ── Toolbar buttons sit flush with the fields ─────────────────────────────
   The height was never wrong here — .btn-accent carries a downward orange
   glow (0 4px 14px), which next to a flat select reads as a taller button
   sitting slightly low. The glow is right for a primary action on a page; in
   a row of filters it just breaks the line.

   Dropped in headers only, so primary buttons keep it everywhere else. */
.card-head .btn,
.list-head .btn,
.list-filters .btn,
.card-head .right .btn {
  box-shadow: none;
}

/* The icon inside a toolbar button gets a fixed box so the label sits on the
   same baseline as the text in the fields next to it. */
.card-head .btn svg,
.list-head .btn svg,
.list-filters .btn svg {
  width: 14px; height: 14px; flex: 0 0 auto;
}

/* ── Fields and buttons get separate dials ─────────────────────────────────
   Reported symptom: whatever --ctl-h-sm is set to, the fields land 2-3px
   shorter than the buttons beside them. My measurements said otherwise, so
   rather than argue with what is on screen, the two are separated: fields can
   now be nudged without touching buttons.

   --ctl-h-field is deliberately a couple of pixels over the button height. If
   fields really are rendering short, this closes it; the two variables let it
   be tuned from one place either way.

   Also pinned here, because each is a way a field can quietly lose height:
     line-height  a UA line-height taller than the box makes an input compute
                  its own intrinsic height and ignore a short one
     padding      any vertical padding is inside the border-box, so it eats
                  the content area rather than adding to the outside
     appearance   a native select carries UA chrome with its own metrics */
:root {
  --ctl-h-btn:   var(--ctl-h-sm);
  --ctl-h-field: calc(var(--ctl-h-sm) + 5px);
}

.card-head .input, .card-head select, .card-head input,
.list-head .input, .list-head select, .list-head input,
.list-filters .input, .list-filters select, .list-filters input,
.search-wrap > input {
  height: var(--ctl-h-field) !important;
  min-height: var(--ctl-h-field) !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  line-height: 1 !important;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

.card-head .btn, .list-head .btn, .list-filters .btn, .card-head .right .btn {
  height: var(--ctl-h-btn) !important;
  min-height: var(--ctl-h-btn) !important;
  line-height: 1 !important;
}

/* Active-members rows share the qrow grid with every other list, so the header
   and the rows are driven by one template. The person cell keeps the avatar
   beside the name; the rest are plain columns. */
.qrow.qrow-member { gap: 12px; align-items: center; }
.qrow.qrow-member .tr-person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.qrow.qrow-member .tr-main { min-width: 0; }
.qrow.qrow-member .tr-name { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qrow.qrow-member .tr-sub { font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qrow.qrow-member > .small { min-width: 0; overflow: hidden; }
.qrow.qrow-member > .small > div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Signals — derived state tags that ride ALONGSIDE the status on the cards.
      Appended at the end so the cascade wins (09 §C2). ── */
/* STACKED, not a horizontal row: as a flex-row the container's basis was the sum
   of both pills side by side, so it spanned wide and shoved the columns no matter
   the max-width. Column direction + a FIXED reserved width keeps every card's
   columns aligned on desktop — an empty slot still holds its place — and overflow
   clips anything too wide instead of pushing. */
.rc-signals { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex: 0 0 104px; overflow: hidden; }
.rc-sig {
  font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
  padding: 2px 8px; border-radius: 20px; white-space: nowrap; border: 1px solid transparent;
}
/* Warm "notice / needs attention" palette — deliberately distinct from the cool
   blue/green status pills, so a glance separates "what to do" from "where they are". */
.rc-sig.sig-alert { background: rgba(239,68,68,.20);   color: #ff9d9d; border-color: rgba(239,68,68,.46); }  /* bounced — red */
.rc-sig.sig-hot   { background: rgba(255,138,76,.22);  color: #ffb488; border-color: rgba(255,138,76,.48); } /* reply waiting — coral */
.rc-sig.sig-due   { background: rgba(234,179,8,.11);   color: #f2d982; border-color: rgba(234,179,8,.30); }  /* no reply — soft yellow */
.rc-sig.sig-warn  { background: rgba(245,158,11,.20);  color: #f7c65a; border-color: rgba(245,158,11,.44); } /* no-show — amber */
.rc-sig.sig-good  { background: rgba(132,204,22,.18);  color: #c4ec7a; border-color: rgba(132,204,22,.40); } /* attended — lime */
.rc-sig.sig-pause { background: rgba(202,138,4,.15);   color: #e6c07a; border-color: rgba(202,138,4,.32); }  /* needs email / stale — muted amber */
.rc-sig.sig-wait  { background: rgba(255,255,255,.05); color: var(--text-3); border-color: var(--border); }  /* awaiting — muted grey, no action */
/* Never split a signal label ("Email bounced" etc.) across two lines — a wrapped
   pill grows its slot and shoves the row's other columns around. */
.rc-sig { white-space: nowrap; }
/* Candidate Fit-card contact rows: flush left, tight icon gap, plain blue links.
   Link/phone are real <a> (hyperlink / tel:), email is non-clickable blue text. */
.fit-who-row { display: flex; align-items: center; gap: 8px; width: 100%; }
.fit-who-lines .pc-plain { display: flex; align-items: center; gap: 6px; flex: 1 1 auto; min-width: 0; margin: 0; padding: 4px 0; text-decoration: none; color: #6ea8fe; background: none; border: 0; }
.fit-who-lines .pc-plain.is-missing { color: var(--text-3); }
.fit-who-lines .pc-plain.pc-noclick { cursor: default; }
.fit-who-lines .pc-plain .pc-ic { flex: 0 0 auto; width: 16px; text-align: center; color: var(--text-3); }
.fit-who-lines .pc-plain .pc-val { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: inherit; }
.fit-who-lines a.pc-plain:hover .pc-val { text-decoration: underline; }
/* The pencil restores add/edit for each field (value itself is a link now). */
/* Hidden until you hover the row, then a small edit icon on the right. */
.pc-edit-btn { flex: 0 0 auto; background: none; border: 0; cursor: pointer; color: var(--text-3); line-height: 1; padding: 3px 5px; border-radius: 5px; opacity: 0; transition: opacity .12s, color .12s, background .12s; }
.pc-edit-btn svg { width: 14px; height: 14px; display: block; }
.fit-who-row:hover .pc-edit-btn { opacity: 1; }
.pc-edit-btn:hover { color: var(--text); background: rgba(255,255,255,.08); }

/* ── Events column — hidden until a board toggles `.show-events` on the list. ── */
.rc-event { display: none; flex-direction: column; align-items: flex-end; gap: 3px; flex: 0 0 auto; min-width: 88px; }
.role-cards.show-events .rc-event { display: flex; }
.rc-etag { font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: 20px; white-space: nowrap; border: 1px solid transparent; }
.rc-etag.ev-info { background: rgba(96,165,250,.16);  color: #9ec5fe; border-color: rgba(96,165,250,.30); }
.rc-etag.ev-good { background: rgba(26,169,113,.16);  color: #8fd9b6; border-color: rgba(26,169,113,.30); }
.rc-etag.ev-miss { background: rgba(220,38,38,.14);   color: #f2a1a1; border-color: rgba(220,38,38,.28); }
.rc-etag.ev-none { background: rgba(255,255,255,.05);  color: var(--text-3); }
/* ── Toolbar: one shared Filters dropdown holds every control; the Add button
      stays outside, always visible, behind a divider. ── */
.toolbar-sep { flex: 0 0 auto; width: 1px; align-self: stretch; min-height: 22px; background: var(--border); margin: 0 4px; }
.filter-menu { position: relative; flex: 0 0 auto; }
.filter-menu > summary { list-style: none; cursor: pointer; user-select: none; display: inline-flex; align-items: center; gap: 6px; }
.filter-menu > summary::-webkit-details-marker { display: none; }
.filter-menu > summary::after { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); opacity: .6; }
.filter-menu[open] > summary { border-color: var(--accent); color: var(--accent); }
.filter-menu[open] > summary::after { transform: rotate(-135deg) translateY(-1px); }
/* Circular icon variant of the toggle — a round funnel button, no caret. */
.filter-menu > summary.filter-toggle { width: 34px; height: 34px; padding: 0; gap: 0; justify-content: center; border-radius: 999px; border: 1px solid var(--border); background: var(--glass-bg); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); color: var(--text-2); transition: color .12s ease, border-color .12s ease, background .12s ease; }
.filter-menu > summary.filter-toggle::after { display: none; }
.filter-menu > summary.filter-toggle svg { width: 16px; height: 16px; display: block; }
.filter-menu > summary.filter-toggle:hover { color: var(--text); border-color: var(--text-3); }
.filter-menu-body {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; min-width: 230px;
  padding: 12px; display: flex; flex-direction: column; gap: 11px;
  /* This panel lives INSIDE .card, which is itself a backdrop-filter surface — a
     nested backdrop-filter only samples the card's own interior, so real
     page-behind blur cannot apply here (that is why the earlier blur "did
     nothing"). Use an opaque surface so the busy content behind never shows
     through, with a backdrop-filter kept for a subtle frosted edge. */
  background: var(--surface); backdrop-filter: blur(40px) saturate(160%); -webkit-backdrop-filter: blur(40px) saturate(160%);
  border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 18px 46px rgba(0,0,0,.6);
}
/* Portaled to <body> (via JS) so backdrop-filter actually blurs the page behind
   it — translucent frosted glass instead of the opaque in-card fallback. */
.filter-menu-body.is-portaled {
  position: fixed; z-index: 300;
  background: var(--glass-bg);
  backdrop-filter: blur(34px) saturate(185%) brightness(1.06); -webkit-backdrop-filter: blur(34px) saturate(185%) brightness(1.06);
}
.fm-row { display: flex; flex-direction: column; gap: 4px; }
.fm-row > label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); }
.fm-row select, .filter-menu-body [data-event-filter] { width: 100%; order: 0; }
.fm-toggle { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--text-2); }
.fm-toggle .ev-toggle { width: auto; }
/* Events column is a real on/off switch, not a Show/hide button. Driven by the
   aria-pressed the toggle JS already sets. */
.fm-switch { position: relative; width: 38px; height: 22px; flex: 0 0 auto; border-radius: 999px; border: 1px solid var(--border); background: rgba(255,255,255,.09); cursor: pointer; padding: 0; appearance: none; -webkit-appearance: none; transition: background .15s ease, border-color .15s ease; }
.fm-switch::after { content: ""; position: absolute; top: 50%; left: 3px; transform: translateY(-50%); width: 16px; height: 16px; border-radius: 50%; background: var(--text-2); transition: left .15s ease, background .15s ease; }
.fm-switch[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); }
.fm-switch[aria-pressed="true"]::after { left: 19px; background: #fff; }
/* Filters-menu column toggles hide their column across the whole board. */
.role-cards.hide-contact .rc-contact-col { display: none; }
.role-cards.hide-action .rc-signals { display: none; }
/* Event-state filter: hide non-matching cards via CSS so it composes with the
   JS search/sort (which own style.display) instead of fighting them. */
.role-cards[data-ev-filter="registered"] .role-card:not([data-event="registered"]),
.role-cards[data-ev-filter="attended"]   .role-card:not([data-event="attended"]),
.role-cards[data-ev-filter="no_show"]    .role-card:not([data-event="no_show"]),
.role-cards[data-ev-filter="none"]       .role-card:not([data-event="none"]) { display: none; }
.ev-toggle.is-on { border-color: var(--accent); color: var(--accent); }

/* ── Tribe setup: the always-on checklist is now a first-run wizard modal; the
      Overview keeps only a slim "finish setup" prompt while incomplete. ── */
.ov-grid.ov-grid--solo { display: block; }
.ov-setup-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; padding: 11px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--glass-bg); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); }
.ov-setup-bar > div { font-size: 13px; color: var(--text-2); }
.setup-wizard { width: 560px; max-width: 94vw; border: 1px solid var(--border); border-radius: 16px; padding: 0; background: var(--surface); color: var(--text); box-shadow: 0 30px 80px rgba(0,0,0,.55); }
.setup-wizard::backdrop { background: rgba(4,4,6,.62); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.sw-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 22px 12px; }
.sw-head h3 { margin: 0; font-size: 18px; }
.sw-sub { font-size: 13px; color: var(--text-3); margin-top: 3px; }
.sw-x { background: none; border: 0; color: var(--text-3); font-size: 22px; line-height: 1; cursor: pointer; padding: 0 4px; }
.sw-x:hover { color: var(--text); }
.sw-prog { height: 4px; margin: 0 22px; border-radius: 3px; background: rgba(255,255,255,.08); overflow: hidden; }
.sw-prog > span { display: block; height: 100%; background: var(--accent); border-radius: 3px; transition: width .3s ease; }
.sw-steps { padding: 6px 22px 4px; max-height: 62vh; overflow-y: auto; }
.sw-step { padding: 16px 0; border-bottom: 1px solid var(--border); }
.sw-step:last-child { border-bottom: 0; }
.sw-step-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.sw-step-head h4 { margin: 0; font-size: 14.5px; }
.sw-num { flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%; background: rgba(255,255,255,.08); color: var(--text-2); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
.sw-step.is-done .sw-num { background: rgba(26,169,113,.2); color: #8fd9b6; }
.sw-done-line { font-size: 12.5px; color: #8fd9b6; margin-bottom: 8px; }
.sw-form { display: flex; flex-direction: column; gap: 10px; }
.sw-form-inline { flex-direction: row; align-items: flex-end; gap: 8px; margin-bottom: 10px; }
.sw-form .field { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.sw-hint { font-weight: 400; color: var(--text-3); font-size: 11px; }
.sw-p { font-size: 13px; color: var(--text-2); margin: 0 0 10px; }
.sw-actions { display: flex; justify-content: flex-end; }
.sw-foot { display: flex; justify-content: flex-end; padding: 12px 22px 18px; }
@media (max-width: 620px) { .sw-form-inline { flex-direction: column; align-items: stretch; } }
/* Stepper wizard: left step list + right content. */
.setup-wizard.wizard2 { width: 880px; max-width: 96vw; }
.setup-wizard.wizard2 .sw-head { padding: 22px 28px 18px; border-bottom: 1px solid var(--border); }
.setup-wizard.wizard2 .sw-head h3 { font-size: 19px; }
.sw-body2 { display: flex; align-items: stretch; min-height: 380px; }
.sw-nav { flex: 0 0 236px; border-right: 1px solid var(--border); padding: 18px 14px; display: flex; flex-direction: column; gap: 6px; background: var(--surface-2); }
.sw-nav-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 10px; cursor: pointer; color: var(--text-2); border: 0; background: none; text-align: left; width: 100%; font-size: 14px; font-weight: 500; }
.sw-nav-item:hover { background: rgba(255,255,255,.05); }
.sw-nav-item.is-active { background: var(--glass-bg); color: var(--text); font-weight: 600; }
.sw-nav-num { flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%; background: rgba(255,255,255,.08); color: var(--text-2); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
.sw-nav-item.is-active .sw-nav-num { background: var(--accent); color: #fff; }
.sw-nav-item.is-done .sw-nav-num { background: rgba(26,169,113,.28); color: #8fd9b6; }
.sw-nav-title { font-size: 14px; }
.sw-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.sw-pages { flex: 1 1 auto; padding: 28px 34px; overflow-y: auto; max-height: 62vh; }
.sw-page { display: none; }
.sw-page.is-active { display: block; }
.sw-page h4 { margin: 0 0 5px; font-size: 17px; }
.sw-page-sub { font-size: 13.5px; color: var(--text-3); margin-bottom: 26px; }
.sw-pages .sw-form { gap: 18px; }
.sw-pages .sw-form .field { font-size: 13px; gap: 9px; }
.sw-textarea-lg { min-height: 150px; }
.sw-welcome { text-align: center; padding: 10px 8px 4px; }
.sw-welcome-badge { font-size: 40px; line-height: 1; margin-bottom: 10px; }
.sw-welcome h4 { font-size: 21px; margin: 0 0 14px; }
.sw-welcome p { font-size: 13.5px; color: var(--text-2); line-height: 1.6; margin: 0 auto 12px; max-width: 48ch; }
.sw-err { margin: 0 28px 6px; padding: 9px 13px; border-radius: 8px; background: rgba(239,68,68,.14); border: 1px solid rgba(239,68,68,.34); color: #ffb4b4; font-size: 12.5px; }

.sw-check { display: flex; align-items: flex-start; gap: 10px; font-size: 13.5px; color: var(--text-2); line-height: 1.5; }
.sw-check input { margin-top: 3px; flex: 0 0 auto; }
.sw-row2 { display: flex; gap: 16px; }
.sw-row2 .field { flex: 1 1 0; }
.sw-foot2 { display: flex; justify-content: space-between; align-items: center; padding: 16px 28px; border-top: 1px solid var(--border); }
@media (max-width: 640px) {
  .sw-body2 { flex-direction: column; }
  .sw-nav { flex-basis: auto; flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--border); }
  .sw-row2 { flex-direction: column; }
}

/* Home overview: Hopper + Your categories, side by side (Hopper ~1/3, Categories ~2/3),
   stacking on narrow screens. Static layout — the modular/gridstack dashboard was removed. */
.home-boards { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .home-boards { grid-template-columns: 1fr; } }

/* ── Tribe setup wizard v2 refinements (2026-09-01) ─────────────────────────
   Bigger headings, click-to-open help bubbles, and the email step's labeled
   blocks. Appended last so these win over the earlier .sw-* rules. */
.sw-welcome h4 { font-size: 25px; }
.sw-page h4 { font-size: 20px; }

/* A "?" that sits inline with the label; its bubble drops onto its own row. */
.hlp {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; margin-left: 5px; padding: 0; flex: 0 0 auto;
  border-radius: 50%; border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text-3); font-size: 10.5px; font-weight: 700; line-height: 1;
  cursor: pointer; vertical-align: middle;
}
.hlp:hover { color: var(--text); border-color: var(--text-3); }
.hlp.is-open { background: var(--accent); border-color: var(--accent); color: #fff; }
.hlp-pop {
  display: none; font-weight: 400; font-size: 12px; color: var(--text-2);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 11px; line-height: 1.5;
}
.hlp-pop.is-open { display: block; }

/* Email step — labeled blocks, each a distinct job. */
.sw-block { display: flex; flex-direction: column; gap: 14px; padding: 20px 0; border-top: 1px solid var(--border); }
.sw-block:first-of-type { border-top: 0; padding-top: 2px; }
.sw-block-h { font-size: 14.5px; font-weight: 700; color: var(--text); margin: 0; }
.sw-block-sub { font-size: 12.5px; color: var(--text-3); line-height: 1.55; margin: -8px 0 0; }
.sw-block code { font-size: 11.5px; background: var(--surface-2); border-radius: 4px; padding: 1px 4px; }

/* Manage categories modal — list + inline create; Edit reuses roleEditDialog. */
.manage-cats { width: 560px; max-width: 94vw; border: 1px solid var(--border); border-radius: 16px; padding: 0; background: var(--surface); color: var(--text); box-shadow: 0 30px 80px rgba(0,0,0,.55); }
.manage-cats::backdrop { background: rgba(4,4,6,.62); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.mc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 22px 14px; border-bottom: 1px solid var(--border); }
.mc-head h3 { margin: 0; font-size: 18px; }
.mc-create { display: flex; gap: 8px; align-items: center; padding: 16px 22px; border-bottom: 1px solid var(--border); }
.mc-create input { flex: 1 1 auto; min-width: 0; }
.mc-list { padding: 6px 14px 14px; max-height: 56vh; overflow-y: auto; }
.mc-row { display: flex; align-items: center; gap: 12px; justify-content: space-between; padding: 11px 8px; border-bottom: 1px solid var(--border); }
.mc-row:last-child { border-bottom: 0; }
.mc-row:hover { background: var(--surface-2); }
.mc-row-main { min-width: 0; }
.mc-row-name { font-weight: 600; font-size: 13.5px; }
.mc-row-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 360px; }
@media (max-width: 560px) { .mc-create { flex-wrap: wrap; } .mc-row-sub { max-width: 55vw; } }

/* ── Sidebar footer: Add is the sole primary action (2026-09-01) ────────────
   Global "Find people" was removed — discovery is per-tribe now — so the 2-up
   grid collapses to a single full-width Add, matching the old primary's shape. */
.sb-primary { grid-template-columns: 1fr; }
.sidebar-footer .topbar-add { width: 100%; height: 36px; justify-content: center; }

/* Finish-setup callout — a light-blue outline draws the eye to it; the button
   itself is the green "go" (btn-success, set in the markup). */
.ov-setup-bar { border-color: rgba(96, 165, 250, .65); box-shadow: 0 0 0 1px rgba(96, 165, 250, .25); }

/* The two overview-toolbar actions (Fill empty categories / Manage categories)
   are one matched pair, sitting a touch taller than the 30px toolbar controls so
   they read as buttons with real vertical padding rather than squeezed chips.
   Scoped to .card-head so it beats the header's small-control rule. */
.card-head .ov-toolbar-btn { min-height: var(--ctl-h); height: var(--ctl-h); }


/* ---- Multi-fill category roster (.rc-roster) ----------------------------
   A category with more than one seat lists everyone behind the featured row,
   so a 99-seat "General fit" no longer renders identically to a 1-seat role.

   Written as new rules on purpose: details.card-collapse (line ~378) is bound
   to `> summary.card-head` — a full card header with its own padding, h3 and
   border — so it cannot be reused by a row-level summary. The chevron markup
   matches that pattern's shape without inheriting its chrome.

   .role-card is a 2-column grid, so this has to span both or it lands in the
   narrow first column of an implicit second row. */
.role-card .rc-roster { grid-column: 1 / -1; border-top: 1px solid var(--border-2); }
.role-card .rc-roster > summary {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 12px; cursor: pointer;
  font-size: 12px; color: var(--text-3);   /* the house muted idiom — see .muted */
  list-style: none;                 /* Firefox */
}
.role-card .rc-roster > summary::-webkit-details-marker { display: none; }
.role-card .rc-roster > summary:hover { color: var(--text); }
.role-card .rc-roster > summary .rc-roster-chev {
  display: inline-flex; width: 14px; height: 14px;
  transition: transform .15s ease;
}
.role-card .rc-roster[open] > summary .rc-roster-chev { transform: rotate(90deg); }
.role-card .rc-roster-n { font-weight: 600; color: var(--text); }
/* The list scrolls rather than stretching the card. .ov-cats is itself a scroll
   container, so this is a deliberate nested scroll, not an accident. */
.role-card .rc-roster-list { max-height: 320px; overflow-y: auto; }
.role-card .rc-roster-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 7px 12px; border-top: 1px solid var(--border-2);
  color: inherit; text-decoration: none;
}
.role-card .rc-roster-row:hover { background: rgba(255,255,255,.05); }
.role-card .rc-roster-row .rc-person-txt { min-width: 0; }
.role-card .rc-roster-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 7px 12px; border-top: 1px solid var(--border-2); font-size: 12px;
}
.role-card .rc-roster-foot a { color: var(--text-2); }
.role-card .rc-roster-foot a:hover { color: var(--text); }
@media (max-width: 640px) {
  .role-card .rc-roster-row { flex-wrap: wrap; }
  .role-card .rc-roster-foot { flex-direction: column; align-items: flex-start; gap: 4px; }
}

/* ---- Add drawer mode switch (.ap-modes) ---------------------------------
   Deliberately NOT .tabs. That class is overridden in the <=720px layer
   (app.css ~1437 and ~1486) with width:100%, and .drawer-head is a flex row
   that also holds the Close button — reusing it would crush the Close button
   on a phone, and appending an override here would beat the mobile layer at
   EVERY width. A small dedicated pair is cheaper than fighting that cascade. */
.ap-modes { display: inline-flex; gap: 2px; padding: 2px; border-radius: 8px; background: rgba(255,255,255,.05); }
.ap-mode {
  appearance: none; border: 0; cursor: pointer;
  padding: 5px 10px; border-radius: 6px;
  font: inherit; font-size: 12px; line-height: 1.2;
  color: var(--text-3); background: transparent;
}
.ap-mode:hover { color: var(--text); }
.ap-mode.is-on { color: var(--text); background: var(--surface-2); }
.ap-mode:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
/* The search panel reuses .drawer-body, so it scrolls the same way the add form
   does; only the gap under the mode switch is new. */
#addPersonSearch { padding-top: 14px; }
/* Match the add form: a flex column so .drawer-foot (flex-shrink:0) pins to the
   bottom instead of scrolling away mid-panel. .hide is display:none !important,
   so hiding still wins over this. */
#addPersonSearch:not(.hide) { display: flex; flex-direction: column; }
#addPersonSearch .drawer-foot { margin-top: auto; }
@media (max-width: 720px) {
  /* Wrap rather than stretch: the head must keep room for Close at 375px. */
  .drawer-head .ap-modes { margin: 6px 0; }
  .ap-mode { padding: 5px 8px; }
}

/* ── Conversion (/conversion) ────────────────────────────────────────────────
   At <=1024px every .tbl becomes a stacked card with its column labels dropped
   (see the "HTML data tables → compact cards" block). That suits lists, but the
   funnel / versions / events tables are rows of NUMBERS - "127 · 88% · 27%" means
   nothing without its label. .cv-labels puts each cell's own data-label back in
   front of it, on those three tables only. */
@media (max-width: 1024px) {
  .tbl.cv-labels td[data-label]:not(:first-child)::before {
    content: attr(data-label) " ";
    color: var(--text-3);
  }
}

/* ── Conversion v2: the visual story (2026-11-10) ───────────────────────────
   Operator: "a bunch of tables ... I need to really see things." Charts are HTML
   bars (crisp at 375px, CSP-safe). Series colours: dataviz reference palette,
   dark steps, validated against --surface #141416 (all six checks pass).
   Text never wears a series colour; status colours stay reserved. */
.cv-page {
  --cv-s1: #3987e5;   /* series 1: blue   - really read, RSVPs */
  --cv-s2: #d95926;   /* series 2: orange - clicked */
  --cv-s3: #199e70;   /* series 3: aqua   - checked in */
  --cv-track: rgba(255,255,255,.05);
  --cv-machine: #4a4a50;
}
.cv-story { margin: 18px 0 20px; }
.cv-lede { font-size: 19px; line-height: 1.55; color: var(--text-2); max-width: 980px; margin: 0 0 16px; }
.cv-lede strong { color: var(--text); font-weight: 650; }
.cv-alert { display: inline-block; margin-left: 6px; padding: 2px 10px; border-radius: 999px;
  background: var(--warning-soft); color: var(--warning); font-size: 14px; font-weight: 600; }
.cv-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.cv-kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.cv-kpi-v { font-size: 28px; font-weight: 700; letter-spacing: -.02em; color: var(--text); font-variant-numeric: tabular-nums; }
.cv-kpi-v.is-good { color: var(--success-fg); }
.cv-kpi-l { font-size: 12px; color: var(--text-3); margin-top: 2px; }

.cv-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.cv-card { padding: 18px 20px; margin: 0; }
.cv-wide { grid-column: 1 / -1; }
.cv-head h3 { margin: 0 0 4px; font-size: 15px; }
.cv-say { margin: 0 0 16px; color: var(--text-2); font-size: 13.5px; line-height: 1.5; max-width: 760px; }
.cv-say strong { color: var(--text); }
.cv-n { color: var(--text-3); font-size: 11.5px; font-weight: 400; margin-left: 4px; }

/* Funnel: thin bars, 4px rounded data end, anchored left. */
.cv-funnel { display: flex; flex-direction: column; gap: 9px; }
.cv-frow { display: grid; grid-template-columns: 130px minmax(0, 1fr) 190px; align-items: center; gap: 12px; }
.cv-flabel { font-size: 13px; color: var(--text-2); }
.cv-ftrack { height: 14px; background: var(--cv-track); border-radius: 0 4px 4px 0; }
.cv-fbar { height: 100%; background: var(--cv-s1); border-radius: 0 4px 4px 0; transition: width .4s ease; }
.cv-fval { font-size: 13px; color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cv-fval strong { color: var(--text); margin-right: 4px; }
.cv-fval em { font-style: normal; color: var(--text-3); margin-left: 8px; font-size: 11.5px; }

/* Column charts (weekly sends, events): 2px surface gap between bars. */
.cv-cols { display: flex; align-items: flex-end; gap: 2px; height: 150px; padding-bottom: 1px; border-bottom: 1px solid var(--border); }
.cv-col { flex: 1 1 0; height: 100%; display: flex; align-items: flex-end; min-width: 0; }
.cv-col:hover .cv-colbar { filter: brightness(1.25); }
.cv-colbar { width: 100%; background: var(--cv-s1); border-radius: 4px 4px 0 0; }
.cv-colbar.is-zero { height: 2px !important; background: var(--cv-track); }
.cv-col-pair { gap: 1px; }
.cv-col-pair .cv-colbar { width: 50%; }
.cv-colbar.is-s3 { background: var(--cv-s3); }
.cv-colbar.is-upcoming { background: repeating-linear-gradient(45deg, var(--cv-s1) 0 3px, transparent 3px 6px); }
.cv-xaxis { display: flex; gap: 2px; margin-top: 6px; }
.cv-xaxis span { flex: 1 1 0; min-width: 0; font-size: 10.5px; color: var(--text-3); white-space: nowrap; overflow: visible; }

/* Horizontal bars (open timing, tribes, A/B). */
.cv-hbars { display: flex; flex-direction: column; gap: 8px; }
.cv-hrow { display: grid; grid-template-columns: 150px minmax(0, 1fr) 52px; gap: 10px; align-items: center; }
.cv-hlabel { font-size: 13px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cv-htrack { position: relative; height: 12px; background: var(--cv-track); border-radius: 0 4px 4px 0; }
.cv-hbar { height: 100%; background: var(--cv-s1); border-radius: 0 4px 4px 0; }
.cv-hbar.is-s1 { background: var(--cv-s1); }
.cv-hbar.is-s2 { background: var(--cv-s2); }
.cv-hbar.is-machine { background: var(--cv-machine); }
.cv-hbar.is-none { background: transparent; box-shadow: inset 0 0 0 1px var(--border); }
.cv-hval { font-size: 13px; color: var(--text); text-align: right; font-variant-numeric: tabular-nums; }
.cv-ab { display: flex; flex-direction: column; gap: 14px; }
.cv-abtitle { font-size: 13px; color: var(--text); margin-bottom: 5px; }
.cv-abbars { display: flex; flex-direction: column; gap: 3px; margin-right: 44px; }
.cv-abbars .cv-htrack { height: 10px; }
.cv-abbars .cv-htrack b { position: absolute; right: -42px; top: -3px; font-size: 12px; font-weight: 500; color: var(--text-2); width: 38px; }

.cv-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 14px; font-size: 12px; color: var(--text-3); }
.cv-legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; background: var(--cv-s1); }
.cv-legend .sw.is-s2 { background: var(--cv-s2); }
.cv-legend .sw.is-s3 { background: var(--cv-s3); }
.cv-legend .sw.is-machine { background: var(--cv-machine); }
.cv-legend .sw.is-none { background: transparent; box-shadow: inset 0 0 0 1px var(--text-3); }
.cv-legend .sw.is-upcoming { background: repeating-linear-gradient(45deg, var(--cv-s1) 0 2px, transparent 2px 4px); }

/* Lane tiles: the working list as groups you open, not a wall. */
.cv-lanes { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.cv-lane { display: flex; flex-direction: column; gap: 4px; padding: 14px 15px 12px; border-radius: var(--radius);
  background: var(--surface-2); border: 1px solid var(--border); text-decoration: none; color: var(--text);
  transition: border-color .12s; }
.cv-lane:hover { border-color: rgba(255,255,255,.18); }
.cv-lane.is-open { border-color: var(--text-3); }
.cv-lane-n { font-size: 26px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.cv-lane-l { font-size: 13.5px; font-weight: 600; }
.cv-lane-h { font-size: 12px; color: var(--text-3); line-height: 1.4; flex: 1; }
.cv-lane-bar { height: 3px; background: var(--cv-track); border-radius: 2px; margin-top: 6px; }
.cv-lane-bar i { display: block; height: 100%; background: var(--text-3); border-radius: 2px; }
.cv-list-head { display: flex; align-items: center; gap: 8px; margin: 18px 0 8px; }
.cv-list-head .btn { margin-left: auto; }
.cv-numbers summary { cursor: pointer; list-style: none; }
.cv-numbers summary::-webkit-details-marker { display: none; }
.cv-numbers[open] summary { margin-bottom: 12px; }
.cv-numbers .tbl { margin-bottom: 16px; }

@media (max-width: 1024px) {
  .cv-grid { grid-template-columns: 1fr; }
  .cv-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cv-lede { font-size: 16.5px; }
}
@media (max-width: 600px) {
  .cv-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cv-frow { grid-template-columns: 1fr; gap: 4px; }
  .cv-hrow { grid-template-columns: 110px minmax(0, 1fr) 44px; }
  .cv-card { padding: 16px 14px; }
  .cv-cols { height: 120px; }
}
/* Conversion lanes on phones: a compact 2-up grid, hints off (the open group shows its own). */
@media (max-width: 600px) {
  .cv-lanes { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .cv-lane { padding: 11px 12px 10px; }
  .cv-lane-h { display: none; }
  .cv-lane-n { font-size: 22px; }
}

/* ── Home: Your tasks (replaced the categories board, 2026-11-10) ───────────
   Same card + .trow rows as the Hopper beside it. Plain, no coloured borders.
   Row = person | why now | actions (primary, Call, ✓ check-off). */
.tk2-tabbar { padding: 4px 16px 12px; border-bottom: 1px solid var(--border-2); }
.tk2-tabbar .tabs { margin-bottom: 8px; }
.tk2-sub { font-size: 12.5px; color: var(--text-3); }
.tk2-done { font-size: 12.5px; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.tk2-done strong { color: var(--text); }
.tk2-done-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); display: inline-block; }
.trow.tk2-row { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.3fr) auto; }
.tk2-why { display: flex; flex-direction: column; gap: 3px; min-width: 0; font-size: 13px; color: var(--text); line-height: 1.4; }
.tk2-tag { align-self: flex-start; font-size: 10.5px; color: var(--text-3); padding: 1px 7px; border-radius: 999px; border: 1px solid var(--border); white-space: nowrap; }
.tk2-acts { flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.tk2-acts form { margin: 0; display: inline-flex; }
.tk2-update { margin: 0; }
.tk2-update select { min-width: 150px; }
@media (max-width: 900px) {
  .trow.tk2-row { grid-template-columns: 1fr; gap: 8px; }
  .tk2-acts { justify-content: flex-start; }
  .tk2-tabbar .tabs { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; }
  .tk2-tabbar .tab { white-space: nowrap; }
}

/* ── Home: Ready to approve (moved from the retired /simple page) ───────────
   Tokens only, no new colours. */
.sp-approve { margin: 0; }
.sp-approve-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--border-2); flex-wrap: wrap; }
.sp-check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.sp-arow { display: grid; grid-template-columns: auto minmax(0, 1.2fr) minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 9px 16px; border-top: 1px solid var(--border-2); cursor: pointer; }
.sp-arow:hover { background: var(--surface-2); }
.sp-arow-who { display: flex; flex-direction: column; min-width: 0; }
.sp-arow-who strong { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-arow-mail { font-size: 13px; color: var(--text-2); overflow-wrap: anywhere; }
.sp-arow-state { display: flex; align-items: center; gap: 6px; justify-content: flex-end; white-space: nowrap; }
.sp-badge { font-size: 10.5px; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--border); color: var(--text-3); white-space: nowrap; }
.sp-badge.is-ok { color: var(--success); border-color: var(--success-soft); background: var(--success-soft); }
.sp-badge.is-warn { color: var(--warning-fg); border-color: var(--warning-soft); background: var(--warning-soft); }
@media (max-width: 760px) {
  .sp-arow { grid-template-columns: auto minmax(0, 1fr); }
  .sp-arow-mail, .sp-arow-state { grid-column: 2; justify-content: flex-start; }
}

/* Home: the event every tribe's invites link to (#events-default). */
.ev-home { margin: 0 0 16px; }
.ev-home .card-head { flex-wrap: wrap; gap: 10px; }
.ev-home-all { display: flex; gap: 8px; align-items: center; margin: 0 0 0 auto; flex-wrap: wrap; }
.ev-home-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 1px; background: var(--border-2); border-top: 1px solid var(--border-2); }
.ev-home-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 16px; margin: 0; background: var(--surface); }
.ev-home-row.is-missing .ev-home-tribe { color: var(--warning-fg); }
.ev-home-tribe { font-size: 13px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-home-row select { min-width: 0; width: 100%; }
.ev-home-link { font-size: 12px; color: var(--text-2); }
@media (max-width: 760px) { .ev-home-grid { grid-template-columns: 1fr; } .ev-home-row { grid-template-columns: 90px minmax(0, 1fr) auto; padding: 8px 12px; } }

/* Home: the pipeline bar (top of Home) + the one-line event strip. */
details.ev-home { margin: 0 0 16px; }
.ev-home-sum { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 16px; cursor: pointer; list-style: none; font-size: 13px; }
.ev-home-sum::-webkit-details-marker { display: none; }
.ev-home-chip { color: var(--text); font-weight: 600; }
.ev-home-chip.is-missing { color: var(--warning-fg); }
.ev-home-change { margin-left: auto; font-size: 12px; color: var(--text-2); border: 1px solid var(--border); border-radius: 999px; padding: 2px 10px; }
details.ev-home[open] .ev-home-change { color: var(--text); border-color: var(--accent); }
details.ev-home .ev-home-all { padding: 8px 16px 10px; border-top: 1px solid var(--border-2); margin: 0; }

/* ── Home: Autopilot bar (admin) + follow-up board (2026-11-11) ──────────────
   The board is a horizontally scrolling row of columns (Today, Replies, Event
   follow-ups, Closing follow-ups, Follow-ups due, Calls). Each column scrolls on
   its own. Tokens only. */
.ap-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; padding: 12px 16px; margin: 0 0 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.ap-bar.is-on { border-color: var(--success-soft); }
.ap-bar-state { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1 1 420px; }
.ap-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--text-3); flex: none; }
.ap-bar.is-on .ap-dot { background: var(--success); box-shadow: 0 0 0 4px var(--success-soft); }
.ap-title { font-weight: 600; font-size: 14.5px; color: var(--text); }
.ap-sub { font-size: 12.5px; color: var(--text-2); line-height: 1.45; font-weight: 400; }
.ap-bar-acts { display: flex; align-items: center; gap: 10px; }
.ap-bar-acts form { margin: 0; }
.ap-switch { position: relative; width: 46px; height: 26px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); cursor: pointer; padding: 0; flex: none; }
.ap-switch span { position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow-1); transition: left .15s ease; }
.ap-switch[aria-checked="true"] { background: var(--success); border-color: var(--success); }
.ap-switch[aria-checked="true"] span { left: 22px; }
.ap-switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ap-warn { flex-basis: 100%; display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--warning-fg); background: var(--warning-soft); border-radius: var(--radius-sm); padding: 8px 12px; }

/* ── Home: pipeline bubbles + "Your pipeline" (board and list) ──────────────
   Cards are deliberately lighter than their column so they read at a glance.
   Board = steps as columns; List = steps as titled sections. Same cards. */
.home-pipe-stats { margin: 0 0 18px; }
.home-pipe-stats .ths, .or-stats .ths { flex: 1 1 120px; }
a.ths { text-decoration: none; cursor: pointer; }
a.ths:hover { background: rgba(255,255,255,.09); border-color: var(--border); }
a.ths:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.kb { margin: 0 0 16px; }
.kb-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; margin: 0 0 12px; }
.kb-head h3 { margin: 0; font-size: 16px; }
.kb-head .tk2-done { margin-left: auto; }
.kb-tribe { margin: 0; }
.kb-views { display: inline-flex; padding: 2px; border: 1px solid var(--border); border-radius: 999px; background: rgba(255,255,255,.03); }
.kb-views a { padding: 4px 14px; border-radius: 999px; font-size: 12.5px; color: var(--text-2); text-decoration: none; }
.kb-views a.is-active { background: rgba(255,255,255,.12); color: var(--text); }

.kb-board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x proximity; }
.kb-col { display: flex; flex-direction: column; min-width: 0; background: rgba(255,255,255,.025); border: 1px solid var(--border-2); border-radius: var(--radius); scroll-snap-align: start; transition: border-color .12s ease, background .12s ease; }
.kb-col-head { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; padding: 10px 12px 8px; }
.kb-col-title { font-weight: 600; font-size: 13.5px; color: var(--text); display: inline-flex; align-items: center; }
.kb-board .kb-col-head .kb-n { margin-left: auto; }
.kb-col-sub { flex-basis: 100%; font-size: 11.5px; color: var(--text-2); }
.kb-step { display: inline-grid; place-items: center; width: 20px; height: 20px; margin-right: 8px; border-radius: 50%; font-size: 11px; font-weight: 700; color: var(--text-2); background: var(--surface); border: 1px solid var(--border); }
.kb-col-conversations .kb-step { color: var(--accent); border-color: var(--accent); }
.kb-n { font-size: 12px; font-weight: 600; color: var(--text-2); background: rgba(255,255,255,.06); border: 1px solid var(--border-2); border-radius: 999px; padding: 0 8px; font-variant-numeric: tabular-nums; }
.kb-col-body { display: flex; flex-direction: column; gap: 8px; padding: 0 8px 8px; max-height: 640px; overflow-y: auto; min-height: 60px; }
.kb-empty { font-size: 12.5px; color: var(--text-2); padding: 14px 6px; text-align: center; }
.kb-more { display: block; text-align: center; font-size: 12.5px; padding: 6px; color: var(--text-2); }

.kb-card { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); border-radius: var(--radius-sm); padding: 11px 12px; display: flex; flex-direction: column; gap: 6px; box-shadow: 0 1px 2px rgba(0,0,0,.25); cursor: grab; transition: border-color .12s ease, background .12s ease, opacity .12s ease; }
.kb-card:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.22); }
.kb-card.is-drag { opacity: .45; cursor: grabbing; }
.kb-card.is-saving { opacity: .6; pointer-events: none; }
.kb-c-who, .kb-c-what { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.kb-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.kb-name { font-weight: 650; font-size: 14px; color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
.kb-name:hover { text-decoration: underline; }
.kb-score { font-size: 11px; color: var(--text); border: 1px solid rgba(255,255,255,.2); border-radius: 6px; padding: 0 5px; font-variant-numeric: tabular-nums; flex: none; }
.kb-meta { font-size: 12.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb-why { font-size: 13px; color: var(--text); line-height: 1.4; opacity: .9; }
.kb-quote { margin: 2px 0 0; font-size: 12.5px; line-height: 1.45; color: var(--text); background: rgba(0,0,0,.25); border-left: 3px solid var(--accent); border-radius: 4px; padding: 6px 8px; overflow-wrap: anywhere; }
.kb-act { align-self: flex-start; margin-top: 2px; }
.kb-reply { margin-top: 2px; }
.kb-reply > summary { list-style: none; display: inline-flex; cursor: pointer; }
.kb-reply > summary::-webkit-details-marker { display: none; }
.kb-reply[open] > summary { display: none; }
.kb-reply form { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.kb-reply textarea { width: 100%; resize: vertical; min-height: 90px; font-size: 13px; }
.kb-reply-acts { display: flex; justify-content: flex-end; gap: 6px; }
.kb-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kb-tag { font-size: 11.5px; color: var(--text-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb-form { margin: 0; }

/* The Update menu: a styled menu instead of the browser's white select list. */
.kb-menu { position: relative; }
.kb-menu > summary { list-style: none; }
.kb-menu > summary::-webkit-details-marker { display: none; }
.kb-menu-btn { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px 0 12px; border-radius: 999px; font-size: 12.5px; color: var(--text); background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16); cursor: pointer; user-select: none; }
.kb-menu-btn::after { content: ""; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translateY(-2px); opacity: .7; }
.kb-menu-btn:hover, .kb-menu[open] .kb-menu-btn { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.26); }
.kb-menu-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.kb-menu-list { position: fixed; z-index: 500; min-width: 190px; padding: 6px; display: flex; flex-direction: column; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 12px 32px rgba(0,0,0,.45); }
.kb-mi { display: block; width: 100%; text-align: left; padding: 7px 10px; border: 0; border-radius: 6px; background: transparent; color: var(--text); font: inherit; font-size: 13px; cursor: pointer; }
.kb-mi:hover, .kb-mi:focus-visible { background: rgba(255,255,255,.08); outline: none; }
.kb-mi.is-done { color: var(--success); font-weight: 600; }
.kb-mi.is-lost { color: var(--danger-fg); }
.kb-mi-sep { font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); padding: 8px 10px 4px; border-top: 1px solid var(--border-2); margin-top: 4px; }

/* Drag and drop. */
.kb.is-dragging .kb-col[data-drop]:not([data-drop=""]) { border-style: dashed; border-color: var(--border); }
.kb-col.is-over, .kb-drop.is-over { border-color: var(--accent) !important; background: var(--accent-soft); }
.kb-dropbar { display: none; gap: 12px; margin-top: 12px; }
.kb.is-dragging .kb-dropbar { display: grid; grid-template-columns: 1fr 1fr; }
.kb-drop { padding: 16px; text-align: center; font-size: 13px; font-weight: 600; color: var(--text-2); border: 1px dashed var(--border); border-radius: var(--radius); transition: border-color .12s ease, background .12s ease; }
.kb-drop.is-member { color: var(--success); }
.kb-drop.is-lost { color: var(--danger-fg); }

/* List view: each step is a section with its title top-left; cards lie flat. */
.kb-list { display: flex; flex-direction: column; gap: 14px; }
.kb-list .kb-col-head { padding: 12px 14px 10px; border-bottom: 1px solid var(--border-2); }
.kb-list .kb-col-title { font-size: 14.5px; }
.kb-list .kb-col-sub { flex-basis: auto; margin-left: 4px; }
.kb-list .kb-col-body { max-height: none; overflow: visible; padding: 8px; }
.kb-list .kb-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr) 220px; align-items: start; gap: 6px 16px; }
.kb-list .kb-foot { justify-content: flex-end; }

.kb-full-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 10px; }
.kb-full-head h4 { margin: 0; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.kb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }

@media (max-width: 760px) {
  .ap-bar-state { flex-basis: 100%; }
  .ap-bar-acts { width: 100%; justify-content: space-between; }
  .kb-board { grid-auto-columns: 85%; }
  .kb-col-body { max-height: 520px; }
  .kb-head .tk2-done { margin-left: 0; }
  .kb-list .kb-card { grid-template-columns: 1fr; }
}

/* ── Outreach page (2026-11-11). Tokens only. */
.or-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin: 0 0 12px; }
.or-head .page-sub { max-width: 760px; line-height: 1.5; }
.or-tribe { margin: 0; }
.or-stats-card { margin: 0 0 14px; }
.or-stats { padding: 14px 16px; margin: 0; }
.or-note { padding: 0 16px 10px; margin: 0; line-height: 1.45; }
.or-section { font-size: 15px; margin: 22px 0 10px; }
.sp-arow.or-row { grid-template-columns: 18px minmax(0, 1.3fr) minmax(0, 1fr) 190px; }
.or-row .sp-arow-mail { line-height: 1.45; }
.sp-arow.or-missing { grid-template-columns: 130px minmax(0, 1.3fr) minmax(0, 1fr) 110px; color: inherit; text-decoration: none; }
.or-missing .sp-badge { justify-self: start; }
@media (max-width: 760px) {
  .sp-arow.or-row, .sp-arow.or-missing { grid-template-columns: auto minmax(0, 1fr); }
  .or-row .sp-arow-mail, .or-row .sp-arow-state, .or-missing .sp-arow-mail, .or-missing .sp-arow-state { grid-column: 2; justify-content: flex-start; }
}

/* ── Person drawer: cheap to slide ───────────────────────────────────────────
   Operator, 2026-11-11: opening a person felt laggy. The drawer covers ~94% of
   the screen, so its 56px backdrop blur (plus the backdrop's own blur) was
   re-blurring almost the whole page on every frame of the slide while showing
   almost none of it. Near-opaque fill instead: same look, a fraction of the
   GPU work. Must stay the LAST .cand-drawer / .drawer rule to win the cascade. */
.drawer.drawer-side.cand-drawer {
  background: rgba(17,18,23,.97);
  backdrop-filter: none; -webkit-backdrop-filter: none;
  will-change: transform;
  transition: transform .18s cubic-bezier(.2,.8,.2,1), opacity .12s ease, visibility .18s;
}
body:has(#candidateDrawer.open) .drawer-backdrop {
  backdrop-filter: none; -webkit-backdrop-filter: none;
}

/* Add person, board mode: a short form. Status and website/score are queue
   things; the lookup option is a board thing. */
#addPersonDrawer .ap-board-only { display: none; }
#addPersonDrawer.is-board .ap-board-only { display: block; }
#addPersonDrawer.is-board .ap-adv, #addPersonDrawer.is-board .ap-modes { display: none !important; }
.ap-lookup { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border-2); border-radius: var(--radius-sm); cursor: pointer; }
.ap-lookup input { margin-top: 3px; }

/* == Light content area + width (operator, 2026-11-11) ========================
   "The middle area and the good afternoon place ... a nice cream colour
   background ... light themed", and "bring in the overall max width of the
   whole site so it is clean". The sidebar stays dark glass; everything to its
   right is cream. Done by re-pointing the design tokens INSIDE .main, so every
   component that already uses var(--text) / var(--border) / var(--glass-bg)
   follows without being rewritten; the handful that hardcode a dark-mode
   colour are corrected below. Drawers live outside :is(.main, .drawer) and stay dark.
   MUST stay at the end of the file: earlier layers set :is(.main, .drawer) and .card. */
.main {
  --bg:        #f4f3f0;
  --surface:   #fefefd;
  --surface-2: #ecebe7;
  --border:    rgba(74,52,30,.14);
  --border-2:  rgba(74,52,30,.09);
  --text:      #27221d;
  --text-2:    #5f564d;
  --text-3:    #8b8177;
  --accent-soft: rgba(255,91,31,.11);
  --success-fg: #0e7a4f;
  --danger-fg:  #c2364a;
  --warning-fg: #93630a;
  --glass-sheen: linear-gradient(transparent, transparent);
  --tex-frost:   linear-gradient(transparent, transparent);
  --glass-tint:  #fefefd;
  --glass-bg:    #fefefd;
  --glass-blur:  none;
  --shadow-1: 0 1px 2px rgba(74,52,30,.06), 0 3px 12px rgba(74,52,30,.05);
  --card-line: rgba(74,52,30,.12);
  background: var(--bg);
  color: var(--text);
}
:is(.main, .drawer) .card, :is(.main, .drawer) .ths {
  background: var(--surface); border-color: var(--card-line);
  box-shadow: var(--shadow-1);
  backdrop-filter: none; -webkit-backdrop-filter: none;
}
:is(.main, .drawer) .input, :is(.main, .drawer) select.input, :is(.main, .drawer) textarea.input {
  background: #fff; border-color: var(--border); color: var(--text);
}
:is(.main, .drawer) .input::placeholder { color: var(--text-3); }
:is(.main, .drawer) .btn:not(.btn-primary):not(.btn-accent):not(.btn-success):not(.btn-danger) {
  background: #fff; border-color: var(--border); color: var(--text);
}
:is(.main, .drawer) .btn:not(.btn-primary):not(.btn-accent):not(.btn-success):not(.btn-danger):hover { background: var(--surface-2); }
:is(.main, .drawer) .btn-ghost { background: transparent !important; }
:is(.main, .drawer) .page-title, :is(.main, .drawer) h1, :is(.main, .drawer) h2, :is(.main, .drawer) h3, :is(.main, .drawer) h4 { color: var(--text); }
:is(.main, .drawer) .meta, :is(.main, .drawer) .muted { color: var(--text-3); }
:is(.main, .drawer) .tab { color: var(--text-2); }
:is(.main, .drawer) .tab-active { color: var(--text); }

@media (min-width: 1025px) {
  /* One centred module, no wider than 1480px. */
  :root { --shell-inset-x: max(2.5vw, calc((100vw - 1480px) / 2)); }
}
.main > :not(.drawer):not(.drawer-backdrop):not(.app-header) { max-width: 1240px; margin-left: auto; margin-right: auto; }

/* Welcome: a warm light card, not the dark photo - unless the person chose a
   header picture (that is an inline style, which still wins). */
:is(.main, .drawer) .welcome-banner {
  background: linear-gradient(120deg, #fdfcfa 0%, #f6f3ef 55%, #efe9e1 100%);
  border: 1px solid var(--card-line); box-shadow: var(--shadow-1);
}
:is(.main, .drawer) .welcome-banner::before, :is(.main, .drawer) .welcome-banner::after { display: none; }
:is(.main, .drawer) .welcome-eyebrow { color: #b4541f; text-shadow: none; }
:is(.main, .drawer) .welcome-title { color: var(--text); text-shadow: none; }
:is(.main, .drawer) .welcome-sub { color: var(--text-2); text-shadow: none; }
:is(.main, .drawer) .welcome-avatar.is-initial { background: #fff; color: var(--text); border: 1px solid var(--card-line); }
:is(.main, .drawer) .welcome-bg-btn { background: rgba(255,255,255,.7); color: var(--text-2); border-color: var(--card-line); }
:is(.main, .drawer) .welcome-banner[style*="background:url"] .welcome-title,
:is(.main, .drawer) .welcome-banner[style*="background:url"] .welcome-sub,
:is(.main, .drawer) .welcome-banner[style*="background:url"] .welcome-eyebrow { color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.4); }

/* Shared light fixes for things that hardcoded dark-mode colours. */
:is(.main, .drawer) .kb-menu-list { background: #fff; border-color: var(--border); box-shadow: 0 12px 32px rgba(74,52,30,.16); }
:is(.main, .drawer) .kb-mi { color: var(--text); }
:is(.main, .drawer) .kb-mi:hover, :is(.main, .drawer) .kb-mi:focus-visible { background: var(--surface-2); }
:is(.main, .drawer) .kb-mi-sep { border-top-color: var(--border-2); }
:is(.main, .drawer) .kb-views { background: #fff; border-color: var(--border); }
:is(.main, .drawer) .kb-views a { color: var(--text-2); }
:is(.main, .drawer) .kb-views a.is-active { background: var(--text); color: #fff; }
:is(.main, .drawer) .kb-quote, :is(.main, .drawer) .pbc-quote { background: #fbf3ee; color: var(--text); }
:is(.main, .drawer) .sp-badge { background: var(--surface-2); color: var(--text-2); }
:is(.main, .drawer) .ap-bar { background: var(--surface); border-color: var(--card-line); box-shadow: var(--shadow-1); }

/* -- Personal board (Home) ---------------------------------------------------
   Plan 2026-11-11-acquisition-and-personal-boards, redesigned the same day
   ("the board UI looks terrible"). Calm columns, white cards, one tint per
   tribe on the avatar and chip, a quiet menu button instead of a Move pill. */
.pb .kb-head { margin-bottom: 14px; }
.pb .kb-head h3 { font-size: 18px; font-weight: 700; }
.pb-head-acts { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pb-head-acts .btn { display: inline-flex; align-items: center; gap: 6px; }
.pb-head-acts .btn .ico { width: 15px; height: 15px; }
.pb-head-acts .kb-tribe { margin: 0; }
.pb-replies { color: var(--accent); }

.pb .kb-board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(228px, 1fr); gap: 14px; align-items: start; overflow-x: auto; padding-bottom: 6px; }
.pb-col { display: flex; flex-direction: column; min-width: 0; background: rgba(74,52,30,.045); border: 1px solid transparent; border-radius: 12px; padding-top: 4px; }
.pb-col.is-over { border-color: var(--accent); background: var(--accent-soft); }
.pb-col-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px 4px; border-radius: 10px; }
.pb-col-head[draggable="true"] { cursor: grab; }
.pb-col-head[draggable="true"]:hover { background: rgba(74,52,30,.05); }
.pb-col-head[draggable="true"]:hover .pb-grip { opacity: 1; }
.pb-grip { display: inline-flex; width: 10px; height: 16px; color: var(--text-3); opacity: .45; flex: none; }
.pb-grip svg { width: 10px; height: 16px; }
.pb-col-title { font-weight: 700; font-size: 13.5px; color: var(--text); }
.kb-col-new .pb-col-title { color: var(--accent); }
.pb-col-n { font-size: 12px; font-weight: 600; color: var(--text-3); font-variant-numeric: tabular-nums; }
.pb-add { margin-left: auto; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; border: 0; background: transparent; color: var(--text-3); font-size: 18px; line-height: 1; cursor: pointer; }
.pb-add:hover { background: #fff; color: var(--accent); box-shadow: var(--shadow-1); }
.pb-col-hint { padding: 0 12px 6px; font-size: 11.5px; color: var(--text-3); }
.pb .kb-col-body { display: flex; flex-direction: column; gap: 8px; padding: 6px 8px 10px; max-height: 66vh; overflow-y: auto; min-height: 60px; }
.pb .kb-empty { border: 1.5px dashed var(--border); border-radius: 10px; padding: 18px 10px; color: var(--text-3); text-align: center; font-size: 12.5px; }
.pb-col.is-col-drag, .pbs-row.is-col-drag { opacity: .45; }

.pbc { background: #fff; border: 1px solid var(--card-line); border-radius: 10px; padding: 11px 12px; display: flex; flex-direction: column; gap: 9px; box-shadow: 0 1px 2px rgba(74,52,30,.05); cursor: grab; transition: box-shadow .12s ease, border-color .12s ease, opacity .12s ease; }
.pbc:hover { border-color: rgba(74,52,30,.22); box-shadow: 0 4px 14px rgba(74,52,30,.10); }
.pbc.is-drag { opacity: .4; cursor: grabbing; }
.pbc.is-saving { opacity: .6; pointer-events: none; }
.pbc.has-reply { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.pbc.is-done { background: #f8f7f5; }
.pbc-top { display: flex; align-items: flex-start; gap: 10px; }
.pbc-av { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: hsl(var(--h) 45% 30%); background: hsl(var(--h) 60% 92%); }
.pbc-id { min-width: 0; flex: 1; }
.pbc-name { display: block; font-weight: 650; font-size: 14px; color: var(--text); text-decoration: none; line-height: 1.25; overflow-wrap: anywhere; }
.pbc-name:hover { color: var(--accent); }
.pbc-sub { margin-top: 2px; font-size: 12px; color: var(--text-2); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pbc .kb-form { margin: 0; flex: none; }
.pbc .kb-menu { position: relative; }
.pbc .kb-menu > summary { list-style: none; }
.pbc-more { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; color: var(--text-3); cursor: pointer; }
.pbc-more::-webkit-details-marker { display: none; }
.pbc-more svg { width: 16px; height: 16px; }
.pbc-more:hover, details[open] > .pbc-more { background: var(--surface-2); color: var(--text); }
.pbc .kb-menu-list a.kb-mi { text-decoration: none; }
.pbc-tags { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
.pbc-chip { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; color: hsl(var(--h) 45% 30%); background: hsl(var(--h) 60% 94%); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pbc-score { margin-left: auto; font-size: 11px; font-weight: 700; color: var(--text-2); background: var(--surface-2); border-radius: 6px; padding: 1px 6px; font-variant-numeric: tabular-nums; }
.pb-badge { font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; border-radius: 999px; padding: 2px 7px; }
.pb-badge.is-reply { color: var(--accent); background: var(--accent-soft); }
.pb-badge.is-member { color: var(--success-fg); background: rgba(26,169,113,.12); }
.pb-badge.is-lost { color: var(--danger-fg); background: rgba(242,85,106,.10); }
.pbc-quote { margin: 0; font-size: 12.5px; line-height: 1.45; border-left: 3px solid var(--accent); border-radius: 4px; padding: 6px 8px; overflow-wrap: anywhere; }
.pbc-phone { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); text-decoration: none; align-self: flex-start; }
.pbc-phone svg { width: 13px; height: 13px; }
.pbc-phone:hover { color: var(--accent); }

.pb .kb-col-done { background: rgba(74,52,30,.03); }
.pb-finish { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 4px 8px 6px; }
.pb-finish .kb-drop { padding: 9px; font-size: 12.5px; font-weight: 600; text-align: center; border-radius: 8px; border: 1.5px dashed var(--border); background: transparent; }
.pb-finish .kb-drop.is-member { color: var(--success-fg); }
.pb-finish .kb-drop.is-lost { color: var(--danger-fg); }
.pb-finish .kb-drop.is-over { border-color: var(--accent); background: var(--accent-soft); }
.pb.is-dragging .pb-finish .kb-drop { border-style: solid; }

.pb .kb-list { display: flex; flex-direction: column; gap: 14px; }
.pb .kb-list .kb-col-body { max-height: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.pb .kb-list .kb-empty { grid-column: 1 / -1; }

/* Column settings drawer (dark, like every drawer). */
.pbs-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border-2); border-radius: 8px; margin-bottom: 8px; background: rgba(255,255,255,.03); }
.pbs-row form { margin: 0; }
.pbs-row .pb-grip { cursor: grab; opacity: .7; }
.pbs-row.is-fixed { opacity: .65; }
.pbs-lock { font-size: 12px; }
.pbs-name { font-weight: 600; }
.pbs-row.is-fixed .meta { margin-left: auto; }
.pbs-rename { display: flex; gap: 6px; flex: 1; min-width: 0; }
.pbs-rename .input { flex: 1; min-width: 0; }
.pbs-del { color: var(--danger-fg); }
.pbs-add { display: flex; gap: 8px; margin-top: 16px; }
.pbs-add .input { flex: 1; }

/* -- Outreach: the Acquisition flow, top to bottom ---------------------------
   Left: the river, flowing down, splitting into "No reply" and "Responded".
   Right: whoever is on the step you clicked (loaded in place, see outreach.php). */
.af2 { display: grid; grid-template-columns: minmax(380px, 440px) minmax(0, 1fr); gap: 18px; align-items: start; }
.af2-flow { padding: 16px; display: flex; flex-direction: column; align-items: stretch; position: sticky; top: 12px; }
.af2-stage { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); margin: 0 0 8px; text-align: center; }
.af2-down { position: relative; display: block; height: 26px; margin: 0 auto; width: 2px; background: var(--border); }
.af2-down::after { content: ""; position: absolute; bottom: -1px; left: -4px; border: 5px solid transparent; border-top-color: var(--border); border-bottom: 0; }
.af2-down em { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); font-size: 10.5px; font-style: normal; color: var(--text-3); white-space: nowrap; }
.af2-down.is-exit { background: var(--success); }
.af2-down.is-exit::after { border-top-color: var(--success); }
.af2-split { height: 22px; margin: 6px 25% 4px; border: 2px solid var(--border); border-bottom: 0; border-radius: 10px 10px 0 0; }
.af2-branches { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.af2-branch { display: flex; flex-direction: column; align-items: stretch; }
.af2-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.af2-pair .af-node { padding: 8px; }
.af2-pair .af-l { font-size: 11.5px; }
.af-node, .af2-node { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--card-line, var(--border)); background: #fff; text-decoration: none; color: var(--text); box-shadow: 0 1px 2px rgba(74,52,30,.05); transition: border-color .12s ease, box-shadow .12s ease, transform .12s ease; }
.af-node:hover { border-color: rgba(74,52,30,.28); box-shadow: 0 4px 14px rgba(74,52,30,.10); transform: translateY(-1px); }
.af-node:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.af-node.is-on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset, 0 4px 14px rgba(255,91,31,.14); }
.af-node.is-empty .af-n { color: var(--text-3); }
.af-n { font-size: 20px; font-weight: 750; font-variant-numeric: tabular-nums; line-height: 1.1; color: var(--text); }
.af-l { font-size: 12px; color: var(--text-2); }
.af-voice:not(.is-empty) .af-n, .af-replied:not(.is-empty) .af-n { color: var(--accent); }
.is-yes .af-node { background: #f6fbf8; }
.af-noresp { border-style: dashed; }
.af2-handoff { border: 1.5px dashed var(--success); background: rgba(26,169,113,.06); align-items: center; }
.af2-handoff .af-n { color: var(--success-fg); }
.af2-foot { margin: 14px 0 0; text-align: center; }

.af2-panel { padding: 18px 20px; min-height: 360px; transition: opacity .12s ease; }
.af2-panel.is-loading { opacity: .5; }
.af2-panel-head { margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--border-2); }
.af2-panel-head h3 { margin: 4px 0 2px; font-size: 20px; display: flex; align-items: center; gap: 10px; }
.af2-panel-head .meta { margin: 0; }
.af2-count { font-size: 13px; font-weight: 700; color: var(--text-2); background: var(--surface-2); border-radius: 999px; padding: 1px 10px; }
.af2-lane-tag { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.af2-lane-tag.is-yes { color: var(--success-fg); }
.af2-lane-tag.is-quiet, .af2-lane-tag.is-end { color: #b4541f; }
.af-list { display: flex; flex-direction: column; }
.af-item { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) auto; gap: 8px 16px; align-items: center; padding: 11px 4px; border-top: 1px solid var(--border-2); }
.af-item:first-child { border-top: 0; }
.af-item .kb-name { color: var(--text); font-weight: 650; text-decoration: none; }
.af-what { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.af-acts { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.af-acts form { margin: 0; }
.af-hand { display: flex; gap: 6px; }
.af-hand .input { max-width: 160px; }

@media (max-width: 1180px) {
  .af2 { grid-template-columns: 1fr; }
  .af2-flow { position: static; max-width: 520px; width: 100%; margin: 0 auto; }
}
@media (max-width: 760px) {
  .pb-head-acts { margin-left: 0; width: 100%; }
  .pb .kb-board { grid-auto-columns: 86%; }
  .af-item { grid-template-columns: 1fr; }
  .af-acts { justify-content: flex-start; }
}

/* Light content area: components that hardcoded a dark-mode fill or a
   pale-on-dark text colour (found by sweeping every page for low contrast). */
:is(.main, .drawer) .tabs { background: #fff; border: 1px solid var(--border); box-shadow: var(--shadow-1); }
:is(.main, .drawer) .tabs .tab:hover { background: var(--surface-2); color: var(--text); }
:is(.main, .drawer) .tabs .tab-active { background: var(--surface-2); color: var(--text); }
:is(.main, .drawer) .person-card { background: var(--surface-2); border-color: var(--border-2); }
:is(.main, .drawer) .btn-success { color: #0e7a4f; background: rgba(26,169,113,.13); border-color: rgba(26,169,113,.38); }
:is(.main, .drawer) .btn-success:hover { background: rgba(26,169,113,.2); }
:is(.main, .drawer) .rail-alert.is-warn { color: #7a5200; }
:is(.main, .drawer) .rail-alert strong { color: inherit; }
:is(.main, .drawer) option { background: #fff; color: var(--text); }
:is(.main, .drawer) .pill.pending, :is(.main, .drawer) .pill.review { color: #b4541f; }
:is(.main, .drawer) .seg { background: #fff; border-color: var(--border); }
:is(.main, .drawer) .seg-opt:hover { background: var(--surface-2); color: var(--text); }
:is(.main, .drawer) .seg-opt.is-on { background: var(--text); border-color: var(--text); color: #fff; }
:is(.main, .drawer) .src-detail { background: var(--surface-2); }
:is(.main, .drawer) .fork-branch.is-yes .fork-tag { color: #0e7a4f; }
:is(.main, .drawer) .fork-branch.is-no .fork-tag { color: #8a5a00; }
:is(.main, .drawer) .rc-sig.sig-alert { color: #b42332; }
:is(.main, .drawer) .rc-sig.sig-hot   { color: #b4451a; }
:is(.main, .drawer) .rc-sig.sig-due   { color: #7d6100; }
:is(.main, .drawer) .rc-sig.sig-warn  { color: #8a5a00; }
:is(.main, .drawer) .rc-sig.sig-good  { color: #3d6b0c; }
:is(.main, .drawer) .rc-sig.sig-pause { color: #7d5a00; }

/* == Shell 2: one centred module, content in a bubble (operator, 2026-11-11) ==
   "The middle area content and the left sidebar need to be both included in
   the max width ... the right area needs to be kind of in a bubble ... more
   rounded corners ... primary, secondary and tertiary buttons clearer ... fix
   the menus." This block is the LAST word on the desktop shell: the layers
   above (full bleed, gutters, insets) are overridden here, not edited, so it
   can be removed in one piece. */
:root {
  --radius: 12px;
  --radius-sm: 8px;
  --shell-radius: 24px;
  --bubble-radius: 20px;
  --module-max: 1480px;
}

@media (min-width: 1025px) {
  /* The module: sidebar + content together, centred, never wider than 1480. */
  .app-frame {
    inset: 18px max(18px, calc((100vw - var(--module-max)) / 2));
    padding-left: 0;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: var(--shell-radius);
    box-shadow: 0 30px 80px rgba(0,0,0,.45);
  }
  .sidebar { inset: 12px auto 12px 12px; border-radius: 18px; }
  .app-header { left: calc(var(--sidebar-w) + 24px); }
  /* The content bubble: its own rounded cream panel beside the sidebar. */
  .main {
    margin: 12px 12px 12px calc(var(--sidebar-w) + 24px);
    height: calc(100% - 24px);
    padding: 28px 32px 56px;
    border-radius: var(--bubble-radius);
    box-shadow: 0 1px 0 rgba(255,255,255,.6) inset, 0 10px 40px rgba(0,0,0,.28);
  }
  .main > :not(.drawer):not(.drawer-backdrop):not(.app-header) { max-width: 1180px; }
}

/* ── Rounder, everywhere ─────────────────────────────────────────────────── */
.card { border-radius: 16px; }
.btn, .input, select.input, textarea.input { border-radius: 10px; }
.btn-sm, .input-sm { border-radius: 9px; }
.tabs { border-radius: 12px; }
.tab { border-radius: 9px; }
.pill, .sp-badge, .pb-badge { border-radius: 999px; }
.ths { border-radius: 14px; }
.drawer:not(.drawer-side) { border-radius: 18px; }
.drawer.drawer-side { border-radius: 18px 0 0 18px; }
.alert { border-radius: 12px; }

/* ── Buttons: three tiers you can tell apart at a glance ─────────────────────
   PRIMARY    .btn-primary / .btn-accent   solid orange, white text - the action
   SECONDARY  .btn                         solid surface with a clear border
   TERTIARY   .btn-ghost                   text only, tinted on hover
   (.btn-success / .btn-danger stay secondary-weight, coloured by meaning.) */
.btn { font-weight: 600; letter-spacing: -.005em; transition: background .14s ease, border-color .14s ease, color .14s ease, box-shadow .14s ease, transform .08s ease; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-primary, .btn-accent {
  background: var(--accent); border-color: var(--accent); color: #fff;
  box-shadow: 0 1px 0 rgba(255,255,255,.25) inset, 0 4px 14px rgba(255,91,31,.28);
}
.btn-primary:hover, .btn-accent:hover { background: #ee4f14; border-color: #ee4f14; color: #fff; box-shadow: 0 1px 0 rgba(255,255,255,.25) inset, 0 6px 18px rgba(255,91,31,.36); }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; }
:is(.main, .drawer) .btn:not(.btn-primary):not(.btn-accent):not(.btn-success):not(.btn-danger):not(.btn-ghost) {
  background: #fff; border-color: rgba(74,52,30,.22); color: var(--text);
  box-shadow: 0 1px 2px rgba(74,52,30,.08);
}
:is(.main, .drawer) .btn:not(.btn-primary):not(.btn-accent):not(.btn-success):not(.btn-danger):not(.btn-ghost):hover {
  background: #fff; border-color: rgba(74,52,30,.4); box-shadow: 0 3px 10px rgba(74,52,30,.12);
}
:is(.main, .drawer) .btn-ghost { color: var(--text-2); }
:is(.main, .drawer) .btn-ghost:hover { background: rgba(74,52,30,.07) !important; color: var(--text); }
:is(.main, .drawer) .btn-danger { background: #fff; color: #c2364a; border-color: rgba(194,54,74,.35); }
:is(.main, .drawer) .btn-danger:hover { background: #fff5f6; }
/* Inside the dark drawers the secondary tier is a lifted dark surface. */
.drawer .btn:not(.btn-primary):not(.btn-accent):not(.btn-success):not(.btn-danger):not(.btn-ghost) {
  background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.16); color: var(--text);
}
.drawer .btn:not(.btn-primary):not(.btn-accent):not(.btn-success):not(.btn-danger):not(.btn-ghost):hover { background: rgba(255,255,255,.12); }

/* ── Menus: one look for every dropdown ──────────────────────────────────── */
.kb-menu-list, .mdd-pop, .filter-menu-body, .topbar-user-menu {
  border-radius: 14px; padding: 6px;
}
:is(.main, .drawer) .kb-menu-list, :is(.main, .drawer) .mdd-pop, :is(.main, .drawer) .filter-menu-body {
  background: #fff; border: 1px solid rgba(74,52,30,.14);
  box-shadow: 0 16px 40px rgba(74,52,30,.18), 0 2px 6px rgba(74,52,30,.08);
  backdrop-filter: none; -webkit-backdrop-filter: none; color: var(--text);
}
.kb-mi, .mdd-opt, .topbar-user-menu a, .topbar-user-menu button { border-radius: 9px; padding: 8px 10px; font-size: 13px; }
:is(.main, .drawer) .mdd-opt { color: var(--text); }
:is(.main, .drawer) .mdd-opt:hover, :is(.main, .drawer) .kb-mi:hover { background: #f2f1ee; }
.kb-mi-sep { font-size: 10px; letter-spacing: .08em; padding: 8px 10px 4px; margin-top: 4px; }
:is(.main, .drawer) .kb-mi.is-done { color: #0e7a4f; }
:is(.main, .drawer) .kb-mi.is-lost { color: #c2364a; }
:is(.main, .drawer) .filter-menu > summary.filter-toggle { background: #fff; border-color: rgba(74,52,30,.22); }
:is(.main, .drawer) .mdd-btn { background: #fff; border-color: rgba(74,52,30,.22); border-radius: 10px; color: var(--text); }
.kb-menu-list { animation: menu-in .12s ease-out; transform-origin: top right; }
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }

/* ── The board, more alive under the cursor ──────────────────────────────── */
.pbc { transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease, opacity .14s ease; }
.pbc:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(74,52,30,.14); }
.pbc:active { cursor: grabbing; }
.pbc.is-drag { opacity: .35; transform: scale(.97); border-style: dashed; box-shadow: none; }
.pbc.is-landed { animation: card-land .45s ease-out; }
@keyframes card-land { 0% { transform: scale(1.04); box-shadow: 0 0 0 3px rgba(255,91,31,.45), 0 10px 26px rgba(74,52,30,.2); } 100% { transform: none; } }
.pb.is-dragging .pb-col:not(.kb-col-done) { outline: 1.5px dashed rgba(74,52,30,.18); outline-offset: -1px; }
.pb-col { transition: background .14s ease, border-color .14s ease, box-shadow .14s ease, transform .14s ease, opacity .14s ease; }
.pb-col.is-over { background: rgba(255,91,31,.07); border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255,91,31,.12); outline: none !important; }
.pb-col.is-over .kb-col-body::before { content: "Drop here"; display: block; text-align: center; font-size: 12px; font-weight: 600; color: var(--accent); padding: 12px; border: 1.5px dashed var(--accent); border-radius: 10px; background: #fff; }
.pb-col.is-col-drag { opacity: .4; transform: scale(.98); }
.pb-col-head[draggable="true"]:active { cursor: grabbing; }
.pb-finish .kb-drop { transition: background .14s ease, border-color .14s ease, transform .14s ease; }
.pb-finish .kb-drop.is-over { transform: scale(1.03); }
.af-node { transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease; }

/* The bubble is the width limit now; inside it, content uses the full width. */
@media (min-width: 1025px) {
  .main > :not(.drawer):not(.drawer-backdrop):not(.app-header) { max-width: none; }
  .main { padding: 26px 26px 56px; }
}
.pb .kb-board { grid-auto-columns: minmax(206px, 1fr); gap: 12px; }

/* == Light everywhere (operator, 2026-11-11: "make all the sidebars and the
   drawers light as well ... remove any of the box shadows ... on buttons").
   The light tokens move up to :root, so the sidebar, every drawer, toasts and
   menus follow; the surfaces that hardcoded dark glass are re-set below.
   Last word in the file - keep it at the end. */
:root {
  --bg:        #f4f3f0;
  --surface:   #fefefd;
  --surface-2: #ecebe7;
  --border:    rgba(74,52,30,.14);
  --border-2:  rgba(74,52,30,.09);
  --text:      #27221d;
  --text-2:    #5f564d;
  --text-3:    #8b8177;
  --accent-soft: rgba(255,91,31,.11);
  --success-fg: #0e7a4f;
  --danger-fg:  #c2364a;
  --warning-fg: #93630a;
  --glass-sheen: linear-gradient(transparent, transparent);
  --tex-frost:   linear-gradient(transparent, transparent);
  --glass-tint:  #fefefd;
  --glass-bg:    #fefefd;
  --glass-blur:  none;
  --shadow-1: 0 1px 2px rgba(74,52,30,.06), 0 3px 12px rgba(74,52,30,.05);
  --card-line: rgba(74,52,30,.12);
}

/* The module frame: warm light stone around the two panels. */
@media (min-width: 1025px) {
  .app-frame {
    background: #e6e4e0;
    backdrop-filter: none; -webkit-backdrop-filter: none;
    border-color: rgba(74,52,30,.18);
    box-shadow: 0 30px 80px rgba(0,0,0,.35);
  }
  .main { box-shadow: 0 0 0 1px rgba(74,52,30,.10), 0 6px 24px rgba(74,52,30,.10); }
}

/* Sidebar: stays DARK (operator, 2026-11-11: "I want the left sidebar dark").
   The app's tokens are light now, so the sidebar gets the original dark set
   back for itself and everything inside it (nav, user menu, Add button). */
.sidebar {
  --bg: #060607; --surface: #141416; --surface-2: #1c1c1f;
  --border: rgba(255,255,255,.09); --border-2: rgba(255,255,255,.06);
  --text: #f4efeb; --text-2: #a6a5a6; --text-3: #767578;
  --accent-soft: rgba(255,91,31,.15);
  --glass-bg: #141416;
  background: #121215; color: var(--text);
  border-color: rgba(255,255,255,.08);
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
}
.sidebar .topbar-user-menu { background: #1c1c1f; border-color: rgba(255,255,255,.1); box-shadow: 0 16px 40px rgba(0,0,0,.45); }
.sidebar .topbar-user-menu a:hover, .sidebar .topbar-user-menu button:hover { background: rgba(255,255,255,.07); }

/* Drawers: white sheets over a soft warm dim. */
.drawer, .drawer.drawer-side.cand-drawer {
  background: #fefefd; color: var(--text);
  border-color: rgba(74,52,30,.14);
  backdrop-filter: none; -webkit-backdrop-filter: none;
  box-shadow: 0 24px 70px rgba(40,28,14,.28);
}
.drawer-backdrop { background: rgba(40,30,20,.32); backdrop-filter: none; -webkit-backdrop-filter: none; }
.drawer-head { border-bottom-color: var(--border-2); }
.drawer .btn:not(.btn-primary):not(.btn-accent):not(.btn-success):not(.btn-danger):not(.btn-ghost) {
  background: #fff; border-color: rgba(74,52,30,.22); color: var(--text);
}
.drawer .btn:not(.btn-primary):not(.btn-accent):not(.btn-success):not(.btn-danger):not(.btn-ghost):hover { background: #f2f1ee; }
.pbs-row { background: #fff; border-color: var(--border); }
.toast { background: #fff; color: var(--text); border-color: var(--border); backdrop-filter: none; -webkit-backdrop-filter: none; }

/* No shadows on buttons, anywhere (operator). */
.btn, .btn-primary, .btn-accent, .btn-success, .btn-danger, .btn-ghost,
.main .btn, .drawer .btn, .sidebar .btn, .topbar-add, .pb-add,
.btn:hover, .btn-primary:hover, .btn-accent:hover, .main .btn:hover, .drawer .btn:hover { box-shadow: none !important; }
.main select.input, .main .input { box-shadow: none; }

/* My board: the controls sit in their own top strip with a divider under it. */
.pb .kb-head { padding: 0 0 14px; margin: 0 0 16px; border-bottom: 1px solid var(--border); }

/* -- Outreach, calmer (operator, 2026-11-11: "too cluttered on the left ...
   too many columns ... they want to see a person and the basic things and
   their score, and then they just want to click on that"). ----------------- */
.af2 { grid-template-columns: minmax(300px, 340px) minmax(0, 1fr); }
.af2-flow { padding: 14px; gap: 4px; }
.af2-stage { text-align: left; margin: 8px 2px 4px; }
.af2-flow > .af2-stage:first-child { margin-top: 0; }
.af-node {
  flex-direction: row; align-items: center; justify-content: space-between; gap: 10px;
  padding: 7px 10px; border-radius: 10px; border: 1px solid transparent;
  background: transparent; box-shadow: none;
}
.af-node:hover { background: #f2f1ee; border-color: transparent; box-shadow: none; transform: none; }
.af-node.is-on { background: var(--accent-soft); border-color: transparent; box-shadow: none; }
.af-node.is-on .af-l { color: #c4420e; font-weight: 650; }
.af-node .af-l { font-size: 13px; color: var(--text); }
.af-node .af-n { font-size: 12.5px; font-weight: 700; min-width: 30px; text-align: center; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); }
.af-node.is-empty .af-l { color: var(--text-3); }
.af-node.is-empty .af-n { background: transparent; color: var(--text-3); }
.af-voice:not(.is-empty) .af-n, .af-replied:not(.is-empty) .af-n { background: var(--accent); color: #fff; }
.is-yes .af-node { background: transparent; }
.is-yes .af-node:hover { background: #f2f1ee; }
.is-yes .af-node.is-on { background: var(--accent-soft); }
.af-noresp { border-style: solid; }
.af2-gap { height: 1px; background: var(--border-2); margin: 6px 2px; }
.af2-branches { grid-template-columns: 1fr; gap: 0; margin-top: 2px; }
.af2-branch { border-left: 2px solid var(--border-2); margin-left: 8px; padding-left: 8px; }
.af2-branch.is-yes { border-left-color: rgba(26,169,113,.35); }
.af2-out { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; padding: 8px 10px; border-radius: 10px; background: rgba(26,169,113,.08); color: var(--success-fg); font-size: 13px; }
.af2-out strong { font-variant-numeric: tabular-nums; }
.af2-foot { text-align: left; font-size: 11.5px; margin-top: 10px; }

.af2-panel { padding: 0; overflow: hidden; }
.af2-panel-head { padding: 16px 18px 12px; margin: 0; border-bottom: 1px solid var(--border-2); }
.af2-panel-head h3 { margin: 0 0 2px; }
.af2-panel .cc-empty { padding: 28px 18px; }
.af-rows { display: flex; flex-direction: column; }
.af-row { display: flex; align-items: center; gap: 6px; padding: 0 10px 0 6px; border-bottom: 1px solid var(--border-2); transition: background .12s ease; }
.af-row:last-child { border-bottom: 0; }
.af-row:hover { background: #f8f7f4; }
.af-row.is-picked { background: rgba(255,91,31,.06); }
.af-person { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 10px 8px; text-decoration: none; color: var(--text); }
.af-person-id { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.af-person-id strong { font-size: 14px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.af-person-id span { font-size: 12.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.af-person:hover strong { color: var(--accent); }
.af-score { flex: none; min-width: 34px; text-align: center; font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text); background: var(--surface-2); border-radius: 8px; padding: 3px 8px; }
.af-check { display: inline-flex; align-items: center; gap: 8px; padding: 0 6px; cursor: pointer; font-size: 13px; color: var(--text); }
.af-check input { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.af-bulk { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 12px; padding: 10px 16px 10px 12px; background: #fefefd; border-bottom: 1px solid var(--border-2); }
.af-sel { font-size: 12.5px; color: var(--text-3); }
.af-bulk .btn { margin-left: auto; }
.af-bulk .btn:disabled { opacity: .45; cursor: not-allowed; }
.af-menu { flex: none; }
.af-menu .kb-menu-list { max-height: 360px; overflow-y: auto; min-width: 210px; }
.af-menu .kb-menu-list form { margin: 0; }
.af-hand-list { display: flex; flex-direction: column; }
@media (max-width: 1180px) { .af2 { grid-template-columns: 1fr; } .af2-flow { max-width: none; } }

/* The frame must stay the containing block for the fixed sidebar/header: a
   backdrop-filter does that (any value but none). Without it the sidebar
   escapes to the screen edge. A zero blur keeps the anchor and adds no blur. */
@media (min-width: 1025px) {
  .app-frame { backdrop-filter: blur(0px); -webkit-backdrop-filter: blur(0px); }
}
.sidebar .brand-mark { color: var(--accent); }

/* Sidebar OUTSIDE the content panel (operator, 2026-11-11: "your sidebar should
   not be in the main container ... so we can see part of the background").
   The module frame becomes invisible: it only centres the two floating panels
   (and stays their containing block via the zero blur above). */
@media (min-width: 1025px) {
  .app-frame { background: none; border: 0; border-radius: 0; box-shadow: none; }
  .sidebar { box-shadow: 0 18px 50px rgba(0,0,0,.35); }
  .main { margin-left: calc(var(--sidebar-w) + 30px); box-shadow: 0 18px 50px rgba(0,0,0,.30); }
  .app-header { left: calc(var(--sidebar-w) + 30px); }
}

/* Home columns: a clean divider under each header; no hover wash on the header;
   the column moves only by its grip (operator, 2026-11-11). */
.pb-col-head { border-bottom: 1px solid var(--border); border-radius: 0; margin: 0 4px 6px; padding: 10px 8px 9px; }
.pb-col-head[draggable="true"], .pb-col-head[draggable="true"]:hover { background: none; cursor: default; }
.pb-col-hint { padding-top: 0; }
.pb-grip { cursor: grab; opacity: .55; padding: 2px; margin-left: -4px; border-radius: 4px; }
.pb-grip:hover { opacity: 1; background: rgba(74,52,30,.08); }
.pb-grip:active { cursor: grabbing; }

/* -- THE person row (fragments/person-row.php), one look everywhere ---------- */
.af-person { min-height: 56px; }
.row-status { flex: none; font-size: 11.5px; font-weight: 600; padding: 3px 10px; border-radius: 999px; white-space: nowrap; color: var(--text-2); background: var(--surface-2); }
.row-status.stage-pending_review { color: #6b5a44; background: #ecebe7; }
.row-status.stage-contacted { color: #2f5f9e; background: #e6eefa; }
.row-status.stage-registered { color: #0f6f73; background: #e0f3f2; }
.row-status.stage-attended_event { color: #2d6b16; background: #e7f4dc; }
.row-status.stage-hopper { color: #b4451a; background: #fde9df; }
.row-status.stage-new_member, .row-status.stage-converted { color: #fff; background: #1aa971; }
.row-status.stage-lost, .row-status.stage-not_a_fit, .row-status.stage-rejected { color: #b42332; background: #fbe6e9; }
.row-status.stage-no_response, .row-status.stage-no_contact, .row-status.stage-backlog { color: var(--text-3); background: var(--surface-2); }
/* Tribe page: the category label stays on the left, the shared row fills the rest. */
.rc-next .af-person { padding: 6px 4px; }
.rc-next .af-person:hover { background: none; }
/* All prospects: rows in one card. */
#peopleTable.af-rows { background: var(--surface); border: 1px solid var(--card-line); border-radius: 16px; overflow: hidden; }
#peopleTable .af-row { padding: 0 10px; }

/* Users: one column now the roles panel is gone. */
.users-layout { grid-template-columns: 1fr; }


/* == Pop-ups: a cream sheet with white cards on it (operator, 2026-11-11:
   "each of the cards ... should actually be white, they shouldn't just be
   transparent" and "the drawer ... is just so freaking huge"). ============= */
.drawer, .drawer.drawer-side.cand-drawer { background: #f4f3f0; }
.drawer-head { background: #fefefd; }
.drawer .card, .drawer .rail-card, .drawer .fit-card {
  background: #fff; border: 1px solid rgba(74,52,30,.12); border-radius: 16px;
  box-shadow: 0 1px 2px rgba(74,52,30,.05);
}
.drawer .card .card { box-shadow: none; }

/* The person drawer: narrower, calmer. */
.drawer.drawer-side.cand-drawer { width: min(920px, 94vw); max-width: 920px; }
.cand-drawer .drawer-body { padding: 22px 22px 30px; }
.cand-drawer .cand-layout { grid-template-columns: minmax(0, 1fr) 250px; gap: 16px; }
.cand-drawer .fit-card { padding: 14px 16px; }
.cand-drawer .fit-dial { width: 64px; height: 64px; }
.cand-drawer .fit-dial svg { width: 64px; height: 64px; }
.cand-drawer .fit-num { font-size: 18px; }
@media (max-width: 1100px) { .cand-drawer .cand-layout { grid-template-columns: 1fr; } }

/* Add person: the form in four small cards - Tribe, Person, Contact, Notes. */
.ap-group { background: #fff; border: 1px solid rgba(74,52,30,.12); border-radius: 14px; padding: 14px 16px 4px; margin-bottom: 12px; }
.ap-group-h { margin: 0 0 10px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.ap-group .form-row { margin-bottom: 12px !important; }
#addPersonDrawer .drawer-body { background: #f4f3f0; }
#addPersonDrawer .drawer-foot { background: #fefefd; border-top: 1px solid var(--border-2); }
#addPersonDrawer .ap-lookup { background: #f8f7f5; }

/* == Tighten everything (operator, 2026-11-11: "don't have things feel so
   bulbous ... proper padding around data tables ... clean the drawer top and
   the tribe header"). Last word in the file. ================================ */

/* Titles and headers: one size, close to their content. */
.main .page-title { font-size: 24px; letter-spacing: -.02em; margin: 0 0 4px; }
.main .page-sub { font-size: 13px; margin: 0 0 14px; }
.main .page-title + .sys-tabs, .main .page-title + .page-sub + .sys-tabs { margin-top: 10px; }
.card-head { padding: 13px 16px; gap: 10px; }
.card-head h3 { font-size: 14.5px; }
.card-body { padding: 16px; }
.tabs { padding: 3px; gap: 2px; }
.tab { padding: 6px 12px; font-size: 13px; }
.mb-4 { margin-bottom: 16px; }

/* Tables inside cards: breathing room at the edges, and a scroll instead of a
   clipped right-hand side when a table is wider than its card. */
.card .card-tight, .card > .tbl-wrap { overflow-x: auto; }
.card table, .card .tbl { width: 100%; border-collapse: collapse; }
.card table th, .card table td { padding: 10px 12px; }
.card table th:first-child, .card table td:first-child { padding-left: 18px; }
.card table th:last-child, .card table td:last-child { padding-right: 18px; }
.card table thead th { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); font-weight: 700; background: #f8f7f5; border-bottom: 1px solid var(--border-2); }
.card table tbody tr + tr td { border-top: 1px solid var(--border-2); }
.ucell-who { display: flex; flex-direction: column; min-width: 0; }
.ucell-who .small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 320px; }

/* Tribe header: smaller picture, compact numbers. */
.tribe-hero { gap: 0; border-radius: 16px; }
.tribe-hero-img { flex: 0 0 200px; max-width: 200px; }
.tribe-hero-body { padding: 16px 20px; }
.tribe-hero-sub { margin: 4px 0 10px; }
.tribe-hero-bar { height: 4px; }
.tribe-hero-stats { gap: 6px; margin-top: 10px; }
.tribe-hero-stats .ths { padding: 8px 12px; min-width: 0; flex: 0 1 auto; border-radius: 12px; box-shadow: none; }
.tribe-hero-stats .ths-v { font-size: 18px; }
.tribe-hero-stats .ths-l { font-size: 11px; }

/* The person drawer's top: small crumbs, a clear name, compact tabs. */
.cand-drawer .crumbs { font-size: 11.5px; margin-bottom: 6px; }
.cand-drawer .cand-topbar, .cand-drawer .cd-head { margin-bottom: 10px; }
.cand-drawer h1, .cand-drawer .cd-name, .cand-drawer .page-title { font-size: 20px; }
.cand-drawer #candTabs { margin-bottom: 14px; }

/* Column settings pop-up: one clean list. */
#boardColsDrawer { width: min(440px, 94vw); }
.pbs-fixed { font-size: 12px; color: var(--text-3); padding: 2px 4px 10px; }
.pbs-fixed:last-child { padding: 10px 4px 0; }
.pbs-list { list-style: none; margin: 0; padding: 0; background: #fff; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.pbs-row { display: flex; align-items: center; gap: 8px; margin: 0; padding: 6px 8px 6px 10px; border: 0; border-radius: 0; background: #fff; }
.pbs-row + .pbs-row { border-top: 1px solid var(--border-2); }
.pbs-row:hover { background: #f8f7f5; }
.pbs-name { flex: 1; min-width: 0; border: 1px solid transparent; background: transparent; border-radius: 8px; padding: 7px 8px; font: inherit; font-size: 14px; font-weight: 600; color: var(--text); }
.pbs-name:hover { border-color: var(--border-2); }
.pbs-name:focus { outline: none; border-color: var(--accent); background: #fff; box-shadow: 0 0 0 3px var(--accent-soft); }
.pbs-saved { font-size: 11px; color: var(--success-fg); opacity: 0; transition: opacity .2s ease; }
.pbs-row.is-saved .pbs-saved { opacity: 1; }
.pbs-del { display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 8px; background: transparent; color: var(--text-3); cursor: pointer; opacity: 0; transition: opacity .12s ease, background .12s ease, color .12s ease; }
.pbs-row:hover .pbs-del, .pbs-del:focus-visible { opacity: 1; }
.pbs-del:hover { background: #fbe6e9; color: #c2364a; }
.pbs-del svg { width: 16px; height: 16px; }
.pbs-add { display: flex; align-items: center; gap: 8px; margin: 10px 0 0; padding: 4px 10px; border: 1.5px dashed var(--border); border-radius: 12px; }
.pbs-add:focus-within { border-color: var(--accent); border-style: solid; background: #fff; }
.pbs-plus { color: var(--text-3); font-size: 18px; width: 16px; text-align: center; }
.pbs-add input { flex: 1; border: 0; background: transparent; padding: 8px 0; font: inherit; font-size: 14px; color: var(--text); outline: none; }
#boardColsDrawer .pbs-name { background: transparent !important; width: 100%; max-width: none; height: auto; box-shadow: none; }
#boardColsDrawer .pbs-name:focus { background: #fff !important; box-shadow: 0 0 0 3px var(--accent-soft); }
#boardColsDrawer .pbs-add input { background: transparent !important; box-shadow: none; height: auto; }

/* == Archivo, app-wide (operator, 2026-11-11). Self-hosted because the CSP only
   allows fonts from this server. One variable file covers weights 100-900. == */
@font-face {
  font-family: 'Archivo'; font-style: normal; font-weight: 100 900; font-display: optional;
  src: url('/public/fonts/archivo-latin-variable.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;
}
body, button, input, select, textarea, .btn, .input {
  font-family: 'Archivo', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* == Round 5 (operator, 2026-11-11) ========================================== */

/* The fit score as a ring around a person's avatar - every list and card. */
.av-ring { --c: #c9c4bb; flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  background: conic-gradient(var(--c) calc(var(--pct) * 1%), rgba(60,50,40,.10) 0); }
.av-ring .pbc-av { width: 34px; height: 34px; box-shadow: 0 0 0 2px #fff; }
.av-ring.is-strong { --c: #1aa971; }
.av-ring.is-good   { --c: #e3a21a; }
.av-ring.is-weak   { --c: #e5703c; }
.av-ring.is-none   { background: none; }

/* Board card: who, then a divider, then tribe + where they came from. */
.pbc { gap: 0; padding: 12px 12px 10px; }
.pbc-top { padding-bottom: 10px; }
.pbc-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding-top: 9px; border-top: 1px solid var(--border-2); }
.pbc-path { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; color: var(--text-2); background: var(--surface-2); }
.pbc-path.is-email { color: #2f5f9e; background: #e6eefa; }
.pbc-path.is-manual { color: #6b5a44; background: #f0ece4; }
.pbc-path.is-found { color: #2d6b16; background: #e7f4dc; }
.pbc-quote, .pbc .kb-reply { margin-top: 9px; }

/* Person page: breathing room around the fit score; company + people as the
   second half of the same card. */
.fit-card { padding: 20px 22px; }
.fit-scores { padding: 2px 0 14px; }
.fit-co { margin: 18px -22px -20px; border-top: 1px solid var(--border-2); }
.fit-co .cand-split > .cand-pane { padding: 16px 22px; }

/* All prospects: rows sit inside the card with padding on every side. */
#peopleTable.af-rows { padding: 6px 8px; }
.card #peopleTable.af-rows { border: 0; border-radius: 0; background: transparent; }
#peopleTable .af-row { border-radius: 10px; }

/* Tabs: plain text with an underline for the active one - no pill bar. */
.tabs, .main .tabs, .drawer .tabs {
  display: flex; flex-wrap: wrap; gap: 4px; padding: 0; background: none !important; border: 0; border-radius: 0;
  box-shadow: none !important; border-bottom: 1px solid var(--border) !important; width: 100%;
}
.tabs .tab, .main .tabs .tab, .drawer .tabs .tab {
  border-radius: 0; background: none !important; border: 0; padding: 9px 12px 10px; margin-bottom: -1px;
  color: var(--text-2); font-weight: 600; border-bottom: 2px solid transparent !important; box-shadow: none !important;
}
.tabs .tab:hover { color: var(--text); background: none !important; }
.tabs .tab.tab-active, .main .tabs .tab-active, .drawer .tabs .tab-active { color: var(--text); border-bottom-color: var(--accent) !important; }
.tabs .tab svg { opacity: .7; }

/* Tribes list: title left, search + New tribe right; each tribe its own card. */
.trs-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.trs-head .page-title { margin: 0; }
.trs-acts { display: flex; align-items: center; gap: 8px; }
.trs-acts .search-wrap { position: relative; display: inline-flex; align-items: center; }
.trs-acts .search-wrap svg { position: absolute; left: 10px; width: 15px; height: 15px; color: var(--text-3); pointer-events: none; }
.trs-acts .lf-search { padding-left: 32px; width: 240px; }
.tribe-grid { gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.tribe-tile { background: #fff; border: 1px solid var(--card-line); border-radius: 16px; padding: 0 0 14px; overflow: hidden;
  box-shadow: 0 1px 2px rgba(60,50,40,.05); backdrop-filter: none; -webkit-backdrop-filter: none; transition: transform .14s ease, box-shadow .14s ease; }
.tribe-tile:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(60,50,40,.12); }
.tribe-tile .tt-img { display: block; width: 100%; height: 120px; margin: 0 0 12px; border-radius: 0; background-size: cover; background-position: center; }
.tribe-tile h4, .tribe-tile .bar, .tribe-tile .stats { margin-left: 16px; margin-right: 16px; }

/* Tribe page: the picture fills its whole side of the header. */
.tribe-hero { align-items: stretch; }
.tribe-hero-img { flex: 0 0 240px; max-width: 240px; align-self: stretch; border-radius: 0; min-height: 170px; }
.tribe-hero-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 760px) { .tribe-hero-img { min-height: 160px; } }

/* Back: a real button. */
.page-back { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px 0 10px; border-radius: 10px;
  border: 1px solid rgba(60,50,40,.22); background: #fff; color: var(--text); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; box-shadow: none; }
.page-back:hover { background: #f8f7f5; border-color: rgba(60,50,40,.4); }

/* == Round 6 (operator, 2026-11-11) ========================================== */

/* Sidebar: the active item is cream with dark text, softly rounded; a little
   more room between items. */
.sidebar .nav a { border-radius: 10px; padding: 8px 10px; margin-bottom: 3px; }
.sidebar .nav a.active, .sidebar .nav a.active:hover { background: #f1efea; color: #1f1b17; font-weight: 600; }
.sidebar .nav a.active .ico { color: #1f1b17; }
.sidebar .nav a.active .badge-n { background: var(--accent); color: #fff; }
.sidebar .nav-section { margin-bottom: 10px; }

/* Footer: your avatar (account menu) on the left, the bell on the right. */
.sidebar .sb-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sidebar .topbar-user-btn.sb-me { background: none; border: 0; padding: 2px; display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; border-radius: 999px; }
.sidebar .topbar-user-btn.sb-me:hover { background: rgba(255,255,255,.06); }
.sidebar .sb-me .topbar-avatar { width: 34px; height: 34px; border-radius: 50%; flex: none; }
.sidebar .sb-me .topbar-user-name { font-size: 13px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-bell { position: relative; flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.05); color: var(--text); cursor: pointer; }
.sb-bell:hover { background: rgba(255,255,255,.1); }
.sb-bell .ico { width: 19px; height: 19px; }
.sb-bell-n { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; border: 2px solid #121215; }

/* Every dropdown gets a clear chevron on the right. */
select.input, .main select.input, .drawer select.input {
  -webkit-appearance: none; -moz-appearance: none; appearance: none;
  padding-right: 32px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b6258' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important; background-position: right 11px center !important; background-size: 12px 12px !important;
  cursor: pointer;
}
.sidebar select.input { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a6a5a6' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important; }

/* Outreach: the bulk bar appears only once someone is picked. */
.af-bulk.is-hidden { display: none; }

/* Settings: setup instructions tucked behind a toggle. */
.set-how { border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; background: #f8f7f5; }
.set-how > summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text); }
.set-how[open] > summary { margin-bottom: 4px; }
/* Settings forms use bare inputs; give them the same look as every other field. */
.main .form-row input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=hidden]), .main .form-row textarea, .main .form-row select:not(.input) { width: 100%; background: #fff !important; border: 1px solid var(--border); border-radius: 10px; padding: 8px 11px; color: var(--text); font: inherit; font-size: 13.5px; box-shadow: none; }
.main .form-row input:focus, .main .form-row textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.main .form-row > label:first-child { display: block; font-size: 12.5px; font-weight: 600; color: var(--text); margin-bottom: 5px; }
.main .form-row { margin-bottom: 14px; }
/* Users: the list must fit the panel (a grid item grows to its widest table otherwise). */
.users-layout > *, .users-main { min-width: 0; }
.users-main .card { max-width: 100%; }
.users-main table { table-layout: auto; }
.users-main .ucell-access { max-width: 300px; }
.users-main td:last-child { white-space: nowrap; width: 1%; }
.users-main .ucell-access, .users-main .ucell-access > div { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.users-main .ucell-who .small { max-width: 230px; }
.users-main th, .users-main td { padding-left: 10px; padding-right: 10px; }
.users-main .ucell-access { max-width: 220px; }
.users-main .ucell-who .small { max-width: 200px; }
.users-main select.input { width: 122px !important; }
.users-main .acc-inline { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.users-main td:last-child, .users-main td.actions { width: auto; white-space: nowrap; }
.users-main td.actions > * { display: inline-flex; vertical-align: middle; }
.users-main .ucell-who .small { max-width: 170px; }
.users-main th:nth-child(4), .users-main td:nth-child(4) { white-space: nowrap; }
.users-main td.actions { display: table-cell !important; text-align: right; vertical-align: middle; }
.users-main td.actions > * { margin-left: 2px; }
.users-main th, .users-main td { padding-left: 8px; padding-right: 8px; }
.users-main th:first-child, .users-main td:first-child { padding-left: 16px; }
.users-main td.actions { padding-right: 14px; }
.users-main .ucell-access { max-width: 200px; }

/* == Round 7 (operator, 2026-11-11) ========================================== */

/* Sidebar: dark glass you can see the background through, blurred. */
.sidebar {
  background: rgba(18,18,22,.62) !important;
  backdrop-filter: blur(22px) saturate(140%) !important; -webkit-backdrop-filter: blur(22px) saturate(140%) !important;
  border: 1px solid rgba(255,255,255,.10) !important;
}
/* Active item: the orange; items a touch closer together. */
.sidebar .nav a { padding: 7px 10px; margin-bottom: 1px; }
.sidebar .nav-section { margin-bottom: 6px; }
.sidebar .nav a.active, .sidebar .nav a.active:hover { background: var(--accent); color: #fff; font-weight: 600; }
.sidebar .nav a.active .ico { color: #fff; }
.sidebar .nav a.active .badge-n { background: #fff; color: var(--accent); }

/* Board columns fill the space below them. */
.pb .kb-board .pb-col { min-height: calc(100vh - 330px); }
.pb .kb-board .pb-col .kb-col-body { flex: 1; }
.pb-col.kb-col-done.is-over .kb-col-body::before { content: "Drop to finish - Member or Lost"; }

/* "Member or Lost?" chooser. */
.pb-choose { position: fixed; inset: 0; z-index: 900; display: grid; place-items: center; background: rgba(30,24,18,.35); animation: menu-in .12s ease-out; }
.pb-choose-box { width: min(380px, 92vw); background: #fff; border-radius: 18px; padding: 20px 22px 18px; box-shadow: 0 24px 70px rgba(30,24,18,.3); }
.pb-choose-box h4 { margin: 0 0 4px; font-size: 17px; }
.pb-choose-box p { margin: 0 0 16px; color: var(--text-2); font-size: 13.5px; }
.pb-choose-acts { display: flex; gap: 8px; }
.pb-choose-acts .btn-ghost { margin-left: auto; }

/* == Person page (operator, 2026-11-11) ====================================== */
/* Status bar at the top: is this person verified, and what do we have. */
.cand-status { display: flex; align-items: center; gap: 9px; margin: 0 0 14px; padding: 9px 14px; border-radius: 12px; font-size: 13px; font-weight: 600; }
.cand-status-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.cand-status.is-ok   { color: #0e7a4f; background: rgba(26,169,113,.10); }
.cand-status.is-warn { color: #8a5a00; background: rgba(227,162,26,.13); }
.cand-status.is-bad  { color: #b42332; background: rgba(242,85,106,.10); }

/* Round profile icon. */
.cand-hero-avatar { border-radius: 50% !important; overflow: hidden; }

/* The fit score: bigger, with room around it. */
.fit-scores { padding: 6px 0 18px; gap: 20px; }
.fit-dial, .cand-drawer .fit-dial { width: 92px; height: 92px; flex: none; margin: 4px; }
.fit-dial svg, .cand-drawer .fit-dial svg { width: 92px; height: 92px; overflow: visible; }
.fit-num, .cand-drawer .fit-num { font-size: 24px; }
.fit-rat { margin-top: 4px; }

/* Company - other people there, as a plain list. */
.co-people { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.co-person { display: flex; flex-direction: column; gap: 3px; padding: 10px 0; border-top: 1px solid var(--border-2); }
.co-person:first-child { border-top: 0; padding-top: 2px; }
.co-person-who { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.co-person-who strong { font-size: 13.5px; }
.co-person-who span { font-size: 12.5px; color: var(--text-2); }
.co-ver { color: #0e7a4f; font-weight: 700; }
.co-person-how { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12.5px; color: var(--text-2); }
.co-person-how a { color: inherit; }

/* Recommended: a quiet suggestion, not an order. */
.rail-rec-why { margin: 2px 0 10px; font-size: 13px; color: var(--text-2); }

/* Score rings: perfectly round, never clipped. */
.av-ring { box-sizing: border-box; aspect-ratio: 1 / 1; min-width: 40px; }
.av-ring .pbc-av { margin: 0 !important; flex: none; }
.af-person, .pbc-top { overflow: visible; }

/* == Round 8 (operator, 2026-11-11) ========================================== */

/* Person header: the score as a ring round the icon and a badge by the name. */
.av-ring.av-ring-lg { width: 52px; height: 52px; min-width: 52px; }
.av-ring.av-ring-lg .cand-hero-avatar { width: 44px; height: 44px; margin: 0; display: grid; place-items: center; background: #fff; box-shadow: 0 0 0 2px #fff; }
.fit-badge { display: inline-flex; align-items: center; margin-left: 8px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; vertical-align: middle; letter-spacing: 0; }
.fit-badge.is-strong { color: #0e7a4f; background: rgba(26,169,113,.13); }
.fit-badge.is-good   { color: #8a5a00; background: rgba(227,162,26,.15); }
.fit-badge.is-weak   { color: #b4451a; background: rgba(229,112,60,.13); }
.fit-card .fit-who { margin-top: 0; padding-top: 0; border-top: 0; }
.fit-card .fit-rat { margin: 14px 0 0; padding-top: 14px; border-top: 1px solid var(--border-2); }

/* Home board fills the rest of the screen; columns scroll inside, the page doesn't. */
@media (min-width: 1025px) {
  .pb .kb-board { height: calc(100vh - 412px); min-height: 340px; align-items: stretch; }
  .pb .kb-board .pb-col { min-height: 0; height: 100%; }
  .pb .kb-board .pb-col .kb-col-body { max-height: none; min-height: 0; overflow-y: auto; }
}

/* == Animations: things arrive, softly ======================================= */
@keyframes rise-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop-in  { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }

/* Page sections rise in one after another. */
.main > :not(.drawer):not(.drawer-backdrop):not(.app-header):not(script) { animation: rise-in .45s cubic-bezier(.2,.7,.2,1) backwards; }
.main > :nth-child(2) { animation-delay: .04s; } .main > :nth-child(3) { animation-delay: .08s; }
.main > :nth-child(4) { animation-delay: .12s; } .main > :nth-child(5) { animation-delay: .16s; }
.main > :nth-child(6) { animation-delay: .20s; } .main > :nth-child(n+7) { animation-delay: .24s; }

/* Board columns and their cards. */
.pb-col { animation: rise-in .45s cubic-bezier(.2,.7,.2,1) backwards; }
.pb-col:nth-child(2) { animation-delay: .06s; } .pb-col:nth-child(3) { animation-delay: .12s; }
.pb-col:nth-child(4) { animation-delay: .18s; } .pb-col:nth-child(5) { animation-delay: .24s; } .pb-col:nth-child(n+6) { animation-delay: .3s; }
.pbc { animation: pop-in .35s ease-out backwards; animation-delay: .2s; }

/* Lists: rows, tribe cards, flow steps. */
.af-row, .co-person { animation: fade-in .35s ease-out backwards; }
.af-row:nth-child(1) { animation-delay: .05s; } .af-row:nth-child(2) { animation-delay: .08s; } .af-row:nth-child(3) { animation-delay: .11s; }
.af-row:nth-child(4) { animation-delay: .14s; } .af-row:nth-child(5) { animation-delay: .17s; } .af-row:nth-child(n+6) { animation-delay: .2s; }
.tribe-tile { animation: rise-in .45s cubic-bezier(.2,.7,.2,1) backwards; }
.tribe-tile:nth-child(2) { animation-delay: .04s; } .tribe-tile:nth-child(3) { animation-delay: .08s; }
.tribe-tile:nth-child(4) { animation-delay: .12s; } .tribe-tile:nth-child(5) { animation-delay: .16s; } .tribe-tile:nth-child(n+6) { animation-delay: .2s; }
.af-node { animation: fade-in .4s ease-out backwards; }
.card, .ths { animation: rise-in .45s cubic-bezier(.2,.7,.2,1) backwards; }

/* The score rings draw themselves. */
@property --pct-a { syntax: '<number>'; inherits: false; initial-value: 0; }
.av-ring:not(.is-none) { background: conic-gradient(var(--c) calc(var(--pct-a) * 1%), rgba(60,50,40,.10) 0); animation: ring-fill .9s cubic-bezier(.2,.7,.2,1) .25s both; }
@keyframes ring-fill { from { --pct-a: 0; } to { --pct-a: var(--pct); } }

/* Hover and press feel. */
.btn, .tab, .af-node, .tribe-tile, .pbc, .af-row { transition-timing-function: cubic-bezier(.2,.7,.2,1); }
.drawer.open .drawer-body > * { animation: rise-in .4s cubic-bezier(.2,.7,.2,1) backwards; }
.drawer.open .drawer-body > :nth-child(2) { animation-delay: .05s; } .drawer.open .drawer-body > :nth-child(3) { animation-delay: .1s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* == Round 9 (2026-11-11): board polish, quieter focus, tribe page cleanup ===== */

/* Focus: no orange halo on text boxes anywhere. A soft neutral ring says
   "you are in here" without shouting. */
:is(.main, .drawer, dialog) :is(.input, input:not([type=checkbox]):not([type=radio]):not([type=range]), select, textarea):focus {
  outline: none; border-color: #cfccc5 !important; box-shadow: 0 0 0 3px rgba(40,34,28,.06) !important;
}
#boardColsDrawer .pbs-name:focus { background: #fff !important; border-color: #d9d6cf !important; box-shadow: none !important; }
#boardColsDrawer .pbs-add:focus-within { border-color: #d9d6cf; }

/* Drawer heads follow the drawer's rounded corners. */
.drawer:not(.drawer-side) > .drawer-head, .drawer:not(.drawer-side) > form > .drawer-head { border-radius: 18px 18px 0 0; }
.drawer.drawer-side > .drawer-head, .drawer.drawer-side > form > .drawer-head { border-radius: 18px 0 0 0; }

/* Columns pop-up: delete is always a red tile; add has a real confirm. */
.pbs-del { opacity: 1 !important; background: #fbe6e9; color: #c2364a; }
.pbs-del:hover { background: #f6d3d8; color: #a92a3d; }
.pbs-row.is-picked { background: #faf8f4; }
.pbs-ok { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border: 0; border-radius: 8px; background: var(--accent); color: #fff; cursor: pointer; }
.pbs-ok:hover { filter: brightness(.95); }
.pbs-ok svg { width: 16px; height: 16px; }

/* Column titles open that column's settings. */
.pb-col-title.is-edit { border: 0; background: none; padding: 2px 6px; margin: -2px -6px; border-radius: 7px; font: inherit; font-weight: 700; font-size: 13.5px; color: var(--text); cursor: pointer; text-align: left; }
.pb-col-title.is-edit:hover { background: rgba(74,52,30,.06); }
.pb-col-head .pb-col-n { margin-left: auto; }

/* Add a person at the foot of any column, shown on hover. */
.pb-col-add { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 6px 6px 4px; padding: 8px; border: 1.5px dashed transparent; border-radius: 10px; background: none; color: var(--text-3); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; opacity: 0; transition: opacity .2s ease, border-color .2s ease, color .2s ease; }
.pb-col:hover .pb-col-add, .pb-col-add:focus-visible { opacity: 1; border-color: var(--border); }
.pb-col-add:hover { color: var(--text); border-color: #cfccc5; background: rgba(255,255,255,.6); }
@media (hover: none) { .pb-col-add { opacity: 1; border-color: var(--border); } }

/* The board's sideways scrollbar is always there. */
.pb .kb-board { overflow-x: scroll; scrollbar-width: auto; scrollbar-color: #cbc7bf transparent; padding-bottom: 10px; }
.pb .kb-board::-webkit-scrollbar { height: 10px; -webkit-appearance: none; }
.pb .kb-board::-webkit-scrollbar-thumb { background: #cbc7bf; border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
.pb .kb-board::-webkit-scrollbar-track { background: rgba(60,50,40,.05); border-radius: 999px; }

/* Person page: dive straight into the contact lines, a little more room. */
.fit-card { padding: 24px 26px; border-radius: 20px; }
.fit-card .fit-who-lines { border-top: 0; margin-top: 0; padding-top: 0; gap: 4px 26px; }
.fit-card .fit-rat { margin-top: 16px; padding-top: 16px; }

/* Tab icons. */
.tabs .tab { display: inline-flex; align-items: center; gap: 7px; }
.tab-ico { width: 15px; height: 15px; flex: none; opacity: .75; }
.tab-active .tab-ico { opacity: 1; }

/* Tribe header automation toggle. */
.tr-auto { margin-left: auto; display: inline-flex; align-items: center; gap: 10px; margin-bottom: 0; }
.tr-auto-l { font-size: 13px; color: var(--text-2); white-space: nowrap; }
.tr-auto-l strong { color: var(--text); }

/* Users: the manage pop-up. */
.um-drawer { width: min(440px, 94vw); }
.um-list { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.um-list > form { margin: 0; }
.um-list > * + * { border-top: 1px solid var(--border-2); }
.um-item { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; padding: 13px 16px; border: 0; border-radius: 0; background: #fff; text-align: left; font: inherit; cursor: pointer; }
.um-item strong { font-size: 14px; font-weight: 650; color: var(--text); }
.um-item span { font-size: 12.5px; color: var(--text-3); }
.um-item:hover { background: #faf9f6; }
.um-item.is-danger strong { color: #c2364a; }
.um-item.is-danger:hover { background: #fdf1f2; }
.um-item.is-off { cursor: default; opacity: .55; }
.um-item.is-off:hover { background: #fff; }
td.actions .icon-btn { width: 32px; height: 32px; display: inline-grid; place-items: center; border-radius: 9px; }
td.actions .icon-btn svg { width: 18px; height: 18px; }

/* Tribes: square images. */
.tribe-tile .tt-img { height: auto; aspect-ratio: 1 / 1; }

/* Tribe page: categories as one simple list - role, then its one person. */
.cat-simple { padding: 0; overflow: hidden; }
.cat-simple-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--border-2); }
.cat-simple-head h3 { margin: 0 auto 0 0; font-size: 15px; }
.cat-list { list-style: none; margin: 0; padding: 4px 0; }
.cat-row { display: grid; grid-template-columns: minmax(150px, 260px) minmax(0, 1fr); align-items: center; gap: 16px; padding: 4px 18px; }
.cat-row + .cat-row { border-top: 1px solid var(--border-2); }
.cat-name { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; border: 0; background: none; padding: 8px 0; font: inherit; text-align: left; cursor: pointer; color: var(--text); }
.cat-name span { font-size: 14px; font-weight: 650; }
.cat-name small { font-size: 11.5px; color: var(--text-3); }
.cat-name:hover span { text-decoration: underline; text-underline-offset: 3px; }
.cat-person { min-width: 0; }
.cat-person .af-person { padding: 6px 0; }
.cat-person .af-person:hover { background: none; }
.cat-empty { font-size: 13px; color: var(--text-3); }
.cat-list .cc-empty { padding: 20px 18px; }
@media (max-width: 640px) { .cat-row { grid-template-columns: 1fr; gap: 0; } }

/* Tribe page: All people - two clean lists. */
.tr-simple .tr-card { padding: 0; overflow: hidden; }
.tr-card-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--border-2); }
.tr-card-head h3 { margin: 0 auto 0 0; font-size: 15px; }
.tr-rows { padding: 4px 10px; max-height: 70vh; overflow-y: auto; }
.tr-rows .af-row + .af-row { border-top: 1px solid var(--border-2); }
.tr-rows .af-row.is-out { opacity: .55; }
.af-person.is-static { cursor: default; }
.af-person.is-static:hover strong { color: var(--text); }

/* Animations: slower, so you can actually see them arrive. */
@keyframes rise-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.main > :not(.drawer):not(.drawer-backdrop):not(.app-header):not(script) { animation-duration: .8s; }
.main > :nth-child(2) { animation-delay: .1s; } .main > :nth-child(3) { animation-delay: .2s; }
.main > :nth-child(4) { animation-delay: .3s; } .main > :nth-child(5) { animation-delay: .4s; }
.main > :nth-child(6) { animation-delay: .5s; } .main > :nth-child(n+7) { animation-delay: .6s; }
.card, .ths, .tribe-tile, .pb-col { animation-duration: .8s; }
.pb-col:nth-child(2) { animation-delay: .12s; } .pb-col:nth-child(3) { animation-delay: .24s; }
.pb-col:nth-child(4) { animation-delay: .36s; } .pb-col:nth-child(5) { animation-delay: .48s; } .pb-col:nth-child(n+6) { animation-delay: .6s; }
.pbc { animation-duration: .6s; animation-delay: .45s; }
.af-row, .co-person { animation-duration: .6s; }
.af-row:nth-child(1) { animation-delay: .1s; } .af-row:nth-child(2) { animation-delay: .17s; } .af-row:nth-child(3) { animation-delay: .24s; }
.af-row:nth-child(4) { animation-delay: .31s; } .af-row:nth-child(5) { animation-delay: .38s; } .af-row:nth-child(n+6) { animation-delay: .45s; }
.tribe-tile:nth-child(2) { animation-delay: .08s; } .tribe-tile:nth-child(3) { animation-delay: .16s; }
.tribe-tile:nth-child(4) { animation-delay: .24s; } .tribe-tile:nth-child(5) { animation-delay: .32s; } .tribe-tile:nth-child(n+6) { animation-delay: .4s; }
.cat-row { animation: fade-in .6s ease-out backwards; }
.cat-row:nth-child(2) { animation-delay: .08s; } .cat-row:nth-child(3) { animation-delay: .16s; } .cat-row:nth-child(4) { animation-delay: .24s; } .cat-row:nth-child(n+5) { animation-delay: .32s; }
.av-ring:not(.is-none) { animation-duration: 1.6s; animation-delay: .5s; }
.drawer.open .drawer-body > * { animation-duration: .6s; }
.drawer.open .drawer-body > :nth-child(2) { animation-delay: .1s; } .drawer.open .drawer-body > :nth-child(3) { animation-delay: .2s; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Active sidebar item: orange text on a soft light tint, not a solid orange block (2026-11-11). */
.sidebar .nav a.active, .sidebar .nav a.active:hover { background: rgba(255,255,255,.09); color: var(--accent); font-weight: 600; box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }
.sidebar .nav a.active .ico { color: var(--accent); }
.sidebar .nav a.active .badge-n { background: var(--accent); color: #fff; }


/* == Notifications pop-up above the bell (2026-11-11) ========================= */
.notif-pop { position: fixed; z-index: 400; width: 340px; max-width: calc(100vw - 16px); background: #fff; color: #27221d; border: 1px solid rgba(60,50,40,.12); border-radius: 16px; box-shadow: 0 18px 50px rgba(20,16,12,.22); overflow: hidden; animation: pop-in .25s cubic-bezier(.2,.7,.2,1); }
.notif-pop[hidden] { display: none; }
.np-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px 10px; border-bottom: 1px solid rgba(60,50,40,.08); }
.np-head strong { font-size: 14px; }
.np-set { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; color: #8b8177; }
.np-set:hover { background: #f4f3f0; color: #27221d; }
.np-set .ico { width: 16px; height: 16px; }
.np-list { max-height: 380px; overflow-y: auto; padding: 4px; }
.np-item { display: flex; gap: 10px; padding: 10px; border-radius: 10px; text-decoration: none; color: inherit; }
.np-item[href]:hover { background: #f6f5f2; }
.np-item.is-unread { background: #fbf6f1; }
.np-ic { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #f1efea; font-size: 13px; }
.np-body { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.np-title { font-size: 13px; font-weight: 600; line-height: 1.35; }
.np-sub { font-size: 12px; color: #6b625a; line-height: 1.35; }
.np-ts { font-size: 11px; color: #8b8177; margin-top: 2px; }
.np-empty { padding: 26px 14px; text-align: center; font-size: 13px; color: #8b8177; }
.np-all { display: block; text-align: center; padding: 11px; font-size: 13px; font-weight: 600; color: var(--accent); text-decoration: none; border-top: 1px solid rgba(60,50,40,.08); }
.np-all:hover { background: #faf9f6; }

/* Sidebar foot: one tight row, no boxed-in panel with empty padding. */
.sidebar { padding-bottom: 12px; }
.sidebar .sidebar-footer { padding: 10px 4px 0; border: 0; border-top: 1px solid rgba(255,255,255,.08); border-radius: 0; background: none; box-shadow: none; }
.sidebar .sb-actions { padding: 0; }

/* Active sidebar item: a soft, slightly see-through cream with orange text (2026-11-11). */
.sidebar .nav a.active, .sidebar .nav a.active:hover { background: rgba(253,249,241,.9); color: var(--accent); box-shadow: none; }

/* == Round 10 (2026-11-11) ================================================== */
/* Completed column: finished cards are greyed, with a check (member) or x (lost) on the avatar. */
.pbc-top { position: relative; }
.pbc-done-mark { position: absolute; left: 22px; top: 22px; z-index: 2; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; border: 2px solid #fff; }
.pbc-done-mark svg { width: 10px; height: 10px; }
.pbc-done-mark.is-member { background: #2f9e57; color: #fff; }
.pbc-done-mark.is-lost { background: #9a948c; color: #fff; }
.pbc.is-done { background: #f3f2ef; box-shadow: none; border-color: transparent; }
.pbc.is-done .pbc-name { color: var(--text-2); }
.pbc.is-done .pbc-sub { color: var(--text-3); }
.pbc.is-done .av-ring, .pbc.is-done .pbc-chip { filter: grayscale(1); opacity: .6; }
.pbc-done-word { font-size: 11px; font-weight: 600; color: var(--text-3); }

/* Home: the board runs to the bottom of the page - no dead band under the columns. */
@media (min-width: 1000px) {
  .main:has(> .pb), .main:has(.pb) { padding-bottom: 18px; }
  .pb .kb-board { height: calc(100vh - 356px); }
}

/* Person slide-out: narrower now there is less on it. */
.drawer.drawer-side.cand-drawer { width: min(760px, 94vw); max-width: 760px; }

/* Active sidebar item: softer still. */
.sidebar .nav a.active, .sidebar .nav a.active:hover { background: rgba(253,249,241,.14); color: #ffb48f; }
.sidebar .nav a.active .ico { color: #ffb48f; }

/* Welcome banner: a black gradient from the left, 40% fading out by 30%. */
:is(.main, .drawer) .welcome-banner::before { content: ""; display: block; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 0; background: linear-gradient(90deg, rgba(0,0,0,.4) 0%, rgba(0,0,0,0) 30%); }
.welcome-banner .welcome-inner { position: relative; z-index: 1; }
.welcome-banner .welcome-bg-btn { z-index: 2; }
@media (min-width: 1000px) { .pb .kb-board { height: calc(100vh - 372px); } }

/* == Motion, final rule (2026-11-11): only BLOCKS animate in - page sections,
   cards and board columns. Individual items (rows, cards in a column, tiles,
   stats) and anything inside a pop-up or drawer appear instantly. ========== */
.drawer .drawer-body > *, .drawer.open .drawer-body > *, .notif-pop, .notif-pop *, dialog *, .kb-menu-list,
.af-row, .co-person, .cat-row, .pbc, .tribe-tile, .ths, .af-node, .np-item { animation: none !important; }
.drawer .card, .drawer .rail-card, .drawer .fit-card, dialog .card { animation: none !important; }

/* Active sidebar item: white text on a fainter cream tint (2026-11-11). */
.sidebar .nav a.active, .sidebar .nav a.active:hover { background: rgba(253,249,241,.10); color: #fff; }
.sidebar .nav a.active .ico { color: #fff; }

/* Conversion charts: steel blues, never the orange of buttons and stats (2026-11-11). */
body .main .cv-page { --cv-s1: #3f6c9e; --cv-s2: #9db4cc; --cv-s3: #5f7a95; }

/* Board columns never shrink below a readable width; the board scrolls sideways instead. */
.pb .kb-board { grid-auto-columns: minmax(272px, 1fr); }
.pb .kb-board .pb-col { min-width: 272px; }

/* Home board scrollbar: slimmer (2026-11-11). */
.pb .kb-board { scrollbar-width: thin; padding-bottom: 6px; }
.pb .kb-board::-webkit-scrollbar { height: 6px; }
.pb .kb-board::-webkit-scrollbar-thumb { border: 0; background: #d3cfc7; }
.pb .kb-board::-webkit-scrollbar-thumb:hover { background: #bdb8ae; }

/* == One data-table look, everywhere (2026-11-11) ============================
   Every .tbl (users, runs, usage, reports, conversion, devices...) and the
   email log list share the same header, row height, dividers and hover. */
.vsep { display: inline-block; width: 1px; height: 12px; margin: 0 8px; vertical-align: -1px; background: rgba(60,50,40,.2); }
.main .tbl { width: 100%; border-collapse: separate; border-spacing: 0; background: #fff; border: 1px solid var(--card-line, rgba(60,50,40,.1)); border-radius: 14px; overflow: hidden; font-size: 13px; }
.main .card .tbl, .main .tbl-wrap .tbl { border: 0; border-radius: 0; }
.main .tbl thead th, .main .tbl th { background: #faf9f6; color: var(--text-3); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; text-align: left; padding: 10px 16px; border-bottom: 1px solid var(--border-2); white-space: nowrap; }
.main .tbl td { padding: 12px 16px; border-bottom: 1px solid var(--border-2); color: var(--text); vertical-align: middle; background: transparent; }
.main .tbl tbody tr:last-child td { border-bottom: 0; }
.main .tbl tbody tr:hover td { background: #faf9f6; }
.main .tbl tbody tr:nth-child(even) td { background: transparent; }
.main .tbl tbody tr:nth-child(even):hover td { background: #faf9f6; }
.main .tbl .num, .main .tbl td.num, .main .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
/* Email log rows match the table rows. */
.main .el-row { padding: 12px 16px; font-size: 13px; }
.main .el-row:hover { background: #faf9f6; }
.main .el-head { padding: 16px; }
/* Email graph bars: steel blue, never the button orange. */
.main .el-bar i { background: #3f6c9e; }

/* Parked slide-over panels must never be caught by the page entry animation (its transform briefly pulled them on screen). */
.main > .slideover, .main > .slideover-scrim, .main > .tribe-panel, .main > .tribe-panel-scrim, .slideover, .slideover-scrim { animation: none !important; }

/* == Round 12 (2026-11-11) ================================================== */
/* Tab counts: always a light grey square chip - never the accent, never flips on hover/active. */
.tabs .tab .tab-count, .tabs .tab.tab-active .tab-count, .tabs .tab:hover .tab-count, .main .tabs .tab .tab-count, .drawer .tabs .tab .tab-count {
  display: inline-flex !important; opacity: 1 !important; visibility: visible !important;
  min-width: 20px; height: 20px; padding: 0 6px; margin-left: 2px; border-radius: 6px;
  background: #ecebe7 !important; color: #5f574f !important; font-size: 11px; font-weight: 600;
}
/* Tabs: snugger left/right. */
.tabs .tab, .main .tabs .tab, .drawer .tabs .tab { padding: 9px 8px 10px; gap: 6px; }
.tabs { gap: 6px; }

/* Home board heading: name, then the open count as a quiet chip beside it. */
.pb .kb-head { align-items: center; gap: 10px; }
.pb .kb-head h3 { margin: 0; line-height: 1.2; }
.pb .kb-head > .meta { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: 12px; font-weight: 600; color: #5f574f; background: #ecebe7; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.pb .kb-head > .meta .pb-replies { color: var(--accent); font-weight: 700; }

/* == Round 13 (2026-11-11): narrower columns, full-screen board ============== */
.pb .kb-board { grid-auto-columns: minmax(236px, 1fr); gap: 10px; }
.pb .kb-board .pb-col { min-width: 236px; }
/* Full screen: the board takes the whole frame, sidebar and banner tucked away. */
.pb.is-full { position: fixed; inset: 0; z-index: 150; margin: 0; padding: 18px 20px 12px; background: #f4f3f0; border-radius: 22px; display: flex; flex-direction: column; }
.pb.is-full .kb-board { height: auto !important; flex: 1; min-height: 0; grid-auto-columns: minmax(220px, 1fr); }
.pb.is-full .kb-board .pb-col { min-width: 220px; }
.pb.is-full .kb-head { flex: none; }
body.pb-fullscreen .main { overflow: hidden; }
.pb-full-btn[aria-pressed="true"] { background: #1f1b17 !important; color: #fff !important; border-color: #1f1b17 !important; }
.pb-full-btn .ico { width: 15px; height: 15px; }

/* Person slide-out: the X always sits above the injected header (the header was covering it, so clicks never reached it). */
#candidateDrawer > .cd-close { z-index: 60 !important; }
#candidateDrawer .cand-topbar { padding-right: 44px; }

/* Add person at the foot of each column: always visible, not hover-only. */
.pb-col-add { opacity: 1 !important; border-color: rgba(60,50,40,.14); color: var(--text-2); background: rgba(255,255,255,.45); flex: none; }
.pb-col-add:hover { border-color: #cfccc5; color: var(--text); background: #fff; }

/* Columns a little narrower again (operator, 2026-11-11). */
.pb .kb-board { grid-auto-columns: minmax(212px, 1fr); gap: 10px; }
.pb .kb-board .pb-col { min-width: 212px; }
.pb.is-full .kb-board { grid-auto-columns: minmax(200px, 1fr); }
.pb.is-full .kb-board .pb-col { min-width: 200px; }

/* == Collapsible board columns (2026-11-11) ==================================
   The board is a flex row so a folded column can be a thin strip while the
   others keep their width. */
.pb .kb-board { display: flex !important; align-items: stretch; }
.pb .kb-board > .pb-col { flex: 1 0 212px; min-width: 212px; }
.pb.is-full .kb-board > .pb-col { flex-basis: 200px; min-width: 200px; }
.pb-col-fold { flex: none; display: grid; place-items: center; width: 24px; height: 24px; margin-left: 2px; border: 0; border-radius: 7px; background: none; color: var(--text-3); cursor: pointer; }
.pb-col-fold:hover { background: rgba(74,52,30,.07); color: var(--text); }
.pb-col-fold svg { width: 14px; height: 14px; transition: transform .2s ease; }
.pb .kb-board > .pb-col.is-folded { flex: 0 0 46px !important; min-width: 46px !important; cursor: pointer; overflow: hidden; }
.pb-col.is-folded .pb-col-hint, .pb-col.is-folded .kb-col-body, .pb-col.is-folded .pb-col-add, .pb-col.is-folded .pb-grip { display: none !important; }
.pb-col.is-folded .pb-col-head { flex-direction: column; align-items: center; gap: 10px; border-bottom: 0; padding: 10px 0; margin: 0; height: 100%; }
.pb-col.is-folded .pb-col-fold { order: -1; margin: 0; }
.pb-col.is-folded .pb-col-fold svg { transform: rotate(180deg); }
.pb-col.is-folded .pb-col-n { margin: 0 !important; }
.pb-col.is-folded .pb-col-title { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; margin: 0 !important; padding: 0 !important; pointer-events: none; }
.pb-col.is-folded:hover { background: rgba(255,255,255,.5); }

/* Completed pop-up: two clear choice boxes (2026-11-11). */
.pb-choose-box { position: relative; width: min(440px, 92vw); padding: 24px 24px 22px; border-radius: 20px; }
.pb-choose-box h4 { font-size: 18px; padding-right: 30px; }
.pb-choose-box p { margin: 0 0 16px; }
.pb-choose-x { position: absolute; top: 14px; right: 14px; width: 30px; height: 30px; display: grid; place-items: center; border: 0; border-radius: 9px; background: none; color: var(--text-3); font-size: 14px; cursor: pointer; }
.pb-choose-x:hover { background: #f2f1ee; color: var(--text); }
.pb-choose-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pb-opt { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 16px; border: 1.5px solid rgba(60,50,40,.12); border-radius: 14px; background: #fff; text-align: left; font: inherit; cursor: pointer; transition: border-color .15s ease, background .15s ease, transform .15s ease; }
.pb-opt strong { font-size: 15px; font-weight: 700; color: var(--text); margin-top: 6px; }
.pb-opt > span:last-child { font-size: 12.5px; color: var(--text-3); }
.pb-opt-ic { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; }
.pb-opt-ic svg { width: 20px; height: 20px; }
.pb-opt.is-member .pb-opt-ic { background: #e3f3e8; color: #2f9e57; }
.pb-opt.is-lost .pb-opt-ic { background: #f1efec; color: #8b8177; }
.pb-opt.is-member:hover, .pb-opt.is-member:focus-visible { border-color: #2f9e57; background: #f6fbf7; outline: none; }
.pb-opt.is-lost:hover, .pb-opt.is-lost:focus-visible { border-color: #b8b1a8; background: #faf9f7; outline: none; }
.pb-opt:active { transform: scale(.98); }

/* Completed: "Show N older" link at the foot. */
.pb-older { display: block; margin: 8px 6px 4px; padding: 8px; text-align: center; font-size: 12.5px; font-weight: 600; color: var(--text-2); text-decoration: none; border-radius: 10px; background: rgba(255,255,255,.5); }
.pb-older:hover { background: #fff; color: var(--text); }

/* Home board: Leaderboard button. */
.pb-lb-btn { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.pb-lb-btn .ico { width: 15px; height: 15px; color: #b8862b; }

/* Add person: manual only while person search is paused (2026-11-11). */
#addPersonDrawer.aps-manual-only [data-ap-back], #addPersonDrawer.aps-manual-only #apChoose, #addPersonDrawer.aps-manual-only #addPersonSearch { display: none !important; }

/* Completed column: Members / Lost tabs with totals (2026-11-11). */
.pb-done-tabs { display: flex; gap: 4px; margin: 0 6px 8px; padding: 3px; background: rgba(60,50,40,.06); border-radius: 10px; }
.pb-done-tabs button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; background: none; padding: 6px 8px; border-radius: 8px; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--text-3); cursor: pointer; }
.pb-done-tabs button b { font-weight: 700; color: inherit; font-variant-numeric: tabular-nums; }
.pb-done-tabs button.is-on { background: #fff; color: var(--text); box-shadow: 0 1px 2px rgba(40,30,20,.08); }
.pb-done-tabs button[data-done-tab="member"].is-on b { color: var(--text); }
.pb-col.is-folded .pb-done-tabs { display: none; }

/* Completed filter (replaces the tabs). */
.pb-done-filter { margin: 0 6px 8px; }
.pb-done-filter select { width: 100%; height: 32px; font-size: 12.5px; font-weight: 600; }
.pb-col.is-folded .pb-done-filter { display: none; }

/* Completed filter: secondary - a quiet inline control, not a full-width box. */
.pb-done-filter { margin: -2px 6px 6px; display: flex; justify-content: flex-start; }
#board .pb-done-filter select, .pb-done-filter select.input { width: auto !important; height: 26px !important; min-height: 0 !important; padding: 0 22px 0 8px !important; border: 0 !important; background-color: transparent !important; box-shadow: none !important; font-size: 12px !important; font-weight: 600; color: var(--text-3) !important; cursor: pointer; border-radius: 7px !important; }
#board .pb-done-filter select:hover { background-color: rgba(60,50,40,.06) !important; color: var(--text-2) !important; }
#board .pb-done-filter select:focus { box-shadow: none !important; background-color: rgba(60,50,40,.06) !important; }

/* Completed tabs: a hidden card really hides (the card display rule was overriding [hidden]). */
#board .pbc[hidden], #board [data-kb-card][hidden] { display: none !important; }

/* Columns pop-up: New and Completed rows - renameable, pinned in place. */
.pbs-fixed-row { background: #faf9f6; border: 1px solid var(--border); border-radius: 12px; margin: 0 0 10px; }
.pbs-fixed-row + .pbs-add, .pbs-add + .pbs-fixed-row { margin-top: 10px; }
.pbs-lockico { width: 18px; text-align: center; font-size: 12px; opacity: .5; }
.pbs-pos { font-size: 11.5px; color: var(--text-3); white-space: nowrap; padding-right: 6px; }
#boardColsDrawer .pbs-fixed-row .pbs-name { background: transparent !important; }

/* Last activity on person rows and board cards (2026-11-11). */
.row-ago { flex: none; font-size: 11.5px; color: var(--text-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.pbc-ago { margin-left: auto; font-size: 11px; color: var(--text-3); white-space: nowrap; font-variant-numeric: tabular-nums; }


/* ── Calmer, cleaner motion (operator, 2026-11-12) ──────────────────────────
   Stop nearly every element animating itself in on load, and stop cards bobbing
   on hover. The page should just appear. Functional feedback stays: spinners,
   the progress bar, a card's landing pop after a move, menus/popovers opening. */
.main > :not(.drawer):not(.drawer-backdrop):not(.app-header):not(script),
.pb-col, .pbc, .af-row, .co-person, .tribe-tile, .af-node, .card, .ths,
.cat-row, .drawer.open .drawer-body > * { animation: none !important; }
/* The fit ring: show its fill straight away instead of sweeping it in. */
.av-ring:not(.is-none) { animation: none !important;
  background: conic-gradient(var(--c) calc(var(--pct) * 1%), rgba(60,50,40,.10) 0) !important; }
/* The pulsing "next / suggested" dots: hold still. */
.eng-next-go, .eng-suggested .eng-tl-dot { animation: none !important; }
/* Hover: keep the shadow/border cue, drop the lift so nothing bobs. */
.pbc:hover, .tribe-tile:hover, .af-node:hover, .funnel-chip:hover,
.fork-chip:hover, .welcome-bg-btn:hover, .hdrbg-thumb:hover { transform: none !important; }

/* Smoother column collapse/expand: glide the width instead of snapping it
   (operator, 2026-11-12: the fold was "too hectic" — animate it closed). */
.pb .kb-board > .pb-col {
  transition: flex-basis .24s cubic-bezier(.2,.7,.2,1), flex-grow .24s cubic-bezier(.2,.7,.2,1),
              min-width .24s cubic-bezier(.2,.7,.2,1), width .24s cubic-bezier(.2,.7,.2,1),
              background .14s ease, border-color .14s ease, box-shadow .14s ease;
}

/* The count sits directly after the column title, in parentheses, and the fold
   button moves to the far right (operator, 2026-11-12). The parens are drawn
   with pseudo-elements so the JS recount (textContent) leaves them intact. */
.pb-col-head .pb-col-n { margin-left: 0; }
.pb-col-head .pb-col-n::before { content: "("; }
.pb-col-head .pb-col-n::after  { content: ")"; }
.pb-col-head .pb-col-fold { margin-left: auto; }
/* Folded: the vertical strip keeps the count tight to the title, no parens. */
.pb-col.is-folded .pb-col-n::before,
.pb-col.is-folded .pb-col-n::after { content: ""; }
.pb-col.is-folded .pb-col-fold { margin-left: 0; }

/* Categories rendered as a proper data table, not people-item cards
   (operator, 2026-11-12). Reuses .tbl; these only tidy the cells. */
.cat-table .cat-name { padding: 2px 0; }
.cat-table .cat-seats { white-space: nowrap; color: var(--text-3); font-variant-numeric: tabular-nums; font-size: 13px; }
.cat-table .cat-person .af-person { padding: 2px 0; }
.cat-table td { vertical-align: middle; }
@media (max-width: 640px) { .cat-table .cat-seats-h, .cat-table .cat-seats { display: none; } }

/* Centered confirmation pop-up — tcConfirm() in celebrate.js, a styled stand-in
   for native confirm() so each status change gets a proper notice (2026-11-12). */
.tc-confirm { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center;
  background: rgba(3,8,15,.5); opacity: 0; transition: opacity .16s ease; padding: 20px; }
.tc-confirm.is-in { opacity: 1; }
.tc-confirm-box { width: min(384px, 100%); background: #fff; color: var(--text);
  border: 1px solid var(--border); border-radius: 14px; padding: 22px 22px 18px;
  box-shadow: 0 24px 70px rgba(0,0,0,.42); transform: translateY(8px) scale(.97);
  transition: transform .16s ease; }
.tc-confirm.is-in .tc-confirm-box { transform: none; }
.tc-confirm-box h4 { margin: 0 0 6px; font-size: 16px; }
.tc-confirm-body { margin: 0 0 16px; font-size: 13.5px; color: var(--text-3); line-height: 1.5; }
.tc-confirm-acts { display: flex; gap: 8px; justify-content: flex-end; }
.tc-confirm.is-member .tc-confirm-box { border-top: 3px solid var(--accent); }
.tc-confirm.is-lost .tc-confirm-box { border-top: 3px solid var(--danger, #d9534f); }
/* The whole board card is clickable to open the person (operator, 2026-11-12). */
.pbc { cursor: pointer; }

/* Conversation composer polish (operator, 2026-11-12): the status line sits
   below the title, the divider is lighter, the From sender is shown, and the
   fields take a darker fill so they clearly read as inputs. */
#conversation .conv-head { align-items: flex-start; border-bottom-color: rgba(74,52,30,.05); }
#conversation .conv-sub { margin-top: 3px; }
#conversation .conv-from { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 12.5px; color: var(--text-2); }
#conversation .conv-from-l { font-weight: 700; text-transform: uppercase; letter-spacing: .05em; font-size: 10px; color: var(--text-3); }
#conversation .conv-from-edit { margin-left: auto; font-size: 11.5px; }
#conversation .conv-field { width: 100%; display: block; margin-bottom: 8px; background: #f7f6f3; border: 1px solid var(--border); }
#conversation .conv-field:focus { background: #fff; border-color: var(--accent); }
#conversation textarea.conv-body { resize: vertical; }


/* Custom dropdown — a styled replacement for the native board selects
   (operator, 2026-11-12). Used in the board head for tribe + whose-board. */
.cdd { position: relative; }
.cdd-btn { display: inline-flex; align-items: center; gap: 8px; height: var(--ctl-h-sm, 32px);
  padding: 0 10px; border: 1px solid var(--border); border-radius: 8px; background: #fff;
  color: var(--text); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.cdd-btn:hover { border-color: var(--text-3); }
.cdd-cur { max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cdd-caret { width: 13px; height: 13px; color: var(--text-3); flex: none; }
.cdd-menu { position: absolute; top: calc(100% + 6px); right: 0; min-width: 210px; max-height: 340px;
  overflow: auto; background: #fff; border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 16px 40px rgba(0,0,0,.18); padding: 5px; z-index: 60; }
.cdd-opt { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 7px;
  font-size: 13px; color: var(--text); text-decoration: none; white-space: nowrap; }
.cdd-opt > span { overflow: hidden; text-overflow: ellipsis; }
.cdd-opt:hover { background: var(--surface-2); }
.cdd-opt.is-sel { font-weight: 700; }
.cdd-tick { width: 14px; height: 14px; margin-left: auto; color: var(--accent); flex: none; }

/* Per-person engagement checklist in the candidate rail (operator, 2026-11-12). */
.rail-checklist { display: flex; flex-direction: column; gap: 1px; margin-top: 6px; }
.rcl-item { position: relative; display: flex; align-items: center; gap: 9px; padding: 6px 4px; border-radius: 7px; cursor: pointer; font-size: 13px; color: var(--text-2); }
.rcl-item:hover { background: var(--surface-2); }
.rcl-item input { position: absolute; opacity: 0; width: 0; height: 0; }
.rcl-box { display: grid; place-items: center; width: 18px; height: 18px; border: 1.5px solid var(--text-3); border-radius: 5px; flex: none; color: #fff; background: #fff; }
.rcl-box svg { width: 12px; height: 12px; opacity: 0; }
.rcl-item.is-on .rcl-box { background: var(--accent); border-color: var(--accent); }
.rcl-item.is-on .rcl-box svg { opacity: 1; }
.rcl-item.is-on .rcl-label { color: var(--text); text-decoration: line-through; text-decoration-color: var(--text-3); }
.rcl-item input:focus-visible + .rcl-box { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Add-person drawer condensed — less vertical spacing (operator, 2026-11-12). */
#addPersonDrawer .ap-group { padding: 11px 14px 3px; margin-bottom: 8px; }
#addPersonDrawer .ap-group-h { margin: 0 0 7px; }
#addPersonDrawer .ap-group .form-row { margin-bottom: 8px !important; }
#addPersonDrawer .form-row > label { margin-bottom: 4px; }

/* Checklist: a step the system auto-tracks shows an "Auto" tag and is read-only. */
.rcl-auto { margin-left: auto; font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); background: var(--surface-2); padding: 2px 6px; border-radius: 999px; }
.rcl-item.is-auto { cursor: default; }
.rcl-item.is-auto:hover { background: transparent; }
.rcl-item input:disabled { cursor: default; }

/* Last-outreach rail card as clean stacked stats, not cramped text (2026-11-12). */
.cand-touch { display: flex; gap: 10px; padding: 12px 14px; }
.cand-touch .ct-item { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.cand-touch .ct-l { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); }
.cand-touch .ct-v { font-size: 14px; font-weight: 650; color: var(--text); }

/* Last-outreach: back to inline, with a divider line between items, not stacked
   (operator, 2026-11-12: "it was better before, just add a divider"). Overrides
   the stacked version appended earlier. */
.cand-touch { display: flex; align-items: center; padding: 11px 14px; gap: 0; }
.cand-touch .ct-item { display: inline-flex; flex-direction: row; align-items: center; gap: 6px; flex: 0 0 auto; font-size: 13px; color: var(--text-2); padding: 0 14px; white-space: nowrap; }
.cand-touch .ct-item:first-child { padding-left: 0; }
.cand-touch .ct-item + .ct-item { border-left: 1px solid var(--border-2); }
.cand-touch .ct-item svg { width: 15px; height: 15px; color: var(--text-3); flex: none; }
.cand-touch .ct-item strong { color: var(--text); font-weight: 650; }

/* Person edit bar (operator, 2026-11-12): real icons on the left, plain text
   (no blue), the whole row opens the centered edit pop-up, pencil always visible. */
.fit-who-lines.fe-lines { display: flex; flex-direction: column; gap: 2px; width: 100%; }
.fe-row { display: grid; grid-template-columns: 18px 84px minmax(0, 1fr) 16px; align-items: center; gap: 10px;
  width: 100%; padding: 7px 8px; margin: 0; border: 0; border-radius: 8px; background: none;
  font: inherit; font-size: 13px; color: var(--text); text-align: left; cursor: pointer; }
.fe-row:hover { background: var(--surface-2); }
.fe-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.fe-ic { width: 16px; height: 16px; color: var(--text-3); }
.fe-lbl { font-size: 12px; font-weight: 600; color: var(--text-3); }
.fe-val { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.fe-row.is-missing .fe-val { color: var(--text-3); font-style: italic; }
.fe-pen { width: 14px; height: 14px; color: var(--text-3); opacity: .55; }
.fe-row:hover .fe-pen { opacity: 1; color: var(--text); }


/* Backlog: no-contact people get a small label, not their own step (2026-11-12). */
.af-needs { flex: none; display: inline-flex; align-items: center; font-size: 11px; font-weight: 600; line-height: 1;
  padding: 4px 8px; border-radius: 999px; color: #8a5a00; background: #fdf3dc; white-space: nowrap; }
.af-row.is-needs { opacity: .85; }

/* Person edit bar — inline editing (operator, 2026-11-12): icon, label, value,
   and the pencil right after the value, shown only on hover. Clicking it turns
   the row into a field in place. Overrides the earlier grid version. */
.fe-row { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 5px 8px; cursor: default; }
.fe-row:hover { background: var(--surface-2); }
.fe-ic { flex: none; }
.fe-lbl { flex: 0 0 72px; }
.fe-val { flex: 0 1 auto; min-width: 0; }
.fe-val[data-fe-start] { cursor: pointer; }
.fe-val[data-fe-start]:hover { text-decoration: underline; text-underline-offset: 3px; }
.fe-pen { flex: none; display: grid; place-items: center; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 6px;
  background: none; color: var(--text-3); cursor: pointer; opacity: 0; transition: opacity .12s ease; }
.fe-pen svg { width: 14px; height: 14px; display: block; }
.fe-row:hover .fe-pen, .fe-pen:focus-visible { opacity: 1; }
.fe-pen:hover { color: var(--text); background: rgba(74,52,30,.08); }
@media (hover: none) { .fe-pen { opacity: .65; } }   /* touch screens can't hover */
.fe-row.is-editing { background: var(--surface-2); }
.fe-row.is-editing .fe-val, .fe-row.is-editing .fe-pen { display: none; }
.fe-edit { flex: 1 1 auto; display: flex; align-items: center; gap: 6px; min-width: 0; }
.fe-edit .fe-input { flex: 1 1 auto; min-width: 0; height: 32px !important; min-height: 32px !important; padding: 0 10px;
  font-size: 13px; background: #fff !important; border: 1px solid var(--accent) !important; border-radius: 8px; box-shadow: 0 0 0 3px var(--accent-soft); }
.fe-act { flex: none; display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border-radius: 8px;
  border: 1px solid var(--border); background: #fff; color: var(--text-3); cursor: pointer; }
.fe-act svg { width: 14px; height: 14px; display: block; }
.fe-act.is-ok { background: var(--accent); border-color: var(--accent); color: #fff; }
.fe-act.is-no:hover { color: var(--text); }
.fe-row.is-saved { background: #e8f5ec; }

/* Board dropdown: the active choice gets a clear outline highlight, and the
   menu itself drops the drop shadow for a crisp border (operator, 2026-11-12). */
.cdd-menu { box-shadow: none; border-color: rgba(74,52,30,.22); }
.cdd-opt.is-sel { background: #fdf5ef; outline: 1.5px solid var(--accent); outline-offset: -1.5px; font-weight: 700; }
.cdd-opt.is-sel:hover { background: #fbeee4; }

/* Home board on phones (operator, 2026-11-12: "never wrapping and looking ugly"):
   one-row toolbar (full-screen is meaningless on a phone; Columns goes icon-only),
   and columns at ~82% width that snap into place when you swipe. */
@media (max-width: 720px) {
  .pb .pb-full-btn { display: none !important; }
  .pb .pb-head-acts { display: flex; flex-wrap: nowrap; align-items: center; gap: 8px; width: 100%; }
  .pb .pb-head-acts .cdd { flex: 1 1 auto; min-width: 0; }
  .pb .pb-head-acts .cdd-btn { width: 100%; justify-content: space-between; }
  .pb .pb-head-acts [data-open-drawer="boardColsDrawer"] { flex: none; font-size: 0; gap: 0; padding: 0 10px; }
  .pb .pb-head-acts [data-open-drawer="boardColsDrawer"] .ico { width: 18px; height: 18px; margin: 0; }
  .pb .pb-head-acts .btn-accent { flex: none; white-space: nowrap; }
  .pb .kb-board { scroll-snap-type: x mandatory; scroll-padding-left: 0; }
  .pb .kb-board > .pb-col:not(.is-folded) { scroll-snap-align: start; flex: 0 0 82vw !important; width: 82vw !important; min-width: 82vw !important; max-width: 82vw !important; }
}

/* Links in the cream content area read as text with a quiet underline, not the
   dark-theme blue (operator, 2026-11-12: "stop highlighting all those things
   blue"). Scoped to .main so the dark drawers keep their own link colour. */
.main .ident-co { color: var(--text); text-decoration: underline; text-decoration-color: rgba(74,52,30,.28); text-underline-offset: 3px; }
.main .ident-co:hover { color: var(--accent); text-decoration-color: currentColor; }
/* Italic "Add email" was clipping its last letter inside the ellipsis box. */
.fe-val { padding-right: 3px; }

/* Automation panel rows on phones (2026-11-12): the person gets the whole first
   line and the label + buttons drop to a right-aligned second line, so the name
   is never squeezed to nothing. The no-contact spacer checkbox goes away here. */
@media (max-width: 720px) {
  /* justify-content right-aligns the wrapped action line; it ignores the
     inline <style> the person-row fragment emits after the first person. */
  .af2-panel .af-row { flex-wrap: wrap; row-gap: 8px; justify-content: flex-end; }
  .af2-panel .af-row > .af-person { flex: 1 1 calc(100% - 48px); min-width: 0; }
  .af2-panel .af-row.is-needs > .af-check { display: none; }
  .af2-panel .af-row.is-needs > .af-person { flex-basis: 100%; }
  .af2-panel .af-row > .af-person ~ * { flex: none; }
}

/* "Add image" sits on a near-black chip; the cream theme had recoloured its
   text brown, making it unreadable (2026-11-12). White on the dark chip. */
.main .tribe-img-btn { color: #fff; }

/* Tribe page on phones (2026-11-12): a short empty hero instead of a 240px
   blank, tabs as one swipeable row (a later rule had re-enabled wrapping),
   and the categories header wrapping instead of crushing its title. */
@media (max-width: 720px) {
  /* flex-basis, not height: the hero stacks as a column on phones, so the
     base flex: 0 0 240px would otherwise set the height. */
  .tribe-hero-img.is-empty { aspect-ratio: auto; min-height: 0; flex: 0 0 92px; height: 92px; }
  .main .tabs { flex-wrap: nowrap !important; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .main .tabs::-webkit-scrollbar { display: none; }
  .main .tabs > * { flex: none; white-space: nowrap; }
  .cat-simple-head { flex-wrap: wrap; }
  .cat-simple-head h3 { flex: 1 1 100%; margin: 0; }
  .cat-simple-head .search-wrap { flex: 1 1 auto; min-width: 0; }
  .cat-simple-head .search-wrap .input { width: 100%; }
}

/* Categories table on phones (2026-11-12): compact cards — category name, then
   the person on deck right under it, no inner divider or double padding. */
@media (max-width: 720px) {
  .cat-table tr { padding: 10px 12px !important; margin-bottom: 6px !important; }
  .cat-table td { border: 0 !important; padding: 0 !important; }
  .cat-table td:first-child { margin-bottom: 4px !important; }
  .cat-table .cat-name { padding: 0; }
  .cat-table .cat-person .af-person { padding: 0; }
}

/* Users on phones (2026-11-12): one compact card per user — no inner dividers,
   role and status side by side instead of each in its own bordered band. */
@media (max-width: 720px) {
  .users-main .tbl tr { padding: 12px 14px !important; }
  .users-main .tbl td { border: 0 !important; padding: 3px 0 !important; }
  .users-main .tbl td[data-label="Role"], .users-main .tbl td[data-label="Status"] {
    display: inline-flex !important; width: auto !important; align-items: center; gap: 8px; margin: 6px 10px 2px 0; vertical-align: middle; }
  .users-main .tbl td[data-label="Status"] > div { margin-top: 0 !important; }
}

/* Person edit bar (operator, 2026-11-12): pencil on the far right of the row,
   and a much quieter hover tint. */
.fe-pen { margin-left: auto; }
.fe-row:hover, .fe-row.is-editing { background: rgba(74,52,30,.03); }

/* Board cards, round 3 (operator, 2026-11-12).
   1. "New" is a small square ribbon tab hanging off the card's top-right edge.
   2. Source (bolt = automation, person = by hand) sits on the avatar's top-right,
      the way the Member/Lost mark sits on its bottom-right. Replaces the chip.
   3. "Fell through" is its own strip under the card: divider, label, time. */
.pbc { position: relative; }
.pb .kb-col-body { padding-top: 12px; }
.pbc-ribbon { position: absolute; top: -6px; right: 12px; z-index: 3; padding: 4px 7px 3px;
  font-size: 9.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; line-height: 1;
  color: #fff; background: var(--accent); border-radius: 3px 3px 2px 2px;
  box-shadow: 0 2px 5px rgba(74,52,30,.18); pointer-events: none; }
.pbc-ribbon::before { content: ""; position: absolute; top: 0; left: -4px;
  border-bottom: 6px solid color-mix(in srgb, var(--accent) 62%, #000); border-left: 4px solid transparent; }

.av-ring { position: relative; }
.av-src { position: absolute; top: -3px; right: -4px; z-index: 2; display: grid; place-items: center;
  width: 17px; height: 17px; border-radius: 50%; border: 2px solid #fff; box-sizing: border-box; }
.av-src svg { width: 9px; height: 9px; display: block; }
.av-src.is-auto { color: #fff; background: #e0a100; }
.av-src.is-manual { color: #fff; background: #8a7a64; }
.ab-foot:not(:has(*)) { display: none; }

.pbc-fell { display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin: 9px -12px -10px; padding: 7px 12px 8px; border-top: 1px solid #f0dfbd;
  background: #fdf6e8; border-radius: 0 0 9px 9px; font-size: 11.5px; }
.pbc-fell-lbl { font-weight: 700; color: #8a5a12; display: inline-flex; align-items: center; gap: 6px; }
.pbc-fell-lbl::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #d98a1c; }
.pbc-fell-ago { color: #9a7440; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pbc-fell:not(:last-child) { margin-bottom: 8px; border-radius: 0; }

/* Every person card is the same height (operator, 2026-11-12): name and
   title|company each hold one line (ellipsis, full text on hover), and the
   subtitle line is always reserved. Only the notice strips below the card
   (Fell through, a reply) add height. */
.pbc-name, .ab-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; overflow-wrap: normal; }
.pbc-sub, .ab-sub { display: block; -webkit-line-clamp: unset; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ab-id { min-width: 0; flex: 1; }

/* List filters → Filter button + bottom sheet on phones (operator, 2026-11-12).
   Desktop: the sheet wrapper is display:contents, so the row is unchanged. */
.lf-toggle, .lf-backdrop, .lf-sheet-head { display: none; }
.lf-sheet { display: contents; }
.lf-count { display: inline-grid; place-items: center; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 999px; background: var(--accent); color: #fff; font-size: 10.5px; font-weight: 700; line-height: 1; }
.lf-count[hidden] { display: none; }
@media (max-width: 720px) {
  .list-head { flex-wrap: wrap; }
  .list-filters { display: flex; flex-wrap: nowrap; align-items: center; gap: 8px; width: 100%; }
  .list-filters .search-wrap { flex: 1 1 auto; min-width: 0; order: 1; }
  .list-filters .search-wrap > input { width: 100%; }
  .lf-toggle { display: inline-flex; align-items: center; gap: 6px; flex: none; order: 2; }
  .lf-toggle svg { width: 14px; height: 14px; }
  .lf-sheet { display: none; }
  .list-filters.is-open .lf-sheet { display: flex; flex-direction: column; gap: 10px; position: fixed; left: 0; right: 0; bottom: 0;
    z-index: 1001; background: #fff; border-radius: 16px 16px 0 0; padding: 14px 16px calc(18px + env(safe-area-inset-bottom));
    box-shadow: 0 -12px 40px rgba(0,0,0,.22); max-height: 80vh; overflow-y: auto; }
  .list-filters.is-open .lf-sheet select { width: 100%; height: 42px; font-size: 15px; }
  .lf-sheet-head { display: flex; align-items: center; justify-content: space-between; padding-bottom: 6px; border-bottom: 1px solid var(--border-2); color: var(--text); font-size: 15px; }
  .list-filters.is-open .lf-backdrop:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 1000; background: rgba(20,14,8,.42); }
  body.lf-locked { overflow: hidden; }
}
/* Same Filter sheet on the Activity card head (plain GET form). */
@media (max-width: 720px) {
  .act-tools[data-lf] { display: flex; flex-wrap: nowrap; align-items: center; gap: 8px; width: 100%; }
  .act-tools[data-lf] > input[type="search"] { flex: 1 1 auto; min-width: 0; width: auto; order: 1; }
  .act-tools[data-lf].is-open .lf-sheet { display: flex; flex-direction: column; gap: 10px; position: fixed; left: 0; right: 0; bottom: 0;
    z-index: 1001; background: #fff; border-radius: 16px 16px 0 0; padding: 14px 16px calc(18px + env(safe-area-inset-bottom));
    box-shadow: 0 -12px 40px rgba(0,0,0,.22); max-height: 80vh; overflow-y: auto; }
  .act-tools[data-lf].is-open .lf-sheet select { width: 100%; height: 42px; font-size: 15px; }
  .act-tools[data-lf].is-open .lf-backdrop:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 1000; background: rgba(20,14,8,.42); }
}
/* Bigger source mark on the person page's large avatar. */
.av-ring-lg .av-src { width: 21px; height: 21px; top: -2px; right: -3px; }
.av-ring-lg .av-src svg { width: 11px; height: 11px; }

/* Tribe page → Categories data table (operator, 2026-11-12). Plain cells, no
   person cards. Stays a real table on phones and scrolls sideways. */
.cdt-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.cdt { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.cdt th { position: sticky; top: 0; background: #faf9f6; color: var(--text-3); font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .04em; text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border-2);
  white-space: nowrap; user-select: none; }
.cdt th[data-sort-key] { cursor: pointer; }
.cdt th[data-sort-key]:hover { color: var(--text); }
.cdt th[aria-sort="ascending"]::after { content: " \2191"; color: var(--accent); }
.cdt th[aria-sort="descending"]::after { content: " \2193"; color: var(--accent); }
.cdt td { padding: 10px 14px; border-bottom: 1px solid var(--border-2); vertical-align: middle; white-space: nowrap; color: var(--text); }
.cdt tbody tr:last-child td { border-bottom: 0; }
.cdt tbody tr:hover td { background: rgba(74,52,30,.025); }
.cdt .cdt-num { text-align: right; font-variant-numeric: tabular-nums; }
.cdt .cdt-muted { color: var(--text-2); }
.cdt-cat { border: 0; background: none; padding: 0; font: inherit; font-weight: 650; color: var(--text); cursor: pointer; text-align: left; }
.cdt-cat:hover { color: var(--accent); }
.cdt-person { font-weight: 600; color: var(--text); text-decoration: none; }
a.cdt-person:hover { color: var(--accent); }
.cdt-dash { color: var(--text-3); font-weight: 400; }
.cdt-seats { display: inline-block; min-width: 34px; padding: 2px 7px; border-radius: 6px; background: var(--surface-2); color: var(--text-2); font-size: 12px; font-weight: 600; text-align: center; }
.cdt-seats.is-full { background: rgba(26,169,113,.12); color: #137a52; }
.cdt td .row-status { font-size: 11px; padding: 2px 9px; }
.cdt-none td { text-align: center; color: var(--text-3); padding: 18px; }
/* Opt this table OUT of the global phone rule that stacks .tbl rows into cards. */
@media (max-width: 720px) {
  .cdt td, .cdt th { padding: 9px 12px; }
  .cdt { min-width: 640px; }
}

/* Tribe page → Automation, cleaner (operator, 2026-11-12). */
.ta2 { padding: 0; overflow: hidden; }
.ta2-head { padding: 18px 20px 14px; }
.ta2-head h3 { margin: 0; font-size: 15px; }
.ta2-head p { margin: 3px 0 0; font-size: 13px; color: var(--text-2); }
.ta2-note { display: flex; align-items: center; gap: 8px; margin: 0 20px 6px; padding: 9px 12px; border-radius: 8px;
  background: #f4f1ea; color: var(--text-2); font-size: 12.5px; }
.ta2-note svg { width: 15px; height: 15px; flex: none; color: var(--text-3); }
.ta2-note a { margin-left: auto; font-weight: 600; white-space: nowrap; }
.ta2-list { list-style: none; margin: 0; padding: 4px 20px; }
.ta2-row { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-top: 1px solid var(--border-2); }
.ta2-row:first-child { border-top: 0; }
.ta2-n { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: var(--surface-2); color: var(--text-2); font-size: 12px; font-weight: 700; }
.ta2-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ta2-txt strong { font-size: 14px; color: var(--text); }
.ta2-txt span { font-size: 12.5px; color: var(--text-2); }
.ta2-txt small { font-size: 12px; color: var(--text-3); }
.ta2-qty { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); white-space: nowrap; }
.ta2-qty input.input { width: 58px; height: 32px !important; min-height: 32px !important; padding: 0 8px; text-align: center; }
.ta2-row .switch { flex: none; }
.ta2-foot { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--border-2); background: #fbfaf7; }
.ta2-foot-note { font-size: 12px; color: var(--text-3); margin-right: auto; }
@media (max-width: 720px) {
  .ta2-row { flex-wrap: wrap; gap: 10px 12px; }
  .ta2-txt { flex: 1 1 calc(100% - 90px); }
  .ta2-qty { order: 3; margin-left: 38px; }
  .ta2-note { flex-wrap: wrap; }
  .ta2-note a { margin-left: 23px; }
}
.cdt { table-layout: auto; }
.cdt td.cdt-trunc { max-width: 0; width: 26%; overflow: hidden; text-overflow: ellipsis; }
.cdt td.cdt-trunc > * { overflow: hidden; text-overflow: ellipsis; }
/* Fixed column widths so the table always fits its card on desktop; text cells
   truncate with an ellipsis (full text on hover). */
.cdt { table-layout: fixed; }
.cdt th:nth-child(1) { width: 27%; }
.cdt th:nth-child(2) { width: 72px; }
.cdt th:nth-child(3) { width: 21%; }
.cdt th:nth-child(4) { width: auto; }
.cdt th:nth-child(5) { width: 118px; }
.cdt th:nth-child(6) { width: 100px; }
.cdt td { overflow: hidden; text-overflow: ellipsis; }
.cdt td.cdt-trunc { max-width: none; width: auto; }
.cdt-cat { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }

/* Calm column fold (operator, 2026-11-12): contents fade before the width moves. */
.pb .kb-board > .pb-col > :not(.pb-col-head) { transition: opacity .18s ease; }
.pb .kb-board > .pb-col.is-folding > :not(.pb-col-head),
.pb .kb-board > .pb-col.is-unfolding > :not(.pb-col-head) { opacity: 0; }
.pb .kb-board > .pb-col.is-folding .pb-col-n, .pb .kb-board > .pb-col.is-folding .pb-col-title { transition: opacity .15s ease; opacity: .4; }
.pb .kb-board > .pb-col {
  transition: flex-basis .3s cubic-bezier(.22,.8,.24,1), flex-grow .3s cubic-bezier(.22,.8,.24,1),
              min-width .3s cubic-bezier(.22,.8,.24,1), width .3s cubic-bezier(.22,.8,.24,1),
              background .14s ease, border-color .14s ease, box-shadow .14s ease;
}

/* ── Conversation thread (shared partial, 2026-11-13) ──────────────────────
   Was inline styles on the candidate page; now one set of rules for both the
   candidate page and the Inbox. */
.conv-thread { display: flex; flex-direction: column; gap: 14px; padding: 18px; }
.conv-row { display: flex; justify-content: flex-start; }
.conv-row.is-out { justify-content: flex-end; }
.conv-bubble { max-width: 78%; min-width: 0; border: 1px solid var(--border); background: var(--surface-2); border-radius: 12px; padding: 10px 13px; }
.conv-row.is-out .conv-bubble { border-color: var(--accent-soft); background: var(--accent-soft); }
.conv-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; margin-bottom: 4px; }
.conv-who { font-size: 12.5px; }
.conv-addr { font-size: 11px; }
.conv-pill { font-size: 9px; }
.conv-pill-in { background: var(--accent); color: #fff; }
.conv-when { margin-left: auto; }
.conv-subject { font-weight: 600; margin-bottom: 3px; }
.conv-text { white-space: pre-wrap; font-size: 13px; line-height: 1.5; color: var(--text-1); word-break: break-word; }
.conv-stats { margin-top: 6px; align-items: center; font-size: 11px; }
.conv-preview { font-size: 11px; padding: 2px 8px; }
@media (max-width: 720px) { .conv-bubble { max-width: 92%; } .conv-thread { padding: 12px; } }

/* ── Inbox (/inbox, 2026-11-13) ─────────────────────────────────────────── */
.ib-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.ib-head .page-sub { margin-bottom: 18px; }
.ib-search { position: relative; margin-bottom: 18px; width: min(340px, 100%); }
.ib-search svg { position: absolute; left: 11px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.ib-search input { width: 100%; height: 36px; padding: 0 12px 0 34px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); color: var(--text-1); font: inherit; font-size: 13px; }
.ib-search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.ib { display: grid; grid-template-columns: minmax(300px, 380px) 1fr; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); overflow: hidden; min-height: 560px; height: calc(100vh - 210px); }
.ib-list { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--border); }
.ib-tabs { display: flex; gap: 2px; padding: 8px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.ib-tabs::-webkit-scrollbar { display: none; }
.ib-tab { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 7px; font-size: 12.5px; font-weight: 600; color: var(--text-2); text-decoration: none; white-space: nowrap; }
.ib-tab:hover { background: var(--surface-2); color: var(--text-1); }
.ib-tab.is-active { background: var(--surface-2); color: var(--text-1); box-shadow: inset 0 0 0 1px var(--border); }
.ib-tab-n { font-size: 11px; font-weight: 700; color: var(--text-3); }
.ib-tab.is-active .ib-tab-n { color: var(--accent); }

.ib-items { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; min-height: 0; }
.ib-items li + li { border-top: 1px solid var(--border); }
.ib-item { position: relative; display: flex; gap: 11px; padding: 12px 14px 12px 16px; text-decoration: none; color: inherit; }
.ib-item:hover { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.ib-item.is-open { background: var(--surface-2); }
.ib-item.is-open::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); }
.ib-av { margin-top: 1px; }
.ib-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ib-line1, .ib-line2 { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ib-name { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 600; color: var(--text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ib-item.is-unread .ib-name { font-weight: 800; }
.ib-time { flex: none; font-size: 11.5px; color: var(--text-3); }
.ib-item.is-unread .ib-time { color: var(--accent); font-weight: 700; }
.ib-co { flex: 1; min-width: 0; font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ib-flag { flex: none; font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 999px; color: var(--accent); background: var(--accent-soft); }
.ib-snip { font-size: 12.5px; line-height: 1.45; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ib-dot { position: absolute; right: 14px; bottom: 16px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

.ib-empty, .ib-pane-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 40px 24px; text-align: center; color: var(--text-3); font-size: 13px; }
.ib-empty svg, .ib-pane-empty svg { width: 34px; height: 34px; color: var(--text-3); opacity: .7; margin-bottom: 4px; }
.ib-empty strong, .ib-pane-empty strong { color: var(--text-1); font-size: 14px; }
.ib-pane-empty { height: 100%; }

.ib-pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.ib-pane-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.ib-back { display: none; width: 32px; height: 32px; border-radius: 8px; place-items: center; color: var(--text-2); }
.ib-back svg { width: 18px; height: 18px; }
.ib-pane-who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ib-pane-who strong { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ib-pane-who .muted { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ib-pane-act { display: flex; gap: 6px; flex: none; }
.ib-pane-act form { margin: 0; }
.ib-thread { flex: 1; min-height: 0; overflow-y: auto; }
/* The shared card sits flush inside the pane: no second border or title. */
.ib-thread #conversation { border: 0; border-radius: 0; margin: 0; box-shadow: none; background: transparent; }
.ib-thread .conv-head { display: none; }
.ib-thread .conv-compose { position: sticky; bottom: 0; background: var(--surface); }

@media (max-width: 900px) {
  .ib { grid-template-columns: 1fr; height: auto; min-height: 0; }
  .ib-list { border-right: 0; }
  .ib.has-open .ib-list { display: none; }
  .ib:not(.has-open) .ib-pane { display: none; }
  .ib-back { display: grid; }
  .ib-items { max-height: none; }
  .ib-pane-act .btn { padding: 4px 9px; }
}
@media (max-width: 720px) {
  .ib-search { width: 100%; }
  .ib { border-radius: 10px; }
}
.ib-list, .ib-pane, .ib-item, .ib-items li { min-width: 0; }
@media (max-width: 900px) { .ib { grid-template-columns: minmax(0, 1fr); } }

/* ── Person page + slide-out: one aligned grid (operator, 2026-11-13) ──────
   Banner sits over the main column only; the details card and the rail's
   Last outreach card start on the same line, and the details card and the
   Status card end on the same line (both columns stretch to equal height). */
.cand-layout { grid-template-areas: "banner ." "main rail"; align-items: stretch; row-gap: 12px; }
.cand-layout > .cand-status { grid-area: banner; margin: 0; }
.cand-layout > .cand-main { grid-area: main; display: flex; flex-direction: column; min-width: 0; }
.cand-layout > .cand-main > .fit-card { flex: 1 1 auto; margin-bottom: 0 !important; }
.cand-layout > .cand-rail { grid-area: rail; display: flex; flex-direction: column; gap: 12px; position: static; }
.cand-layout > .cand-rail > .rail-card { margin: 0 !important; }
.cand-layout > .cand-rail > .rail-manage { flex: 1 1 auto; }
@media (max-width: 1100px) {
  .main .cand-layout { grid-template-areas: "banner" "main" "rail"; }
}
@media (max-width: 700px) {
  .cand-drawer .cand-layout { grid-template-areas: "banner" "main" "rail"; }
}

/* Composer: Send is green. (Field corners stay at the standard input radius -
   the 16px card match was too round, operator 2026-11-13.) */
:is(.main, .drawer) #conversation .conv-send-btn,
#conversation .conv-send-btn { background: var(--success); border-color: var(--success); color: #fff; }
:is(.main, .drawer) #conversation .conv-send-btn:hover,
#conversation .conv-send-btn:hover { background: #168459; border-color: #168459; color: #fff; }

/* ── Data tables inside cards: inset, wrapped (operator, 2026-11-13) ───────
   A table in a card no longer runs edge to edge: the card keeps a margin
   around it and the table is its own bordered, rounded block with a header
   row and row dividers. One rule for every card table on the site (logs,
   rejected connections, active devices, usage, runs ...). */
.main .card .card-tight:has(> .tbl),
.main .card .tbl-wrap:has(> .tbl),
.main .card .el-wrap { padding: 16px; }
.main .card > .card-head + .card-tight:has(> .tbl),
.main .card > .card-head + .tbl-wrap:has(> .tbl),
.main .card > .el-head + .el-wrap { padding-top: 2px; }
.main .card:has(> .card-tight > .tbl) > .card-head,
.main .card:has(> .tbl-wrap > .tbl) > .card-head { border-bottom: 0; }
@media (min-width: 1025px) {
  .main .card .card-tight > .tbl,
  .main .card .tbl-wrap > .tbl,
  .main .card .el-wrap > .tbl { border: 1px solid var(--card-line, rgba(60,50,40,.12)); border-radius: 12px; overflow: hidden; }
}
@media (max-width: 1024px) {
  .main .card .card-tight:has(> .tbl),
  .main .card .tbl-wrap:has(> .tbl),
  .main .card .el-wrap { padding: 12px; }
}

/* Usage page section headings (one plain page, 2026-11-13). */
.main .usage-sec { margin: 26px 0 12px; font-size: 15px; font-weight: 650; color: var(--text); }

/* ── Connector tokens as cards (operator, 2026-11-13) ──────────────────── */
.tok-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; margin: 0 0 14px; }
.tok-head h3 { margin: 0; font-size: 15px; }
.tok-head p { margin: 4px 0 0; }
.btn.tok-create { display: inline-flex; align-items: center; gap: 6px; height: var(--ctl-h-sm, 32px) !important; min-height: var(--ctl-h-sm, 32px) !important; padding: 0 14px; line-height: 1; }
.btn.tok-create svg { width: 15px; height: 15px; flex: none; }
.tok-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.tok-card { display: flex; flex-direction: column; gap: 14px; padding: 16px; background: #fff; border: 1px solid var(--card-line, rgba(60,50,40,.12)); border-radius: 14px; box-shadow: 0 1px 2px rgba(74,52,30,.05); min-width: 0; }
.tok-card-top { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
.tok-ico { flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); }
.tok-ico svg { width: 18px; height: 18px; }
.tok-name { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.tok-name strong { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tok-prefix-line { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-3); }
.tok-prefix-line code { font-size: 11.5px; }
.tok-meta { margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 10px 0 0; border-top: 1px solid var(--border-2); }
.tok-meta div { min-width: 0; }
.tok-meta dt { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); }
.tok-meta dd { margin: 2px 0 0; font-size: 12.5px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tok-acts { display: flex; gap: 8px; margin-top: auto; }
.tok-acts form { margin: 0; }
.btn.tok-btn { display: inline-flex; align-items: center; gap: 6px; height: 30px !important; min-height: 30px !important; padding: 0 11px; font-size: 12.5px; line-height: 1; }
.btn.tok-btn svg { width: 14px; height: 14px; flex: none; }
.btn.tok-btn.is-danger { color: var(--danger-fg, #b42332); }
.btn.tok-btn.is-danger:hover { background: rgba(242,85,106,.08); }
.tok-add { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin: 14px 0 0; padding: 16px; border: 1.5px dashed rgba(74,52,30,.22); border-radius: 14px; background: transparent; color: var(--text-2); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; transition: border-color .15s ease, color .15s ease, background .15s ease; }
.tok-add svg { width: 16px; height: 16px; }
.tok-add:hover, .tok-add:focus-visible { border-color: var(--success, #1aa971); color: #137a52; background: rgba(26,169,113,.05); outline: none; }
#panel-tokens > .card.mt-4 { margin-top: 26px !important; }
@media (max-width: 720px) {
  .tok-grid { grid-template-columns: 1fr; }
  .tok-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Person card: Company runs full width; the OTHER people at the company sit in
   a small box beneath it (operator, 2026-11-13). The top person is not repeated. */
.fit-co .cand-split { grid-template-columns: minmax(0, 1fr); }
.co-others { margin: 0 22px 16px; padding: 12px 14px; border: 1px solid var(--border-2, var(--border)); border-radius: 10px; background: var(--surface-2); }
.co-others .cand-pane-title { margin-bottom: 6px; }
.co-others-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.co-other { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 4px 14px; align-items: baseline; padding: 8px 0; border-top: 1px solid var(--border-2, var(--border)); }
.co-other:first-child { border-top: 0; padding-top: 2px; }
.co-other-who { min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.co-other-who strong { font-size: 13px; }
.co-other-title { font-size: 12px; color: var(--text-3); }
.co-other-how { min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; color: var(--text-2); }
.co-other-how a { color: inherit; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cand-drawer .co-others { margin: 0 16px 14px; }
@media (max-width: 700px) { .co-other { grid-template-columns: minmax(0, 1fr); } .co-others { margin: 0 14px 14px; } }

/* Outreach rows: a small vertical divider left of the action (operator, 2026-11-13). */
.af-row .af-div { flex: none; width: 1px; height: 18px; margin: 0 6px; background: var(--border); }

/* Tokens: the whole area sits in one proper card (operator, 2026-11-13). */
.tok-wrap { margin-bottom: 16px; }
.tok-wrap > .tok-head { margin: 0; align-items: center; }
.tok-wrap > .tok-body { padding: 16px; }

/* Compact log tables (Usage → outside calls): one line per row, every row the
   same short height, long values cut with an ellipsis (full text on hover). */
@media (min-width: 721px) {
  .tbl.tbl-compact th, .tbl.tbl-compact td { padding-top: 5px !important; padding-bottom: 5px !important; white-space: nowrap; line-height: 1.35; vertical-align: middle; }
  .tbl.tbl-compact td { max-width: 320px; overflow: hidden; text-overflow: ellipsis; font-size: 12.5px; }
  .tbl.tbl-compact td code { font-size: 11.5px; }
  .tbl.tbl-compact .pill { padding-top: 1px; padding-bottom: 1px; font-size: 10.5px; }
  .tbl.tbl-compact tbody tr { height: 32px; }
}

/* ── Job A (2026-11-13): Automation page polish ─────────────────────────── */
/* Section counts: "(52)" snug to the title, the My Board count style. */
.af2-panel-head h3 { gap: 6px; align-items: baseline; }
.af2-panel-head h3 .af2-count { background: none; padding: 0; border-radius: 0; font-size: 14px; font-weight: 600; color: var(--text-3); }
/* Board view column counts read the same way: "(N)" next to the title. */
.ab-col-head .ab-col-n { margin-left: 0; min-width: 0; height: auto; padding: 0; background: none !important; color: var(--text-3) !important; font-size: 12px; border-radius: 0; display: inline; }
.ab-col-head .ab-col-n::before { content: "("; }
.ab-col-head .ab-col-n::after  { content: ")"; }
.ab-col.is-folded .ab-col-n::before, .ab-col.is-folded .ab-col-n::after { content: ""; }
/* Getting ready: a real card header with a divider under it. */
.af2-flow-head { margin: -14px -14px 10px; padding: 12px 14px; border-bottom: 1px solid var(--border-2); }
.af2-flow-head h3 { margin: 0; font-size: 14px; font-weight: 700; color: var(--text); }
/* Bulk-selection bars: an elevated grey strip that sits above the list, with
   Select all exactly in the row checkbox column (rows: 6px pad + 6px label). */
.af-bulk, .af-bulk2 {
  position: sticky; top: 0; z-index: 3;
  margin: 0 0 8px; padding: 8px 14px 8px 5px;
  background: #f1f0ec; border: 1px solid rgba(74,52,30,.12); border-radius: 10px;
  box-shadow: 0 2px 8px rgba(74,52,30,.08);
}
.af-bulk .af-check span, .af-bulk2 .af-check span { font-weight: 600; }

/* ── Job A (2026-11-13): pop-ups and drawers are plain white ───────────────
   No grey sheet behind content. Cards inside separate with borders, not a
   grey backdrop. (TribeShores' dark pop-ups stay dark on purpose.) */
.drawer, .drawer.drawer-side.cand-drawer, .drawer.status-modal { background: #fff; }
.drawer-head, .drawer-foot { background: #fff; }
#addPersonDrawer .drawer-body, #addPersonDrawer .drawer-foot { background: #fff; }
.drawer .card, .drawer .rail-card, .drawer .fit-card { background: #fff; border: 1px solid rgba(74,52,30,.12); box-shadow: none; }
.drawer.cand-drawer .hx-item { background: #fff !important; border: 1px solid rgba(74,52,30,.12); }
dialog:not(.mc-dialog) { background: #fff; color: var(--text); border-color: rgba(74,52,30,.14); backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: 0 24px 70px rgba(40,28,14,.28); }
dialog .dlg-head, dialog .dlg-foot { background: #fff; }
.tc-confirm-box { background: #fff; }
/* The next-step bar sits flush in the panel (rows have no side gutter), so it
   is a full-width strip: 6px pad + 6px label = the row checkbox column. */
.af-bulk2 { border-left: 0; border-right: 0; border-radius: 0; padding-left: 6px; }
.drawer .co-others { background: #fff; }

/* ── Job B (2026-11-13) ─────────────────────────────────────────────────── */
/* Counts beside a title read "(N)", snug against it - the My Board column
   count pattern (.pb-col-head .pb-col-n). Opt in with .is-paren. */
.hd-count.is-paren { margin-left: 3px; font-weight: 500; color: var(--text-3); background: none; padding: 0; }
.hd-count.is-paren::before { content: "("; }
.hd-count.is-paren::after  { content: ")"; }
/* Tribe page tab strip: counts as "(N)" text, not chips. */
[data-ctabs="tribeTabs"] .tab .tab-count, [data-ctabs="tribeTabs"] .tab.tab-active .tab-count, [data-ctabs="tribeTabs"] .tab:hover .tab-count {
  display: inline !important; min-width: 0; height: auto; padding: 0 !important; margin-left: 3px !important;
  background: none !important; color: var(--text-3) !important; font-size: inherit; font-weight: 500; border-radius: 0;
}
[data-ctabs="tribeTabs"] .tab .tab-count::before { content: "("; }
[data-ctabs="tribeTabs"] .tab .tab-count::after  { content: ")"; }

/* Tribe Automation tab: one switch. */
.ta2-one { display: flex; align-items: center; gap: 16px; margin: 4px 20px 0; padding: 16px 0; border-top: 1px solid var(--border-2); }
.ta2-one .ap-switch { flex: none; }
.ta2-one .ap-switch:disabled { opacity: .5; cursor: not-allowed; }
.ta2-mixed { margin-top: 4px; font-size: 12px !important; color: var(--warning-fg, #8a5a00) !important; }
.ta2-facts { list-style: none; margin: 0; padding: 12px 20px 16px; border-top: 1px solid var(--border-2); display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--text-2); }
.ta2-facts strong { color: var(--text); font-weight: 600; }
.ta2-facts a { font-weight: 600; }

/* Settings family: the Back pill sits above the page header with room under it. */
.main .set-back { margin: 0 0 14px; text-decoration: none; }

/* "Also at <company>": no shaded box - just a divider line above, sitting in
   the card like the Company section (operator, 2026-11-13). */
.co-others { margin: 0 !important; padding: 14px 22px 16px !important; border: 0 !important; border-top: 1px solid var(--border-2, var(--border)) !important; border-radius: 0 !important; background: transparent !important; }
.cand-drawer .co-others { padding: 12px 16px 14px !important; }
@media (max-width: 700px) { .co-others { padding: 12px 14px 14px !important; } }
/* Correction (operator, 2026-11-13): only POP-UPS go white. Slide-out drawers
   keep their darker sheet; restore the drawer values the block above changed.
   The status pop-up (.drawer.status-modal) is a pop-up, so it stays white. */
.drawer, .drawer.drawer-side.cand-drawer { background: #f4f3f0; }
.drawer-head { background: #fefefd; }
.drawer-foot { background: transparent; }
#addPersonDrawer .drawer-body { background: #f4f3f0; }
#addPersonDrawer .drawer-foot { background: #fefefd; }
.drawer .card, .drawer .rail-card, .drawer .fit-card { box-shadow: 0 1px 2px rgba(74,52,30,.05); }
.drawer.cand-drawer .hx-item { background: rgba(255,255,255,.55) !important; border: 0; }
.drawer .co-others { background: var(--surface-2); }
.drawer.status-modal, .drawer.status-modal .drawer-head, .drawer.status-modal .drawer-body { background: #fff; }
.drawer.cand-drawer .hx-item { border: 1px solid var(--border-2); }

/* "Also at <company>": each person in a simple outlined card (operator, 2026-11-13). */
.co-others-list { display: grid !important; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.co-other, .co-other:first-child { display: flex !important; flex-direction: column; gap: 4px; padding: 10px 12px !important; border: 1px solid var(--border-2, var(--border)) !important; border-radius: 10px; background: #fff; min-width: 0; }
.co-other-how { gap: 1px; }

/* ── Job A (2026-11-13): Automation page quick links + default panels ───── */
.or-quick { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.or-quick-link { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px; border: 1px solid rgba(74,52,30,.18); border-radius: 9px; background: #fff; color: var(--text); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; box-shadow: 0 1px 2px rgba(74,52,30,.05); }
.or-quick-link svg { width: 16px; height: 16px; color: var(--text-3); }
.or-quick-link:hover { border-color: rgba(74,52,30,.32); background: #fbfaf8; }
.or-quick-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.drawer.or-drawer { width: min(640px, 96vw); }
.or-drawer .drawer-body { display: flex; flex-direction: column; gap: 12px; }
.or-drawer .es-card { max-width: none; margin: 0; }
.or-drawer .es-card input[type=email], .or-drawer .es-card input[type=text], .or-drawer .es-card textarea { background: #fff !important; border: 1px solid rgba(74,52,30,.18) !important; border-radius: 8px !important; color: var(--text) !important; }
.or-drawer .es-card textarea { padding: 8px 10px; }
.or-drawer .page-sub { display: none; }
.or-panel-cur { display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; border: 1px solid rgba(74,52,30,.12); border-radius: 12px; background: #fff; }
.or-panel-cur strong { font-size: 14px; color: var(--text); }
.or-panel-miss { color: #a92a3d !important; }
.or-panel-link { font-size: 12.5px; color: var(--accent); }
.or-panel-note { margin-top: 6px; font-size: 12px; color: #93630a; }
.or-panel-acts { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; padding-top: 12px; border-top: 1px solid rgba(74,52,30,.09); }
.or-ap-approve { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid rgba(74,52,30,.12); border-radius: 12px; background: #fff; margin: 0; }
.or-ap-approve strong { font-size: 13.5px; }
.or-ap-tune { display: flex; flex-direction: column; padding: 4px 14px 12px; border: 1px solid rgba(74,52,30,.12); border-radius: 12px; background: #fff; margin: 0; }
.or-ap-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid rgba(74,52,30,.08); cursor: default; }
.or-ap-l { font-size: 13px; color: var(--text-2); font-weight: 600; }
.or-ap-c { display: inline-flex; align-items: center; gap: 8px; flex: none; }
.or-ap-c .input { width: 78px !important; height: 32px; text-align: right; background: #fff; border: 1px solid rgba(74,52,30,.18); color: var(--text); }
.or-ap-u { font-size: 12px; color: var(--text-3); min-width: 92px; }
@media (max-width: 560px) { .or-ap-row { flex-direction: column; align-items: flex-start; gap: 6px; } .or-ap-u { min-width: 0; } }

/* Tribes grid (operator, 2026-11-13): the uploaded tribe images are ~16:10
   landscape, so a square frame cut their sides off. Frame them 16:10, and give
   the tribe name more weight. */
.tribe-grid .tribe-tile .tt-img { aspect-ratio: 16 / 10 !important; height: auto !important; background-size: cover; background-position: center; }
.tribe-grid .tribe-tile h4 { font-size: 17px; font-weight: 700; letter-spacing: -0.015em; margin-bottom: 6px; }

/* ── Automation strip (/outreach top, operator 2026-11-13) ─────────────────
   One slim row of cards: Default email · Default event · Autopilot settings ·
   Autopilot (switch + today's sends). */
.ac-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 1.35fr); gap: 10px; margin: 0 0 14px; }
.ac-card { display: flex; align-items: center; gap: 11px; min-width: 0; padding: 10px 14px; border: 1px solid var(--card-line, var(--border)); border-radius: 12px; background: #fff; color: inherit; font: inherit; text-align: left; box-shadow: 0 1px 2px rgba(60,50,40,.04); }
button.ac-card { cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease; }
button.ac-card:hover, button.ac-card:focus-visible { border-color: rgba(74,52,30,.28); box-shadow: 0 3px 10px rgba(60,50,40,.08); outline: none; }
.ac-ic { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--surface-2); color: var(--text-2); }
.ac-ic svg { width: 17px; height: 17px; }
.ac-txt { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.ac-lbl { display: inline-flex; align-items: center; gap: 6px; font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); }
.ac-val { font-size: 13.5px; font-weight: 650; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-val.is-miss { color: #b42332; }
.ac-sub { font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-pilot { gap: 14px; }
.ac-pilot .ac-txt { flex: none; }
.ac-dot { width: 8px; height: 8px; border-radius: 50%; background: #b9b4ab; }
.ac-pilot.is-on { border-color: rgba(26,169,113,.35); }
.ac-pilot.is-on .ac-dot { background: var(--success); box-shadow: 0 0 0 3px rgba(26,169,113,.18); }
.ac-pilot.is-on .ac-val { color: #0e7a4f; }
.ac-meter { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.ac-meter-n { font-size: 11.5px; color: var(--text-3); white-space: nowrap; text-align: right; }
.ac-meter-n strong { color: var(--text); font-weight: 700; }
.ac-bar { display: block; height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.ac-bar span { display: block; height: 100%; border-radius: inherit; background: #b9b4ab; transition: width .3s ease; }
.ac-pilot.is-on .ac-bar span { background: var(--success); }
.ac-toggle { margin: 0; flex: none; }
.ac-warn { margin: -4px 0 14px; }
@media (max-width: 1100px) { .ac-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px)  { .ac-strip { grid-template-columns: minmax(0, 1fr); } }

/* Multi-select bar (operator, 2026-11-13): a little inset from the panel edges
   and the top, slimmer padding, no shadow. Select all stays in the row checkbox
   column: 4px margin + 1px border + 1px padding = the rows' 6px. */
.af-bulk { margin: 8px 4px 8px !important; padding: 5px 10px 5px 1px !important; box-shadow: none !important; }
.af-bulk2 { box-shadow: none !important; }

/* Automation strip spacing (operator, 2026-11-13): roomier cards, more air
   between them and the page, and the Autopilot card split into three clear
   zones by vertical dividers: status | today's sends | switch. */
.ac-strip { gap: 14px; margin: 4px 0 20px; }
.ac-card { padding: 14px 18px; gap: 14px; min-height: 72px; }
.ac-txt { gap: 3px; }
.ac-pilot { gap: 0; padding-top: 0; padding-bottom: 0; }
.ac-pilot > .ac-txt { padding: 14px 18px 14px 0; }
.ac-pilot > .ac-meter { align-self: stretch; justify-content: center; padding: 0 18px; border-left: 1px solid rgba(74,52,30,.1); border-right: 1px solid rgba(74,52,30,.1); }
.ac-pilot > .ac-toggle { padding-left: 18px; }
.ac-meter-n { text-align: left; }
@media (max-width: 1100px) { .ac-strip { gap: 12px; } }

/* Every Save button is solid green (operator, 2026-11-13). app.js tags any
   button labelled "Save..." with .is-save, including ones loaded into drawers. */
.btn.is-save, :is(.main, .drawer) .btn.is-save, dialog .btn.is-save { background: var(--success, #1aa971) !important; border-color: var(--success, #1aa971) !important; color: #fff !important; }
.btn.is-save:hover, :is(.main, .drawer) .btn.is-save:hover, dialog .btn.is-save:hover { background: #168459 !important; border-color: #168459 !important; color: #fff !important; }
.btn.is-save:disabled { opacity: .5; }
.ac-pilot > .ac-meter { border-left-color: rgba(74,52,30,.14); border-right-color: rgba(74,52,30,.14); }

/* "Also at <company>": exactly the Company section's spacing (operator, 2026-11-13). */
.co-others, .cand-drawer .co-others { padding: 16px 22px !important; }
.co-others .cand-pane-title { margin-bottom: 10px !important; }

/* ── Usage page (operator, 2026-11-13) ─────────────────────────────────────
   Discovery runs: one line per row, dates never cut off; the table stays a
   table down to phone width and scrolls sideways inside its card if needed. */
.ru-card .card-tight { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.ru-tbl th, .ru-tbl td { white-space: nowrap; }
.ru-tbl td.ru-when { min-width: 170px; }
.ru-tbl td.ru-when .vsep { margin: 0 8px; }
.ru-tbl td.ru-tribe { max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 721px) and (max-width: 1024px) {
  .ru-tbl { display: table !important; width: 100%; }
  .ru-tbl thead { display: table-header-group !important; }
  .ru-tbl tbody { display: table-row-group !important; }
  .ru-tbl tr { display: table-row !important; border: 0 !important; padding: 0 !important; margin: 0 !important; box-shadow: none !important; background: transparent; }
  .ru-tbl th, .ru-tbl td { display: table-cell !important; }
  .ru-tbl td::before { content: none !important; display: none !important; }
}

/* SalesIntel budget: one clean line per reading - label | bar | used / cap. */
.api-split .sib-body { gap: 0; padding-top: 6px; padding-bottom: 6px; }
.api-split .sib-row { display: grid; grid-template-columns: 118px minmax(0, 1fr) 76px; grid-template-areas: 'label track value'; align-items: center; gap: 0 12px; padding: 11px 0; }
.api-split .sib-row + .sib-row { border-top: 1px solid rgba(74,52,30,.08); }
.api-split .sib-label { font-size: 12.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.api-split .sib-track { height: 6px; border-radius: 999px; background: #ecebe7; }
.api-split .sib-track i { border-radius: 999px; min-width: 0; }
.api-split .sib-val { text-align: right; font-size: 12.5px; }
.api-split .sib-note { padding-top: 10px; border-top: 1px solid rgba(74,52,30,.08); }
/* Usage page tables stay real tables (header + every column) between phone
   and desktop; the global <=1024 card mode is for phones only here. */
@media (min-width: 721px) and (max-width: 1024px) {
  .ru-tbl, .tbl.tbl-compact { display: table !important; width: 100% !important; }
  .ru-tbl thead, .tbl.tbl-compact thead { position: static !important; width: auto !important; height: auto !important; overflow: visible !important; clip: auto !important; display: table-header-group !important; }
  .tbl.tbl-compact tbody { display: table-row-group !important; }
  .tbl.tbl-compact tr { display: table-row !important; border: 0 !important; padding: 0 !important; margin: 0 !important; background: transparent; }
  .ru-tbl th, .ru-tbl td, .tbl.tbl-compact th, .tbl.tbl-compact td { display: table-cell !important; width: auto !important; font-size: 12.5px !important; font-weight: inherit; }
  .ru-tbl td.m-hide, .ru-tbl th.m-hide, .tbl.tbl-compact td.m-hide, .tbl.tbl-compact th.m-hide { display: table-cell !important; }
  .tbl.tbl-compact td::before { content: none !important; display: none !important; }
  .ru-tbl td:first-child, .tbl.tbl-compact td:first-child { font-size: 13px !important; }
  .ru-card .card-tight, .tbl.tbl-compact { overflow-x: auto; }
}
@media (min-width: 721px) and (max-width: 1024px) {
  .ru-tbl td.num, .ru-tbl th.num, .tbl.tbl-compact td.num, .tbl.tbl-compact th.num { text-align: right !important; }
}

/* Users list: the email line never truncates mid-address. */
.ucell-email { white-space: nowrap; }

/* Person header (page + slide-out): title | company sit closer, and the Fit
   tag is lighter and snug to the name (operator, 2026-11-13). */
.cand-hero-sub { gap: 0 !important; }
.cand-hero-sub .vsep { margin: 0 7px !important; }
.page-title .fit-badge { font-weight: 550 !important; margin-left: 5px !important; }

/* ── Automation strip = ONE compact card (operator, 2026-11-13: "combine
   those together ... why is it so large") ─────────────────────────────────
   The four sections sit side by side inside one card, split by vertical
   dividers, with slimmer padding. */
.ac-strip { gap: 0 !important; margin: 0 0 16px !important; background: #fff; border: 1px solid var(--card-line, var(--border)); border-radius: 12px; overflow: hidden; box-shadow: 0 1px 2px rgba(60,50,40,.04); }
.ac-strip > .ac-card { border: 0 !important; border-radius: 0 !important; box-shadow: none !important; background: transparent; min-height: 0 !important; padding: 10px 16px !important; gap: 10px !important; }
.ac-strip > .ac-card + .ac-card { border-left: 1px solid rgba(74,52,30,.1) !important; }
.ac-strip > button.ac-card:hover, .ac-strip > button.ac-card:focus-visible { background: #faf9f6; box-shadow: none !important; }
.ac-strip .ac-ic { width: 28px; height: 28px; border-radius: 8px; }
.ac-strip .ac-ic svg { width: 15px; height: 15px; }
.ac-strip .ac-lbl { font-size: 10px; }
.ac-strip .ac-val { font-size: 13px; }
.ac-strip .ac-sub { font-size: 11px; }
.ac-strip > .ac-pilot { padding-top: 0 !important; padding-bottom: 0 !important; }
.ac-strip > .ac-pilot > .ac-txt { padding: 10px 14px 10px 0; }
.ac-strip > .ac-pilot > .ac-meter { padding: 0 14px; }
.ac-strip > .ac-pilot > .ac-toggle { padding-left: 14px; }
.ac-pilot.is-on { border-color: transparent; }
@media (max-width: 1100px) {
  .ac-strip > .ac-card:nth-child(3) { border-left: 0 !important; }
  .ac-strip > .ac-card:nth-child(n+3) { border-top: 1px solid rgba(74,52,30,.1); }
}
@media (max-width: 600px) {
  .ac-strip > .ac-card + .ac-card { border-left: 0 !important; border-top: 1px solid rgba(74,52,30,.1); }
}

/* Performance - "Who needs what next" as a light, organised list
   (operator, 2026-11-13: no dark tiles). */
.cv-next { padding: 0 !important; overflow: hidden; }
.cv-next-head { padding: 14px 18px; border-bottom: 1px solid rgba(74,52,30,.1); }
.cv-next-head h3 { margin: 0; font-size: 15px; }
.cv-next-sub { margin: 3px 0 0; font-size: 12.5px; color: var(--text-3); }
.cv-next-list { display: flex; flex-direction: column; }
.cv-next-row { display: grid; grid-template-columns: 64px minmax(0, 1fr) 190px 18px; align-items: center; gap: 14px; padding: 12px 18px; color: inherit; text-decoration: none; background: #fff; transition: background .12s ease; }
.cv-next-row + .cv-next-row { border-top: 1px solid rgba(74,52,30,.07); }
.cv-next-row:hover { background: #faf9f6; }
.cv-next-row.is-open { background: #f6f5f1; box-shadow: inset 3px 0 0 var(--accent); }
.cv-next-n { font-size: 20px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--text); }
.cv-next-txt { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cv-next-l { font-size: 13.5px; font-weight: 650; color: var(--text); }
.cv-next-h { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cv-next-share { display: flex; align-items: center; gap: 10px; }
.cv-next-bar { flex: 1; height: 6px; border-radius: 999px; background: #ecebe7; overflow: hidden; }
.cv-next-bar i { display: block; height: 100%; border-radius: inherit; background: var(--text-3); }
.cv-next-row.is-open .cv-next-bar i { background: var(--accent); }
.cv-next-pct { width: 36px; text-align: right; font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.cv-next-go { width: 16px; height: 16px; color: var(--text-3); }
.cv-next-body:has(> *) { padding: 14px 18px 16px; border-top: 1px solid rgba(74,52,30,.1); }
@media (max-width: 720px) {
  .cv-next-row { grid-template-columns: 48px minmax(0, 1fr) 16px; gap: 10px; padding: 11px 14px; }
  .cv-next-share { display: none; }
  .cv-next-h { white-space: normal; }
  .cv-next-head { padding: 12px 14px; }
}
.cand-status-ic { width: 17px; height: 17px; flex: none; }
.cv-next-body { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.cv-next-body > .tbl { min-width: 0; }

/* Autosave status (operator, 2026-11-13): a small inline "Saving… / Saved ✓ /
   error" beside the section title. Forms marked data-autosave have no Save. */
.as-status { display: inline-flex; align-items: center; margin-left: 10px; font-size: 11.5px; font-weight: 600; letter-spacing: 0; text-transform: none; vertical-align: middle; transition: opacity .4s ease; }
.as-status.is-busy { color: var(--text-3); }
.as-status.is-ok   { color: #0e7a4f; }
.as-status.is-fade { opacity: 0; color: #0e7a4f; }
.as-status.is-err  { color: #b42332; white-space: normal; }
form[data-autosave] [aria-invalid="true"] { border-color: #d6455b !important; box-shadow: 0 0 0 3px rgba(214,69,91,.12) !important; }

/* Cruise Control card: a compact switch that fits the slim card (operator,
   2026-11-13: "the toggle ... is huge"). */
.ac-strip .ap-switch { width: 34px; height: 20px; }
.ac-strip .ap-switch span { top: 2px; left: 2px; width: 14px; height: 14px; }
.ac-strip .ap-switch[aria-checked="true"] span { left: 16px; }

/* ── The held card on Home (operator, 2026-11-13) ────────────────────────────
   .pb-ghost is the live copy that hangs from the pointer and swings (driven by
   JS), .is-landing is its short flight into place, .is-plop the landing bounce. */
.pb-ghost { position: fixed !important; left: 0 !important; top: 0 !important; margin: 0 !important; z-index: 9999; pointer-events: none;
  cursor: grabbing; will-change: transform; opacity: 1 !important;
  box-shadow: 0 18px 38px rgba(40,28,14,.22), 0 4px 10px rgba(40,28,14,.12) !important; border-style: solid !important; }
.pb-ghost.is-landing { transition: transform .22s cubic-bezier(.3,1.25,.5,1), box-shadow .22s ease; box-shadow: 0 2px 6px rgba(40,28,14,.08) !important; }
/* The spot it left: a soft dashed placeholder. */
.pbc.is-drag { opacity: .28; transform: none; border-style: dashed; box-shadow: none; }
@keyframes pb-plop {
  0%   { transform: scale(.94) translateY(-3px); }
  45%  { transform: scale(1.035) translateY(1px); }
  70%  { transform: scale(.99); }
  100% { transform: scale(1) translateY(0); }
}
.pbc.is-plop { animation: pb-plop .48s cubic-bezier(.3,1.2,.5,1); }
@media (prefers-reduced-motion: reduce) { .pbc.is-plop, .pb-ghost.is-landing { animation: none; transition: none; } }

/* Autosave: the no-JS Save fallbacks stay hidden once autosave is running (some
   wrappers set display:flex, which would beat the hidden attribute). */
[data-autosave-fallback][hidden] { display: none !important; }
.es-autonote { margin: 8px 0 0; font-size: 12px; color: var(--text-3); }
.or-ap-statusrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 6px; }
.or-ap-statusrow .as-status { margin-left: 0; }
.or-email-body .es-card { max-width: none; }

/* ── How it works (/docs + AI → How it works), rebuilt 2026-11-13 ────────────
   One intro card, a step strip, one card per area, a short FAQ. */
.hw { display: flex; flex-direction: column; gap: 16px; }
.hw-card { background: #fff; border: 1px solid var(--card-line, var(--border)); border-radius: 14px; padding: 18px 20px; box-shadow: 0 1px 2px rgba(60,50,40,.04); }
.hw h2 { margin: 0 0 8px; font-size: 15px; font-weight: 700; color: var(--text); }
.hw-intro p { margin: 0; font-size: 14px; line-height: 1.6; color: var(--text-2); max-width: 820px; }
.hw-flow { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; counter-reset: none; }
.hw-step { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 14px 14px 12px; background: #fff; border: 1px solid var(--card-line, var(--border)); border-radius: 12px; min-width: 0; }
.hw-step + .hw-step::before { content: ""; position: absolute; left: -10px; top: 50%; width: 10px; height: 1px; background: rgba(74,52,30,.25); }
.hw-step-ic { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--surface-2); color: var(--text-2); margin-bottom: 4px; }
.hw-step-ic svg, .hw-ic svg { width: 16px; height: 16px; }
.hw-step-n { position: absolute; top: 12px; right: 12px; font-size: 11px; font-weight: 700; color: var(--text-3); }
.hw-step strong { font-size: 13.5px; color: var(--text); }
.hw-step-d { font-size: 12px; line-height: 1.45; color: var(--text-3); }
.hw-step:last-child .hw-step-ic { background: rgba(26,169,113,.12); color: #0e7a4f; }
.hw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.hw-area { display: flex; flex-direction: column; gap: 10px; }
.hw-area-head { display: flex; align-items: center; gap: 10px; }
.hw-area-head h3 { margin: 0; font-size: 14.5px; font-weight: 700; }
.hw-ic { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 9px; background: var(--surface-2); color: var(--text-2); }
.hw-area ul { margin: 0; padding: 0 0 0 16px; display: flex; flex-direction: column; gap: 5px; }
.hw-area li { font-size: 13px; line-height: 1.5; color: var(--text-2); }
.hw-go { margin-top: auto; align-self: flex-start; font-size: 12.5px; font-weight: 650; color: var(--text); text-decoration: none; padding-top: 4px; }
.hw-go:hover { color: var(--accent); }
.hw-faq details { border-top: 1px solid rgba(74,52,30,.08); }
.hw-faq details:first-of-type { border-top: 0; }
.hw-faq summary { cursor: pointer; list-style: none; padding: 11px 0; font-size: 13.5px; font-weight: 600; color: var(--text); display: flex; justify-content: space-between; gap: 12px; }
.hw-faq summary::-webkit-details-marker { display: none; }
.hw-faq summary::after { content: "+"; color: var(--text-3); font-weight: 500; }
.hw-faq details[open] summary::after { content: "−"; }
.hw-faq details p { margin: 0 0 12px; font-size: 13px; line-height: 1.55; color: var(--text-2); max-width: 760px; }
@media (max-width: 1200px) { .hw-flow { grid-template-columns: repeat(4, minmax(0, 1fr)); } .hw-step + .hw-step::before { display: none; } }
@media (max-width: 600px) {
  .hw-flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hw-grid { grid-template-columns: minmax(0, 1fr); }
  .hw-card { padding: 16px; }
}

/* ── P3 consistency pass (2026-11-13) ──────────────────────────────────── */
/* Fields: a very light grey fill so they read against white cards; white with
   an accent ring on focus. Main content, drawers, dialogs, login. */
:is(.main, .drawer, dialog, .tc-confirm-box, .pb-choose-box, .login-card) :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=file]):not([type=submit]):not([type=button]):not([type=hidden]):not([type=image]), select, textarea) {
  background-color: #F7F7F8 !important; border-color: rgba(74,52,30,.16);
}
:is(.main, .drawer, dialog, .tc-confirm-box, .pb-choose-box, .login-card) :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=file]):not([type=submit]):not([type=button]):not([type=hidden]):not([type=image]), select, textarea):focus {
  background-color: #fff !important; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
/* Cruise Control strip: no small titles; the Autopilot value carries its dot. */
.ac-strip .ac-val { display: flex; align-items: center; gap: 6px; }
/* Person rows: verified state, a divider, then the status chip. */
.row-verify { flex: none; display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; white-space: nowrap; color: var(--text-3); }
.row-verify svg { width: 14px; height: 14px; }
.row-verify.is-ok { color: #0e7a4f; }
.row-verify.is-warn { color: #8a5a00; }
.row-verify.is-bad { color: #b42332; }
.af-person .row-vsep { flex: none; height: 14px; margin: 0 2px; }
@media (max-width: 720px) { .row-verify { font-size: 0; gap: 0; } .row-verify svg { width: 15px; height: 15px; } }
/* Tribe → Categories: the same card pattern as every other data card -
   title row, then the table as its own inset bordered block. */
.main .cat-simple > .cdt-wrap { margin: 2px 16px 16px; border: 1px solid var(--card-line, rgba(60,50,40,.12)); border-radius: 12px; overflow: auto; }
.main .cat-simple > .cdt-wrap .cdt { margin: 0; }
.main .cat-simple > .cc-empty { margin: 0 16px 16px; }
@media (max-width: 1024px) { .main .cat-simple > .cdt-wrap { margin: 2px 12px 12px; } }
.main .cat-simple > .cat-simple-head { border-bottom: 0; padding-bottom: 12px; }

/* ── AI → Tokens: a plain section, not a card in a card (2026-11-13) ──────── */
.tok-sec { margin: 0 0 22px; }
.tok-sec > .tok-head { margin: 0 0 14px; align-items: center; }
.tok-sec .tok-head h3 { font-size: 16px; }

/* ── AI → Usage, by provider (2026-11-13) ─────────────────────────────────── */
.up-of { font-size: .55em; font-weight: 600; color: var(--text-3); }
.up-bad { color: var(--danger-fg, #b42332) !important; }
.up-si-body { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 22px; }
.up-si-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border: 1px solid var(--border-2, var(--border)); border-radius: 10px; overflow: hidden; align-self: start; }
.up-fact { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; min-width: 0; }
.up-fact:nth-child(n+4) { border-top: 1px solid var(--border-2, var(--border)); }
.up-fact:not(:nth-child(3n+1)) { border-left: 1px solid var(--border-2, var(--border)); }
.up-fact span { font-size: 11px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.up-fact strong { font-size: 17px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.up-detail-h { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); margin: 0 0 8px; }
.up-more { border-top: 1px solid var(--border-2, var(--border)); }
.up-more > summary { cursor: pointer; padding: 11px 18px; font-size: 13px; font-weight: 600; color: var(--text-2); list-style: none; }
.up-more > summary::-webkit-details-marker { display: none; }
.up-more > summary::before { content: "+ "; color: var(--text-3); }
.up-more[open] > summary::before { content: "− "; }
.up-more > .up-detail-grid { padding: 0 18px 16px; }
.up-detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 18px; }
.up-mini code { font-size: 11.5px; }
.up-res { font-size: 11.5px; font-weight: 600; color: #0e7a4f; }
.up-res.is-bad { color: var(--danger-fg, #b42332); }

.up-rows { display: flex; flex-direction: column; }
.up-row { display: grid; grid-template-columns: minmax(150px, 1.4fr) minmax(120px, 1fr) 70px 70px minmax(120px, .9fr) 130px; align-items: center; gap: 12px; padding: 10px 18px; font-size: 13px; min-height: 46px; }
.up-row .num { text-align: right; font-variant-numeric: tabular-nums; }
.up-row-head { min-height: 0; padding-top: 9px; padding-bottom: 9px; font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); background: #faf9f6; border-bottom: 1px solid var(--border-2, var(--border)); }
.up-prov + .up-prov { border-top: 1px solid var(--border-2, var(--border)); }
.up-prov > summary { cursor: pointer; list-style: none; }
.up-prov > summary::-webkit-details-marker { display: none; }
.up-prov > summary:hover { background: #faf9f6; }
.up-pname { display: inline-flex; align-items: center; gap: 8px; font-weight: 650; color: var(--text); min-width: 0; }
.up-chev { width: 14px; height: 14px; flex: none; color: var(--text-3); transition: transform .15s ease; }
.up-prov[open] .up-chev { transform: rotate(90deg); }
.up-sub { color: var(--text-3); font-size: 11.5px; }
.up-last { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12.5px; }
.up-trend { color: #6b8db5; }
.up-spark { display: block; width: 100%; height: 26px; }
.up-prov-body { padding: 4px 18px 16px; background: #fcfbf9; border-top: 1px dashed var(--border-2, var(--border)); }
@media (max-width: 1024px) {
  .up-si-body { grid-template-columns: minmax(0, 1fr); }
  .up-row { grid-template-columns: minmax(130px, 1.3fr) minmax(100px, 1fr) 60px minmax(0, .9fr); }
  .up-row > :nth-child(4), .up-row > .up-trend, .up-row-head > :nth-child(6) { display: none; }
}
@media (max-width: 720px) {
  .up-si-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .up-fact:nth-child(n) { border-left: 0; border-top: 0; }
  .up-fact:nth-child(n+3) { border-top: 1px solid var(--border-2, var(--border)); }
  .up-fact:nth-child(2n) { border-left: 1px solid var(--border-2, var(--border)); }
  .up-detail-grid { grid-template-columns: minmax(0, 1fr); }
  .up-row { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; padding: 10px 14px; }
  .up-row-head { display: none; }
  .up-row > .up-last, .up-row > :nth-child(3) { display: none; }
  .up-sub { display: none; }
}
.up-si-caps .sib-row { display: grid !important; grid-template-columns: 130px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 9px 0; }
.up-si-caps .sib-row + .sib-row { border-top: 1px solid rgba(74,52,30,.07); }
.up-si-caps .sib-label { font-size: 12.5px; color: var(--text-2); white-space: nowrap; }
.up-si-caps .sib-track { display: block; height: 6px; border-radius: 999px; background: #ecebe7 !important; overflow: hidden; }
.up-si-caps .sib-track i { display: block; height: 100%; border-radius: inherit; background: #6b8db5; }
.up-si-caps .sib-track.is-warm i { background: #d99a2b; }
.up-si-caps .sib-track.is-hot i { background: #d2453d; }
.up-si-caps .sib-val { font-size: 12.5px; color: var(--text-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.up-si-caps .sib-val strong { color: var(--text); }
.up-si-caps .sib-note { margin-top: 8px; }
.up-si-caps .sib-row { grid-template-areas: none !important; grid-template-columns: 130px minmax(0, 1fr) auto !important; }
.up-si-caps .sib-row > * { grid-area: auto !important; }

/* ── Conversion: the journey (operator, 2026-11-13: "a graph that really goes
   through things and dives deep ... whoa, this is clean") ──────────────────
   Steel-blue series, accent orange only for the selected step. */
.jr-card { padding: 0 !important; overflow: hidden; margin: 0 0 20px; }
.jr-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 16px 20px; border-bottom: 1px solid rgba(74,52,30,.1); }
.jr-head h3 { margin: 0; font-size: 15px; }
.jr-sub { margin: 4px 0 0; font-size: 13px; line-height: 1.5; color: var(--text-3); max-width: 780px; }
.jr-sub strong { color: var(--text); }
.jr-total { flex: none; display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; }
.jr-total strong { font-size: 22px; font-weight: 700; color: var(--text); }
.jr-total span { font-size: 11.5px; color: var(--text-3); }
.jr-chart { padding: 14px 16px 4px; }
.jr-svg { display: block; width: 100%; height: auto; }
.jr-flow { fill: #3f6c9e; opacity: .13; }
.jr-hit { fill: transparent; }
.jr-stage { cursor: pointer; outline: none; }
.jr-bar { fill: #3f6c9e; transition: fill .15s ease; }
.jr-stage:hover .jr-bar, .jr-stage:focus-visible .jr-bar { fill: #2f5583; }
.jr-stage.is-sel .jr-bar { fill: var(--accent, #ff5b1f); }
.jr-stage:hover .jr-hit, .jr-stage.is-sel .jr-hit { fill: rgba(63,108,158,.045); }
.jr-lbl { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; fill: #8b8379; }
.jr-stage.is-sel .jr-lbl { fill: var(--accent, #ff5b1f); }
.jr-num { font-size: 22px; font-weight: 700; fill: #27221d; }
.jr-pct { font-size: 15px; font-weight: 700; fill: #3f6c9e; }
.jr-pct-l { font-size: 11px; fill: #8b8379; }
.jr-drop { font-size: 11px; fill: #b4532a; }
.jr-list { display: none; }
.jr-exits { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 6px 20px 16px; }
.jr-exits-l { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); margin-right: 4px; }
.jr-exit { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px; border: 1px solid rgba(74,52,30,.14); border-radius: 999px; background: #fff; font: inherit; font-size: 12.5px; color: var(--text-2); cursor: pointer; }
.jr-exit strong { color: var(--text); }
.jr-exit:hover { border-color: rgba(74,52,30,.3); }
.jr-exit.is-sel { border-color: var(--accent, #ff5b1f); color: var(--accent, #ff5b1f); }
.jr-exit:disabled { opacity: .45; cursor: default; }
.jr-detail { border-top: 1px solid rgba(74,52,30,.1); padding: 16px 20px 20px; background: #fcfbf9; }
.jr-dh h4 { margin: 0; font-size: 15px; }
.jr-dh p { margin: 3px 0 14px; font-size: 13px; color: var(--text-2); }
.jr-dgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.jr-box { background: #fff; border: 1px solid rgba(74,52,30,.1); border-radius: 12px; padding: 12px 14px; min-width: 0; }
.jr-box-h { margin: 0 0 8px; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); }
.jr-brow { display: grid; grid-template-columns: minmax(0, 9em) minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 4px 0; font-size: 12.5px; }
.jr-bl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.jr-btrack { height: 8px; border-radius: 999px; background: rgba(63,108,158,.1); overflow: hidden; }
.jr-btrack i { display: block; height: 100%; border-radius: inherit; background: #3f6c9e; }
.jr-bv { color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.jr-none { margin: 4px 0; font-size: 12.5px; color: var(--text-3); }
.jr-people { background: #fff; border: 1px solid rgba(74,52,30,.1); border-radius: 12px; overflow: hidden; }
.jr-ph, .jr-pr { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, .8fr); gap: 12px; align-items: center; padding: 0 14px; }
.jr-ph { height: 32px; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); background: #faf9f6; border-bottom: 1px solid rgba(74,52,30,.08); }
.jr-pr { width: 100%; min-height: 44px; border: 0; border-bottom: 1px solid rgba(74,52,30,.06); background: #fff; font: inherit; text-align: left; color: inherit; cursor: pointer; }
.jr-pr:hover { background: #faf9f6; }
.jr-pw { display: flex; flex-direction: column; min-width: 0; }
.jr-pw strong, .jr-pw small, .jr-pt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jr-pw strong { font-size: 13px; font-weight: 600; }
.jr-pw small { font-size: 11.5px; color: var(--text-3); }
.jr-pt { font-size: 12.5px; color: var(--text-2); }
.jr-ps { justify-self: start; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: rgba(63,108,158,.12); color: #2f5583; white-space: nowrap; }
.jr-ps.is-left { background: rgba(180,83,42,.1); color: #9a4522; }
.jr-ps.is-member { background: rgba(26,169,113,.13); color: #0e7a4f; }
.jr-pd { font-size: 12.5px; color: var(--text-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.jr-more { display: block; margin: 8px auto; }
@media (max-width: 700px) {
  .jr-svg { display: none; }
  .jr-list { display: flex; flex-direction: column; gap: 2px; }
  .jr-li { display: grid; grid-template-columns: 6.5em minmax(0, 1fr) auto; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 6px 8px; border: 0; border-radius: 8px; background: transparent; font: inherit; text-align: left; color: inherit; cursor: pointer; }
  .jr-li.is-sel { background: rgba(255,91,31,.07); }
  .jr-li-l { font-size: 12.5px; font-weight: 600; }
  .jr-li-bar { height: 10px; border-radius: 999px; background: rgba(63,108,158,.1); overflow: hidden; }
  .jr-li-bar i { display: block; height: 100%; border-radius: inherit; background: #3f6c9e; }
  .jr-li.is-sel .jr-li-bar i { background: var(--accent, #ff5b1f); }
  .jr-li-n { display: flex; align-items: baseline; gap: 6px; font-variant-numeric: tabular-nums; }
  .jr-li-n strong { font-size: 13.5px; }
  .jr-li-n em { font-style: normal; font-size: 11.5px; color: #3f6c9e; }
  .jr-head { padding: 14px; }
  .jr-chart { padding: 10px 8px 4px; }
  .jr-exits { padding: 6px 14px 14px; }
  .jr-detail { padding: 14px; }
  .jr-dgrid { grid-template-columns: minmax(0, 1fr); }
  .jr-ph { display: none; }
  .jr-pr { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "w s" "t d"; row-gap: 2px; padding: 8px 12px; }
  .jr-pw { grid-area: w; } .jr-ps { grid-area: s; justify-self: end; } .jr-pt { grid-area: t; } .jr-pd { grid-area: d; justify-self: end; }
}
/* How it works: each card opens with what the area is for (2026-11-13). */
.hw .hw-for { margin: 2px 0 8px; font-size: 13.5px; font-weight: 600; color: var(--text); line-height: 1.4; }
.jr-more[hidden] { display: none !important; }
@media (max-width: 700px) { .jr-li { grid-template-columns: 6.5em minmax(0, 1fr) 5.6em; } .jr-li-n { justify-content: flex-end; } }
/* Counts beside titles and in every tab strip read "(N)" - one look site-wide
   (P3 consistency pass; the tribe strip already did this). */
.tabs .tab .tab-count, .tabs .tab.tab-active .tab-count, .tabs .tab:hover .tab-count,
.main .tabs .tab .tab-count, .drawer .tabs .tab .tab-count {
  display: inline !important; min-width: 0; height: auto; padding: 0 !important; margin-left: 3px !important;
  background: none !important; color: var(--text-3) !important; font-size: inherit; font-weight: 500; border-radius: 0; box-shadow: none !important;
}
.tabs .tab .tab-count::before { content: "("; }
.tabs .tab .tab-count::after  { content: ")"; }
/* Cruise Control strip: value + subline read as one unit; Autopilot is one
   compact card (switch inline with its status, small bar under it). */
.ac-strip .ac-txt { gap: 1px !important; }
.ac-strip .ac-val { line-height: 1.25; }
.ac-strip .ac-sub { line-height: 1.25; }
.ac-strip > .ac-pilot { padding: 10px 16px !important; }
.ac-strip > .ac-pilot > .ac-txt { padding: 0 !important; flex: 1; min-width: 0; }
.ac-pilot-row { gap: 6px; }
.ac-pilot-row .ac-toggle { margin: 0 0 0 auto; padding: 0 !important; display: inline-flex; }
.ac-pilot-meter { display: flex !important; align-items: center; gap: 8px; }
.ac-pilot-meter .ac-bar { flex: 1; max-width: 120px; height: 4px; }
.ac-pilot-meter strong { color: var(--text); font-weight: 700; }
/* Person rows: verification as a small round icon badge (tooltip has the words). */
.row-verify { width: 24px; height: 24px; justify-content: center; border-radius: 50%; gap: 0 !important; font-size: 0 !important; }
.row-verify svg { width: 15px !important; height: 15px !important; }
.row-verify.is-ok   { color: #0e7a4f; background: rgba(26,169,113,.12); }
.row-verify.is-warn { color: #8a5a00; background: rgba(227,162,26,.15); }
.row-verify.is-bad  { color: var(--text-3); background: var(--surface-2); }
/* Tribe header: a thin divider between Members and Prospects. */
.tribe-hero-stats { align-items: center; }
.tribe-hero-stats .ths-sep { height: 28px; margin: 0 4px; }

/* AI → Tokens: one card, one row ("bar") per token (operator, 2026-11-13). */
.tok-list { overflow: hidden; }
.tok-list-head { align-items: center; }
.tok-list-head h3 { margin: 0; }
.tok-list-head .meta { margin-top: 3px; }
.tok-row { display: grid; grid-template-columns: 34px minmax(160px, 1.3fr) minmax(0, 2fr) auto; align-items: center; gap: 14px; padding: 12px 18px; border-top: 1px solid var(--border-2, var(--border)); }
.tok-row .tok-ico { width: 34px; height: 34px; border-radius: 9px; }
.tok-row .tok-ico svg { width: 16px; height: 16px; }
.tok-row .tok-meta { border-top: 0; padding: 0; gap: 14px; }
.tok-row .tok-acts { margin-top: 0; justify-content: flex-end; }
.tok-add-row { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 13px 18px; border: 0; border-top: 1px dashed rgba(74,52,30,.18); background: transparent; color: var(--text-2); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; transition: background .15s ease, color .15s ease; }
.tok-add-row svg { width: 16px; height: 16px; }
.tok-add-row:hover, .tok-add-row:focus-visible { background: rgba(26,169,113,.05); color: #137a52; outline: none; }
@media (max-width: 900px) {
  .tok-row { grid-template-columns: 34px minmax(0, 1fr) auto; }
  .tok-row .tok-meta { grid-column: 2 / -1; grid-row: 2; }
}
@media (max-width: 560px) {
  .tok-row { grid-template-columns: 34px minmax(0, 1fr); padding: 12px 14px; }
  .tok-row .tok-meta { grid-column: 1 / -1; grid-row: auto; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tok-row .tok-acts { grid-column: 1 / -1; justify-content: flex-start; }
}
/* Tribe → Categories, edited in place (operator, 2026-11-13). */
.cdt-edit { display: inline-block; min-width: 40px; max-width: 100%; padding: 2px 6px; margin: -2px -6px; border-radius: 6px; font-weight: 600; color: var(--text); cursor: text; outline: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.cdt-edit:hover { background: #F7F7F8; box-shadow: inset 0 0 0 1px rgba(74,52,30,.14); }
.cdt-edit:focus { background: #fff; box-shadow: 0 0 0 2px var(--accent); text-overflow: clip; }
.main .cdt-seats input.cdt-seat-in { width: 38px; min-height: 0 !important; height: 24px; padding: 0 4px !important; margin-left: 1px; border-radius: 6px; font: inherit; font-size: 12px; text-align: center; -moz-appearance: textfield; }
.cdt-seat-in::-webkit-outer-spin-button, .cdt-seat-in::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.cdt th.cdt-act, .cdt td.cdt-act { width: 72px; text-align: right; white-space: nowrap; }
.cdt-ibtn { display: inline-grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: 7px; background: transparent; color: var(--text-3); cursor: pointer; }
.cdt-ibtn svg { width: 16px; height: 16px; }
.cdt-ibtn:hover { background: #F2F1EE; color: var(--text); }
.cdt-ibtn.is-danger:hover { background: rgba(214,69,91,.1); color: #b42332; }
.cdt tbody tr .cdt-ibtn { opacity: .45; }
.cdt tbody tr:hover .cdt-ibtn, .cdt-ibtn:focus-visible { opacity: 1; }
.cdt-add { display: flex; align-items: center; gap: 8px; margin: -6px 16px 16px; padding: 8px 12px; border: 1px dashed rgba(74,52,30,.2); border-radius: 10px; }
.cdt-add:focus-within { border-style: solid; border-color: var(--accent); }
.cdt-add-ic { color: var(--text-3); font-weight: 700; }
.main .cdt-add input.cdt-add-in { flex: 1; min-height: 0 !important; height: 28px; padding: 0 !important; border: 0 !important; background: transparent !important; box-shadow: none !important; font: inherit; font-size: 13px; }
.cat-saved { font-size: 12px; color: #0e7a4f; white-space: nowrap; }
.cat-saved.is-bad { color: #b42332; }
@media (max-width: 1024px) { .cdt-add { margin: -2px 12px 12px; } .cdt tbody tr .cdt-ibtn { opacity: 1; } }
/* Usage chart: each provider's line draws itself in on load ("it pops"). */
.up-chart .up-line { stroke-dasharray: 1; stroke-dashoffset: 1; animation: up-draw 1.1s cubic-bezier(.3,.7,.3,1) forwards; }
.up-chart .up-line:nth-of-type(2) { animation-delay: .12s; }
.up-chart .up-line:nth-of-type(3) { animation-delay: .24s; }
.up-chart .up-line:nth-of-type(n+4) { animation-delay: .36s; }
@keyframes up-draw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .up-chart .up-line { animation: none; stroke-dashoffset: 0; } }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
/* Inline seats: plain "N /" then the small box - no chip around an input. */
.cdt th:nth-child(1) { width: 25%; }
.cdt th:nth-child(2) { width: 84px; }
.cdt th:nth-child(7) { width: 70px; }
.main .cdt .cdt-seats { background: none !important; padding: 0 !important; display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; color: var(--text-2); font-variant-numeric: tabular-nums; }
.main .cdt .cdt-seats.is-full { color: #137a52; }
.cdt td.cdt-act { padding-left: 0 !important; padding-right: 8px !important; }
.cdt td.cdt-act .cdt-ibtn + .cdt-ibtn { margin-left: 2px; }
.tok-list-head { display: flex !important; justify-content: space-between !important; gap: 12px 16px; flex-wrap: wrap; }
.tok-list-head .tok-create { margin-left: auto; }

/* ── Conversion cleanup (2026-11-13): every card gets the journey's header
   pattern (title + one muted line, divider under it), content padded inside,
   and a calm two-column grid. Cards with nothing to show are not rendered. */
.cv-page .cv-card { padding: 0 !important; overflow: hidden; margin: 0; }
.cv-page .cv-card > .cv-head { padding: 14px 20px 12px; border-bottom: 1px solid rgba(74,52,30,.1); margin: 0; }
.cv-page .cv-card > .cv-head h3 { margin: 0; font-size: 15px; }
.cv-page .cv-card > .cv-head .cv-say { margin: 4px 0 0; font-size: 13px; line-height: 1.5; color: var(--text-3); max-width: none; }
.cv-page .cv-card > .cv-head .cv-say strong { color: var(--text); }
.cv-page .cv-card > :not(.cv-head) { margin-left: 20px; margin-right: 20px; }
.cv-page .cv-card > .cv-head + * { margin-top: 16px; }
.cv-page .cv-card > :last-child:not(.cv-head) { margin-bottom: 18px; }
.cv-page .cv-results { margin: 0 0 16px; }
.cv-page .cv-results .cv-kpis { margin-bottom: 16px; }
.cv-page .cv-results .cv-kpi { background: #faf9f6; border: 1px solid rgba(74,52,30,.08); box-shadow: none; }
.cv-page .cv-results .cv-kpi-v { font-size: 22px; color: var(--text); }
.cv-page .cv-alert { display: inline-block; margin-left: 4px; }
.cv-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.cv-grid2 > .cv-card:last-child:nth-child(odd) { grid-column: 1 / -1; }
.cv-grid2 .cv-cols { height: 150px; }
@media (max-width: 1024px) { .cv-grid2 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 700px) {
  .cv-page .cv-card > .cv-head { padding: 12px 14px 10px; }
  .cv-page .cv-card > :not(.cv-head) { margin-left: 14px; margin-right: 14px; }
}
.cv-page .cv-results .cv-kpis { grid-template-columns: repeat(6, minmax(0, 1fr)) !important; gap: 8px; }
.cv-page .cv-results .cv-kpi { padding: 10px 12px !important; min-height: 0; }
.cv-page .cv-results .cv-kpi-v { font-size: 20px !important; line-height: 1.15; }
.cv-page .cv-results .cv-kpi-l { font-size: 11.5px; margin-top: 2px; }
@media (max-width: 700px) { .cv-page .cv-results .cv-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; } }
.ac-pilot-row .ac-toggle { margin-left: 8px !important; }
.ac-pilot-meter { margin-top: 3px; }
.cv-page .cv-cols .cv-col, .cv-page .cv-xaxis span { max-width: 36px; }

/* ── Reports, streamlined (2026-11-13): key numbers, then compact cards with
   the same header pattern as the Conversion page (title + one muted line +
   divider), in a calm two-column grid. */
.rpt-page .stat-num { color: var(--text) !important; }
.rpt-page .rpt-of { font-size: 15px; color: var(--text-3); }
.rpt-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; margin: 0 0 16px; }
.rpt-card { padding: 0 !important; overflow: hidden; margin: 0; }
.rpt-head { padding: 14px 20px 12px; border-bottom: 1px solid rgba(74,52,30,.1); }
.rpt-head h3 { margin: 0; font-size: 15px; }
.rpt-head p { margin: 4px 0 0; font-size: 13px; line-height: 1.5; color: var(--text-3); }
.rpt-head-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.rpt-head-row select { width: auto; min-width: 120px; }
.rpt-body { padding: 16px 20px 18px; }
.rpt-none { margin: 0; font-size: 13px; color: var(--text-3); }
.rpt-split-bar { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: rgba(63,108,158,.08); }
.rpt-split-bar span { display: block; height: 100%; }
.rpt-keys { display: flex; flex-direction: column; margin-top: 12px; }
.rpt-key { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto 3.2em; align-items: center; gap: 10px; padding: 7px 0; font-size: 13px; border-top: 1px solid rgba(74,52,30,.06); }
.rpt-key:first-child { border-top: 0; }
.rpt-sw { width: 10px; height: 10px; border-radius: 3px; }
.rpt-key strong { font-variant-numeric: tabular-nums; }
.rpt-key em { font-style: normal; text-align: right; color: var(--text-3); font-variant-numeric: tabular-nums; }
.rpt-link { display: inline-block; margin-top: 12px; font-size: 13px; font-weight: 600; color: #3f6c9e; text-decoration: none; }
.rpt-link:hover { text-decoration: underline; }
.rpt-page .rpt-facts { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; }
.rpt-page .rpt-facts dt, .rpt-page .rpt-facts dd { margin: 0; padding: 7px 0; font-size: 13px; border-top: 1px solid rgba(74,52,30,.06); }
.rpt-page .rpt-facts dt { color: var(--text-2); }
.rpt-page .rpt-facts dd { text-align: right; font-variant-numeric: tabular-nums; }
.rpt-page .rpt-facts dt:first-of-type, .rpt-page .rpt-facts dd:first-of-type { border-top: 0; }
.rpt-trend .rpt-trend-wrap svg { display: block; width: 100%; height: auto; }
.rpt-bar-row { display: grid; grid-template-columns: minmax(0, 10em) minmax(0, 1fr) 2.5em; align-items: center; gap: 10px; padding: 6px 0; font-size: 13px; }
.rpt-bar-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.rpt-bar-t { height: 8px; border-radius: 999px; background: rgba(63,108,158,.1); overflow: hidden; }
.rpt-bar-t i { display: block; height: 100%; border-radius: inherit; background: #3f6c9e; }
.rpt-bar-row strong { text-align: right; font-variant-numeric: tabular-nums; }
.rpt-src { padding: 6px 20px 10px; }
.rpt-src-h, .rpt-src-r { display: grid; grid-template-columns: minmax(0, 1fr) 6em 6em 5em; gap: 10px; align-items: center; }
.rpt-src-h { height: 32px; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); border-bottom: 1px solid rgba(74,52,30,.08); }
.rpt-src-r { height: 36px; font-size: 13px; border-bottom: 1px solid rgba(74,52,30,.06); }
.rpt-src-r:last-child { border-bottom: 0; }
.rpt-src .num { text-align: right; font-variant-numeric: tabular-nums; }
.rpt-src-n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 1024px) { .rpt-grid2 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 700px) {
  .rpt-head { padding: 12px 14px 10px; }
  .rpt-head-row { flex-direction: column; }
  .rpt-body { padding: 14px; }
  .rpt-src { padding: 4px 14px 8px; }
  .rpt-src-h, .rpt-src-r { grid-template-columns: minmax(0, 1fr) 4.5em 4.5em 4em; gap: 6px; }
  .rpt-bar-row { grid-template-columns: minmax(0, 7em) minmax(0, 1fr) 2.5em; }
}
.rpt-src-h, .rpt-src-r { grid-template-columns: minmax(0, 1fr) 7.5em 6.5em 5.5em; }
@media (max-width: 700px) { .rpt-src-h, .rpt-src-r { grid-template-columns: minmax(0, 1fr) 6.2em 5.6em 4.6em; } .rpt-src-h { font-size: 10px; } }
@media (max-width: 700px) {
  .rpt-page .stat-band { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rpt-page .stat-band .stat-cell { padding: 12px 14px !important; border-bottom: 1px solid rgba(74,52,30,.07); }
  .rpt-page .stat-band .stat-cell:nth-child(odd) { border-right: 1px solid rgba(74,52,30,.07); }
  .rpt-page .stat-band .stat-num { font-size: 20px; }
}
/* Settings-style cards (Emails etc.): the section title is a real card header
   with a full-width divider, like every other card. */
.main .es-card > .es-sec:first-child > h3,
.main .es-card > form > .es-sec:first-child > h3 { margin: 0 -18px 12px; padding: 0 18px 12px; border-bottom: 1px solid var(--border-2, rgba(74,52,30,.1)); }
/* Stat tiles everywhere: ink numbers, light border, no heavy shadow ("way too
   many colors"). */
.main .kpi { box-shadow: 0 1px 2px rgba(60,50,40,.04) !important; border: 1px solid var(--card-line, rgba(74,52,30,.12)) !important; }
.main .kpi .value, .main .kpi.accent .value, .main .kpi.purple .value, .main .kpi.success .value { color: var(--text) !important; }
/* Category page: shared person rows, with review actions beside them. */
.cat-cands .cat-cand { display: flex; align-items: center; gap: 10px; padding-right: 14px; border-top: 1px solid var(--border-2, rgba(74,52,30,.08)); }
.cat-cands .cat-cand:first-child { border-top: 0; }
.cat-cands .cat-cand > .af-person { flex: 1; min-width: 0; }
.cat-cand-acts { display: flex; gap: 6px; flex: none; }
@media (max-width: 720px) { .cat-cands .cat-cand { flex-wrap: wrap; padding: 0 0 10px; } .cat-cand-acts { margin-left: 56px; } }

/* Verification status lives inside the main card, above the name (operator,
   2026-11-13): one slim line, aligned with the fields. The layout grid no
   longer has a banner row, so the card and the rail start on the same line. */
.cand-layout { grid-template-areas: "main rail" !important; }
@media (max-width: 1100px) { .main .cand-layout { grid-template-areas: "main" "rail" !important; } }
@media (max-width: 700px)  { .cand-drawer .cand-layout { grid-template-areas: "main" "rail" !important; } }
.fit-card > .cand-status-in { display: inline-flex; align-items: center; gap: 7px; width: auto; max-width: 100%; margin: 0 0 12px; padding: 5px 11px 5px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 600; line-height: 1.3; white-space: nowrap; }
.fit-card > .cand-status-in .cand-status-ic { width: 15px; height: 15px; }

/* ── Cruise Control: settings panel in the left column (2026-11-13) ─────────
   Replaces the top strip. Priority list above, Settings below; the whole left
   column sticks, not just the flow card. */
.af2-left { display: flex; flex-direction: column; gap: 14px; min-width: 0; position: sticky; top: 12px; align-self: start; }
.af2-left > .af2-flow { position: static !important; }
.or-set { padding: 0; overflow: hidden; }
.or-set-head { padding: 12px 14px; border-bottom: 1px solid var(--border-2, rgba(74,52,30,.1)); }
.or-set-head h3 { margin: 0; font-size: 14px; font-weight: 700; color: var(--text); }
.or-set-row { display: flex; align-items: center; gap: 11px; width: 100%; min-width: 0; padding: 10px 14px; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; }
.or-set-row + .or-set-row { border-top: 1px solid var(--border-2, rgba(74,52,30,.08)); }
button.or-set-row { cursor: pointer; }
button.or-set-row:hover, button.or-set-row:focus-visible { background: #faf9f6; outline: none; }
.or-set-ic { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--surface-2); color: var(--text-2); }
.or-set-ic svg { width: 15px; height: 15px; }
.or-set-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.or-set-l { font-size: 13px; font-weight: 650; color: var(--text); line-height: 1.3; }
.or-set-v { font-size: 12px; color: var(--text-3); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.or-set-v.is-miss { color: #b42332; }
.or-set-chev { flex: none; width: 15px; height: 15px; color: var(--text-3); }
.or-set-row.is-pilot .or-set-state { font-weight: 500; color: var(--text-3); }
.or-set-row.is-pilot.is-on .or-set-state { color: #0e7a4f; font-weight: 650; }
.or-set-row.is-pilot .ac-toggle { margin: 0; flex: none; }
.or-set-row .ap-switch { width: 34px; height: 20px; }
.or-set-row .ap-switch span { top: 2px; left: 2px; width: 14px; height: 14px; }
.or-set-row .ap-switch[aria-checked="true"] span { left: 16px; }
.or-set-warn { margin: 0 14px 12px; padding: 8px 10px; border-radius: 8px; background: var(--warning-soft, rgba(227,162,26,.13)); color: var(--warning-fg, #8a5a00); font-size: 12px; display: flex; flex-direction: column; gap: 4px; }
.or-set-solo { max-width: 440px; margin: 0 0 14px; }
@media (max-width: 1180px) { .af2-left { position: static; } .af2-left > .af2-flow { max-width: none; } }
/* The left column (Priority list + Settings) is taller than many screens, and a
   sticky block taller than the viewport hides its bottom rows - so it scrolls
   with the page. */
.af2-left { position: static !important; }

/* Cruise Control (operator, 2026-11-13): Approve and every "next step" action
   are green, and every step's select-all bar (Attended, Registered, ...) gets the
   same look as the Backlog one - grey, inset, no shadow, aligned checkbox. */
.af-bulk [data-af-go], .af-bulk2-acts .btn, .af-row .af-next.is-go {
  background: var(--success, #1aa971) !important; border-color: var(--success, #1aa971) !important; color: #fff !important; }
.af-bulk [data-af-go]:hover, .af-bulk2-acts .btn:hover, .af-row .af-next.is-go:hover { background: #168459 !important; border-color: #168459 !important; }
.af-bulk [data-af-go]:disabled { opacity: .45 !important; }
.af-bulk2 { position: sticky; top: 0; z-index: 3; margin: 8px 4px 8px !important; padding: 5px 10px 5px 1px !important;
  background: #f1f0ec !important; border: 1px solid rgba(74,52,30,.12) !important; border-radius: 10px !important; box-shadow: none !important; }
.af-bulk2 .af-check span { font-weight: 600; }

/* Person card: the verification strip spans the full width of the card's top (operator, 2026-11-13). */
.fit-card > .cand-status-in { display: flex !important; width: 100% !important; border-radius: 10px !important; padding: 7px 12px !important; box-sizing: border-box; }
/* Person rows: "New" is the orange badge (same look as the board's New
   ribbon), not grey text (operator, 2026-11-13). */
.af-person .row-status.phase-new { color: #fff !important; background: var(--accent) !important; box-shadow: none !important;
  font-size: 9.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; line-height: 1; padding: 5px 8px 4px; border-radius: 4px; }

/* The right column is its natural height again (operator, 2026-11-13: "don't
   make it the same height anymore") - no stretching to match the main card. */
.cand-layout { align-items: start !important; }
.cand-layout > .cand-main > .fit-card { flex: none !important; }
.cand-layout > .cand-rail > .rail-manage { flex: none !important; }
/* Person avatars in lists: a neutral silhouette placeholder (or the real photo
   when one exists), inside the same score ring and source mark. */
.pbc-av.is-silhouette { color: #a8a196 !important; background: #ecebe7 !important; overflow: hidden; }
.pbc-av.is-silhouette svg { width: 64%; height: 64%; margin-top: 18%; }
.pbc-av.is-photo { background: #ecebe7 !important; overflow: hidden; padding: 0; }
.pbc-av.is-photo img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%; }
/* Tribe → Categories polish (operator, 2026-11-13). */
/* Add row: same inner padding and height as a table row. */
.main .cat-simple .cdt-add { padding: 10px 12px 10px 18px; min-height: 44px; box-sizing: border-box; }
/* Stage: one pill style; "New" is the orange badge (as on All prospects),
   joined members green, everything else neutral. */
.cdt td .row-status { display: inline-flex; align-items: center; font-size: 11px; font-weight: 600; line-height: 1.2; padding: 3px 9px; border-radius: 999px; background: var(--surface-2) !important; color: var(--text-2) !important; box-shadow: none; }
.cdt td .row-status.stage-pending_review, .cdt td .row-status.stage-backlog { background: var(--accent) !important; color: #fff !important; font-size: 9.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: 5px 8px 4px; border-radius: 4px; }
.cdt td .row-status.stage-new_member, .cdt td .row-status.stage-converted { background: #e3f4ea !important; color: #1f7a4d !important; }
/* The "..." pop-ups open with a short fade + scale (reduced motion: instant). */
@keyframes cat-dlg-in { from { opacity: 0; transform: translateY(6px) scale(.97); } to { opacity: 1; transform: none; } }
#roleEditDialog[open], #roleDeleteDialog[open], #markFilledDialog[open] { animation: cat-dlg-in .15s cubic-bezier(.2,.7,.2,1); }
#roleEditDialog[open]::backdrop, #roleDeleteDialog[open]::backdrop, #markFilledDialog[open]::backdrop { animation: cat-dlg-fade .15s ease-out; }
@keyframes cat-dlg-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { #roleEditDialog[open], #roleDeleteDialog[open], #markFilledDialog[open], #roleEditDialog[open]::backdrop, #roleDeleteDialog[open]::backdrop, #markFilledDialog[open]::backdrop { animation: none; } }

/* Per-row Approve / next-step buttons are SECONDARY (operator, 2026-11-13:
   "abrasive"); only the bulk bar's main action stays solid green. */
.af-row .af-next.is-go, .af-row .af-next.is-go:hover {
  background: #fff !important; color: #0e7a4f !important; border: 1px solid rgba(26,169,113,.45) !important; box-shadow: none !important; }
.af-row .af-next.is-go:hover { background: rgba(26,169,113,.08) !important; }

/* Last outreach / On the board values: lighter weight (operator, 2026-11-13). */
.cand-touch .ct-v { font-weight: 500 !important; color: var(--text-2) !important; }

/* ── Custom dropdowns everywhere (operator, 2026-11-13) ──────────────────────
   The select itself stays (fill #F7F7F8 + chevron from the field rules); its
   open list is .tc-pop, in the same look as the board's .cdd menu. */
select.tc-sel { cursor: pointer; }
select.tc-sel.is-open { background-color: #fff !important; border-color: var(--accent) !important; box-shadow: 0 0 0 3px var(--accent-soft) !important; }
.tc-pop { position: fixed; z-index: 10050; overflow-y: auto; overscroll-behavior: contain;
  background: #fff; border: 1px solid rgba(74,52,30,.18); border-radius: 10px;
  box-shadow: 0 14px 34px rgba(40,28,14,.16), 0 2px 6px rgba(40,28,14,.06); padding: 5px;
  font: 13px/1.3 inherit; font-family: inherit; color: var(--text, #27221d);
  opacity: 0; transform: translateY(-4px) scale(.98); transform-origin: top center;
  transition: opacity .12s ease, transform .12s ease; }
.tc-pop.is-up { transform: translateY(4px) scale(.98); transform-origin: bottom center; }
.tc-pop.is-in { opacity: 1; transform: none; }
.tc-opt { display: flex; align-items: center; gap: 8px; min-height: 34px; padding: 6px 10px; border-radius: 7px;
  cursor: pointer; white-space: nowrap; font-size: 13px; color: var(--text, #27221d); }
.tc-opt > span { overflow: hidden; text-overflow: ellipsis; }
.tc-opt.is-active { background: #f4f2ee; }
.tc-opt.is-sel { font-weight: 650; background: #fdf5ef; }
.tc-opt.is-sel.is-active { background: #fbeee4; }
.tc-opt.is-dis { opacity: .45; cursor: default; }
.tc-tick { width: 14px; height: 14px; margin-left: auto; color: var(--accent, #ff5b1f); flex: none; }
.tc-grp { padding: 8px 10px 4px; font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3, #8a8178); }
.tc-grp:first-child { padding-top: 4px; }
@media (max-width: 720px) { .tc-opt { min-height: 42px; font-size: 14px; } }
@media (prefers-reduced-motion: reduce) { .tc-pop { transition: none; transform: none; } }
/* Priority list: icons on Backlog and Approved (same stroke as the sidebar). */
.af2-flow .af-node .af-l { display: inline-flex; align-items: center; gap: 7px; }
.af2-flow .af-node .af-ic { width: 15px; height: 15px; flex: none; opacity: .8; }

/* ONE field shape everywhere (operator, 2026-11-13: "all share the same
   rounded corners ... not crazy"): inputs, selects, textareas and the custom
   dropdown button all use a calm 8px radius. */
:is(.main, .drawer, dialog, .login-card) :is(input.input, input[type="text"], input[type="email"], input[type="search"], input[type="number"], input[type="url"], input[type="tel"], input[type="password"], select, textarea),
:is(.main, .drawer, dialog) .cdd-btn,
#conversation .conv-field { border-radius: 8px !important; }
/* "New" on person rows: secondary, not solid orange (operator, 2026-11-13:
   "a little abrasive") - a soft accent tint with darker text. Also the
   category table's New stage, so the two match. */
.af-person .row-status.phase-new, .cdt td .row-status.stage-pending_review, .cdt td .row-status.stage-backlog {
  background: rgba(255,91,31,.1) !important; color: #b4451a !important; box-shadow: inset 0 0 0 1px rgba(255,91,31,.22) !important;
  font-size: 10px !important; font-weight: 700 !important; letter-spacing: .06em; text-transform: uppercase; padding: 3px 7px !important; border-radius: 4px !important; line-height: 1.1;
}

/* ── Performance alignment (operator, 2026-11-13: "columns actually match up",
   "proper spacing between things") ─────────────────────────────────────────
   Two-column rows stretch to equal height; cards are flex columns so their
   bodies fill and bottoms line up; one 16px rhythm between every card. */
.cv-grid2, .rpt-grid2 { align-items: stretch !important; gap: 16px !important; margin: 0 0 16px !important; }
.cv-grid2 > .cv-card, .rpt-grid2 > .rpt-card { display: flex; flex-direction: column; height: 100%; }
.cv-grid2 > .cv-card > .cv-head, .rpt-grid2 > .rpt-card > .rpt-head { min-height: 86px; box-sizing: border-box; }
.rpt-grid2 > .rpt-card > .rpt-body { flex: 1 1 auto; }
.cv-grid2 > .cv-card:last-child:nth-child(odd) { grid-column: 1 / -1; height: auto; }
.cv-page .jr-card, .cv-page .cv-results { margin: 0 0 16px !important; }
.rpt-page .stat-band { margin-bottom: 16px !important; }
.rpt-page .rpt-trend { margin: 0 0 16px !important; }
.rpt-page > .rpt-grid2:last-of-type { margin-bottom: 16px !important; }
/* Trend chart: fixed-height plot + HTML y-axis (no scaled text, no dead space). */
.rpt-trend .rpt-trend-wrap { height: auto !important; }
.rpt-tchart { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 8px; margin-top: 10px; }
.rpt-ty { display: flex; flex-direction: column; justify-content: space-between; height: 200px; font-size: 11px; color: var(--text-3); text-align: right; font-variant-numeric: tabular-nums; line-height: 1; }
.rpt-ty span { transform: translateY(0); }
.rpt-tplot { height: 200px; min-width: 0; }
.rpt-tplot svg { display: block; width: 100%; height: 200px; overflow: visible; }
.rpt-thit { fill: transparent; }
.rpt-thit:hover { fill: rgba(63,108,158,.06); }
.rpt-tx { margin: 6px 0 0 42px; display: flex; justify-content: space-between; font-size: 11px; color: var(--text-3); }
@media (max-width: 1024px) {
  .cv-grid2 > .cv-card > .cv-head, .rpt-grid2 > .rpt-card > .rpt-head { min-height: 0; }
}
@media (max-width: 700px) {
  .rpt-ty, .rpt-tplot, .rpt-tplot svg { height: 160px; }
  .rpt-tchart { grid-template-columns: 28px minmax(0, 1fr); gap: 6px; }
  .rpt-tx { margin-left: 34px; }
}
.cv-grid2 > .cv-card > .cv-head, .rpt-grid2 > .rpt-card > .rpt-head { min-height: 0; }

/* "New" is blue (operator, 2026-11-13) - a soft blue tint, secondary weight. */
.af-person .row-status.phase-new, .cdt td .row-status.stage-pending_review, .cdt td .row-status.stage-backlog {
  color: #1f5fae !important; background: #e8f1fc !important; border: 1px solid #c6dbf5 !important; box-shadow: none !important; }

/* Whose board they're on: a round avatar instead of "With <name>". */
.row-owner { flex: none; display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; overflow: hidden;
  background: #ecebe7; color: var(--text-2); font-size: 10px; font-weight: 700; letter-spacing: .02em; box-shadow: 0 0 0 2px #fff, 0 0 0 3px rgba(74,52,30,.12); }
.row-owner img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Automation email panel (2026-11-13). */
.or-auto-id .field { display: block; margin: 14px 0 6px; font-size: 12px; font-weight: 600; color: var(--text-2); }
.or-auto-id .field:first-of-type { margin-top: 0; }
.or-fixed { padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; background: #f7f7f8; font-size: 13px; color: var(--text); }
.or-auto-id .input { width: 100%; box-sizing: border-box; }
.or-sig-preview { display: block; width: 100%; height: 120px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }

/* ── Tribe → Categories, final pass (operator, 2026-11-13: "fix up the
   categories page"). Seats read as plain "1 / 3" text; the 3 is the edit
   target, it only shows a field once you hover or click it. Empty cells stay
   empty instead of a column of dashes. */
.main .cdt .cdt-seats { gap: 0; font-size: 13px; font-weight: 500; color: var(--text-2); }
.main .cdt .cdt-seats .cdt-of { margin: 0 4px; color: var(--text-3); font-weight: 400; }
.main .cdt .cdt-seats input.cdt-seat-in {
  width: 26px; height: 24px; min-height: 0 !important; margin: 0 0 0 -3px; padding: 0 3px !important;
  border: 1px solid transparent !important; border-radius: 6px; background: transparent !important; box-shadow: none !important;
  font: inherit; color: inherit; text-align: left; cursor: pointer;
}
.main .cdt .cdt-seats input.cdt-seat-in:hover { background: #F7F7F8 !important; border-color: rgba(74,52,30,.14) !important; }
.main .cdt .cdt-seats input.cdt-seat-in:focus { background: #fff !important; border-color: var(--accent) !important; box-shadow: 0 0 0 2px rgba(31,95,174,.15) !important; cursor: text; text-align: center; outline: none; }
.main .cdt .cdt-seats.is-full, .main .cdt .cdt-seats.is-full .cdt-of { color: #137a52; }
.cdt .cdt-dash { color: var(--text-3); font-weight: 400; font-style: normal; }

/* Tribe header cover photo: one quiet dashed tile when there's no photo (admins
   only), the "Change" chip appears on hover when there is one. */
.tribe-hero.no-img .tribe-hero-body { padding-left: 22px; }
.main form.tribe-hero-img.is-empty { margin: 0; padding: 12px; background: transparent; border-right: 1px solid var(--border); }
.tribe-img-add {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  width: 100%; height: 100%; min-height: 120px; border: 1.5px dashed rgba(74,52,30,.2); border-radius: 12px;
  background: #F7F7F8; color: var(--text-3); font-size: 12.5px; font-weight: 500; cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.tribe-img-add svg { width: 28px; height: 28px; }
.tribe-img-add:hover { border-color: var(--accent); color: var(--accent); background: #fff; }
.tribe-hero-img .tribe-hero-upload { opacity: 0; transition: opacity .15s; }
.tribe-hero-img:hover .tribe-hero-upload, .tribe-hero-upload:focus-within { opacity: 1; }
@media (hover: none) { .tribe-hero-img .tribe-hero-upload { opacity: 1; } }
@media (max-width: 760px) {
  .main form.tribe-hero-img.is-empty { flex: 0 0 auto; height: auto; min-height: 0; border-right: 0; border-bottom: 1px solid var(--border); }
  .tribe-img-add { flex-direction: row; min-height: 52px; }
  .tribe-img-add svg { width: 20px; height: 20px; }
}
/* The global field rule (:is(.main …) input:not(…)×9) out-specifies class
   selectors, so the seat box is targeted through the panel id. */
#panel-categories .cdt-seats input.cdt-seat-in { background-color: transparent !important; border-color: transparent !important; box-shadow: none !important; }
#panel-categories .cdt-seats input.cdt-seat-in:hover { background-color: #F7F7F8 !important; border-color: rgba(74,52,30,.14) !important; }
#panel-categories .cdt-seats input.cdt-seat-in:focus { background-color: #fff !important; border-color: var(--accent) !important; box-shadow: 0 0 0 2px rgba(31,95,174,.15) !important; }

/* Single category page header (operator, 2026-11-13): one card, title + tribe
   link + seats on the left, status pill right, the six phase counts below in the
   tribe header's stat boxes. Zero counts recede. */
.cat-hero { padding: 18px 22px; }
.cat-hero-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.cat-hero .page-title { margin: 0; }
.cat-hero-sub { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 4px; font-size: 13px; color: var(--text-2); }
.cat-hero-sub a { color: var(--text-2); font-weight: 500; text-decoration: none; }
.cat-hero-sub a:hover { color: var(--accent); text-decoration: underline; }
.cat-hero-sub .is-full { color: #137a52; font-weight: 500; }
.cat-hero-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--text-3); }
.cat-hero-stats { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.cat-hero-stats .ths { flex: 1 1 96px; }
.cat-hero-stats .ths.is-zero .ths-v { color: var(--text-3); font-weight: 600; }
@media (max-width: 560px) { .cat-hero-stats .ths { flex: 1 1 calc(33% - 8px); } }
/* Seats: line the editable number up on the text baseline with "0 /". */
.main .cdt .cdt-seats { align-items: baseline; }
#panel-categories .cdt-seats input.cdt-seat-in { height: auto; line-height: 20px; padding: 1px 3px !important; vertical-align: baseline; }
@media (max-width: 760px) {
  .main .tribe-hero form.tribe-hero-img.is-empty { flex: 0 0 auto; width: auto; max-width: none; align-self: stretch; }
}

/* ── Consistency pass V (2026-11-13) ─────────────────────────────────────── */
/* 1. One corner for every control: buttons now share the fields' 8px, so a
      button sitting beside a dropdown or a search box has the same shape. */
.btn, .btn-sm, .btn.btn-sm, .page-back, .icon-btn { border-radius: 8px; }
/* 2. One height per control size. min-height alone let padding and line
      height push fields to 35-38px; a fixed height keeps them at the two
      tokens: 34px in forms and drawers, and the toolbar field height
      (--ctl-h-field, 35px) for every filter, search and select in a header. */
:is(.main, .drawer, dialog) :is(input.input, input[type="text"], input[type="email"], input[type="search"], input[type="number"], input[type="url"], input[type="tel"], input[type="password"], input[type="date"], select):not([multiple]):not([size]) {
  box-sizing: border-box; height: var(--ctl-h); min-height: var(--ctl-h); }
.main :is(.input-sm, select.input-sm),
.main :is(.card-head, .list-head, .list-filters, .page-head-tools, .sys-head, .rpt-head, .cv-head) :is(.input, select, input[type="search"]):not([multiple]):not([size]) {
  height: var(--ctl-h-field); min-height: var(--ctl-h-field); padding-top: 0; padding-bottom: 0; }
/* 3. "New" reads the same everywhere: the board-card ribbon takes the blue the
      list badges use (operator: "make the new label blue"). */
.pbc-ribbon { background: #2f6fbd; }
.pbc-ribbon::before { border-bottom-color: #1f4f8a; }
/* 4. A tribe with no picture yet gets a soft panel with its initial, not a
      blank white box (the old style was tuned for the dark theme). */
.tribe-grid .tribe-tile .tt-img.is-empty { display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #f6efe6 0%, #efe4d6 100%); color: rgba(120, 86, 52, .38);
  font-size: 44px; font-weight: 800; letter-spacing: -.02em; border-bottom: 1px solid var(--border-2); }
/* 5. The test-mode warning spans the full column like the cards under it. */
.main .es-warn { max-width: none; }
/* 6. Users and Activity share one header (title "Users", a line under it),
      the same shape as the Emails and AI headers. */
.main .act-head { margin: 0 0 20px; }
.main .act-head .page-title { margin: 0; font-size: 24px; line-height: 1.2; }
.main .act-head .page-sub { margin: 6px 0 0; font-size: 13.5px; line-height: 1.45; color: var(--text-3); max-width: 760px; }
/* 7. A drawer's confirming button (Create token, Add exclusion...) is the same
      solid green as Save, not the pale tint left over from the dark theme. */
.drawer .drawer-foot .btn-success, .drawer button[type="submit"].btn-success {
  background: var(--success, #1aa971) !important; border-color: var(--success, #1aa971) !important; color: #fff !important; }
.drawer .drawer-foot .btn-success:hover, .drawer button[type="submit"].btn-success:hover { background: #168459 !important; border-color: #168459 !important; }

/* ── Cruise Control > Email versions (v61, operator 2026-11-13) ─────────── */
.ev-body { gap: 10px !important; }
.ev-note { padding: 10px 12px; border-radius: 8px; background: #F7F7F8; font-size: 13px; color: var(--text-2); }
.ev-note.is-warn { background: #fff4e5; color: #8a4b00; }
.ev-card { border: 1px solid var(--border); border-radius: 12px; background: #fff; overflow: hidden; }
.ev-card[open] { border-color: rgba(74,52,30,.22); box-shadow: 0 4px 14px rgba(60,50,40,.06); }
.ev-card.is-paused .ev-subject, .ev-card.is-paused .ev-stats { opacity: .55; }
.ev-sum { display: flex; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer; list-style: none; }
.ev-sum::-webkit-details-marker { display: none; }
.ev-sum:hover { background: #FBFAF8; }
.ev-label { flex: none; display: grid; place-items: center; min-width: 30px; height: 30px; padding: 0 6px; border-radius: 8px;
  background: #e8f1fc; color: #1f5fae; font-weight: 700; font-size: 13px; }
.ev-label.is-add { background: #F2F1EE; color: var(--text-2); font-size: 16px; }
.ev-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ev-subject { font-weight: 600; font-size: 13.5px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-meta { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12px; color: var(--text-3); }
.ev-meta > span { line-height: 18px; }
.ev-off, .ev-best, .ev-warn { padding: 0 7px; border-radius: 999px; font-weight: 600; font-size: 11px; }
.ev-off  { background: #F2F1EE; color: var(--text-2); }
.ev-best { background: rgba(26,169,113,.12); color: #137a52; }
.ev-warn { background: #fff4e5; color: #8a4b00; }
.ev-stats { flex: none; display: flex; gap: 0; }
.ev-stats > span { display: flex; flex-direction: column; align-items: flex-end; min-width: 58px; padding-left: 12px;
  font-size: 11px; color: var(--text-3); border-left: 1px solid var(--border); margin-left: 12px; }
.ev-stats > span:first-child { border-left: 0; margin-left: 0; }
.ev-stats strong { font-size: 14px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.ev-form { display: flex; flex-direction: column; gap: 6px; padding: 4px 14px 12px; border-top: 1px solid var(--border); }
.ev-form .field { margin-top: 6px; }
.ev-form textarea { min-height: 200px; font: 13px/1.55 inherit; }
.ev-row { display: flex; gap: 12px; }
.ev-f { display: flex; flex-direction: column; gap: 4px; }
.ev-f-label { flex: 1; } .ev-f-share { flex: 0 0 170px; }
.ev-acts { display: flex; gap: 8px; justify-content: flex-end; margin-top: 6px; }
.ev-acts-2 { padding: 0 14px 12px; justify-content: flex-start; }
.ev-acts-2 form { margin: 0; }
.ev-card:not([open]) .ev-acts-2 { display: none; }
.ev-del:hover { color: #b42332; }
@media (max-width: 640px) {
  .ev-sum { flex-wrap: wrap; }
  .ev-stats { width: 100%; justify-content: space-between; padding-left: 42px; }
  .ev-stats > span { align-items: flex-start; min-width: 0; }
  .ev-row { flex-direction: column; } .ev-f-share { flex: none; }
}
/* A global `.drawer details` rule lays details out as a 2-col grid; these are stacked cards. */
.drawer .ev-card { display: block !important; grid-template-columns: none !important; padding: 0 !important; }
.drawer .ev-card > summary { width: auto !important; }

/* Conversation > Next automated email (operator, 2026-11-13). */
.conv-next { margin: 0 18px 4px; margin-top: 12px; border: 1px solid #cfe0f5; border-radius: 10px; background: #f4f8fd; }
.conv-next.is-held { border-color: #f1dcc0; background: #fffaf2; }
.conv-next-sum { display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer; list-style: none; }
.conv-next-sum::-webkit-details-marker { display: none; }
.conv-next-ic { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: #e8f1fc; color: #1f5fae; }
.conv-next.is-held .conv-next-ic { background: #fdebd3; color: #8a4b00; }
.conv-next-ic svg { width: 17px; height: 17px; }
.conv-next-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.conv-next-t { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-weight: 600; font-size: 13px; color: var(--text); }
.conv-next-tag { padding: 0 7px; border-radius: 999px; background: #fff; border: 1px solid var(--border); font-size: 11px; font-weight: 600; color: var(--text-2); line-height: 18px; }
.conv-next-tag.is-ver { background: #e8f1fc; border-color: #cfe0f5; color: #1f5fae; }
.conv-next-s { font-size: 12px; color: var(--text-3); }
.conv-next.is-held .conv-next-s { color: #8a4b00; }
.conv-next-more { flex: none; font-size: 12px; font-weight: 600; color: var(--text-2); }
.conv-next[open] .conv-next-more { color: var(--text-3); }
.conv-next-body { padding: 0 12px 12px 52px; }
.conv-next-body .conv-text { white-space: pre-wrap; font-size: 13px; line-height: 1.55; color: var(--text); background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; margin-top: 6px; }
.conv-next-edit { display: inline-block; margin-top: 8px; font-size: 12px; font-weight: 600; color: var(--accent); text-decoration: none; }
@media (max-width: 640px) { .conv-next { margin-left: 12px; margin-right: 12px; } .conv-next-body { padding-left: 12px; } }

/* Tribes list (operator, 2026-11-13): compact tiles. A photo is a short
   banner; no photo = a coloured initial beside the name, not an empty box. */
.tribe-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)) !important; gap: 12px !important; align-items: start; }
.tribe-grid .tribe-tile { padding: 0 !important; overflow: hidden; }
.tribe-grid .tribe-tile .tt-img { aspect-ratio: auto !important; height: 96px !important; margin: 0 !important; }
.tribe-grid .tribe-tile .tt-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.tribe-grid .tribe-tile .tt-ava { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px;
  background: hsl(var(--tt-h) 55% 93%); color: hsl(var(--tt-h) 45% 38%); font-weight: 700; font-size: 17px; }
.tribe-grid .tribe-tile .tt-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.tribe-grid .tribe-tile h4 { margin: 0 !important; font-size: 15px !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tribe-grid .tribe-tile .stats { display: flex; align-items: center; gap: 8px; margin: 0 !important; font-size: 12.5px; color: var(--text-3); }
.tribe-grid .tribe-tile .stats strong { color: var(--text); font-weight: 600; }
.tribe-grid .tribe-tile .stats .vsep { height: 12px; }
.tribe-grid .tribe-tile .tt-chev { flex: none; width: 16px; height: 16px; color: var(--text-3); transition: transform .15s; }
.tribe-grid .tribe-tile:hover .tt-chev { transform: translateX(2px); color: var(--text-2); }
.tribe-grid .tribe-tile .tt-auto { margin-left: 6px; padding: 0 7px; border-radius: 999px; background: rgba(26,169,113,.12); color: #137a52; font-size: 10.5px; font-weight: 600; line-height: 17px; vertical-align: 2px; }

/* Home board: columns share the width and may shrink a little, so five
   columns fit a normal laptop screen without a sideways scroll (2026-11-13).
   Phones keep their own one-column swipe rule (max-width media query). */
@media (min-width: 721px) {
  .pb .kb-board > .pb-col:not(.is-folded) { flex: 1 1 200px; min-width: 184px; }
  .pb.is-full .kb-board > .pb-col:not(.is-folded) { flex: 1 1 200px; min-width: 184px; }
}
/* Only show the board's sideways scrollbar when there is something to scroll. */
.pb .kb-board { overflow-x: auto !important; }
/* Email versions popup keeps a steady size instead of shrinking to its
   contents (operator, 2026-11-13: "min height to be clean and clear"). */
#drawer-or-versions { min-height: min(720px, 88vh); display: flex; flex-direction: column; }
#drawer-or-versions .drawer-body { flex: 1 1 auto; overflow-y: auto; justify-content: flex-start; }
@media (max-width: 640px) { #drawer-or-versions { min-height: 82vh; } }
/* …and scrolls inside itself once a version is opened (operator: "I need to be
   able to scroll down"). Header stays put; the list scrolls. */
#drawer-or-versions { height: min(760px, 90vh) !important; max-height: 90vh !important; overflow: hidden !important; }
#drawer-or-versions > .drawer-head { flex: none; }
#drawer-or-versions > .drawer-body { flex: 1 1 0 !important; min-height: 0 !important; overflow-y: auto !important; overscroll-behavior: contain; padding-bottom: 20px; }
@media (max-width: 640px) { #drawer-or-versions { height: 88vh !important; max-height: 88vh !important; } }
#drawer-or-versions .ev-body > * { flex: none !important; }

/* Automation email popup, tightened (operator, 2026-11-13). */
#drawer-or-email .or-auto-id { gap: 16px !important; padding-top: 18px; padding-bottom: 18px; }
#drawer-or-email .aid-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
#drawer-or-email .aid-f { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
#drawer-or-email .aid-l { margin: 0; font-size: 12px; font-weight: 600; color: var(--text-2); }
#drawer-or-email .aid-h { margin: 0; font-size: 12px; line-height: 1.4; color: var(--text-3); }
#drawer-or-email .or-fixed { display: flex; align-items: center; height: var(--ctl-h, 34px); padding: 0 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#drawer-or-email textarea { min-height: 76px; resize: vertical; }
#drawer-or-email .or-sig-preview { height: 84px; min-height: 0; margin: 0; }
#drawer-or-email .es-autonote { margin: 0; font-size: 12px; color: var(--text-3); }
@media (max-width: 560px) { #drawer-or-email .aid-grid { grid-template-columns: 1fr; } }

/* Email versions: icon actions, preview, signature (operator, 2026-11-13). */
#drawer-or-versions .ev-acts { align-items: center; justify-content: flex-start; }
#drawer-or-versions .ev-acts-gap { flex: 1; }
#drawer-or-versions .ev-pv-btn { display: inline-flex; align-items: center; gap: 6px; }
#drawer-or-versions .ev-pv-btn svg { width: 16px; height: 16px; }
.ev-ic { display: inline-grid; place-items: center; width: 34px; height: 34px; padding: 0; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--border); background: #fff; color: var(--text-2); transition: background .12s, color .12s, border-color .12s; }
.ev-ic svg { width: 16px; height: 16px; }
.ev-ic:hover { background: #F7F7F8; color: var(--text); border-color: rgba(74,52,30,.22); }
.ev-ic.is-danger { color: #b42332; border-color: rgba(180,35,50,.28); background: #fff; }
.ev-ic.is-danger:hover { background: rgba(214,69,91,.08); border-color: rgba(180,35,50,.45); color: #9a1c2a; }
.ev-sig { flex: none; display: flex; flex-direction: column; gap: 8px; margin-top: 6px; padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: #fff; }
.ev-sig-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
.ev-sig-head h4 { margin: 0; font-size: 13.5px; font-weight: 600; color: var(--text); }
.ev-sig-head span { font-size: 12px; color: var(--text-3); }
.ev-sig-form { display: flex; flex-direction: column; gap: 8px; margin: 0; }
.ev-sig-form textarea { min-height: 70px; resize: vertical; }
.ev-sig-pv { width: 100%; height: 80px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.ev-sig-form .es-autonote { margin: 0; font-size: 12px; color: var(--text-3); }
.ev-pv { position: absolute; inset: 0; z-index: 5; display: flex; align-items: flex-start; justify-content: center; padding: 18px;
  background: rgba(40,32,24,.32); backdrop-filter: blur(2px); border-radius: inherit; }
.ev-pv[hidden] { display: none; }
.ev-pv-box { width: 100%; max-height: 100%; display: flex; flex-direction: column; overflow: hidden; border-radius: 14px; background: #fff; box-shadow: 0 18px 50px rgba(30,20,10,.25); }
.ev-pv-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.ev-pv-head strong { font-size: 14px; }
.ev-pv-meta { display: flex; flex-direction: column; gap: 4px; padding: 10px 16px; border-bottom: 1px solid var(--border); background: #FBFAF8; font-size: 12.5px; }
.ev-pv-meta div { display: flex; gap: 10px; min-width: 0; }
.ev-pv-meta span { flex: 0 0 56px; color: var(--text-3); }
.ev-pv-meta b { font-weight: 500; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-pv-frame { flex: 1; width: 100%; min-height: 360px; border: 0; background: #fff; }
#drawer-or-versions { position: fixed; }

/* Settings > Where we look (operator, 2026-11-13): plain words, two columns,
   a real switch instead of the browser checkbox. */
.set-geo .card-head .meta { margin-top: 3px; }
.set-geo .sg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
.set-geo .sg-f { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.set-geo .sg-wide { grid-column: 1 / -1; }
.set-geo label { margin: 0; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.set-geo .sg-h { font-size: 12px; line-height: 1.4; color: var(--text-3); font-weight: 400; }
.set-geo textarea { min-height: 64px; resize: vertical; }
.set-geo .sg-switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 18px; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: 10px; background: #FBFAF8; }
.set-geo .sg-switch > div { display: flex; flex-direction: column; gap: 3px; }
.set-geo .sg-switch strong { font-size: 13px; font-weight: 600; color: var(--text); }
.sg-sw { position: relative; flex: none; width: 46px; height: 26px; cursor: pointer; }
.sg-sw input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.sg-sw span { position: absolute; inset: 0; border-radius: 999px; background: #e3e0da; border: 1px solid var(--border); transition: background .15s; }
.sg-sw span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.18); transition: left .15s; }
.sg-sw input:checked + span { background: var(--success, #1aa971); border-color: var(--success, #1aa971); }
.sg-sw input:checked + span::after { left: 22px; }
.sg-sw input:focus-visible + span { box-shadow: 0 0 0 3px rgba(31,95,174,.25); }
.set-geo .es-autonote { margin: 12px 0 0; font-size: 12px; color: var(--text-3); }
@media (max-width: 640px) { .set-geo .sg-grid { grid-template-columns: 1fr; } }
