/* ── Brand mark (two-tone rocket, theme-aware) ────────────────────────────── */
.brand-mark { width: 30px; height: 30px; flex: none; display: block; }
.brand-mark .logo-arrow { fill: var(--logo-arrow); }
.brand-mark .logo-rocket { fill: var(--logo-rocket); }
/* The brand is a FIXED logo lockup (rocket on the left of the wordmark) — it must look identical in LTR
   and RTL: never mirror the rocket, never reorder the lockup. Force LTR flow inside the lockup; in RTL
   align the whole lockup to the inline-start (right) edge so it still lines up with the right-aligned nav. */
.brand, .topbar-brand { direction: ltr; }
[dir="rtl"] .brand { justify-content: center; }

/* ── App shell ─────────────────────────────────────────────────────────── */
.app { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; }
.sidebar { background: var(--sidebar-bg); border-inline-end: 1px solid var(--border-subtle); padding: var(--sp-5) var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-4); position: sticky; top: 0; height: 100vh; padding-inline-end: 0; padding-bottom: 0; overflow: hidden; --_ps: var(--sp-4); }
/* animated radial orb sits behind all sidebar content */
.sidebar::before { content: ''; position: absolute; top: -50px; left: calc(50% - 120px); width: 240px; height: 240px; border-radius: 50%; background: radial-gradient(circle, rgba(8,126,252,0.28) 0%, rgba(2,62,138,0.12) 45%, transparent 70%); pointer-events: none; z-index: 0; animation: orb-float 8s ease-in-out infinite alternate; }
.sidebar > * { position: relative; z-index: 1; }
.sidebar .brand-mark { filter: drop-shadow(0 0 6px rgba(8,126,252,0.55)); }
/* Pull brand to full sidebar width so justify-content:center aligns to the sidebar box, not the padded
   content area; the full-bleed hairline under it grounds the lockup and separates it from the nav. */
.sidebar .brand { margin-inline-start: calc(-1 * var(--_ps)); width: calc(100% + var(--_ps)); padding-inline: 0; padding-block-end: var(--sp-4); border-block-end: 1px solid rgba(255,255,255,0.07); }
[dir="rtl"] .sidebar .brand { margin-inline-start: 0; margin-right: calc(-1 * var(--_ps)); width: calc(100% + var(--_ps)); }
.brand { display: flex; align-items: center; gap: var(--sp-2h); font-family: var(--font-display); font-weight: 600; font-size: var(--text-xl); letter-spacing: -.02em; color: var(--text-primary); justify-content: center; }
.brand b { color: var(--logo-wordmark-strong); font-weight: 600; }

/* The nav takes the height left under the brand and scrolls WITHIN the sidebar (min-height:0 lets a flex child
   shrink below its content so overflow actually triggers) — so a long nav (many groups / operator) never gets
   clipped by the 100vh sidebar. The scrollbar is slimmer than the global one and its thumb border matches the
   sidebar surface (not --bg-app), so it doesn't show a mismatched halo. */
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-height: 0; overflow-y: auto;
       scrollbar-width: thin; scrollbar-color: transparent transparent; line-height: 35px;
       scrollbar-gutter: stable; padding-block-end: var(--sp-5); }
/* the scrollbar stays invisible until the pointer is over the sidebar — the rail reads clean at rest */
.sidebar:hover .nav, .nav:focus-within { scrollbar-color: var(--border-strong) transparent; }
.nav::-webkit-scrollbar { width: 8px; }
.nav::-webkit-scrollbar-button { display: none; height: 0; }
.nav::-webkit-scrollbar-track { background: transparent; }
.nav::-webkit-scrollbar-thumb { background: transparent; border-radius: var(--r-pill); }
.sidebar:hover .nav::-webkit-scrollbar-thumb { background: var(--border-strong); border: 2px solid var(--bg-surface); }
.nav::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); }
/* Section heads carry a dim cobalt tint + weight so the eye finds group boundaries without scanning —
   plain tertiary gray sat too close to the resting rows. Arabic: bigger and NO tracking (letter-spacing
   visually breaks the joined script; caps-tracking is a Latin-only device). */
.nav-label { display: flex; align-items: center; height: 30px; font-size: var(--text-xs); font-weight: 600; letter-spacing: var(--tracking-label); text-transform: uppercase; color: color-mix(in srgb, var(--accent-ink) 72%, transparent); padding: 0 var(--sp-3); margin-block-start: calc(var(--sp-4) + var(--sp-1)); }
.nav-label:first-child { margin-block-start: 0; }
[dir="rtl"] .nav-label { font-size: var(--text-sm); letter-spacing: 0; }

/* ── Sidebar platform groups — the collapsible <details> pattern (A2). One block per platform
   (Facebook today; Instagram/Threads/TikTok land as siblings) — the admin group reuses it (I1).
   The summary reads like a .nav-label but is interactive; app.js persists open/closed. ── */
.nav-group { margin-block-start: calc(var(--sp-4) + var(--sp-1)); }
.nav-group:first-of-type { margin-block-start: var(--sp-3); }
.nav-group-head { list-style: none; display: flex; align-items: center; gap: var(--sp-2); height: 30px;
  line-height: 1; padding: 0 var(--sp-3); border-radius: var(--r-1); cursor: pointer; user-select: none;
  font-size: var(--text-xs); font-weight: 600; letter-spacing: var(--tracking-label); text-transform: uppercase;
  color: color-mix(in srgb, var(--accent-ink) 72%, transparent); transition: color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease); }
[dir="rtl"] .nav-group-head { font-size: var(--text-sm); letter-spacing: 0; }
.nav-group-head::-webkit-details-marker { display: none; }
.nav-group-head:hover { color: var(--accent-ink); background: rgba(255,255,255,0.06); }
.nav-group-head:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.nav-group-chev { width: 14px; height: 14px; flex: none; margin-inline-start: auto; opacity: .7;
  transition: transform var(--dur-fast) ease; }
/* closed → chevron points at the inline-end (transforms have no logical form → explicit RTL mirror) */
.nav-group:not([open]) .nav-group-chev { transform: rotate(-90deg); }
[dir="rtl"] .nav-group:not([open]) .nav-group-chev { transform: rotate(90deg); }
.nav-group-items { display: flex; flex-direction: column; gap: 2px; padding-top: var(--sp-1); }

/* "More coming soon" — a deliberately non-interactive growth hint inside a platform group, styled as an
   empty dashed "next bay" slot (future platforms dock here) so it can't be mistaken for a broken link. */
.nav-soon { display: flex; align-items: center; gap: var(--sp-2h); margin-block-start: var(--sp-2);
  padding: var(--sp-2) var(--sp-3); border: 1px dashed rgba(255,255,255,0.14); border-radius: var(--r-2);
  color: var(--text-tertiary); cursor: default; }
.nav-soon svg { width: 16px; height: 16px; flex: none; opacity: .55; }
.nav-soon-text { display: flex; flex-direction: column; gap: 1px; line-height: 1.4; min-width: 0; }
.nav-soon-label { font-size: var(--text-sm); font-weight: 500; }
.nav-soon-hint { font-size: var(--text-2xs); opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav a { display: flex; align-items: center; gap: var(--sp-3); height: 38px; padding: 0 var(--sp-3); border-radius: var(--r-2); color: var(--text-secondary); font-weight: 500; font-size: var(--text-md); position: relative;
  transition: color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease); }
/* rest = muted, hover = lifted, active = white — the column reads as hierarchy, not a wall of white */
.sidebar .nav a { color: var(--text-secondary); font-size: var(--text-base); }
.sidebar .nav a:hover { background: rgba(255,255,255,0.07); color: var(--text-primary); }
.nav a svg { width: 19px; height: 19px; flex: none; opacity: .75; transition: opacity var(--dur-fast) var(--ease); }
.nav a:hover { background: var(--bg-surface-2); color: var(--text-primary); }
.nav a:hover svg { opacity: 1; }
/* Active = the "boost rail": a lit gradient edge at the row's inline-start that FOLLOWS the pill's
   rounded corners — the gradient paints the border-box and the padding-box/xor mask keeps only the
   3px logical border region, whose ends taper along the radius arcs (a straight bar would overshoot
   the curve). border-inline-start is logical, so RTL mirrors it for free; the wash gradient itself
   still needs the RTL mirror. drop-shadow (not box-shadow) so the glow hugs the masked curve. */
.nav a.active { background: var(--nav-active-bg); color: var(--text-primary); }
.nav a.active::before { content: ''; position: absolute; inset-block: 0; inset-inline-start: 0; width: 16px;
  pointer-events: none;
  border-start-start-radius: var(--r-2); border-end-start-radius: var(--r-2);
  border-inline-start: 3px solid transparent;
  background: linear-gradient(180deg, #87CCFF, #087EFC 55%, #023E8A) border-box;
  -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  filter: drop-shadow(0 0 5px rgba(8,126,252,0.6)); }
[dir="rtl"] .nav a.active { background: linear-gradient(to left, rgba(8,126,252,0.26), rgba(2,62,138,0.10), transparent 80%); }
.nav a.active svg { opacity: 1; color: var(--accent); }

/* In light theme the sidebar stays dark — the artifact's "rails never switch on the cabin lights".
   Force the colour tokens back to the artifact COCKPIT dark values so the always-night rail matches
   the dark theme exactly (not the pre-artifact greys). */
[data-theme="light"] .sidebar {
  color-scheme: dark;
  --bg-surface: #0A101F;
  --bg-surface-2: #101A30;
  --bg-surface-3: #18243E;
  --border-subtle: rgba(111,193,255,0.11);
  --border-strong: rgba(111,193,255,0.22);
  --text-primary: #EAF2FF;
  --text-secondary: #93A7C9;
  --text-tertiary: #6E80A6;
  --accent: #087EFC;
  --accent-hover: #6FC1FF;
  --accent-ink: #6FC1FF;
  --accent-wash: rgba(8,126,252,0.14);
  --accent-wash-strong: rgba(8,126,252,0.20);
  --accent-border: rgba(8,126,252,0.40);
  --logo-arrow: #087EFC;
  --logo-rocket: #FFFFFF;
  --logo-wordmark-strong: #FFFFFF;
  --avatar-ring: rgba(255,255,255,0.12);
  --avatar-gradient: linear-gradient(145deg, #087EFC, #023E8A);
  --sidebar-bg: linear-gradient(180deg, #060B18 0%, #04070F 44%);
  --nav-active-bg: linear-gradient(90deg, rgba(8,126,252,0.20), rgba(2,62,138,0.08), transparent 80%);
  --nav-active-border: #087EFC;
  --ctl: #1B1F27; --ctl-hover: #232732; --ctl-edge: rgba(255,255,255,0.16);
  --shadow-color: rgba(0,6,24,0.9);
  padding-inline-end: 0;
  padding-inline-start: 20px;
  --_ps: 20px;
}

/* ── Sidebar footer — a contained account card ────────────────────────────── */
.sidebar-foot { margin-top: auto; background: var(--bg-surface-2); border: 1px solid var(--border-subtle); border-radius: var(--r-2); padding: var(--sp-3); }
.user { display: flex; align-items: center; gap: var(--sp-2h); }
.user-avatar { width: 38px; height: 38px; flex: none; border-radius: var(--r-pill); background: var(--avatar-gradient); color: var(--text-on-accent); display: grid; place-items: center; font-family: var(--font-display); font-weight: 600; font-size: var(--text-lg); box-shadow: inset 0 0 0 1px var(--avatar-ring), 0 3px 10px -4px var(--accent); }
/* Accounts row identity: reuses the .user-avatar look at row size, with a profile photo that degrades
   to the initials avatar if absent OR if the (expiring) CDN link fails — the <img> onerror removes
   itself, revealing the initial underneath. Flex row is writing-direction aware → avatar sits inline-start
   in both LTR and RTL with no hardcoded side. */
.acct-identity { display: flex; align-items: center; gap: var(--sp-3); min-width: 0; }
.acct-identity .acct-text { min-width: 0; }
.acct-avatar { width: 34px; height: 34px; font-size: var(--text-base); position: relative; overflow: hidden; }
.acct-avatar > svg { width: 50%; height: 50%; }   /* icon-bearing avatars (chat/composer previews) */
.acct-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.acct-avatar-lg { width: 64px; height: 64px; font-size: var(--text-2xl); }   /* account Details header */
/* Two-up section grid (identity / technical) — collapses to one column on narrow screens. */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); margin-bottom: var(--sp-5); }
@media (max-width: 720px) { .grid-2 { grid-template-columns: 1fr; } }
.acct-name { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-meta { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.user-email { font-size: var(--text-sm); color: var(--text-primary); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { display: flex; }
.user-role .chip { padding: 2px var(--sp-2); font-size: var(--text-2xs); }
/* Actions as a tidy stacked menu — full-width, icon + label, borderless until hover (Sign out warns red). */
.user-actions { display: flex; flex-direction: column; gap: 2px; margin-top: var(--sp-3); padding-top: var(--sp-3); border-top: 1px solid var(--border-subtle); }
.user-actions form { display: contents; }
.user-actions .btn { height: 36px; justify-content: flex-start; gap: var(--sp-2h); padding: 0 var(--sp-2h); background: transparent; border-color: transparent; color: var(--text-secondary); font-weight: 500; }
.user-actions .btn svg { width: 16px; height: 16px; opacity: .8; }
.user-actions .btn:hover { background: var(--accent-wash); color: var(--text-primary); }
.user-actions .btn-signout:hover { background: var(--status-failed-wash); color: var(--status-failed); }

.main { display: flex; flex-direction: column; min-width: 0; }
/* sticky glass bar — translucent + blur so content visibly scrolls beneath it; .is-scrolled (app.js) adds elevation */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); padding: var(--sp-5) var(--sp-6); border-bottom: 1px solid var(--border-subtle); position: sticky; top: 0; background: color-mix(in srgb, var(--bg-surface) 78%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); z-index: var(--z-sticky); transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.topbar.is-scrolled { border-color: var(--border-strong); box-shadow: var(--elev-2); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .topbar { background: var(--bg-surface); } }
.topbar-actions { display: flex; align-items: center; gap: var(--sp-3); }
/* the theme toggle + language switch are 38px; any .btn in the app bar matches them. */
.topbar-actions .btn { height: 38px; }

/* Page-header band — the page title/subtitle + the page actions (@section TopActions) on their OWN row
   below the app bar, so they never compete with the app controls. flex + space-between flips for RTL with
   no extra rule; flex-wrap drops the actions below the title on a narrow screen. Scrolls (not sticky). */
/* Page-head band (B1 rhythm): a roomier title block with a confident display heading — the hero the
   canvas pool sits behind. */
.page-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--sp-4); padding: var(--sp-6) var(--sp-6); border-block-end: 1px solid var(--border-subtle); }
.page-title { min-width: 0; }
.page-header h1 { font-size: var(--text-3xl); letter-spacing: -.02em; margin: 0; background: linear-gradient(90deg, var(--text-primary) 10%, var(--accent-ink) 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
[data-theme="light"] .page-header h1 { background: linear-gradient(90deg, var(--text-primary) 10%, var(--accent) 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.page-header .sub { color: var(--text-secondary); font-size: var(--text-sm); margin-top: 2px; }
.content { padding: var(--sp-6) var(--sp-6) var(--sp-7); width: 100%; }

/* Mobile sidebar-drawer controls — defined here but HIDDEN on desktop; the ≤860px query reveals them.
   On desktop the topbar lead just wraps the title (the hamburger is display:none), so the shell is unchanged. */
.topbar-lead { display: flex; align-items: center; gap: var(--sp-3); min-width: 0; }
.nav-toggle { display: none; align-items: center; justify-content: center; width: 40px; height: 40px; flex: none; border-radius: var(--r-2); background: transparent; border: 1px solid var(--border-subtle); color: var(--text-secondary); cursor: pointer; }
.nav-toggle:hover { background: var(--bg-surface-2); color: var(--text-primary); }
.nav-toggle svg { width: 20px; height: 20px; }
.nav-backdrop { display: none; }

/* Header brand — HIDDEN on desktop (the sidebar carries the brand there); the ≤860px query reveals it when
   the sidebar is an off-canvas drawer. The account dropdown (.user-menu) shows at ALL widths — it replaced
   the sidebar footer — and mirrors the language switcher's native <details> pattern. */
.topbar-brand { display: none; align-items: center; gap: var(--sp-2h); font-family: var(--font-display); font-weight: 600; font-size: var(--text-lg); letter-spacing: -.02em; color: var(--text-primary); white-space: nowrap; }
.topbar-page-title { font-family: var(--font-display); font-size: var(--text-sm); font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-breadcrumb-parent { color: var(--text-secondary); }
.topbar-breadcrumb-sep { color: var(--text-tertiary); }
.topbar-brand .brand-mark { width: 26px; height: 26px; }
.topbar-brand b { color: var(--logo-wordmark-strong); }
.user-menu { display: inline-block; position: relative; }
.user-menu > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; border-radius: var(--r-pill); }
.user-menu > summary::-webkit-details-marker { display: none; }
.user-menu > summary:focus-visible { outline: var(--ring); }
.user-menu > summary .user-avatar { width: 38px; height: 38px; }
.user-menu-panel { position: absolute; z-index: var(--z-dropdown); inset-inline-end: 0; top: calc(100% + 6px); min-width: 224px; background: var(--bg-surface); border: 1px solid var(--border-strong); border-radius: var(--r-2); box-shadow: var(--elev-2); padding: var(--sp-1); }
.user-menu-head { padding: var(--sp-2h); margin-bottom: var(--sp-1); border-block-end: 1px solid var(--border-subtle); }
.user-menu-head .user-email { margin-bottom: 5px; }
.user-menu-head .user-role { display: flex; }
.user-menu form { margin: 0; display: contents; }
.user-menu-item { display: flex; align-items: center; gap: var(--sp-2h); width: 100%; background: none; border: 0; color: var(--text-primary); padding: 9px var(--sp-2h); border-radius: var(--r-1); cursor: pointer; font-family: var(--font-body); font-size: var(--text-base); font-weight: 500; text-align: start; }
.user-menu-item svg { width: 16px; height: 16px; flex: none; opacity: .8; }
.user-menu-item:hover { background: var(--accent-wash); }
.user-menu-signout:hover { background: var(--status-failed-wash); color: var(--status-failed); }

/* ── Notification bell (topbar) — same details/summary dropdown idiom as .user-menu/.lang-switch ──────── */
.notif-bell { display: inline-block; position: relative; }
.notif-bell > summary {
  list-style: none; cursor: pointer; position: relative;
  width: 38px; height: 38px; flex: none; display: inline-grid; place-items: center;
  background: var(--bg-surface-2); color: var(--text-secondary);
  border: 1px solid var(--border-strong); border-radius: var(--r-2);
  transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.notif-bell > summary::-webkit-details-marker { display: none; }
.notif-bell > summary:hover, .notif-bell[open] > summary { color: var(--text-primary); border-color: var(--accent); }
.notif-bell > summary:focus-visible { outline: var(--ring); }
.notif-bell > summary svg { width: 18px; height: 18px; }
.notif-badge { position: absolute; top: 3px; inset-inline-end: 3px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: var(--r-pill); background: var(--status-failed); color: #fff; font-size: 10px; font-weight: 700;
  line-height: 16px; text-align: center; font-variant-numeric: tabular-nums; pointer-events: none; z-index: 1; }
.notif-panel { position: absolute; z-index: var(--z-dropdown); inset-inline-end: 0; top: calc(100% + 6px);
  width: 340px; max-width: calc(100vw - 2 * var(--sp-4)); background: var(--bg-surface); border: 1px solid var(--border-strong);
  border-radius: var(--r-2); box-shadow: var(--elev-2); overflow: hidden; }
.notif-panel-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2);
  padding: var(--sp-2h) var(--sp-3); border-block-end: 1px solid var(--border-subtle); }
.notif-panel-title { font-weight: 600; font-size: var(--text-sm); color: var(--text-primary); }
.notif-list { max-height: 360px; overflow-y: auto; }
.notif-row { display: flex; align-items: flex-start; gap: var(--sp-2h); padding: var(--sp-3); border-block-end: 1px solid var(--border-subtle);
  transition: background var(--dur-fast) var(--ease); }
.notif-row:last-child { border-block-end: 0; }
.notif-row:hover { background: var(--bg-surface-2); }
.notif-row-text { flex: 1 1 0; min-width: 0; }
.notif-row-title { font-size: var(--text-sm); font-weight: 600; color: var(--text-primary); }
.notif-row-head { font-size: var(--text-xs); color: var(--text-secondary); margin-block-start: 3px; line-height: 1.45; }
.notif-row-meta { font-size: var(--text-2xs); color: var(--text-tertiary); margin-block-start: 4px; white-space: pre-line;
  line-height: 1.7; }
.notif-row-time { font-size: var(--text-2xs); color: var(--text-tertiary); margin-block-start: var(--sp-1h); }
.notif-list-msg { padding: var(--sp-4) var(--sp-3); text-align: center; color: var(--text-tertiary); font-size: var(--text-sm); }
.notif-panel-foot { border-block-start: 1px solid var(--border-subtle); padding: var(--sp-2) var(--sp-3); text-align: center; }
.notif-view-all { font-size: var(--text-xs); font-weight: 600; color: var(--accent); }
.notif-view-all:hover { color: var(--accent-hover); }

/* ── notification thumbnail (page avatar) — bell dropdown + full list ──────────────────────────────────── */
.notif-thumb { width: 32px; height: 32px; border-radius: var(--r-pill); object-fit: cover; flex: none;
  background: var(--bg-surface-2); border: 1px solid var(--border-subtle); }
.notif-thumb-fallback { display: inline-flex; align-items: center; justify-content: center; font-size: 15px; }
.notif-thumb-lg { width: 40px; height: 40px; }
.notif-thumb-fallback svg { width: 18px; height: 18px; color: var(--text-tertiary); }
/* full Notifications page rows — the bell-row anatomy at page scale; unread carries an accent edge */
.notif-page-row { padding: var(--sp-4) var(--sp-5); gap: var(--sp-3); }
.notif-page-row.is-unread { border-inline-start: 3px solid var(--accent); }
.notif-page-row .notif-row-title { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; font-size: var(--text-base); }
.notif-full-row { display: flex; align-items: flex-start; gap: var(--sp-3); }
.notif-full-text { flex: 1 1 0; min-width: 0; }
.notif-full-head { font-size: var(--text-sm); color: var(--text-secondary); margin-block-start: var(--sp-1); line-height: 1.5; }
.notif-full-meta { font-size: var(--text-xs); color: var(--text-tertiary); margin-block-start: var(--sp-1); white-space: pre-line;
  line-height: 1.8; }

/* ── checkpoint identity block (C2): the profile pic reads as an account avatar; name + uid labeled ───── */
.notif-thumb.notif-identity-pic { border-radius: var(--r-pill); }
.notif-identity { display: flex; flex-direction: column; gap: 2px; margin-block-start: var(--sp-1); }
.notif-identity-label { font-size: var(--text-2xs); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--text-tertiary); }
.notif-identity-name { font-size: var(--text-base); font-weight: 600; color: var(--text-primary); }
.notif-identity-uid { font-size: var(--text-xs); color: var(--text-secondary); }
/* the bell dropdown reuses the label inline before the head line */
.notif-row-head .notif-identity-label { margin-inline-end: var(--sp-1); }

/* ── typed-card pieces (C1): title deep link, per-type chip sizing, and the trailing open-arrow ────────── */
.notif-row-title .chip { font-size: var(--text-2xs); padding: 1px var(--sp-2); }
.notif-title-link { color: inherit; }
.notif-title-link:hover { color: var(--accent-ink); }
.notif-open-link { flex: none; display: inline-grid; place-items: center; width: 28px; height: 28px;
  color: var(--text-tertiary); border: 1px solid transparent; border-radius: var(--r-pill);
  transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease); }
.notif-open-link svg { width: 15px; height: 15px; }
.notif-open-link:hover { color: var(--accent-ink); border-color: var(--accent-border); background: var(--accent-wash); }

/* ── per-notification "mark as read" — bell dropdown (icon-only) + full list (same icon, in its own cell) ── */
.notif-mark-btn { flex: none; display: inline-grid; place-items: center; width: 28px; height: 28px;
  color: var(--text-tertiary); background: transparent; border: 1px solid transparent; border-radius: var(--r-pill);
  cursor: pointer; transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease); }
.notif-mark-btn svg { width: 15px; height: 15px; }
.notif-mark-btn:hover { color: var(--status-live); border-color: var(--status-live); background: var(--status-live-wash); }
.notif-mark-btn:disabled { opacity: .5; cursor: default; }
.notif-mark-one { display: flex; }

/* ── Telegram link code (user's own notification-settings page) ────────────────────────────────────────── */
.link-code { display: inline-block; font-size: var(--text-lg); font-weight: 700; letter-spacing: .15em;
  padding: var(--sp-2) var(--sp-3); background: var(--bg-surface); border: 1px solid var(--border-strong);
  border-radius: var(--r-1); margin-inline-end: var(--sp-2); }

/* ── Theme toggle ──────────────────────────────────────────────────────────── */
.theme-toggle {
  width: 38px; height: 38px; flex: none; display: inline-grid; place-items: center;
  background: var(--bg-surface-2); color: var(--text-secondary);
  border: 1px solid var(--border-strong); border-radius: var(--r-2);
  cursor: pointer; transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.theme-toggle:hover { color: var(--text-primary); border-color: var(--accent); }
.theme-toggle svg { width: 18px; height: 18px; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
[data-theme="light"] .theme-toggle .icon-sun { display: none; }
.auth-toggle { position: absolute; top: var(--sp-5); inset-inline-end: var(--sp-5); }

/* ── Language switcher (native <details> dropdown, no JS) ──────────────────── */
.lang-switch { position: relative; }
.lang-switch > summary { list-style: none; cursor: pointer; height: 38px; display: inline-flex; align-items: center; gap: var(--sp-1h); padding: 0 var(--sp-2h); background: var(--bg-surface-2); color: var(--text-secondary); border: 1px solid var(--border-strong); border-radius: var(--r-2); font-size: var(--text-sm); user-select: none; }
.lang-switch > summary::-webkit-details-marker { display: none; }
.lang-switch > summary:hover, .lang-switch[open] > summary { color: var(--text-primary); border-color: var(--accent); }
.lang-switch summary svg { width: 16px; height: 16px; }
.lang-code { font-weight: 600; letter-spacing: .02em; }
.lang-menu { position: absolute; z-index: var(--z-dropdown); inset-inline-end: 0; top: calc(100% + 6px); min-width: 168px; background: var(--bg-surface); border: 1px solid var(--border-strong); border-radius: var(--r-2); box-shadow: var(--elev-2); padding: var(--sp-1); }
.lang-item-form { margin: 0; }
.lang-item { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); width: 100%; background: none; border: 0; color: var(--text-primary); padding: 8px var(--sp-2h); border-radius: var(--r-1); cursor: pointer; font-family: var(--font-body); font-size: var(--text-base); text-align: start; }
.lang-item:hover { background: var(--accent-wash); }
.lang-item.is-active { color: var(--accent); font-weight: 600; }
.lang-check { width: 16px; height: 16px; flex: none; }

/* ── Buttons — ONE disciplined scale (default + sm) ──────────────────────── */
.btn {
  font-family: var(--font-body); font-weight: 600; font-size: var(--text-base); line-height: 1;
  border: 1px solid transparent; border-radius: var(--r-2);
  height: 40px; padding: 0 var(--sp-4); cursor: pointer; white-space: nowrap;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  transition: transform var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn-sm { height: 32px; padding: 0 var(--sp-3); font-size: var(--text-sm); }
.btn-block { width: 100%; }
.btn-primary {
    background: linear-gradient(135deg, #087EFC 0%, #0257CC 100%);
    color: var(--text-on-accent);
    position: relative;
    overflow: hidden;
}
/* shine sweep — slides across on hover */
.btn-primary::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,0.22) 50%, transparent 65%);
  transform: translateX(-150%);
  transition: transform 0.55s ease;
}
.btn-primary:hover { background: linear-gradient(135deg, #3F9BFF 0%, #087EFC 100%); color: var(--text-on-accent); }
.btn-primary:hover::before { transform: translateX(150%); }
.btn-ghost { background: var(--bg-surface-2); color: var(--text-primary); border-color: var(--border-strong); }
.btn-ghost:hover { border-color: var(--accent); color: var(--text-primary); }
.btn-live { background: var(--status-live-wash); color: var(--status-live); border-color: var(--status-live-border); }
.btn-live:hover { background: var(--status-live-wash); border-color: var(--status-live); }
.btn-danger { background: var(--status-failed-wash); color: var(--status-failed); border-color: var(--status-failed-border); }
.btn-danger:hover { background: var(--status-failed-wash); border-color: var(--status-failed); }

/* ── Layout utilities (token-driven — replace inline styles) ──────────────── */
.center { text-align: center; }
.m-0 { margin: 0 !important; }
.mt-2 { margin-top: var(--sp-2); } .mt-3 { margin-top: var(--sp-3); } .mt-4 { margin-top: var(--sp-4); } .mt-5 { margin-top: var(--sp-5); }
.mb-2 { margin-bottom: var(--sp-2); } .mb-3 { margin-bottom: var(--sp-3); } .mb-4 { margin-bottom: var(--sp-4); } .mb-5 { margin-bottom: var(--sp-5); }
.subtitle { color: var(--text-secondary); margin: 0 0 var(--sp-5); }
.narrow { max-width: 760px; } .narrow-md { max-width: 600px; } .narrow-sm { max-width: 460px; }
/* action button groups: lay out tidily, do NOT stretch like .row does */
.actions { display: flex; gap: var(--sp-3); flex-wrap: wrap; align-items: center; }
.actions.end { justify-content: flex-end; }
.span-all { grid-column: 1 / -1; }   /* a full-width item inside any grid (e.g. an empty state in a card grid) */
/* sticky form footer with a live recap — commits a long form without scrolling back down */
.form-actions-bar { position: sticky; bottom: 0; z-index: var(--z-sticky); display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); flex-wrap: wrap; margin-top: var(--sp-5); padding: var(--sp-3) var(--sp-4); background: var(--bg-surface); border: 1px solid var(--border-strong); border-radius: var(--r-2); box-shadow: 0 -10px 28px -18px var(--shadow-color); }
.form-actions-bar .summary { color: var(--text-secondary); font-size: var(--text-sm); min-width: 0; }
.form-actions-bar .actions { flex: none; }
/* toolbar: search on the start side, bulk actions on the end side */
.toolbar { display: flex; gap: var(--sp-3); justify-content: space-between; align-items: center; flex-wrap: wrap; }
.toolbar .input { min-width: 260px; }
/* inline search row: the input grows; the submit/clear sit beside it on ONE line at the same height
   (flex follows writing direction, so the controls land on the inline-end in both LTR and RTL). */
.search-bar { display: flex; flex-wrap: nowrap; align-items: center; gap: var(--sp-3); }
.search-bar .input { flex: 1; height: 40px; }
/* row-selection checkbox column */
.pick-col { width: 34px; text-align: center; }
/* a scrollable list of checkboxes (e.g. account picker) */
.pick-list { display: flex; flex-direction: column; gap: var(--sp-2); max-height: 200px; overflow-y: auto; padding: var(--sp-3); border: 1px solid var(--border-strong); border-radius: var(--r-2); background: var(--bg-surface-2); }

/* ── Bulk page picker — scales to thousands: the server returns the top-N by audience + a total, the DOM
   only ever renders that shown set, and "target all matching" expands the whole filter server-side.
   (.acct-pick — NOT .acct-filter: that name belongs to the Pages-toolbar dropdown further down, whose
   fixed width used to bleed into this collapsible and crush it.) ── */
.acct-pick { border: 1px solid var(--border-subtle); border-radius: var(--r-2); background: var(--bg-surface-2); margin-bottom: var(--sp-4); }
.acct-pick > summary { display: flex; align-items: center; gap: var(--sp-2); cursor: pointer; list-style: none; padding: var(--sp-3) var(--sp-4); font-size: var(--text-sm); font-weight: 600; color: var(--text-secondary); }
.acct-pick > summary::-webkit-details-marker { display: none; }
.acct-pick > summary svg { width: 16px; height: 16px; color: var(--text-tertiary); }
.acct-pick[open] > summary { border-block-end: 1px solid var(--border-subtle); }
.acct-pick .pick-list { border: 0; background: none; border-radius: 0; max-height: 264px; padding: 2px; gap: 1px; }
.acct-pick-count { margin-inline-start: auto; color: var(--accent); font-family: var(--font-mono); font-size: var(--text-xs); }
/* searchable account filter styled like the pages list (avatar · name · uid), was a bare checkbox stack */
.acct-pick-body { padding: var(--sp-3); display: flex; flex-direction: column; gap: var(--sp-3); }
.acct-search { height: 38px; }
.acct-row { padding: var(--sp-2) var(--sp-2h); border-radius: var(--r-2); cursor: pointer; transition: background var(--dur-fast) var(--ease); }
.acct-row:hover { background: var(--bg-surface); }
.acct-row:has(input:checked) { background: var(--accent-wash); }
.acct-row .bulk-page { flex: 1 1 auto; }
.acct-row-pages { flex: none; margin-inline-start: auto; font-family: var(--font-mono); font-size: var(--text-xs); color: var(--text-tertiary); white-space: nowrap; }
.acct-nomatch { text-align: center; color: var(--text-tertiary); font-size: var(--text-sm); padding: var(--sp-3) 0 var(--sp-2); }

.bulk-selbar { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; margin: var(--sp-4) 0 var(--sp-2h); }
.bulk-selcount { font-family: var(--font-display); font-weight: 600; color: var(--text-primary); }
.bulk-pagesnote { font-size: var(--text-sm); color: var(--text-tertiary); }
.bulk-selactions { margin-inline-start: auto; display: flex; gap: var(--sp-2); }
.bulk-allmatching { margin-bottom: var(--sp-3); padding: var(--sp-2h) var(--sp-3); border: 1px dashed var(--accent-border); border-radius: var(--r-2); background: var(--accent-wash); }

.bulk-pagelist { max-height: 440px; overflow-y: auto; border: 1px solid var(--border-subtle); border-radius: var(--r-2); }
.bulk-pagetable { margin: 0; }
.bulk-pagetable thead th { position: sticky; inset-block-start: 0; z-index: 1; background: var(--bg-surface); }
.bulk-pagetable td { padding-block: var(--sp-2h); }
.bulk-pagetable tbody tr:last-child td { border-block-end: 0; }
.bulk-pagetable tr.is-sel td { background: var(--accent-wash); }
.bulk-pagetable tr.is-sel:hover td { background: var(--accent-wash-strong); }
.bulk-page { display: flex; align-items: center; gap: var(--sp-3); min-width: 0; }
.bulk-page .acct-text { min-width: 0; }
.acct-avatar.sm { width: 30px; height: 30px; font-size: var(--text-xs); }

/* modal (templates: save / load picker / load summary) */
.modal { position: fixed; inset: 0; z-index: var(--z-modal); display: none; align-items: center; justify-content: center; padding: var(--sp-4); }
.modal.is-open { display: flex; }
.modal-backdrop { position: absolute; inset: 0; background: var(--overlay); backdrop-filter: blur(2px); }
.modal-card { position: relative; width: 100%; max-width: 540px; max-height: 82vh; overflow-y: auto; background: var(--bg-surface); border: 1px solid var(--border-strong); border-radius: var(--r-3); padding: var(--sp-5); box-shadow: var(--elev-3); }
.modal-title { font-size: var(--text-lg); font-weight: 600; margin-bottom: var(--sp-2); }
.modal-list { display: flex; flex-direction: column; gap: var(--sp-2); margin: var(--sp-3) 0; max-height: 320px; overflow-y: auto; }
.modal-list .row-pick { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3); padding: var(--sp-3); border: 1px solid var(--border-strong); border-radius: var(--r-2); background: var(--bg-surface-2); cursor: pointer; text-align: start; width: 100%; }
.modal-list .row-pick:hover { border-color: var(--accent); }
.summary-line { display: flex; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-1h) 0; border-bottom: 1px solid var(--border-subtle); }

/* choice cards inside a modal (e.g. add a single account vs bulk import) */
.choice-grid { display: grid; gap: var(--sp-3); margin: var(--sp-4) 0; }
.choice-card { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-4); text-decoration: none; color: inherit;
  border: 1px solid var(--border-strong); border-radius: var(--r-2); background: var(--bg-surface-2);
  transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease); }
.choice-card:hover { border-color: var(--accent); background: var(--accent-wash); transform: translateY(-1px); }
.choice-icon { width: 42px; height: 42px; flex: none; border-radius: var(--r-2); display: grid; place-items: center; background: var(--accent-wash); color: var(--accent); }
.choice-icon svg { width: 21px; height: 21px; }
.choice-card:hover .choice-icon { background: var(--bg-surface); }
.choice-body { display: flex; flex-direction: column; min-width: 0; }
.choice-title { font-weight: 600; font-size: var(--text-md); color: var(--text-primary); }
.choice-desc { font-size: var(--text-sm); color: var(--text-secondary); margin-top: 2px; }

/* Reply Autopilot surface choices: equal cards keep the three content modes readable without changing the
   shared choice-card/data-chips patterns used elsewhere. */
.autopilot-surface-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-3); margin-block-start: var(--sp-2); }
.autopilot-surface-card { display: flex; align-items: flex-start; gap: var(--sp-3); min-width: 0; padding: var(--sp-4); color: inherit; background: var(--bg-surface-2); border: 1px solid var(--border-strong); border-radius: var(--r-2); cursor: pointer; transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease); }
.autopilot-surface-card > input { flex: none; margin-block-start: 4px; }
.autopilot-surface-card .choice-body { gap: var(--sp-1h); }
.autopilot-surface-card .choice-title { display: block; line-height: 1.25; letter-spacing: normal; text-transform: none; }
.autopilot-surface-card .choice-desc { display: block; margin: 0; line-height: 1.45; }
.autopilot-surface-badges { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1h); margin-block-start: var(--sp-1h); }
.autopilot-surface-badges .chip { flex: 0 0 auto; }
.autopilot-surface-card:hover { border-color: var(--accent); background: var(--accent-wash); }
.autopilot-surface-card:focus-within { border-color: var(--accent); box-shadow: var(--ring); }
.autopilot-surface-card:has(input:checked) { border-color: var(--accent); background: var(--accent-wash); box-shadow: var(--ring); }
.autopilot-readiness-alert { display: flex; align-items: flex-start; gap: var(--sp-2); margin-block-end: var(--sp-3); padding: var(--sp-3) var(--sp-4); color: var(--text-primary); background: var(--status-failed-wash); border: 1px solid var(--status-failed); border-inline-start-width: 4px; border-radius: var(--r-2); line-height: 1.45; }
.autopilot-readiness-alert strong { color: var(--status-failed); }
.autopilot-account-select { width: 100%; }
.autopilot-account-select-empty { display: none; }
.autopilot-form { min-width: 0; }
.autopilot-wizard { display: flex; flex-direction: column; gap: var(--sp-4); min-width: 0; }
.autopilot-validation-summary:empty { display: none; }
.autopilot-validation-modal .modal-card { max-width: 480px; }
.autopilot-validation-modal__head { display: flex; align-items: center; gap: var(--sp-3); margin-block-end: var(--sp-3); }
.autopilot-validation-modal__head .modal-title { margin: 0; }
.autopilot-validation-modal__messages { display: grid; gap: var(--sp-2); margin: 0; padding: 0; list-style: none; color: var(--text-primary); }
.autopilot-validation-modal__messages li { position: relative; padding: var(--sp-3); padding-inline-start: calc(var(--sp-3) + 12px); background: var(--status-failed-wash); border: 1px solid var(--status-failed); border-radius: var(--r-2); line-height: 1.45; overflow-wrap: anywhere; }
.autopilot-validation-modal__messages li::before { content: ''; position: absolute; inset-inline-start: var(--sp-3); inset-block-start: 1.05em; inline-size: 6px; block-size: 6px; background: var(--status-failed); border-radius: 50%; }

/* Reply Autopilot is a real four-stage workflow. The compact progress rail and persistent footer keep one
   decision in view at a time while preserving normal server-side form submission on the final stage. */
.autopilot-wizard-steps { display: flex; align-items: center; width: 100%; min-width: 0; padding: var(--sp-3) var(--sp-4); background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--r-3); box-shadow: var(--elev-1); }
.autopilot-wizard-step { display: inline-flex; align-items: center; gap: var(--sp-2); flex: none; min-width: 0; padding: var(--sp-1h) var(--sp-2); color: var(--text-secondary); background: transparent; border: 0; border-radius: var(--r-pill); font: inherit; font-size: var(--text-sm); cursor: pointer; }
.autopilot-wizard-step:disabled { cursor: default; opacity: .7; }
.autopilot-wizard-step__number { display: grid; place-items: center; inline-size: 28px; block-size: 28px; flex: none; color: var(--text-secondary); background: var(--bg-surface-2); border: 1px solid var(--border-strong); border-radius: 50%; font-family: var(--font-mono); font-size: var(--text-xs); font-weight: 700; }
.autopilot-wizard-step.is-active { color: var(--accent); font-weight: 700; }
.autopilot-wizard-step.is-active .autopilot-wizard-step__number { color: var(--text-on-accent); background: var(--accent); border-color: var(--accent); box-shadow: var(--ring); }
.autopilot-wizard-step.is-complete { color: var(--status-live); }
.autopilot-wizard-step.is-complete .autopilot-wizard-step__number { color: var(--text-on-accent); background: var(--status-live); border-color: var(--status-live); }
.autopilot-wizard-connector { flex: 1 1 72px; min-inline-size: 24px; block-size: 1px; margin-inline: var(--sp-2); background: var(--border-strong); }
.autopilot-wizard-step.is-complete + .autopilot-wizard-connector { background: var(--status-live); }

.autopilot-source-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--r-3); box-shadow: var(--elev-1); overflow: hidden; }
.autopilot-source-summary__item { display: flex; align-items: center; gap: var(--sp-3); min-width: 0; padding: var(--sp-3) var(--sp-4); border-inline-end: 1px solid var(--border-subtle); }
.autopilot-source-summary__item:last-child { border-inline-end: 0; }
.autopilot-source-summary__item > span:nth-child(2) { display: flex; flex: 1 1 auto; flex-direction: column; min-width: 0; }
.autopilot-source-summary__item small { color: var(--text-tertiary); font-size: var(--text-xs); }
.autopilot-source-summary__item strong { overflow: hidden; color: var(--text-primary); font-size: var(--text-sm); text-overflow: ellipsis; white-space: nowrap; }
.autopilot-source-summary__icon { display: grid; place-items: center; inline-size: 36px; block-size: 36px; flex: none; color: var(--accent); background: var(--accent-wash); border-radius: 50%; }
.autopilot-source-summary__icon svg { inline-size: 18px; block-size: 18px; }
.autopilot-icon-button { display: inline-grid; place-items: center; inline-size: 34px; block-size: 34px; flex: none; padding: 0; color: var(--text-secondary); background: transparent; border: 1px solid transparent; border-radius: var(--r-1); cursor: pointer; }
.autopilot-icon-button:hover { color: var(--accent); background: var(--accent-wash); border-color: var(--accent-border); }
.autopilot-icon-button:focus-visible { outline: none; box-shadow: var(--ring); }
.autopilot-icon-button svg { inline-size: 17px; block-size: 17px; }

.autopilot-wizard .autopilot-wizard-panel { margin: 0; min-width: 0; }
.autopilot-wizard-panel[hidden], .autopilot-source-summary[hidden] { display: none; }
.autopilot-source-fields { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-4); }
.autopilot-source-divider { block-size: 1px; margin-block: var(--sp-5); background: var(--border-subtle); }
.autopilot-account-heading { margin-block-end: var(--sp-3); }

/* Stage 2 mirrors the chosen master-detail reference: a fixed-height, internally scrolling list stays beside
   one spacious preview, so long Facebook content can never widen or lengthen the whole form uncontrollably. */
.autopilot-target-stage { padding: var(--sp-4); }
.autopilot-target-heading { margin-block-end: var(--sp-3); }
.autopilot-target-heading > div:nth-child(2) { min-width: 0; }
.autopilot-target-actions { display: flex; align-items: center; justify-content: flex-end; gap: var(--sp-2); flex: 1 1 auto; min-width: 240px; margin-inline-start: auto; }
.autopilot-target-actions .hint { max-width: 320px; text-align: end; }
.autopilot-direct-target { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; align-items: start; gap: var(--sp-4); padding: var(--sp-4); background: linear-gradient(135deg, var(--bg-surface), var(--accent-wash)); border: 1px solid var(--accent); border-radius: var(--r-3); box-shadow: var(--elev-1); }
.autopilot-direct-target[hidden] { display: none; }
.autopilot-direct-target__icon { display: grid; place-items: center; inline-size: 56px; block-size: 56px; color: var(--text-on-accent); background: var(--accent); border-radius: var(--r-2); }
.autopilot-direct-target__icon svg { inline-size: 26px; block-size: 26px; }
.autopilot-direct-target__body { display: flex; flex-direction: column; gap: var(--sp-1h); min-width: 0; }
.autopilot-direct-target__heading { display: flex; align-items: center; gap: var(--sp-2); }
.autopilot-direct-target__body > strong { color: var(--text-primary); font-size: var(--text-lg); }
.autopilot-direct-target__body > a { max-inline-size: 100%; overflow: hidden; color: var(--accent-ink); font-size: var(--text-sm); text-overflow: ellipsis; white-space: nowrap; }
.autopilot-direct-target__body > p { margin: 0; color: var(--text-secondary); font-size: var(--text-sm); }
.autopilot-direct-target__ids { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.autopilot-direct-target__ids > span { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-1h) var(--sp-2); background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--r-1); }
.autopilot-direct-target__ids small { color: var(--text-tertiary); }
.autopilot-direct-target__ids code { color: var(--text-primary); font-size: var(--text-sm); direction: ltr; }
.autopilot-target-toolbar { display: grid; grid-template-columns: minmax(220px, 1fr) 150px auto auto; align-items: center; gap: var(--sp-2); margin-block-end: var(--sp-3); padding: var(--sp-3); background: var(--bg-surface-2); border: 1px solid var(--border-subtle); border-radius: var(--r-2); }
.autopilot-target-search { position: relative; display: flex; align-items: center; min-width: 0; }
.autopilot-target-search > span { position: absolute; inset-inline-start: 12px; display: grid; place-items: center; color: var(--text-tertiary); pointer-events: none; }
.autopilot-target-search svg { inline-size: 17px; block-size: 17px; }
.autopilot-target-search input { inline-size: 100%; min-inline-size: 0; block-size: 40px; padding-inline: 38px 12px; color: var(--text-primary); background: var(--bg-surface); border: 1px solid var(--border-strong); border-radius: var(--r-2); font: inherit; }
.autopilot-target-search input:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.autopilot-target-toolbar .select, .autopilot-target-toolbar .btn { block-size: 40px; }
.autopilot-filter-toggle[aria-pressed="true"] { color: var(--accent); background: var(--accent-wash); border-color: var(--accent); }
.autopilot-eligible-count { justify-self: end; color: var(--text-secondary); font-size: var(--text-sm); white-space: nowrap; }
.autopilot-target-workspace { display: grid; grid-template-columns: minmax(340px, .92fr) minmax(0, 1.18fr); gap: var(--sp-3); min-width: 0; }
.autopilot-target-browser, .autopilot-target-preview { box-sizing: border-box; block-size: 620px; min-width: 0; background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--r-2); overflow: hidden; }
.autopilot-target-browser { display: flex; flex-direction: column; }
.autopilot-target-list[hidden] { display: none; }
.autopilot-target-list { display: flex; flex: 1 1 auto; flex-direction: column; gap: var(--sp-2); min-width: 0; min-block-size: 0; padding: var(--sp-2); overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; scrollbar-gutter: stable; scrollbar-color: var(--border-strong) transparent; scrollbar-width: thin; }
.autopilot-target-list::-webkit-scrollbar, .autopilot-preview-copy::-webkit-scrollbar { inline-size: 7px; }
.autopilot-target-list::-webkit-scrollbar-thumb, .autopilot-preview-copy::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: var(--r-pill); }
.autopilot-target-empty { display: grid; flex: 1 1 auto; place-items: center; align-content: center; gap: var(--sp-2); margin: 0; padding: var(--sp-6); border: 0; text-align: center; }
.autopilot-target-empty[hidden] { display: none; }
.autopilot-empty-icon { display: grid; place-items: center; inline-size: 52px; block-size: 52px; color: var(--accent); background: var(--accent-wash); border-radius: 50%; }
.autopilot-empty-icon svg { inline-size: 24px; block-size: 24px; }
.autopilot-load-more { display: flex; justify-content: center; flex: none; min-block-size: 44px; padding: var(--sp-1h) var(--sp-2); border-block-start: 1px solid var(--border-subtle); }
.autopilot-load-more:has(button[hidden]) { display: none; }

.autopilot-target-card { box-sizing: border-box; display: grid; grid-template-columns: 18px 82px minmax(0, 1fr); gap: var(--sp-3); flex: 0 0 118px; min-width: 0; block-size: 118px; padding: var(--sp-2h); color: inherit; background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--r-2); cursor: pointer; overflow: hidden; transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease); }
.autopilot-target-card[hidden] { display: none; }
.autopilot-target-card > input { inline-size: 17px; block-size: 17px; margin-block-start: 3px; accent-color: var(--accent); cursor: pointer; }
.autopilot-target-card__thumb { display: grid; place-items: center; inline-size: 82px; block-size: 82px; overflow: hidden; color: var(--accent); background: var(--accent-wash); border-radius: var(--r-2); }
.autopilot-target-card__thumb img { inline-size: 100%; block-size: 100%; object-fit: cover; }
.autopilot-target-card__thumb > span { display: grid; place-items: center; }
.autopilot-target-card__thumb svg { inline-size: 26px; block-size: 26px; }
.autopilot-target-card__content { display: flex; flex-direction: column; gap: 4px; min-width: 0; min-block-size: 0; }
.autopilot-target-card__meta, .autopilot-target-card__footer { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); min-width: 0; color: var(--text-tertiary); font-size: var(--text-xs); }
.autopilot-target-card__meta strong { overflow: hidden; color: var(--text-primary); text-overflow: ellipsis; white-space: nowrap; }
.autopilot-target-card__meta small { flex: none; white-space: nowrap; }
.autopilot-target-card__body { flex: 1 1 auto; min-width: 0; min-block-size: 0; max-block-size: 43px; overflow-y: auto; overflow-x: hidden; color: var(--text-primary); font-size: var(--text-sm); font-weight: 600; line-height: 1.45; text-align: start; white-space: normal; overflow-wrap: anywhere; scrollbar-width: thin; }
.autopilot-target-card__footer small, .autopilot-target-card__footer code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.autopilot-target-card__footer code { max-inline-size: 45%; color: var(--text-tertiary); font-size: var(--text-2xs); direction: ltr; }
.autopilot-target-card__reason { overflow: hidden; font-size: var(--text-2xs); text-overflow: ellipsis; white-space: nowrap; }
.autopilot-target-card:hover, .autopilot-target-card.is-active { border-color: var(--accent); background: var(--accent-wash); box-shadow: var(--elev-1); }
.autopilot-target-card:focus-within { border-color: var(--accent); box-shadow: var(--ring); }
.autopilot-target-card:has(input:checked) { border-color: var(--accent); background: var(--accent-wash); box-shadow: 0 0 0 1px var(--accent); }
.autopilot-target-card:has(input:disabled) { cursor: not-allowed; opacity: .68; background: var(--bg-surface-2); }

.autopilot-target-preview { display: flex; flex-direction: column; }
.autopilot-preview-empty { display: grid; flex: 1 1 auto; place-items: center; align-content: center; gap: var(--sp-2); padding: var(--sp-6); color: var(--text-secondary); text-align: center; }
.autopilot-preview-content { display: flex; flex: 1 1 auto; flex-direction: column; min-block-size: 0; }
.autopilot-preview-content[hidden] { display: none; }
.autopilot-preview-toolbar { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: var(--sp-2); min-block-size: 54px; padding: var(--sp-2) var(--sp-3); border-block-end: 1px solid var(--border-subtle); }
.autopilot-preview-toolbar > strong { justify-self: center; color: var(--text-secondary); font-family: var(--font-mono); font-size: var(--text-xs); }
.autopilot-selection-toggle { display: inline-flex; align-items: center; gap: var(--sp-2); margin-inline-start: var(--sp-2); color: var(--accent); font-size: var(--text-sm); font-weight: 600; cursor: pointer; }
.autopilot-selection-toggle input { position: absolute; inline-size: 1px; block-size: 1px; opacity: 0; }
.autopilot-switch { position: relative; inline-size: 38px; block-size: 22px; background: var(--border-strong); border-radius: var(--r-pill); transition: background var(--dur-fast) var(--ease); }
.autopilot-switch::after { content: ''; position: absolute; inset-block-start: 3px; inset-inline-start: 3px; inline-size: 16px; block-size: 16px; background: var(--bg-surface); border-radius: 50%; box-shadow: var(--elev-1); transition: transform var(--dur-fast) var(--ease); }
.autopilot-selection-toggle input:checked + .autopilot-switch { background: var(--accent); }
.autopilot-selection-toggle input:checked + .autopilot-switch::after { transform: translateX(16px); }
[dir="rtl"] .autopilot-selection-toggle input:checked + .autopilot-switch::after { transform: translateX(-16px); }
.autopilot-selection-toggle input:focus-visible + .autopilot-switch { box-shadow: var(--ring); }
.autopilot-selection-toggle:has(input:disabled) { cursor: not-allowed; opacity: .55; }
.autopilot-preview-author { display: flex; align-items: center; gap: var(--sp-3); min-width: 0; padding: var(--sp-3) var(--sp-4); }
.autopilot-preview-author > span:nth-child(2) { display: flex; flex: 1 1 auto; flex-direction: column; min-width: 0; }
.autopilot-preview-author strong, .autopilot-preview-author small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.autopilot-preview-author small { color: var(--text-tertiary); }
.autopilot-preview-avatar { display: grid; place-items: center; inline-size: 42px; block-size: 42px; flex: none; overflow: hidden; color: var(--text-on-accent); background: var(--accent); border-radius: 50%; font-weight: 700; }
.autopilot-preview-avatar img { inline-size: 100%; block-size: 100%; object-fit: cover; }
.autopilot-preview-media { display: grid; place-items: center; flex: 0 0 245px; min-block-size: 0; margin: 0 var(--sp-4); overflow: hidden; color: var(--accent); background: var(--accent-wash); border: 1px solid var(--border-subtle); border-radius: var(--r-2); }
.autopilot-preview-media img { inline-size: 100%; block-size: 100%; object-fit: contain; background: var(--bg-surface-3); }
.autopilot-preview-media svg { inline-size: 48px; block-size: 48px; }
.autopilot-preview-copy { flex: 1 1 auto; min-block-size: 64px; max-block-size: 112px; margin: var(--sp-3) var(--sp-4) 0; padding: var(--sp-3); overflow-y: auto; overflow-x: hidden; color: var(--text-primary); background: var(--bg-surface-2); border: 1px solid var(--border-subtle); border-radius: var(--r-2); font-size: var(--text-sm); line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; scrollbar-color: var(--border-strong) transparent; scrollbar-width: thin; }
.autopilot-preview-meta { display: flex; align-items: center; gap: var(--sp-2); min-width: 0; padding: var(--sp-2) var(--sp-4); }
.autopilot-preview-meta > span:first-child { display: flex; flex-direction: column; min-width: 0; }
.autopilot-preview-meta small { color: var(--text-tertiary); font-size: var(--text-xs); }
.autopilot-preview-meta code { overflow: hidden; color: var(--text-primary); font-size: var(--text-sm); text-overflow: ellipsis; white-space: nowrap; direction: ltr; }
.autopilot-preview-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0 var(--sp-4); border: 1px solid var(--border-subtle); border-radius: var(--r-2); }
.autopilot-preview-metrics > div { padding: var(--sp-2); border-inline-end: 1px solid var(--border-subtle); text-align: center; }
.autopilot-preview-metrics > div:last-child { border-inline-end: 0; }
.autopilot-preview-metrics dt { color: var(--text-tertiary); font-size: var(--text-xs); }
.autopilot-preview-metrics dd { margin: 2px 0 0; color: var(--text-primary); font-family: var(--font-mono); font-size: var(--text-lg); font-weight: 700; }
.autopilot-preview-badges { padding: var(--sp-3) var(--sp-4); }

.autopilot-selection-tray { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: var(--sp-3); margin-block-start: var(--sp-3); padding: var(--sp-2); background: var(--bg-surface-2); border: 1px solid var(--border-subtle); border-radius: var(--r-2); }
.autopilot-selection-tray__head { display: flex; align-items: center; gap: var(--sp-2); padding-inline: var(--sp-2); white-space: nowrap; }
.autopilot-selection-tray__items { display: flex; gap: var(--sp-2); min-width: 0; overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-width: thin; }
.autopilot-selected-target { display: grid; grid-template-columns: 52px minmax(120px, 1fr) 34px; align-items: center; gap: var(--sp-2); flex: 0 0 280px; min-width: 0; padding: 4px; background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--r-2); }
.autopilot-selected-target__thumb { display: grid; place-items: center; inline-size: 52px; block-size: 44px; overflow: hidden; color: var(--accent); background: var(--accent-wash); border-radius: var(--r-1); }
.autopilot-selected-target__thumb img { inline-size: 100%; block-size: 100%; object-fit: cover; }
.autopilot-selected-target__thumb svg { inline-size: 20px; block-size: 20px; }
.autopilot-selected-target__text { display: -webkit-box; min-width: 0; overflow: hidden; color: var(--text-primary); font-size: var(--text-xs); line-height: 1.35; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.autopilot-target-settings { display: grid; grid-template-columns: minmax(220px, .45fr) minmax(280px, 1fr); align-items: end; gap: var(--sp-4); margin-block-start: var(--sp-3); padding: var(--sp-3); background: var(--bg-surface-2); border: 1px solid var(--border-subtle); border-radius: var(--r-2); }
.autopilot-target-settings .field { margin: 0; }
.autopilot-backlog-choice { display: flex; align-items: flex-start; gap: var(--sp-3); min-height: 42px; padding: var(--sp-2); cursor: pointer; }
.autopilot-backlog-choice > input { inline-size: 18px; block-size: 18px; margin-block-start: 2px; accent-color: var(--accent); }
.autopilot-backlog-choice > span { display: flex; flex-direction: column; }
.autopilot-backlog-choice small { color: var(--text-secondary); }

.autopilot-review-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--sp-3); }
.autopilot-review-grid article { display: flex; flex-direction: column; min-width: 0; padding: var(--sp-3); background: var(--bg-surface-2); border: 1px solid var(--border-subtle); border-radius: var(--r-2); }
.autopilot-review-grid small { color: var(--text-tertiary); }
.autopilot-review-grid strong { margin-block-start: var(--sp-1); overflow: hidden; color: var(--text-primary); font-size: var(--text-sm); text-overflow: ellipsis; white-space: nowrap; }
.autopilot-advanced-safety { margin-block-start: var(--sp-4); padding: var(--sp-3); border: 1px solid var(--border-subtle); border-radius: var(--r-2); }
.autopilot-wizard-footer { position: sticky; bottom: var(--sp-2); z-index: var(--z-sticky); display: grid; grid-template-columns: auto 1fr auto; margin: 0; box-shadow: 0 -12px 30px -20px var(--shadow-color), var(--elev-1); }
.autopilot-wizard-footer .summary { justify-self: center; align-self: center; }

@media (max-width: 1180px) {
  .autopilot-target-toolbar { grid-template-columns: minmax(220px, 1fr) 140px auto; }
  .autopilot-eligible-count { grid-column: 1 / -1; justify-self: start; }
  .autopilot-target-workspace { grid-template-columns: minmax(300px, .85fr) minmax(0, 1.15fr); }
  .autopilot-review-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 920px) {
  .autopilot-wizard-step { flex: 1 1 0; justify-content: center; }
  .autopilot-wizard-step > span:last-child { display: none; }
  .autopilot-wizard-connector { flex-basis: 28px; min-inline-size: 12px; margin-inline: 0; }
  .autopilot-source-summary { grid-template-columns: 1fr; }
  .autopilot-source-summary__item { border-inline-end: 0; border-block-end: 1px solid var(--border-subtle); }
  .autopilot-source-summary__item:last-child { border-block-end: 0; }
  .autopilot-target-heading { align-items: flex-start; flex-wrap: wrap; }
  .autopilot-target-actions { flex-basis: 100%; justify-content: flex-start; margin-inline-start: 0; }
  .autopilot-target-actions .hint { text-align: start; }
  .autopilot-target-workspace { grid-template-columns: minmax(0, 1fr); }
  .autopilot-target-browser { block-size: 520px; }
  .autopilot-target-preview { block-size: auto; min-block-size: 620px; }
  .autopilot-selection-tray { grid-template-columns: minmax(0, 1fr); }
  .autopilot-review-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .autopilot-surface-grid { grid-template-columns: 1fr; }
  .autopilot-wizard-steps { padding-inline: var(--sp-2); }
  .autopilot-target-stage { padding: var(--sp-3); }
  .autopilot-target-toolbar { grid-template-columns: minmax(0, 1fr); }
  .autopilot-target-toolbar .select, .autopilot-target-toolbar .btn { inline-size: 100%; }
  .autopilot-direct-target { grid-template-columns: 44px minmax(0, 1fr); padding: var(--sp-3); }
  .autopilot-direct-target__icon { inline-size: 44px; block-size: 44px; }
  .autopilot-direct-target > .btn { grid-column: 1 / -1; inline-size: 100%; justify-content: center; }
  .autopilot-eligible-count { grid-column: auto; }
  .autopilot-target-card { grid-template-columns: 18px 64px minmax(0, 1fr); }
  .autopilot-target-card__thumb { inline-size: 64px; block-size: 72px; }
  .autopilot-preview-toolbar { grid-template-columns: auto 1fr auto; }
  .autopilot-selection-toggle { grid-column: 1 / -1; justify-self: end; }
  .autopilot-preview-author { flex-wrap: wrap; }
  .autopilot-preview-author .btn { inline-size: 100%; justify-content: center; }
  .autopilot-preview-media { flex-basis: 210px; margin-inline: var(--sp-3); }
  .autopilot-preview-copy, .autopilot-preview-metrics { margin-inline: var(--sp-3); }
  .autopilot-preview-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .autopilot-preview-metrics > div:nth-child(2) { border-inline-end: 0; }
  .autopilot-preview-metrics > div:nth-child(-n+2) { border-block-end: 1px solid var(--border-subtle); }
  .autopilot-target-settings, .autopilot-review-grid { grid-template-columns: minmax(0, 1fr); }
  .autopilot-wizard-footer { grid-template-columns: auto 1fr; }
  .autopilot-wizard-footer .summary { display: none; }
  .autopilot-wizard-footer .actions { justify-self: end; }
}

/* ── Command palette (Ctrl/Cmd+K) — top-sheet modal reusing the combo-row idiom ── */
.modal.cmdk { align-items: flex-start; padding-top: 12vh; }
.cmdk-card { max-width: 560px; padding: var(--sp-3); }
.cmdk-input-wrap { position: relative; display: flex; align-items: center; }
.cmdk-input-wrap .search-icon { position: absolute; inset-inline-start: 13px; width: 17px; height: 17px; color: var(--text-tertiary); pointer-events: none; }
.cmdk-input-wrap .input { padding-inline-start: 38px; padding-inline-end: 52px; height: 44px; }
.cmdk-kbd { position: absolute; inset-inline-end: 10px; }
kbd.cmdk-kbd, .cmdk-hint kbd { font-family: var(--font-mono); font-size: var(--text-2xs); color: var(--text-tertiary);
  background: var(--bg-surface-2); border: 1px solid var(--border-subtle); border-bottom-width: 2px; border-radius: var(--r-0); padding: 1px 5px; }
.cmdk-list { margin-block-start: var(--sp-2); max-height: 46vh; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.cmdk-group { font-size: var(--text-2xs); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--text-tertiary); padding: var(--sp-2) var(--sp-2h) var(--sp-1); }
.cmdk-item { display: flex; align-items: baseline; gap: var(--sp-2); padding: 9px var(--sp-2h); border-radius: var(--r-1);
  color: var(--text-primary); font-size: var(--text-base); text-decoration: none; }
.cmdk-item .cmdk-sub { margin-inline-start: auto; font-family: var(--font-mono); font-size: var(--text-xs); color: var(--text-tertiary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40%; direction: ltr; }
.cmdk-item[aria-selected="true"], .cmdk-item:hover { background: var(--accent-wash-strong); color: var(--text-primary); }
.cmdk-empty { padding: var(--sp-3); color: var(--text-secondary); font-size: var(--text-sm); text-align: center; }
/* topbar affordance — desktop shows label + shortcut, phones collapse to the icon */
.cmdk-hint { display: inline-flex; align-items: center; gap: var(--sp-2); height: 38px; padding: 0 var(--sp-3);
  background: var(--bg-surface-2); color: var(--text-secondary); border: 1px solid var(--border-strong); border-radius: var(--r-2);
  font-family: var(--font-body); font-size: var(--text-sm); cursor: pointer;
  transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease); }
.cmdk-hint:hover { color: var(--text-primary); border-color: var(--accent); }
.cmdk-hint svg { width: 16px; height: 16px; flex: none; }
@media (max-width: 860px) {
  .cmdk-hint span, .cmdk-hint kbd { display: none; }
  .cmdk-hint { width: 40px; padding: 0; justify-content: center; }
}

/* ── Topbar credit pill — the tenant's balance, linking to Billing (A3) ─────── */
.credit-pill { display: inline-flex; align-items: center; gap: var(--sp-2); height: 38px; padding: 0 var(--sp-3);
  background: var(--accent-wash); color: var(--accent-ink); border: 1px solid var(--accent-border);
  border-radius: var(--r-pill); font-size: var(--text-sm);
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease); }
.credit-pill:hover { background: var(--accent-wash-strong); border-color: var(--accent); }
.credit-pill svg { width: 16px; height: 16px; flex: none; }
.credit-pill-num { font-family: var(--font-mono); font-weight: 600; color: var(--text-primary); }
.credit-pill-label { color: var(--text-secondary); }
@media (max-width: 860px) { .credit-pill-label { display: none; } }
/* Credit balance inside the account dropdown — the phone stand-in for the topbar pill (which is hidden
   ≤640; see utilities.css). Reads as a highlighted balance row above the account links. Hidden ≥641 where
   the topbar pill already shows the balance. */
.user-menu-balance { display: flex; align-items: center; gap: var(--sp-2h); width: 100%; padding: 9px var(--sp-2h);
  margin-bottom: var(--sp-1); border-radius: var(--r-1); background: var(--accent-wash); color: var(--accent-ink);
  font-weight: 500; text-align: start; }
.user-menu-balance:hover { background: var(--accent-wash-strong); }
.user-menu-balance svg { width: 16px; height: 16px; flex: none; }
.user-menu-balance-label { color: var(--text-secondary); }
.user-menu-balance-num { margin-inline-start: auto; font-family: var(--font-mono); font-weight: 600; color: var(--text-primary); }
@media (min-width: 641px) { .user-menu-balance { display: none; } }

/* ── Toasts ────────────────────────────────────────────────────────────────── */
.toast-host { position: fixed; z-index: var(--z-toast); inset-block-end: var(--sp-5); inset-inline-end: var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-2); pointer-events: none; max-width: min(380px, calc(100vw - 2 * var(--sp-5))); }
.toast { pointer-events: auto; background: var(--bg-surface); color: var(--text-primary); border: 1px solid var(--border-strong); border-inline-start: 3px solid var(--accent); border-radius: var(--r-2); padding: var(--sp-3) var(--sp-4); font-size: var(--text-base); box-shadow: var(--elev-2); opacity: 0; transform: translateY(8px); transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease); }
.toast.is-in { opacity: 1; transform: translateY(0); }
.toast-ok { border-inline-start-color: var(--status-live); }
.toast-bad { border-inline-start-color: var(--status-failed); }
.toast-warn { border-inline-start-color: var(--status-warn); }

/* loading state for in-flight async buttons — label hides, a spinner takes its place.
   color:transparent kills currentColor, so the spinner border is set from explicit tokens per variant. */
.btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-loading::after {
  content: ""; position: absolute; top: 50%; inset-inline-start: 50%; width: 15px; height: 15px; margin: -8px 0 0 -8px;
  border-radius: 50%; border: 2px solid var(--text-primary); border-top-color: transparent;
  animation: spin .6s linear infinite;
}
/* filled buttons carry white text → white spinner; status buttons spin in their own colour */
.btn-primary.is-loading::after { border-color: var(--text-on-accent); border-top-color: transparent; }
.btn-live.is-loading::after    { border-color: var(--status-live); border-top-color: transparent; }
.btn-danger.is-loading::after  { border-color: var(--status-failed); border-top-color: transparent; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes orb-float {
  from { transform: translateY(0) scale(1); opacity: 0.7; }
  to   { transform: translateY(30px) scale(1.12); opacity: 1; }
}
@keyframes metric-shimmer {
  0%   { background-position: 0% 0%; }
  50%  { background-position: 100% 0%; }
  100% { background-position: 0% 0%; }
}

/* top page-load progress bar (vanilla, injected by app.js) — sits above all chrome */
#nprogress { position: fixed; inset-block-start: 0; inset-inline: 0; height: 2px; width: 0; opacity: 0;
  z-index: var(--z-toast); background: linear-gradient(to right, #023E8A, #087EFC, #61A8FF); box-shadow: 0 0 10px rgba(8,126,252,0.7);
  transition: width var(--dur-slow) var(--ease), opacity var(--dur) var(--ease); pointer-events: none; }
#nprogress.is-active { opacity: 1; }

/* multi-shot sending-speed slider (graduated, escalating danger) */
.sep { border: none; border-top: 1px solid var(--border-subtle); margin: var(--sp-4) 0; }
/* the native range stays the CONTROL (keyboard/AT intact); visually it slims to a thin neutral track so
   the graduated meter below carries the one colour story (audit: two stacked rails read as duplication) */
.speed-range { width: 100%; appearance: none; -webkit-appearance: none; height: 24px; background: transparent; cursor: pointer; }
.speed-range::-webkit-slider-runnable-track { height: 4px; border-radius: var(--r-pill); background: var(--border-strong); }
.speed-range::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 18px; height: 18px; margin-top: -7px;
  border-radius: 50%; background: var(--accent); border: 3px solid var(--bg-surface); box-shadow: var(--elev-1); }
.speed-range::-moz-range-track { height: 4px; border-radius: var(--r-pill); background: var(--border-strong); }
.speed-range::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); border: 3px solid var(--bg-surface); box-shadow: var(--elev-1); }
.speed-range:focus-visible { box-shadow: none; }
.speed-range:focus-visible::-webkit-slider-thumb { box-shadow: var(--ring); }
/* signal-meter visualization: 5 segments fill up to the level (coloured by danger); ticks label each */
.speed-meter { display: flex; gap: var(--sp-1h); margin-top: var(--sp-3); }
.speed-seg { flex: 1; height: 10px; border-radius: var(--r-pill); background: var(--bg-surface-2); transition: background var(--dur) var(--ease); }
.speed-ticks { display: flex; margin-top: var(--sp-2); }
.speed-tick { flex: 1; text-align: center; font-size: var(--text-2xs); color: var(--text-tertiary); transition: color var(--dur-fast) var(--ease); }
.speed-tick.is-active { color: var(--text-primary); font-weight: 600; }
.speed-readout { display: flex; align-items: center; gap: var(--sp-3); margin-top: var(--sp-4); }
.speed-par { font-family: var(--font-display); font-size: var(--text-lg); font-weight: 600; color: var(--text-primary); }
/* danger acknowledgement (levels 4–5) as a red callout */
.speed-ack { display: flex; align-items: center; gap: var(--sp-2h); margin-top: var(--sp-4); padding: var(--sp-3) var(--sp-4); border-radius: var(--r-2); background: var(--status-failed-wash); border: 1px solid var(--status-failed-border); cursor: pointer; }
.speed-ack input { accent-color: var(--status-failed); flex: none; }
.speed-ack-text { display: inline-flex; align-items: center; gap: var(--sp-2); color: var(--status-failed); font-size: var(--text-base); }
.speed-ack-text svg { width: 18px; height: 18px; flex: none; }
.speed-warn { margin-top: var(--sp-3); font-size: var(--text-sm); padding: var(--sp-2h) 12px; border-radius: var(--r-2); border: 1px solid var(--border-strong); background: var(--bg-surface-2); }
/* a strong danger callout for a per-guard anti-ban OVERRIDE (same-account parallelism) — always red */
.danger-warn { margin-top: var(--sp-3); font-size: var(--text-sm); padding: var(--sp-3) 12px; border-radius: var(--r-2); border: 1px solid var(--status-failed-border); background: var(--status-failed-wash); color: var(--status-failed); font-weight: 600; }
.danger-warn strong { color: var(--status-failed); }
.speed-lvl-1 .speed-seg.is-on { background: var(--status-live); } .speed-lvl-1 #speedChip { color: var(--status-live); border-color: var(--status-live-border); }
.speed-lvl-2 .speed-seg.is-on { background: var(--status-warn); } .speed-lvl-2 #speedChip { color: var(--status-warn); border-color: var(--status-warn-border); }
.speed-lvl-3 .speed-seg.is-on { background: var(--status-warn-strong); } .speed-lvl-3 #speedChip { color: var(--status-warn-strong); border-color: var(--status-warn-border); }
.speed-lvl-4 .speed-seg.is-on { background: var(--status-failed); } .speed-lvl-4 #speedChip { color: var(--status-failed); border-color: var(--status-failed-border); }
.speed-lvl-5 .speed-seg.is-on { background: var(--status-failed-strong); } .speed-lvl-5 #speedChip { color: var(--status-failed); border-color: var(--status-failed-border); }
.speed-lvl-2 .speed-warn { border-color: var(--status-warn-border); color: var(--status-warn); background: var(--status-warn-wash); }
.speed-lvl-3 .speed-warn { border-color: var(--status-warn-border); color: var(--status-warn-strong); background: var(--status-warn-wash); }
.speed-lvl-4 .speed-warn { border-color: var(--status-failed-border); color: var(--status-failed); background: var(--status-failed-wash); font-weight: 600; }
.speed-lvl-5 .speed-warn { border-color: var(--status-failed-border); color: var(--status-failed); background: var(--status-failed-wash); font-weight: 700; }
.speed-lvl-6 .speed-seg.is-on { background: var(--status-failed-strong); } .speed-lvl-6 #speedChip { color: var(--status-failed); border-color: var(--status-failed-border); }
.speed-lvl-6 .speed-warn { border-color: var(--status-failed-border); color: var(--status-failed); background: var(--status-failed-wash); font-weight: 700; }
/* Custom-level parallelism input (shown only at speed level 6) */
.speed-custom { margin-top: var(--sp-3); display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-2h); }
.speed-custom label { font-weight: 600; color: var(--text-primary); }
.speed-custom input { width: 6rem; }
.speed-custom .hint { flex-basis: 100%; }
/* a de-emphasised table row (e.g. a blocked audience contact) */
tr.is-muted { opacity: .55; }
/* a card that holds a full-bleed table */
.card.flush { padding: 0; overflow: hidden; }
.text-xs { font-size: var(--text-xs); }
.text-2xs { font-size: var(--text-2xs); }
.mt-1 { margin-block-start: var(--sp-1); }
.ml-2 { margin-inline-start: var(--sp-2); }
.inline { display: inline; }

/* ── Pricing catalog manager (I5): reorder arrows, duration-coverage strip, inline toggles ── */
/* the wrapper lets a wide catalog table scroll horizontally on small screens without breaking the page */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-catalog .col-rank { width: 1%; white-space: nowrap; }
.table-catalog .col-actions { width: 1%; white-space: nowrap; }
.rank-cell { display: flex; align-items: center; gap: var(--sp-2); }
.reorder { display: inline-flex; flex-direction: column; gap: 2px; }
.reorder form { display: flex; }
.reorder button { width: 24px; height: 17px; display: grid; place-items: center; padding: 0; cursor: pointer;
  border: 1px solid var(--border-strong); border-radius: var(--r-1); background: var(--bg-surface-2); color: var(--text-secondary);
  transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease); }
.reorder button:hover:not(:disabled) { color: var(--text-primary); border-color: var(--accent); }
.reorder button:disabled { opacity: .3; cursor: default; }
.reorder button svg { width: 13px; height: 13px; }
/* fixed 4-across so every plan's duration coverage lines up column-for-column (never 3+1 vs 4 by number length) */
.dur-strip { display: grid; grid-template-columns: repeat(4, minmax(48px, 1fr)); gap: var(--sp-1h); }
.dur-chip { display: flex; flex-direction: column; align-items: center; line-height: 1.25;
  padding: 3px var(--sp-2); border: 1px solid var(--border-subtle); border-radius: var(--r-1); background: var(--bg-surface-2); }
.dur-chip .dk { font-size: var(--text-2xs); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--text-tertiary); }
.dur-chip .dv { font-size: var(--text-sm); color: var(--text-primary); font-variant-numeric: tabular-nums; }
.dur-chip.is-unset { border-style: dashed; background: none; }
.dur-chip.is-unset .dv { color: var(--text-tertiary); }
/* small currency pill on a column header / price label (e.g. "Duration prices  USD") */
.cur-tag { display: inline-block; margin-inline-start: var(--sp-1h); padding: 1px 6px; border-radius: var(--r-1);
  background: var(--accent-wash); color: var(--accent); font-size: var(--text-2xs); font-weight: 600; letter-spacing: 0; text-transform: none; }
/* ── Billing overview hero + usage meter (J1) ── */
.billing-hero { display: flex; flex-direction: column; gap: var(--sp-4); }
.billing-hero-top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; }
.billing-plan-name { font-family: var(--font-display); font-size: var(--text-2xl); font-weight: 600; color: var(--text-primary); }
.billing-renewal { font-size: var(--text-sm); color: var(--text-secondary); margin-block-start: 2px; }
.billing-facts { display: flex; flex-wrap: wrap; gap: var(--sp-3) var(--sp-6); padding-block: var(--sp-3); border-block: 1px solid var(--border-subtle); }
.billing-fact { display: flex; flex-direction: column; gap: 2px; }
.billing-fact > .muted { font-size: var(--text-2xs); letter-spacing: var(--tracking-label); text-transform: uppercase; }
.billing-hero-cta { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.usage-meter { display: flex; flex-direction: column; gap: var(--sp-1h); margin-block-start: var(--sp-3); }
.usage-track { height: 8px; border-radius: var(--r-pill); background: var(--bg-surface-2); overflow: hidden; }
.usage-fill { height: 100%; border-radius: var(--r-pill); transition: width var(--dur) var(--ease); background: var(--status-live); }
.usage-fill.warn { background: var(--status-warn); }
.usage-fill.danger { background: var(--status-failed); }
.usage-cap { display: flex; justify-content: space-between; gap: var(--sp-2); font-size: var(--text-2xs); }
/* ── Proof-screenshot upload zone (J2): styled click/drop target + live preview ── */
.upload-zone { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--sp-2);
  min-height: 132px; padding: var(--sp-4); text-align: center; cursor: pointer;
  border: 1.5px dashed var(--border-strong); border-radius: var(--r-2); background: var(--bg-surface-2);
  transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease); }
.upload-zone:hover { border-color: var(--accent); background: var(--accent-wash); }
.upload-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.upload-cta { display: inline-flex; flex-direction: column; align-items: center; gap: var(--sp-1h); color: var(--text-secondary); font-size: var(--text-sm); max-width: 32ch; }
.upload-cta svg { width: 26px; height: 26px; color: var(--text-tertiary); }
.upload-preview { max-width: 100%; max-height: 260px; border-radius: var(--r-1); border: 1px solid var(--border-subtle); }
.upload-change { font-size: var(--text-xs); color: var(--accent); font-weight: 600; }
/* payment-proof thumbnail (J3) → opens a lightbox with the full screenshot */
.proof-thumb { display: block; padding: 0; border: 1px solid var(--border-strong); border-radius: var(--r-1); background: var(--bg-surface-2); cursor: pointer; overflow: hidden; line-height: 0;
  transition: border-color var(--dur-fast) var(--ease); }
.proof-thumb:hover { border-color: var(--accent); }
.proof-thumb img { width: 56px; height: 56px; object-fit: cover; display: block; }
.modal-card.proof-lightbox { max-width: min(92vw, 720px); }
.proof-lightbox img { display: block; width: 100%; max-height: 78vh; object-fit: contain; border-radius: var(--r-1); background: var(--bg-surface-2); }
/* Pages card — admin-health warning: which admin account needs re-login / is in checkpoint */
.page-admin-warn { display: flex; flex-direction: column; gap: var(--sp-1h); padding: var(--sp-2) var(--sp-2h);
  border-radius: var(--r-1); border: 1px solid var(--border-subtle); font-size: var(--text-xs); }
.page-admin-warn.warn { background: var(--status-warn-wash); border-color: var(--status-warn-border); color: var(--status-warn); }
.page-admin-warn.bad  { background: var(--status-failed-wash); border-color: var(--status-failed-border); color: var(--status-failed); }
.page-admin-warn-head { display: inline-flex; align-items: center; gap: var(--sp-1h); font-weight: 600; }
.page-admin-warn-head svg { width: 14px; height: 14px; flex: none; }
.page-admin-issues { display: flex; flex-wrap: wrap; gap: var(--sp-1h); }
.admin-issue-chip { display: inline-flex; align-items: center; gap: 5px; padding: 1px var(--sp-1h);
  border-radius: var(--r-1); background: var(--bg-surface); border: 1px solid currentColor; }
.admin-issue-name { font-weight: 600; color: var(--text-primary); max-width: 12ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-toggles { display: flex; flex-wrap: wrap; gap: var(--sp-1h); }
.status-toggles form { display: flex; }
.row-actions { display: inline-flex; gap: var(--sp-2); justify-content: flex-end; }

.cell-actions { text-align: end; white-space: nowrap; }
.stack.tight { gap: var(--sp-2); }
/* an inline form: a field + a button on one baseline (invite, create category) */
.form-inline { display: flex; align-items: flex-end; gap: var(--sp-3); }
.form-inline .field { margin: 0; flex: 1; }
.form-inline > .btn { flex: none; }
/* Jobs filter bar — wraps so its kind/status/target/date fields reflow on narrow widths */
.filter-bar { display: flex; flex-wrap: wrap; align-items: end; gap: var(--sp-3); margin-bottom: var(--sp-4); }
.filter-bar .field { margin: 0; }
.filter-bar .field.filter-search { flex: 1 1 240px; min-width: 0; }
.filter-bar .field.filter-status { flex: 0 1 200px; min-width: 160px; }
.filter-bar .filter-actions { display: flex; gap: var(--sp-2); align-items: end; }

/* ── Status filter chips (D1) — one-tap filter links carrying live counts ─────────────────────────────── */
.filter-chips { flex: 1 0 100%; display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-1); }
.filter-chip { display: inline-flex; align-items: center; gap: var(--sp-2); height: 30px; padding: 0 var(--sp-3);
  border: 1px solid var(--border-strong); border-radius: var(--r-pill); background: var(--bg-surface-2);
  color: var(--text-secondary); font-size: var(--text-sm); font-weight: 500;
  transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease); }
.filter-chip b { font-weight: 600; font-size: var(--text-xs); color: var(--text-tertiary); }
.filter-chip:hover { color: var(--text-primary); border-color: var(--accent-border); }
.filter-chip.is-active { color: var(--accent-ink); border-color: var(--accent-border); background: var(--accent-wash); }
.filter-chip.is-active b { color: var(--accent-ink); }

/* ── Bulk selection bar (D1) — select-all + count + the destructive action pinned inline-end ──────────── */
.bulk-bar { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); margin-bottom: var(--sp-4); }
.bulk-bar-actions { margin-inline-start: auto; display: flex; gap: var(--sp-2); }
.bulk-bar .select-all input, .data-card-head .acct-pick, .data-card-head .camp-pick { accent-color: var(--accent); }
.data-card-head .acct-pick, .data-card-head .camp-pick { flex: none; width: 17px; height: 17px; cursor: pointer; }
/* a main column + a fixed side column */
.split { display: grid; grid-template-columns: 1fr 280px; gap: var(--sp-4); align-items: start; margin-bottom: var(--sp-5); }
.list-item { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); background: var(--bg-surface-2); border: 1px solid var(--border-strong); border-radius: var(--r-2); padding: var(--sp-2h) var(--sp-3); }
@media (max-width: 720px) { .split { grid-template-columns: 1fr; } }

/* Elevation discipline (B1): resting panels are framed by the hairline border + ONE tight shadow
   (--elev-1); the bigger --elev-2/3 steps are reserved for things that float (popovers, sticky bars,
   hover lifts, modals) — never a colored bloom at rest. */
.card { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--r-3); padding: var(--sp-5); box-shadow: var(--elev-1); }
.card + .card { margin-top: var(--sp-5); }
/* the last element in a card defines the bottom gap via card padding alone — no trailing margin */
.card > :last-child { margin-bottom: 0; }
/* cards laid out side-by-side must not inherit the vertical-stack top margin */
.stat-grid > .card + .card,
.split > .card + .card,
.msg-grid > .card + .card,
.team-grid > .card + .card,
.uidchk-results > .card + .card { margin-top: 0; }
.card-title { font-family: var(--font-display); font-size: var(--text-lg); margin-bottom: var(--sp-2); }

label, .label { display: block; font-size: var(--text-sm); font-weight: 600; letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--text-secondary); margin-bottom: var(--sp-1h); }
/* the [hidden] attribute must win over display-setting classes (.row/.actions/.seg/.speed-ack use flex,
   which would otherwise override the UA [hidden]{display:none} and leak toggled-off blocks). */
[hidden] { display: none !important; }
.input, .select, textarea, input[type=text], input[type=email], input[type=password], input[type=date], input[type=datetime-local], input[type=time], input[type=number], input[type=search], select {
  width: 100%; background: var(--bg-surface-2); border: 1px solid var(--border-strong); color: var(--text-primary);
  border-radius: var(--r-2); padding: 11px 13px; font-family: var(--font-body); font-size: var(--text-base);
}
textarea, .input.mono, input.mono { font-family: var(--font-mono); }
/* native date/time controls: tabular figures + a tappable, theme-aware calendar button (not the 1990s default) */
input[type=date], input[type=datetime-local], input[type=time] { font-variant-numeric: tabular-nums; min-height: 44px; }
input[type=date]::-webkit-datetime-edit, input[type=datetime-local]::-webkit-datetime-edit, input[type=time]::-webkit-datetime-edit { color: var(--text-primary); padding: 0; }
input[type=date]::-webkit-datetime-edit-fields-wrapper, input[type=datetime-local]::-webkit-datetime-edit-fields-wrapper { padding: 0; }
input::-webkit-calendar-picker-indicator { cursor: pointer; padding: 3px; margin-inline-start: var(--sp-2); border-radius: var(--r-1); opacity: .65; transition: opacity var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease); }
input::-webkit-calendar-picker-indicator:hover { opacity: 1; background: var(--accent-wash); }
.input:focus, textarea:focus, select:focus, input:focus { border-color: var(--accent); box-shadow: var(--ring); outline: none; }
/* read-only identity fields (e.g. the account's immutable Facebook ID) keep the field look, visibly inert */
.input:disabled, input:disabled, select:disabled, textarea:disabled { opacity: .65; cursor: not-allowed; background: var(--bg-surface); }
::placeholder { color: var(--text-tertiary); }
/* invalid fields — jQuery-unobtrusive adds .input-validation-error to the control; signal it on the field
   itself (red border + ring), not just the message text below it */
.input-validation-error,
input.input-validation-error, textarea.input-validation-error, select.input-validation-error {
  border-color: var(--status-failed) !important; box-shadow: 0 0 0 3px var(--status-failed-wash);
}

/* styled native file input — the control reads like .input; its picker button reads like a small ghost
   button. Stays a real <input type=file> (keyboard + screen-reader intact); appearance only. */
.file-input { width: 100%; background: var(--bg-surface-2); border: 1px solid var(--border-strong); color: var(--text-secondary); border-radius: var(--r-2); padding: var(--sp-2) var(--sp-3); font-family: var(--font-body); font-size: var(--text-base); cursor: pointer; }
.file-input::file-selector-button { font-family: var(--font-body); font-weight: 600; font-size: var(--text-sm); cursor: pointer; margin-inline-end: var(--sp-3); padding: 6px var(--sp-3); border-radius: var(--r-1); border: 1px solid var(--border-strong); background: var(--bg-surface); color: var(--text-primary); }
.file-input::file-selector-button:hover { border-color: var(--accent); }
.file-input:focus-visible { border-color: var(--accent); box-shadow: var(--ring); outline: none; }
.field { margin-bottom: var(--sp-4); }
.hint { font-size: var(--text-sm); color: var(--text-tertiary); margin-top: var(--sp-1h); }

/* searchable combobox (scales to hundreds of options) */
.combo { position: relative; }
.combo-panel { position: absolute; z-index: var(--z-dropdown); inset-inline: 0; top: calc(100% + 4px); max-height: 280px; overflow-y: auto; background: var(--bg-surface-2); border: 1px solid var(--border-strong); border-radius: var(--r-2); box-shadow: var(--elev-2); padding: var(--sp-1); }
.combo-item { display: flex; align-items: baseline; gap: var(--sp-2); width: 100%; text-align: start; background: none; border: 0; color: var(--text-primary); padding: 8px var(--sp-2h); border-radius: var(--r-1); cursor: pointer; font-family: var(--font-body); font-size: var(--text-base); }
.combo-item:hover, .combo-item.active { background: var(--accent-wash-strong); }
.combo-name { font-weight: 500; }
.combo-aud { margin-inline-start: auto; padding-inline-start: var(--sp-3); font-family: var(--font-mono); font-size: var(--text-xs); color: var(--text-tertiary); white-space: nowrap; }
.combo-empty { padding: var(--sp-2h); color: var(--text-secondary); font-size: var(--text-sm); }

/* campaign admin picker (Part A — "send from which accounts"): a checkbox chip per admin account */
.admin-picker { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-2); }
.admin-chip { display: inline-flex; align-items: center; gap: var(--sp-2); padding: 6px 12px 6px 6px; border: 1px solid var(--border-strong); border-radius: 999px; cursor: pointer; user-select: none; background: var(--bg-surface-2); font-size: var(--text-sm); }
.admin-chip:hover { background: var(--accent-wash-strong); }
.admin-chip:has(input:checked) { border-color: var(--accent); background: var(--accent-wash-strong); }
.admin-chip input { accent-color: var(--accent); margin: 0; }
.admin-chip .acct-avatar { width: 26px; height: 26px; font-size: var(--text-xs); }
.admin-chip-name { font-weight: 500; }

/* a constrained single-column form card (e.g. the operator rename-customer form) */
.form-narrow { max-width: 520px; }
/* warn-toned hint text (e.g. "this account holds no token for this page") */
.warn-text { color: var(--status-warn); }
.row { display: flex; gap: var(--sp-4); flex-wrap: wrap; }
.row > * { flex: 1 1 0; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: var(--sp-4); }
.between { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); }

/* ── Table ─────────────────────────────────────────────────────────────── */
.table { width: 100%; border-collapse: collapse; font-size: var(--text-base); }
.table th { text-align: start; font-size: var(--text-2xs); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--text-secondary); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--border-subtle); }
.table td.num, .table th.num { text-align: end; font-variant-numeric: tabular-nums; }
.table td { padding: 13px 14px; border-bottom: 1px solid var(--border-subtle); color: var(--text-primary); }
.table tr:hover td { background: var(--bg-surface-2); }
.table .empty-row:hover td { background: none; }
.cell-detail { font-size: var(--text-xs); }
/* click-to-copy affordance (ids, proxies) */
.copy { cursor: pointer; border-radius: var(--r-0); }
.copy:hover { color: var(--text-primary); text-decoration: underline dotted; text-underline-offset: 2px; }

/* ── Data cards ─────────────────────────────────────────────────────────────
   Premium card grid that replaces the index tables (Pages first; the other four
   follow). Max 3 per row → 2 → 1. Tokens + logical properties only (RTL-safe). */
.data-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-5); }
@media (max-width: 1024px) { .data-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* minmax(0,1fr) — NOT bare 1fr (= minmax(auto,1fr)), whose min-content floor lets a card's widest
   unbreakable content blow the column past the viewport. Card min-width:0 (below) lets the card shrink
   so inner content wraps/clips instead. (Other ≤640 overrides are at file end — AFTER the base
   .data-card/.stat-grid rules — so source order lets them win.) */
@media (max-width: 640px) { .data-grid { grid-template-columns: minmax(0, 1fr); } }

.data-card { position: relative; min-width: 0; display: flex; flex-direction: column; gap: var(--sp-3);
  background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--r-3);
  padding: var(--sp-4) var(--sp-5);
  transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease); }
.data-card:hover { transform: translateY(-2px); border-color: rgba(8,126,252,0.30); box-shadow: var(--elev-2); }
/* selection — pure CSS, mirrors the .page-pick checkbox state (no JS) */
.data-card:has(.page-pick:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--elev-2); }

/* TOP: selection checkbox (inline-start) + status chip / kebab grouped inline-end */
.data-card-top { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); }
.data-card-top .page-pick { flex: none; width: 17px; height: 17px; cursor: pointer; }
.data-top-end { display: inline-flex; align-items: center; gap: var(--sp-2); }

/* HEAD: avatar + identity */
.data-card-head { display: flex; align-items: center; gap: var(--sp-3); }
.data-avatar { width: 48px; height: 48px; flex: none; border-radius: var(--r-pill); position: relative; overflow: hidden;
  background: var(--avatar-gradient); color: var(--text-on-accent);
  display: grid; place-items: center; font-family: var(--font-display); font-weight: 600; font-size: var(--text-xl);
  box-shadow: inset 0 0 0 1px var(--avatar-ring), 0 4px 14px -6px var(--accent); }
.data-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
/* H1 — Activity job avatar: the typed fallback icon sits under the (optional) target picture */
.job-avatar > svg { width: 22px; height: 22px; color: var(--text-on-accent); }
.data-card-id { flex: 1; min-width: 0; }
.data-title { display: block; font-family: var(--font-display); font-size: var(--text-lg); font-weight: 600; line-height: 1.25;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.data-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* STATS: a two-figure panel (audience | admins) with a dir-aware divider */
.data-stats { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--sp-2);
  background: var(--bg-surface-2); border: 1px solid var(--border-subtle); border-radius: var(--r-2); padding: var(--sp-3) var(--sp-2); }
.data-stats.single { grid-template-columns: 1fr; }
/* two figures + a status chip on one row — figures split the space, the status hugs its chip (end) */
.data-stats.with-status { grid-template-columns: 1fr 1fr auto; }
.data-stat { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; padding-inline: var(--sp-2); text-align: center; }
.data-stat + .data-stat { border-inline-start: 1px solid var(--border-subtle); }
/* per-card secondary stat — a step below the page's hero KPI (--text-3xl) so hierarchy reads right and
   large counts don't overflow the narrow stat cell */
.data-stat-num { font-family: var(--font-display); font-size: var(--text-2xl); font-weight: 600; color: var(--text-primary); line-height: 1.1; font-variant-numeric: tabular-nums; }
.data-stat-label { font-size: var(--text-2xs); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--text-secondary); }
.data-stat-link { text-decoration: none; transition: color var(--dur-fast) var(--ease); }
.data-stat-link:hover .data-stat-num, .data-stat-link:hover .data-stat-label { color: var(--accent-hover); }
/* a text-valued stat cell (proxy ip:port, etc.) sitting where the big number would — e.g. account cards */
.data-stat-text { max-width: 100%; font-size: var(--text-sm); font-weight: 600; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.data-stat-text.dim { color: var(--text-tertiary); font-weight: 500; }
/* vertically-centred stat cell — a lone status chip aligns with the figure beside it */
.data-stat.center { justify-content: center; }
/* a clickable status chip (opens the check-note modal); a tiny info glyph hints at it */
.chip.status-link { cursor: pointer; font-family: inherit; transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease); }
.chip.status-link:hover { border-color: currentColor; }
.status-info { width: 13px; height: 13px; flex: none; opacity: .7; }

/* FOOT META: inbox-fetch state (lighter chip) + subordinate UID — nowrap keeps uid on the same row */
.data-foot-meta { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); flex-wrap: nowrap; }
/* a row of chips that fill the width equally with centred content (campaign policy + message-type) */
.data-chips { display: flex; gap: var(--sp-2); }
.data-chips .chip { flex: 1 1 0; min-width: 0; justify-content: center; }
/* the inline-end cluster of a card-top: an id + a kebab */
.data-top-end { display: inline-flex; align-items: center; gap: var(--sp-2); }
.data-inbox { display: flex; align-items: center; gap: var(--sp-2); min-width: 0; overflow: hidden; flex: 1 1 0; }
.data-inbox .chip { font-size: var(--text-2xs); padding: 3px var(--sp-2); flex: none; }
.data-inbox .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.data-uid { font-size: var(--text-2xs); cursor: pointer; max-width: 46%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* FOOT: equal-width action bar; colour carries primary/secondary, layout makes it intentional */
.data-card-actions { display: flex; gap: var(--sp-2); margin-block-start: auto;
  border-block-start: 1px solid var(--border-subtle); padding-block-start: var(--sp-3); }
.data-card-actions > * { flex: 1 1 0; min-width: 0; }
.data-card-actions form { display: flex; min-width: 0; }
.data-card-actions .btn { width: 100%; min-width: 0; }
/* is-fill: footer buttons size to their content and share the leftover space, so a long label
   ("Sync pages") isn't cramped by an equal-width split. Forms become display:contents so their
   button is a direct flex item beside the plain links. */
.data-card-actions.is-fill form { display: contents; }
.data-card-actions.is-fill .btn { flex: 1 1 auto; width: auto; min-width: 0; }

/* a status-tinted note inside a card (checkpoint/check explanation) — colour mirrors the status chip */
.data-note { font-size: var(--text-xs); line-height: 1.4; padding: var(--sp-2h) var(--sp-3); border-radius: var(--r-2);
  border: 1px solid var(--border-subtle); background: var(--bg-surface-2); color: var(--text-secondary); }
.data-note.warn { background: var(--status-warn-wash); border-color: var(--status-warn-border); color: var(--status-warn); }
.data-note.bad { background: var(--status-failed-wash); border-color: var(--status-failed-border); color: var(--status-failed); }
.data-note.live, .data-note.ok { background: var(--status-live-wash); border-color: var(--status-live-border); color: var(--status-live); }
.data-note.cobalt { background: var(--accent-wash); border-color: var(--accent-border); color: var(--accent-ink); }
/* kebab (⋮) overflow menu pinned in a card-top corner — native <details>, dir-aware panel */
.kebab { position: relative; flex: none; }
.kebab > summary { list-style: none; cursor: pointer; width: 30px; height: 30px; display: grid; place-items: center; border-radius: var(--r-1); color: var(--text-secondary); }
.kebab > summary::-webkit-details-marker { display: none; }
.kebab > summary:hover, .kebab[open] > summary { background: var(--bg-surface-2); color: var(--text-primary); }
.kebab > summary svg { width: 18px; height: 18px; }
.kebab-menu { position: absolute; z-index: var(--z-dropdown); inset-inline-end: 0; top: calc(100% + 4px); min-width: 168px;
  background: var(--bg-surface); border: 1px solid var(--border-strong); border-radius: var(--r-2); box-shadow: var(--elev-2); padding: var(--sp-1); }
.kebab-item { display: flex; align-items: center; gap: var(--sp-2h); width: 100%; padding: 8px var(--sp-2h); border-radius: var(--r-1); background: none; border: 0; cursor: pointer; font-family: inherit; font-size: var(--text-base); text-align: start; color: var(--text-primary); text-decoration: none; white-space: nowrap; }
.kebab-item:hover { background: var(--accent-wash); }
.kebab-item svg { width: 16px; height: 16px; flex: none; }
.kebab-danger { color: var(--status-failed); }
.kebab-danger:hover { background: var(--status-failed-wash); }
/* labeled kebab trigger (bulk-bar "…all" menu): undo the fixed 30px icon square — the .btn classes on the
   summary style the rest; same dir-aware .kebab-menu panel */
.kebab-labeled > summary { width: auto; height: auto; display: inline-flex; }

/* remove-in-place (app.js data-async-mode="remove") — the element collapses + fades before removal */
.is-removing { overflow: hidden !important; opacity: 0; transform: scale(.97); height: 0 !important;
  padding-block: 0 !important; margin-block: 0 !important; border-block-width: 0 !important;
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease), height var(--dur-slow) var(--ease),
    padding var(--dur-slow) var(--ease), margin var(--dur-slow) var(--ease), border-width var(--dur-slow) var(--ease); }

/* empty state (rendered in place of the grid) */
.data-empty { display: flex; flex-direction: column; align-items: center; gap: var(--sp-3);
  padding: var(--sp-7) var(--sp-4); text-align: center; color: var(--text-secondary);
  background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--r-3); }
.data-empty > * { margin: 0; }
/* structured first-run empty: icon tile, title, one-line subtext, primary CTA. Plain-text empties
   (filtered "no match") still render fine as a single centered line — the slots are optional. */
.data-empty .empty-icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: var(--r-3);
  background: var(--accent-wash); color: var(--accent); }
.data-empty .empty-icon svg { width: 28px; height: 28px; }
.data-empty h3 { font-family: var(--font-display); font-size: var(--text-lg); color: var(--text-primary); }
.data-empty p { max-width: 42ch; }
.data-empty .btn { margin-top: var(--sp-2); }

/* inline select-all control in the toolbar / selection bar */
/* reset the global <label> styling — this is a checkbox label, not a form-field label. margin:0 is
   essential: the global label's margin-bottom would otherwise shift it up in the align-items:center row. */
.select-all { display: inline-flex; align-items: center; gap: var(--sp-2); margin: 0; font-size: var(--text-sm); font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--text-secondary); cursor: pointer; user-select: none; }

/* Pages search + selection toolbar — search row (icon inside the field) over a
   divided selection bar. Scoped classes so the shared .toolbar/.search-bar are untouched. */
/* margin-bottom restores the gap to the card grid below: the grid isn't a .card, so the
   global `.card + .card` spacing no longer applies (it did when the table was a .card.flush). */
.page-toolbar { display: flex; flex-direction: column; gap: var(--sp-3); margin-bottom: var(--sp-5); }
/* search card sits directly above the fetch card */
.ptb-search-card { margin-bottom: var(--sp-3); }
/* fetch card — collapsible, separated from the search card */
.ptb-fetch-card { margin-bottom: var(--sp-5); display: flex; flex-direction: column; gap: 0; }
.ptb-fetch-head { display: flex; align-items: center; gap: var(--sp-2); }
.ptb-fetch-head > svg { width: 16px; height: 16px; color: var(--text-secondary); flex-shrink: 0; }
.ptb-fetch-title { font-size: var(--text-sm); font-weight: 600; color: var(--text-primary); margin-inline-end: auto; }
.ptb-fetch-collapse { width: 26px; height: 26px; display: grid; place-items: center; flex-shrink: 0;
  background: none; border: none; border-radius: var(--r-1); cursor: pointer; color: var(--text-secondary);
  transition: background var(--dur-fast) var(--ease); }
.ptb-fetch-collapse:hover { background: var(--bg-surface-3); }
.ptb-fetch-collapse svg { width: 16px; height: 16px; transition: rotate var(--dur-fast) var(--ease); }
.ptb-fetch-collapse[aria-expanded="false"] svg { rotate: -90deg; }
#fetchBody { display: flex; flex-direction: column; gap: var(--sp-3); margin-top: var(--sp-3); }
/* wrap allowed: the E1 state-filter chips row (flex-basis 100%) takes its own line under the fields */
.ptb-search { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.ptb-search .search-field { flex: 1 1 0; min-width: 0; }
.search-field { position: relative; flex: 1; min-width: 0; display: flex; align-items: center; }
.search-field .search-icon { position: absolute; inset-inline-start: 13px; width: 17px; height: 17px; color: var(--text-tertiary); pointer-events: none; }
.search-field .input { padding-inline-start: 38px; }
/* selection bar — an inset action panel that becomes a contextual accent bar when anything is picked */
.ptb-select { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap;
  background: var(--bg-surface-2); border: 1px solid var(--border-subtle); border-radius: var(--r-2);
  padding: var(--sp-2h) var(--sp-3); transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease); }
.ptb-select .select-all input, .data-card-top .page-pick { accent-color: var(--accent); }
.ptb-actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; margin-inline-start: auto; }
/* inbox-fetch control bar — Pause all / Resume all / Stop all (contextual; only while fetches run/pause) */
.ptb-fetchctl-card { margin-bottom: var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-3); }
.ptb-fetchctl-counts { display: inline-flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.ptb-fetchctl-actions { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.ptb-fetchctl-actions form.inline { display: inline-flex; }
/* live count as a pill badge */
#pickCount { display: inline-flex; align-items: center; padding: 3px var(--sp-2h); border-radius: var(--r-pill);
  background: var(--bg-surface); border: 1px solid var(--border-strong); color: var(--text-secondary);
  font-size: var(--text-xs); font-weight: 600; font-variant-numeric: tabular-nums; transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease); }
/* selected → the whole bar + count light up accent (pure CSS; toolbar & grid share .content) */
.content:has(.page-pick:checked) .ptb-select { background: var(--accent-wash); border-color: var(--accent-border); }
.content:has(.page-pick:checked) #pickCount { background: var(--bg-surface); border-color: var(--accent-border); color: var(--accent); }
/* ── Account filter dropdown (in the search/filter bar) ─────────────────── */
.acct-filter { position: relative; flex: 0 0 auto; width: 220px; min-width: 0; margin-block: 0; }
.acct-filter-btn { display: flex; align-items: center; gap: var(--sp-2); width: 100%;
  padding: 11px 13px; background: var(--bg-surface-2); border: 1px solid var(--border-strong);
  border-radius: var(--r-2); color: var(--text-primary); font-family: var(--font-body); font-size: var(--text-base);
  cursor: pointer; text-align: start; transition: border-color var(--dur-fast) var(--ease); }
.acct-filter-btn:hover, .acct-filter-btn[aria-expanded="true"] { border-color: var(--accent); }
.acct-filter-display { flex: 1 1 0; min-width: 0; display: flex; align-items: center; gap: var(--sp-2); overflow: hidden; }
.acct-filter-display > svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--text-secondary); }
.acct-filter-name { font-size: var(--text-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acct-filter-av { position: relative; width: 22px; height: 22px; border-radius: var(--r-pill); flex-shrink: 0;
  background: var(--avatar-gradient); display: grid; place-items: center;
  font-size: 10px; font-weight: 700; color: #fff; overflow: hidden; }
.acct-filter-av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.acct-filter-caret { width: 16px; height: 16px; flex-shrink: 0; color: var(--text-tertiary);
  transition: rotate var(--dur-fast) var(--ease); }
.acct-filter-btn[aria-expanded="true"] .acct-filter-caret { rotate: 180deg; }
/* dropdown panel */
.acct-filter-panel { position: absolute; top: calc(100% + 4px); inset-inline-start: 0; z-index: 200;
  width: 300px; background: var(--bg-surface); border: 1px solid var(--border-strong);
  border-radius: var(--r-2); box-shadow: 0 8px 24px rgba(0,0,0,.18); overflow: hidden; }
.acct-filter-search { position: relative; padding: var(--sp-2); border-bottom: 1px solid var(--border-subtle); }
.acct-filter-search .search-icon { position: absolute; inset-inline-start: calc(var(--sp-2) + 13px); top: 50%; translate: 0 -50%; width: 15px; height: 15px; color: var(--text-tertiary); pointer-events: none; }
.acct-filter-search .input { padding-inline-start: 38px; height: 36px; font-size: var(--text-sm); }
.acct-filter-list { max-height: 260px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; padding: var(--sp-1); }
/* "All accounts" row — icon instead of letter avatar */
.acct-filter-av-all { background: var(--bg-surface-3); }
.acct-filter-av-all svg { width: 14px; height: 14px; color: var(--text-secondary); }

/* ── Account picker bar (fetch inbox by accounts) ───────────────────────── */
.ptb-acct { display: flex; flex-direction: column; gap: var(--sp-2h);
  background: var(--bg-surface-2); border: 1px solid var(--border-subtle); border-radius: var(--r-2);
  padding: var(--sp-2h) var(--sp-3); }
.ptb-acct-head { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.ptb-acct-head > svg { width: 16px; height: 16px; color: var(--text-secondary); flex-shrink: 0; }
.ptb-acct-title { font-size: var(--text-sm); font-weight: 600; color: var(--text-primary); }
.ptb-acct-count { margin-inline-end: auto; }
.ptb-acct-head .btn { flex-shrink: 0; }
/* collapse toggle */
.ptb-acct-collapse { width: 26px; height: 26px; display: grid; place-items: center; flex-shrink: 0;
  background: none; border: none; border-radius: var(--r-1); cursor: pointer; color: var(--text-secondary);
  transition: background var(--dur-fast) var(--ease); }
.ptb-acct-collapse:hover { background: var(--bg-surface-3); }
.ptb-acct-collapse svg { width: 16px; height: 16px; transition: rotate var(--dur-fast) var(--ease); }
.ptb-acct-collapse[aria-expanded="false"] svg { rotate: -90deg; }
/* collapsible body */
#acctBody { display: flex; flex-direction: column; gap: var(--sp-2h); }
/* search box */
.ptb-acct-search-wrap { position: relative; }
.ptb-acct-search-wrap .search-icon { position: absolute; inset-inline-start: 13px; top: 50%; translate: 0 -50%; width: 16px; height: 16px; color: var(--text-tertiary); pointer-events: none; }
.ptb-acct-search-wrap .input { padding-inline-start: 38px; }
/* scrollable row list */
.ptb-acct-list { display: flex; flex-direction: column; gap: 2px; max-height: 240px; overflow-y: auto;
  border: 1px solid var(--border-subtle); border-radius: var(--r-2); background: var(--bg-surface); }
/* ── shared account row (used in both the picker and the filter dropdown) ── */
.acct-row { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-2) var(--sp-3);
  background: none; border: none; border-radius: var(--r-1); text-align: start; cursor: pointer; width: 100%;
  transition: background var(--dur-fast) var(--ease); }
.acct-row:hover { background: var(--bg-surface-2); }
.acct-row[aria-selected="true"] { background: var(--accent-wash); }
.acct-row[aria-selected="true"]:hover { background: color-mix(in srgb, var(--accent-wash) 85%, var(--accent) 15%); }
/* avatar — gradient circle + real photo on top */
.acct-row-avatar { position: relative; width: 34px; height: 34px; border-radius: var(--r-pill); flex-shrink: 0;
  background: var(--avatar-gradient); display: grid; place-items: center;
  font-weight: 700; font-size: var(--text-sm); color: #fff; overflow: hidden; }
.acct-row-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
/* name + uid column */
.acct-row-body { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.acct-row-name { font-size: var(--text-sm); font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acct-row-uid { font-size: var(--text-xs); }
/* status chip + page count */
.acct-row-meta { display: flex; align-items: center; gap: var(--sp-2); flex-shrink: 0; }
.chip-xs { font-size: 10px; padding: 2px 7px; }
.acct-row-pages { font-size: var(--text-xs); color: var(--text-secondary); white-space: nowrap; }
/* check icon — hidden by default, visible when selected */
.acct-row-check { width: 18px; height: 18px; display: grid; place-items: center; flex-shrink: 0;
  color: var(--accent); opacity: 0; transition: opacity var(--dur-fast) var(--ease); }
.acct-row-check svg { width: 14px; height: 14px; }
.acct-row[aria-selected="true"] .acct-row-check { opacity: 1; }
/* light-up the picker bar header when any account is selected */
.ptb-acct:has(#acctList .acct-row[aria-selected="true"]) { border-color: var(--accent-border); }
.ptb-acct:has(#acctList .acct-row[aria-selected="true"]) #acctPickCount { color: var(--accent); font-weight: 600; }

/* ── Summary metrics ─────────────────────────────────────────────────────────
   The premium KPI row that sits above a .data-grid (icon-led number cards + a
   segmented status bar). Same surface/border/radius/hover as .data-card so the
   whole page reads as one design. Tokens + logical properties only. */
.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: var(--sp-4); margin-bottom: var(--sp-5); }
/* 1–2 KPI rows: don't stretch two lonely cards across the full row (Billing, admin balances) */
.metric-grid:has(> :last-child:nth-child(-n+2)) { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 380px)); }
/* metric-2up: opt back into an even full-width pair where the row should mirror a full-width grid below
   it (Messages) — beats the 380px cap above (extra class → higher specificity). Collapses to 1 col ≤560px. */
.metric-grid.metric-2up,
.metric-grid.metric-2up:has(> :last-child:nth-child(-n+2)) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
/* wide cards: align the big number under the top-left label (a proper KPI band, not a floating centred figure) */
.metric-grid.metric-2up .metric-value { text-align: start; }
@media (max-width: 560px) { .metric-grid.metric-2up { grid-template-columns: minmax(0, 1fr); } }
.metric-card { display: flex; flex-direction: column; gap: var(--sp-3); min-width: 0;
  background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--r-3); padding: var(--sp-4) var(--sp-5);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.metric-card:hover { border-color: var(--border-strong); box-shadow: var(--elev-2); }
/* a KPI card that IS a link (account detail → filtered Pages/Activity) — accent hover says "clickable" */
a.metric-card { text-decoration: none; color: inherit; }
a.metric-card:hover { border-color: var(--accent-border); }
.metric-head { display: flex; align-items: center; gap: var(--sp-2h); }
.metric-icon { width: 36px; height: 36px; flex: none; border-radius: var(--r-2); display: grid; place-items: center; background: var(--accent-wash); color: var(--accent); }
.metric-icon svg { width: 19px; height: 19px; }
.metric-icon.mint { background: var(--status-live-wash); color: var(--status-live); }
.metric-icon.warn { background: var(--status-warn-wash); color: var(--status-warn); }
.metric-label { font-size: var(--text-xs); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--text-secondary); font-weight: 600; }
.metric-value {
    font-family: var(--font-display);
    font-size: var(--text-3xl);
    font-weight: 600;
    line-height: 1;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    margin-block-start: auto;
    text-align: center;
}
.metric-value {
  background: var(--metric-gradient);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  /* one shimmer pass on load, then the gradient settles — perpetual motion on every KPI reads as noise */
  animation: metric-shimmer 2.8s var(--ease) 1;
}
.metric-value.mint { background: none; -webkit-text-fill-color: unset; color: var(--status-live); }
.metric-value.danger { background: none; -webkit-text-fill-color: unset; color: var(--status-failed); }
.metric-icon.danger { background: var(--status-failed-wash); color: var(--status-failed); }
.metric-icon.cobalt { background: var(--accent-wash); color: var(--accent); }

/* ── Sparkline — tiny inline-SVG trend under a KPI (see _Sparkline.cshtml); CSS-var themed, no library ── */
.sparkline { display: block; width: 100%; height: 28px; margin-block-start: var(--sp-2); }
.sparkline-line { fill: none; stroke: var(--accent); stroke-width: 1.6; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.sparkline-area { fill: var(--accent-wash); stroke: none; }

/* ── Campaign Details — hero count pair + compact strip (replaces five equal cards) + send-rate chart ── */
.dash-hero-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-4); margin-bottom: var(--sp-4); }
@media (max-width: 640px) { .dash-hero-grid { grid-template-columns: 1fr; } }
.metric-value-hero { font-size: var(--text-4xl); }
.stat-strip { display: flex; flex-wrap: wrap; gap: var(--sp-2h) var(--sp-6); align-items: center;
  background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--r-2);
  padding: var(--sp-2h) var(--sp-4); margin-bottom: var(--sp-5); }
.stat-strip-item { display: inline-flex; align-items: baseline; gap: var(--sp-2); font-size: var(--text-sm); color: var(--text-secondary); }
.stat-strip-item b { font-family: var(--font-display); font-size: var(--text-lg); font-weight: 600; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.rate-card { margin-bottom: var(--sp-5); }
.rate-chart { display: block; width: 100%; height: 88px; margin-block-start: var(--sp-2); }
.rate-meta { margin-block-start: var(--sp-2); }

/* ── Skeletons — shimmer placeholders for async panels (the reduced-motion kill-switch stops the sweep) ── */
.skel { position: relative; overflow: hidden; background: var(--bg-surface-2); border-radius: var(--r-1); }
.skel::after { content: ''; position: absolute; inset: 0; translate: -100% 0;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--text-primary) 8%, transparent), transparent);
  animation: skel-sweep 1.4s var(--ease) infinite; }
@keyframes skel-sweep { to { translate: 100% 0; } }
.skel-circle { border-radius: var(--r-pill); }
/* bell-panel loading rows */
.notif-skel-avatar { width: 32px; height: 32px; flex: none; }
.notif-skel-line { height: 10px; margin-block-start: 4px; width: 72%; }
.notif-skel-line + .notif-skel-line { width: 46%; }

/* a right-aligned group in a section head (e.g. a count + 'view all' on account Details) */
.edit-section-head .sec-head-end { margin-inline-start: auto; display: flex; align-items: center; gap: var(--sp-3); }
.sec-count { font-family: var(--font-mono); font-size: var(--text-sm); font-weight: 600; color: var(--text-secondary); background: var(--bg-surface-2); border: 1px solid var(--border-subtle); border-radius: var(--r-pill); padding: 2px var(--sp-3); }
/* a plain definition row (label ⟷ value) inside a detail section */
.def-row { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-4); padding-block: var(--sp-1h); }
.def-row + .def-row { border-block-start: 1px solid var(--border-subtle); }
.def-row > .muted { flex: none; }
.def-row > :last-child { text-align: end; min-width: 0; }

/* a field that shouldn't stretch full width (e.g. a small select like the message type) */
.field-sm { max-width: 280px; }

/* a highlighted {placeholder} token inside a message body / preview */
.token { background: var(--accent-wash-strong); color: var(--accent); border-radius: var(--r-0); padding: 0 4px; font-family: var(--font-mono); font-size: .9em; font-weight: 600; }
/* ── Message composer (add / edit) — fields + a miniature Messenger thread ── */
.composer { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--sp-5); align-items: start; }
.composer-fields { min-width: 0; }
.composer-preview { position: sticky; top: var(--sp-5); min-width: 0; }
.preview-label { font-size: var(--text-2xs); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--text-tertiary); margin-bottom: var(--sp-2h); }
.msgr { border: 1px solid var(--border-subtle); border-radius: var(--r-3); overflow: hidden; background: var(--bg-surface); box-shadow: var(--elev-1); }
.msgr-body { display: flex; flex-direction: column; gap: var(--sp-2); padding: var(--sp-4) var(--sp-3); min-height: 132px; }
.msgr-row { display: flex; align-items: flex-end; gap: var(--sp-2); }
.msgr-row .acct-avatar { width: 26px; height: 26px; font-size: var(--text-2xs); }
.msgr-bubble { max-width: 80%; background: var(--bg-surface-2); color: var(--text-primary); border-radius: 18px; border-end-start-radius: var(--r-0);
  padding: 8px 13px; font-size: var(--text-base); line-height: 1.45; white-space: pre-wrap; word-break: break-word; }
.msgr-bubble.is-empty { color: var(--text-tertiary); font-style: italic; }
.msgr-foot { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-2h) var(--sp-3); border-block-start: 1px solid var(--border-subtle); }
.msgr-input { flex: 1; background: var(--bg-surface-2); border-radius: var(--r-pill); padding: 7px var(--sp-3); color: var(--text-tertiary); font-size: var(--text-sm); }
.msgr-send { flex: none; color: var(--accent); display: grid; place-items: center; }
.msgr-send svg { width: 20px; height: 20px; }
[dir="rtl"] .msgr-send svg { transform: scaleX(-1); }
.msg-thread { max-width: 460px; }   /* constrain the standalone thread on the message view */

/* ── The single-message view: a focused two-column (chat preview + details) ── */
.msg-view { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: var(--sp-5); align-items: start; }
.msg-view-main { display: flex; flex-direction: column; gap: var(--sp-5); min-width: 0; }
@media (max-width: 920px) { .msg-view { grid-template-columns: 1fr; } }

/* a believable Messenger conversation frame */
.chat-frame { display: flex; flex-direction: column; border: 1px solid var(--border-subtle); border-radius: var(--r-3); overflow: hidden; background: var(--bg-surface); box-shadow: var(--elev-1); }
.chat-head { display: flex; align-items: center; gap: var(--sp-2h); padding: var(--sp-3) var(--sp-3h); border-block-end: 1px solid var(--border-subtle); }
.chat-head .acct-name { font-size: var(--text-base); line-height: 1.15; }
.chat-head-sub { font-size: var(--text-2xs); color: var(--status-live); }
.chat-head-actions { margin-inline-start: auto; display: flex; gap: var(--sp-3); color: var(--accent); }
.chat-head-actions svg { width: 19px; height: 19px; }
.chat-avatar { width: 30px; height: 30px; flex: none; }
.chat-avatar svg { width: 15px; height: 15px; }
.chat-conv { display: flex; flex-direction: column; justify-content: flex-end; gap: var(--sp-1h); padding: var(--sp-4) var(--sp-3h); background: var(--bg-app); min-height: 8rem; }
.chat-row { display: flex; align-items: flex-end; gap: var(--sp-2); }
.chat-bubble { width: fit-content; max-width: 80%; background: var(--bg-surface-2); border: 1px solid var(--border-subtle); border-radius: 18px; border-end-start-radius: var(--r-0);
  padding: 9px 14px; font-size: var(--text-base); line-height: 1.45; white-space: pre-wrap; word-break: break-word; color: var(--text-primary); }
.chat-meta { display: flex; align-items: center; gap: var(--sp-1h); margin-inline-start: 38px; font-size: var(--text-2xs); color: var(--text-tertiary); }
.chat-meta svg { width: 13px; height: 13px; color: var(--accent); }
.chat-foot { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-3h); border-block-start: 1px solid var(--border-subtle); color: var(--accent); }
.chat-foot svg { width: 21px; height: 21px; flex: none; }
.chat-input { flex: 1; background: var(--bg-surface-2); border-radius: var(--r-pill); padding: 8px var(--sp-3h); color: var(--text-tertiary); font-size: var(--text-sm); }
[dir="rtl"] .chat-send svg { transform: scaleX(-1); }
.msg-token-list { display: inline-flex; flex-wrap: wrap; gap: var(--sp-1h); justify-content: flex-end; }
@media (max-width: 860px) { .composer { grid-template-columns: 1fr; } .composer-preview { position: static; } }

/* ── Message-templates index: compact folder cards (F1) — the whole card is a hit-link to the category,
   a small count sub-line + a hover-lit "open" glyph replace the oversized single-stat block so the grid
   fits the viewport. The kebab rises above the hit-link so its menu stays clickable. ── */
.msg-cat-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.msg-cat-card { gap: 0; }
.msg-cat-hit { position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.msg-cat-card .data-card-head { position: relative; align-items: center; margin: 0; }
.msg-cat-card .kebab { position: relative; z-index: 2; }               /* clickable above the hit-link */
.data-avatar.folder { background: var(--accent-wash); color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent-border); }
.data-avatar.folder svg { width: 22px; height: 22px; }
.msg-cat-count { display: inline-flex; align-items: center; gap: var(--sp-1h); margin-top: 3px; }
.msg-cat-count svg { width: 13px; height: 13px; flex: none; }
.msg-cat-open { flex: none; display: grid; place-items: center; color: var(--text-tertiary);
  transition: color var(--dur-fast) var(--ease); }
.msg-cat-open svg { width: 18px; height: 18px; }
.msg-cat-card:hover .msg-cat-open { color: var(--accent); }

/* ── Saved-message cards (F2) — cards size to their CONTENT (no fixed height → no dead space under short
   messages); a very long message is capped and scrolls in place. A Messenger-style bubble hugs its text. ── */
/* MANDATORY uniform layout: cards in a row stretch to equal height (align-items:stretch), a flex body fills
   and vertically centres the content, and the foot is pinned to the bottom so footers align across the row. */
.msg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: var(--sp-4); align-items: stretch; }
.msg-card { display: flex; flex-direction: column; gap: var(--sp-3);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.msg-card:hover { border-color: var(--border-strong); box-shadow: var(--elev-2); }
.msg-card-top { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.msg-card-id { margin-inline-start: auto; font-size: var(--text-xs); }
/* the body fills the space between the header and the foot and centres its content; a long message caps and
   scrolls in place (min-height:0 lets the scroll child shrink) */
.msg-card-body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; justify-content: center; gap: var(--sp-3); }
.msg-card-scroll { min-height: 0; max-height: 13rem; overflow-y: auto; display: flex; flex-direction: column; }
.msg-bubble { align-self: start; width: fit-content; max-width: 100%; background: var(--bg-surface-2); color: var(--text-primary);
  border-radius: 18px; border-end-start-radius: var(--r-0); padding: 8px 13px; font-size: var(--text-base); line-height: 1.45; white-space: pre-wrap; word-break: break-word; }
.msg-card-foot { display: flex; gap: var(--sp-2); padding-block-start: var(--sp-3); border-block-start: 1px solid var(--border-subtle); }
.msg-card-foot > * { flex: 1; }
.msg-card-foot form { display: flex; }
.msg-card-foot .btn { width: 100%; }

/* ── F3 — dedicated media previews inside a message card (framed, aspect-aware, hover). The bytes stream
   through the tenant-scoped Media action; these elements only ever hold that id-based src. ── */
.msg-card.has-media .msg-media { display: block; border-radius: var(--r-2); overflow: hidden;
  border: 1px solid var(--border-subtle); background: var(--bg-surface-2); }
/* image — capped-height cover thumbnail (keeps media cards close in height to text cards), hover zoom + eye
   badge; the whole thumb opens full size */
.msg-media-image { position: relative; height: 150px; }
.msg-media-image img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform var(--dur) var(--ease); }
.msg-media-image:hover img { transform: scale(1.04); }
.msg-media-zoom { position: absolute; inset-block-start: var(--sp-2); inset-inline-end: var(--sp-2);
  width: 30px; height: 30px; display: grid; place-items: center; border-radius: var(--r-pill);
  background: rgba(0,0,0,.55); color: #fff; opacity: 0; transition: opacity var(--dur-fast) var(--ease); }
.msg-media-image:hover .msg-media-zoom { opacity: 1; }
.msg-media-zoom svg { width: 16px; height: 16px; }
/* video — fills the frame, height-capped */
.msg-media-video video { width: 100%; max-height: 200px; display: block; background: #000; }
/* audio — a compact strip: sound glyph + the native player */
.msg-media-audio { display: flex; align-items: center; gap: var(--sp-2h); padding: var(--sp-2h) var(--sp-3); }
.msg-media-audio-icon { width: 34px; height: 34px; flex: none; border-radius: var(--r-2); display: grid; place-items: center; background: var(--accent-wash); color: var(--accent); }
.msg-media-audio-icon svg { width: 18px; height: 18px; }
.msg-media-audio audio { flex: 1; min-width: 0; height: 34px; }
/* file — a document tile: extension-badged glyph + filename + a download affordance */
.msg-media-file { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3); text-decoration: none; color: inherit;
  transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease); }
.msg-media-file:hover { border-color: var(--accent-border); background: var(--accent-wash); }
.msg-file-ext { position: relative; width: 40px; height: 40px; flex: none; display: grid; place-items: center; color: var(--accent); }
.msg-file-ext svg { width: 34px; height: 34px; }
.msg-file-ext-label { position: absolute; inset-inline: 0; inset-block-end: 4px; text-align: center; font-size: 8px; font-weight: 700; letter-spacing: .02em; color: var(--accent); }
.msg-file-body { flex: 1; min-width: 0; }
.msg-file-name { display: block; font-size: var(--text-sm); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-file-dl { flex: none; color: var(--text-tertiary); display: grid; place-items: center; }
.msg-file-dl svg { width: 18px; height: 18px; }
.msg-media-file:hover .msg-file-dl { color: var(--accent); }

/* ── Team member cards ── */
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: var(--sp-4); }
.team-card { display: flex; flex-direction: column; gap: var(--sp-3); }
.team-card-head { display: flex; align-items: center; gap: var(--sp-3); min-width: 0; }
.team-card-head .acct-name { font-size: var(--text-md); }
.team-card-chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.team-card-foot { display: flex; gap: var(--sp-2); margin-block-start: auto; padding-block-start: var(--sp-3); border-block-start: 1px solid var(--border-subtle); }
.team-card-foot form { flex: 1; display: flex; }
.team-card-foot .btn { width: 100%; }

/* ── Page audience view ── */
.audience-id { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-4); }
.admin-wrap { display: flex; flex-wrap: wrap; gap: var(--sp-2h); }
.admin-pill { display: inline-flex; align-items: center; gap: var(--sp-2h); padding-block: 4px; padding-inline: 4px var(--sp-3); border: 1px solid var(--border-subtle); border-radius: var(--r-pill); background: var(--bg-surface-2); }
.admin-pill .mono { font-size: var(--text-sm); color: var(--text-secondary); }

/* even vertical rhythm between the account dashboard's stacked blocks; side-by-side cards size to content */
.detail-stack { display: flex; flex-direction: column; gap: var(--sp-5); }
.detail-stack > * { margin-block: 0; }
.detail-stack > .grid-2 { align-items: start; }

/* ── Campaign live dashboard (Details) ── */
.dash-hero { display: flex; flex-direction: column; gap: var(--sp-5); }
.dash-hero-top { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); flex-wrap: wrap; }
.dash-hero-status { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.acct-name-lg { font-size: var(--text-2xl); }
.dash-progress { display: flex; flex-direction: column; gap: var(--sp-3); }
.dash-progress-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3); }
.dash-sent { font-family: var(--font-mono); font-size: var(--text-md); color: var(--text-secondary); }
.dash-pct { font-family: var(--font-display); font-size: var(--text-3xl); font-weight: 600; line-height: 1; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.dash-controls { padding-block-start: var(--sp-4); border-block-start: 1px solid var(--border-subtle); flex-wrap: wrap; row-gap: var(--sp-3); }
.dash-section-label { font-size: var(--text-2xs); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--text-tertiary); margin: var(--sp-5) 0 var(--sp-3); }

/* segmented status bar + legend (proportional fill; tiny slices keep a min width) */
.seg-bar { display: flex; height: 10px; border-radius: var(--r-pill); overflow: hidden; background: var(--bg-surface-2); margin-block-start: auto; }
.seg { min-width: 4px; }
.seg.ok { background: var(--status-live); }
.seg.warn { background: var(--status-warn); }
.seg.idle { background: var(--status-idle); }
.seg-legend { display: flex; flex-wrap: wrap; gap: var(--sp-1h) var(--sp-3); }
.seg-leg { display: inline-flex; align-items: center; gap: var(--sp-1h); font-size: var(--text-xs); color: var(--text-secondary); }
.seg-leg b { color: var(--text-primary); font-variant-numeric: tabular-nums; }
.seg-dot { width: 8px; height: 8px; border-radius: var(--r-pill); flex: none; }
.seg-dot.ok { background: var(--status-live); }
.seg-dot.warn { background: var(--status-warn); }
.seg-dot.idle { background: var(--status-idle); }

/* RTL: identifiers & numbers stay LTR/Western (proxies, UIDs, tokens, stats must not bidi-reorder) */
[dir="rtl"] .mono,
[dir="rtl"] .stat,
[dir="rtl"] .num,
[dir="rtl"] .pulse-meta { direction: ltr; }
/* …but a stat number keeps sitting UNDER its (start-aligned) label in RTL: the direction:ltr above keeps the
   digits LTR, and this re-aligns the block to the inline-start side (right in RTL) so the number is directly
   beneath its title, not shifted to the left. LTR is unaffected. */
[dir="rtl"] .stat { text-align: right; }
/* same idea for a mono identifier cell in a table (e.g. the recipient FB id): direction:ltr keeps the
   digits Western, but without this the cell would left-align and sit on the wrong side of an RTL row. */
[dir="rtl"] td.mono { text-align: right; }

/* Bidi: text-bearing string content resolves its OWN base direction from content (the CSS form of
   dir="auto"). Fixes leading/trailing punctuation jumping to the wrong end on English (and mixed) strings
   inside an RTL layout, and future-proofs Arabic content in 2b. English resolves LTR ⇒ visually unchanged. */
.sub, .subtitle, .hint, .meta, .alert, .empty-row td, .cell-detail, .pager-info {
  unicode-bidi: plaintext;
}

/* ── Pagination ────────────────────────────────────────────────────────── */
.pager { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); margin-top: var(--sp-5); flex-wrap: wrap; }
.pager-info { font-size: var(--text-sm); color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.pager-controls { display: flex; align-items: center; gap: var(--sp-2); }
.pager-pages { display: flex; align-items: center; gap: var(--sp-1); }
/* numbered pages + chevron nav — square, token-driven, current page = accent */
.pager-num, .pager-btn { display: inline-flex; align-items: center; justify-content: center;
  min-width: 36px; height: 36px; padding: 0 var(--sp-2h); border-radius: var(--r-2);
  border: 1px solid var(--border-subtle); background: var(--bg-surface); color: var(--text-secondary);
  font-size: var(--text-sm); font-weight: 600; font-variant-numeric: tabular-nums; text-decoration: none;
  transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease); }
.pager-num:hover, .pager-btn:hover { border-color: var(--accent); color: var(--text-primary); }
.pager-num.is-current { background: var(--accent-solid); border-color: var(--accent-solid); color: var(--text-on-accent); }
.pager-btn.is-disabled { opacity: .4; pointer-events: none; }
.pager-btn svg { width: 16px; height: 16px; flex: none; }
[dir="rtl"] .pager-btn svg { transform: scaleX(-1); }   /* chevrons point the writing-direction way */
.pager-gap { padding: 0 var(--sp-1); color: var(--text-tertiary); }
.pager-page { display: none; font-size: var(--text-sm); color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.btn.is-disabled { opacity: .4; pointer-events: none; }

/* ── Chips / status ────────────────────────────────────────────────────── */
.chip { display: inline-flex; align-items: center; gap: var(--sp-1h); font-size: var(--text-xs); font-weight: 600; padding: 4px var(--sp-2h); border-radius: var(--r-pill); border: 1px solid var(--border-strong); color: var(--text-secondary); background: var(--bg-surface-2); }
.chip-dot { width: 7px; height: 7px; border-radius: var(--r-pill); background: currentColor; }
/* the live/running status chip animates its dot via chip context (one dot mechanism — no separate element).
   In a .chip.live, currentColor is --status-live, so the dot stays green; this only adds size + glow + pulse. */
.chip.live .chip-dot { width: 8px; height: 8px; box-shadow: 0 0 10px var(--status-live); animation: breathe 1.6s ease-in-out infinite; }
.chip.live { color: var(--status-live); border-color: var(--status-live-border); background: var(--status-live-wash); }
.chip.ok { color: var(--status-live); border-color: var(--status-live-border); background: var(--status-live-wash); }
.chip.warn { color: var(--status-warn); border-color: var(--status-warn-border); background: var(--status-warn-wash); }
.chip.bad { color: var(--status-failed); border-color: var(--status-failed-border); background: var(--status-failed-wash); }
.chip.cobalt { color: var(--accent-ink); border-color: var(--accent-border); background: var(--accent-wash); }
.chip.idle { color: var(--status-idle); border-color: var(--border-strong); background: var(--bg-surface-2); }
/* a neutral data chip (counts, type labels) — distinct from status/accent chips */
.chip.neutral { color: var(--text-secondary); border-color: var(--border-strong); background: var(--bg-surface-2); font-variant-numeric: tabular-nums; }
a.chip.chip-link:hover { border-color: var(--accent); color: var(--accent-hover); }

/* ── Pricing page: duration tabs (1/3/6/12mo) — a toggle-button group, not a nav; the swap is client-side,
   see app.js. Logical properties only, so RTL falls out for free (no [dir="rtl"] override needed). ────── */
.duration-tabs { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-block-end: var(--sp-5); }
.duration-tab { display: inline-flex; align-items: center; gap: var(--sp-1h); font: inherit; font-size: var(--text-sm);
  font-weight: 600; padding: var(--sp-2) var(--sp-4); border-radius: var(--r-pill); border: 1px solid var(--border-strong);
  background: var(--bg-surface-2); color: var(--text-secondary); cursor: pointer;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease); }
.duration-tab:hover { border-color: var(--accent-border); color: var(--text-primary); }
.duration-tab.is-active { background: var(--accent-wash-strong); border-color: var(--accent); color: var(--accent-ink); }
.duration-tab-badge { font-size: var(--text-2xs); font-weight: 700; letter-spacing: var(--tracking-label); text-transform: uppercase;
  padding: 1px 6px; border-radius: var(--r-pill); background: var(--accent); color: var(--text-on-accent); }

/* one stat voice — display face matches .metric-value so big numbers read as one system */
/* ── Pricing plan cards — dedicated tier cards (NOT the entity .data-card): price hero, fact bullets,
   full-size CTA. .is-featured = the best-value tier (accent ring + floating flag). Tokens + logical
   properties only; the duration-tab JS contract (data-price-*, .js-price, .js-duration-field) is unchanged. */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: var(--sp-5); align-items: stretch; padding-block-start: var(--sp-3); }
.plan-card { position: relative; display: flex; flex-direction: column; gap: var(--sp-2h); min-width: 0;
  background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--r-3);
  padding: var(--sp-6) var(--sp-5) var(--sp-5);
  transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease); }
.plan-card:hover { transform: translateY(-2px); border-color: rgba(8,126,252,0.30); box-shadow: var(--elev-2); }
.plan-card.is-featured { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 12px 34px -12px rgba(8,126,252,0.35), var(--elev-2); }
.plan-flag { position: absolute; inset-block-start: calc(-1 * var(--sp-3)); inset-inline-start: 50%; translate: -50% 0;
  display: inline-flex; align-items: center; gap: var(--sp-1h); padding: 3px var(--sp-3); border-radius: var(--r-pill);
  background: linear-gradient(135deg, #087EFC 0%, #0257CC 100%); color: var(--text-on-accent);
  font-size: var(--text-2xs); font-weight: 700; letter-spacing: var(--tracking-label); text-transform: uppercase; white-space: nowrap; }
[dir="rtl"] .plan-flag { translate: 50% 0; }   /* translate has no logical form — mirror the centring shift */
.plan-flag svg { width: 12px; height: 12px; flex: none; }
.plan-name { font-family: var(--font-display); font-size: var(--text-lg); font-weight: 600; color: var(--text-primary); }
.plan-price-num { font-family: var(--font-display); font-size: var(--text-4xl); font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums;
  background: var(--metric-gradient); background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.plan-price-cur { font-family: var(--font-display); font-size: var(--text-lg); font-weight: 600; color: var(--text-secondary); }
.plan-price-sub { font-size: var(--text-xs); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--text-secondary); font-weight: 600; }
.plan-points { list-style: none; margin: var(--sp-2) 0 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-2h); }
.plan-points li { display: flex; align-items: center; gap: var(--sp-2h); color: var(--text-secondary); font-size: var(--text-base); }
.plan-points svg { width: 16px; height: 16px; flex: none; color: var(--accent); }
.plan-points b { color: var(--text-primary); font-variant-numeric: tabular-nums; }
.plan-cta { margin-block-start: auto; padding-block-start: var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-2); }
.plan-cta form { display: contents; }
.plan-cta .btn { width: 100%; }

.stat { font-family: var(--font-display); font-size: var(--text-3xl); font-weight: 600; color: var(--text-primary); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat.mint { color: var(--status-live); }
.stat.danger { color: var(--status-failed); }
.stat-label { font-size: var(--text-xs); color: var(--text-secondary); text-transform: uppercase; letter-spacing: var(--tracking-label); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: var(--sp-4); margin-bottom: var(--sp-5); }
.stat-grid:last-child { margin-bottom: 0; }
/* compact insight cards — less dead space, a glance bar not big empty boxes */
.stat-grid > .card { padding: var(--sp-4) var(--sp-5); box-shadow: var(--elev-1), inset 0 2px 0 var(--accent); }
.stat-grid .stat { font-size: var(--text-3xl); line-height: 1.1; }
.stat-sub { font-size: var(--text-xs); color: var(--text-tertiary); margin-top: 3px; }
/* Grouped stat strip (campaign Details): "Counts" then "Performance" as two labelled, balanced grids
   instead of one ragged auto-fit run. The thin divider + quiet group label keep the split readable. */
.stat-group + .stat-group { margin-top: var(--sp-5); padding-top: var(--sp-5); border-top: 1px solid var(--border-subtle); }
.stat-group-label { font-size: var(--text-2xs); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--text-tertiary); margin-bottom: var(--sp-3); }
.stat-group .stat-grid { margin-bottom: 0; }
/* Reserve two label lines so 1- and 2-line labels share one baseline (numbers don't drift card-to-card). */
.stat-group .stat-label { display: block; min-height: 2.4em; line-height: 1.25; }

/* a small meta line (policy summary, etc.) */
.meta { font-size: var(--text-sm); color: var(--text-secondary); display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; }

/* advanced/override disclosure */
.advanced { border-color: var(--status-warn-border); }
.advanced > summary { cursor: pointer; font-family: var(--font-display); font-weight: 600; color: var(--status-warn); list-style: none; margin-bottom: var(--sp-2); }
.advanced > summary::-webkit-details-marker { display: none; }
.pulse-node.static { animation: none; }
.pulse-rail.preview .pulse-fill { width: 44%; }
.pulse-rail.preview .pulse-node { inset-inline-start: 44%; }

.alert { border-radius: var(--r-2); padding: var(--sp-4); font-size: var(--text-base); border: 1px solid var(--border-strong); background: var(--bg-surface-2); margin-bottom: var(--sp-5); }
.alert:last-child { margin-bottom: 0; }
.alert-info { border-color: var(--accent-border); background: var(--accent-wash); }
.alert-warn { border-color: var(--status-warn-border); background: var(--status-warn-wash); color: var(--status-warn); }
.alert-bad { border-color: var(--status-failed-border); background: var(--status-failed-wash); }
.alert-danger { border-color: var(--status-failed-border); background: var(--status-failed-wash); color: var(--status-failed); }
.alert .link-mono { display: block; margin-top: var(--sp-2); font-family: var(--font-mono); font-size: var(--text-xs); word-break: break-all; }

/* asp-validation-summary → an .alert.alert-bad box (every view sets class="alert alert-bad"); this only
   handles what the tag helper itself controls: hiding the empty/valid state and the error LIST inside it.
   A single error reads as one clean line (no lonely bullet); two-or-more get real list spacing so a
   multi-line summary doesn't look like a cramped browser-default list. */
.validation-summary-valid { display: none; }
.alert.validation-summary-errors ul { margin: 0; padding-inline-start: 1.2em; list-style: disc; }
.alert.validation-summary-errors li { margin: 0; }
.alert.validation-summary-errors li + li { margin-top: var(--sp-1); }
.alert.validation-summary-errors ul:has(li:only-child) { list-style: none; padding-inline-start: 0; }

/* empty-state row inside a table */
.empty-row td { padding: var(--sp-7) var(--sp-4); text-align: center; color: var(--text-secondary); }

/* a labelled section header above a card/block */
.section-title { font-family: var(--font-display); font-weight: 600; font-size: var(--text-md); margin-bottom: var(--sp-3); }

/* code/format sample block */
.code-block { background: var(--bg-surface-2); border: 1px solid var(--border-strong); border-radius: var(--r-2); padding: var(--sp-4); font-family: var(--font-mono); font-size: var(--text-xs); color: var(--text-secondary); overflow: auto; margin: 0; white-space: pre; }

/* a compact format cheat-sheet (e.g. the account-import aside) */
.fmt-group + .fmt-group { margin-block-start: var(--sp-4); }
.fmt-label { font-size: var(--text-2xs); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--text-tertiary); margin-block-end: var(--sp-2); }
.fmt-line { display: block; direction: ltr; font-family: var(--font-mono); font-size: var(--text-xs); color: var(--text-secondary); background: var(--bg-surface-2); border: 1px solid var(--border-subtle); border-radius: var(--r-1); padding: var(--sp-1h) var(--sp-2h); margin-block-end: var(--sp-1h); overflow-x: auto; white-space: nowrap; }

/* onboarding steps */
.steps { display: flex; flex-direction: column; gap: var(--sp-4); }
.step { display: flex; align-items: flex-start; gap: var(--sp-4); }
.step-num { flex: none; width: 40px; height: 40px; border-radius: var(--r-2); display: grid; place-items: center; font-family: var(--font-mono); font-size: var(--text-lg); background: var(--bg-surface-2); color: var(--text-secondary); }
.step.is-now .step-num { background: var(--accent); color: var(--text-on-accent); }
.step-body { flex: 1; min-width: 0; }
.step-title { font-family: var(--font-display); font-weight: 600; margin-bottom: 2px; }

/* a checkbox + label laid out inline (label.check overrides the stacked field defaults) */
.check { display: flex; align-items: center; gap: var(--sp-3); margin-block-end: 0; font-size: var(--text-base); font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--text-primary); }   /* reset only the label's bottom margin so mt-* utilities still apply on top */
.check input { width: auto; flex: none; }

/* selectable option cards — binary radio choices (audience target, when-to-run) */
.seg { display: flex; flex-wrap: wrap; gap: var(--sp-3); }
.seg .check { flex: 1 1 180px; padding: var(--sp-3) var(--sp-4); border: 1px solid var(--border-subtle); border-radius: var(--r-2); background: var(--bg-surface-2); cursor: pointer; transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease); }
.seg .check:hover { border-color: var(--border-strong); }
.seg .check:has(input:checked) { border-color: var(--accent); background: var(--accent-wash); }

/* the 2FA input follows the mode toggle, not a label — restore the normal field rhythm above it */
[data-twofa-input] { margin-top: var(--sp-3); }

/* one-time 6-digit code entry — OTP-style spacing so the six digits read as a code, not a number */
.input-code { letter-spacing: 0.4em; font-variant-numeric: tabular-nums; font-size: var(--text-lg); }
.input-code::placeholder { letter-spacing: 0.4em; }

/* a two-column field row with intentional widths (e.g. the add-message form) */
.field-grid { display: grid; gap: var(--sp-4); align-items: end; }
.field-grid.cols-3 { grid-template-columns: 180px 1fr 1fr; }
.field-grid.cols-2 { grid-template-columns: 180px 1fr; }
.field-grid .field { margin: 0; }

/* ── Campaign edit — premium form (sections + sticky live preview) ──────────── */
.edit-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--sp-5); align-items: start; }
@media (max-width: 1040px) { .edit-layout { grid-template-columns: 1fr; } }
.edit-main { display: flex; flex-direction: column; gap: var(--sp-5); min-width: 0; }

/* a form section card with an icon-led header */
.edit-section { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--r-3); padding: var(--sp-5) var(--sp-6); }
.edit-section-head { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-5); }
.edit-section-icon { width: 38px; height: 38px; flex: none; border-radius: var(--r-2); display: grid; place-items: center; background: var(--accent-wash); color: var(--accent); }
.edit-section-icon svg { width: 20px; height: 20px; }
.edit-section-icon.warn { background: var(--status-warn-wash); color: var(--status-warn); }
.edit-section-icon.danger { background: var(--status-failed-wash); color: var(--status-failed); }
.edit-section-title { font-family: var(--font-display); font-size: var(--text-lg); font-weight: 600; line-height: 1.2; }
.edit-section-desc { font-size: var(--text-sm); color: var(--text-secondary); margin-top: 2px; }

/* ── Two-factor setup (authenticator key + otpauth URI, recovery codes) ────── */
.setup-steps { margin: 0 0 var(--sp-5); padding-inline-start: var(--sp-5); color: var(--text-secondary); font-size: var(--text-base); }
.setup-steps li { margin-bottom: var(--sp-3); }
.key-block { margin-top: var(--sp-2h); padding: var(--sp-4); background: var(--bg-surface-2); border: 1px solid var(--border-strong); border-radius: var(--r-2); }
.tfa-qr { display: block; width: 200px; height: 200px; padding: var(--sp-2); background: #fff; border: 1px solid var(--border-strong); border-radius: var(--r-1); }
.key-value { display: block; font-size: var(--text-lg); letter-spacing: .12em; color: var(--text-primary); }
.key-uri { display: block; font-size: var(--text-xs); word-break: break-all; color: var(--text-secondary); margin-top: var(--sp-1h); }
.recovery-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-2) var(--sp-5); margin: var(--sp-4) 0 var(--sp-5); }
.recovery-grid code { font-family: var(--font-mono); font-size: var(--text-md); letter-spacing: .08em; color: var(--text-primary); }

/* sticky live-preview card (right rail) */
.edit-preview { position: sticky; top: var(--sp-5); }
@media (max-width: 1040px) { .edit-preview { position: static; } }
.preview-page { display: flex; align-items: center; gap: var(--sp-3); padding-block-end: var(--sp-4); margin-block-end: var(--sp-2); border-block-end: 1px solid var(--border-subtle); }
.preview-page .acct-text { min-width: 0; }
.preview-row { display: flex; flex-direction: column; gap: 3px; padding-block: var(--sp-3); }
.preview-row + .preview-row { border-block-start: 1px solid var(--border-subtle); }
.preview-label { font-size: var(--text-2xs); text-transform: uppercase; letter-spacing: var(--tracking-label); color: var(--text-secondary); font-weight: 600; }
.preview-val { font-size: var(--text-base); font-weight: 500; color: var(--text-primary); overflow-wrap: anywhere; }
.preview-val .chip-dot { display: inline-block; vertical-align: middle; margin-inline-end: var(--sp-1h); }

/* a real toggle switch (e.g. custom-pacing override) — resets the global <label> uppercase/tracking,
   which would otherwise shout the switch title AND its sentence-case hint in all-caps */
.switch { display: flex; align-items: center; gap: var(--sp-3); cursor: pointer; text-transform: none; letter-spacing: 0; font-size: var(--text-base); color: var(--text-primary); margin-bottom: 0; }
.switch > input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.switch-track { width: 42px; height: 24px; flex: none; border-radius: var(--r-pill); background: var(--border-strong); position: relative; transition: background var(--dur-fast) var(--ease); }
.switch-track::after { content: ''; position: absolute; inset-block-start: 3px; inset-inline-start: 3px; width: 18px; height: 18px; border-radius: var(--r-pill); background: var(--text-on-accent); box-shadow: var(--elev-1); transition: transform var(--dur-fast) var(--ease); }
.switch > input:checked + .switch-track { background: var(--accent); }
.switch > input:checked + .switch-track::after { transform: translateX(18px); }
[dir="rtl"] .switch > input:checked + .switch-track::after { transform: translateX(-18px); }
.switch > input:focus-visible + .switch-track { box-shadow: var(--ring); }
.switch-text { display: flex; flex-direction: column; gap: 2px; }
.switch-text strong { font-weight: 600; color: var(--text-primary); }

/* a disabled switch reads as inert, not merely off (Telegram column before the account is linked) */
.switch > input:disabled + .switch-track { opacity: .4; cursor: not-allowed; }

/* ── Notification-preferences matrix (C3): typed-icon rows × per-channel switch columns ──────────────── */
.pref-matrix { display: flex; flex-direction: column; }
.pref-row { display: grid; grid-template-columns: minmax(0, 1fr) 96px 96px; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-2); border-block-end: 1px solid var(--border-subtle); }
.pref-row:last-child { border-block-end: 0; }
.pref-head { padding-block: var(--sp-2); font-size: var(--text-xs); letter-spacing: var(--tracking-label);
  text-transform: uppercase; color: var(--text-tertiary); border-block-end: 1px solid var(--border-strong); }
.pref-head span { text-align: center; }
.pref-head span:first-child { text-align: start; }
.pref-event { display: flex; align-items: center; gap: var(--sp-3); min-width: 0; }
.pref-label { font-weight: 500; }
.pref-icon { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: var(--r-pill);
  background: var(--bg-surface-2); border: 1px solid var(--border-subtle); color: var(--text-secondary); flex: none; }
.pref-icon svg { width: 17px; height: 17px; }
.pref-switch { justify-self: center; }

/* a field group that's dimmed + inert until its toggle enables it */
.lockable { transition: opacity var(--dur-fast) var(--ease); }
.lockable.is-locked { opacity: .45; pointer-events: none; }

/* mono metric labels for the dashboard pulse preview */
.pulse-card .hint { margin-top: var(--sp-3); }

/* ── Settings — tunable safety limits (tile grid + overview rail) ───────────── */
/* the platform context switch in the page header (today: Facebook only) */
.platform-switch { display: inline-flex; align-items: center; gap: var(--sp-2h); }
.platform-switch-label { margin: 0; font-size: var(--text-2xs); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--text-tertiary); font-weight: 600; }
.platform-switch .select { width: auto; min-width: 168px; padding-block: 9px; }

/* each visible setting is a self-contained tile; related tiles flow in a responsive grid */
.set-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 272px), 1fr)); gap: var(--sp-4); }
.set-grid--compact { grid-template-columns: repeat(auto-fill, minmax(min(100%, 272px), 1fr)); }
.set-tile { display: flex; flex-direction: column; gap: var(--sp-2h); padding: var(--sp-4); border: 1px solid var(--border-subtle); border-radius: var(--r-2); background: var(--bg-surface-2); transition: border-color var(--dur-fast) var(--ease); }
.set-tile:hover { border-color: var(--border-strong); }
/* an overridden tile carries a subtle amber edge — it reads "deviates from the safe default" at a glance */
.set-tile.is-custom { border-color: var(--status-warn-border); }
.set-tile-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-2); }
.set-tile-head label { margin: 0; text-transform: none; letter-spacing: 0; font-size: var(--text-sm); font-weight: 600; color: var(--text-primary); }
.set-tile-head .chip { flex: none; }
.set-tile .input { font-variant-numeric: tabular-nums; }
.set-tile-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); flex-wrap: wrap; min-height: 28px; }
.set-range { font-size: var(--text-xs); color: var(--text-tertiary); }
.set-range-val { font-family: var(--font-mono); color: var(--text-secondary); margin-inline-start: var(--sp-1); }
.set-reset { height: 28px; padding: 0 var(--sp-2h); font-size: var(--text-xs); }
.set-reset svg { width: 14px; height: 14px; }

/* overview rail — customized-vs-default ratio + the "tunable, not disableable" note */
.settings-overview .seg-bar { margin-block-start: var(--sp-4); }
.settings-gauge { display: flex; align-items: baseline; gap: var(--sp-2h); flex-wrap: wrap; }
.settings-gauge-num { font-family: var(--font-display); font-size: var(--text-3xl); font-weight: 600; line-height: 1; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.settings-gauge-den { color: var(--text-tertiary); font-size: var(--text-xl); font-weight: 500; }
.settings-gauge-label { font-size: var(--text-sm); color: var(--text-secondary); }
.settings-note { display: flex; gap: var(--sp-3); align-items: flex-start; }
.settings-note-icon { flex: none; color: var(--accent); margin-top: 1px; }
.settings-note-icon svg { width: 22px; height: 22px; }
.settings-note .hint { margin: 0; }

/* ── Danger zone (operator tenant detail) — destructive ops live here, not in the page header ── */
.danger-zone { border-color: var(--status-failed-border); }
.danger-row { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); padding-block: var(--sp-3); }
.danger-row + .danger-row { border-block-start: 1px solid var(--border-subtle); }
.danger-row-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.danger-row .btn { flex: none; }

/* ── Overview (Dashboard) — attention strip + compact recent-activity rows ── */
.attn-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: var(--sp-3); margin-bottom: var(--sp-5); }
.attn-item { display: flex; align-items: center; gap: var(--sp-2h); font-size: var(--text-sm); font-weight: 500; text-decoration: none;
  transition: border-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease); }
.attn-item:hover { border-color: currentColor; transform: translateY(-1px); }
.attn-item svg { width: 18px; height: 18px; flex: none; }
.attn-item span { flex: 1 1 auto; min-width: 0; }
.dash-recent { justify-content: flex-start; }
.dash-recent .chip { flex: none; }
.dash-recent-type { font-weight: 600; color: var(--text-primary); }
.dash-recent-ref { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-recent > :last-child { margin-inline-start: auto; flex: none; }

/* ── Signature: Send Pulse ─────────────────────────────────────────────── */
.pulse { display: flex; align-items: center; gap: 12px; }
.pulse-rail { position: relative; flex: 1; height: 8px; border-radius: var(--r-pill); background: var(--border-strong); overflow: visible; }
.pulse-fill { position: absolute; inset-block: 0; inset-inline-start: 0; inset-inline-end: auto; height: 100%; border-radius: var(--r-pill); background: linear-gradient(90deg, var(--brand-navy), var(--accent)); }
.pulse-node { position: absolute; top: 50%; width: 12px; height: 12px; border-radius: var(--r-pill); background: var(--status-live); transform: translate(-50%,-50%); box-shadow: 0 0 0 4px var(--status-live-wash), 0 0 14px var(--status-live); animation: breathe 1.6s ease-in-out infinite; }
.pulse-meta { font-family: var(--font-mono); font-size: var(--text-sm); color: var(--text-secondary); white-space: nowrap; }
@keyframes breathe { 0%,100% { opacity: 1; } 50% { opacity: .45; } }

/* ── Auth — split shell: an always-dark navy brand panel + the theme-following form side ── */
.auth-split { display: grid; grid-template-columns: minmax(400px, 44%) 1fr; min-height: 100vh; }
.auth-brand-panel { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: center; gap: var(--sp-4);
  padding: var(--sp-8) var(--sp-7);
  background: linear-gradient(165deg, var(--brand-navy) 0%, #04122B 48%, #0B0C10 100%);
  color-scheme: dark;
  /* the panel is theme-invariant → pin the logo to its dark-variant colours */
  --logo-arrow: #087EFC; --logo-rocket: #FFFFFF; --logo-wordmark-strong: #FFFFFF; }
/* the sidebar's floating orb, scaled up for the panel */
.auth-brand-panel::before { content: ''; position: absolute; top: -140px; inset-inline-end: -120px; width: 440px; height: 440px; border-radius: 50%;
  background: radial-gradient(circle, rgba(8,126,252,0.30) 0%, rgba(2,62,138,0.12) 45%, transparent 70%);
  pointer-events: none; animation: orb-float 8s ease-in-out infinite alternate; }
.auth-brand-panel > * { position: relative; z-index: 1; }
.auth-brand-lockup { display: flex; align-items: center; gap: var(--sp-3); direction: ltr;
  font-family: var(--font-display); font-weight: 600; font-size: var(--text-3xl); letter-spacing: -.02em; color: #FFFFFF; }
[dir="rtl"] .auth-brand-lockup { justify-content: flex-end; }   /* LTR lockup hugs the inline-start (right) edge in RTL */
.auth-brand-lockup .brand-mark { width: 44px; height: 44px; filter: drop-shadow(0 0 8px rgba(8,126,252,0.55)); }
.auth-brand-lockup b { color: var(--logo-wordmark-strong); font-weight: 600; }
.auth-brand-tagline { margin: 0; color: rgba(236,237,239,0.85); font-size: var(--text-lg); line-height: 1.5; max-width: 44ch; text-wrap: balance; unicode-bidi: plaintext; }
.auth-brand-points { list-style: none; margin: var(--sp-2) 0 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-3); }
.auth-brand-points li { display: flex; align-items: center; gap: var(--sp-2h); color: rgba(236,237,239,0.72); font-size: var(--text-base); }
.auth-brand-points svg { width: 18px; height: 18px; flex: none; color: #61A8FF; }
.auth-form-side { position: relative; display: grid; place-items: center; padding: var(--sp-6) var(--sp-5); }
@media (max-width: 900px) {
  /* single column: the panel collapses to a centred brand strip above the form */
  .auth-split { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .auth-brand-panel { align-items: center; text-align: center; justify-content: center; gap: var(--sp-2h); padding: var(--sp-6) var(--sp-5); }
  .auth-brand-points { display: none; }
  .auth-brand-lockup { font-size: var(--text-2xl); }
  .auth-brand-lockup .brand-mark { width: 34px; height: 34px; }
  .auth-brand-tagline { font-size: var(--text-sm); }
}
.auth-card { width: 100%; max-width: 460px; background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--r-3); padding: var(--sp-7) var(--sp-6); box-shadow: var(--elev-2); }
.auth-title { font-size: var(--text-xl); text-align: center; margin: 0 0 var(--sp-2); }
.auth-tag { text-align: center; color: var(--text-secondary); margin-bottom: var(--sp-6); font-size: var(--text-base); text-wrap: balance; }
.auth-alt { text-align: center; font-size: var(--text-base); margin: 0; }
.label-row { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: var(--sp-1h); }
.label-row label { margin: 0; }
.link-xs { font-size: var(--text-xs); }
.text-danger, .field-validation-error { color: var(--status-failed); font-size: var(--text-sm); }

/* ── Mobile responsive overrides (≤640px) ───────────────────────────── */
@media (max-width: 640px) {

  /* metric cards: 2-col grid on mobile (220px min → 1 col on 342px content) */
  .metric-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 155px), 1fr)); }

  /* page-header actions: hide icons + tighten padding so labels stay short, and WRAP onto a second row
     when they don't all fit — never shrink a button below its label (that clipped "New campaign" → "campaig"). */
  .page-header .actions {
    width: 100%;
    flex-wrap: wrap;
  }
  .page-header .actions .btn svg { display: none; }
  .page-header .actions .btn { padding-inline: var(--sp-2h); flex-shrink: 0; }

  /* filter bar — SEARCH always gets its own full-width row; STATUS + button share the row below */
  .filter-bar .field.filter-search { flex: 1 0 100%; }
  .filter-bar .field.filter-status { flex: 1 1 auto; min-width: 0; }
  .filter-bar .field.filter-status .select { width: 100%; }

  /* Jobs date fields: each in its own full-width row */
  .filter-bar .filter-date { flex: 1 0 100%; }
  .filter-bar .filter-date .input { width: 100%; }

  /* Jobs stacked filter: apply button is also full-width (class added to <form> in Jobs view) */
  .filter-bar-stacked .filter-actions { flex: 1 0 100%; display: flex; gap: var(--sp-2); }
  .filter-bar-stacked .filter-actions .btn { flex: 1; justify-content: center; }

  /* Team invite: stack email input + button vertically, both full-width */
  .form-inline { flex-direction: column; align-items: stretch; }
  .form-inline .field { flex: none; }
  .form-inline > .btn { width: 100%; justify-content: center; }

}


/* ── Support contact (audit G1) — inline channel links + the auth-page footer ─────────────── */
.support-links { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4); margin-top: var(--sp-2); }
.support-link { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-sm);
  color: var(--accent); text-decoration: none; }
.support-link:hover { text-decoration: underline; }
.support-link svg { width: 16px; height: 16px; flex: none; }

.auth-footer { margin-top: var(--sp-5); text-align: center; }
.auth-footer .support-links { justify-content: center; }
.auth-legal { margin-top: var(--sp-3); font-size: var(--text-xs); color: var(--text-tertiary); }
.auth-legal a { color: var(--text-tertiary); text-decoration: underline; }
.auth-legal a:hover { color: var(--accent); }

/* Legal documents (terms/privacy) — readable measure inside the auth card */
.legal-doc { text-align: start; }
.legal-doc h2 { font-size: var(--text-md); margin: var(--sp-4) 0 var(--sp-1); }
.legal-doc p { color: var(--text-secondary); font-size: var(--text-sm); line-height: 1.6; }

/* ── Announcements (W11) — the dismissible banner strip above page content ────────────────── */
.announce-banner { display: flex; align-items: flex-start; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4);
  margin-bottom: var(--sp-3); border-radius: 10px; border: 1px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent); }
.announce-text { flex: 1; font-size: var(--text-sm); line-height: 1.5; }
.announce-dismiss { flex: none; background: none; border: none; cursor: pointer; color: inherit;
  opacity: .65; padding: 2px; }
.announce-dismiss:hover { opacity: 1; }
.announce-dismiss svg { width: 16px; height: 16px; display: block; }

/* ── What's new (W12) — topbar sparkle + unseen dot ────────────────────────────────────────── */
.whatsnew-link { position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 10px; color: inherit; }
.whatsnew-link:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.whatsnew-link svg { width: 18px; height: 18px; }
.whatsnew-dot { position: absolute; top: 7px; inset-inline-end: 7px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--accent); }

/* ── Impersonation strip (W13) — unmissable while the operator acts as a workspace ─────────── */
.impersonation-banner { display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-4); background: #B45309; color: #fff;
  font-size: var(--text-sm); font-weight: 600; }
.impersonation-banner svg { width: 16px; height: 16px; flex: none; }
.impersonation-banner span { flex: 1; }
.impersonation-return { background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.45);
  color: #fff; }
.impersonation-return:hover { background: rgba(255,255,255,.28); }

/* ── Proxy-provider recommendation (Proxy6.net affiliate) — operator-toggled card on the login pages ── */
.p6-reco { background: var(--bg-surface); border: 1px solid var(--accent-border); border-radius: var(--r-3);
  padding: var(--sp-5); box-shadow: var(--elev-1);
  background-image: linear-gradient(180deg, var(--accent-wash) 0%, transparent 64px); }
.edit-main .p6-reco { margin-top: var(--sp-5); }        /* single-Add page: sit below the proxy section */
.edit-preview .p6-reco { margin-top: var(--sp-4); }     /* bulk-Import aside: below the formats card */
.p6-reco-top { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  margin-bottom: var(--sp-3); }
.p6-wordmark { font-family: var(--font-display); font-weight: 800; letter-spacing: -.01em;
  font-size: var(--text-lg); color: var(--text-primary); }
.p6-wordmark .p6-6 { color: #FF6A00; }                  /* Proxy6 brand orange — the only fixed hue (theme-safe) */
.p6-reco-badge { font-size: var(--text-2xs); font-weight: 600; text-transform: uppercase;
  letter-spacing: var(--tracking-label); color: var(--accent-ink);
  background: var(--accent-wash-strong); border-radius: var(--r-pill); padding: 3px var(--sp-2); white-space: nowrap; }
.p6-reco-title { font-weight: 600; color: var(--text-primary); font-size: var(--text-md); margin-bottom: 3px; }
.p6-reco-body { font-size: var(--text-sm); color: var(--text-secondary); margin: 0 0 var(--sp-4); line-height: 1.5; }
.p6-coupon { display: flex; align-items: center; gap: var(--sp-2h); flex-wrap: wrap;
  margin: 0 0 var(--sp-4); }
.p6-coupon-lead { font-size: var(--text-sm); color: var(--text-secondary); }
.p6-code { display: inline-flex; align-items: center; gap: var(--sp-2); cursor: pointer;
  font-family: var(--font-mono); font-weight: 700; font-size: var(--text-sm); letter-spacing: .04em;
  color: var(--accent-ink); background: var(--accent-wash); border: 1px dashed var(--accent-border);
  border-radius: var(--r-1); padding: 4px var(--sp-2h); transition: background .15s, border-color .15s; }
.p6-code:hover { background: var(--accent-wash-strong); }
.p6-code svg { width: 14px; height: 14px; flex: none; opacity: .8; }
.p6-code.is-copied { color: var(--text-on-accent); background: var(--accent-solid); border-style: solid; border-color: var(--accent-solid); }
.p6-code .p6-code-text { direction: ltr; }        /* the code is a Latin literal — keep it LTR in RTL */
.p6-reco-cta { width: 100%; justify-content: center; gap: var(--sp-2); }
.p6-reco-cta svg { width: 15px; height: 15px; flex: none; }
[dir="rtl"] .p6-wordmark { direction: ltr; }            /* the wordmark is a Latin brand mark — keep it LTR in RTL */
[dir="rtl"] .p6-reco-cta svg { transform: scaleX(-1); }

.autopilot-identity-choice { margin: 0 0 var(--sp-4); padding: var(--sp-3); border: 1px solid var(--border-subtle); border-radius: var(--r-2); }
.autopilot-identity-choice legend { padding-inline: var(--sp-1); color: var(--text-secondary); font-size: var(--text-xs); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.autopilot-choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--sp-3); margin-block-start: var(--sp-2); }
.autopilot-choice-card { display: flex; align-items: flex-start; gap: var(--sp-3); min-width: 0; min-height: 64px; padding: var(--sp-3); color: inherit; background: var(--bg-surface-2); border: 1px solid var(--border-strong); border-radius: var(--r-2); cursor: pointer; }
.autopilot-choice-card:hover, .autopilot-choice-card:focus-within, .autopilot-choice-card:has(input:checked) { border-color: var(--accent); background: var(--accent-wash); box-shadow: var(--ring); }
.autopilot-choice-card > input { flex: none; inline-size: 18px; block-size: 18px; margin-block-start: 3px; accent-color: var(--accent); }
.autopilot-choice-card .choice-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.autopilot-choice-card .choice-desc { color: var(--text-secondary); font-size: var(--text-sm); line-height: 1.45; }
.autopilot-review-callout { display: flex; align-items: flex-start; gap: var(--sp-3); margin-block-start: var(--sp-4); padding: var(--sp-3); background: var(--accent-wash); border: 1px solid var(--accent-border); border-radius: var(--r-2); }
.autopilot-video-overlay { display: grid; place-items: center; inline-size: 34px; block-size: 34px; color: var(--text-on-accent); background: rgb(0 0 0 / .72); border-radius: 50%; font-size: var(--text-sm); }
.autopilot-target-card__thumb, .autopilot-preview-media { position: relative; }
.autopilot-target-card__thumb .autopilot-video-overlay, .autopilot-preview-media .autopilot-video-overlay { position: absolute; inset: 50% auto auto 50%; transform: translate(-50%, -50%); }
@media (max-width: 640px) { .autopilot-choice-grid { grid-template-columns: minmax(0, 1fr); } .autopilot-review-callout { flex-direction: column; } }
.autopilot-identity-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--sp-3); }
.autopilot-identity-card { display: flex; align-items: center; gap: var(--sp-3); min-height: 64px; padding: var(--sp-3); border: 1px solid var(--border-strong); border-radius: var(--r-2); background: var(--bg-surface-2); cursor: pointer; }
.autopilot-identity-card:hover, .autopilot-identity-card:focus-within, .autopilot-identity-card:has(input:checked) { border-color: var(--accent); background: var(--accent-wash); box-shadow: var(--ring); }
.autopilot-identity-card > input { position: absolute; opacity: 0; pointer-events: none; }
.autopilot-identity-avatar { position: relative; display: grid; place-items: center; inline-size: 40px; block-size: 40px; flex: none; overflow: hidden; border-radius: 50%; background: var(--accent-wash-strong); color: var(--accent-ink); font-weight: 800; }
.autopilot-identity-avatar img { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; object-fit: cover; }
.autopilot-identity-copy { display: flex; flex-direction: column; min-width: 0; gap: 3px; }
.autopilot-identity-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.autopilot-identity-copy small { color: var(--text-tertiary); }
.autopilot-actor-selector { margin-block-end: var(--sp-4); }
.autopilot-contract-legacy-field { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.autopilot-reaction-field { max-width: 360px; margin-block-start: var(--sp-4); }
@media (max-width: 640px) { .autopilot-identity-list { grid-template-columns: minmax(0, 1fr); } }
.autopilot-identity-search { display: block; max-width: 420px; margin-block-end: var(--sp-3); }
.autopilot-activity-review-alert { margin-block: var(--sp-4); }
.autopilot-activity-review-alert p { margin: 4px 0 0; color: var(--text-secondary); }
.autopilot-activity-honesty { margin-block: var(--sp-4); }
/* Reply Autopilot identity pickers keep the native selects as clipped serializers while the visible surface
   remains keyboard-friendly, status-aware, and large enough for touch. */
.autopilot-picker-source { position: absolute !important; inline-size: 1px !important; block-size: 1px !important; overflow: hidden !important; clip-path: inset(50%) !important; white-space: nowrap !important; }
.autopilot-picker { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--sp-2); max-block-size: 280px; min-width: 0; overflow-y: auto; padding: 2px; }
.autopilot-picker-option { display: grid; grid-template-columns: 40px minmax(0, 1fr) 22px; align-items: center; gap: var(--sp-2); min-block-size: 56px; min-width: 0; padding: var(--sp-2); color: var(--text-primary); background: var(--bg-surface-2); border: 1px solid var(--border-strong); border-radius: var(--r-2); font: inherit; text-align: start; cursor: pointer; }
.autopilot-picker-option:hover, .autopilot-picker-option:focus-visible { border-color: var(--accent); background: var(--accent-wash); box-shadow: var(--ring); outline: 0; }
.autopilot-picker-option[aria-selected="true"] { border-color: var(--accent); background: var(--accent-wash); box-shadow: inset 0 0 0 1px var(--accent); }
.autopilot-picker-option:disabled { cursor: not-allowed; opacity: .58; }
.autopilot-picker-option .autopilot-identity-avatar { inline-size: 36px; block-size: 36px; }
.autopilot-picker-copy { display: flex; flex-direction: column; min-width: 0; gap: 3px; }
.autopilot-picker-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.autopilot-picker-copy small { overflow: hidden; color: var(--text-tertiary); direction: ltr; text-overflow: ellipsis; white-space: nowrap; }
.autopilot-picker-check { display: grid; place-items: center; inline-size: 22px; block-size: 22px; color: var(--accent); border: 1px solid transparent; border-radius: 50%; opacity: 0; }
.autopilot-picker-option[aria-selected="true"] .autopilot-picker-check { opacity: 1; border-color: var(--accent); }
.autopilot-placeholder-hint { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-2); margin-block-start: var(--sp-2); }
.autopilot-placeholder-hint .chip { min-block-size: 30px; padding: 4px 10px; cursor: pointer; }
.autopilot-placeholder-hint code { color: inherit; font: inherit; font-weight: 800; }
.autopilot-picker-actions { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); min-width: 0; margin-block-start: var(--sp-2); }
.autopilot-picker-actions .hint { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 640px) { .autopilot-picker { grid-template-columns: minmax(0, 1fr); max-block-size: none; } .autopilot-picker-actions { align-items: flex-start; flex-direction: column; } .autopilot-picker-actions .btn { inline-size: 100%; } }

/* Reply Autopilot presentation: dedicated simulator and campaign surfaces. */
.autopilot-rule-preview { display: flex; flex-direction: column; gap: var(--sp-4); margin-block-start: var(--sp-4); padding: var(--sp-4); background: linear-gradient(145deg, var(--bg-surface), var(--bg-surface-2)); border: 1px solid var(--border-strong); border-radius: var(--r-3); box-shadow: var(--elev-1); }
.autopilot-rule-preview__header { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-3); }
.autopilot-rule-preview__heading { display: flex; align-items: flex-start; gap: var(--sp-3); min-width: 0; }
.autopilot-rule-preview__heading h3 { margin: 0; color: var(--text-primary); font-size: var(--text-lg); }
.autopilot-rule-preview__heading p { margin: 4px 0 0; color: var(--text-secondary); font-size: var(--text-sm); }
.autopilot-rule-preview__icon, .autopilot-rule-preview__channel-icon { display: grid; place-items: center; inline-size: 38px; block-size: 38px; flex: none; color: var(--accent); background: var(--accent-wash); border-radius: var(--r-2); }
.autopilot-rule-preview__icon svg, .autopilot-rule-preview__channel-icon svg { inline-size: 18px; block-size: 18px; }
.autopilot-rule-preview__workspace { display: grid; grid-template-columns: minmax(230px, .72fr) minmax(0, 1.28fr); gap: var(--sp-3); min-width: 0; }
.autopilot-rule-preview__input { display: flex; flex-direction: column; gap: var(--sp-3); min-width: 0; padding: var(--sp-4); background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--r-2); }
.autopilot-rule-preview__input .field { margin: 0; }
.autopilot-rule-preview__input textarea { min-block-size: 116px; resize: vertical; }
.autopilot-rule-preview__eyebrow { color: var(--text-tertiary); font-size: var(--text-xs); font-weight: 800; letter-spacing: var(--tracking-label); text-transform: uppercase; }
.autopilot-rule-preview__input-footer { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-2); margin-block-start: auto; }
.autopilot-rule-preview__input-footer .hint { flex: 1 1 120px; min-width: 0; }
.autopilot-rule-preview__outputs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3); min-width: 0; }
.autopilot-rule-preview__outputs[hidden] { display: none; }
.autopilot-rule-preview__channel { display: flex; flex-direction: column; min-width: 0; min-block-size: 238px; background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--r-2); overflow: hidden; }
.autopilot-rule-preview__channel > header { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-3); border-block-end: 1px solid var(--border-subtle); }
.autopilot-rule-preview__channel > header > div { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.autopilot-rule-preview__channel strong { color: var(--text-primary); font-size: var(--text-sm); }
.autopilot-rule-preview__channel small { color: var(--text-tertiary); font-size: var(--text-xs); }
.autopilot-rule-preview__channel--private .autopilot-rule-preview__channel-icon { color: var(--status-live); background: var(--status-live-wash); }
.autopilot-rule-preview__bubble { display: flex; align-items: flex-end; gap: var(--sp-2); margin-block-start: auto; padding: var(--sp-4); background: linear-gradient(180deg, transparent, var(--bg-surface-2)); }
.autopilot-rule-preview__bubble-avatar { display: grid; place-items: center; inline-size: 30px; block-size: 30px; flex: none; color: var(--text-on-accent); background: var(--accent); border-radius: 50%; font-size: var(--text-2xs); font-weight: 800; }
.autopilot-rule-preview__bubble p { max-inline-size: 100%; margin: 0; padding: var(--sp-3); color: var(--text-primary); background: var(--accent-wash); border: 1px solid var(--accent-border); border-radius: var(--r-2) var(--r-2) var(--r-2) 4px; font-size: var(--text-sm); line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.autopilot-rule-preview__channel--private .autopilot-rule-preview__bubble p { background: var(--status-live-wash); border-color: var(--status-live-border); }
[dir="rtl"] .autopilot-rule-preview__bubble p { border-radius: var(--r-2) var(--r-2) 4px var(--r-2); }

.autopilot-campaign-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: var(--sp-4); }
.autopilot-campaign-card { display: flex; flex-direction: column; gap: var(--sp-3); min-width: 0; padding: var(--sp-4); background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--r-3); box-shadow: var(--elev-1); transition: transform var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease); }
.autopilot-campaign-card:hover { transform: translateY(-2px); border-color: var(--accent-border); box-shadow: var(--elev-2); }
.autopilot-campaign-card__identity { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: var(--sp-3); min-width: 0; }
.autopilot-campaign-card__copy { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.autopilot-campaign-card__copy .data-title { max-inline-size: 100%; }
.autopilot-campaign-card__copy .data-sub { direction: ltr; text-align: start; }
.autopilot-campaign-card__top-end { align-self: start; justify-content: flex-end; flex-wrap: wrap; max-inline-size: 156px; }
.autopilot-campaign-card__status { flex: none; }
.autopilot-campaign-card__metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: var(--sp-3) var(--sp-2); background: var(--bg-surface-2); border: 1px solid var(--border-subtle); border-radius: var(--r-2); }
.autopilot-campaign-card__metric { padding-inline: var(--sp-2); }
.autopilot-campaign-card__metric + .autopilot-campaign-card__metric { border-inline-start: 1px solid var(--border-subtle); }
.autopilot-campaign-card__metric .data-stat-num { font-size: var(--text-xl); }
.autopilot-campaign-card__metric .data-stat-label { line-height: 1.3; text-align: center; }
.autopilot-campaign-card__meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-2); min-width: 0; padding: var(--sp-2); border: 1px solid var(--border-subtle); border-radius: var(--r-2); }
.autopilot-campaign-card__meta > span { display: flex; flex-direction: column; gap: 3px; min-width: 0; padding-inline: var(--sp-2); }
.autopilot-campaign-card__meta > span + span { border-inline-start: 1px solid var(--border-subtle); }
.autopilot-campaign-card__meta small { color: var(--text-tertiary); font-size: var(--text-2xs); }
.autopilot-campaign-card__meta strong { overflow: hidden; color: var(--text-secondary); font-size: var(--text-xs); text-overflow: ellipsis; white-space: nowrap; }
.autopilot-campaign-card__diagnostics { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.autopilot-campaign-card__diagnostics .chip { flex: 0 1 auto; }
.autopilot-campaign-card__heartbeat { display: flex; min-height: 34px; align-items: center; padding-block: var(--sp-1h); border-block-start: 1px solid var(--border-subtle); border-block-end: 1px solid var(--border-subtle); line-height: 1.4; }
.autopilot-campaign-card__actions { align-items: center; gap: var(--sp-2); padding-block-start: var(--sp-3); }
.autopilot-campaign-card__actions .btn { min-block-size: 40px; }
.autopilot-campaign-card__actions .btn-danger { background: transparent; border-color: var(--status-failed-border); color: var(--status-failed); }
.autopilot-campaign-card__actions .btn-danger:hover { color: var(--text-on-accent); background: var(--status-failed); border-color: var(--status-failed); }
@media (max-width: 920px) { .autopilot-campaign-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) { .autopilot-rule-preview__workspace, .autopilot-rule-preview__outputs { grid-template-columns: minmax(0, 1fr); } .autopilot-campaign-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 520px) {
    .autopilot-rule-preview { padding: var(--sp-3); }
    .autopilot-rule-preview__header { flex-direction: column; }
    .autopilot-rule-preview__header > .chip { align-self: flex-start; }
    .autopilot-rule-preview__input-footer { align-items: stretch; flex-direction: column; }
    .autopilot-rule-preview__input-footer .btn { inline-size: 100%; justify-content: center; }
    .autopilot-campaign-card { padding: var(--sp-3); }
    .autopilot-campaign-card__identity { grid-template-columns: 42px minmax(0, 1fr) auto; gap: var(--sp-2); }
    .autopilot-campaign-card__identity .data-avatar { inline-size: 42px; block-size: 42px; }
    .autopilot-campaign-card__top-end { max-inline-size: 122px; }
    .autopilot-campaign-card__metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-2); }
    .autopilot-campaign-card__metric:nth-child(odd) { border-inline-start: 0; }
    .autopilot-campaign-card__metric:nth-child(-n+2) { padding-block-end: var(--sp-2); border-block-end: 1px solid var(--border-subtle); }
    .autopilot-campaign-card__meta { grid-template-columns: minmax(0, 1fr); }
    .autopilot-campaign-card__meta > span + span { border-block-start: 1px solid var(--border-subtle); border-inline-start: 0; padding-block-start: var(--sp-2); }
    .autopilot-campaign-card__actions { flex-wrap: wrap; }
    .autopilot-campaign-card__actions > * { flex: 1 1 calc(50% - var(--sp-2)); }
}

/* Reply Autopilot Activity dashboard: compact, semantic and direction-safe presentation. */
.autopilot-activity-dashboard { display: grid; gap: var(--sp-4); margin-block-end: var(--sp-4); padding: var(--sp-5); background: var(--panel); border: 1px solid var(--line-strong); border-radius: var(--r-3); box-shadow: var(--elev-1); }
.autopilot-activity-dashboard__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-4); }
.autopilot-activity-dashboard__identity { display: flex; align-items: flex-start; gap: var(--sp-3); min-width: 0; }
.autopilot-activity-dashboard__icon { display: grid; place-items: center; inline-size: 42px; block-size: 42px; flex: none; color: var(--accent); background: var(--accent-soft); border-radius: var(--r-2); }
.autopilot-activity-dashboard h2 { margin: 2px 0 4px; color: var(--text-primary); font-size: clamp(1.35rem, 2vw, 1.8rem); }
.autopilot-activity-dashboard__identity p { margin: 0; }
.autopilot-activity-dashboard__truth { flex: none; padding-block-start: 4px; }
.autopilot-activity-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; overflow: hidden; background: var(--line-strong); border: 1px solid var(--line-strong); border-radius: var(--r-2); }
.autopilot-activity-summary article { display: grid; gap: 3px; min-width: 0; padding: var(--sp-3) var(--sp-4); background: var(--bg-surface); border-inline-start: 2px solid var(--accent-border); }
.autopilot-activity-summary strong { color: var(--text-primary); font-family: var(--font-mono); font-size: var(--text-xl); line-height: 1.1; }
.autopilot-activity-summary small { color: var(--text-tertiary); overflow-wrap: anywhere; }
.autopilot-activity-review-alert { margin: 0; }
.autopilot-activity-review-alert p { margin: 4px 0 0; color: var(--text-secondary); }
.autopilot-activity-controls { display: grid; grid-template-columns: minmax(0, 1fr) 220px; align-items: end; gap: var(--sp-3); margin-block-end: var(--sp-4); padding: var(--sp-3); background: var(--panel); border: 1px solid var(--border-subtle); border-radius: var(--r-2); }
.autopilot-activity-controls .autopilot-target-search { min-block-size: 44px; }
.autopilot-activity-filter { display: grid; gap: 5px; min-width: 0; }
.autopilot-activity-filter .select { inline-size: 100%; min-inline-size: 0; }
.autopilot-activity-cards { display: grid; gap: var(--sp-3); }
.autopilot-activity-card { min-width: 0; padding: var(--sp-4); background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--r-3); box-shadow: var(--elev-1); }
.autopilot-activity-card[hidden] { display: none; }
.autopilot-activity-card:focus-within { border-color: var(--accent-border); box-shadow: var(--ring); }
.autopilot-activity-card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-3); padding-block-end: var(--sp-3); border-block-end: 1px solid var(--border-subtle); }
.autopilot-activity-target { display: flex; align-items: center; gap: var(--sp-3); min-width: 0; }
.autopilot-activity-target__copy { min-width: 0; }
.autopilot-activity-target__copy h2 { margin: 2px 0 3px; color: var(--text-primary); font-size: var(--text-md); overflow-wrap: anywhere; }
.autopilot-activity-target__copy .eyebrow { color: var(--accent); }
.autopilot-activity-media { display: grid; place-items: center; inline-size: 50px; block-size: 50px; flex: none; color: var(--accent); background: var(--accent-soft); border: 1px solid var(--accent-border); border-radius: var(--r-2); text-align: center; }

.autopilot-activity-media--reel { color: var(--status-info, var(--accent)); background: var(--info-soft, var(--accent-soft)); }
.autopilot-activity-media--group { color: var(--text-secondary); background: var(--bg-surface); border-color: var(--accent-border); }
.autopilot-activity-post-bubble { margin: 2px 0 3px; padding: var(--sp-2) var(--sp-3); color: var(--text-primary); background: var(--bg-surface); border: 1px solid var(--accent-border); border-radius: var(--r-2); font-size: var(--text-md); line-height: 1.55; overflow-wrap: anywhere; }
.autopilot-activity-target-id { display: block; color: var(--text-tertiary); font-size: var(--text-xs); overflow-wrap: anywhere; }
.autopilot-activity-target-id code { color: var(--text-secondary); font-family: var(--font-mono); }
.autopilot-activity-card__head > .chip { flex: none; }
.autopilot-activity-card__workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(190px, 230px); gap: var(--sp-4); padding-block-start: var(--sp-4); }
.autopilot-activity-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-3); min-width: 0; margin: 0; padding: 0; list-style: none; counter-reset: activity-step; }
.autopilot-activity-step { display: flex; align-items: flex-start; align-self: start; gap: var(--sp-2); min-width: 0; padding: var(--sp-3); background: var(--bg-surface); border: 1px solid var(--accent-border); border-radius: var(--r-2); }
.autopilot-activity-step__marker { display: grid; place-items: center; inline-size: 24px; block-size: 24px; flex: none; color: var(--accent); background: var(--accent-soft); border-radius: 50%; font-family: var(--font-mono); font-size: var(--text-xs); font-weight: 800; }
.autopilot-activity-step__content { display: grid; gap: 6px; min-width: 0; }
.autopilot-activity-step__title { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-2); min-width: 0; }
.autopilot-activity-step h3 { margin: 0; color: var(--text-primary); font-size: var(--text-sm); overflow-wrap: anywhere; }
.autopilot-activity-step .chip { flex: none; font-size: var(--text-xs); }
.autopilot-activity-step__detail { color: var(--text-secondary); font-size: var(--text-sm); overflow-wrap: anywhere; }
.autopilot-activity-step__time { color: var(--text-tertiary); font-size: var(--text-xs); overflow-wrap: anywhere; }
.autopilot-activity-card__summary { display: grid; align-content: start; gap: var(--sp-3); min-width: 0; padding-inline-start: var(--sp-4); border-inline-start: 1px solid var(--border-subtle); }
.autopilot-activity-summary-block { display: grid; gap: 4px; }
.autopilot-activity-status { margin: 0; color: var(--text-primary); font-size: var(--text-lg); font-weight: 800; }
.autopilot-activity-status--ok { color: var(--status-success); }
.autopilot-activity-status--warn { color: var(--status-warning); }
.autopilot-activity-status--bad { color: var(--status-failed); }
.autopilot-activity-meta { display: grid; gap: var(--sp-2); margin: 0; }
.autopilot-activity-meta > div { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-2); }
.autopilot-activity-meta dt { color: var(--text-tertiary); font-size: var(--text-xs); }
.autopilot-activity-meta dd { margin: 0; color: var(--text-secondary); font-family: var(--font-mono); font-size: var(--text-sm); text-align: end; overflow-wrap: anywhere; }
.autopilot-diagnostic-list { display: grid; gap: var(--sp-2); margin: 0; padding-block: var(--sp-3); }
.autopilot-diagnostic-list > div { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-2); }
.autopilot-diagnostic-list dt { color: var(--text-tertiary); font-size: var(--text-sm); }
.autopilot-diagnostic-list dd { margin: 0; color: var(--text-secondary); text-align: end; overflow-wrap: anywhere; }
.activity-diagnostics { margin-block-start: var(--sp-4); border-block-start: 1px solid var(--border-subtle); }
.activity-diagnostics summary { min-block-size: 40px; padding-block-start: var(--sp-3); color: var(--accent); cursor: pointer; font-weight: 700; }
.activity-diagnostics summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-1); }
.autopilot-activity-empty { min-block-size: 180px; }
@media (max-width: 1080px) {
    .autopilot-activity-card__workspace { grid-template-columns: minmax(0, 1fr); }
    .autopilot-activity-card__summary { grid-template-columns: minmax(0, 1fr) minmax(240px, .8fr); align-items: start; padding-block-start: var(--sp-3); padding-inline-start: 0; border-block-start: 1px solid var(--border-subtle); border-inline-start: 0; }
}
@media (max-width: 920px) {
    .autopilot-activity-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .autopilot-activity-steps { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .autopilot-activity-dashboard { padding: var(--sp-4); }
    .autopilot-activity-dashboard__head, .autopilot-activity-card__head { flex-direction: column; }
    .autopilot-activity-dashboard__truth { padding-block-start: 0; }
    .autopilot-activity-controls { grid-template-columns: minmax(0, 1fr); align-items: stretch; }
    .autopilot-activity-card { padding: var(--sp-3); }
    .autopilot-activity-target { align-items: flex-start; }
    .autopilot-activity-media { inline-size: 50px; block-size: 50px; }
    .autopilot-activity-card__summary { grid-template-columns: 1fr; }
}

/* Reply Autopilot lead cards: comments lead the hierarchy while outcomes and support data remain easy to scan. */
.autopilot-leads-dashboard { display: grid; gap: var(--sp-4); margin-block-end: var(--sp-4); padding: var(--sp-5); overflow: hidden; background: linear-gradient(180deg, var(--panel), color-mix(in srgb, #1f6fc7 3%, var(--panel))); border: 1px solid color-mix(in srgb, #1f6fc7 20%, var(--border-subtle)); border-block-start: 3px solid #1f6fc7; border-radius: 18px; box-shadow: 0 10px 28px color-mix(in srgb, #173a5e 7%, transparent); }
.autopilot-leads-dashboard__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-4); }
.autopilot-leads-dashboard__identity { display: flex; align-items: flex-start; gap: var(--sp-3); min-width: 0; }
.autopilot-leads-dashboard__icon { display: grid; place-items: center; inline-size: 42px; block-size: 42px; flex: none; color: #fff; background: #1f6fc7; border: 1px solid color-mix(in srgb, #fff 22%, transparent); border-radius: 12px; box-shadow: 0 6px 14px color-mix(in srgb, #1f6fc7 22%, transparent); }
.autopilot-leads-dashboard__icon svg { display: block; inline-size: 21px; block-size: 21px; stroke-width: 1.8; }
.autopilot-leads-dashboard h2 { margin: 2px 0 4px; color: var(--text-primary); font-size: clamp(1.35rem, 2vw, 1.8rem); }
.autopilot-leads-dashboard p { margin: 0; }
.autopilot-leads-dashboard__head > .chip { flex: none; margin-block-start: 4px; }
.autopilot-leads-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-2); }
.autopilot-leads-summary article { display: grid; gap: 4px; min-width: 0; padding: var(--sp-3) var(--sp-4); background: var(--bg-surface); border: 1px solid color-mix(in srgb, #6f8ca8 30%, var(--border-subtle)); border-block-start: 2px solid #2b75c4; border-radius: 10px; box-shadow: 0 3px 10px color-mix(in srgb, #173a5e 4%, transparent); }
.autopilot-leads-summary article.autopilot-leads-summary__private { border-block-start-color: #20848c; }
.autopilot-leads-summary article.autopilot-leads-summary__attention.is-clear { border-block-start-color: #278761; }
.autopilot-leads-summary article.autopilot-leads-summary__attention.is-alert { border-block-start-color: #c4811a; }
.autopilot-leads-summary strong { color: var(--text-primary); font-family: var(--font-mono); font-size: var(--text-xl); line-height: 1.1; }
.autopilot-leads-summary small { color: var(--text-tertiary); overflow-wrap: anywhere; }
.autopilot-leads-controls { display: grid; grid-template-columns: minmax(0, 1fr) 240px; align-items: end; gap: var(--sp-3); margin-block-end: var(--sp-4); padding: var(--sp-3); background: var(--panel); border: 1px solid color-mix(in srgb, #6f8ca8 30%, var(--border-subtle)); border-radius: 14px; box-shadow: 0 6px 18px color-mix(in srgb, #173a5e 5%, transparent); }
.autopilot-leads-controls .autopilot-target-search { min-block-size: 44px; }
.autopilot-leads-filter { display: grid; gap: 5px; min-width: 0; }
.autopilot-leads-filter .select { inline-size: 100%; min-inline-size: 0; }
.autopilot-leads-card-shell { container-type: inline-size; display: grid; gap: var(--sp-4); max-inline-size: 100%; }
.autopilot-leads-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; gap: clamp(16px, 1.6vw, 24px); min-width: 0; }
.autopilot-lead-card { --lead-accent: #2b75c4; position: relative; display: grid; min-width: 0; block-size: 100%; overflow: hidden; background: var(--bg-surface); border: 1px solid color-mix(in srgb, #6f8ca8 32%, var(--border-subtle)); border-block-start: 3px solid var(--lead-accent); border-radius: 16px; box-shadow: 0 10px 26px color-mix(in srgb, #173a5e 8%, transparent); transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease); }
.autopilot-lead-card:hover { border-color: color-mix(in srgb, var(--lead-accent) 35%, var(--border-subtle)); box-shadow: 0 14px 30px color-mix(in srgb, #173a5e 11%, transparent); transform: translateY(-1px); }
.autopilot-lead-card--completed { --lead-accent: #278761; }
.autopilot-lead-card--pending { --lead-accent: #c4811a; }
.autopilot-lead-card--review { --lead-accent: #20848c; }
.autopilot-lead-card--failed { --lead-accent: #c84f5d; }
.autopilot-lead-card[hidden], .autopilot-lead-card__details[hidden] { display: none; }
.autopilot-lead-card__header { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-4); }
.autopilot-lead-person { display: flex; align-items: center; gap: var(--sp-2); min-width: 0; }
.autopilot-lead-person__avatar { display: grid; place-items: center; inline-size: 46px; block-size: 46px; flex: none; overflow: hidden; color: #fff; background: #2b75c4; border: 2px solid color-mix(in srgb, #6f8ca8 28%, var(--border-subtle)); border-radius: 50%; box-shadow: 0 3px 9px color-mix(in srgb, #173a5e 12%, transparent); font-size: var(--text-sm); font-weight: 800; }
.autopilot-lead-person__avatar > * { grid-area: 1 / 1; inline-size: 100%; block-size: 100%; }
.autopilot-lead-person__avatar img { display: block; object-fit: cover; }
.autopilot-lead-person__fallback { display: grid; place-items: center; }
.autopilot-lead-person__fallback[hidden] { display: none; }
.autopilot-lead-person__copy, .autopilot-lead-outcome { display: grid; gap: 5px; min-width: 0; }
.autopilot-lead-person__copy strong { font-size: var(--text-base); }
.autopilot-lead-person__copy strong { overflow: hidden; color: var(--text-primary); text-overflow: ellipsis; white-space: nowrap; }
.autopilot-lead-person__copy small, .autopilot-lead-outcome small { overflow: hidden; color: var(--text-tertiary); font-size: var(--text-xs); text-overflow: ellipsis; white-space: nowrap; }
.autopilot-lead-outcome { justify-items: end; flex: none; }
.autopilot-lead-card__comment { position: relative; display: grid; gap: var(--sp-2); min-block-size: 116px; margin-inline: var(--sp-4); padding: var(--sp-3) var(--sp-4); overflow: hidden; background: color-mix(in srgb, #2b75c4 3%, var(--bg-surface)); border: 1px solid color-mix(in srgb, #6f8ca8 27%, var(--border-subtle)); border-inline-start: 3px solid #7aa7d4; border-radius: 12px; }
.autopilot-lead-card__comment::after { position: absolute; inset-block-start: -16px; inset-inline-end: 14px; color: color-mix(in srgb, #7aa7d4 24%, transparent); content: "\201C"; font-family: Georgia, serif; font-size: 7rem; line-height: 1; pointer-events: none; }
.autopilot-lead-comment { position: relative; z-index: 1; display: -webkit-box; margin: 0; overflow: hidden; color: var(--text-primary); font-size: var(--text-sm); font-weight: 600; line-height: 1.7; overflow-wrap: anywhere; white-space: pre-wrap; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.autopilot-lead-comment.is-missing { color: var(--text-tertiary); font-style: italic; }
.autopilot-lead-card__rule { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; align-items: center; gap: var(--sp-2); margin: var(--sp-4) var(--sp-4) var(--sp-2); padding: 10px var(--sp-3); background: color-mix(in srgb, #6f8ca8 3%, var(--bg-surface)); border: 1px solid color-mix(in srgb, #6f8ca8 28%, var(--border-subtle)); border-inline-start: 3px solid #6f8ca8; border-radius: 10px; }
.autopilot-lead-card__rule-icon { display: grid; place-items: center; inline-size: 28px; block-size: 28px; color: #456987; background: color-mix(in srgb, #6f8ca8 12%, var(--bg-surface)); border-radius: 8px; }
.autopilot-lead-card__rule-icon svg { inline-size: 15px; block-size: 15px; }
.autopilot-lead-card__rule strong { overflow: hidden; color: var(--text-primary); text-overflow: ellipsis; white-space: nowrap; }
.autopilot-lead-card__rule .chip { justify-self: end; }
.autopilot-lead-card__rule-type { color: #4f667b; background: color-mix(in srgb, #6f8ca8 10%, var(--bg-surface)); border-color: color-mix(in srgb, #6f8ca8 26%, var(--border-subtle)); }
.autopilot-lead-card__content { display: grid; gap: var(--sp-3); margin: 0 var(--sp-4) var(--sp-4); padding: var(--sp-3); background: color-mix(in srgb, #2b75c4 4%, var(--bg-surface)); border: 1px solid color-mix(in srgb, #2b75c4 23%, var(--border-subtle)); border-radius: 12px; box-shadow: 0 4px 12px color-mix(in srgb, #173a5e 5%, transparent); }
.autopilot-lead-card__content-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--sp-3); min-width: 0; }
.autopilot-lead-card__content-icon { display: grid; place-items: center; inline-size: 42px; block-size: 42px; color: #fff; background: #2b75c4; border-radius: 11px; box-shadow: 0 4px 10px color-mix(in srgb, #1f6fc7 18%, transparent); }
.autopilot-lead-card__content-icon svg { inline-size: 20px; block-size: 20px; }
.autopilot-lead-card__content-copy { display: grid; gap: 6px; min-width: 0; }
.autopilot-lead-card__content-title { display: -webkit-box; margin: 0; padding-block-start: var(--sp-3); overflow: hidden; color: var(--text-primary); border-block-start: 1px solid color-mix(in srgb, #2b75c4 18%, var(--border-subtle)); font-size: var(--text-sm); font-weight: 700; line-height: 1.65; overflow-wrap: anywhere; white-space: pre-wrap; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.autopilot-lead-card__content-meta { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-2); min-width: 0; color: var(--text-tertiary); font-size: var(--text-2xs); }
.autopilot-lead-card__content-meta .mono { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.autopilot-lead-card__content-link { color: #fff; background: #1f6fc7; border-color: #1a61ae; box-shadow: 0 4px 10px color-mix(in srgb, #1f6fc7 18%, transparent); white-space: nowrap; }
.autopilot-lead-card__content-link:hover, .autopilot-lead-card__content-link:focus-visible { color: #fff; background: #195eaa; border-color: #195eaa; transform: translateY(-1px); }
.autopilot-lead-card__progress { display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: var(--sp-2); margin-inline: var(--sp-4); }
.autopilot-lead-progress { --progress-accent: #2b75c4; display: grid; gap: 7px; min-width: 0; padding: var(--sp-2) var(--sp-3); background: color-mix(in srgb, #2b75c4 3%, var(--bg-surface)); border: 1px solid color-mix(in srgb, #6f8ca8 27%, var(--border-subtle)); border-block-start: 2px solid var(--progress-accent); border-radius: 10px; }
.autopilot-lead-progress--public { --progress-accent: #2b75c4; }
.autopilot-lead-progress--private { --progress-accent: #20848c; }
.autopilot-lead-progress--reaction { --progress-accent: #b7791f; }
.autopilot-lead-card__progress small { color: color-mix(in srgb, var(--progress-accent) 70%, var(--text-primary)); font-size: var(--text-xs); font-weight: 750; }
.autopilot-lead-card__progress .chip { justify-self: center; }
.autopilot-lead-card__timeline { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3); margin: var(--sp-4); padding-block: var(--sp-3); border-block: 1px solid color-mix(in srgb, #6f8ca8 26%, var(--border-subtle)); }
.autopilot-lead-card__timeline > div { display: grid; gap: 4px; min-width: 0; }
.autopilot-lead-card__timeline dt { color: var(--text-tertiary); font-size: var(--text-2xs); font-weight: 700; letter-spacing: var(--tracking-label); text-transform: uppercase; }
.autopilot-lead-card__timeline dd { margin: 0; overflow: hidden; color: var(--text-secondary); font-family: var(--font-mono); font-size: var(--text-xs); text-overflow: ellipsis; white-space: nowrap; }
.autopilot-lead-card__footer { align-self: end; display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: 0 var(--sp-4) var(--sp-4); }
.autopilot-lead-card__credit { color: var(--text-tertiary); font-size: var(--text-xs); }
.autopilot-lead-details-toggle { min-inline-size: 42px; padding-inline: var(--sp-2); }
.autopilot-lead-details-toggle svg { inline-size: 14px; block-size: 14px; transition: transform var(--dur-fast) var(--ease); }
.autopilot-lead-details-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.autopilot-lead-card__details { padding: var(--sp-4); background: color-mix(in srgb, #2b75c4 3%, var(--bg-surface)); border-block-start: 1px solid color-mix(in srgb, #6f8ca8 26%, var(--border-subtle)); }
.autopilot-lead-details { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-3); margin: 0; }
.autopilot-lead-details > div { display: grid; gap: 4px; min-width: 0; padding-inline-start: var(--sp-3); border-inline-start: 2px solid #8ea9c0; }
.autopilot-lead-details > .autopilot-lead-details__comment { grid-column: 1 / -1; }
.autopilot-lead-details__comment dd { color: var(--text-primary); font-size: var(--text-sm); line-height: 1.6; white-space: pre-wrap; }
.autopilot-lead-details dt { color: var(--text-tertiary); font-size: var(--text-2xs); font-weight: 700; letter-spacing: var(--tracking-label); text-transform: uppercase; }
.autopilot-lead-details dd { margin: 0; color: var(--text-secondary); font-size: var(--text-xs); overflow-wrap: anywhere; }
.autopilot-leads-empty { min-block-size: 220px; padding: var(--sp-5); background: var(--panel); border: 1px dashed color-mix(in srgb, var(--accent) 30%, var(--border-subtle)); border-radius: var(--r-3); }
.autopilot-leads-pagination { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); min-block-size: 58px; padding: var(--sp-3) var(--sp-4); color: var(--text-secondary); background: var(--panel); border: 1px solid color-mix(in srgb, #6f8ca8 30%, var(--border-subtle)); border-radius: 12px; box-shadow: 0 4px 12px color-mix(in srgb, #173a5e 4%, transparent); font-size: var(--text-xs); }
@container (max-width: 1100px) { .autopilot-leads-grid { grid-template-columns: minmax(0, 1fr); } }
@container (max-width: 620px) { .autopilot-lead-card__header, .autopilot-lead-card__footer { align-items: flex-start; flex-direction: column; } .autopilot-lead-outcome { justify-items: start; } .autopilot-lead-card__rule { grid-template-columns: auto minmax(0, 1fr); } .autopilot-lead-card__rule .chip { justify-self: start; } .autopilot-lead-card__content-head { grid-template-columns: auto minmax(0, 1fr); } .autopilot-lead-card__content-link { grid-column: 1 / -1; justify-content: center; inline-size: 100%; } .autopilot-lead-card__timeline, .autopilot-lead-details { grid-template-columns: minmax(0, 1fr); } .autopilot-lead-card__progress { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 920px) { .autopilot-leads-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .autopilot-leads-dashboard { padding: var(--sp-4); } .autopilot-leads-dashboard__head { flex-direction: column; } .autopilot-leads-dashboard__head > .chip { margin-block-start: 0; } .autopilot-leads-summary, .autopilot-leads-controls { grid-template-columns: minmax(0, 1fr); } .autopilot-leads-controls { align-items: stretch; } .autopilot-lead-card__progress { grid-template-columns: minmax(0, 1fr); } .autopilot-leads-pagination { align-items: flex-start; flex-direction: column; } }
/* Reply Autopilot flow dashboard was retired in favor of the campaign ledger. The legacy selectors stay inside
   this comment only to make stale cached markup visually inert; the current view emits no flow markup. */
/*
.autopilot-flow-dashboard { display: grid; gap: var(--sp-4); margin-block-end: var(--sp-3); padding: var(--sp-5); background: var(--panel); border: 1px solid var(--border-strong); border-radius: var(--r-3); box-shadow: var(--elev-1); }
.autopilot-flow-dashboard__header { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-4); }
.autopilot-flow-dashboard__header p { margin: 0; }
.autopilot-flow-status-filter { display: grid; gap: 5px; flex: 0 1 220px; min-width: 160px; }
.autopilot-flow-status-filter .select { inline-size: 100%; }
.autopilot-campaign-rail-wrap { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--sp-2); min-width: 0; }
.autopilot-campaign-rail { display: flex; gap: var(--sp-2); min-width: 0; padding: 2px; overflow-x: auto; scrollbar-width: thin; }
.autopilot-campaign-rail__item { display: flex; align-items: center; flex: 0 0 min(240px, 78vw); gap: var(--sp-2); min-block-size: 64px; min-width: 0; padding: var(--sp-2) var(--sp-3); color: var(--text-primary); text-align: start; background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--r-2); cursor: pointer; transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease); }
.autopilot-campaign-rail__item:hover, .autopilot-campaign-rail__item:focus-visible { border-color: var(--accent-border); background: var(--accent-wash); box-shadow: var(--ring); outline: 0; transform: translateY(-1px); }
.autopilot-campaign-rail__item.is-selected { border-color: var(--accent); background: var(--accent-wash); box-shadow: inset 0 0 0 1px var(--accent); }
.autopilot-campaign-rail__copy { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.autopilot-campaign-rail__copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.autopilot-campaign-rail__copy small { display: flex; align-items: center; gap: 5px; color: var(--text-tertiary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.autopilot-campaign-rail__nav { display: grid; place-items: center; inline-size: 34px; block-size: 34px; color: var(--accent); background: var(--bg-surface); border: 1px solid var(--accent-border); border-radius: 50%; cursor: pointer; }
.autopilot-campaign-rail__nav:hover, .autopilot-campaign-rail__nav:focus-visible { background: var(--accent-wash); box-shadow: var(--ring); outline: 0; }
.autopilot-flow-avatar { position: relative; display: grid; place-items: center; inline-size: 40px; block-size: 40px; flex: none; overflow: hidden; color: var(--text-on-accent); background: var(--accent); border-radius: 50%; font-size: var(--text-sm); font-weight: 800; }
.autopilot-flow-avatar img { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; object-fit: cover; }
.autopilot-flow-avatar--lg { inline-size: 56px; block-size: 56px; font-size: var(--text-lg); }
.autopilot-flow-panels { display: grid; gap: var(--sp-3); }
.autopilot-flow-panel { display: grid; gap: var(--sp-4); min-width: 0; padding: var(--sp-5); background: var(--panel); border: 1px solid var(--border-strong); border-radius: var(--r-3); box-shadow: var(--elev-1); animation: autopilot-flow-panel-enter var(--dur) var(--ease); }
.autopilot-flow-panel[hidden] { display: none; }
@keyframes autopilot-flow-panel-enter { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.autopilot-flow-panel__header { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-4); }
.autopilot-flow-panel__identity { display: flex; align-items: center; gap: var(--sp-3); min-width: 0; }
.autopilot-flow-panel__identity h2 { margin: 2px 0 3px; color: var(--text-primary); font-size: var(--text-xl); overflow-wrap: anywhere; }
.autopilot-flow-panel__identity p { margin: 0; overflow-wrap: anywhere; }
.autopilot-flow-panel__actions { display: flex; align-items: center; gap: var(--sp-2); flex: none; }
.autopilot-flow-stages { display: flex; align-items: stretch; gap: var(--sp-2); min-width: 0; }
.autopilot-flow-stage { display: grid; align-content: start; align-self: start; flex: 1 1 0; gap: 5px; min-width: 0; min-block-size: 138px; padding: var(--sp-3); background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--r-2); }
.autopilot-flow-stage__icon { display: grid; place-items: center; inline-size: 32px; block-size: 32px; margin-block-end: 2px; color: var(--accent); background: var(--accent-wash); border-radius: 50%; }
.autopilot-flow-stage strong { color: var(--text-primary); overflow-wrap: anywhere; }
.autopilot-flow-stage small { color: var(--text-tertiary); overflow-wrap: anywhere; }
.autopilot-flow-connector { position: relative; align-self: center; flex: 0 0 22px; block-size: 2px; background: var(--accent-border); }

.autopilot-flow-actions { display: grid; gap: 5px; min-width: 0; }
.autopilot-flow-action { display: block; padding: 5px 7px; color: var(--text-tertiary); background: var(--bg-surface-2); border: 1px solid var(--border-subtle); border-radius: var(--r-1); font-size: var(--text-xs); overflow-wrap: anywhere; }
.autopilot-flow-action.is-enabled { color: var(--text-primary); background: var(--accent-wash); border-color: var(--accent-border); }
.autopilot-flow-action.is-muted { opacity: .7; }
.autopilot-flow-lower { display: grid; grid-template-columns: minmax(0, 1fr) minmax(190px, .32fr); gap: var(--sp-3); min-width: 0; }
.autopilot-flow-outcomes, .autopilot-flow-health { min-width: 0; padding: var(--sp-3); background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--r-2); }
.autopilot-flow-outcomes > header { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding-block-end: var(--sp-2); border-block-end: 1px solid var(--border-subtle); }
.autopilot-flow-outcomes h3 { margin: 2px 0 0; color: var(--text-primary); font-size: var(--text-base); }
.autopilot-flow-outcome-list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.autopilot-flow-outcome { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--sp-2); min-width: 0; padding-block: var(--sp-2); border-block-end: 1px solid var(--border-subtle); }
.autopilot-flow-outcome:last-child { border-block-end: 0; }
.autopilot-flow-outcome__marker { display: grid; place-items: center; inline-size: 26px; block-size: 26px; color: var(--text-tertiary); background: var(--bg-surface-2); border: 1px solid var(--border-subtle); border-radius: 50%; }
.autopilot-flow-outcome__marker.is-confirmed { color: var(--status-live); background: var(--status-live-wash); border-color: var(--status-live-border); }
.autopilot-flow-outcome strong, .autopilot-flow-outcome small { display: block; min-width: 0; overflow-wrap: anywhere; }
.autopilot-flow-outcome small, .autopilot-flow-outcome time { color: var(--text-tertiary); font-size: var(--text-xs); }
.autopilot-flow-outcome time { direction: ltr; text-align: end; white-space: nowrap; }
.autopilot-flow-outcomes__footer { display: flex; flex-wrap: wrap; gap: var(--sp-3); padding-block-start: var(--sp-2); color: var(--text-tertiary); font-size: var(--text-xs); }
.autopilot-flow-outcomes__footer strong { color: var(--text-primary); }
.autopilot-flow-health { display: grid; align-content: start; gap: 7px; color: var(--text-secondary); font-size: var(--text-xs); line-height: 1.45; }
.autopilot-flow-health strong { color: var(--text-primary); }
.autopilot-flow-panel__footer { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding-block-start: var(--sp-3); border-block-start: 1px solid var(--border-subtle); }
.autopilot-flow-panel__stats { display: flex; flex-wrap: wrap; gap: var(--sp-4); }
.autopilot-flow-panel__stats span { display: grid; gap: 2px; min-width: 54px; }
.autopilot-flow-panel__stats strong { color: var(--text-primary); font-size: var(--text-lg); line-height: 1; }
.autopilot-flow-panel__stats small { color: var(--text-tertiary); font-size: var(--text-2xs); }
.autopilot-flow-panel__state-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--sp-2); }
@media (max-width: 980px) { .autopilot-flow-lower { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) { .autopilot-flow-dashboard, .autopilot-flow-panel { padding: var(--sp-4); } .autopilot-flow-dashboard__header, .autopilot-flow-panel__header { align-items: stretch; flex-direction: column; } .autopilot-flow-status-filter { flex-basis: auto; } .autopilot-flow-stages { align-items: stretch; flex-direction: column; } .autopilot-flow-stage { min-block-size: 0; } .autopilot-flow-connector { align-self: center; flex-basis: 18px; inline-size: 2px; block-size: 18px; }  .autopilot-flow-panel__footer { align-items: stretch; flex-direction: column; } .autopilot-flow-panel__state-actions { justify-content: flex-start; } }
@media (max-width: 640px) { .autopilot-campaign-rail__item { flex-basis: min(220px, 80vw); } .autopilot-flow-outcome { grid-template-columns: auto minmax(0, 1fr); } .autopilot-flow-outcome time { grid-column: 2; text-align: start; } .autopilot-flow-outcomes > header { align-items: flex-start; flex-direction: column; } .autopilot-flow-panel__state-actions > * { flex: 1 1 auto; } }
 Reply Autopilot reference flow: open canvas, large semantic nodes, and a horizontal outcome rail.
.autopilot-campaign-toolbar { display: grid; grid-template-columns: minmax(170px, .2fr) minmax(0, 1fr); align-items: center; gap: var(--sp-4); margin-block-end: var(--sp-3); padding: var(--sp-3) var(--sp-4); background: var(--panel); border: 1px solid var(--border-subtle); border-radius: var(--r-2); box-shadow: var(--elev-1); }
.autopilot-campaign-toolbar__filter { display: flex; align-items: end; gap: var(--sp-2); min-width: 0; }
.autopilot-campaign-toolbar__filter .autopilot-flow-status-filter { flex: 1 1 auto; min-width: 0; }
.autopilot-campaign-toolbar__count { display: grid; place-items: center; inline-size: 30px; block-size: 30px; flex: none; color: var(--accent); background: var(--accent-wash); border: 1px solid var(--accent-border); border-radius: 50%; font-family: var(--font-mono); font-size: var(--text-xs); font-weight: 800; }
.autopilot-campaign-toolbar .autopilot-campaign-rail-wrap { grid-column: 2; grid-row: 1; }
.autopilot-campaign-rail-wrap { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--sp-2); min-width: 0; }
.autopilot-campaign-rail { display: flex; gap: var(--sp-2); min-width: 0; padding: 2px; overflow-x: auto; scrollbar-width: thin; }
.autopilot-campaign-rail__item { display: flex; align-items: center; flex: 0 0 min(230px, 72vw); gap: var(--sp-2); min-block-size: 58px; min-width: 0; padding: var(--sp-2) var(--sp-3); color: var(--text-primary); text-align: start; background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--r-2); cursor: pointer; transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease); }
.autopilot-campaign-rail__item:hover, .autopilot-campaign-rail__item:focus-visible { border-color: var(--accent-border); background: var(--accent-wash); box-shadow: var(--ring); outline: 0; }
.autopilot-campaign-rail__item.is-selected { border-color: var(--accent); background: var(--accent-wash); box-shadow: inset 0 0 0 1px var(--accent); }
.autopilot-campaign-rail__copy { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.autopilot-campaign-rail__copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.autopilot-campaign-rail__copy small { display: flex; align-items: center; gap: 5px; color: var(--text-tertiary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.autopilot-campaign-rail__nav { display: grid; place-items: center; inline-size: 32px; block-size: 32px; color: var(--accent); background: var(--bg-surface); border: 1px solid var(--accent-border); border-radius: 50%; cursor: pointer; }
.autopilot-campaign-rail__nav:hover, .autopilot-campaign-rail__nav:focus-visible { background: var(--accent-wash); box-shadow: var(--ring); outline: 0; }
.autopilot-flow-panels { display: grid; gap: var(--sp-3); }
.autopilot-flow-panel { display: grid; gap: var(--sp-4); min-width: 0; padding: var(--sp-5) var(--sp-6); background: var(--panel); border: 1px solid var(--border-strong); border-radius: var(--r-3); box-shadow: var(--elev-1); animation: autopilot-flow-panel-enter var(--dur) var(--ease); }
.autopilot-flow-panel[hidden] { display: none; }
@keyframes autopilot-flow-panel-enter { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.autopilot-flow-panel__header { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); }
.autopilot-flow-panel__identity { display: flex; align-items: center; gap: var(--sp-3); min-width: 0; }
.autopilot-flow-panel__identity h2 { margin: 2px 0 3px; color: var(--text-primary); font-size: var(--text-xl); overflow-wrap: anywhere; }
.autopilot-flow-panel__identity p { margin: 0; overflow-wrap: anywhere; }
.autopilot-flow-panel__actions { display: flex; align-items: center; gap: var(--sp-2); flex: none; }
.autopilot-flow-avatar { position: relative; display: grid; place-items: center; inline-size: 40px; block-size: 40px; flex: none; overflow: hidden; color: var(--text-on-accent); background: var(--accent); border-radius: 50%; font-size: var(--text-sm); font-weight: 800; }
.autopilot-flow-avatar img { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; object-fit: cover; }
.autopilot-flow-avatar--lg { inline-size: 56px; block-size: 56px; font-size: var(--text-lg); }
.autopilot-flow-canvas { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr); align-items: start; gap: var(--sp-3); min-width: 0; padding-block: var(--sp-4); }
.autopilot-flow-stage { display: grid; justify-items: center; align-content: start; align-self: start; gap: 7px; min-width: 0; min-block-size: 190px; padding: 0 var(--sp-2); text-align: center; background: transparent; border: 0; }
.autopilot-flow-stage__label { color: var(--text-tertiary); font-size: var(--text-xs); font-weight: 800; letter-spacing: var(--tracking-label); text-transform: uppercase; }
.autopilot-flow-stage__visual { display: grid; place-items: center; min-block-size: 112px; }
.autopilot-flow-stage__avatar--large, .autopilot-flow-stage__surface-icon, .autopilot-flow-stage__rule-icon { display: grid; place-items: center; inline-size: 104px; block-size: 104px; color: var(--accent); background: var(--accent-wash); border: 1px solid var(--accent-border); border-radius: 50%; box-shadow: 0 0 0 7px var(--accent-wash); }
.autopilot-flow-stage__avatar--large { position: relative; overflow: hidden; color: var(--text-on-accent); background: var(--accent); font-size: var(--text-xl); }
.autopilot-flow-stage__avatar--large img { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; object-fit: cover; }
.autopilot-flow-stage__surface-icon svg, .autopilot-flow-stage__rule-icon svg { inline-size: 34px; block-size: 34px; }
.autopilot-flow-stage__rule-icon { color: var(--status-warning); background: var(--status-warning-wash); border-color: var(--status-warning-border); box-shadow: 0 0 0 7px var(--status-warning-wash); }
.autopilot-flow-stage strong { max-inline-size: 100%; color: var(--text-primary); overflow-wrap: anywhere; }
.autopilot-flow-stage small { max-inline-size: 100%; color: var(--text-tertiary); overflow-wrap: anywhere; }
.autopilot-flow-canvas__connector { display: grid; place-items: center; align-self: center; inline-size: 38px; block-size: 38px; color: var(--accent); }
.autopilot-flow-canvas__connector svg { inline-size: 27px; block-size: 27px; }
.autopilot-flow-action-tray { display: flex; justify-content: center; gap: var(--sp-2); min-block-size: 112px; padding-block-start: 12px; }
.autopilot-flow-action { display: grid; align-content: center; justify-items: center; gap: 6px; inline-size: 62px; block-size: 62px; color: var(--accent); background: var(--bg-surface); border: 1px solid var(--accent-border); border-radius: 50%; }
.autopilot-flow-action svg { inline-size: 24px; block-size: 24px; }
.autopilot-flow-action small { max-inline-size: 58px; color: var(--text-secondary); font-size: var(--text-2xs); line-height: 1.15; overflow-wrap: anywhere; }
.autopilot-flow-stage--then > strong { margin-block-start: 0; }
.autopilot-flow-outcomes { min-width: 0; padding-block-start: var(--sp-3); border-block-start: 1px solid var(--border-subtle); }
.autopilot-flow-outcomes > header { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding-block-end: var(--sp-2); }
.autopilot-flow-outcomes h3 { margin: 2px 0 0; color: var(--text-primary); font-size: var(--text-base); }
.autopilot-flow-outcome-timeline { display: flex; align-items: stretch; min-width: 0; margin: 0; padding: var(--sp-2) 0; list-style: none; overflow-x: auto; scrollbar-width: thin; }
.autopilot-flow-outcome-node { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; flex: 1 1 0; gap: var(--sp-2); min-inline-size: 150px; padding: var(--sp-2) var(--sp-3); background: transparent; border: 0; }
.autopilot-flow-outcome-node__icon { display: grid; place-items: center; inline-size: 38px; block-size: 38px; flex: none; color: var(--text-tertiary); background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: 50%; }
.autopilot-flow-outcome-node__icon svg { inline-size: 20px; block-size: 20px; }
.autopilot-flow-outcome-node.is-confirmed .autopilot-flow-outcome-node__icon { color: var(--status-live); background: var(--status-live-wash); border-color: var(--status-live-border); }
.autopilot-flow-outcome-node strong, .autopilot-flow-outcome-node small, .autopilot-flow-outcome-node time { display: block; min-width: 0; overflow-wrap: anywhere; }
.autopilot-flow-outcome-node small, .autopilot-flow-outcome-node time { color: var(--text-tertiary); font-size: var(--text-xs); }
.autopilot-flow-outcome-node time { direction: ltr; }
.autopilot-flow-outcome-node--credits .autopilot-flow-outcome-node__icon { color: var(--accent); background: var(--accent-wash); border-color: var(--accent-border); }
.autopilot-flow-outcome-connector { display: grid; place-items: center; align-self: center; flex: 0 0 36px; color: var(--accent-border); }
.autopilot-flow-outcome-connector svg { inline-size: 20px; block-size: 20px; }
.autopilot-flow-meta { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-3); color: var(--text-tertiary); font-size: var(--text-xs); }
.autopilot-flow-meta .chip { font-size: var(--text-xs); }
.autopilot-flow-panel__footer { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding-block-start: var(--sp-3); border-block-start: 1px solid var(--border-subtle); }
.autopilot-flow-panel__stats { display: flex; flex-wrap: wrap; gap: var(--sp-4); }
.autopilot-flow-panel__stats span { display: grid; gap: 2px; min-width: 54px; }
.autopilot-flow-panel__stats strong { color: var(--text-primary); font-size: var(--text-lg); line-height: 1; }
.autopilot-flow-panel__stats small { color: var(--text-tertiary); font-size: var(--text-2xs); }
.autopilot-flow-panel__state-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--sp-2); }
@media (max-width: 980px) { .autopilot-campaign-toolbar { grid-template-columns: minmax(0, 1fr); } .autopilot-campaign-toolbar .autopilot-campaign-rail-wrap { grid-column: 1; grid-row: 2; } .autopilot-flow-canvas { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); } .autopilot-flow-stage--then { grid-column: 1 / -1; } }
@media (max-width: 760px) { .autopilot-flow-panel { padding: var(--sp-4); } .autopilot-flow-panel__header { align-items: stretch; flex-direction: column; } .autopilot-flow-canvas { display: flex; align-items: center; flex-direction: column; gap: var(--sp-2); } .autopilot-flow-stage { min-block-size: 0; padding-block: var(--sp-2); } .autopilot-flow-canvas__connector { transform: rotate(90deg); } .autopilot-flow-outcomes > header { align-items: flex-start; flex-direction: column; } .autopilot-flow-panel__footer { align-items: stretch; flex-direction: column; } .autopilot-flow-panel__state-actions { justify-content: flex-start; } }
@media (max-width: 640px) { .autopilot-campaign-toolbar { padding: var(--sp-3); } .autopilot-campaign-toolbar__filter { align-items: stretch; } .autopilot-campaign-rail__item { flex-basis: min(220px, 80vw); } .autopilot-flow-stage__avatar--large, .autopilot-flow-stage__surface-icon, .autopilot-flow-stage__rule-icon { inline-size: 92px; block-size: 92px; } .autopilot-flow-outcome-node { min-inline-size: 178px; } .autopilot-flow-panel__state-actions > * { flex: 1 1 auto; } }
@media (prefers-reduced-motion: reduce) { .autopilot-flow-panel, .autopilot-campaign-rail__item { animation: none; transition: none; } }

*/
/* Reply Autopilot campaign ledger: dense, plain-spoken rows keep the live operational facts scannable. */
.autopilot-ledger { display: flex; min-width: 0; min-height: calc(100vh - 250px); flex-direction: column; margin-block-end: var(--sp-4); background: var(--bg-surface); border: 1px solid var(--border-subtle); }
.autopilot-ledger__data-as-of { color: var(--text-tertiary); font-size: var(--text-xs); white-space: nowrap; }
.page-header .autopilot-ledger__top-actions { flex-direction: column; align-items: flex-end; gap: var(--sp-1); }
.page-header .autopilot-ledger__top-actions .autopilot-ledger__data-as-of { order: 2; }
.autopilot-ledger__toolbar { display: grid; grid-template-columns: minmax(280px, 1.55fr) repeat(3, minmax(150px, 1fr)) minmax(112px, auto) 42px; gap: var(--sp-3); align-items: end; min-height: 0; padding: 20px; background: var(--bg-surface); border-block-end: 1px solid var(--border-subtle); }
.autopilot-ledger__search, .autopilot-ledger__filter { display: grid; gap: 5px; min-width: 0; }
.autopilot-ledger__search { position: relative; }
.autopilot-ledger__search > span:first-child { position: absolute; inset-inline-start: auto; inset-inline-end: 12px; inset-block-end: 11px; color: var(--text-tertiary); pointer-events: none; }
.autopilot-ledger__search svg { inline-size: 18px; block-size: 18px; }
.autopilot-ledger__search input { inline-size: 100%; block-size: 40px; padding-inline: 12px 38px; color: var(--text-primary); background: var(--bg-surface); border: 1px solid var(--border-strong); border-radius: var(--r-1); font: inherit; text-align: start; }
.autopilot-ledger__search input:focus, .autopilot-ledger__filter .select:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.autopilot-ledger__filter { position: relative; }
.autopilot-ledger__filter > span { position: absolute; inset-block-start: -7px; inset-inline-start: 10px; z-index: 1; padding-inline: 3px; color: var(--text-tertiary); background: var(--bg-surface); font-size: var(--text-2xs); font-weight: 600; line-height: 1; letter-spacing: 0; text-transform: none; }
.autopilot-ledger__filter .select { inline-size: 100%; min-inline-size: 0; block-size: 40px; padding-block-start: 5px; color: var(--text-primary); background: var(--bg-surface); }
.autopilot-ledger__advanced { position: relative; min-width: 0; }
.autopilot-ledger__advanced-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-width: 104px; block-size: 40px; padding-inline: 12px; color: var(--text-primary); background: var(--bg-surface); border: 1px solid var(--border-strong); border-radius: var(--r-1); cursor: pointer; list-style: none; }
.autopilot-ledger__advanced-toggle::-webkit-details-marker { display: none; }
.autopilot-ledger__advanced-toggle:hover, .autopilot-ledger__advanced-toggle:focus-visible { border-color: var(--accent); box-shadow: var(--ring); outline: 0; }
.autopilot-ledger__advanced-toggle svg { inline-size: 16px; block-size: 16px; }
.autopilot-ledger__advanced-panel { position: absolute; inset-block-start: calc(100% + 8px); inset-inline-end: 0; z-index: 4; min-width: 220px; padding: var(--sp-3); background: var(--bg-surface); border: 1px solid var(--border-strong); border-radius: var(--r-1); box-shadow: var(--elev-2); }
.autopilot-ledger__advanced-panel .autopilot-ledger__filter > span { background: var(--bg-surface); }
.autopilot-ledger__gear { display: grid; place-items: center; inline-size: 42px; block-size: 40px; color: var(--text-secondary); background: var(--bg-surface); border: 1px solid var(--border-strong); border-radius: var(--r-1); cursor: pointer; }
.autopilot-ledger__gear:hover, .autopilot-ledger__gear:focus-visible { color: var(--accent); border-color: var(--accent); box-shadow: var(--ring); outline: 0; }
.autopilot-ledger__gear svg { inline-size: 18px; block-size: 18px; }
.autopilot-ledger__filter-button { display: none; }
.autopilot-ledger__filter-button:hover, .autopilot-ledger__filter-button:focus-visible { color: var(--accent); border-color: var(--accent); box-shadow: var(--ring); outline: 0; }
.autopilot-ledger__filter-button svg { inline-size: 18px; block-size: 18px; }
.autopilot-ledger__table-wrap { flex: 1 1 auto; min-width: 0; overflow-x: auto; }
.autopilot-ledger__table { width: 100%; min-width: 1110px; border-collapse: collapse; table-layout: fixed; }
.autopilot-ledger__table th { height: 44px; padding: 0 var(--sp-3); color: var(--text-tertiary); border-block-end: 1px solid var(--border-subtle); font-size: var(--text-2xs); font-weight: 800; letter-spacing: .04em; text-align: start; text-transform: uppercase; white-space: nowrap; }
.autopilot-ledger__table th > span { display: inline-flex; inline-size: 13px; block-size: 13px; margin-inline-start: 3px; vertical-align: -2px; }
.autopilot-ledger__table th > span svg { inline-size: 100%; block-size: 100%; }
.autopilot-ledger__sort { color: var(--accent); }
.autopilot-ledger__info { color: var(--text-tertiary); }
.autopilot-ledger__table th:nth-child(1) { width: 21%; }
.autopilot-ledger__table th:nth-child(2) { width: 11%; }
.autopilot-ledger__table th:nth-child(3) { width: 9%; }
.autopilot-ledger__table th:nth-child(4) { width: 6%; text-align: center; }
.autopilot-ledger__table th:nth-child(5) { width: 8%; text-align: center; }
.autopilot-ledger__table th:nth-child(6) { width: 7%; text-align: center; }
.autopilot-ledger__table th:nth-child(7) { width: 8%; text-align: center; }
.autopilot-ledger__table th:nth-child(8) { width: 10%; }
.autopilot-ledger__table th:nth-child(9) { width: 20%; }
.autopilot-ledger__row { height: 92px; border-block-end: 1px solid var(--border-subtle); }
.autopilot-ledger__row[hidden], .autopilot-ledger__detail[hidden] { display: none; }
.autopilot-ledger__row:hover { background: var(--bg-surface-2); }
.autopilot-ledger__row td { padding: var(--sp-3); color: var(--text-secondary); font-size: var(--text-sm); vertical-align: middle; }
.autopilot-ledger__campaign { min-width: 0; }
.autopilot-ledger__disclosure { display: grid; grid-template-columns: 16px 56px minmax(0, 1fr); align-items: center; gap: var(--sp-2); width: 100%; min-width: 0; padding: 0; color: inherit; background: transparent; border: 0; font: inherit; text-align: start; cursor: pointer; }
.autopilot-ledger__disclosure:focus-visible { outline: none; border-radius: var(--r-1); box-shadow: var(--ring); }
.autopilot-ledger__chevron { display: grid; place-items: center; color: var(--accent); transition: transform var(--dur-fast) var(--ease); }
.autopilot-ledger__chevron svg { inline-size: 18px; block-size: 18px; }
.autopilot-ledger__row.is-expanded .autopilot-ledger__chevron { transform: rotate(90deg); }
.autopilot-ledger__avatar { position: relative; display: grid; place-items: center; inline-size: 56px; block-size: 56px; overflow: hidden; color: var(--accent-ink); background: var(--accent-wash); border: 1px solid var(--accent-border); border-radius: 50%; font-weight: 800; }
.autopilot-ledger__avatar img { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; object-fit: cover; }
.autopilot-ledger__campaign-copy { display: grid; gap: 3px; min-width: 0; }
.autopilot-ledger__campaign-copy strong, .autopilot-ledger__campaign-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.autopilot-ledger__campaign-copy strong { color: var(--text-primary); font-size: var(--text-sm); }
.autopilot-ledger__campaign-copy small { color: var(--text-tertiary); font-size: var(--text-xs); }
.autopilot-ledger__campaign-copy small:last-child { display: inline-flex; align-items: center; gap: 4px; }
.autopilot-ledger__campaign-copy small:last-child svg { inline-size: 13px; block-size: 13px; flex: none; }
.autopilot-ledger__content-type { display: inline-flex; align-items: center; gap: 6px; color: var(--text-secondary); }
.autopilot-ledger__content-type svg { inline-size: 18px; block-size: 18px; flex: none; color: var(--text-tertiary); }
.autopilot-ledger__status { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.autopilot-ledger__status--live { color: var(--status-live); }
.autopilot-ledger__status--warn { color: var(--status-warning); }
.autopilot-ledger__status--bad { color: var(--status-failed); }
.autopilot-ledger__status--idle { color: var(--text-secondary); }
.autopilot-ledger__number { color: var(--text-primary) !important; font-family: var(--font-mono); text-align: center; }
.autopilot-ledger__checked { color: var(--text-secondary); font-size: var(--text-xs) !important; line-height: 1.45; white-space: nowrap; }
.autopilot-ledger__actions { display: flex; align-items: center; justify-content: flex-start; gap: 6px; min-width: 0; white-space: nowrap; }
.autopilot-ledger__actions .btn { min-height: 32px; padding-inline: 10px; font-size: var(--text-xs); }
.autopilot-ledger__actions .btn-ghost, .autopilot-ledger__pagination .btn-ghost { background: var(--bg-surface); }
.autopilot-ledger__actions .btn-danger { color: var(--status-failed); background: transparent; border-color: var(--status-failed-border); }
.autopilot-ledger__actions .btn-danger:hover { color: var(--text-on-accent); background: var(--status-failed); }
.autopilot-ledger__detail td { padding: 0 14px 14px; border-block-end: 1px solid var(--border-subtle); }
.autopilot-ledger__activity { display: grid; grid-template-areas: "title metrics link" "timeline metrics link"; grid-template-columns: minmax(380px, 1.15fr) minmax(360px, 1fr) auto; grid-template-rows: auto 1fr; align-items: center; column-gap: 24px; row-gap: 10px; min-height: 132px; padding: 18px 20px; background: var(--bg-surface); border: 1px solid var(--border-subtle); border-inline-start: 3px solid var(--accent); border-radius: var(--r-1); }
.autopilot-ledger__activity-title { display: flex; grid-area: title; align-items: center; align-self: end; gap: 7px; color: var(--accent); font-size: var(--text-sm); }
.autopilot-ledger__activity-title svg { inline-size: 18px; block-size: 18px; flex: none; }
.autopilot-ledger__timeline { display: grid; grid-area: timeline; align-self: start; gap: 5px; margin: 0; padding: 0; padding-inline-start: 25px; list-style: none; }
.autopilot-ledger__timeline li { display: grid; grid-template-columns: 92px 22px minmax(0, 1fr); align-items: center; gap: 7px; min-width: 0; color: var(--text-secondary); font-size: var(--text-xs); }
.autopilot-ledger__timeline time { color: var(--text-tertiary); font-family: var(--font-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.autopilot-ledger__timeline-marker { display: grid; place-items: center; inline-size: 18px; block-size: 18px; color: var(--status-live); border: 1px solid var(--status-live); border-radius: 50%; }
.autopilot-ledger__timeline-marker svg { inline-size: 12px; block-size: 12px; }
.autopilot-ledger__timeline-empty { display: block !important; color: var(--text-tertiary) !important; }
.autopilot-ledger__activity-metrics { display: grid; grid-area: metrics; grid-template-columns: repeat(4, minmax(70px, 1fr)); align-content: center; align-self: stretch; min-width: 0; padding-block: 6px; border-inline-start: 1px solid var(--border-strong); }
.autopilot-ledger__activity-metrics > span { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; justify-items: center; gap: 3px 6px; padding-inline: var(--sp-3); text-align: center; }
.autopilot-ledger__metric-icon { display: grid; grid-column: 1; grid-row: 1; place-items: center; color: var(--text-secondary); font-style: normal; }
.autopilot-ledger__metric-icon svg { inline-size: 17px; block-size: 17px; }
.autopilot-ledger__activity-metrics span + span { border-inline-start: 1px solid var(--border-subtle); }
.autopilot-ledger__activity-metrics strong { grid-column: 2; grid-row: 1; color: var(--text-primary); font-family: var(--font-mono); font-size: var(--text-lg); line-height: 1; }
.autopilot-ledger__activity-metrics small { grid-column: 1 / -1; grid-row: 2; color: var(--text-tertiary); font-size: var(--text-2xs); white-space: nowrap; }
.autopilot-ledger__full-activity { display: inline-flex; grid-area: link; align-items: center; gap: 5px; color: var(--accent); font-size: var(--text-xs); font-weight: 700; text-decoration: none; white-space: nowrap; }
.autopilot-ledger__full-activity:hover { text-decoration: underline; }
.autopilot-ledger__full-activity svg { inline-size: 16px; block-size: 16px; }
.autopilot-ledger__footer { display: flex; align-items: center; gap: var(--sp-4); min-height: 56px; padding: var(--sp-3) var(--sp-4); color: var(--text-secondary); font-size: var(--text-xs); }
.autopilot-ledger__total { margin-inline-end: auto; }
.autopilot-ledger__rows-per-page { display: inline-flex; align-items: center; gap: var(--sp-2); white-space: nowrap; }
.autopilot-ledger__rows-per-page .select { block-size: 36px; min-inline-size: 70px; }
.autopilot-ledger__range { min-inline-size: 78px; text-align: center; white-space: nowrap; }
.autopilot-ledger__pagination { display: inline-flex; }
.autopilot-ledger__pagination .btn { inline-size: 42px; padding: 0; border-radius: 0; }
.autopilot-ledger__pagination .btn:first-child { border-start-start-radius: var(--r-1); border-end-start-radius: var(--r-1); }
.autopilot-ledger__pagination .btn:last-child { margin-inline-start: -1px; border-start-end-radius: var(--r-1); border-end-end-radius: var(--r-1); }
.autopilot-ledger__pagination .btn:disabled { cursor: not-allowed; opacity: .45; }
.autopilot-ledger__no-results { padding: var(--sp-6); color: var(--text-tertiary); text-align: center; }
@media (max-width: 1180px) { .autopilot-ledger__toolbar { grid-template-columns: minmax(220px, 1.5fr) repeat(2, minmax(130px, 1fr)); } .autopilot-ledger__filter-button { align-self: end; } .autopilot-ledger__activity { grid-template-areas: "title metrics" "timeline metrics" "link link"; grid-template-columns: minmax(320px, 1fr) minmax(320px, 1fr); } .autopilot-ledger__activity-metrics { border-block-start: 0; border-inline-start: 1px solid var(--border-strong); } .autopilot-ledger__full-activity { justify-self: end; } }
@media (max-width: 640px) { .autopilot-ledger__toolbar { grid-template-columns: minmax(0, 1fr); padding: var(--sp-3); } .autopilot-ledger__filter-button { inline-size: 100%; } .page-header .autopilot-ledger__top-actions { align-items: flex-end; width: 100%; } .autopilot-ledger__activity { grid-template-areas: "title" "timeline" "metrics" "link"; grid-template-columns: minmax(0, 1fr); padding: var(--sp-3); } .autopilot-ledger__timeline { padding-inline-start: 0; } .autopilot-ledger__activity-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); border-block-start: 1px solid var(--border-strong); border-inline-start: 0; } .autopilot-ledger__activity-metrics span:nth-child(-n+2) { padding-block-end: var(--sp-2); border-block-end: 1px solid var(--border-subtle); } .autopilot-ledger__activity-metrics span:nth-child(odd) { border-inline-start: 0; } .autopilot-ledger__full-activity { justify-self: start; } .autopilot-ledger__footer { align-items: flex-start; flex-wrap: wrap; gap: var(--sp-2); } .autopilot-ledger__total { flex-basis: 100%; } .autopilot-ledger__range { margin-inline-start: auto; } }
@media (prefers-reduced-motion: reduce) { .autopilot-ledger__chevron { transition: none; } }

/* Reply Autopilot campaign workspace: neutral surfaces keep attention on campaign state and actions. */
.autopilot-card-dashboard { container-type: inline-size; display: grid; align-content: start; gap: 20px; max-inline-size: 100%; min-width: 0; min-height: calc(100vh - 250px); margin-block-end: var(--sp-4); }
.autopilot-card-filters { display: grid; grid-template-columns: minmax(220px, 2fr) repeat(6, minmax(0, 1fr)) minmax(130px, auto); align-items: end; gap: var(--sp-3); max-inline-size: 100%; min-width: 0; padding: 20px; background: var(--bg-surface); border: 1px solid color-mix(in srgb, #6f8ca8 30%, var(--border-subtle)); border-radius: 16px; box-shadow: 0 8px 24px color-mix(in srgb, #42698c 9%, transparent); }
.autopilot-card-filter { display: grid; gap: 7px; min-width: 0; margin: 0; }
.autopilot-card-filter > span:first-child { color: color-mix(in srgb, #315779 78%, var(--text-tertiary)); font-size: var(--text-2xs); font-weight: 800; letter-spacing: var(--tracking-label); text-transform: uppercase; }
.autopilot-card-filter .select, .autopilot-card-filter__control { inline-size: 100%; min-inline-size: 0; block-size: 44px; }
.autopilot-card-filter .select { color: var(--text-primary); background-color: color-mix(in srgb, #2b75c4 3%, var(--bg-surface)); border-color: color-mix(in srgb, #6f8ca8 36%, var(--border-subtle)); border-radius: 10px; }
.autopilot-card-filter__control { position: relative; display: flex; align-items: center; }
.autopilot-card-filter__control > svg { position: absolute; z-index: 1; inset-inline-start: 13px; inline-size: 18px; block-size: 18px; color: #2b75c4; pointer-events: none; }
.autopilot-card-filter__control input { inline-size: 100%; block-size: 44px; padding-inline: 42px 12px; color: var(--text-primary); background: color-mix(in srgb, #2b75c4 3%, var(--bg-surface)); border: 1px solid color-mix(in srgb, #6f8ca8 36%, var(--border-subtle)); border-radius: 10px; font: inherit; }
.autopilot-card-filter__control input:focus, .autopilot-card-filter .select:focus { outline: 0; border-color: #2b75c4; box-shadow: 0 0 0 3px color-mix(in srgb, #2b75c4 18%, transparent); }
.autopilot-card-filters__clear { block-size: 44px; color: #315779; background: color-mix(in srgb, #2b75c4 4%, var(--bg-surface)); border-color: color-mix(in srgb, #6f8ca8 36%, var(--border-subtle)); white-space: nowrap; }
.autopilot-card-dashboard .autopilot-campaign-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; gap: 20px; inline-size: 100%; max-inline-size: 100%; min-width: 0; }
.autopilot-card-dashboard .autopilot-campaign-card { --campaign-accent: #2b75c4; inline-size: 100%; block-size: 100%; max-inline-size: 100%; min-width: 0; overflow: hidden; gap: var(--sp-4); padding: 20px; background: var(--bg-surface); border: 1px solid color-mix(in srgb, #6f8ca8 34%, var(--border-subtle)); border-block-start: 3px solid var(--campaign-accent); border-radius: 16px; box-shadow: 0 10px 28px color-mix(in srgb, #42698c 11%, transparent); }
.autopilot-card-dashboard .autopilot-campaign-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--campaign-accent) 48%, var(--border-subtle)); box-shadow: 0 14px 32px color-mix(in srgb, #42698c 15%, transparent); }
.autopilot-campaign-card--active { --campaign-accent: #278761 !important; }
.autopilot-campaign-card--paused { --campaign-accent: #c4811a !important; }
.autopilot-campaign-card--stopped { --campaign-accent: #c84f5d !important; }
.autopilot-campaign-card[hidden] { display: none; }
.autopilot-campaign-card__header { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-3); min-width: 0; }
.autopilot-card-dashboard .autopilot-campaign-card__identity { display: flex; align-items: center; flex: 1 1 auto; gap: var(--sp-3); min-width: 0; }
.autopilot-campaign-card__identity .data-avatar { inline-size: 56px; block-size: 56px; flex: none; color: #1f6fc7; background: color-mix(in srgb, #2b75c4 9%, var(--bg-surface)); border: 1px solid color-mix(in srgb, #2b75c4 38%, var(--border-subtle)); box-shadow: 0 5px 14px color-mix(in srgb, #42698c 14%, transparent); }
.autopilot-campaign-card__copy { display: grid; gap: 3px; min-width: 0; }
.autopilot-campaign-card__copy h2 { overflow: hidden; margin: 0; color: var(--text-primary); font-family: var(--font-display); font-size: var(--text-lg); line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.autopilot-campaign-card__copy .eyebrow { color: #1f6fc7; font-weight: 700; }
.autopilot-campaign-card__uid { display: inline-flex; align-items: center; gap: 5px; overflow: hidden; color: var(--text-tertiary); font-family: var(--font-mono); font-size: var(--text-xs); text-overflow: ellipsis; white-space: nowrap; }
.autopilot-campaign-card__uid svg { inline-size: 13px; block-size: 13px; flex: none; }
.autopilot-card-dashboard .autopilot-campaign-card__top-end { display: flex; align-items: center; align-self: flex-start; gap: var(--sp-2); max-inline-size: none; }
.autopilot-card-dashboard .autopilot-campaign-card__meta { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; padding: var(--sp-3); background: color-mix(in srgb, #2b75c4 4%, var(--bg-surface)); border-color: color-mix(in srgb, #6f8ca8 28%, var(--border-subtle)); border-radius: 12px; }
.autopilot-card-dashboard .autopilot-campaign-card__meta > span { gap: 5px; padding-inline: var(--sp-3); }
.autopilot-card-dashboard .autopilot-campaign-card__meta > span + span { border-inline-start-color: color-mix(in srgb, #6f8ca8 28%, var(--border-subtle)); }
.autopilot-card-dashboard .autopilot-campaign-card__meta small { color: color-mix(in srgb, #315779 78%, var(--text-tertiary)); font-weight: 700; letter-spacing: .03em; text-transform: uppercase; }
.autopilot-card-dashboard .autopilot-campaign-card__meta strong { color: var(--text-primary); font-size: var(--text-sm); }
.autopilot-campaign-card__meta-icon { display: inline-flex; align-items: center; gap: 6px; }
.autopilot-campaign-card__meta-icon svg { inline-size: 16px; block-size: 16px; flex: none; color: #2b75c4; }
.autopilot-card-dashboard .autopilot-campaign-card__metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 0; overflow: visible; background: transparent; border: 0; border-radius: 0; }
.autopilot-card-dashboard .autopilot-campaign-card__metric { display: grid; grid-template-columns: auto auto; align-items: center; justify-content: center; gap: 4px 8px; min-width: 0; padding: 12px 8px; background: color-mix(in srgb, #2b75c4 2.5%, var(--bg-surface)); border: 1px solid color-mix(in srgb, #6f8ca8 26%, var(--border-subtle)); border-radius: 10px; }
.autopilot-card-dashboard .autopilot-campaign-card__metric + .autopilot-campaign-card__metric { border-inline-start: 1px solid color-mix(in srgb, #6f8ca8 26%, var(--border-subtle)); }
.autopilot-campaign-card__metric i { display: grid; grid-column: 1; grid-row: 1; place-items: center; color: #2b75c4; font-style: normal; }
.autopilot-campaign-card__metric--dm i { color: #20848c; }
.autopilot-campaign-card__metric--leads i { color: #278761; }
.autopilot-campaign-card__metric--credits i { color: #b87716; }
.autopilot-campaign-card__metric i svg { inline-size: 18px; block-size: 18px; }
.autopilot-campaign-card__metric strong { grid-column: 2; grid-row: 1; color: var(--text-primary); font-family: var(--font-mono); font-size: var(--text-xl); line-height: 1; }
.autopilot-campaign-card__metric small { grid-column: 1 / -1; grid-row: 2; overflow: hidden; color: var(--text-tertiary); font-size: var(--text-2xs); text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.autopilot-card-dashboard .autopilot-campaign-card__diagnostics { min-height: 28px; align-items: center; }
.autopilot-card-dashboard .autopilot-campaign-card__diagnostics .chip { padding: 5px 9px; color: #315779; background: color-mix(in srgb, #2b75c4 6%, var(--bg-surface)); border-color: color-mix(in srgb, #6f8ca8 30%, var(--border-subtle)); font-size: var(--text-2xs); }
.autopilot-card-dashboard .autopilot-campaign-card__diagnostics .chip.bad { color: var(--status-failed); background: var(--status-failed-wash); border-color: var(--status-failed-border); }
.autopilot-card-dashboard .autopilot-campaign-card__heartbeat { justify-content: space-between; gap: var(--sp-3); min-height: 42px; padding: 10px 12px; color: var(--text-tertiary); background: color-mix(in srgb, #2b75c4 2.5%, var(--bg-surface)); border: 1px solid color-mix(in srgb, #6f8ca8 24%, var(--border-subtle)); border-radius: 10px; font-size: var(--text-xs); }
.autopilot-campaign-card__heartbeat > span { display: inline-flex; align-items: center; gap: 7px; }
.autopilot-campaign-card__heartbeat svg { inline-size: 16px; block-size: 16px; color: #2b75c4; }
.autopilot-campaign-card__heartbeat strong { color: var(--text-secondary); font-family: var(--font-mono); font-weight: 500; white-space: nowrap; }
.autopilot-card-dashboard .autopilot-campaign-card__actions { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-2); max-inline-size: 100%; min-width: 0; margin-block-start: auto; padding-block-start: var(--sp-3); border-block-start: 1px solid color-mix(in srgb, #6f8ca8 24%, var(--border-subtle)); }
.autopilot-card-dashboard .autopilot-campaign-card__actions form { display: flex; }
.autopilot-card-dashboard .autopilot-campaign-card__actions .btn { min-inline-size: 92px; min-block-size: 40px; justify-content: center; font-weight: 700; box-shadow: none; }
.autopilot-card-dashboard .autopilot-campaign-card__actions > * { max-inline-size: 100%; }
.autopilot-card-dashboard .autopilot-campaign-card__action--activity { color: var(--accent-ink); background: var(--bg-surface); border-color: var(--accent-border); }
.autopilot-card-dashboard .autopilot-campaign-card__action--activity:hover, .autopilot-card-dashboard .autopilot-campaign-card__action--activity:focus-visible { color: var(--accent-hover); background: var(--accent-wash); border-color: var(--accent); }
.autopilot-card-dashboard .autopilot-campaign-card__action--pause { color: var(--status-warn); background: var(--status-warn-wash); border-color: var(--status-warn-border); }
.autopilot-card-dashboard .autopilot-campaign-card__action--pause:hover, .autopilot-card-dashboard .autopilot-campaign-card__action--pause:focus-visible { color: var(--status-warn); background: color-mix(in srgb, var(--status-warn) 17%, var(--bg-surface)); border-color: var(--status-warn); }
.autopilot-card-dashboard .autopilot-campaign-card__action--primary { color: var(--text-on-accent); background: var(--accent-solid); border-color: var(--accent-solid); }
.autopilot-card-dashboard .autopilot-campaign-card__action--primary:hover, .autopilot-card-dashboard .autopilot-campaign-card__action--primary:focus-visible { color: var(--text-on-accent); background: var(--accent); border-color: var(--accent); }
.autopilot-card-dashboard .autopilot-campaign-card__action--stop { color: #b42336; background: color-mix(in srgb, #d54859 11%, var(--bg-surface)); border: 0; border-radius: 0; clip-path: var(--chamfer-sm); box-shadow: inset 0 0 0 1px color-mix(in srgb, #d54859 68%, var(--border-subtle)); }
.autopilot-card-dashboard .autopilot-campaign-card__action--stop:hover, .autopilot-card-dashboard .autopilot-campaign-card__action--stop:focus-visible { color: #fff; background: #b93645; box-shadow: inset 0 0 0 1px #b93645, 0 5px 14px color-mix(in srgb, #b93645 22%, transparent); }
.autopilot-card-dashboard .autopilot-campaign-card__activity-toggle { margin-inline-start: auto; color: var(--accent-ink); background: var(--bg-surface); border-color: var(--accent-border); }
.autopilot-card-dashboard .autopilot-campaign-card__activity-toggle:hover, .autopilot-card-dashboard .autopilot-campaign-card__activity-toggle:focus-visible { color: var(--accent-hover); background: var(--accent-wash); border-color: var(--accent); }
.autopilot-campaign-card__activity-toggle span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.autopilot-campaign-card__activity-toggle i { display: grid; place-items: center; font-style: normal; transition: transform var(--dur-fast) var(--ease); }
.autopilot-campaign-card__activity-toggle i svg { inline-size: 15px; block-size: 15px; }
.autopilot-campaign-card.is-expanded .autopilot-campaign-card__activity-toggle i { transform: rotate(180deg); }
.autopilot-campaign-card__activity { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: var(--sp-3); padding: var(--sp-3); background: color-mix(in srgb, #2b75c4 5%, var(--bg-surface)); border: 1px solid color-mix(in srgb, #2b75c4 28%, var(--border-subtle)); border-inline-start: 3px solid #2b75c4; border-radius: 10px; }
.autopilot-campaign-card__activity[hidden] { display: none; }
.autopilot-campaign-card__timeline { display: grid; gap: 7px; min-width: 0; margin: 0; padding: 0; list-style: none; }
.autopilot-campaign-card__timeline li { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; align-items: center; gap: var(--sp-2); min-width: 0; color: var(--text-secondary); font-size: var(--text-xs); }
.autopilot-campaign-card__timeline time { color: var(--text-tertiary); font-family: var(--font-mono); white-space: nowrap; }
.autopilot-campaign-card__timeline-marker { display: grid; place-items: center; inline-size: 18px; block-size: 18px; color: var(--status-live); background: var(--bg-surface); border: 1px solid var(--status-live); border-radius: 50%; }
.autopilot-campaign-card__timeline-marker svg { inline-size: 11px; block-size: 11px; }
.autopilot-campaign-card__timeline-empty { display: block !important; color: var(--text-tertiary) !important; }
.autopilot-campaign-card__full-activity { display: inline-flex; align-items: center; gap: 5px; color: #1f6fc7; font-size: var(--text-xs); font-weight: 700; text-decoration: none; white-space: nowrap; }
.autopilot-campaign-card__full-activity:hover { text-decoration: underline; }
.autopilot-campaign-card__full-activity svg { inline-size: 15px; block-size: 15px; }
.autopilot-campaign-empty { display: grid; justify-items: center; gap: var(--sp-2); padding: var(--sp-7); color: var(--text-tertiary); background: var(--bg-surface); border: 1px dashed var(--border-strong); border-radius: var(--r-2); text-align: center; }
.autopilot-campaign-empty[hidden] { display: none; }
.autopilot-campaign-empty svg { inline-size: 28px; block-size: 28px; color: #2b75c4; }
.autopilot-card-pagination { display: flex; align-items: center; gap: var(--sp-4); min-height: 64px; padding: var(--sp-3) var(--sp-4); color: var(--text-secondary); background: var(--bg-surface); border: 1px solid color-mix(in srgb, #6f8ca8 30%, var(--border-subtle)); border-radius: 14px; box-shadow: 0 6px 18px color-mix(in srgb, #42698c 7%, transparent); font-size: var(--text-xs); }
.autopilot-card-pagination .autopilot-ledger__total { margin-inline-end: auto; }
.autopilot-card-pagination__page-size { position: relative; display: inline-flex; align-items: center; }
.autopilot-card-pagination .autopilot-ledger__rows-per-page .select { inline-size: 96px; min-inline-size: 96px; padding-inline: 28px; appearance: none; -webkit-appearance: none; font-family: var(--font-mono); font-variant-numeric: tabular-nums; text-align: center; text-align-last: center; }
.autopilot-card-pagination .autopilot-ledger__rows-per-page .select option { text-align: center; }
.autopilot-card-pagination__page-size i { position: absolute; inset-inline-end: 12px; display: grid; place-items: center; color: var(--text-tertiary); pointer-events: none; }
.autopilot-card-pagination__page-size i svg { inline-size: 14px; block-size: 14px; }
@container (max-width: 1400px) { .autopilot-card-filters { grid-template-columns: repeat(4, minmax(0, 1fr)); } .autopilot-card-filter--search, .autopilot-card-filter--identity { grid-column: span 2; } .autopilot-card-filters__clear { inline-size: 100%; } }
@container (max-width: 1180px) { .autopilot-card-dashboard .autopilot-campaign-grid { grid-template-columns: minmax(0, 1fr); } }
@container (max-width: 760px) { .autopilot-card-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container (max-width: 520px) { .autopilot-card-filters { grid-template-columns: minmax(0, 1fr); padding: var(--sp-3); } .autopilot-card-filter--search, .autopilot-card-filter--identity { grid-column: auto; } }
@media (max-width: 1500px) { .autopilot-card-filters { grid-template-columns: repeat(4, minmax(0, 1fr)); } .autopilot-card-filter--search, .autopilot-card-filter--identity { grid-column: span 2; } .autopilot-card-filters__clear { inline-size: 100%; } }
@media (max-width: 900px) { .autopilot-card-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); } .autopilot-card-dashboard .autopilot-campaign-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) { .autopilot-card-filters { grid-template-columns: minmax(0, 1fr); padding: var(--sp-3); } .autopilot-card-filter--search, .autopilot-card-filter--identity { grid-column: auto; } .autopilot-card-dashboard .autopilot-campaign-card { padding: var(--sp-3); } .autopilot-campaign-card__header { align-items: stretch; flex-direction: column; } .autopilot-card-dashboard .autopilot-campaign-card__top-end { align-self: stretch; justify-content: space-between; } .autopilot-card-dashboard .autopilot-campaign-card__meta { grid-template-columns: minmax(0, 1fr); } .autopilot-card-dashboard .autopilot-campaign-card__meta > span + span { padding-block-start: var(--sp-2); border-block-start: 1px solid color-mix(in srgb, #6f8ca8 28%, var(--border-subtle)); border-inline-start: 0; } .autopilot-card-dashboard .autopilot-campaign-card__metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); } .autopilot-card-dashboard .autopilot-campaign-card__metric:nth-child(odd) { border-inline-start: 1px solid color-mix(in srgb, #6f8ca8 26%, var(--border-subtle)); } .autopilot-card-dashboard .autopilot-campaign-card__metric:nth-child(-n+2) { border-block-end: 1px solid color-mix(in srgb, #6f8ca8 26%, var(--border-subtle)); } .autopilot-card-dashboard .autopilot-campaign-card__heartbeat { align-items: flex-start; flex-direction: column; } .autopilot-campaign-card__activity-toggle { flex: 1 1 100%; justify-content: space-between; margin-inline-start: 0; } .autopilot-campaign-card__activity { grid-template-columns: minmax(0, 1fr); } .autopilot-campaign-card__full-activity { justify-self: start; } .autopilot-card-pagination { align-items: flex-start; flex-wrap: wrap; gap: var(--sp-2); } .autopilot-card-pagination .autopilot-ledger__total { flex-basis: 100%; } .autopilot-card-pagination .autopilot-ledger__range { margin-inline-start: auto; } }
@media (prefers-reduced-motion: reduce) { .autopilot-card-dashboard .autopilot-campaign-card, .autopilot-campaign-card__activity-toggle i { transition: none; } }
