/* ═══════════════════════════════════════════════════════════════════
   Nexus Dashboard — Proofwork design system
   Aesthetic: proof-green accent · IBM Plex Sans + Plex-Mono-for-DATA · calm depth
   Grid: 8px base · tokens mirror the-circuit/design-kit/tokens.css
   ═══════════════════════════════════════════════════════════════════ */

/* ── Self-hosted brand fonts ──────────────────────────────────────────
   IBM Plex, replacing Inter + JetBrains Mono. One superfamily rather than two
   unrelated designs, real tabular figures for the data columns, and OFL 1.1 so
   it ships in the extension bundle rather than phoning a CDN.
   Three weights, not four: 700 reads as a template hero, and 500 with tight
   tracking carries a heading perfectly well. Net 6 files where there were 7. */
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/ibm-plex-sans-400.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/ibm-plex-sans-500.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/ibm-plex-sans-600.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/ibm-plex-mono-400.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/ibm-plex-mono-500.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/ibm-plex-mono-600.woff2") format("woff2");
}

/* ── Reset + base ────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html,
body {
  background: var(--page-bg);
  color: var(--page-ink);
  font-family: var(--font-body);
  /* 13px -> 14px with the family swap. Plex's x-height is smaller than Inter's,
     so the 9-11px muted labels would read lighter at the same nominal size even
     though the contrast ratios are unchanged. This restores the apparent size. */
  font-size: 14px;
  line-height: 1.5;
  height: 100%;
  overflow: clip;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}

::selection {
  background: color-mix(in srgb, var(--accent) 30%, transparent);
}
/* Keyboard operability: a clear focus ring on every focusable element, and on
   the clickable <div>/<a> cards the dashboard builds (many aren't real buttons
   yet — give them a visible focus state so keyboard users can see where they
   are). WCAG 2.4.7. */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}
[role="button"]:focus-visible,
[tabindex]:focus-visible,
a:focus-visible,
button:focus-visible,
.card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Respect users who ask for less motion (vestibular safety, WCAG 2.3.3). */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* ── Design tokens ───────────────────────────────────────────────── */
:root {
  /* PROOFWORK — mirrors design-kit/tokens.css (proof-green accent, neutral ink). */
  --bg-0: #08090b;
  --bg-1: #0e1014;
  --bg-2: #14171c;
  --bg-3: #1b1f26;
  --border: #1e222a;
  --border-active: #4ade80;
  --text-1: #eceef2;
  --text-2: #a8acb6;
  /* text-3/4 raised for the 9-11px muted labels they carry: the old #606074
     (3.3:1) and #404054 (2:1) failed AA badly.
     MEASURED, not asserted - the note that stood here claimed BOTH cleared AA,
     and text-4 never did. #6c7080 was 4.05:1 on --bg-0, under the 4.5:1 small
     text floor, which was the one number that mattered. #7d8191 measures
     --bg-0 5.14 / --bg-1 4.92 / --bg-2 4.64 / --bg-3 4.27, so AA passes on the
     three surfaces these labels sit on. On --bg-3 it reaches only 4.27 and
     clears just the 3:1 large-text floor.
     An earlier version of this note excused that by claiming --bg-3 carries dots
     and borders rather than small text. That was wrong - a sweep found 10px mono
     labels and a status pill sitting on --bg-3 in exactly that combination, and
     they were moved to --text-3 (5.05:1). So the rule is: --text-4 is NOT for
     text on --bg-3; use --text-3 there. Stays a clear tier below --text-3
     (6.09:1 on --bg-0). */
  --text-3: #8a8e9a;
  --text-4: #7d8191;
  --accent: #4ade80;
  --accent-hover: #6ee79b;
  /* Ink for text sitting ON the accent. White on #4ADE80 measures 1.74:1,
     which fails WCAG AA (4.5:1) on the product's PRIMARY action; this is
     10.86:1. The accent is a light green - it needs dark text, not white. */
  --accent-ink: #04140b;
  --accent-soft: rgba(74, 222, 128, 0.12);
  --green: #4ade80;
  --green-soft: rgba(74, 222, 128, 0.12);
  --red: #f87171;
  --red-soft: rgba(248, 113, 113, 0.12);
  --yellow: #fbbf24;
  --yellow-soft: rgba(251, 191, 36, 0.12);
  --blue: #60a5fa;
  --blue-soft: rgba(96, 165, 250, 0.12);
  /* SHAPE — four values, and none in the 6-16px band that every generated UI
     defaults to. Sharper rather than rounder: rounder reads consumer-app, and
     this product's stated language is hairlines and tabular numbers.
       --radius-sm  controls: buttons, inputs, chips, badges, tags, code
       --radius-md  containers: cards, panels, popovers, menus, toasts
       --radius-lg  kept as an alias of md so existing call sites need no edit
       --radius-full status dots and avatars ONLY, never a pill button */
  /* Softened 2026-08-22 from 2/4/4 to match the marketing site's new direction.
     The old scale existed to dodge a banned 6-16px band; that ban is gone.
     Still tighter than the marketing site: this is a dense operator tool and
     rounder reads consumer-app, so controls stay at 6 while containers go to 10.
     --radius-lg is no longer an alias of md; it is the modal/drawer step. */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;
  --transition: 120ms ease-out;
  --font-body: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-display: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  /* Reconciliation aliases — the dashboard.js inline styles drifted to these
     literal hexes; expose them as tokens so future code can reference the
     intended value and a theme change stays single-source. (The bulk codemod
     of existing inline literals is deferred; these document the mapping.)
       inline #13131a / #1a1a22  → card surface
       inline #2a2a38            → hairline border on inline cards
       inline #6aa9ff            → link blue
       inline #4ade80 / #22c55e  → success green
       inline #fca5a5 / #f87171  → danger text */
  --bg-card: var(--bg-2); /* was #13131a (drifted) */
  --border-soft: var(--border); /* was #242832 (drifted) */
  --link: var(--blue); /* was #6aa9ff → #60A5FA */
  --success: var(--green);
  --danger: var(--red); /* was #fca5a5 → #F87171 */
  /* The hover border for an interactive card. This one was NOT a drifted
     fallback like the four above — it was a live literal, `#3a3a4e`, assigned
     from JS in four files, so every hoverable card in the product brightened to
     a colour that existed in no token and no stylesheet. #3a3a4e is also the
     wrong hue: it sits at H240 against a neutral ramp built on H216. */
  /* Two border weights, because one was never enough. --border is the hairline
     that separates same-family surfaces; against --bg-2 it is 1.13:1, which is
     deliberately near-invisible. --border-strong is the edge you are meant to
     SEE - 1.38:1 on the same fill. Code kept reaching for a literal #333 (1.42:1)
     because the set had no name for that, so 17 borders drifted off-token purely
     for lack of a word.
     --border-hover is the same value and stays for hover state; the split is
     about intent, not colour, so they can diverge later without a sweep. */
  --border-strong: #2c313b;
  --border-hover: var(--border-strong);
  /* Semantic status spine — ONE color language across Proof, Accounts and the
     topbar pulse: green = working/proven · amber = blocked/needs-you ·
     red = failing/logged-out · neutral = idle. New status UI must use these
     (they alias the base palette so a theme change stays single-source). */
  --status-ok: var(--green);
  --status-ok-soft: var(--green-soft);
  --status-warn: var(--yellow);
  --status-warn-soft: var(--yellow-soft);
  --status-bad: var(--red);
  --status-bad-soft: var(--red-soft);
  --status-idle: #7c8190;
  /* M1 rooms (dashboard-rooms.css). The selected row, map node and outbound
     bubble share one green edge and one green wash, so "selected" reads the same
     in every room. Both derive from --accent; the neutral ramp is unchanged. */
  --accent-line: rgba(74, 222, 128, 0.55);
  --accent-wash: rgba(74, 222, 128, 0.08);
  --chip-border: var(--border-strong);
  --pane-bg: var(--bg-1);
  --pane-border: var(--border-strong);
  --topbar-h: 56px;
  --sidebar-w: 200px;
  --map-edge: var(--text-4);
  --map-edge-active: var(--accent);
  --map-node-bg: var(--bg-2);
  /* Knowledge map node types (dashboard-knowledge-map.js): dot fills and
     swatches only, never text, and always beside the type's own icon and
     word. Six reuse the palette; four hues are added so ten types stay apart. */
  --km-company: var(--accent);
  --km-offer: var(--blue);
  --km-audience: var(--yellow);
  --km-differentiator: #2dd4bf;
  --km-topic: #a78bfa;
  --km-objection: var(--red);
  --km-question: #fb923c;
  --km-person: #f472b6;
  --km-organization: #22d3ee;
  --km-source: var(--text-3);
  --km-dot-ink: var(--bg-0);
  /* CRM network map (dashboard-crm-network.js, drawn on a canvas that reads
     these). Three kinds that stay apart at a few pixels, badges that never
     reuse a kind's hue, and line weights for where a relationship came from.
     Warm is the warm hue on purpose; green stays "selected" and "confirmed". */
  --net-company: var(--blue);
  --net-person: var(--km-person);
  --net-community: var(--km-differentiator);
  --net-warm: var(--km-question);
  --net-token: var(--yellow);
  --net-telegram: #7dd3fc;
  --net-campaign: var(--accent);
  --net-edge: #59606e;
  --net-edge-recorded: #3a404b;
  --net-edge-suggested: var(--text-4);
  --net-edge-confirmed: var(--accent);
  --net-select: var(--accent);
  --net-label: var(--text-1);
  --net-halo: var(--bg-0);
  --net-ground: var(--bg-0);
  --net-glass: rgba(8, 9, 11, 0.86);
  --net-field-edge: #646a77;
  /* Ground, scrims and depth, lifted out of the rules that drew them so the
     shell's chrome reads from the token block like everything else. Values are
     the ones those rules already used. */
  --page-bg: #0a0a0e;
  --page-ink: #e0e0ec;
  --accent-deep: #35b667;
  --danger-ink: #ffffff;
  --scrim: rgba(0, 0, 0, 0.52);
  /* The web sign-in covers the inert app almost entirely. */
  --scrim-auth: rgba(8, 8, 12, 0.92);
  --shadow-popover: 0 8px 24px rgba(0, 0, 0, 0.3);
  --shadow-menu: 0 12px 28px rgba(0, 0, 0, 0.45);
  --shadow-overlay: 0 24px 64px rgba(0, 0, 0, 0.5);
  --shadow-modal: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 32px 70px -30px rgba(0, 0, 0, 0.75);
  --sheen-modal: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.04) 0%,
    rgba(255, 255, 255, 0.012) 100%
  );
  --shadow-primary:
    0 1px 0 rgba(255, 255, 255, 0.24) inset, 0 6px 18px -8px rgba(74, 222, 128, 0.5);
  --shadow-primary-hover:
    0 1px 0 rgba(255, 255, 255, 0.24) inset, 0 10px 24px -10px rgba(74, 222, 128, 0.62);
}

/* ── Top bar ─────────────────────────────────────────────────────── */
.topbar {
  height: 48px;
  background: var(--bg-1);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  flex-shrink: 0;
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: 20px;
}
.logo {
  font-weight: 700;
  font-size: 15px;
  background: linear-gradient(135deg, var(--accent), #6ee79b);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: -0.01em;
}
.section-title {
  color: var(--text-3);
  font-size: 13px;
  font-weight: 500;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: var(--bg-2);
  border: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-3);
  transition:
    background-color var(--transition),
    border-color var(--transition),
    color var(--transition),
    box-shadow var(--transition);
}
.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-4);
  transition:
    background-color var(--transition),
    border-color var(--transition),
    color var(--transition),
    box-shadow var(--transition);
}
.status-pill.online .status-dot {
  background: var(--green);
  box-shadow: 0 0 6px color-mix(in srgb, var(--green) 40%, transparent);
}
.status-pill.offline .status-dot {
  background: var(--red);
}
.status-pill.online {
  border-color: color-mix(in srgb, var(--green) 20%, transparent);
  color: var(--text-2);
}
.status-pill.offline {
  border-color: rgba(248, 113, 113, 0.2);
  color: var(--text-2);
}

.icon-btn {
  width: 32px;
  height: 32px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-3);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background-color var(--transition),
    border-color var(--transition),
    color var(--transition),
    box-shadow var(--transition);
}
.icon-btn:hover {
  background: var(--bg-2);
  color: var(--text-1);
  border-color: var(--border);
}

/* ── Persistent header actions: Search / Inbox / + New ─────────────── */
.topbar-action {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 8px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition:
    background-color var(--transition),
    border-color var(--transition),
    color var(--transition),
    box-shadow var(--transition);
  position: relative;
}

/* System pulse chip — the instrument-panel heartbeat in the topbar. */
.topbar-pulse {
  margin-left: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
}
.topbar-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--status-idle);
  flex: none;
  transition:
    background var(--transition),
    box-shadow var(--transition);
}

/* Runtime chip: what runs in the background on this computer (renderRuntimeChip).
   The dot is the state; the label says it in words. */
.topbar-runtime {
  font-size: 11px;
}
.topbar-runtime[data-state="off"] .topbar-pulse-dot {
  background: var(--status-idle);
}
.topbar-runtime[data-state="limited"] .topbar-pulse-dot {
  background: var(--status-warn);
}
.topbar-runtime[data-state="on"] .topbar-pulse-dot {
  background: var(--status-ok);
}
.topbar-runtime[data-state="unknown"] .topbar-pulse-dot {
  background: var(--status-bad);
}
/* Assistant permission mode stays legible when the other header labels collapse. */
.topbar-permission {
  font-size: 11px;
  white-space: nowrap;
}
.topbar-permission[hidden] {
  display: none;
}
.topbar-permission[data-mode="full"] {
  color: var(--status-warn);
  border-color: var(--status-warn);
}
/* An empty wrap would still take a flex gap while the chip waits for its first read. */
.topbar-runtime-wrap:has(> .topbar-runtime[hidden]) {
  display: none;
}
/* The chip sits on the left of the bar, so its menu opens rightwards. */
.topbar-runtime-wrap .topbar-account-menu {
  left: 0;
  right: auto;
  max-width: 380px;
}
/* The pilot panel opens under its pill, leftwards, like the account menus. */
.topbar-pilot-wrap {
  position: relative;
}
.topbar-pilot-panel {
  max-width: 340px;
}
.topbar-pilot-detail {
  margin: 0;
  padding: 8px 12px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-2);
}
/* Menu items are flex boxes, which the hidden attribute alone does not hide. */
.topbar-pilot-wrap[hidden],
.topbar-pilot-panel .topbar-account-menu-item[hidden] {
  display: none;
}
/* At phone width the chip sits mid-bar, and a menu opening rightwards from it
   ran past the screen's edge (the page never scrolls sideways). There the bar
   holds the menu instead of the chip, and the menu spans it. */
@media (max-width: 600px) {
  .topbar {
    position: relative;
    height: auto;
    min-height: 48px;
    flex-wrap: wrap;
    gap: 8px;
    padding-block: 8px;
  }
  .topbar-left,
  .topbar-right {
    min-width: 0;
    flex-wrap: wrap;
  }
  .topbar-right {
    margin-left: auto;
  }
  .topbar:has(#web-signout) {
    padding-inline: 12px;
  }
  .topbar:has(#web-signout) .topbar-left {
    gap: 8px;
  }
  .topbar:has(#web-signout) .section-title {
    display: none;
  }
  #web-signout {
    white-space: nowrap;
  }
  .topbar-account-wrap.topbar-runtime-wrap,
  .topbar-account-wrap.topbar-ws-wrap,
  .topbar-pilot-wrap {
    position: static;
  }
  .topbar-runtime-wrap .topbar-account-menu,
  .topbar-ws-wrap .topbar-account-menu,
  .topbar-pilot-wrap .topbar-account-menu {
    left: 14px;
    right: 14px;
    min-width: 0;
    max-width: none;
  }
}
.topbar-runtime-line {
  padding: 6px 12px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-2);
}
/* Workspace switcher: what each desk holds, under its name. */
.topbar-ws-contents {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.3;
  color: var(--text-3);
}
.topbar-action:hover {
  background: var(--bg-3, var(--bg-2));
  color: var(--text-1);
  border-color: var(--text-4);
}
.topbar-action.primary {
  background: var(--accent, #4ade80);
  border-color: var(--accent, #4ade80);
  color: #fff;
}
/* The #6b5aee fallbacks here were the last of the purple template this theme
   was recoloured from: a green button that turned PURPLE on hover. */
.topbar-action.primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--accent-ink);
}
.topbar-action-icon {
  font-size: 13px;
  line-height: 1;
}
.topbar-action-label {
  line-height: 1;
}
.topbar-action-kbd {
  font-size: 11px;
  padding: 2px 4px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text-4);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  margin-left: 2px;
}
.topbar-action-arrow {
  font-size: 9px;
  opacity: 0.7;
}
.topbar-badge {
  background: var(--red);
  color: var(--danger-ink);
  font-size: 10px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 4px;
  min-width: 16px;
  text-align: center;
  line-height: 1.3;
}

.topbar-account-wrap {
  position: relative;
}
.topbar-account-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-4);
  flex-shrink: 0;
}
.topbar-account-dot.online {
  background: var(--green);
}
.topbar-account-dot.warning {
  background: var(--yellow, #eab308);
}
.topbar-account-dot.offline {
  background: var(--red, #f87171);
}
.topbar-account-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 2px);
  min-width: 260px;
  max-height: 480px;
  overflow-y: auto;
  box-shadow: var(--shadow-popover);
  padding: 4px;
  z-index: 100;
}
.topbar-account-menu-section {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-4, #52525b);
  padding: 8px 12px 4px;
}
.topbar-account-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-1);
}
.topbar-account-menu-item:hover {
  background: var(--bg-3, var(--bg-2));
}
.topbar-account-menu-item.active {
  background: var(--bg-3, var(--bg-2));
  font-weight: 600;
}
.topbar-account-menu-item-platform {
  font-size: 11px;
  color: var(--text-3);
  margin-left: auto;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.topbar-account-menu-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

.topbar-new-wrap {
  position: relative;
}
.topbar-new-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 2px);
  min-width: 220px;
  box-shadow: var(--shadow-popover);
  padding: 4px;
  z-index: 100;
}
.topbar-new-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  color: var(--text-2);
  font-size: 12px;
  cursor: pointer;
  border-radius: 4px;
  transition: background var(--transition);
}
.topbar-new-menu-item:hover {
  background: var(--bg-2);
  color: var(--text-1);
}
.topbar-new-menu-item .menu-icon {
  font-size: 14px;
  width: 18px;
  text-align: center;
}
.topbar-new-menu-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}
.topbar-new-menu-section {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-4);
  padding: 6px 12px 2px;
  font-weight: 700;
}

/* Hide labels on narrow viewports */
@media (max-width: 1100px) {
  .topbar-action-label,
  .topbar-action-kbd {
    display: none;
  }
  .topbar-action {
    padding: 0 8px;
  }
}

/* ── Layout ──────────────────────────────────────────────────────── */
.main {
  display: flex;
  flex: 1;
  min-height: 0;
}

/* ── Sidebar ─────────────────────────────────────────────────────── */
.sidebar {
  width: 220px;
  background: var(--bg-0);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  flex-shrink: 0;
  padding: 16px 0;
  display: flex;
  flex-direction: column;
}
.sidebar-section {
  margin-bottom: 8px;
}
.sidebar-section-secondary {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding-top: 8px;
}
.sidebar-section-secondary.collapsed .sidebar-nav {
  display: none;
}
.sidebar-group-label {
  padding: 0 16px 6px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-4);
  font-weight: 600;
  cursor: default;
}
.sidebar-group-label.clickable {
  cursor: pointer;
}
.sidebar-group-label.clickable:hover {
  color: var(--text-3);
}
.sidebar-group-label .collapse-arrow {
  display: inline-block;
  font-size: 8px;
  margin-left: 4px;
  transition: transform var(--transition);
}
.sidebar-section-secondary.collapsed .collapse-arrow {
  transform: rotate(-90deg);
}

/* ── Section header (Hub / Intelligence / Platforms / System) ─────── */
.sidebar-section-header {
  padding: 14px 16px 4px;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-4);
  font-weight: 700;
  -webkit-user-select: none;
  user-select: none;
}
.sidebar-section-header:first-child {
  padding-top: 6px;
}
.sidebar-section + .sidebar-section-header,
.sidebar-platform + .sidebar-section-header {
  padding-top: 16px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}
.sidebar-system {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding-top: 4px;
}

/* Tutorial progress dots */
.tutorial-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-1);
  cursor: pointer;
  padding: 0;
  transition: all var(--transition);
}
.tutorial-dot:hover {
  border-color: var(--accent);
}
.tutorial-dot.visited {
  background: var(--accent-soft);
  border-color: var(--accent);
}
.tutorial-dot.active {
  background: var(--accent);
  border-color: var(--accent);
  transform: scale(1.3);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  color: var(--text-3);
  text-decoration: none;
  cursor: pointer;
  font-size: 13px;
  border-radius: 0;
  position: relative;
  transition:
    background-color var(--transition),
    border-color var(--transition),
    color var(--transition),
    box-shadow var(--transition);
}
.nav-item:hover {
  background: var(--bg-2);
  color: var(--text-2);
}
.nav-item.active {
  background: var(--accent-soft);
  color: var(--text-1);
}
.nav-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
}
.nav-icon {
  font-size: 14px;
  width: 18px;
  text-align: center;
  opacity: 0.8;
}
.nav-label {
  flex: 1;
  font-weight: 450;
}
.nav-badge {
  font-size: 10px;
  min-width: 18px;
  text-align: center;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  background: var(--bg-3);
  color: var(--text-3);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.nav-badge.hot {
  background: var(--red-soft);
  color: var(--red);
}
.nav-item-tg {
  font-size: 12px;
}
.nav-item-tg .nav-label::after {
  content: " \2197";
  font-size: 10px;
  opacity: 0.3;
}
.sidebar-loading {
  padding: 20px 14px;
  color: var(--text-4);
  font-size: 12px;
}

/* ── Platform sections (dynamic sidebar) ────────────────────────── */
.sidebar-platform {
  margin-bottom: 2px;
}
.platform-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  transition: color var(--transition);
}
.platform-header:hover {
  color: var(--text-2);
}
.platform-header .platform-name {
  flex: 1;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-4);
  font-weight: 600;
}
.platform-header .platform-badge {
  font-size: 9px;
  color: var(--text-4);
  font-weight: 500;
}
.platform-header .platform-arrow {
  font-size: 8px;
  color: var(--text-4);
  transition: transform var(--transition);
}
.sidebar-platform.collapsed .platform-arrow {
  transform: rotate(-90deg);
}
.sidebar-platform.collapsed .platform-features {
  display: none;
}
.sidebar-platform.collapsed .platform-sep {
  display: none;
}
.sidebar-platform.locked .platform-header {
  opacity: 0.45;
}
.sidebar-platform.locked .platform-features {
  display: none;
}

/* ── V2 IA: beta pill + Platform Power Tools ────────────────────── */
.sidebar-beta-pill {
  margin: 0 16px 12px;
  padding: 4px 8px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: center;
  background: var(--accent-soft, rgba(74, 222, 128, $1));
  color: var(--accent, #4ade80);
  border: 1px solid var(--accent, #4ade80);
  border-radius: 4px;
  cursor: help;
}
.sidebar-power-tools {
  margin-top: 16px;
  border-top: 1px solid var(--border);
  padding-top: 8px;
}
.power-tools-header {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  -webkit-user-select: none;
  user-select: none;
}
.power-tools-header:hover {
  color: var(--text-3);
}
.power-tools-arrow {
  display: inline-block;
  font-size: 8px;
  transition: transform var(--transition);
}
.sidebar-power-tools.collapsed .power-tools-arrow {
  transform: rotate(-90deg);
}
.sidebar-power-tools.collapsed .power-tools-body {
  display: none;
}

.platform-accounts {
  padding: 2px 0;
}
.account-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 16px 4px 20px;
  cursor: pointer;
  font-size: 11px;
  color: var(--text-3);
  transition: background var(--transition);
  text-decoration: none;
  min-height: 26px;
}
.account-row:hover {
  background: var(--bg-2);
  color: var(--text-2);
}
.account-row.active {
  background: var(--accent-soft);
  color: var(--text-1);
}
.account-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.account-dot.green {
  background: var(--green);
}
.account-dot.yellow {
  background: var(--yellow);
}
.account-dot.red {
  background: var(--red);
}
.account-dot.gray {
  background: var(--text-4);
}
.account-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 450;
}
.account-detail {
  font-size: 9px;
  color: var(--text-4);
  white-space: nowrap;
  font-family: var(--font-mono);
}

.platform-sep {
  height: 1px;
  background: var(--border);
  margin: 4px 16px;
}
.platform-features .nav-item {
  padding: 6px 16px 6px 20px;
  font-size: 12px;
}
.platform-features .nav-icon {
  font-size: 12px;
  width: 16px;
}

.nav-item-connect {
  padding: 6px 16px 6px 20px;
  font-size: 11px;
  color: var(--text-4);
  cursor: pointer;
  border-left: 2px dashed var(--border);
  margin-left: 14px;
  transition: all var(--transition);
  text-decoration: none;
  display: block;
}
.nav-item-connect:hover {
  color: var(--accent);
  border-left-color: var(--accent);
}

.sidebar-bottom {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding-top: 4px;
}

/* ── Content ─────────────────────────────────────────────────────── */
.content {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px 80px;
  min-width: 0;
}

/* ── Icons (dashboard-icons.js) ──────────────────────────────────────
   ONE class, not 56. Per-icon classes would add 56 names to the surface
   check-css-classes.js has to track and buy nothing: the mark sizes off the
   current font-size and inherits colour, so a status hue on the parent flows
   straight into it. -0.125em is the optical baseline nudge that stops an icon
   sitting a hair high next to its label. */
.i {
  width: 1em;
  height: 1em;
  flex: none;
  vertical-align: -0.125em;
}
/* Button busy state — replaces the "⏳ " prefix withProgress() used to splice
   into textContent (which also destroyed any child nodes the button had). */
.btn.is-busy,
button.is-busy {
  opacity: 0.6;
  pointer-events: none;
  position: relative;
}
.btn.is-busy::after,
button.is-busy::after {
  content: "···";
  font-family: var(--font-mono);
  letter-spacing: 0.1em;
  margin-left: 6px;
  animation: skeleton-pulse 1.2s ease-in-out infinite;
}

/* ── Loading + skeletons ─────────────────────────────────────────── */
.loading {
  color: var(--text-4);
  text-align: center;
  padding: 64px 0;
  font-size: 13px;
}
/* A flat surface that breathes, not a sweeping highlight. The sweep was a
   3-stop linear-gradient, and gradients are out; an opacity pulse reads as
   "loading" just as clearly, costs one property instead of three, and composites
   on the GPU. `prefers-reduced-motion` already pins every animation to a single
   frame at :40, so this degrades to a plain block for anyone who asks. */
.skeleton {
  background: var(--bg-2);
  animation: skeleton-pulse 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}
.skeleton-text {
  height: 14px;
  margin-bottom: 8px;
}
.skeleton-text.w-60 {
  width: 60%;
}
.skeleton-text.w-40 {
  width: 40%;
}
.skeleton-text.w-80 {
  width: 80%;
}
.skeleton-stat {
  height: 40px;
  width: 100%;
  margin-bottom: 8px;
}
.skeleton-row {
  height: 44px;
  width: 100%;
  margin-bottom: 2px;
}
@keyframes skeleton-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.45;
  }
}

/* ── Empty states ────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 80px 24px;
  color: var(--text-4);
}
.empty-state-icon {
  font-size: 36px;
  margin-bottom: 12px;
  opacity: 0.4;
}
.empty-state-title {
  font-size: 15px;
  color: var(--text-2);
  margin-bottom: 6px;
  font-weight: 500;
}
.empty-state-hint {
  font-size: 12px;
  line-height: 1.6;
  max-width: 360px;
  margin: 0 auto;
}

/* ── Page headers ────────────────────────────────────────────────── */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  gap: 16px;
}
.page-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-1);
  letter-spacing: -0.01em;
}
.page-subtitle {
  color: var(--text-3);
  font-size: 12px;
  margin-top: 4px;
}

/* ── Cards ────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 12px;
}

/* uiCard()'s surface. This lived as an inline style string inside dashboard.js,
   which meant the .ui-card class it also applied styled NOTHING: every card in
   the product carried a class the stylesheet had never heard of, and the only
   rule that mentioned .ui-card was in the print block. A theme change could not
   reach any of them.

   The inline string also carried three drifted fallbacks — `var(--bg-card,#13131a)`,
   `var(--border-soft,#2a2a38)`, `var(--radius-lg,10px)` — whose defaults were the
   pre-token values, including a 10px radius that is off a 2/4/4/9999 scale. They
   were inert only for as long as the tokens keep existing. */
.ui-card {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  /* md, not lg. Containers are 10px and lg (14px) is the modal/drawer step; this
     pointed at lg back when the two were aliases of the same 4px. */
  border-radius: var(--radius-md);
  padding: 14px;
}
.ui-card-interactive {
  cursor: pointer;
  transition:
    border-color var(--transition),
    background var(--transition);
}
/* :hover, not two JS listeners. The listeners it replaces also fought the
   element's own inline style, which is why they had to write a literal back. */
.ui-card-interactive:hover {
  border-color: var(--border-hover);
}
.ui-card-interactive:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.card-title {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.card-subtitle {
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 12px;
}

/* ── Stats grid ──────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.stat {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
}
.stat-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-4);
  margin-bottom: 4px;
  font-weight: 600;
}
.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-1);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.stat-sub {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}

/* ── Funnel (home hero) ──────────────────────────────────────────── */
.funnel {
  display: flex;
  gap: 2px;
  margin-bottom: 24px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  padding: 0;
}
.funnel-stage {
  flex: 1;
  text-align: center;
  padding: 20px 8px 16px;
  position: relative;
  transition: background var(--transition);
}
.funnel-stage:hover {
  background: var(--bg-2);
}
.funnel-stage:not(:last-child)::after {
  content: "\203A";
  position: absolute;
  right: -8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  color: var(--text-4);
  z-index: 1;
}
.funnel-count {
  font-size: 24px;
  font-weight: 700;
  display: block;
  color: var(--text-1);
  font-variant-numeric: tabular-nums;
}
.funnel-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
  margin-top: 4px;
  display: block;
}
.funnel-bar {
  height: 3px;
  margin-top: 10px;
  background: var(--bg-3);
  border-radius: 2px;
  overflow: hidden;
}
.funnel-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.4s ease-out;
}

/* ── Tabs ─────────────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.tab {
  padding: 8px 16px;
  background: none;
  border: none;
  color: var(--text-3);
  font-size: 13px;
  font-weight: 450;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition:
    background-color var(--transition),
    border-color var(--transition),
    color var(--transition),
    box-shadow var(--transition);
  font-family: inherit;
}
.tab:hover {
  color: var(--text-2);
}
.tab.active {
  color: var(--text-1);
  border-bottom-color: var(--accent);
}
.tab-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  font-size: 10px;
  background: var(--bg-3);
  color: var(--text-3);
}

/* ── Filter row ──────────────────────────────────────────────────── */
.filter-row {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  align-items: center;
  flex-wrap: wrap;
}
.filter-input,
.filter-select {
  background: var(--bg-0);
  border: 1px solid var(--border);
  color: var(--text-1);
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-family: inherit;
  transition: border-color var(--transition);
}
.filter-input:focus,
.filter-select:focus {
  outline: none;
  border-color: var(--accent);
}
.filter-input {
  flex: 1;
  min-width: 200px;
}
.filter-input::placeholder {
  color: var(--text-4);
}

/* ── Tables ───────────────────────────────────────────────────────── */
.table-wrap {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow-x: auto;
  overflow-y: hidden;
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.table thead {
  position: sticky;
  top: 0;
  z-index: 2;
}
.table th {
  text-align: left;
  padding: 10px 14px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-4);
  font-weight: 600;
  background: var(--bg-0);
  border-bottom: 1px solid var(--border);
  cursor: default;
  white-space: nowrap;
  -webkit-user-select: none;
  user-select: none;
}
.table th.sortable {
  cursor: pointer;
}
.table th.sortable:hover {
  color: var(--text-2);
}
.table th .sort-arrow {
  font-size: 10px;
  margin-left: 2px;
  opacity: 0.4;
}
.table th.sorted .sort-arrow {
  opacity: 1;
  color: var(--accent);
}
.table td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(28, 28, 38, 0.5);
  color: var(--text-2);
  vertical-align: middle;
}
.table tbody tr {
  transition: background var(--transition);
  position: relative;
}
.table tbody tr {
  border-left: 2px solid transparent;
}
.table tbody tr:hover {
  background: var(--bg-2);
  cursor: pointer;
  border-left-color: var(--accent);
}
.table tbody tr:last-child td {
  border-bottom: none;
}
.table td .primary-cell {
  color: var(--text-1);
  font-weight: 500;
}
.table td .secondary-cell {
  color: var(--text-3);
  font-size: 11px;
}
.benchmark-mobile-label {
  display: none;
}
@media (max-width: 700px) {
  .competitor-benchmark-table,
  .competitor-benchmark-table tbody,
  .competitor-benchmark-table tr,
  .competitor-benchmark-table th {
    display: block;
  }
  .competitor-benchmark-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .competitor-benchmark-table tbody th {
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .competitor-benchmark-table td {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
    gap: 8px;
    padding: 7px 14px;
  }
  .competitor-benchmark-table .benchmark-mobile-label,
  .competitor-benchmark-table td.benchmark-actions {
    display: block;
  }
  .competitor-benchmark-table .benchmark-mobile-label {
    color: var(--text-3);
  }
}
.table td .mono {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
}

/* Row actions — visible on hover */
.row-actions {
  opacity: 0;
  transition: opacity var(--transition);
  display: flex;
  gap: 4px;
}
.table tbody tr:hover .row-actions {
  opacity: 1;
}

/* ── CRM: smart views, score bars, engagement, filters ─────────── */
.smart-views {
  display: flex;
  gap: 6px;
  padding: 0 0 12px;
  overflow-x: auto;
  /* Hide scrollbar — three vendors covered:
     • scrollbar-width: Firefox, Chrome 121+, modern Edge
     • -ms-overflow-style: legacy IE / pre-Chromium Edge
     • ::-webkit-scrollbar (below): older Chrome, Safari, iOS Safari */
  scrollbar-width: none;
  -ms-overflow-style: none;
  flex-wrap: wrap;
}
.smart-views::-webkit-scrollbar {
  display: none;
}
.smart-view-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--bg-1);
  color: var(--text-3);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
  font-family: inherit;
}
.smart-view-chip:hover {
  border-color: rgba(74, 222, 128, 0.3);
  color: var(--text-2);
  background: var(--bg-2);
}
.smart-view-chip.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.score-bar-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 60px;
}
.score-bar {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: var(--bg-3);
  overflow: hidden;
  flex-shrink: 0;
}
.score-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.2s;
}
.score-bar-fill.score-low {
  background: var(--text-4);
}
.score-bar-fill.score-mid {
  background: var(--yellow);
}
.score-bar-fill.score-high {
  background: var(--blue);
}
.score-bar-fill.score-hot {
  background: var(--green);
}
.score-num {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-3);
  min-width: 18px;
}

.target-star {
  color: var(--yellow);
  margin-right: 4px;
  font-size: 11px;
}

.engagement-mini {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  font-family: var(--font-mono);
}
.engagement-mini .eng-item {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.engagement-mini .eng-item.active {
  color: var(--text-2);
}
.engagement-mini .eng-item.zero {
  color: var(--text-4);
  opacity: 0.5;
}
.engagement-mini .eng-label {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
}

.filter-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding-bottom: 8px;
}
.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px 3px 10px;
  border-radius: var(--radius-full);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 10px;
  font-weight: 500;
}
.filter-pill-x {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: 12px;
  padding: 0 2px;
  font-family: inherit;
  opacity: 0.7;
  transition: opacity var(--transition);
}
.filter-pill-x:hover {
  opacity: 1;
}

.tag-autocomplete {
  position: relative;
  flex: 0 0 auto;
}
.tag-autocomplete .filter-input {
  width: 160px;
  min-width: 120px;
}
.tag-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 240px;
  overflow-y: auto;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  z-index: 50;
  margin-top: 4px;
}
.tag-dropdown-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 12px;
  font-size: 12px;
  color: var(--text-2);
  cursor: pointer;
  transition: background var(--transition);
}
.tag-dropdown-item:hover {
  background: var(--bg-2);
}
.tag-dropdown-item .tag-count {
  color: var(--text-4);
  font-size: 10px;
  font-family: var(--font-mono);
}

.tag-removable {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px 2px 8px;
  border-radius: var(--radius-full);
  background: var(--bg-3);
  color: var(--text-3);
  font-size: 10px;
  font-weight: 600;
}
.tag-remove-btn {
  background: none;
  border: none;
  color: var(--text-4);
  cursor: pointer;
  font-size: 11px;
  padding: 0 2px;
  font-family: inherit;
  transition: color var(--transition);
}
.tag-remove-btn:hover {
  color: var(--red);
}

.inline-stage-picker {
  position: absolute;
  z-index: 50;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  min-width: 200px;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(28, 28, 38, 0.3);
}
.activity-item:last-child {
  border-bottom: none;
}
.activity-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
  background: var(--bg-2);
}
.activity-body {
  flex: 1;
  min-width: 0;
}
.activity-text {
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.5;
}
.activity-contact {
  color: var(--accent);
  cursor: pointer;
  font-weight: 500;
}
.activity-contact:hover {
  text-decoration: underline;
}
.activity-time {
  font-size: 10px;
  color: var(--text-4);
  margin-top: 2px;
  font-family: var(--font-mono);
}

.target-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-3);
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}
.target-toggle input[type="checkbox"] {
  accent-color: var(--accent);
  width: 13px;
  height: 13px;
  cursor: pointer;
}

/* ── Badges / status ─────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-green {
  background: var(--green-soft);
  color: var(--green);
}
.badge-yellow {
  background: var(--yellow-soft);
  color: var(--yellow);
}
.badge-red {
  background: var(--red-soft);
  color: var(--red);
}
.badge-blue {
  background: var(--blue-soft);
  color: var(--blue);
}
.badge-gray {
  background: var(--bg-3);
  color: var(--text-3);
}
.badge-purple {
  background: var(--accent-soft);
  color: var(--accent);
}

/* Status dot + label pattern (Linear style) */
.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}
.status-dot-inline {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-dot-inline.green {
  background: var(--green);
}
.status-dot-inline.yellow {
  background: var(--yellow);
}
.status-dot-inline.red {
  background: var(--red);
}
.status-dot-inline.blue {
  background: var(--blue);
}
.status-dot-inline.gray {
  background: var(--text-4);
}

/* ── Buttons ─────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition:
    background-color var(--transition),
    border-color var(--transition),
    color var(--transition),
    box-shadow var(--transition),
    opacity var(--transition);
  white-space: nowrap;
}
/* The same gradient-and-glow treatment as the marketing site's CTA, in the
   app's green rather than the parent cyan: brand architecture keeps Growth
   green, and the dashboard is the Growth Terminal's arm. */
.btn-primary {
  color: var(--accent-ink);
  background-image: linear-gradient(
    135deg,
    var(--accent-hover) 0%,
    var(--accent) 46%,
    var(--accent-deep) 100%
  );
  box-shadow: var(--shadow-primary);
  transition:
    filter var(--transition),
    box-shadow var(--transition),
    transform var(--transition);
}
.btn-primary:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
  box-shadow: var(--shadow-primary-hover);
}
.btn-primary:active {
  transform: translateY(0);
}
.btn-secondary {
  background: var(--bg-2);
  color: var(--text-2);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: var(--bg-3);
  color: var(--text-1);
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
}
.btn-danger {
  background: var(--red-soft);
  color: var(--red);
}
.btn-danger:hover {
  background: rgba(248, 113, 113, 0.2);
}
.btn-tiny {
  padding: 4px 8px;
  font-size: 10px;
}
.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.reply-outcome-controls,
.reply-outcome-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.reply-outcome-controls {
  margin-top: 8px;
  cursor: default;
}
.reply-outcome-actions button {
  min-height: 28px;
}
.reply-outcome-actions button[hidden] {
  display: none;
}
.reply-outcome-actions button[aria-disabled="true"] {
  opacity: 0.6;
  cursor: wait;
}

/* Applied by JS but never defined, so these rendered as unstyled browser
   defaults on the dark body. Surfaced by tools/check-css-classes.js; the
   remaining 77 are baselined rather than swept (CLAUDE.md rule 7). */
.btn-sm {
  padding: 4px 10px;
  font-size: 11px;
}
.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  background: var(--bg-2);
  color: var(--text-1);
}

/* .pill — 18 uses across 7 scripts, the single most-applied undefined class.
   A neutral, slightly softer sibling of .badge. */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: var(--radius-full);
  background: var(--bg-2);
  color: var(--text-2);
  border: 1px solid var(--border);
  font-size: 10px;
  font-weight: 500;
  white-space: nowrap;
}

/* Form controls built by el("input"|"select"|"textarea", …) with a bare
   .input / .nx-input class. Element-level styling (the pattern the reference
   repo uses) is deliberately avoided here — this stylesheet is shared with
   surfaces that rely on native control rendering. */
.input,
.nx-input {
  background: var(--bg-2);
  color: var(--text-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font: inherit;
  font-size: 12px;
  min-height: 30px;
}
.input:focus,
.nx-input:focus {
  outline: none;
  border-color: var(--accent);
}
.client-invoice-card,
.client-invoice-preview,
.client-invoice-history,
.client-invoice-form {
  display: grid;
  gap: 12px;
}
.client-invoice-fields {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  margin: 0;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
}
.client-invoice-fields legend {
  padding: 0 8px;
  font-weight: 600;
}
.client-invoice-fields .nx-label,
.client-invoice-preview .nx-label {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.client-invoice-fields p,
.client-invoice-fields .nx-label:has(textarea) {
  grid-column: 1 / -1;
}
.client-invoice-fields .btn,
.client-invoice-actions .btn {
  justify-self: start;
}
.client-invoice-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-block: 12px;
}
.client-invoice-card :is(h2, h3, p),
.client-invoice-preview :is(h3, p, ul),
.client-invoice-history ul {
  margin-block: 0;
}
.client-invoice-card :is(p, li),
.client-invoice-preview :is(p, li) {
  overflow-wrap: anywhere;
}

.nx-label {
  display: block;
  font-size: 11px;
  color: var(--text-3);
  margin-bottom: 4px;
}

/* ── Wizard sections ─────────────────────────────────────────────── */
.wizard {
  max-width: 900px;
}
.wizard-section {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin-bottom: 12px;
}
.wizard-section-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-4);
  margin-bottom: 12px;
  font-weight: 600;
}
.wizard-label {
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 4px;
  display: block;
}
.wizard-value {
  font-size: 13px;
  color: var(--text-1);
  margin-bottom: 12px;
}
.wizard-post {
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 12px;
  color: var(--text-3);
  font-style: italic;
  line-height: 1.6;
  margin-bottom: 12px;
  max-height: 160px;
  overflow-y: auto;
}
.wizard-textarea {
  width: 100%;
  background: var(--bg-0);
  border: 1px solid var(--border);
  color: var(--text-1);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
  transition: border-color var(--transition);
}
.wizard-textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.wizard-input {
  width: 100%;
  background: var(--bg-0);
  border: 1px solid var(--border);
  color: var(--text-1);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  transition: border-color var(--transition);
}
.wizard-input:focus {
  outline: none;
  border-color: var(--accent);
}
.wizard-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  flex-wrap: wrap;
}

/* ── Campaign Wizard (Phase 1 IA) ────────────────────────────────── */
.wizard-steps {
  display: flex;
  gap: 8px;
  margin: 16px 0 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.wizard-step-dot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--text-4);
  font-size: 12px;
}
.wizard-step-dot.active {
  background: var(--accent-soft, rgba(74, 222, 128, $1));
  border-color: var(--accent);
  color: var(--accent);
}
.wizard-step-dot.done {
  color: var(--green, #4ade80);
  border-color: var(--green, #4ade80);
}
.wizard-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--bg-1);
  font-size: 10px;
  font-weight: 700;
}
.wizard-step-dot.active .wizard-step-num {
  background: var(--accent);
  color: var(--accent-ink);
}
.wizard-step-dot.done .wizard-step-num {
  background: var(--green, #4ade80);
  color: #fff;
}
.wizard-step-label {
  font-weight: 600;
}

.wizard-prefill-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--accent-soft, rgba(74, 222, 128, $1));
  border: 1px solid var(--accent, #4ade80);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--text-2);
}
.btn-link {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: 12px;
  text-decoration: underline;
  padding: 0;
}

.wizard-step-body {
  animation: wizard-fade 200ms ease;
}
@keyframes wizard-fade {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.wizard-intent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 24px;
}
.wizard-intent-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 4px);
  padding: 14px;
  cursor: pointer;
  transition: all var(--transition);
}
.wizard-intent-card:hover {
  border-color: var(--accent);
}
.wizard-intent-card.selected {
  background: var(--accent-soft, rgba(74, 222, 128, $1));
  border-color: var(--accent);
}
.wizard-intent-icon {
  font-size: 24px;
  margin-bottom: 6px;
}
.wizard-intent-label {
  font-weight: 700;
  font-size: 14px;
  color: var(--text-1);
}
.wizard-intent-desc {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 4px;
  line-height: 1.4;
}

.wizard-template-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.wizard-template-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}
.wizard-template-card:hover {
  background: var(--bg-2);
  border-color: var(--accent);
}
.wizard-template-card.selected {
  border-color: var(--accent);
  background: var(--accent-soft, rgba(74, 222, 128, $1));
}
.wizard-template-icon {
  font-size: 22px;
  flex-shrink: 0;
}
.wizard-template-body {
  flex: 1;
  min-width: 0;
}
.wizard-template-title {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-1);
  display: flex;
  align-items: center;
  gap: 6px;
}
.wizard-template-desc {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 2px;
}
.wizard-template-tag {
  font-size: 9px;
  padding: 1px 6px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-4);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.wizard-template-pill {
  font-size: 9px;
  padding: 2px 6px;
  margin-left: 8px;
  background: var(--accent);
  color: #fff;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  vertical-align: middle;
}

.wizard-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}
.wizard-field {
  display: flex;
  flex-direction: column;
}

.wizard-summary {
  margin-top: 20px;
  padding: 14px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.wizard-summary-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-4);
  font-weight: 700;
  margin-bottom: 10px;
}
.wizard-summary-row {
  display: flex;
  gap: 12px;
  padding: 4px 0;
  font-size: 12px;
}
.wizard-summary-label {
  min-width: 70px;
  color: var(--text-3);
}

.wizard-hint {
  padding: 16px;
  color: var(--text-4);
  font-size: 12px;
  text-align: center;
  background: var(--bg-2);
  border-radius: var(--radius-sm);
}

/* ── Operations Center (Phase 2 IA) ─────────────────────────────── */
.operations-center {
  max-width: 1200px;
}
.op-filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
}
/* Inline label (e.g., "Type", "Platform") prefixing each filter row.
   Lets users instantly distinguish the type and platform chip rows. */
.op-filter-row-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-4);
  font-weight: 700;
  margin-right: 4px;
  min-width: 56px;
}
/* "Recently Used" bucket gets a slightly different feel — accent-tinted header
   so the user spots their muscle-memory ops without parsing the label. */
.op-bucket-recent .op-bucket-header {
  color: var(--accent, #4ade80);
  border-bottom-color: var(--accent, #4ade80);
}
/* Pinned bucket gets a warmer accent so users distinguish it from Recently Used. */
.op-bucket-pinned .op-bucket-header {
  color: var(--yellow, #fbbf24);
  border-bottom-color: var(--yellow, #fbbf24);
}

/* Pin star — overlaid in the top-right corner of each card. Default empty
   star, fills + tints yellow when pinned. Click event bubbles are stopped at
   the JS level so it doesn't trigger the card's own onclick. */
.op-card {
  position: relative;
} /* anchor for absolute pin button */
.op-card-pin {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  color: var(--text-4);
  border-radius: 4px;
  transition: all var(--transition);
  padding: 0;
}
.op-card-pin:hover {
  background: var(--bg-2);
  color: var(--yellow, #fbbf24);
}
.op-card-pin.pinned {
  color: var(--yellow, #fbbf24);
}

/* "Ran X ago" footer. Subtle, only present when telemetry has a launch event
   for this op — keeps clean cards uncluttered when there's nothing to show. */
.op-card-lastrun {
  font-size: 10px;
  color: var(--text-4);
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}

/* View-mode toggle in the page header. Pair of icon buttons; active one is
   accent-tinted. Subtle so the search box stays the visual anchor. */
.op-view-toggle {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  align-self: flex-start;
}
.op-view-btn {
  width: 30px;
  height: 30px;
  background: var(--bg-2);
  border: none;
  color: var(--text-4);
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}
.op-view-btn:hover {
  color: var(--text-2);
}
.op-view-btn.active {
  background: var(--accent-soft, rgba(74, 222, 128, $1));
  color: var(--accent, #4ade80);
}

/* List view — single column, denser cards. Same op-card markup just laid out
   horizontally (icon | titles+desc | tags+platforms+lastrun). */
.op-grid--list {
  grid-template-columns: 1fr;
}
.op-grid--list .op-card {
  flex-direction: row;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
}
.op-grid--list .op-card-header {
  flex: 1;
  gap: 12px;
}
.op-grid--list .op-card-tags,
.op-grid--list .op-platforms {
  flex-shrink: 0;
}
.op-grid--list .op-card-lastrun {
  flex-shrink: 0;
  margin-top: 0;
  padding-left: 8px;
  border-left: 1px solid var(--border);
}
.op-grid--list .op-card-desc {
  font-size: 11px;
  -webkit-line-clamp: 1;
  line-clamp: 1;
  overflow: hidden;
}

/* "● N running" badge — top-right of card (between pin star and corner).
   Green dot + count tells the user this op already has live workflows so they
   don't accidentally double-launch. */
.op-card-running {
  position: absolute;
  top: 8px;
  right: 36px; /* clear of the pin star at right: 8px */
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  background: rgba(74, 222, 128, 0.12);
  color: var(--green, #4ade80);
  border: 1px solid rgba(74, 222, 128, 0.3);
  border-radius: 4px;
  line-height: 1.4;
}
/* Subtle accent border on cards with active workflows so they pop in the grid. */
.op-card--active {
  border-color: rgba(74, 222, 128, 0.4);
}
.op-card--active:hover {
  border-color: var(--green, #4ade80);
}

/* Needs-setup state — card is dimmed and click navigates to Accounts instead
   of the launch flow. The "Connect →" footer makes the recovery action obvious
   without having to go discover it mid-wizard. */
.op-card--needs-setup {
  opacity: 0.6;
  background: var(--bg-1);
}
.op-card--needs-setup:hover {
  opacity: 0.85;
  border-color: var(--border);
  transform: none;
}
.op-card-needs-setup {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  padding: 6px 10px;
  background: var(--bg-2);
  border-left: 3px solid var(--yellow, #fbbf24);
  border-radius: 4px;
  font-size: 11px;
  color: var(--text-3);
}
.op-card-needs-setup .btn-link {
  color: var(--yellow, #fbbf24);
  font-size: 11px;
  font-weight: 600;
}

/* Auto-skipped account pill — appears at top of Configure step when there
   was only one account to choose, so we silently picked it. Compact, accent-
   tinted, with a "change" link that takes the user back to step 1. */
.op-auto-account-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  margin-bottom: 16px;
  background: var(--accent-soft, rgba(74, 222, 128, $1));
  border: 1px solid var(--accent, #4ade80);
  border-radius: var(--radius-full);
  color: var(--accent, #4ade80);
  font-size: 12px;
  font-weight: 500;
}
.op-auto-account-pill .btn-link {
  color: var(--accent, #4ade80);
  font-size: 11px;
  margin-left: 4px;
}
.op-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--text-3);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}
.op-filter-chip:hover {
  color: var(--text-1);
  border-color: var(--text-4);
}
.op-filter-chip.active {
  background: var(--accent-soft, rgba(74, 222, 128, $1));
  border-color: var(--accent, #4ade80);
  color: var(--accent, #4ade80);
}
.op-filter-chip.op-filter-clear {
  color: var(--red);
  border-color: var(--red);
  background: transparent;
}

.op-search-input {
  width: 100%;
  max-width: 480px;
  padding: 8px 12px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-1);
  font-size: 13px;
  margin-bottom: 20px;
  transition: border-color var(--transition);
}
.op-search-input:focus {
  outline: none;
  border-color: var(--accent);
}

.op-bucket {
  margin-bottom: 28px;
}
.op-bucket-header {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-4);
  font-weight: 700;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.op-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
.op-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 4px);
  padding: 14px;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.op-card:hover,
.op-card:focus-visible {
  border-color: var(--accent);
  background: var(--bg-1);
  outline: none;
  transform: translateY(-1px);
}
.op-card-header {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.op-card-icon {
  font-size: 22px;
  flex-shrink: 0;
  line-height: 1;
}
.op-card-titles {
  flex: 1;
  min-width: 0;
}
.op-card-label {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-1);
}
.op-card-desc {
  font-size: 11px;
  color: var(--text-3);
  line-height: 1.4;
  margin-top: 3px;
}
.op-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.op-tag {
  font-size: 9px;
  padding: 2px 6px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text-4);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.op-tag-multi-account {
  color: #4ade80;
  border-color: rgba(74, 222, 128, $1);
}
.op-tag-passive {
  color: #4ade80;
  border-color: rgba(74, 222, 128, 0.3);
}
.op-tag-single-platform {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.3);
}
.op-tag-multi-step {
  color: #60a5fa;
  border-color: rgba(96, 165, 250, 0.3);
}
.op-tag-cross-platform {
  color: #f472b6;
  border-color: rgba(244, 114, 182, 0.3);
}

.op-platforms {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.op-platform-pill {
  font-size: 10px;
  padding: 2px 6px;
  background: var(--bg-1);
  border-radius: 3px;
  color: var(--text-3);
}

.op-empty {
  padding: 40px 16px;
  text-align: center;
  color: var(--text-4);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.op-empty-icon {
  font-size: 32px;
  opacity: 0.5;
}

/* AccountPicker */
.op-account-picker {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 12px;
}
.op-account-section {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
}
.op-account-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.op-account-platform-name {
  font-weight: 600;
  font-size: 12px;
  color: var(--text-1);
}
.op-account-count {
  font-size: 10px;
  color: var(--text-4);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.op-account-empty {
  font-size: 12px;
  color: var(--text-4);
  padding: 8px 0;
}
.op-account-empty a {
  color: var(--accent);
  text-decoration: none;
}
.op-account-empty a:hover {
  text-decoration: underline;
}
.op-account-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.op-account-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--text-2);
  font-size: 12px;
  cursor: pointer;
  transition: all var(--transition);
}
.op-account-chip:hover {
  border-color: var(--accent);
  color: var(--text-1);
}
.op-account-chip.selected {
  background: var(--accent-soft, rgba(74, 222, 128, $1));
  border-color: var(--accent);
  color: var(--accent);
}
.op-account-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--text-4);
}
.op-account-dot.green {
  background: var(--green, #4ade80);
}
.op-account-dot.yellow {
  background: var(--yellow, #fbbf24);
}
.op-account-dot.red {
  background: var(--red, #f87171);
}
.op-account-dot.gray {
  background: var(--text-4);
}
.op-account-chip-label {
  line-height: 1;
}

.char-counter {
  font-size: 10px;
  color: var(--text-4);
  text-align: right;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}
.char-counter.over {
  color: var(--red);
}

/* ── Toggles ─────────────────────────────────────────────────────── */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid rgba(28, 28, 38, 0.4);
}
.toggle-row:last-child {
  border-bottom: none;
}
.toggle-label {
  font-size: 12px;
  color: var(--text-2);
}
.toggle {
  width: 36px;
  height: 20px;
  background: var(--bg-3);
  border-radius: 4px;
  position: relative;
  cursor: pointer;
  transition: background var(--transition);
  flex-shrink: 0;
}
.toggle::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: white;
  border-radius: 50%;
  transition: left var(--transition);
}
.toggle.on {
  background: var(--green);
}
.toggle.on::after {
  left: 18px;
}

/* ── Web sign-in (app.html) ─────────────────────────────────────── */
/* web-auth.js shows and hides the overlay through its inline display. */
.web-auth-overlay {
  position: fixed;
  inset: 0;
  background: var(--scrim-auth);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.web-auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 24px;
  width: 420px;
  max-width: calc(100vw - 32px);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  box-sizing: border-box;
  font-family: var(--font-body);
  color: var(--text-1);
}
.web-auth-title {
  margin: 0 0 8px;
  font-size: 20px;
  color: var(--text-1);
}
.web-auth-lede {
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.5;
}

/* ── Drawer ──────────────────────────────────────────────────────── */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: var(--scrim);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  display: none;
  z-index: 100;
  transition: opacity 0.2s;
}
.drawer-backdrop.show {
  display: block;
}
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 480px;
  max-width: 90vw;
  background: var(--bg-1);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  /* A closed drawer sits off screen: hidden, so it is out of the tab order and
     no measure of the page counts its header as running past a phone screen.
     Visibility flips only once the slide out has finished. */
  visibility: hidden;
  transition:
    transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
    visibility 0s linear 0.25s;
  z-index: 101;
}
.drawer.show {
  transform: translateX(0);
  visibility: visible;
  transition:
    transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
    visibility 0s;
}
.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.drawer-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
}
.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  font-size: 13px;
  color: var(--text-2);
}
.drawer-body h4 {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-4);
  margin: 20px 0 8px;
  font-weight: 600;
}
.drawer-body h4:first-child {
  margin-top: 0;
}
.field-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid rgba(28, 28, 38, 0.3);
  gap: 12px;
}
.field-row:last-child {
  border-bottom: none;
}
.field-label {
  color: var(--text-4);
  font-size: 11px;
  flex-shrink: 0;
}
.field-value {
  color: var(--text-1);
  font-size: 12px;
  text-align: right;
  overflow-wrap: anywhere;
}

/* ── Toast ────────────────────────────────────────────────────────── */
.toast-region {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 12px;
  pointer-events: auto;
  animation: slideIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 380px;
  display: flex;
  align-items: center;
  gap: 8px;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.toast.ok {
  background: rgba(52, 211, 153, 0.15);
  color: var(--green);
  border: 1px solid rgba(52, 211, 153, 0.2);
}
.toast.err {
  background: rgba(248, 113, 113, 0.15);
  color: var(--red);
  border: 1px solid rgba(248, 113, 113, 0.2);
}
.toast.info {
  background: rgba(96, 165, 250, 0.15);
  color: var(--blue);
  border: 1px solid rgba(96, 165, 250, 0.2);
}
.toast-dismiss {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  opacity: 0.5;
  font-size: 14px;
  padding: 0 2px;
  margin-left: auto;
}
.toast-dismiss:hover {
  opacity: 1;
}
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(16px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ── Pagination ──────────────────────────────────────────────────── */
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  padding: 8px 0;
  font-size: 12px;
  color: var(--text-3);
}
.pagination-controls {
  display: flex;
  gap: 4px;
  align-items: center;
}
.pagination-page {
  min-width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-3);
  font-size: 11px;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--transition);
}
.pagination-page:hover {
  background: var(--bg-2);
  color: var(--text-1);
}
.pagination-page.active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: rgba(74, 222, 128, 0.3);
}

/* ── Alert card ──────────────────────────────────────────────────── */
.alert-card {
  background: var(--accent-soft);
  border: 1px solid rgba(74, 222, 128, 0.2);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 16px;
}
.alert-card.warning {
  background: var(--yellow-soft);
  border-color: rgba(251, 191, 36, 0.2);
}
.alert-card.error {
  background: var(--red-soft);
  border-color: rgba(248, 113, 113, 0.2);
}
.alert-card.success {
  background: var(--green-soft);
  border-color: rgba(52, 211, 153, 0.2);
}
.alert-card-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text-1);
}
.alert-card-body {
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-2);
}

/* ── Channel health bars (home) ──────────────────────────────────── */
.channel-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(28, 28, 38, 0.3);
}
.channel-row:last-child {
  border-bottom: none;
}
.channel-icon {
  width: 20px;
  text-align: center;
  flex-shrink: 0;
  font-size: 12px;
}
.channel-name {
  width: 180px;
  font-size: 12px;
  color: var(--text-2);
  flex-shrink: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.channel-bar {
  flex: 1;
  height: 4px;
  background: var(--bg-3);
  border-radius: 2px;
  overflow: hidden;
}
.channel-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.4s ease-out;
}
.channel-bar-fill.healthy {
  background: var(--green);
}
.channel-bar-fill.degraded {
  background: var(--yellow);
}
.channel-bar-fill.down {
  background: var(--red);
}
.channel-detail {
  font-size: 10px;
  color: var(--text-4);
  width: 120px;
  text-align: right;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

/* ── Safety-net for the <button class="card"> antipattern ──────────
   Buttons inherit browser-default text color (varies by OS, often near-black)
   instead of the theme's text color. Any historical/future use of `<button>`
   with the `card` class would otherwise render unreadable on the dark theme.
   This single rule protects the whole codebase. */
button.card {
  color: var(--text-1);
  font-family: inherit;
  text-align: left;
}

/* ── Action card (Competitor routines, Platform Operations, Group Ops) ──
   Reusable polished card-style button. Use anywhere a clickable card needs to
   show: icon · title · description · optional "+" affordance. Replaces the
   older inline-styled <button class="card"> grids.

   Markup contract:
     <button class="action-card">
       <div class="action-card-icon">📌</div>
       <div class="action-card-body">
         <div class="action-card-title">Title</div>
         <div class="action-card-desc">One-line description</div>
       </div>
       <div class="action-card-cta">+</div>   (optional)
     </button>
*/
/* Grid container — both names supported (the older one is kept as an alias
   for code that hasn't been migrated to .action-card-grid yet). */
.action-card-grid,
.routine-template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
}

.action-card,
.routine-template-card {
  color: var(--text-1);
  font-family: inherit;
  text-align: left;

  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 4px);
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.action-card:hover,
.routine-template-card:hover {
  background: var(--bg-1);
  border-color: var(--accent, #4ade80);
  transform: translateY(-1px);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}
.action-card:hover .action-card-cta,
.routine-template-card:hover .routine-template-card-cta {
  color: var(--accent, #4ade80);
  transform: scale(1.15);
}
.action-card:focus-visible,
.routine-template-card:focus-visible {
  outline: 2px solid var(--accent, #4ade80);
  outline-offset: 2px;
}

/* Icon in its own subtle badge — prevents emoji overlap with title text and
   gives each card a clear visual anchor. */
.action-card-icon,
.routine-template-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 4px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  line-height: 1;
}
.action-card:hover .action-card-icon,
.routine-template-card:hover .routine-template-card-icon {
  border-color: var(--accent, #4ade80);
  background: var(--accent-soft, rgba(74, 222, 128, $1));
}

.action-card-body,
.routine-template-card-body {
  min-width: 0;
}

.action-card-title,
.routine-template-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-1);
  line-height: 1.3;
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.action-card-desc,
.routine-template-card-desc {
  font-size: 11px;
  color: var(--text-3);
  line-height: 1.4;
}
.action-card-meta {
  font-size: 10px;
  color: var(--text-4);
  font-family: var(--font-mono);
  margin-top: 4px;
}
.action-card-cta,
.routine-template-card-cta {
  font-size: 16px;
  color: var(--text-4);
  font-weight: 300;
  text-align: center;
  transition: all var(--transition);
  align-self: center;
}

/* ── Utility ─────────────────────────────────────────────────────── */
.hidden {
  display: none !important;
}
.muted {
  color: var(--text-3);
}
.small {
  font-size: 11px;
}
.row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.grow {
  flex: 1;
}
.mono {
  font-family: var(--font-mono);
}
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Scrollbars ──────────────────────────────────────────────────── */
.sidebar::-webkit-scrollbar,
.content::-webkit-scrollbar,
.drawer-body::-webkit-scrollbar,
.wizard-post::-webkit-scrollbar {
  width: 6px;
}
.sidebar::-webkit-scrollbar-thumb,
.content::-webkit-scrollbar-thumb,
.drawer-body::-webkit-scrollbar-thumb,
.wizard-post::-webkit-scrollbar-thumb {
  background: var(--bg-3);
  border-radius: 3px;
}
.sidebar::-webkit-scrollbar-thumb:hover {
  background: var(--text-4);
}
.sidebar::-webkit-scrollbar-track,
.content::-webkit-scrollbar-track,
.drawer-body::-webkit-scrollbar-track,
.wizard-post::-webkit-scrollbar-track {
  background: transparent;
}

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .sidebar {
    width: 56px;
  }
  .sidebar .nav-label,
  .sidebar .nav-badge,
  .sidebar .sidebar-group-label,
  .sidebar .collapse-arrow {
    display: none;
  }
  .nav-item {
    justify-content: center;
    padding: 8px 0;
  }
  .nav-icon {
    width: auto;
    font-size: 16px;
  }
  .content {
    padding: 20px 16px 60px;
  }
}

@media (max-width: 768px) {
  .page-header {
    flex-direction: column;
    align-items: stretch;
  }
  .page-header > * {
    min-width: 0;
  }
  .tabs {
    overflow-x: auto;
    overflow-y: hidden;
  }
  .tab {
    flex: 0 0 auto;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .funnel {
    flex-wrap: wrap;
  }
  .funnel-stage {
    min-width: 80px;
  }
  .table-wrap {
    overflow-x: auto;
  }
  .drawer {
    width: 100%;
    max-width: none;
  }
}

/* ── Keyboard shortcut overlay ───────────────────────────────────── */
.kbd-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  display: none;
  z-index: 300;
  align-items: center;
  justify-content: center;
}
.kbd-overlay.show {
  display: flex;
}
.kbd-box {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 400px;
  width: 100%;
}
.kbd-box h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 16px;
}
.kbd-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 12px;
}
.kbd-key {
  font-family: var(--font-mono);
  background: var(--bg-3);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  color: var(--text-2);
  border: 1px solid var(--border);
}

/* Live Map — pulsing dot for "running now" cron jobs */
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(1.4);
  }
}

/* ── Command palette (Cmd/Ctrl+K) ────────────────────────────────── */
.cmdk-overlay {
  position: fixed;
  inset: 0;
  background: var(--scrim);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  z-index: 400;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12vh;
}
.cmdk-overlay[hidden] {
  display: none;
}
.cmdk-panel {
  width: 600px;
  max-width: 92vw;
  max-height: 80vh;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-overlay);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: cmdkIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes cmdkIn {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.cmdk-input {
  flex-shrink: 0;
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text-1);
  font-size: 15px;
  font-family: inherit;
  padding: 16px 20px;
  outline: none;
}
.cmdk-input::placeholder {
  color: var(--text-4);
}
.cmdk-results {
  min-height: 0;
  max-height: 56vh;
  overflow-y: auto;
  padding: 8px 0;
}
.cmdk-coverage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 6px 12px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-3);
  font-size: 11px;
  line-height: 1.5;
  flex-shrink: 0;
}
.cmdk-coverage[hidden] {
  display: none;
}
.cmdk-coverage p,
.cmdk-coverage-status {
  margin: 0;
}
.cmdk-coverage details {
  min-width: 0;
}
.cmdk-coverage details[open] {
  grid-column: 1 / -1;
}
.cmdk-coverage summary {
  cursor: pointer;
  color: var(--text-2);
}
.cmdk-coverage summary:focus-visible,
.cmdk-coverage-list:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.cmdk-coverage-list {
  max-height: 24vh;
  overflow-y: auto;
  overflow-wrap: anywhere;
  margin: 6px 0 0;
  padding-left: 18px;
}
.cmdk-coverage-list ul {
  padding-left: 16px;
}
.cmdk-coverage-list li + li {
  margin-top: 4px;
}
.cmdk-section-label {
  padding: 8px 16px 4px;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-4);
  font-weight: 600;
}
.cmdk-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  cursor: pointer;
  border-left: 2px solid transparent;
  transition: background var(--transition);
}
.cmdk-row:hover,
.cmdk-row.active {
  background: var(--bg-2);
  border-left-color: var(--accent);
}
.cmdk-row .cmdk-icon {
  width: 22px;
  text-align: center;
  font-size: 14px;
  flex-shrink: 0;
  opacity: 0.85;
}
.cmdk-row .cmdk-text {
  flex: 1;
  min-width: 0;
}
.cmdk-row .cmdk-label {
  color: var(--text-1);
  font-size: 13px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cmdk-row .cmdk-sublabel {
  color: var(--text-3);
  font-size: 11px;
  margin-top: 1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cmdk-row .cmdk-meta {
  font-size: 10px;
  color: var(--text-4);
  font-family: var(--font-mono);
  flex-shrink: 0;
}
.cmdk-empty {
  padding: 24px 20px;
  text-align: center;
  color: var(--text-4);
  font-size: 12px;
}
.cmdk-footer {
  flex-shrink: 0;
  display: flex;
  gap: 16px;
  padding: 8px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg-0);
}
.cmdk-hint {
  font-size: 10px;
  color: var(--text-4);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.cmdk-key {
  font-family: var(--font-mono);
  background: var(--bg-3);
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 10px;
  color: var(--text-2);
  border: 1px solid var(--border);
}

/* Clickable company link inside contact rows — opens company drawer.
   Anchor uses no href so it doesn't navigate; click handler is delegated. */
.company-link {
  color: var(--text-1);
  cursor: pointer;
  border-bottom: 1px dashed transparent;
  transition:
    border-color var(--transition),
    color var(--transition);
}
.company-link:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Keyboard row selection (j/k navigation in CRM tables) */
.table tbody tr.row-active {
  background: var(--accent-soft);
  border-left-color: var(--accent);
}

/* Undo toast — extends .toast with a button and a hairline progress bar */
.toast .toast-undo {
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text-1);
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}
.toast .toast-undo:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}
.toast.with-undo {
  position: relative;
  overflow: hidden;
  padding-bottom: 12px;
}
.toast .toast-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: currentColor;
  opacity: 0.4;
  transform-origin: left center;
  animation: toastProgress linear forwards;
}
@keyframes toastProgress {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(0);
  }
}

/* ═══════════════════════════════════════════════════════════════════
   V3 sidebar (compact, Vercel/Linear hybrid) + context bar
   Activated by ._navIaV3 flag in chrome.storage.local — see buildV3Sidebar
   ═══════════════════════════════════════════════════════════════════ */

.sidebar.sidebar-v3 {
  display: flex;
  flex-direction: column;
  padding: 4px 0;
}

/* Beta pill — small, neutral, less attention-grabbing than v2's */
.sidebar.sidebar-v3 .sidebar-beta-pill {
  margin: 6px 12px 10px;
  padding: 4px 8px;
  font-size: 9px;
  letter-spacing: 0.08em;
  text-align: center;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
}

/* Primary nav: six daily rooms always visible. Each gets a thin colored stripe
   on its left edge when active so the user instantly sees "where am I". */
.sidebar.sidebar-v3 .sidebar-nav-primary {
  padding: 0 8px;
}

.workspace-tools {
  border-bottom: 1px solid var(--border);
  padding: 8px 0;
}

.workspace-tools > summary {
  cursor: pointer;
  color: var(--text-2);
  padding: 8px 16px;
  font-size: 12px;
}

.workspace-tools > summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.workspace-tools-icon {
  display: none;
}

@media (max-width: 1024px) {
  .workspace-tools > summary {
    display: grid;
    place-items: center;
    padding: 8px 0;
  }
  .workspace-tools-label,
  .sidebar.sidebar-v3 .sidebar-context-header,
  .sidebar.sidebar-v3 .sidebar-context-subheader,
  .sidebar.sidebar-v3 .nav-item-primary .nav-kbd {
    display: none;
  }
  .workspace-tools-icon {
    display: flex;
  }
}

.campaign-execution-tools > summary {
  cursor: pointer;
}

.campaign-execution-tools-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-block: 8px;
}

.campaign-comparison {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 16px;
}

.campaign-comparison > summary {
  cursor: pointer;
  font-weight: 600;
}

.campaign-comparison-body {
  margin-top: 12px;
  display: grid;
  gap: 12px;
}

.campaign-comparison-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 12px;
}

.campaign-comparison-grid > label {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.campaign-comparison-grid select {
  width: 100%;
  min-width: 0;
}
.sidebar.sidebar-v3 .nav-item-primary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 8px;
  margin: 1px 0;
  border-radius: 5px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  position: relative;
  transition:
    background 120ms,
    color 120ms;
}
.sidebar.sidebar-v3 .nav-item-primary:hover {
  background: var(--bg-2);
  color: var(--text-1);
}
.sidebar.sidebar-v3 .nav-item-primary.active {
  background: var(--bg-2);
  color: var(--text-1);
  font-weight: 600;
}
.sidebar.sidebar-v3 .nav-item-primary.active::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 7px;
  bottom: 7px;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: var(--accent);
}
.sidebar.sidebar-v3 .nav-item-primary .nav-icon {
  font-size: 16px;
  line-height: 1;
}
.sidebar.sidebar-v3 .nav-item-primary .nav-label {
  flex: 1;
}
.sidebar.sidebar-v3 .nav-item-primary .nav-badge {
  font-size: 10px;
  background: var(--red);
  color: #fff;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 700;
}
/* Shortcut hint — small monospace digit aligned right. Surfaces the
   Cmd/Ctrl+1..6 shortcut so users discover it on first scan. */
.sidebar.sidebar-v3 .nav-item-primary .nav-kbd {
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 10px;
  color: var(--text-3);
  background: var(--bg-2);
  padding: 1px 8px;
  border-radius: 4px;
  font-weight: 500;
  margin-left: auto;
  opacity: 0.6;
  transition: opacity 120ms;
}
.sidebar.sidebar-v3 .nav-item-primary:hover .nav-kbd {
  opacity: 1;
}
.sidebar.sidebar-v3 .nav-item-primary.active .nav-kbd {
  background: var(--bg-3);
  color: var(--text-2);
  opacity: 1;
}

/* Context pane: section header + child list. Subtle background separator
   so it's visually distinct from primary without being heavy. */
.sidebar.sidebar-v3 .sidebar-section-context {
  margin-top: 8px;
  padding: 4px 0 8px;
  background: var(--bg-1);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  animation: v3-context-fade-in 180ms ease-out;
}
@keyframes v3-context-fade-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.sidebar.sidebar-v3 .sidebar-context-header {
  padding: 10px 16px 4px;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--text-3);
  text-transform: uppercase;
  font-weight: 600;
}
.sidebar.sidebar-v3 .sidebar-nav-context {
  padding: 0 8px;
}
/* Sub-group header within a section's context pane (Run / Build / Measure …) */
.sidebar.sidebar-v3 .sidebar-context-subheader {
  padding: 10px 8px 3px;
  font-size: 9px;
  letter-spacing: 0.07em;
  color: var(--text-4);
  text-transform: uppercase;
  font-weight: 600;
}
.sidebar.sidebar-v3 .sidebar-context-subheader:first-child {
  padding-top: 2px;
}
.sidebar.sidebar-v3 .nav-item-child {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 6px 22px;
  margin: 1px 0;
  border-radius: 5px;
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
  transition:
    background 100ms,
    color 100ms;
}
.sidebar.sidebar-v3 .nav-item-child:hover {
  background: var(--bg-2);
  color: var(--text-1);
}
.sidebar.sidebar-v3 .nav-item-child.active {
  background: var(--bg-3);
  color: var(--text-1);
  font-weight: 500;
}
.sidebar.sidebar-v3 .nav-item-child .nav-icon {
  font-size: 13px;
  opacity: 0.75;
}

body[data-nexus-app] .sidebar.sidebar-v3 {
  width: 196px;
  padding-block: 12px;
}

body[data-nexus-app] .sidebar.sidebar-v3 .sidebar-section-primary {
  margin-bottom: 8px;
}

body[data-nexus-app] .sidebar.sidebar-v3 > nav {
  margin: 0 8px;
  padding-block: 8px;
  border-top: 1px solid var(--border);
}

body[data-nexus-app] .sidebar.sidebar-v3 .nav-item-primary {
  min-height: 34px;
  margin: 0;
  padding: 8px 8px;
  font-size: 13px;
}

body[data-nexus-app] .sidebar.sidebar-v3 > nav .nav-kbd {
  display: none;
}

body[data-nexus-app] .sidebar.sidebar-v3 .nav-item-primary.active::before {
  left: 0;
  width: 2px;
  background: var(--accent);
}

body[data-nexus-app] .sidebar.sidebar-v3 .nav-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

body[data-nexus-app] .sidebar.sidebar-v3 .sidebar-section-context {
  margin-top: 0;
  background: transparent;
  border-bottom: 0;
  animation: none;
}

body[data-nexus-app] .sidebar.sidebar-v3 .workspace-tools {
  padding-block: 4px;
}

@media (max-width: 1024px) {
  body[data-nexus-app] .sidebar.sidebar-v3 {
    width: 52px;
  }

  body[data-nexus-app] .sidebar.sidebar-v3 > nav {
    margin-inline: 4px;
  }
}

@media (min-width: 881px) and (max-width: 1024px) {
  body[data-nexus-app] .sidebar.sidebar-v3 {
    width: 170px;
  }

  body[data-nexus-app] .sidebar.sidebar-v3 .nav-item {
    justify-content: flex-start;
  }

  body[data-nexus-app] .sidebar.sidebar-v3 .nav-label,
  body[data-nexus-app] .sidebar.sidebar-v3 .workspace-tools-label {
    display: inline;
  }

  body[data-nexus-app] .sidebar.sidebar-v3 .workspace-tools > summary {
    display: block;
    padding-inline: 16px;
  }

  body[data-nexus-app] .sidebar.sidebar-v3 .workspace-tools-icon {
    display: none;
  }
}

/* On a phone, use the width for the work and keep destination names readable. */
@media (max-width: 700px) {
  body:has(.sidebar-v3) .main:has(.sidebar-v3) {
    flex-direction: column;
  }

  body:has(.sidebar-v3) .sidebar.sidebar-v3 {
    width: 100%;
    max-height: 44dvh;
    padding-block: 4px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  body:has(.sidebar-v3) .sidebar.sidebar-v3 .sidebar-section-primary,
  body:has(.sidebar-v3) .sidebar.sidebar-v3 .sidebar-section-context {
    margin: 0;
  }

  body:has(.sidebar-v3) .sidebar.sidebar-v3 .sidebar-nav-primary,
  body:has(.sidebar-v3) .sidebar.sidebar-v3 > nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2px;
  }

  body:has(.sidebar-v3) .sidebar.sidebar-v3 > nav {
    margin: 0 8px;
    padding-block: 4px;
  }

  body:has(.sidebar-v3) .sidebar.sidebar-v3 .nav-item {
    padding: 8px 4px;
    min-height: 38px;
    gap: 4px;
    font-size: 12px;
  }

  body:has(.sidebar-v3) .sidebar.sidebar-v3 .nav-item-primary {
    flex-direction: column;
    justify-content: center;
    min-height: 44px;
    padding: 4px 2px;
    font-size: 11px;
    line-height: 1.15;
    text-align: center;
  }

  body:has(.sidebar-v3) .sidebar.sidebar-v3 .nav-label,
  body:has(.sidebar-v3) .sidebar.sidebar-v3 .workspace-tools-label {
    display: inline;
    flex: none;
  }

  body:has(.sidebar-v3) .sidebar.sidebar-v3 .nav-item-primary.active::before,
  body:has(.sidebar-v3) .sidebar.sidebar-v3 .workspace-tools-icon {
    display: none;
  }

  body:has(.sidebar-v3) .sidebar.sidebar-v3 .workspace-tools {
    padding: 0 8px;
  }

  body:has(.sidebar-v3) .sidebar.sidebar-v3 .workspace-tools > summary {
    display: flex;
    justify-content: center;
    gap: 8px;
  }

  body:has(.sidebar-v3) .sidebar.sidebar-v3 .workspace-tools > summary::after {
    content: "⌄";
  }

  body:has(.sidebar-v3) .sidebar.sidebar-v3 .workspace-tools[open] > summary::after {
    transform: rotate(180deg);
  }

  body:has(.sidebar-v3) .sidebar.sidebar-v3 .sidebar-nav-context,
  body:has(.sidebar-v3) .sidebar.sidebar-v3 .workspace-tools > nav {
    display: flex;
    flex-flow: row wrap;
    gap: 4px 12px;
  }

  body:has(.sidebar-v3) .sidebar.sidebar-v3 .workspace-tools > nav .nav-item {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  body:has(.sidebar-v3) .sidebar.sidebar-v3 .sidebar-section-context {
    padding: 4px 8px;
    border-bottom: 0;
  }
}

/* ── Context bar (top of content area when an account is selected) ── */
.context-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  margin: 0 0 12px;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: 2px;
  font-size: 12px;
  color: var(--text-1);
  animation: v3-context-fade-in 200ms ease-out;
}
.context-bar-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}
.context-bar-label {
  font-weight: 600;
}
.context-bar-platform {
  font-family: ui-monospace, monospace;
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-3);
  letter-spacing: 0.04em;
}
.context-bar-spacer {
  flex: 1;
}
.context-bar-clear {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-2);
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  transition:
    background 120ms,
    color 120ms;
}
.context-bar-clear:hover {
  background: var(--bg-3);
  color: var(--text-1);
}

/* Client mode — a persistent, branded "you are working in this client" bar.
   The client's own colour rides in via the inline --client-tint variable, so
   the operator can never mistake whose list they're on. */
.context-bar-client {
  border-color: var(--client-tint, var(--accent));
  border-left: 3px solid var(--client-tint, var(--accent));
}
.context-bar-client-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--client-tint, var(--accent));
  flex-shrink: 0;
}
.context-bar-client-lead {
  color: var(--text-3);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.05em;
}
.context-bar-client-name {
  font-weight: 600;
  color: var(--text-1);
}
.context-bar-client-hint {
  color: var(--text-3);
  font-size: 11px;
}

/* ── Account picker menu — improvements on top of the inline styles ── */
.topbar-account-menu .topbar-account-menu-item {
  transition: background 100ms;
}
.topbar-account-menu .topbar-account-menu-item:active {
  background: var(--bg-3);
  transform: scale(0.99);
}

/* ── Phase 34b — n8n-style canvas editor ─────────────────────── */

.canvas-editor {
  position: relative;
  contain: strict;
}

.canvas-editor-inner {
  /* The pan/zoom transform happens here; let it bleed past viewport so
     dragging beyond the visible area still works. */
}

.canvas-node {
  transition:
    border-color 120ms,
    box-shadow 120ms;
  z-index: 2;
}
.canvas-node:hover {
  border-color: #6a7aaa !important;
  box-shadow: 0 0 0 2px rgba(106, 122, 170, 0.15);
}
.canvas-node:active {
  cursor: grabbing !important;
}

/* Running pulse — applied while Execute is in flight.
   Implemented as a sibling ::after ring that scales + fades, so the only
   animated properties are transform + opacity (composite-only, no paint). */
.canvas-node-running {
  border-color: #faaa5a !important;
  position: relative;
}
.canvas-node-running::after {
  content: "";
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border: 2px solid rgba(250, 170, 90, 0.6);
  border-radius: 4px;
  pointer-events: none;
  transform-origin: center;
  /* Promote to GPU layer so the animated transform + opacity stay composite-only */
  will-change: transform, opacity;
  animation: canvas-pulse-ring 1.2s ease-out infinite;
}
@keyframes canvas-pulse-ring {
  0% {
    transform: scale(1);
    opacity: 0.7;
  }
  100% {
    transform: scale(1.06);
    opacity: 0;
  }
}

/* Results overlay on a canvas node — what this stage actually did.
   Built from the mojo-stat primitives, which are token-based and so read
   correctly on this dark surface as well as the light one they were
   introduced for. Also the hook the overlay uses to replace itself on
   re-render, so it must exist as a rule and not only as a JS string. */
.canvas-node-stats {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  row-gap: 2px;
}

/* Drag-to-connect port handles (Task 11b) — small circles on a node's edge.
   JS sets each port's per-kind position/size/colour inline; this covers the
   shared shape plus a hover affordance so a drag target reads as grabbable. */
.canvas-port {
  position: absolute;
  box-sizing: border-box;
  border-radius: var(--radius-full);
  background: var(--bg-2);
  border: 1.5px solid var(--border-strong);
  transition:
    box-shadow 100ms,
    transform 100ms;
}
.canvas-port:hover {
  box-shadow: 0 0 0 3px var(--accent-soft);
  transform: scale(1.2);
}

.canvas-toolbar button {
  /* Inherit btn styles; tighter padding for the toolbar */
  font-size: 13px !important;
  line-height: 1 !important;
}

/* Canvas-side drawer (sidebar library / config panel) — used by Phase 34b.2+ */
.canvas-drawer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 360px;
  background: #0c0c0c;
  border-left: 1px solid #222;
  z-index: 20;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 200ms ease-out;
}
.canvas-drawer.open {
  transform: translateX(0);
}
.canvas-drawer-header {
  position: sticky;
  top: 0;
  background: #0c0c0c;
  border-bottom: 1px solid #222;
  padding: 12px 16px;
  z-index: 1;
}
.canvas-drawer-body {
  padding: 12px 16px;
}

/* Canvas + Add node FAB */
.canvas-fab {
  position: absolute;
  bottom: 12px;
  right: 12px;
  z-index: 10;
}

/* Sticky notes (Phase 34b.5) */
.canvas-sticky {
  transition: transform 80ms;
}
.canvas-sticky:hover .canvas-sticky-header {
  opacity: 1 !important;
}
.canvas-sticky-body:focus {
  background: rgba(255, 255, 255, 0.04);
}

/* ── LinkedIn Activity view (Phase 3 of LI overhaul) ───────────────── */
.li-activity-view {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.li-activity-header {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  border-radius: 4px;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.li-activity-status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.li-activity-status-pill {
  font-size: 14px;
}
.li-activity-status-text {
  font-weight: 600;
}
.li-activity-sessions {
  font-size: 13px;
}

.li-activity-tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.li-activity-tile {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 2px;
  padding: 8px 10px;
  text-align: center;
}
.li-activity-tile-ok {
  border-color: rgba(80, 200, 120, 0.3);
}
.li-activity-tile-fail {
  border-color: rgba(220, 80, 80, 0.3);
}
.li-activity-tile-skip {
  border-color: rgba(180, 180, 180, 0.2);
}
.li-activity-tile-value {
  font-size: 20px;
  font-weight: 700;
}
.li-activity-tile-label {
  font-size: 11px;
  opacity: 0.7;
}

.li-activity-top-errors {
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.li-activity-error-chip {
  display: inline-block;
  font-size: 11px;
  font-family: ui-monospace, monospace;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(220, 80, 80, 0.15);
  color: rgba(255, 200, 200, 0.95);
  margin-left: 6px;
}

.li-activity-filters {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 12px;
  padding: 4px 0;
}
.li-activity-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: inherit;
  border-radius: 4px;
  padding: 3px 9px;
  font-size: 12px;
  cursor: pointer;
}
.li-activity-chip.active {
  background: rgba(100, 150, 255, 0.18);
  border-color: rgba(100, 150, 255, 0.4);
}

.li-activity-feed {
  display: flex;
  flex-direction: column;
  gap: 1px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 2px;
  overflow: hidden;
}
.li-activity-row {
  display: grid;
  grid-template-columns: 70px 24px 1fr 60px 100px auto 1fr;
  gap: 10px;
  align-items: center;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.015);
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 13px;
  font-family: ui-monospace, "SFMono-Regular", monospace;
}
.li-activity-row:hover {
  background: rgba(255, 255, 255, 0.05);
}
.li-activity-row-fail {
  background: rgba(220, 80, 80, 0.06);
}
.li-activity-row-fail:hover {
  background: rgba(220, 80, 80, 0.12);
}
.li-activity-row-skip {
  opacity: 0.7;
}
.li-activity-time {
  opacity: 0.6;
}
.li-activity-icon {
  text-align: center;
}
.li-activity-action {
  font-weight: 600;
}
.li-activity-status {
  font-size: 11px;
  letter-spacing: 0.5px;
  opacity: 0.8;
}
.li-activity-source {
  font-size: 11px;
}
.li-activity-detail {
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.li-activity-drawer-dl {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 6px 14px;
  font-size: 13px;
}
.li-activity-drawer-dl dt {
  opacity: 0.6;
  font-weight: 500;
}
.li-activity-drawer-dl dd {
  margin: 0;
  word-break: break-word;
}
.li-activity-drawer-pre {
  background: rgba(0, 0, 0, 0.25);
  border-radius: 4px;
  padding: 8px 10px;
  font-size: 11px;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 320px;
  overflow: auto;
}

/* ── Print: clean A4 client report ────────────────────────────────────
   "Download PDF" on the Client report calls window.print(). Hide the app
   chrome (topbar / sidebar / toasts / in-page controls) and expand the
   content so the browser print dialog produces a shareable PDF. Force exact
   colors so the branded bars/badges survive the print pipeline. */
@media print {
  /* Hide the app chrome + in-page controls; keep the report itself. */
  .topbar,
  #sidebar,
  #toast-region,
  .ui-modal-backdrop,
  .report-controls {
    display: none !important;
  }
  .app,
  .main,
  .content,
  #content-wrap,
  #content {
    display: block !important;
    overflow: visible !important;
    height: auto !important;
    margin: 0 !important;
  }
  #content {
    padding: 0 8px !important;
  }
  /* Keep the designed dark theme so the inline light text + colored bars
     stay legible (a forced-white page would hide them). Force exact colors
     so backgrounds/bars/badges survive the print pipeline. */
  .card,
  .ui-card,
  .stat-card {
    break-inside: avoid;
    page-break-inside: avoid;
  }
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  @page {
    margin: 12mm;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Carrying the marketing site's treatment into the app, 2026-08-22.

   The same idea as landing/ocb.css: a container is a glass surface with a 1px
   border and a top bevel, not a flat fill. Restraint is heavier here than on the
   marketing site on purpose. This is a tool people keep open all day, so there is
   no ambient glow, no gradient type and no parallax; depth comes from the bevel
   and the border alone, which costs nothing to read past.
   ═══════════════════════════════════════════════════════════════════════════ */

/* The hosted workspace uses solid fills and borders. Keep the older extension
   frame on its existing surface treatment. */
body:not([data-nexus-app]) .card,
body:not([data-nexus-app]) .ui-card,
body:not([data-nexus-app]) .stat-card {
  background-image: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.032) 0%,
    rgba(255, 255, 255, 0.008) 100%
  );
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045);
}

/* The topbar sits above everything and should read that way. */
body:not([data-nexus-app]) .topbar {
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

body[data-nexus-app] .topbar .logo {
  background: none;
  color: var(--text-1);
}

body[data-nexus-app] .topbar .section-title {
  color: var(--text-2);
}

body[data-nexus-app] .topbar .topbar-pulse-dot {
  animation: none;
}

body[data-nexus-app] .btn {
  text-decoration: none;
}

body[data-nexus-app] .btn-primary {
  background: var(--accent);
  box-shadow: none;
}

body[data-nexus-app] .btn-primary:hover {
  background: var(--accent-hover);
  filter: none;
  transform: none;
}

@media (max-width: 600px) {
  body[data-nexus-app] .topbar:has(#web-signout) {
    padding-inline: 8px;
  }

  body[data-nexus-app] .topbar-right {
    gap: 4px;
  }

  body[data-nexus-app] .topbar-right .status-pill {
    padding-inline: 8px;
  }
}

/* Modals and the drawer are the app's foreground: heavier glass, and a real
   shadow now that blurred shadows are permitted again. */
.modal,
.modal-content,
.drawer {
  border-radius: var(--radius-lg);
  background-image: var(--sheen-modal);
  box-shadow: var(--shadow-modal);
}
.drawer-backdrop {
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  background: var(--scrim);
}

/* Nav items get the same rounding as everything else; they were square. */
.nav-item,
.sidebar a {
  border-radius: var(--radius-sm);
}

@media (prefers-reduced-motion: reduce) {
  .btn-primary,
  .btn-primary:hover {
    transform: none;
  }
}

/* ── Mojo: a scoped light surface ──────────────────────────────────────────
   Redefines the colour tokens for its own subtree ONLY. Deliberately not a
   :root flip: 134 inline coloured styles across the JS views bypass CSS
   entirely and would stay dark, so flipping the root would leave 76 views
   half-converted with no way back except finishing all of them. Scoped means
   the 74 views not being piloted cannot break, and promoting this later is one
   line plus that cleanup.
   CONTRAST: check-color-tokens.js parses :root ONLY, so it does not see this
   block — the pairs below were checked against the same maths and the same 4.5
   floor by hand, and three of them failed a first pass:
     --text-3 was #71717a, which is 4.40:1 on --bg-2 (the row-hover tint);
       darkened to #6b6b74 = 4.80:1 there and 5.28:1 on white.
     --accent-ink was #ffffff, which is 2.47:1 on the accent fill; on a light
       surface the ink on a bright fill has to be dark. #0a0a0b = 8.02:1.
   Two tokens are decorative here and MUST NOT carry small text:
     --text-4 is 2.56:1 on white, and --accent is 2.47:1 — the brand cyan is a
     fill and rule colour on this surface, never a text colour. No .mojo rule
     below sets colour from either. */
.mojo {
  --bg-0: #ffffff;
  --bg-1: #fafafa;
  --bg-2: #f4f4f5;
  --bg-3: #ededef;
  --bg-card: #ffffff;
  --border: #e4e4e7;
  --border-soft: #efeff1;
  --border-hover: #d4d4d8;
  --text-1: #0a0a0b;
  --text-2: #3f3f46;
  --text-3: #6b6b74;
  --text-4: #a1a1aa;
  --accent: #34b4c8;
  --accent-hover: #2aa0b3;
  --accent-ink: #0a0a0b;
  --accent-soft: rgba(52, 180, 200, 0.1);

  background: var(--bg-0);
  color: var(--text-1);
  padding: 20px 22px;
}

/* 1. Hairline rules, not cards. */
.mojo-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2px;
}
.mojo-title {
  font: 600 15px/1.2 var(--font-display);
  color: var(--text-1);
  letter-spacing: -0.01em;
}
.mojo-sub {
  font: 400 12px/1.2 var(--font-mono);
  color: var(--text-3);
}

/* 5. Dense rows, hover tint, no zebra. */
.mojo-table {
  width: 100%;
  border-collapse: collapse;
  font: 400 13px/1.45 var(--font-body);
}
.mojo-table th {
  text-align: left;
  font: 400 11px/1.4 var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
  padding: 10px 12px 8px 0;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.mojo-table td {
  padding: 9px 12px 9px 0;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text-2);
  vertical-align: top;
}
.mojo-table tbody tr:hover td {
  background: var(--bg-2);
}

/* Account connections and local browser setup. */
.account-profile-panel {
  min-width: 0;
  margin: 0 0 14px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-card);
  color: var(--text-1);
}
.account-profile-panel .mojo-head {
  flex-wrap: wrap;
}
.account-profile-panel .mojo-num {
  white-space: normal;
  overflow-wrap: anywhere;
}

.accounts-view.acct-overview {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  min-width: 0;
}
.accounts-view.acct-overview .page-header {
  margin-bottom: 0;
}
.accounts-view.acct-overview .page-header > div {
  min-width: 0;
}
.accounts-view .acct-toolbar[hidden] {
  display: none;
}
.accounts-view .acct-platform h2,
.accounts-view .acct-empty h2 {
  margin: 0 0 6px;
  font-size: 15px;
}
.accounts-view .acct-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  align-items: start;
  gap: 10px;
}
.accounts-view .acct-card-grid > div {
  min-width: 0;
}
.accounts-view .acct-card,
.accounts-view .acct-setup,
.accounts-view .acct-empty {
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-card);
}
.accounts-view .acct-card-head,
.accounts-view .acct-toolbar,
.accounts-view .acct-control-buttons,
.accounts-view .acct-check,
.accounts-view .acct-setup-option {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}
.accounts-view .acct-card-head {
  justify-content: space-between;
  align-items: start;
  flex-wrap: nowrap;
}
.accounts-view .acct-card-identity {
  min-width: 0;
}
.accounts-view .acct-card-identity h3 {
  margin: 0;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.accounts-view .acct-card-identity p,
.accounts-view .acct-card-status {
  margin: 3px 0 0;
  overflow-wrap: anywhere;
}
.accounts-view .acct-card-badge {
  flex-shrink: 0;
  padding: 2px 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-2);
  font-size: 11px;
  line-height: 1.4;
}
.accounts-view .acct-card-badge[data-tone="ok"] {
  color: var(--green);
}
.accounts-view .acct-card-badge[data-tone="warn"] {
  color: var(--yellow);
}
.accounts-view .acct-card-controls {
  margin-top: 8px;
  border-top: 1px solid var(--border);
}
.accounts-view .acct-card-controls > summary,
.accounts-view .acct-setup > summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text-1);
}
.accounts-view .acct-card-controls > summary {
  padding-top: 7px;
  font-size: 12px;
}
.accounts-view .acct-card-content,
.accounts-view .acct-browser-details,
.accounts-view .acct-setup-content {
  display: grid;
  gap: 10px;
  padding-top: 9px;
  overflow-wrap: anywhere;
}
.accounts-view .acct-detail-group {
  display: grid;
  gap: 6px;
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: 7px;
}
.accounts-view .acct-detail-group h4,
.accounts-view .acct-detail-group p {
  margin: 0;
}
.accounts-view .acct-browser-details .mojo-stat {
  flex-wrap: wrap;
}
.accounts-view .acct-toolbar input {
  flex: 1 1 180px;
  min-width: 0;
  max-width: 420px;
}
.accounts-view .acct-setup-option {
  justify-content: space-between;
  padding-top: 7px;
  border-top: 1px solid var(--border);
}
.accounts-view .acct-setup .account-profile-panel {
  margin: 9px 0 0;
}

/* 2. Mono for anything numeric, temporal or identifier-like.
   Only weight 400 of IBM Plex Mono is self-hosted — never ask for bold mono. */
.mojo-num {
  font: 400 12px/1.45 var(--font-mono);
  color: var(--text-2);
  white-space: nowrap;
}

/* 3. Letter-value chips: S:web3, F:BD, A:TON. */
.mojo-chip {
  display: inline-block;
  font: 400 11px/1.5 var(--font-mono);
  color: var(--text-2);
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1px 6px;
  margin: 0 4px 3px 0;
  white-space: nowrap;
}

/* 4. Dot meters. */
.mojo-meter {
  font: 400 12px/1 var(--font-mono);
  color: var(--text-1);
  letter-spacing: 1px;
  white-space: nowrap;
}

/* 6. Stage-stat block. Phase 1 barely needs it; the workflow canvas nodes are
   made of it, so it is defined here rather than invented again later. */
.mojo-stat {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  margin-right: 14px;
}
.mojo-stat-label {
  font: 400 11px/1.4 var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
}
.mojo-stat-value {
  font: 400 13px/1.4 var(--font-mono);
  color: var(--text-1);
}
.mojo-state-ok {
  color: var(--status-ok);
}
.mojo-state-warn {
  color: var(--status-warn);
}
.mojo-state-bad {
  color: var(--status-bad);
}

.mojo-empty {
  font: 400 13px/1.6 var(--font-body);
  color: var(--text-3);
  padding: 18px 0;
}

/* ── Assistant (route #chat, dashboard-assistant.js) ─────────────────────────
   Tokens only, and only tokens the scoped light surface (.mojo) redefines too:
   --bg-*, --text-1..3, --accent, --accent-ink, --accent-soft, --border,
   --border-hover. --text-4 and --accent never colour text here: in .mojo they
   are 2.56:1 and 2.47:1 on white, so they are kept to fills, edges and rings.
   --border-hover is the visible edge (it is --border-strong in the dark theme
   and the light theme's own hover edge), because --border is a near-invisible
   hairline on purpose.

   Layout: the view fills the content column so the thread scrolls inside it
   and the composer stays put. Below 900px the conversation list becomes a
   drawer over the thread; at phone width everything stacks in one column with
   no horizontal page scroll (tables and code scroll inside their own box). */

.asst {
  display: flex;
  flex-direction: column;
  gap: 12px;
  /* topbar 48 + content padding-top 24 + the reduced bottom padding below */
  height: calc(100vh - 88px);
  height: calc(100dvh - 88px);
  min-height: 420px;
  min-width: 0;
}
/* .content keeps 80px of bottom padding for long scrolling pages; a view that
   sizes itself to the viewport would otherwise always overflow by that much. */
#content-wrap:has(.asst) {
  padding-bottom: 16px;
}

/* ── header ─────────────────────────────────────────────────────────────── */
.asst-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.asst-head-main {
  min-width: 0;
}
.asst-ws {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-2);
}
.asst-ws-name {
  color: var(--text-1);
  font-weight: 500;
  overflow-wrap: anywhere;
}
.asst-ws-note {
  color: var(--text-3);
}
.asst-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.asst-list-toggle {
  display: none;
}

.asst-stale {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 12px;
  font-size: 12px;
  color: var(--text-1);
  background: var(--bg-2);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-sm);
}
.asst-stale > span {
  flex: 1;
  min-width: 180px;
}

/* ── body: list + main ──────────────────────────────────────────────────── */
.asst-body {
  position: relative;
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 12px;
}

.asst-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 0;
  overflow-y: auto;
  padding: 8px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.asst-list-head {
  padding: 4px 8px 8px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
}
.asst-list-empty {
  padding: 8px;
  font-size: 12px;
  color: var(--text-3);
}
.asst-conv {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  padding: 8px 10px;
  text-align: left;
  font: inherit;
  color: var(--text-2);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition:
    background var(--transition),
    color var(--transition);
}
.asst-conv:hover {
  background: var(--bg-2);
  color: var(--text-1);
}
.asst-conv[aria-current="true"] {
  background: var(--bg-3);
  color: var(--text-1);
  border-color: var(--border-hover);
}
.asst-conv:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.asst-conv-title {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.asst-conv-time {
  font-size: 11px;
  color: var(--text-3);
}

.asst-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.asst-task {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  margin: 12px 0;
  overflow-wrap: anywhere;
}
.asst-task summary {
  cursor: pointer;
  padding: 8px 0;
}
.asst-task summary:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}
.asst-task button {
  min-height: 44px;
}
.asst-main > .ui-card {
  margin: 16px;
}
.asst-main > .empty-state {
  margin: auto 0;
  padding: 48px 16px;
}
.asst-thread-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}
.asst-thread-head[hidden] {
  display: none;
}
.asst-thread-title {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.asst-thread {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
}
.asst-loading {
  padding: 12px 0;
  font-size: 12px;
  color: var(--text-3);
}

/* ── empty state ────────────────────────────────────────────────────────── */
.asst-empty {
  margin: auto 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 24px 8px;
  text-align: center;
}
.asst-empty-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--text-1);
}
.asst-opener {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  max-width: 640px;
  text-align: left;
}
.asst-opener:empty {
  display: none;
}
.asst-opener-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.asst-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  max-width: 640px;
}
.asst-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  font: inherit;
  font-size: 12px;
  color: var(--text-1);
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  transition:
    border-color var(--transition),
    background var(--transition);
}
.asst-chip:hover {
  background: var(--bg-3);
  border-color: var(--accent);
}
.asst-chip:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.asst-chip[data-starter="accounts"] {
  border-color: var(--border-hover);
}
.asst-checklist {
  width: 100%;
  max-width: 640px;
  text-align: left;
}

/* ── messages ───────────────────────────────────────────────────────────── */
.asst-msg {
  display: flex;
  min-width: 0;
}
.asst-msg-user {
  justify-content: flex-end;
}
.asst-bubble {
  min-width: 0;
  max-width: min(720px, 85%);
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-1);
  border-radius: var(--radius-md);
  overflow-wrap: anywhere;
}
.asst-msg-user .asst-bubble {
  white-space: pre-wrap;
  background: var(--accent-soft);
  border: 1px solid var(--border);
}
.asst-msg-assistant .asst-bubble {
  max-width: 100%;
  padding: 2px 0;
}

/* The markdown subset renderMarkdownSafe() emits, and nothing else. */
.asst-md > :first-child {
  margin-top: 0;
}
.asst-md > :last-child {
  margin-bottom: 0;
}
.asst-md p {
  margin: 0 0 8px;
}
.asst-md h3,
.asst-md h4,
.asst-md h5 {
  margin: 14px 0 6px;
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-1);
}
.asst-md h3 {
  font-size: 15px;
}
.asst-md h4 {
  font-size: 14px;
}
.asst-md h5 {
  font-size: 13px;
}
.asst-md ul,
.asst-md ol {
  margin: 0 0 8px;
  padding-left: 20px;
}
.asst-md li {
  margin: 2px 0;
}
.asst-md strong {
  font-weight: 600;
}
.asst-md code {
  padding: 0 4px;
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.asst-md pre {
  max-width: 100%;
  margin: 0 0 8px;
  padding: 10px 12px;
  overflow-x: auto;
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.asst-md pre code {
  padding: 0;
  white-space: pre;
  background: none;
  border: 0;
}
.asst-md a {
  color: var(--text-1);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 2px;
}
.asst-md a:hover {
  text-decoration-thickness: 2px;
}
.asst-md a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}
.asst-md blockquote {
  margin: 0 0 8px;
  padding: 2px 0 2px 12px;
  color: var(--text-2);
  border-left: 2px solid var(--border-hover);
}
.asst-md hr {
  margin: 12px 0;
  border: 0;
  border-top: 1px solid var(--border);
}
.asst-md [data-md="table"] {
  max-width: 100%;
  margin: 0 0 8px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.asst-md table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.asst-md th,
.asst-md td {
  padding: 6px 10px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}
.asst-md th {
  font-weight: 500;
  white-space: nowrap;
  color: var(--text-2);
  background: var(--bg-2);
}
.asst-md tbody tr:last-child td {
  border-bottom: 0;
}

.asst-event,
.asst-error {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 10px;
  font-size: 12px;
  line-height: 1.5;
  border-radius: var(--radius-sm);
  overflow-wrap: anywhere;
}
.asst-event {
  color: var(--text-3);
}
.asst-error {
  color: var(--text-1);
  background: var(--bg-2);
  border: 1px solid var(--border-hover);
}
.asst-event > .i,
.asst-error > .i {
  margin-top: 2px;
}

/* ── tool steps ─────────────────────────────────────────────────────────── */
.asst-tool {
  min-width: 0;
  font-size: 12px;
  color: var(--text-2);
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.asst-tool > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 6px 10px;
  list-style: none;
  cursor: pointer;
}
.asst-tool > summary::-webkit-details-marker {
  display: none;
}
.asst-tool > summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  border-radius: var(--radius-sm);
}
.asst-tool-label {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-1);
}
.asst-tool-summary {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-3);
}
.asst-tool[data-status="running"] > summary > .i {
  animation: asst-pulse 1.2s ease-in-out infinite;
}
.asst-tool[data-status="error"] {
  border-color: var(--border-hover);
}
.asst-tool[data-status="error"] .asst-tool-label {
  font-weight: 600;
}
.asst-tool[data-status="approval"] {
  border-color: var(--accent);
}
.asst-tool-output {
  max-height: 280px;
  margin: 0;
  padding: 8px 10px;
  overflow: auto;
  font: 11px/1.5 var(--font-mono);
  color: var(--text-2);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border-top: 1px solid var(--border);
}
@keyframes asst-pulse {
  50% {
    opacity: 0.35;
  }
}
@media (prefers-reduced-motion: reduce) {
  .asst-tool[data-status="running"] > summary > .i {
    animation: none;
  }
}

/* ── approval cards ─────────────────────────────────────────────────────── */
.asst-approval {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 720px;
  min-width: 0;
  padding: 12px 14px;
  background: var(--bg-2);
  border: 1px solid var(--accent);
  border-radius: var(--radius-md);
}
.asst-approval[data-state="executed"],
.asst-approval[data-state="failed"],
.asst-approval[data-state="rejected"],
.asst-approval[data-state="expired"] {
  border-color: var(--border-hover);
}
.asst-approval-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  color: var(--text-1);
}
.asst-approval-tool {
  font-weight: 600;
}
.asst-approval-state {
  margin-left: auto;
  padding: 2px 8px;
  font-size: 11px;
  white-space: nowrap;
  color: var(--text-2);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-sm);
}
.asst-approval[data-state="pending"] .asst-approval-state {
  color: var(--accent-ink);
  background: var(--accent);
  border-color: var(--accent);
}
.asst-approval-summary {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-1);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.asst-approval-args {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 4px 12px;
  margin: 0;
  font-size: 12px;
}
.asst-approval-args dt {
  color: var(--text-3);
}
.asst-approval-args dd {
  margin: 0;
  font-family: var(--font-mono);
  color: var(--text-1);
  overflow-wrap: anywhere;
}
.asst-approval-result {
  padding: 8px 10px;
  font-size: 12px;
  color: var(--text-2);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.asst-approval-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ── inline cards: sign-in handoff ──────────────────────────────────────── */
.asst-handoff {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 720px;
  min-width: 0;
  padding: 12px 14px;
  background: var(--bg-2);
  border: 1px solid var(--status-warn);
  border-radius: var(--radius-md);
}
.asst-handoff[data-state="signed_in"],
.asst-handoff[data-state="skipped"],
.asst-handoff[data-state="expired"],
.asst-handoff[data-state="checking"],
.asst-handoff[data-state="opening"] {
  border-color: var(--border-hover);
}
.asst-handoff[data-state="signed_in"] {
  border-color: var(--status-ok);
}
.asst-handoff-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  color: var(--text-1);
}
.asst-handoff-title {
  font-weight: 600;
}
.asst-handoff-account {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-2);
}
.asst-handoff-state {
  margin-left: auto;
  padding: 2px 8px;
  font-size: 11px;
  white-space: nowrap;
  color: var(--text-2);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-sm);
}
.asst-handoff[data-state="offer"] .asst-handoff-state,
.asst-handoff[data-state="waiting_for_you"] .asst-handoff-state,
.asst-handoff[data-state="failed"] .asst-handoff-state {
  color: var(--status-warn);
  background: var(--status-warn-soft);
  border-color: var(--status-warn);
}
.asst-handoff-message {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-1);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.asst-handoff-note {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-3);
}
.asst-handoff-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Question cards: one short question, 2 to 4 answers to click. */
.asst-choice {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 720px;
  min-width: 0;
  padding: 12px 14px;
  background: var(--bg-2);
  border: 1px solid var(--accent);
  border-radius: var(--radius-md);
}
.asst-choice[data-state="answered"] {
  border-color: var(--border-hover);
}
.asst-choice-question {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-1);
  overflow-wrap: anywhere;
}
.asst-choice-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.asst-choice-answer {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-2);
}

/* The handoff banner: one instruction across the chat while the person
   signs in in the account's own window, with Skip / I'm done. */
.asst-takeover {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 8px 12px 0;
  padding: 10px 12px;
  color: var(--status-warn);
  background: var(--status-warn-soft);
  border: 1px solid var(--status-warn);
  border-radius: var(--radius-md);
}
.asst-takeover[hidden] {
  display: none;
}
.asst-takeover-text {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 260px;
  font-size: 13px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.asst-takeover-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.asst-takeover-on .asst-thread > :not(.asst-handoff) {
  opacity: 0.55;
}

/* "N new messages": jumps to the bottom when work arrived while scrolled up. */
.asst-new-pill {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: -40px 0 8px;
  padding: 6px 12px;
  position: relative;
  z-index: 1;
  font: inherit;
  font-size: 12px;
  color: var(--accent-ink);
  background: var(--accent);
  border: 0;
  border-radius: var(--radius-full);
  cursor: pointer;
}
.asst-new-pill[hidden] {
  display: none;
}
.asst-new-pill:focus-visible {
  outline: 2px solid var(--text-1);
  outline-offset: 2px;
}

/* "Connect apps": one mark per platform, filled when an account is ready. */
.asst-connect {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  font: inherit;
  font-size: 13px;
  color: var(--text-1);
  text-align: left;
  background: var(--bg-2);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-full);
  cursor: pointer;
}
.asst-connect:hover {
  background: var(--bg-3);
}
.asst-connect:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.asst-connect-icons {
  display: inline-flex;
  align-items: center;
}
.asst-connect-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-left: -4px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-3);
  background: var(--bg-3);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-full);
}
.asst-connect-icon-on {
  color: var(--accent-ink);
  background: var(--accent);
  border-color: var(--accent);
}

/* Sidebar: what each thread waits on, and a dot when that is the person. */
.asst-conv-status {
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.asst-conv-status-attention {
  color: var(--status-warn);
}
.asst-conv-status-working {
  color: var(--text-3);
}
.asst-conv-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  vertical-align: middle;
  background: var(--status-warn);
  border-radius: var(--radius-full);
}
.asst-conv-unread .asst-conv-title {
  font-weight: 600;
  color: var(--text-1);
}

/* ── composer ───────────────────────────────────────────────────────────── */
.asst-composer {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  background: var(--bg-1);
  border-top: 1px solid var(--border);
}
.asst-input {
  box-sizing: border-box;
  width: 100%;
  min-height: 44px;
  max-height: 200px;
  padding: 8px 10px;
  font: inherit;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-1);
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  resize: vertical;
}
.asst-input::placeholder {
  color: var(--text-3);
}
.asst-input:focus {
  outline: none;
  border-color: var(--accent);
}
.asst-composer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.asst-hint {
  min-width: 0;
  font-size: 11px;
  line-height: 1.4;
  color: var(--text-3);
}

/* ── disabled (no AI key) ───────────────────────────────────────────────── */
.asst-disabled {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  max-width: 560px;
}
.asst-disabled-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-1);
}
.asst-disabled-detail {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-2);
}
.asst-disabled-reason {
  margin: 0;
  font: 12px/1.5 var(--font-mono);
  color: var(--text-3);
  overflow-wrap: anywhere;
}

/* ── responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .asst-body {
    grid-template-columns: minmax(0, 1fr);
  }
  .asst-list-toggle {
    display: inline-flex;
  }
  .asst-list {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 5;
    display: none;
    width: min(300px, 85%);
    border-color: var(--border-hover);
  }
  .asst-list-open .asst-list {
    display: flex;
  }
}
@media (max-width: 600px) {
  .asst {
    gap: 8px;
    min-height: 360px;
  }
  .asst-thread {
    padding: 12px 10px;
  }
  .asst-bubble {
    max-width: 92%;
  }
  .asst-composer {
    padding: 8px;
  }
  .asst-approval {
    padding: 10px 12px;
  }
  .asst-approval-args {
    grid-template-columns: minmax(0, 1fr);
  }
  .asst-approval-args dd {
    margin-bottom: 4px;
  }
  .asst-approval-state {
    margin-left: 0;
  }
}

/* Today desk. Keep primary decisions visible and fold the supporting activity. */
.today-desk {
  width: min(1120px, 100%);
  margin-inline: auto;
  padding: 12px 0 32px;
}
.today-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}
.today-heading h1 {
  font-size: clamp(24px, 3vw, 30px);
  line-height: 1.2;
  letter-spacing: -0.025em;
  margin-bottom: 4px;
}
.today-heading p,
.today-card-heading p,
.today-status {
  color: var(--text-2);
}
.today-weekly-board {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}
.today-board-toolbar,
.today-board-controls,
.today-board-objective {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.today-board-toolbar {
  justify-content: space-between;
}
.today-board-toolbar h2 {
  font-size: 18px;
  font-weight: 600;
}
.today-board-controls select {
  max-width: min(100%, 260px);
}
.today-board-objectives:empty {
  display: none;
}
.today-board-objective {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  background: var(--bg-1);
}
.today-board-objective-main {
  display: flex;
  flex: 1 1 280px;
  align-items: baseline;
  gap: 2px 10px;
  flex-wrap: wrap;
  min-width: 0;
  overflow-wrap: anywhere;
}
.today-board-objective-main small {
  flex-basis: 100%;
  color: var(--text-2);
}
.today-board-goal-count {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.today-board-lanes {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
  align-items: start;
}
.work-layout-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.work-layout-tabs [aria-selected="true"] {
  border-color: var(--accent);
  color: var(--text-1);
  background: var(--bg-3);
}
.work-layout-tabs button:focus-visible,
.work-layout:focus-visible,
.work-layout a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.work-layout {
  display: grid;
  align-items: start;
  gap: 10px;
  min-width: 0;
}
.work-layout-board {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
}
.work-layout-list {
  grid-template-columns: minmax(0, 1fr);
}
.work-layout-list .today-board-item {
  grid-template-columns: minmax(0, 2fr) minmax(90px, 1fr);
}
.work-layout-list .today-board-item > span:not(.work-item-status),
.work-layout-list .today-board-item small {
  grid-column: 1 / -1;
}
.work-layout-calendar {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
}
@media (min-width: 1200px) {
  .work-layout-calendar {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }
}
.work-layout-calendar h3 {
  flex-wrap: wrap;
  overflow-wrap: anywhere;
}
.work-calendar-items {
  display: grid;
  grid-auto-rows: max-content;
  align-content: start;
  gap: 7px;
  max-height: 22rem;
  overflow: auto;
  padding: 3px;
  min-width: 0;
  overscroll-behavior: contain;
}
.work-calendar-navigation {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.work-calendar-navigation[hidden] {
  display: none;
}
.work-calendar-navigation select {
  min-width: 0;
  max-width: 100%;
}
.work-calendar-items:focus-visible,
.work-layout-calendar h3:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.work-layout .today-board-item strong {
  font-size: 14px;
}
.work-layout .today-board-item > span,
.work-layout .today-board-item small {
  font-size: 13px;
}
.work-item-status {
  font-weight: 600;
}
.work-room .today-board-controls {
  min-width: 0;
  max-width: 100%;
}
.work-room .today-board-controls select {
  min-width: 0;
}
@media (max-width: 700px) {
  .work-layout-board,
  .work-layout-calendar {
    grid-template-columns: minmax(0, 1fr);
  }
  .work-layout-list .today-board-item {
    grid-template-columns: minmax(0, 1fr);
  }
}
.today-board-lane {
  display: grid;
  align-content: start;
  gap: 7px;
  min-width: 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  padding: 9px;
  background: var(--bg-1);
}
.today-board-lane h3 {
  display: flex;
  justify-content: space-between;
  gap: 5px;
  font-size: 14px;
  font-weight: 600;
}
.today-board-lane h3 span,
.today-board-item small,
.today-board-item > span,
.today-board-more summary {
  color: var(--text-2);
  font-size: 12px;
}
.today-board-item {
  display: grid;
  gap: 3px;
  min-height: 44px;
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-1);
  text-decoration: none;
  overflow-wrap: anywhere;
}
.today-board-item strong {
  font-size: 13px;
}
a.today-board-item:hover {
  background: var(--bg-3);
}
.today-board-more > .today-board-item {
  margin-top: 7px;
}
.today-board-more summary {
  cursor: pointer;
  padding-block: 5px;
}
.today-desk-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: clip;
}
.today-card {
  min-width: 0;
  background: var(--bg-1);
  padding: 14px 16px;
}
.today-card-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-bottom: 8px;
}
.today-card-heading h2 {
  font-size: 15px;
  font-weight: 600;
}
.today-card-heading p {
  flex-basis: 100%;
}
.today-card-link {
  color: var(--text-2);
  font-size: 13px;
  text-underline-offset: 3px;
}
.today-card-link:hover {
  color: var(--text-1);
}
.today-intake {
  margin-bottom: 16px;
}
.today-intake-fields,
.today-intake-results {
  display: grid;
  gap: 12px;
}
.today-intake-fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.today-intake-fields .nx-label {
  margin: 0;
  color: var(--text-2);
  font-size: 13px;
}
.today-intake-fields .nx-input {
  display: block;
  width: 100%;
  min-height: 44px;
  margin-top: 4px;
  font-size: 14px;
}
.today-intake-fields textarea {
  resize: vertical;
}
.today-intake > .today-status:not(:empty),
.today-intake-results {
  margin-top: 12px;
}
.today-intake-results {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
  list-style: none;
}
.today-intake-opportunity {
  display: grid;
  align-content: start;
  gap: 8px;
  overflow-wrap: anywhere;
}
.today-intake-opportunity a {
  color: var(--accent);
  text-decoration: underline;
}
.today-intake-evidence,
.today-intake-footer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.today-intake-evidence {
  color: var(--text-2);
}
.today-intake-footer {
  margin-top: 12px;
}
.today-intake-footer > .btn {
  min-height: 44px;
}
.today-queue > .today-status {
  padding-block: 8px;
}
.today-records,
.today-coverage {
  list-style: none;
}
.today-records > li + li,
.today-action + .today-action {
  border-top: 1px solid var(--border);
}
.today-record,
.today-action {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 8px;
  color: var(--text-1);
  text-decoration: none;
}
.today-record {
  justify-content: space-between;
}
.today-record-link:hover,
.today-action:hover {
  background: var(--bg-3);
}
.today-record-link:focus-visible,
.today-card-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.today-record-main,
.today-action-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
  overflow-wrap: anywhere;
}
.today-preview,
.today-action-copy > span,
.today-record-meta {
  color: var(--text-2);
  font-size: 13px;
}
.today-preview {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.today-record-meta {
  display: grid;
  justify-items: end;
  gap: 4px;
  max-width: 45%;
  text-align: right;
  overflow-wrap: anywhere;
}
.today-channel {
  font-size: 12px;
}
.today-action-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: var(--radius-md);
}
.today-secondary {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}
.today-secondary[hidden] {
  display: none;
}
.today-disclosure {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-1);
}
.today-queue > .today-disclosure {
  margin-top: 12px;
}
.today-disclosure > summary {
  min-height: 44px;
  padding: 11px 14px;
  cursor: pointer;
  font-weight: 500;
}
.today-disclosure-body {
  padding: 0 14px 12px;
}
.today-coverage {
  display: grid;
  gap: 6px;
  color: var(--text-2);
}
@media (max-width: 880px) {
  .today-desk-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 540px) {
  .campaign-inventory-wrap {
    overflow: visible;
  }
  .campaign-inventory,
  .campaign-inventory tbody {
    display: block;
    width: 100%;
  }
  .campaign-inventory thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .campaign-inventory tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 10px;
    margin-bottom: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
  }
  .campaign-inventory td {
    display: block;
    min-width: 0;
    padding: 8px;
    border: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    order: 4;
  }
  .campaign-inventory td::before {
    content: attr(data-label);
    display: block;
    font-size: 11px;
    color: var(--text-3);
    margin-bottom: 4px;
  }
  .campaign-inventory td[data-label="Name"] {
    grid-column: 1 / -1;
    order: 0;
  }
  .campaign-inventory td[data-label="Manage"] {
    grid-column: 1 / -1;
    order: 1;
  }
  .campaign-inventory td[data-label="State"] {
    order: 2;
  }
  .campaign-inventory td[data-label="Last outcome"] {
    order: 3;
  }
  .campaign-inventory td[data-label="Manage"] > span {
    flex-wrap: wrap;
    white-space: normal !important;
  }
  .campaign-inventory .badge {
    white-space: normal;
  }
  .today-intake-fields {
    grid-template-columns: minmax(0, 1fr);
  }
  .today-card {
    padding: 12px;
  }
  .today-record {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .today-record-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    max-width: none;
    text-align: start;
  }
}

/* Opportunities: a queue of observations leading to one readable evidence review. */
.opportunities-workspace {
  width: min(1120px, 100%);
  margin-inline: auto;
  overflow-wrap: anywhere;
}
.opportunities-workspace a {
  color: var(--text-1);
  text-underline-offset: 3px;
  text-decoration-color: var(--text-3);
}
.opportunities-workspace .page-header {
  align-items: start;
  gap: 16px;
}
.opportunities-workspace .page-header > div {
  min-width: 0;
}
.opportunity-quiet-link {
  flex: 0 0 auto;
  padding-block: 8px;
}
.opportunity-back {
  display: inline-block;
  margin-block: 2px 20px;
}
.opportunity-filters {
  display: flex;
  align-items: end;
  gap: 16px;
  flex-wrap: wrap;
  margin-block: 24px 14px;
}
.opportunity-filter {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 140px;
  flex: 1 1 150px;
  font-size: 12px;
  color: var(--text-2);
}
.opportunity-filter select {
  width: 100%;
  max-width: 100%;
}
.opportunity-fresh {
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: 38px;
  font-size: 12px;
}
.opportunity-count {
  color: var(--text-2);
  font-size: 12px;
  margin-block: 0 16px;
}
.opportunity-queue {
  border-top: 1px solid var(--border);
}
.opportunity-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(200px, 27%);
  gap: 28px;
  padding-block: 22px;
  border-bottom: 1px solid var(--border);
}
.opportunity-row h2 {
  font-size: 17px;
  line-height: 1.4;
  margin: 0 0 5px;
}
.opportunity-row h2 a {
  color: var(--text-1);
  text-decoration: none;
}
.opportunity-row h2 a:hover {
  text-decoration: underline;
}
.opportunity-row p {
  margin: 5px 0;
}
.opportunity-row-source {
  color: var(--text-2);
  font-size: 12px;
}
.opportunities-workspace .meta,
.opportunities-workspace .opportunity-record-id,
.opportunities-workspace .opportunity-literal-reason,
.opportunities-workspace .opportunity-window-detail {
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.opportunities-workspace .opportunity-record-id {
  font-family: var(--font-mono);
}
.opportunities-workspace .opportunity-coverage-fallback,
.opportunities-workspace .opportunity-selection-fallback {
  margin-block: 12px;
  padding: 12px;
  border-inline-start: 2px solid var(--border);
  background: var(--bg-card);
  color: var(--text-1);
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.opportunity-row-excerpt {
  color: var(--text-1);
  font-size: 13px;
  line-height: 1.6;
}
.opportunity-row-meta {
  display: flex;
  flex-direction: column;
  align-items: start;
  justify-content: start;
  gap: 10px;
  font-size: 12px;
  color: var(--text-2);
}
.opportunity-review-link {
  font-size: 13px;
}
.opportunity-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.opportunity-actions .btn {
  white-space: normal;
  min-height: 36px;
}
.opportunity-support {
  padding-block: 16px;
}
.opportunity-utilities {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 24px;
  border-block: 1px solid var(--border);
}
.opportunity-utilities .opportunity-support[open] {
  flex: 1 1 100%;
  min-width: 0;
}
.opportunity-support summary {
  cursor: pointer;
  font-size: 13px;
  color: var(--text-2);
}
.opportunity-support[open] > summary {
  margin-bottom: 16px;
}
.opportunity-coverage {
  font-size: 13px;
}
.opportunity-review {
  max-width: 840px;
}
.opportunity-review-section,
.opportunity-review-notes {
  padding-block: 25px;
  border-top: 1px solid var(--border);
}
.opportunity-review h2 {
  font-size: 18px;
  line-height: 1.4;
  margin: 0 0 14px;
}
.opportunity-review h3 {
  font-size: 14px;
  line-height: 1.5;
  margin: 0 0 6px;
}
.opportunity-review p {
  line-height: 1.65;
  margin-block: 8px;
}
.opportunity-source-caption {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-2);
}
.opportunity-excerpt {
  margin: 20px 0;
  padding: 0 0 0 18px;
  border-left: 2px solid var(--accent);
  white-space: pre-wrap;
  font-size: 16px;
  line-height: 1.75;
  color: var(--text-1);
}
.opportunity-times {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 24px 0 0;
}
.opportunity-times dt {
  color: var(--text-2);
  font-size: 12px;
  margin-bottom: 5px;
}
.opportunity-times dd {
  margin: 0;
  color: var(--text-1);
  font-size: 13px;
  line-height: 1.5;
}
.opportunity-entity-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-block: 12px;
  font-size: 13px;
}
.opportunity-review-section > label {
  display: block;
  font-size: 12px;
  color: var(--text-2);
  margin-bottom: 8px;
}
.opportunity-review-section > select {
  max-width: 100%;
  min-height: 40px;
}
.opportunity-version-note {
  font-size: 12px;
  color: var(--text-2);
}
.opportunity-fit-conclusion {
  font-size: 14px;
  font-weight: 500;
  padding-top: 12px;
}
.opportunity-criterion {
  border-top: 1px solid var(--border);
  padding-block: 18px;
}
.opportunity-evidence-quote {
  margin: 12px 0;
  padding-left: 16px;
  border-left: 1px solid var(--border-hover);
  white-space: pre-wrap;
  line-height: 1.65;
  font-size: 14px;
}
.opportunity-legacy-fit {
  margin-top: 14px;
  color: var(--text-2);
  font-size: 12px;
}
.opportunity-legacy-fit summary {
  cursor: pointer;
}
.opportunity-unchecked-criteria summary {
  padding-block: 12px;
  color: var(--text-2);
  font-size: 13px;
  cursor: pointer;
}
.opportunity-check-list {
  padding: 0;
  margin: 0;
  list-style: none;
}
.opportunity-check-list li {
  border-top: 1px solid var(--border);
  padding-block: 13px;
}
.opportunity-check-list li > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13px;
}
.opportunity-check-list li > p {
  font-size: 13px;
  color: var(--text-2);
}
.opportunity-check-warning {
  border-left: 2px solid var(--accent);
  padding-left: 12px;
}
.opportunity-review-notes label {
  display: block;
  margin-bottom: 10px;
  color: var(--text-2);
  font-size: 13px;
}
.opportunity-review-notes textarea {
  width: 100%;
  resize: vertical;
  min-height: 90px;
}
.opportunity-review-notes button {
  margin-top: 12px;
}
.opportunity-review-actions {
  padding-block: 22px;
  border-top: 1px solid var(--border-hover);
}
.opportunity-review-actions .opportunity-actions {
  margin-top: 14px;
}
.opportunity-empty,
.opportunity-unavailable {
  padding: 28px 0;
}
.opportunity-unavailable a {
  margin-left: 16px;
}
.opportunities-workspace :is(a, button, select, textarea, summary):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
@media (max-width: 700px) {
  .opportunities-workspace .page-header {
    flex-wrap: wrap;
  }
  .opportunity-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    padding-block: 20px;
  }
  .opportunity-row-meta {
    gap: 10px;
  }
  .opportunity-times {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }
  .opportunity-times > div {
    display: grid;
    grid-template-columns: minmax(95px, 30%) minmax(0, 1fr);
    gap: 12px;
  }
  .opportunity-excerpt {
    font-size: 15px;
    padding-left: 12px;
  }
  .opportunity-review-section {
    padding-block: 22px;
  }
  .opportunity-review-section > select {
    width: 100%;
  }
}
.opportunity-body,
.opportunity-row-main {
  min-width: 0;
}
.opportunity-evidence-fact {
  font-size: 14px;
  color: var(--text-1);
}
/* NAH-24: local presentation only; shared shell/mobile/campaign intents stay intact. */
.opportunity-group,
.opportunity-recorded-coverage,
.opportunity-source-receipt {
  min-width: 0;
  overflow-wrap: anywhere;
}
.opportunity-group-heading {
  padding: 16px 12px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
}
.opportunity-group-heading h2,
.opportunity-recorded-coverage h2 {
  margin: 0 0 6px;
  font-size: 18px;
}
.opportunity-group-heading p {
  margin: 0;
}
.opportunity-group .opportunity-row h3 {
  margin: 0 0 5px;
  font-size: 17px;
  line-height: 1.4;
}
.opportunity-recorded-coverage {
  padding: 16px 0;
  border-block: 1px solid var(--border);
}
.opportunity-source-receipt {
  padding-block: 12px;
  border-top: 1px solid var(--border);
}
.opportunity-source-receipt h3 {
  margin: 0 0 6px;
  font-size: 15px;
}
.opportunity-body :is(p, label, dt, dd, li, a, span, div, h4, select, textarea, button, summary),
.opportunity-body
  .opportunity-review
  :is(p, label, dt, dd, li, a, span, div, h4, select, textarea, button, summary),
.opportunity-count,
.opportunity-review-link {
  font-size: 14px;
}
.opportunity-body :is(button, select),
.opportunity-review-link,
.opportunity-evidence-jump {
  min-height: 44px;
  max-width: 100%;
  white-space: normal;
}
.opportunity-review-link {
  display: inline-flex;
  align-items: center;
}
.opportunity-body :is(a, button, input, select, textarea, summary):focus-visible,
.opportunity-review-section h2:focus,
.opportunity-selected-review:focus {
  outline: 2px solid var(--text-1);
  outline-offset: 3px;
}
.opportunity-evidence-jump {
  margin-bottom: 16px;
}
.opportunity-review-section h2 {
  scroll-margin-block: 24px;
}
/* NAH-27: compact recorded coverage and direct local queue navigation. */
.opportunity-header-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
}
.opportunity-header-actions > :is(a, button) {
  min-height: 44px;
  max-width: 100%;
  white-space: normal;
}
.opportunity-queue-jump {
  font-size: 14px;
}
.opportunity-count {
  margin-block: 8px 0;
}
.opportunity-coverage-summary {
  color: var(--text-2);
  margin-block: 0 12px;
  line-height: 1.5;
}
.opportunity-queue-heading {
  font-size: 18px;
  margin-block: 18px 12px;
  scroll-margin-block: 16px;
}
.opportunity-queue-heading:focus,
.opportunity-queue-jump:focus-visible {
  outline: 2px solid var(--text-1);
  outline-offset: 3px;
}
.opportunity-master-detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.opportunity-master,
.opportunity-pane {
  min-width: 0;
  max-height: calc(100dvh - 180px);
  overflow: auto;
  scrollbar-gutter: stable;
  padding: 4px;
}
.opportunity-pane {
  border-inline-start: 1px solid var(--border);
  padding-inline-start: 20px;
}
.opportunity-master .opportunity-row {
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}
.opportunity-master [aria-current="true"] {
  color: var(--text-1);
  text-decoration: underline;
  text-underline-offset: 4px;
}
.opportunity-literal-filters {
  margin-block: 14px;
  padding: 12px;
  border: 1px solid var(--border);
  color: var(--text-1);
}
.opportunity-literal-filters .opportunity-filter {
  margin-block: 12px;
}
.opportunity-literal-filters :is(textarea, button),
.opportunity-body .opportunity-fresh {
  min-height: 44px;
}
.opportunity-literal-filters button {
  margin: 4px;
}
.opportunity-back {
  min-height: 44px;
  align-content: center;
  font-size: 14px;
}
.opportunity-literal-filters textarea {
  width: 100%;
  max-width: 100%;
  font-size: 14px;
}
.opportunity-literal-filters > summary,
.opportunity-literal-result summary {
  min-height: 44px;
  align-content: center;
}
.opportunity-pane .opportunity-times {
  grid-template-columns: minmax(0, 1fr);
}
.opportunity-pane .opportunity-times > div {
  display: grid;
  grid-template-columns: minmax(80px, 1fr) minmax(0, 2fr);
  gap: 12px;
}
.opportunity-literal-result :is(p, h3),
.opportunity-literal-counts {
  overflow-wrap: anywhere;
}
@media (max-width: 700px) {
  .opportunity-master-detail {
    display: block;
  }
  .opportunity-queue-heading {
    /* Keep the 5px focus ring clear without clipping the first observation. */
    scroll-margin-block: 6px;
  }
  .opportunity-has-selection .opportunity-master,
  .opportunity-has-selection .opportunity-header-actions .opportunity-queue-jump,
  .opportunity-has-selection .opportunity-count {
    display: none;
  }
  .opportunity-pane {
    max-height: none;
    overflow: visible;
    border: 0;
    padding: 0;
  }
}
.qualification-evidence {
  margin-block: 22px;
  padding-block: 20px;
  border-block: 1px solid var(--border);
  min-width: 0;
}
.qualification-evidence h3 {
  margin: 0 0 16px;
}
.qualification-evidence-row {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) minmax(0, 3fr);
  gap: 16px;
  padding-block: 16px;
}
.qualification-evidence-row + .qualification-evidence-row {
  border-top: 1px solid var(--border);
}
.qualification-evidence-row h4 {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
}
.qualification-evidence-body {
  min-width: 0;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.qualification-evidence-body p {
  margin: 0 0 8px;
}
.qualification-evidence-body a {
  color: var(--text-1);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.qualification-evidence-state {
  color: var(--text-1);
  font-weight: 500;
}
.qualification-evidence-meta,
.qualification-evidence-metrics dt {
  color: var(--text-2);
  font-size: 12px;
}
.qualification-evidence-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}
.qualification-evidence-metrics dd {
  margin: 4px 0 0;
}
.qualification-evidence-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-block: 10px;
}
.qualification-evidence-person + .qualification-evidence-person {
  margin-top: 16px;
}
.qualification-history-list {
  margin-top: 12px;
}
.qualification-history-list summary {
  cursor: pointer;
}
.qualification-history-list > p {
  margin-top: 8px;
}
.qualification-history-list ol {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}
.qualification-history-list li {
  padding-block: 10px;
  border-top: 1px solid var(--border);
}
.qualification-evidence-body > button {
  margin-block: 8px;
  padding: 8px 12px;
  border: 1px solid var(--border-hover);
  border-radius: 6px;
  color: var(--text-1);
  background: var(--bg-2);
  font: inherit;
  cursor: pointer;
}
.qualification-evidence-body > button:disabled {
  opacity: 0.6;
  cursor: wait;
}
@media (max-width: 600px) {
  .qualification-evidence-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }
}

.campaign-designer .cd-strategy-pool {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.campaign-designer .cd-strategy-pool > p {
  margin-bottom: 6px;
}
.cd-strategy-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 310px), 1fr));
  gap: 7px;
}
.campaign-designer .cd-strategy-card {
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-1);
  overflow-wrap: anywhere;
}
.campaign-designer .cd-strategy-card h3,
.campaign-designer .cd-strategy-card h4,
.campaign-designer .cd-strategy-card p {
  margin: 0 0 3px;
}
.cd-strategy-headline,
.cd-strategy-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 2px 10px;
}
.campaign-designer .cd-strategy-run {
  margin-bottom: 6px;
}
.cd-strategy-assign,
.cd-strategy-picker-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 5px;
}
.cd-strategy-assign select,
.cd-strategy-picker-form select {
  flex: 1;
  min-width: min(100%, 130px);
}
.cd-strategy-picker {
  margin-bottom: 7px;
}
.cd-strategy-picker > summary {
  width: fit-content;
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--cd-accent);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.cd-strategy-picker > p:empty,
.cd-strategy-pool > [role="status"]:empty,
.cd-strategy-run > [role="status"]:empty {
  display: none;
}
.cd-strategy-receipts {
  margin: 5px 0 0;
  font-size: 12px;
}
.cd-strategy-receipts summary {
  cursor: pointer;
}
.cd-strategy-receipts[open] summary {
  margin-bottom: 5px;
}
.cd-strategy-receipts ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 16px;
}
.cd-strategy-receipts li > strong {
  display: inline-block;
  margin-right: 8px;
}
.cd-strategy-test {
  display: grid;
  gap: 8px;
  justify-items: start;
}
.cd-strategy-test label {
  width: 100%;
}

/* Six-room chrome: shared tokens, without restyling domain renderers. */
.sidebar.sidebar-v3 .nav-item {
  min-height: 32px;
}
.sidebar.sidebar-v3 .nav-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.daily-room {
  min-width: 0;
}
.social-room {
  max-width: 100%;
  color: var(--text-1);
  overflow-wrap: anywhere;
}
.daily-room > .page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}
.daily-room > .page-header .page-title {
  font-size: 24px;
  line-height: 1.25;
  letter-spacing: -0.025em;
}
.daily-room .page-subtitle,
.social-context {
  font-size: 12px;
  color: var(--text-2);
}
.social-context {
  display: grid;
  gap: 8px;
  margin-block: 12px;
}
.social-context .bk-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.work-room .today-board-toolbar h2 {
  font-size: 16px;
}
@media (max-width: 768px) {
  .daily-room > .page-header > div,
  .work-room .today-board-controls {
    min-width: 0;
    width: 100%;
  }
  .work-room .today-board-controls select {
    max-width: 100%;
  }
}

/* Social's local navigation is separate from the six-room application chrome. */
.social-room > .page-header > div {
  flex: 1;
  width: auto;
}
@media (max-width: 768px) {
  .social-room > .page-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0 12px;
    margin-bottom: 0;
  }
  .social-room > .page-header > div {
    display: contents;
  }
  .social-room > .page-header .page-title {
    grid-area: 1 / 1;
  }
  .social-room > .page-header .page-subtitle {
    grid-area: 2 / 1 / auto / -1;
    margin-top: 0;
  }
  .social-room > .page-header > button {
    grid-area: 1 / 2;
    min-height: 44px;
  }
}
.social-room .tabs {
  margin-bottom: 8px;
  overflow-x: auto;
}
.social-room .tab {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  box-sizing: border-box;
  white-space: nowrap;
}
.social-room .social-platforms .tab {
  flex: 1;
  justify-content: center;
  min-width: 44px;
  padding-inline: 8px;
}
.social-room .social-list-heading {
  font-size: 16px;
  margin-bottom: 4px;
}
.social-room .social-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: start;
  gap: 8px;
}
.social-room .social-kind {
  min-height: 44px;
  max-width: 100%;
  background: var(--bg-1);
  color: var(--text-1);
}
.social-room .social-kind option {
  background: var(--bg-1);
  color: var(--text-1);
}
.social-room .social-context {
  display: block;
  margin: 0;
}
.social-room :is(.social-operations, .social-account-chooser) {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-1);
  color: var(--text-1);
}
.social-room :is(.social-operations, .social-account-chooser) > summary {
  box-sizing: border-box;
  min-height: 44px;
  padding: 8px;
  cursor: pointer;
  font: inherit;
  color: var(--text-1);
}
.social-room .social-account-chooser > summary > span {
  display: block;
  margin-top: 4px;
}
.social-room .social-operations[open] {
  flex-basis: 100%;
}
.social-room .social-operations > :not(summary) {
  margin: 8px 10px;
}
.social-room .social-context .bk-actions > a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  box-sizing: border-box;
  white-space: normal;
}
.social-room .social-inbox-grid {
  display: grid;
  grid-template-columns: minmax(150px, 0.7fr) minmax(220px, 1fr) minmax(280px, 1.7fr);
  gap: 12px;
  align-items: start;
  margin-top: 12px;
}
.social-room .social-inbox-grid > *,
.social-room .social-conversation-detail > *,
.social-room .inbox-reply-area {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.social-room .social-account-rail,
.social-room .social-conversation-list {
  display: grid;
  gap: 4px;
  max-height: 70vh;
  overflow-y: auto;
}
.social-room .social-account-rail {
  padding: 4px;
}
.social-room .social-account-rail > a:not(.social-account) {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 6px;
  color: var(--text-1);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.social-room .social-account,
.social-room .social-thread-row {
  display: grid;
  gap: 4px;
  min-height: 44px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-1);
  background: var(--bg-1);
  text-decoration: none;
  overflow-wrap: anywhere;
}
.social-room .social-account[aria-current="page"],
.social-room .social-thread-row[aria-current="true"] {
  border-color: var(--accent);
  background: var(--bg-2);
}
.social-room .social-thread-row p {
  margin: 2px 0;
  font-size: 12px;
}
.social-room :is(a, button, select, textarea, summary):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.social-room textarea {
  box-sizing: border-box;
  width: 100%;
}
.social-room .wizard-label,
.social-room .inbox-reply-area > div {
  flex-wrap: wrap;
}
.social-room .social-conversation-detail {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
}
.social-room .social-x-grid {
  grid-template-columns: minmax(150px, 0.7fr) minmax(0, 2.7fr);
}
@media (max-width: 1000px) {
  .social-room .social-inbox-grid {
    grid-template-columns: minmax(140px, 0.7fr) minmax(0, 2fr);
  }
  .social-room .social-conversation-detail {
    grid-column: 1 / -1;
  }
}
@media (max-width: 600px) {
  /* Social already has the outer content's phone gutters. */
  .mojo:has(> .social-room) {
    padding: 0;
  }
  .social-room .social-inbox-grid {
    display: block;
  }
  .social-room .social-account-rail {
    max-height: 60vh;
  }
  .social-room .social-account-chooser {
    margin-bottom: 12px;
  }
  .social-room .social-conversation-list {
    max-height: none;
  }
  .social-room .social-conversation-detail {
    display: none;
  }
  .social-room .social-detail-open > .social-conversation-list {
    display: none;
  }
  .social-room .social-detail-open > .social-conversation-detail {
    display: block;
  }
  .social-room .social-platforms {
    flex-wrap: nowrap;
  }
  .social-room .social-context .bk-actions {
    display: flex;
    flex-wrap: wrap;
  }
}

/* CRM presentation uses the existing controls, tokens and table/drawer owners. */
.crm-room .page-header,
.crm-room .crm-header-actions,
.crm-toolbar {
  flex-wrap: wrap;
  min-width: 0;
}
.crm-toolbar {
  display: flex;
  align-items: start;
  gap: 8px;
  margin-top: 12px;
}
.crm-toolbar > input {
  flex: 1 1 240px;
  min-width: 0;
}
.crm-toolbar > select {
  flex: 0 1 190px;
  min-width: 0;
  max-width: 100%;
}
.crm-room .crm-tabs {
  display: flex;
  flex-wrap: wrap;
  overflow: visible;
  gap: 4px;
}
.crm-room :is(summary, input, select, button, .btn) {
  min-height: 36px;
  box-sizing: border-box;
}
.crm-room :is(summary, input, select, button, a):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.crm-room summary {
  cursor: pointer;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-1);
  background: var(--bg-1);
}
.crm-filters,
.crm-actions {
  min-width: 0;
  max-width: 100%;
}
.crm-filters[open] {
  flex: 1 1 100%;
}
.crm-filter-body,
.crm-actions-body {
  display: grid;
  gap: 8px;
  padding: 10px 0;
  min-width: 0;
}
.crm-room .filter-row {
  flex-wrap: wrap;
  margin: 0;
}
.crm-room .crm-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
  align-items: end;
  gap: 8px;
}
.crm-room .crm-fields :is(.filter-input, .filter-select) {
  width: 100%;
}
.crm-room .filter-row > *,
.crm-room .tag-autocomplete,
.crm-field input {
  min-width: 0;
  max-width: 100%;
}
.crm-field {
  display: grid;
  gap: 4px;
}
.crm-filter-status {
  margin: 8px 0;
  overflow-wrap: anywhere;
}
.crm-actions-body {
  max-width: 360px;
}
.crm-room .table-wrap {
  max-width: 100%;
  overflow-x: auto;
}
@media (max-width: 600px) {
  #topbar-search-btn {
    width: 32px;
    flex: 0 0 32px;
    padding: 0;
    justify-content: center;
  }
  #topbar-search-btn :is(.topbar-action-label, .topbar-action-kbd) {
    display: none;
  }
  .crm-room :is(summary, input, select, button, .btn) {
    min-height: 44px;
  }
  .crm-toolbar > input {
    flex-basis: 100%;
  }
}

/* NAH-40: local presentation only; existing dark/scoped-light tokens inherit. */
.relationships {
  min-width: 0;
  max-width: 100%;
  font-size: 14px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.relationships *,
.relationships *::before,
.relationships *::after {
  box-sizing: border-box;
}
.relationships h3,
.relationships h4 {
  font-size: 16px;
}
.relationships-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-block: 12px;
}
.relationships-controls label {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  max-width: 100%;
}
.relationships button,
.relationships select,
.relationships input {
  min-height: 44px;
  min-width: 44px;
  max-width: 100%;
  font: inherit;
  color: var(--text-1);
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 6px);
  padding: 8px;
}
.relationships input[type="number"] {
  width: 90px;
}
.relationships .relationships-inference {
  min-height: 44px;
  cursor: pointer;
}
.relationships .relationships-inference input[type="checkbox"] {
  appearance: auto;
  width: 18px;
  height: 18px;
  min-width: 0;
  min-height: 0;
  padding: 0;
  margin: 0;
  flex: 0 0 18px;
  accent-color: var(--accent);
  color-scheme: dark;
}
.mojo .relationships .relationships-inference input[type="checkbox"] {
  color-scheme: light;
}
.relationships-coverage pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.relationships button {
  cursor: pointer;
  white-space: normal;
  text-align: left;
}
.relationships button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}
.relationships [aria-pressed="true"] {
  border: 2px solid var(--accent);
  font-weight: 600;
}
.relationships :focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
.relationships-list {
  display: grid;
  gap: 8px;
}
.relationships-relation {
  width: 100%;
  overflow-wrap: anywhere;
}
.relationships svg {
  display: block;
  width: 100%;
  height: auto;
  color: var(--text-2);
}
.relationships svg circle,
.relationships svg rect {
  fill: var(--bg-2);
  stroke: var(--accent);
  stroke-width: 2;
}
.relationships svg text {
  fill: var(--text-1);
}
.relationships blockquote {
  margin: 12px 0;
  padding: 12px;
  border-left: 3px solid var(--accent);
  white-space: pre-wrap;
}
#drawer.relationships-expanded {
  width: min(1040px, 100vw);
  max-width: 100vw;
}

/* The existing typed CRM Name label is also its native drawer opener. */
.crm-name-control {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  padding: 4px 0;
  cursor: pointer;
}
.crm-name-control:hover {
  color: var(--accent);
}
.crm-name-control:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

.crm-website-review {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.crm-website-review select {
  display: block;
  max-width: 100%;
  margin-block: 0.5rem;
}
.crm-website-review .asst-approval {
  min-width: 0;
  overflow-wrap: anywhere;
}

.execution-runner-drawer {
  box-sizing: border-box;
  position: fixed;
  inset: 0 0 0 auto;
  margin: 0;
  width: min(46rem, 100vw);
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  overflow: auto;
  overflow-wrap: anywhere;
  padding: clamp(12px, 3vw, 24px);
  border: 0;
  border-inline-start: 1px solid var(--border);
  background: var(--bg-1);
  color: var(--text-1);
}

.execution-runner-drawer::backdrop {
  background: rgb(0 0 0 / 45%);
}

.execution-runner-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-block-end: 12px;
}
