/* =============================================================================
   Brunomag · Dashboard — Editorial Light Skin
   ---------------------------------------------------------------------------
   Aesthetic direction: editorial-refined ops console.
   - Surgical brand orange (#F05E22) on dominant cream/white surfaces
   - Fraunces (variable serif, opsz axis) for KPI numerals + drawer titles
   - Geist Sans for UI / nav / labels — fresh, technical, warm
   - Geist Mono for clock + tabular data accents
   - Pinyon Script for the logo "B" — recreates the cream script B from the logo
   - Sub-perceptible SVG grain on cream surfaces for paper-like depth
   ============================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,500;0,9..144,600;0,9..144,700;1,9..144,400;1,9..144,500;1,9..144,600;1,9..144,700&family=Geist:wght@300;400;500;600;700;800&family=Geist+Mono:wght@400;500;600&family=Pinyon+Script&display=swap');

:root {
  /* -------- Canonical Brunomag palette (extracted from logo) ----------------- */
  --bg: #FFFFFF;
  --surface: #EDE6D3;        /* cream — slide / card / table surface (deeper than PPTX bg so it pops on white) */
  --surface-alt: #E5DDC5;    /* cream alt — hover / zebra (deeper still) */
  --ghost: #E8E8D8;          /* logo cream ghost — score-bar well, dividers */
  --border: #D2CBB8;         /* visible border on cream — strong enough to pop on white */
  --border-soft: #E2DCCC;    /* hairline divider inside surfaces */
  --text: #000000;           /* pure black, logo light variant */
  --text-soft: #181818;      /* near-black badge / hover text */
  --muted: #666666;          /* helper text */
  --muted-soft: #8C8678;     /* whisper text on cream */
  --accent: #F05E22;         /* canonical brand orange */
  --accent-deep: #C84A18;    /* pressed orange */
  --accent-soft: rgba(240, 94, 34, 0.20);
  --accent-tint: #FCEBE2;
  --accent-tint-2: #FAE0D2;
  /* Status (kept honest, calibrated for cream surfaces) */
  --green: #1F8B3F;
  --yellow: #B57A0E;
  --red: #C5301F;
  --blue: #1E5BC6;
  --pill-green-bg: #E8F2EA;   --pill-green-bd: #C2DCC8;
  --pill-yellow-bg: #FAF1DA;  --pill-yellow-bd: #E8D6A6;
  --pill-red-bg: #F8E3E1;     --pill-red-bd: #E6BAB4;
  --pill-blue-bg: #E2EAF7;    --pill-blue-bd: #BCCBE7;
  --pill-muted-bg: #ECEAE2;   --pill-muted-bd: #D5D2C5;
  /* Typography */
  --ff-display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --ff-body: 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ff-mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --ff-script: 'Pinyon Script', 'Snell Roundhand', cursive;
  /* Motion */
  --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.42, 0.64, 1);
  /* Elevation */
  --shadow-1: 0 1px 2px rgba(0,0,0,0.06), 0 6px 18px -10px rgba(0,0,0,0.14);
  --shadow-2: 0 3px 6px rgba(0,0,0,0.08), 0 16px 36px -16px rgba(0,0,0,0.20);
  --shadow-pressed: inset 0 1px 2px rgba(0,0,0,0.10);
  /* Subtle paper grain — applied as a layered overlay */
  --grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.045 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* ------------------------------------------------------------------ Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background:
    radial-gradient(1200px 600px at 12% -10%, rgba(240, 94, 34, 0.045), transparent 60%),
    radial-gradient(900px 500px at 100% 110%, rgba(240, 94, 34, 0.03), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: var(--ff-body);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv11', 'ss01', 'ss03';
  font-variant-numeric: oldstyle-nums;
}

::selection { background: var(--accent-soft); color: var(--text); }

a { color: var(--accent); text-decoration: none; transition: color 150ms var(--ease-out); }
a:hover { color: var(--accent-deep); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }

button { font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* =========================================================== Header / Nav === */
header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 28px;
  padding: 14px 32px 14px 28px;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--border-soft);
}
header::after {
  /* Subtle orange thread at the very bottom of the header — brand signature */
  content: '';
  position: absolute;
  left: 28px; right: 28px; bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent) 12%, var(--accent) 18%, transparent 28%);
  opacity: 0.55;
  pointer-events: none;
}

/* ----------------------------------------------------- Brand wordmark badge --- */
.logo {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: var(--text);
  text-decoration: none;
  user-select: none;
}
.logo:hover { text-decoration: none; }
.logo-mark {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 28%, #F8784A 0%, var(--accent) 55%, #D8501C 100%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--ff-script);
  font-size: 32px;
  line-height: 1;
  color: var(--ghost);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.18), 0 0 1px rgba(255, 255, 255, 0.06);
  /* Concentric rings honoring the logo's scalloped border:
     near-black ring + cream gap + outer near-black hairline */
  box-shadow:
    inset 0 0 0 1px rgba(232, 232, 216, 0.4),
    0 0 0 1.5px var(--bg),
    0 0 0 3px var(--text-soft),
    0 4px 10px -5px rgba(240, 94, 34, 0.45);
  position: relative;
  transition: transform 320ms var(--ease-spring);
  padding-right: 1px; /* optical centering of script B */
  padding-bottom: 3px;
}
.logo:hover .logo-mark { transform: rotate(-7deg) scale(1.05); }
.logo-words { display: inline-flex; flex-direction: column; line-height: 1; gap: 3px; }
.logo-line {
  font-family: var(--ff-body);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: -0.2px;
  color: var(--text);
}
.logo-line em {
  font-style: italic;
  font-family: var(--ff-display);
  font-variation-settings: 'opsz' 144;
  font-weight: 500;
  letter-spacing: -0.3px;
  color: var(--text);
  font-size: 16.5px;
}
.logo-tagline {
  font-family: var(--ff-body);
  font-size: 9.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: var(--accent);
  display: inline-flex;
  gap: 5px;
  align-items: center;
}
.logo-tagline::before {
  content: '';
  width: 4px; height: 4px;
  background: var(--accent);
  border-radius: 50%;
  display: inline-block;
}

/* ---------------------------------------------------------------- Nav --- */
nav {
  display: flex;
  gap: 4px;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  margin-left: 8px;
}
nav a {
  position: relative;
  color: var(--muted);
  font-family: var(--ff-body);
  font-size: 11.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.85px;
  padding: 8px 10px 9px;
  border-radius: 6px;
  transition: color 160ms var(--ease-out), background 160ms var(--ease-out);
  text-decoration: none;
}
nav a::after {
  content: '';
  position: absolute;
  left: 50%;
  right: 50%;
  bottom: 4px;
  height: 1.5px;
  background: var(--accent);
  border-radius: 1px;
  transition: left 220ms var(--ease-out), right 220ms var(--ease-out), height 220ms var(--ease-out);
}
nav a:hover { color: var(--text); background: var(--surface); text-decoration: none; }
nav a:hover::after { left: 10px; right: 10px; }
nav a.active {
  color: var(--text);
  font-weight: 700;
}
nav a.active::after {
  left: 10px; right: 10px;
  height: 2.5px;
}

/* Index icon — small grid mark at the end of nav, links to /menu */
nav a.nav-index {
  font-family: ui-monospace, monospace;
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0;
  padding: 4px 9px 5px;
  margin-left: 6px;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  line-height: 1;
}
nav a.nav-index::after { display: none; }
nav a.nav-index:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-tint);
}
nav a.nav-index.active {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-tint);
}

/* Right cluster (clock + user) */
header > div:last-of-type { display: flex; align-items: center; gap: 14px; }

/* ============================================================ Sibling tabs === */
/* Second-level navigation: shows the pages inside the current department.
   Visible always (no hover dropdowns) so the user can see what's available. */
.sibling-tabs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  padding: 10px 32px 11px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 64px;
  z-index: 40;
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
}
.sibling-tabs-label {
  font-family: var(--ff-body);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: var(--muted);
  padding-right: 14px;
  margin-right: 6px;
  border-right: 1px solid var(--border);
}
.sibling-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 5px 11px 6px;
  border-radius: 6px;
  font-family: var(--ff-body);
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: color 140ms var(--ease-out), background 140ms var(--ease-out), border-color 140ms var(--ease-out);
  border: 1px solid transparent;
}
.sibling-tab:hover {
  color: var(--text);
  background: var(--bg);
  border-color: var(--border);
  text-decoration: none;
}
.sibling-tab.active {
  color: var(--text);
  background: var(--bg);
  border-color: var(--accent);
  font-weight: 600;
  box-shadow: 0 1px 0 rgba(240, 94, 34, 0.18) inset, 0 1px 4px -2px rgba(0,0,0,0.06);
}
.sibling-tab.active::before {
  content: '';
  display: inline-block;
  width: 5px; height: 5px;
  background: var(--accent);
  border-radius: 50%;
  margin-right: 7px;
  flex-shrink: 0;
}

/* ============================================================ Menu / index === */
.menu-hero {
  padding: 8px 0 4px;
  margin-bottom: 4px;
}
.menu-hero-eyebrow {
  font-family: var(--ff-body);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.menu-hero-eyebrow::before {
  content: '';
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.menu-hero-title {
  font-family: var(--ff-display);
  font-variation-settings: 'opsz' 144;
  font-weight: 600;
  font-size: 38px;
  line-height: 1.05;
  letter-spacing: -1px;
  color: var(--text);
  margin-bottom: 10px;
}
.menu-hero-title em {
  font-style: italic;
  color: var(--accent);
  font-weight: 500;
}
.menu-hero-sub {
  font-family: var(--ff-body);
  font-size: 14px;
  color: var(--muted);
  max-width: 580px;
  line-height: 1.5;
}

.dept-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}
.dept-card {
  position: relative;
  background:
    var(--grain),
    var(--surface);
  background-blend-mode: multiply, normal;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 22px 18px;
  box-shadow: var(--shadow-1);
  transition: transform 200ms var(--ease-out), box-shadow 200ms var(--ease-out), border-color 160ms var(--ease-out);
  overflow: hidden;
}
.dept-card::before {
  content: '';
  position: absolute;
  left: 0; top: 16px; bottom: 16px;
  width: 3px;
  background: var(--accent);
  border-radius: 2px;
}
.dept-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-2);
  border-color: var(--ghost);
}
.dept-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
  padding-left: 8px;
}
.dept-card-title {
  font-family: var(--ff-body);
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.3px;
  color: var(--text);
}
.dept-card-count {
  font-family: var(--ff-mono);
  font-size: 10.5px;
  color: var(--muted);
  letter-spacing: 0.2px;
}
.dept-card-blurb {
  font-family: var(--ff-body);
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.5;
  margin: 0 0 14px 8px;
}
.dept-page-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.dept-page {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 4px 14px;
  padding: 9px 10px 10px;
  border-radius: 8px;
  text-decoration: none;
  transition: background 140ms var(--ease-out), padding-left 180ms var(--ease-out);
  border: 1px solid transparent;
}
.dept-page-label {
  font-family: var(--ff-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.dept-page-desc {
  grid-column: 1;
  font-family: var(--ff-body);
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.4;
}
.dept-page-arrow {
  grid-column: 2;
  grid-row: 1;
  font-family: var(--ff-mono);
  color: var(--muted);
  font-size: 14px;
  transition: transform 200ms var(--ease-out), color 140ms var(--ease-out);
}
.dept-page:hover {
  background: var(--bg);
  border-color: var(--border-soft);
  padding-left: 14px;
  text-decoration: none;
}
.dept-page:hover .dept-page-label { color: var(--accent-deep); }
.dept-page:hover .dept-page-arrow {
  transform: translateX(3px);
  color: var(--accent);
}

/* ============================================================ OPS hero === */
.ops-hero {
  padding: 4px 0 8px;
  position: relative;
  max-width: 740px;
}
.ops-hero-badge {
  display: inline-block;
  font-family: var(--ff-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.2px;
  padding: 3px 9px;
  background: var(--accent);
  color: #FFFFFF;
  border-radius: 4px;
  margin-bottom: 14px;
  box-shadow: 0 2px 8px -3px rgba(240, 94, 34, 0.5);
}
.ops-hero-title {
  font-family: var(--ff-display);
  font-variation-settings: 'opsz' 144;
  font-weight: 600;
  font-size: 40px;
  line-height: 1.05;
  letter-spacing: -1px;
  color: var(--text);
  margin-bottom: 14px;
}
.ops-hero-title em {
  font-style: italic;
  color: var(--accent);
  font-weight: 500;
}
.ops-hero-sub {
  font-family: var(--ff-body);
  font-size: 14px;
  color: var(--text-soft);
  line-height: 1.55;
  margin-bottom: 16px;
}
.ops-hero-cta {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

/* Spec preview block */
.spec-md {
  font-family: var(--ff-mono);
  font-size: 11.5px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 16px 18px;
  margin-top: 10px;
  white-space: pre-wrap;
  word-wrap: break-word;
  max-height: 520px;
  overflow-y: auto;
  tab-size: 2;
}
#clock {
  font-family: var(--ff-mono);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.3px;
  padding: 5px 10px;
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  background: var(--bg);
  white-space: nowrap;
}

/* ============================================================== Layout === */
main {
  padding: 36px 32px 80px;
  display: flex;
  flex-direction: column;
  gap: 38px;
  max-width: 1640px;
  margin: 0 auto;
  width: 100%;
}

/* Section title — editorial label with gradient rule */
.section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--ff-body);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 18px;
}
.section-title::before {
  content: '';
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--border) 0%, var(--border) 30%, transparent 100%);
}

/* ============================================================ KPI cards === */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 8px;
}
.card {
  position: relative;
  background:
    var(--grain),
    var(--surface);
  background-blend-mode: multiply, normal;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px 20px 22px;
  box-shadow: var(--shadow-1);
  transition: transform 220ms var(--ease-out), box-shadow 220ms var(--ease-out), border-color 160ms var(--ease-out);
  overflow: hidden;
}
.card::before {
  /* Vertical accent stripe — invisible by default, colored by .alert/.warn/.good */
  content: '';
  position: absolute;
  left: 0; top: 12px; bottom: 12px;
  width: 3px;
  border-radius: 2px;
  background: transparent;
  transition: background 200ms var(--ease-out);
}
.card .label {
  font-family: var(--ff-body);
  font-size: 10.5px;
  color: var(--muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.85px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.card .value {
  font-family: var(--ff-body);
  font-weight: 800;
  font-size: 30px;
  letter-spacing: -0.8px;
  line-height: 1;
  color: var(--text);
  font-variant-numeric: lining-nums tabular-nums;
}
.card .sub {
  font-family: var(--ff-body);
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 8px;
  letter-spacing: 0.1px;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
  border-color: var(--ghost);
}
.card.alert::before { background: var(--red); }
.card.warn::before  { background: var(--yellow); }
.card.good::before  { background: var(--green); }
.card.alert { border-left: 1px solid var(--border); padding-left: 24px; }
.card.warn  { padding-left: 24px; }
.card.good  { padding-left: 24px; }

/* ============================================================ Tables === */
.table-wrap {
  background:
    var(--grain),
    var(--surface);
  background-blend-mode: multiply, normal;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  box-shadow: var(--shadow-1);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--ff-body);
}
thead {
  background: var(--surface-alt);
}
th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-alt);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
th::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border) 20%, var(--border) 80%, transparent);
}
td {
  padding: 13px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-soft);
  font-variant-numeric: tabular-nums;
  vertical-align: top;
  color: var(--text);
  font-size: 13px;
}
td.num, th.num {
  text-align: right;
  font-family: var(--ff-mono);
  font-size: 12.5px;
  letter-spacing: -0.1px;
}
tr:last-child td { border-bottom: none; }
tbody tr {
  transition: background 130ms var(--ease-out);
}
tbody tr:hover td { background: var(--surface-alt); }
tr.highlight td { background: var(--accent-tint); }
tr.highlight:hover td { background: var(--accent-tint-2); }

/* Subtle zebra on long tables (opt-in via no extra class — defaults to off via :nth-child).
   Kept very subtle: a 30% mix toward surface-alt, only on every 4th row. */
tbody tr:nth-child(4n) td { background-color: rgba(232, 232, 216, 0.18); }
tbody tr:nth-child(4n):hover td { background-color: var(--surface-alt); }

/* Existing column-width discipline — preserved exactly */
table.fixed { table-layout: fixed; }
table.fixed td, table.fixed th { overflow: hidden; }
.contacts-table { table-layout: fixed; }
.contacts-table th:nth-child(1), .contacts-table td:nth-child(1) { width: 18%; }
.contacts-table th:nth-child(2), .contacts-table td:nth-child(2) { width: 22%; }
.contacts-table th:nth-child(3), .contacts-table td:nth-child(3) { width: 12%; }
.contacts-table th:nth-child(4), .contacts-table td:nth-child(4) { width: 9%; }
.contacts-table th:nth-child(5), .contacts-table td:nth-child(5) { width: 7%; }
.contacts-table th:nth-child(6), .contacts-table td:nth-child(6) { width: 10%; }
.contacts-table th:nth-child(7), .contacts-table td:nth-child(7) { width: 13%; }
.contacts-table th:nth-child(8), .contacts-table td:nth-child(8) { width: 5%; }
.contacts-table th:nth-child(9), .contacts-table td:nth-child(9) { width: 4%; }
.contacts-table td { overflow: hidden; }
.companies-table { table-layout: fixed; }
.companies-table th:nth-child(1), .companies-table td:nth-child(1) { width: 22%; }
.companies-table th:nth-child(2), .companies-table td:nth-child(2) { width: 10%; }
.companies-table th:nth-child(3), .companies-table td:nth-child(3) { width: 12%; }
.companies-table th:nth-child(4), .companies-table td:nth-child(4) { width: 14%; }
.companies-table th:nth-child(5), .companies-table td:nth-child(5) { width: 12%; }
.companies-table th:nth-child(6), .companies-table td:nth-child(6) { width: 7%; }
.companies-table th:nth-child(7), .companies-table td:nth-child(7) { width: 8%; }
.companies-table th:nth-child(8), .companies-table td:nth-child(8) { width: 15%; }
.companies-table td { overflow: hidden; }

/* Clickable row affordance — subtle orange left edge on hover */
tr.clickable { transition: background 130ms var(--ease-out); position: relative; }
tr.clickable:hover td { background: var(--surface-alt); }
tr.clickable:hover td:first-child {
  box-shadow: inset 3px 0 0 var(--accent);
}
tr.clickable a { color: var(--text); cursor: pointer; }
tr.clickable a:hover { color: var(--accent); text-decoration: none; }

/* ====================================================== Pills + Tags === */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 999px;
  font-family: var(--ff-body);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.3px;
  border: 1px solid transparent;
  line-height: 1.6;
  text-transform: uppercase;
}
.pill.red    { background: var(--pill-red-bg);    color: var(--red);    border-color: var(--pill-red-bd); }
.pill.green  { background: var(--pill-green-bg);  color: var(--green);  border-color: var(--pill-green-bd); }
.pill.yellow { background: var(--pill-yellow-bg); color: var(--yellow); border-color: var(--pill-yellow-bd); }
.pill.blue   { background: var(--pill-blue-bg);   color: var(--blue);   border-color: var(--pill-blue-bd); }
.pill.muted  { background: var(--pill-muted-bg);  color: var(--muted);  border-color: var(--pill-muted-bd); }
.pill.accent { background: var(--accent-tint);    color: var(--accent-deep); border-color: #F4C7B2; }

/* Social-network pills with brand colors — used on /ops */
.pill-facebook  { background: #E7F0FE; color: #1877F2; border-color: #BFD7FB; }
.pill-instagram { background: #FCE4EC; color: #C13584; border-color: #F5B5CE; }
.pill-tiktok    { background: #F0F0F0; color: #111111; border-color: #D6D6D6; }
.pill-youtube   { background: #FDE8E8; color: #C4302B; border-color: #F4B7B5; }
.pill-linkedin  { background: #E1ECF7; color: #0A66C2; border-color: #B8D2EE; }
.pill-unknown   { background: var(--pill-muted-bg); color: var(--muted); border-color: var(--pill-muted-bd); }

.net-icon {
  width: 14px;
  height: 14px;
  display: inline-block;
  vertical-align: -2px;
  fill: currentColor;
  flex-shrink: 0;
}
.net-icon-lg { width: 22px; height: 22px; vertical-align: -5px; margin-right: 6px; }

/* Per-network card theming — used as `.card.net-facebook` etc. on /ops cards.
   Sets a CSS variable `--net` consumed by both the left accent stripe and the
   watermark SVG positioned bottom-right. */
.card.net-facebook  { --net: #1877F2; }
.card.net-instagram { --net: #C13584; }
.card.net-tiktok    { --net: #111111; }
.card.net-youtube   { --net: #C4302B; }
.card.net-linkedin  { --net: #0A66C2; }
.card.net-unknown   { --net: var(--muted); }

.card.net-facebook::before,
.card.net-instagram::before,
.card.net-tiktok::before,
.card.net-youtube::before,
.card.net-linkedin::before { background: var(--net); }

.card-watermark {
  position: absolute;
  right: -16px;
  bottom: -22px;
  width: 116px;
  height: 116px;
  opacity: 0.13;
  pointer-events: none;
  fill: var(--net, var(--muted));
}

.tag {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 5px;
  font-family: var(--ff-mono);
  font-size: 10px;
  font-weight: 500;
  background: var(--accent-tint);
  color: var(--accent-deep);
  border: 1px solid #F4C7B2;
  margin-right: 4px;
  letter-spacing: 0.1px;
}

/* ===================================================== Score bar === */
.score-bar-wrap {
  width: 84px;
  height: 5px;
  background: var(--ghost);
  border-radius: 3px;
  overflow: hidden;
  display: inline-block;
  vertical-align: middle;
  position: relative;
}
.score-bar {
  height: 5px;
  background: linear-gradient(90deg, var(--accent) 0%, #F8784A 100%);
  position: relative;
  border-radius: 3px;
  transition: width 400ms var(--ease-out);
}
.score-bar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.18), transparent 60%);
}

/* ===================================================== Filter bar / inputs / buttons === */
.filter-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
  align-items: center;
}
.filter-bar form { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-bar select,
.filter-bar input {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 7px;
  padding: 7px 12px;
  font-size: 12.5px;
  font-family: inherit;
  transition: border-color 140ms var(--ease-out), box-shadow 140ms var(--ease-out), background 140ms var(--ease-out);
  line-height: 1.4;
}
.filter-bar select { padding-right: 28px; appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' stroke='%23666' stroke-width='1.4' fill='none' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat; background-position: right 10px center;
}
.filter-bar input::placeholder { color: var(--muted-soft); }
.filter-bar input:focus,
.filter-bar select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.filter-bar button {
  background: var(--accent);
  color: #FFFFFF;
  border: 1px solid var(--accent);
  border-radius: 7px;
  padding: 7px 16px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
  cursor: pointer;
  font-family: inherit;
  transition: filter 140ms var(--ease-out), transform 140ms var(--ease-out), box-shadow 140ms var(--ease-out);
  box-shadow: 0 2px 6px -2px rgba(240, 94, 34, 0.45);
}
.filter-bar button:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px -3px rgba(240, 94, 34, 0.55);
}
.filter-bar button:active { transform: translateY(0); box-shadow: var(--shadow-pressed); }
.filter-bar button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft), 0 2px 6px -2px rgba(240, 94, 34, 0.45);
}

.filter-bar button.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  font-weight: 500;
  box-shadow: none;
}
.filter-bar button.ghost:hover {
  color: var(--text);
  border-color: var(--accent);
  background: var(--surface);
  filter: none;
  transform: translateY(-1px);
}

/* ===================================================== Pager === */
.pager a {
  color: var(--muted);
  padding: 5px 11px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--bg);
  font-family: var(--ff-mono);
  font-size: 11.5px;
  transition: all 140ms var(--ease-out);
}
.pager a:hover {
  color: var(--text);
  border-color: var(--accent);
  background: var(--surface);
  text-decoration: none;
}

/* ===================================================== Detail drawer === */
.detail-card {
  position: relative;
  border: 1px solid var(--border) !important;
  background:
    var(--grain),
    linear-gradient(180deg, #FFFFFF 0%, var(--surface) 92%);
  background-blend-mode: multiply, normal;
  box-shadow: 0 12px 40px -22px rgba(0, 0, 0, 0.18), 0 1px 0 rgba(255,255,255,0.7) inset;
  padding: 24px 26px 26px 32px;
  overflow: hidden;
  border-radius: 12px;
}
.detail-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 5px;
  background: linear-gradient(180deg, var(--accent) 0%, #D8501C 100%);
}
.detail-card::after {
  /* Editorial corner mark — thin orange dot in the top-right */
  content: '';
  position: absolute;
  right: 18px; top: 18px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(240, 94, 34, 0.12);
}
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px 24px;
  margin-bottom: 22px;
}
.detail-grid > div { min-width: 0; }
.detail-grid .label {
  font-family: var(--ff-body);
  font-size: 9.5px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 5px;
  font-weight: 700;
}
.detail-grid .value {
  font-family: var(--ff-body);
  font-size: 13.5px;
  color: var(--text);
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.45;
}
.detail-grid .value.mono {
  font-family: var(--ff-mono);
  font-size: 12px;
}

.subsection-title {
  font-family: var(--ff-body);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--muted);
  margin: 22px 0 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.subsection-title::before {
  content: '';
  width: 4px; height: 4px;
  background: var(--accent);
  border-radius: 50%;
  flex-shrink: 0;
}
.subsection-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

details.raw-json > summary {
  cursor: pointer;
  user-select: none;
  font-family: var(--ff-body);
  font-size: 11px;
  color: var(--muted);
  padding: 8px 0;
  list-style: none;
  letter-spacing: 0.3px;
  transition: color 140ms var(--ease-out);
}
details.raw-json > summary::-webkit-details-marker { display: none; }
details.raw-json > summary::before {
  content: '▸';
  display: inline-block;
  margin-right: 7px;
  color: var(--accent);
  transition: transform 180ms var(--ease-out);
}
details.raw-json[open] > summary::before { transform: rotate(90deg); }
details.raw-json > summary:hover { color: var(--text); }

/* ===================================================== JSON viewer (dark code block) === */
.json-viewer {
  background:
    radial-gradient(circle at 100% 0%, rgba(240, 94, 34, 0.05), transparent 40%),
    var(--text-soft);
  color: var(--ghost);
  border: 1px solid #2A2A2A;
  padding: 14px 16px;
  border-radius: 9px;
  overflow-x: auto;
  max-height: 380px;
  margin-top: 10px;
  font-family: var(--ff-mono);
  font-size: 11.5px;
  line-height: 1.6;
  tab-size: 2;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}
.json-viewer .json-key    { color: var(--accent); font-weight: 600; }
.json-viewer .json-string { color: #9CCC65; }
.json-viewer .json-number { color: #FFB74D; }
.json-viewer .json-bool   { color: #7BB0FF; }
.json-viewer .json-null   { color: #8A8A78; font-style: italic; }
.json-viewer .json-punct  { color: #6E6E5E; }
.json-viewer::-webkit-scrollbar { height: 8px; width: 8px; }
.json-viewer::-webkit-scrollbar-track { background: transparent; }
.json-viewer::-webkit-scrollbar-thumb { background: #2F2F2F; border-radius: 4px; }
.json-viewer::-webkit-scrollbar-thumb:hover { background: #3F3F3F; }

/* ===================================================== Utilities === */
.muted { color: var(--muted); }
.tiny { font-size: 11px; letter-spacing: 0.2px; }
.mono { font-family: var(--ff-mono); font-size: 12px; }

.ellipsis {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  display: block;
}

.empty,
tr td.empty {
  color: var(--muted);
  font-style: italic;
  letter-spacing: 0.2px;
  padding: 32px;
  text-align: center;
}

/* ===================================================== Login — refined === */
.login-wrap {
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  background:
    var(--grain),
    linear-gradient(180deg, #FFFFFF 0%, var(--surface) 100%);
  background-blend-mode: multiply, normal;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 38px 40px 36px;
  box-shadow: 0 20px 56px -28px rgba(0,0,0,0.18), 0 2px 6px rgba(0,0,0,0.04);
  position: relative;
  overflow: hidden;
}
.login-wrap::before {
  content: '';
  position: absolute;
  left: 0; top: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent) 0%, #D8501C 100%);
}

/* ===================================================== Reduced motion === */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .logo:hover .logo-mark { transform: none; }
  .card:hover { transform: none; }
}

/* =============================================================================
   Dedups — per-email decision UI (grouped by primary contact)
   ============================================================================= */

/* ---------- toolbar (top + bottom sticky) ---------- */
.dedup-toolbar {
  position: sticky;
  top: 56px;                    /* sit just under the sibling-tabs bar */
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 16px;
  margin: 0 0 22px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-1);
  flex-wrap: wrap;
}
.dedup-toolbar-bottom {
  position: sticky;
  top: auto;
  bottom: 16px;
  margin: 24px 0 8px;
  z-index: 25;
}
.dedup-toolbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}
.dedup-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ---------- chip buttons (bulk shortcuts) ---------- */
.dedup-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 999px;
  font-family: var(--ff-body);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
  cursor: pointer;
  text-decoration: none;
  transition: all 140ms var(--ease-out);
  line-height: 1.3;
}
.dedup-chip:hover {
  border-color: var(--accent);
  color: var(--accent-deep);
  background: var(--accent-tint);
  transform: translateY(-1px);
  text-decoration: none;
}
.dedup-chip:active { transform: translateY(0); box-shadow: var(--shadow-pressed); }
.dedup-chip b { font-weight: 700; }
.dedup-chip-sm {
  padding: 4px 10px;
  font-size: 11px;
}
.dedup-chip-ghost {
  background: transparent;
  color: var(--muted);
  border-color: var(--border-soft);
}
.dedup-chip-ghost:hover {
  background: var(--surface);
  color: var(--text);
}

/* ---------- main Apply button ---------- */
.dedup-apply-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 20px;
  background: var(--accent);
  color: #FFFFFF;
  border: 1px solid var(--accent);
  border-radius: 8px;
  font-family: var(--ff-body);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  box-shadow: 0 3px 10px -3px rgba(240, 94, 34, 0.5);
  transition: filter 140ms var(--ease-out), transform 140ms var(--ease-out), box-shadow 140ms var(--ease-out), opacity 140ms var(--ease-out);
}
.dedup-apply-btn:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
  box-shadow: 0 5px 14px -3px rgba(240, 94, 34, 0.6);
}
.dedup-apply-btn:active { transform: translateY(0); box-shadow: var(--shadow-pressed); }
.dedup-apply-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft), 0 3px 10px -3px rgba(240, 94, 34, 0.5);
}
.dedup-apply-btn.is-empty {
  opacity: 0.55;
  background: var(--muted);
  border-color: var(--muted);
  box-shadow: none;
}
.dedup-apply-btn-lg {
  padding: 12px 28px;
  font-size: 14px;
}
.dedup-apply-btn span[data-role="apply-count"] {
  display: inline-block;
  min-width: 1.2em;
  padding: 1px 7px;
  background: rgba(255, 255, 255, 0.22);
  border-radius: 4px;
  font-variant-numeric: tabular-nums;
  font-family: var(--ff-mono);
}

/* ---------- group card ---------- */
.dedup-form { display: flex; flex-direction: column; gap: 20px; }
.dedup-group {
  position: relative;
  background:
    var(--grain),
    var(--surface);
  background-blend-mode: multiply, normal;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 24px 20px;
  box-shadow: var(--shadow-1);
  overflow: hidden;
}
.dedup-group::before {
  content: '';
  position: absolute;
  left: 0; top: 20px; bottom: 20px;
  width: 3px;
  background: var(--accent);
  border-radius: 2px;
}

/* ---------- group header ---------- */
.dedup-group-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding-left: 8px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-soft);
}
.dedup-group-head-main { min-width: 0; flex: 1; }
.dedup-group-head-aside { flex-shrink: 0; text-align: right; }
.dedup-group-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--ff-body);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: var(--accent);
  margin-bottom: 6px;
}
.dedup-eyebrow-dot {
  width: 5px; height: 5px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.dedup-eyebrow-sep { color: var(--muted); font-weight: 400; }
.dedup-eyebrow-company { color: var(--muted); font-weight: 600; letter-spacing: 0.4px; text-transform: none; font-size: 11px; }
.dedup-group-title {
  font-family: var(--ff-display);
  font-variation-settings: 'opsz' 144;
  font-weight: 600;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -0.4px;
  color: var(--text);
  margin-bottom: 4px;
}
.dedup-primary-link { color: var(--text); text-decoration: none; transition: color 140ms var(--ease-out); }
.dedup-primary-link:hover { color: var(--accent-deep); text-decoration: none; }
.dedup-primary-link:hover .dedup-arrow { color: var(--accent); }
.dedup-arrow { color: var(--muted); font-size: 16px; transition: color 140ms var(--ease-out); margin-left: 4px; }
.dedup-arrow-sm { color: var(--muted); font-size: 11px; margin-left: 2px; }
.dedup-group-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--text-soft);
}
.dedup-group-meta .mono { font-family: var(--ff-mono); font-size: 12px; color: var(--text-soft); }
.dedup-meta-sep { color: var(--muted); }
.dedup-group-count {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  padding: 8px 12px;
  background: var(--bg);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
}
.dedup-group-count-num {
  font-family: var(--ff-body);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.5px;
  color: var(--accent);
  font-variant-numeric: lining-nums tabular-nums;
  line-height: 1;
}
.dedup-group-count-label {
  font-family: var(--ff-body);
  font-size: 9.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
}

/* ---------- per-group bulk row ---------- */
.dedup-group-bulk {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 0 0 14px 8px;
  margin-bottom: 4px;
}

/* ---------- rows container ---------- */
.dedup-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-left: 8px;
}

/* ---------- single row ---------- */
.dedup-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  transition: border-color 140ms var(--ease-out), box-shadow 140ms var(--ease-out);
}
.dedup-row:hover {
  border-color: var(--border);
  box-shadow: 0 2px 6px -3px rgba(0,0,0,0.06);
}
.dedup-row.is-resolved {
  opacity: 0.4;
  background: var(--surface-alt);
  pointer-events: none;
}
.dedup-row.is-resolved .dedup-row-email-link { color: var(--muted); }

/* ---------- row identity column ---------- */
.dedup-row-identity {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  justify-content: center;
}
.dedup-row-email {
  font-family: var(--ff-mono);
  font-size: 13px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dedup-row-email-link { color: var(--text); text-decoration: none; transition: color 140ms var(--ease-out); }
.dedup-row-email-link:hover { color: var(--accent-deep); text-decoration: none; }
.dedup-row-email-link:hover .dedup-arrow-sm { color: var(--accent); }
.dedup-row-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-soft);
  line-height: 1.4;
}
.dedup-row-corrupted {
  color: var(--text-soft);
  font-style: italic;
}
.dedup-row-realname {
  color: var(--green);
  font-size: 11.5px;
}
.dedup-row-realname b { font-weight: 700; color: var(--green); }
.dedup-row-pills {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 2px;
}
.dedup-row-localid { opacity: 0.6; margin-left: auto; }

/* ---------- pills ---------- */
.dedup-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 999px;
  font-family: var(--ff-body);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.4px;
  line-height: 1.6;
  text-transform: uppercase;
  border: 1px solid transparent;
  white-space: nowrap;
}
.dedup-pill-gf {
  background: var(--pill-green-bg);
  color: var(--green);
  border-color: var(--pill-green-bd);
}
.dedup-pill-muted {
  background: var(--pill-muted-bg);
  color: var(--muted);
  border-color: var(--pill-muted-bd);
  text-transform: none;
  font-weight: 500;
  font-size: 9.5px;
  letter-spacing: 0.2px;
}
.dedup-pill-suggestion-gf {
  background: var(--accent-tint);
  color: var(--accent-deep);
  border-color: #F4C7B2;
}
.dedup-pill-suggestion-inferred {
  background: var(--pill-blue-bg);
  color: var(--blue);
  border-color: var(--pill-blue-bd);
  text-transform: none;
  font-weight: 600;
  letter-spacing: 0.2px;
}
.dedup-pill-warn {
  background: var(--pill-yellow-bg);
  color: var(--yellow);
  border-color: var(--pill-yellow-bd);
  text-transform: none;
  font-weight: 600;
  letter-spacing: 0.2px;
}

/* ---------- decision column ---------- */
.dedup-row-decision {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
  flex-shrink: 0;
}
.dedup-radios {
  display: flex;
  gap: 6px;
  align-items: stretch;
  flex-wrap: nowrap;
}

/* ---------- radio (label-wrapped) ---------- */
.dedup-radio {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 8px 12px 8px 11px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
  transition: all 140ms var(--ease-out);
  min-width: 0;
}
.dedup-radio input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0; height: 0;
}
.dedup-radio-mark {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--bg);
  position: relative;
  margin-top: 1px;
  transition: all 140ms var(--ease-out);
}
.dedup-radio-mark::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--accent);
  transform: scale(0);
  transition: transform 140ms var(--ease-spring);
}
.dedup-radio-label {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.2;
  min-width: 0;
}
.dedup-radio-title {
  font-family: var(--ff-body);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.1px;
  white-space: nowrap;
}
.dedup-radio-hint {
  font-family: var(--ff-body);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.1px;
  white-space: nowrap;
}

/* hover */
.dedup-radio:hover {
  border-color: var(--accent);
  background: var(--accent-tint);
}
.dedup-radio:hover .dedup-radio-mark { border-color: var(--accent); }

/* pre-selected hint (subtle dashed ring) */
.dedup-radio.is-preselected {
  border-style: dashed;
}

/* checked state — orange surround */
.dedup-radio.is-checked {
  background: var(--accent-tint);
  border-color: var(--accent);
  border-style: solid;
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.dedup-radio.is-checked .dedup-radio-mark {
  border-color: var(--accent);
}
.dedup-radio.is-checked .dedup-radio-mark::after {
  transform: scale(1);
}
.dedup-radio.is-checked .dedup-radio-title { color: var(--accent-deep); }

/* "different" checked: brand-orange semantic too (different person) */
.dedup-radio-different.is-checked {
  background: #FFF1DF;
  border-color: #E89720;
  box-shadow: 0 0 0 3px rgba(232, 151, 32, 0.18);
}
.dedup-radio-different.is-checked .dedup-radio-mark { border-color: #E89720; }
.dedup-radio-different.is-checked .dedup-radio-mark::after { background: #E89720; }
.dedup-radio-different.is-checked .dedup-radio-title { color: #8A580B; }

/* skip checked: neutral grey */
.dedup-radio-skip.is-checked {
  background: var(--surface-alt);
  border-color: var(--muted);
  box-shadow: 0 0 0 3px rgba(102, 102, 102, 0.12);
}
.dedup-radio-skip.is-checked .dedup-radio-mark { border-color: var(--muted); }
.dedup-radio-skip.is-checked .dedup-radio-mark::after { background: var(--muted); }
.dedup-radio-skip.is-checked .dedup-radio-title { color: var(--text); }

/* focus ring for keyboard */
.dedup-radio input[type="radio"]:focus-visible + .dedup-radio-mark {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* engagement warning slot */
.dedup-engagement-warn {
  font-family: var(--ff-body);
  font-size: 11px;
  color: var(--red);
  font-weight: 600;
  letter-spacing: 0.1px;
  padding: 4px 10px;
  background: var(--pill-red-bg);
  border: 1px solid var(--pill-red-bd);
  border-radius: 6px;
  max-width: 100%;
  text-align: right;
}
.dedup-engagement-warn b { font-weight: 800; }

/* ---------- per-group apply button (header right) ---------- */
.dedup-group-apply-btn {
  margin-top: 8px;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.15s ease;
}
.dedup-group-apply-btn:hover:not(:disabled) {
  filter: brightness(0.92);
}
.dedup-group-apply-btn:disabled {
  opacity: 0.7;
  cursor: wait;
}

/* ---------- per-row test button ---------- */
.dedup-row-test {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.dedup-row-test-btn {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}
.dedup-row-test-btn:hover:not(:disabled) {
  background: var(--pill-accent-bg);
}
.dedup-row-test-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}
.dedup-row-test-status { font-style: italic; }

/* ---------- resolved mark ---------- */
.dedup-resolved-mark {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--pill-green-bg);
  color: var(--green);
  border: 1px solid var(--pill-green-bd);
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.dedup-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px; height: 14px;
  background: var(--green);
  color: white;
  border-radius: 50%;
  font-size: 9px;
  font-weight: 900;
}

/* ---------- legend (bottom of page) ---------- */
.dedup-legend {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}
.dedup-legend-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.dedup-legend-mark {
  flex-shrink: 0;
  width: 18px; height: 18px;
  border-radius: 50%;
  margin-top: 2px;
  border: 2px solid;
  position: relative;
}
.dedup-legend-mark::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
}
.dedup-legend-mark-same { border-color: var(--accent); }
.dedup-legend-mark-same::after { background: var(--accent); }
.dedup-legend-mark-different { border-color: #E89720; }
.dedup-legend-mark-different::after { background: #E89720; }
.dedup-legend-mark-skip { border-color: var(--muted); }
.dedup-legend-mark-skip::after { background: var(--muted); }
.dedup-legend-title {
  font-family: var(--ff-body);
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 3px;
  letter-spacing: -0.1px;
}

/* ---------- dedup responsive ---------- */
@media (max-width: 900px) {
  .dedup-row { grid-template-columns: 1fr; }
  .dedup-row-decision { align-items: stretch; }
  .dedup-radios { flex-wrap: wrap; }
  .dedup-engagement-warn { text-align: left; }
  .dedup-group-head { flex-direction: column; gap: 8px; }
  .dedup-group-head-aside { align-self: flex-start; }
}

/* ===================================================== Reduced motion === */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .logo:hover .logo-mark { transform: none; }
  .card:hover { transform: none; }
}

/* ===================================================== Smaller screens === */
@media (max-width: 1024px) {
  header { grid-template-columns: 1fr; gap: 14px; padding: 14px 20px; }
  nav { justify-content: flex-start; overflow-x: auto; padding-bottom: 4px; }
  nav a { white-space: nowrap; }
  main { padding: 24px 20px 60px; gap: 28px; }
  .logo-tagline { display: none; }
}
@media (max-width: 640px) {
  th, td { padding: 10px 12px; font-size: 12px; }
  /* KPI band: 2-up compact grid so it doesn't eat half the screen height. */
  .cards { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .card { padding: 11px 12px; border-radius: 9px; }
  .card .label { font-size: 9.5px; margin-bottom: 4px; letter-spacing: 0.4px; }
  .card .value { font-size: 22px; }
  .card .sub { font-size: 10px; margin-top: 4px; }
  .card.alert, .card.warn, .card.good { padding-left: 15px; }
  /* "Total open" card carries a sub line — let it span the full width up top. */
  .cards .card:first-child { grid-column: 1 / -1; }
}

/* ===== Triage essentials block (Jira ticket inline summary + bullets) ===== */
.ess {
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px dashed var(--border-soft);
}
.ess-sum {
  font-size: 12px;
  color: var(--text);
  opacity: 0.82;
  line-height: 1.45;
  margin-bottom: 4px;
}
.ess-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ess-list li {
  font-size: 11.5px;
  line-height: 1.5;
  display: flex;
  gap: 6px;
  align-items: baseline;
  flex-wrap: wrap;
}
.ess-list li strong {
  font-weight: 600;
  color: var(--text);
  opacity: 0.9;
}
.ess-list a {
  color: var(--accent);
  text-decoration: none;
  word-break: break-all;
}
.ess-list a:hover { text-decoration: underline; }
.ess-i { flex: 0 0 auto; opacity: 0.7; font-size: 11px; }
.ess-unsub { font-style: italic; }

/* ===== Filter search box (sortable.js data-filter-all / data-filter-for) ===== */
.filter-search { margin: 10px 0; }
.filter-search input,
.filter-search select {
  width: 100%;
  max-width: 420px;
  padding: 9px 13px;
  font-family: var(--ff-body);
  font-size: 13px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9px;
  outline: none;
  transition: border-color 130ms var(--ease-out), box-shadow 130ms var(--ease-out);
}
.filter-search select { max-width: 230px; cursor: pointer; }
.filter-search input:focus,
.filter-search select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-tint);
}

/* ===== Responsive tables — stacked card layout on mobile (no h-scroll) =====
   Tables tagged class="responsive-table" collapse from columns into stacked
   cards under 720px. data-label on each <td> (auto-filled by sortable.js from
   the column header) becomes the inline label. .cell-main spans full width. */
@media (max-width: 720px) {
  .table-wrap:has(table.responsive-table) {
    border: none;
    background: none;
    box-shadow: none;
    overflow: visible;
  }
  table.responsive-table thead { display: none; }
  table.responsive-table,
  table.responsive-table tbody,
  table.responsive-table tr,
  table.responsive-table td { display: block; width: 100%; }
  table.responsive-table tr {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 13px;
    margin-bottom: 10px;
    box-shadow: var(--shadow-1);
  }
  table.responsive-table tbody tr:nth-child(4n) td,
  table.responsive-table tbody tr:hover td { background: none; }
  table.responsive-table td {
    border: none;
    padding: 3px 0;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    align-items: baseline;
    font-size: 13px;
  }
  table.responsive-table td::before {
    content: attr(data-label);
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 9.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    padding-top: 2px;
  }
  table.responsive-table td:empty { display: none; }
  table.responsive-table td:not([data-label])::before,
  table.responsive-table td[data-label=""]::before { display: none; }
  /* Title/main cell: full width, no label, emphasized + left-aligned. */
  table.responsive-table td.cell-main {
    display: block;
    padding: 5px 0 7px;
    font-size: 14px;
    line-height: 1.45;
  }
  table.responsive-table td.cell-main::before { display: none; }
}

/* ===========================================================================
   Social pages — ported from outreach-management mockup ops-hub/styles.css
   Used by: /social, /social/post/{id}, /social/insights (ops_hub:18803)
   =========================================================================== */

.ops-social {
  --soc-bg: var(--bg);
  --soc-card: #ffffff;
  --soc-card-soft: #fbf7ee;
  --soc-ink: var(--text);
  --soc-ink-2: #3a3733;
  --soc-ink-3: #74705f;
  --soc-ink-4: #a09a89;
  --soc-rule: #e6dfd1;
  --soc-rule-2: #d4ccba;
  --soc-accent: var(--accent);
  --soc-accent-deep: var(--accent-deep);
  --soc-accent-soft: #fde4d5;
  --soc-accent-tint: #fef0e6;
  --soc-live: #228c4f;
  --soc-live-soft: #dcefe2;
  --soc-danger: #b03020;
  --soc-num: "Geist", "Inter", system-ui, sans-serif;
  --soc-mono: "Geist Mono", ui-monospace, monospace;
  --fb-blue: #1877f2;
  --ig-pink: #d62a7c;
  --tt-ink: #111;
  --yt-red: #cc0000;
  --li-blue: #0a66c2;

  font-family: var(--ff-body, "Inter", system-ui, sans-serif);
  color: var(--soc-ink);
  font-size: 13px;
  line-height: 1.5;
}

/* Reset .ops-main constraints to give social pages full bleed within the shell. */
main.ops-main:has(.ops-social) { max-width: 1440px; padding: 12px 20px 40px; }

/* === PAGE HEAD === */
.ops-social .page-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  margin: 6px 0 22px; padding-bottom: 14px;
  border-bottom: 1px solid var(--soc-rule);
}
.ops-social .page-head h1 {
  font-family: var(--soc-num); font-weight: 800; font-size: 28px;
  letter-spacing: -0.015em; margin: 0; line-height: 1; color: var(--soc-ink);
  font-style: normal;
}
.ops-social .page-head .sub {
  font-size: 12px; color: var(--soc-ink-3); margin-top: 6px; font-family: var(--soc-mono);
}
.ops-social .page-head .actions { display: flex; gap: 8px; align-items: center; }

.ops-social .btn {
  font-family: inherit; font-size: 12.5px; font-weight: 500;
  padding: 6px 12px; border-radius: 6px; border: 1px solid var(--soc-rule);
  background: var(--soc-card); color: var(--soc-ink); cursor: pointer;
  text-decoration: none; display: inline-flex; align-items: center;
}
.ops-social .btn:hover { border-color: var(--soc-rule-2); background: var(--soc-card-soft); color: var(--soc-ink); }
.ops-social .btn.primary { background: var(--soc-accent); color: #fff; border-color: var(--soc-accent-deep); }
.ops-social .btn.primary:hover { background: var(--soc-accent-deep); color: #fff; }
.ops-social .btn.tiny { padding: 3px 8px; font-size: 11.5px; }

.ops-social .tabs {
  display: inline-flex; background: var(--soc-card-soft); border: 1px solid var(--soc-rule);
  border-radius: 8px; padding: 3px; gap: 2px;
}
.ops-social .tabs a, .ops-social .tabs button {
  border: none; background: transparent; cursor: pointer; text-decoration: none;
  font-family: inherit; font-size: 12px; font-weight: 500;
  padding: 5px 10px; border-radius: 5px; color: var(--soc-ink-3);
}
.ops-social .tabs a:hover { color: var(--soc-ink); background: rgba(0,0,0,0.02); }
.ops-social .tabs a.on, .ops-social .tabs button.on {
  background: var(--soc-card); color: var(--soc-ink);
  border: 1px solid var(--soc-rule); box-shadow: 0 1px 0 rgba(0,0,0,0.03);
}

.ops-social .muted { color: var(--soc-ink-3); }
.ops-social .mono  { font-family: var(--soc-mono); }

/* === SECTION HEAD === */
.ops-social .section-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin: 22px 0 12px;
}
.ops-social .section-head h2 {
  margin: 0; font-family: var(--soc-num); font-weight: 800; font-size: 18px;
  letter-spacing: -0.01em; color: var(--soc-ink); font-style: normal;
}
.ops-social .section-head .sub { font-family: var(--soc-mono); font-size: 11px; color: var(--soc-ink-3); }

/* === CHANNEL STRIP === */
.ops-social .channel-strip {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 18px;
}
.ops-social .ch-card {
  background: var(--soc-card); border: 1px solid var(--soc-rule); border-radius: 10px;
  padding: 16px 16px 14px; position: relative; overflow: hidden; cursor: default;
  transition: border-color 0.15s, transform 0.15s;
}
.ops-social .ch-card:hover { border-color: var(--soc-rule-2); transform: translateY(-1px); }
.ops-social .ch-card .wm {
  position: absolute; right: -12px; bottom: -16px; opacity: 0.06; font-size: 90px;
  font-family: var(--soc-num); font-weight: 800; color: var(--soc-ink);
  pointer-events: none; line-height: 1; letter-spacing: -0.04em; text-transform: lowercase;
}
.ops-social .ch-card.fb .wm { color: var(--fb-blue); opacity: 0.08; }
.ops-social .ch-card.ig .wm { color: var(--ig-pink); opacity: 0.08; }
.ops-social .ch-card.tt .wm { color: var(--tt-ink); opacity: 0.06; }
.ops-social .ch-card.yt .wm { color: var(--yt-red);  opacity: 0.08; }
.ops-social .ch-card.li .wm { color: var(--li-blue); opacity: 0.08; }

.ops-social .ch-card .name {
  font-size: 11.5px; color: var(--soc-ink-3); font-family: var(--soc-mono);
  text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 6px;
}
.ops-social .ch-card .count {
  font-family: var(--soc-num); font-weight: 800; font-size: 34px; line-height: 1;
  color: var(--soc-ink); letter-spacing: -0.02em; font-style: normal;
}
.ops-social .ch-card .count .unit {
  font-size: 12px; color: var(--soc-ink-3); font-weight: 500; margin-left: 4px;
  letter-spacing: 0; text-transform: none; font-family: inherit;
}
.ops-social .ch-card .stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px;
  position: relative; z-index: 2;
}
.ops-social .ch-card .stat { display: flex; flex-direction: column; gap: 1px; }
.ops-social .ch-card .stat .lab {
  font-family: var(--soc-mono); font-size: 9.5px; color: var(--soc-ink-3);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.ops-social .ch-card .stat .v {
  font-family: var(--soc-num); font-weight: 800; font-size: 16px; line-height: 1.1;
  color: var(--soc-ink); letter-spacing: -0.01em; font-style: normal;
}
.ops-social .ch-card .stat .v.up { color: var(--soc-live); }
.ops-social .ch-card .stat .v.down { color: var(--soc-danger); }
.ops-social .ch-card .spark {
  margin-top: 10px; display: flex; align-items: flex-end; gap: 1.5px; height: 22px;
  position: relative; z-index: 2;
}
.ops-social .ch-card .spark .b {
  flex: 1; background: var(--soc-accent-soft); border-radius: 1px; min-height: 2px;
}
.ops-social .ch-card .spark .b.cur { background: var(--soc-accent); }

/* === COMPARE STRIP === */
.ops-social .compare {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; margin-bottom: 18px;
}
.ops-social .compare-card {
  background: var(--soc-card); border: 1px solid var(--soc-rule); border-radius: 10px;
  padding: 14px 16px;
}
.ops-social .compare-card h4 {
  margin: 0 0 4px; font-size: 12px; color: var(--soc-ink-3); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.ops-social .compare-card .lead {
  font-size: 14px; color: var(--soc-ink-2); margin: 0 0 12px;
}
.ops-social .compare-card .lead b { color: var(--soc-ink); font-weight: 600; }
.ops-social .compare-row {
  display: grid; grid-template-columns: 90px 1fr 70px; align-items: center; gap: 10px;
  font-size: 12px; padding: 5px 0; text-decoration: none; color: inherit;
}
.ops-social a.compare-row.clickable:hover { background: var(--soc-card-soft); border-radius: 5px; }
.ops-social .compare-row .cn { font-family: var(--soc-mono); font-size: 11px; color: var(--soc-ink-2); font-weight: 500; }
.ops-social .compare-row .bar {
  height: 6px; background: var(--soc-card-soft); border-radius: 999px; overflow: hidden;
}
.ops-social .compare-row .bar i { display: block; height: 100%; background: var(--soc-accent); border-radius: 999px; }
.ops-social .compare-row .v {
  font-family: var(--soc-num); font-weight: 800; font-size: 14px; text-align: right;
  color: var(--soc-ink); font-style: normal;
}

/* === LEADERBOARD === */
.ops-social .leader {
  background: var(--soc-card); border: 1px solid var(--soc-rule); border-radius: 10px; overflow: hidden;
}
.ops-social .leader-row {
  display: grid; grid-template-columns: 28px 60px 1fr 90px 100px 90px 90px;
  align-items: center; gap: 10px; padding: 12px 16px;
  border-bottom: 1px solid var(--soc-rule); cursor: pointer;
  text-decoration: none; color: inherit;
}
.ops-social .leader-row:last-child { border-bottom: none; }
.ops-social a.leader-row:hover { background: var(--soc-card-soft); }
.ops-social .leader-row .rank {
  font-family: var(--soc-num); font-weight: 800; font-size: 16px;
  color: var(--soc-ink-3); text-align: center; font-style: normal;
}
.ops-social .leader-row .ch { font-family: var(--soc-mono); font-size: 11px; color: var(--soc-ink-2); font-weight: 500; }
.ops-social .leader-row .ch span {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  margin-right: 5px; vertical-align: middle;
}
.ops-social .leader-row .ch span.fb { background: var(--fb-blue); }
.ops-social .leader-row .ch span.ig { background: var(--ig-pink); }
.ops-social .leader-row .ch span.tt { background: var(--tt-ink); }
.ops-social .leader-row .ch span.yt { background: var(--yt-red);  }
.ops-social .leader-row .ch span.li { background: var(--li-blue); }
.ops-social .leader-row .text {
  font-size: 12.5px; color: var(--soc-ink); line-height: 1.4;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.ops-social .leader-row .text small {
  display: block; color: var(--soc-ink-3); font-family: var(--soc-mono);
  font-size: 10.5px; margin-top: 2px;
}
.ops-social .leader-row .metric {
  font-family: var(--soc-num); font-weight: 800; font-size: 15px;
  color: var(--soc-ink); text-align: right; font-style: normal;
}
.ops-social .leader-row .metric .delta {
  font-size: 10.5px; font-weight: 500; color: var(--soc-live);
  margin-left: 4px; font-family: var(--soc-mono);
}
.ops-social .leader-row .metric .delta.neg { color: var(--soc-danger); }
.ops-social .leader-row.head {
  background: var(--soc-card-soft); cursor: default;
  font-family: var(--soc-mono); font-size: 10.5px; color: var(--soc-ink-3);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.ops-social .leader-row.head:hover { background: var(--soc-card-soft); }
.ops-social .leader-row.head .text {
  font-family: var(--soc-mono); font-size: 10.5px; letter-spacing: 0.06em; color: var(--soc-ink-3);
}
.ops-social .leader-row.head .metric {
  font-family: var(--soc-mono); font-weight: 500; font-size: 10.5px;
  color: var(--soc-ink-3); text-align: right;
}
/* Per-account variant — same column shape but no hover-click */
.ops-social .leader-row.pa-row { grid-template-columns: 28px 60px 1fr 90px 90px 90px 90px; }

/* === METRIC CARDS (drill-down) === */
.ops-social .metric-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
}
.ops-social .metric-grid-12 { grid-template-columns: repeat(4, 1fr); }
.ops-social .metric-card {
  background: var(--soc-card); border: 1px solid var(--soc-rule); border-radius: 10px;
  padding: 14px 16px;
}
.ops-social .metric-card .lab {
  font-family: var(--soc-mono); font-size: 10.5px; color: var(--soc-ink-3);
  text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 4px;
}
.ops-social .metric-card .val {
  font-family: var(--soc-num); font-weight: 800; font-size: 28px; line-height: 1;
  color: var(--soc-ink); letter-spacing: -0.015em; font-style: normal;
}
.ops-social .metric-card .val .unit {
  font-size: 12px; color: var(--soc-ink-3); font-weight: 500; margin-left: 4px;
  font-family: inherit;
}
.ops-social .metric-card .cmp {
  font-family: var(--soc-mono); font-size: 11px; margin-top: 6px; color: var(--soc-ink-3);
}
.ops-social .metric-card .cmp .up { color: var(--soc-live); font-weight: 500; }
.ops-social .metric-card .cmp .down { color: var(--soc-danger); font-weight: 500; }
.ops-social .metric-card .cmp .flat { color: var(--soc-ink-3); }
.ops-social .metric-card.null { opacity: 0.55; }
.ops-social .metric-card.null .val { color: var(--soc-ink-4); }

/* === POST PREVIEW === */
.ops-social .post-preview {
  background: var(--soc-card); border: 1px solid var(--soc-rule); border-radius: 12px;
  padding: 20px 22px; display: grid; grid-template-columns: 1fr 200px;
  gap: 22px; margin-bottom: 18px;
}
.ops-social .post-preview .head { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.ops-social .post-preview .caption {
  font-size: 14px; line-height: 1.6; color: var(--soc-ink); white-space: pre-wrap;
}
.ops-social .post-preview .caption b { font-weight: 600; }
.ops-social .post-preview .meta-side {
  border-left: 1px solid var(--soc-rule); padding-left: 22px;
  display: flex; flex-direction: column; gap: 10px;
}
.ops-social .post-preview .media-thumb {
  aspect-ratio: 1; background: linear-gradient(135deg, #3a4a6e, #1a2a4a);
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
  color: #fff; font-family: var(--soc-num); font-weight: 800; font-size: 32px;
  letter-spacing: -0.02em; font-style: normal;
}
.ops-social .pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--soc-mono); font-size: 10.5px;
  padding: 2px 7px; border-radius: 999px;
  background: var(--soc-card-soft); border: 1px solid var(--soc-rule); color: var(--soc-ink-2);
  letter-spacing: 0.04em; white-space: nowrap;
}
.ops-social .pill.live { background: var(--soc-live-soft); color: var(--soc-live); border-color: transparent; }

.ops-social .kv {
  display: flex; justify-content: space-between; font-size: 12px;
  padding: 5px 0; border-bottom: 1px dashed var(--soc-rule);
}
.ops-social .kv:last-child { border: none; }
.ops-social .kv .k {
  color: var(--soc-ink-3); font-family: var(--soc-mono); font-size: 10.5px;
  letter-spacing: 0.04em; text-transform: uppercase;
}
.ops-social .kv .v { font-family: var(--soc-mono); font-size: 12px; }

/* === CHART CARDS === */
.ops-social .chart-card {
  background: var(--soc-card); border: 1px solid var(--soc-rule); border-radius: 10px;
  padding: 16px 18px;
}
.ops-social .card-head {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px;
}
.ops-social .card-head h3 {
  margin: 0; font-size: 13px; font-weight: 600; color: var(--soc-ink);
  letter-spacing: -0.005em;
}
.ops-social .card-head .meta {
  font-family: var(--soc-mono); font-size: 11px; color: var(--soc-ink-3);
}
.ops-social .chart-area {
  height: 200px; position: relative; margin: 12px 0 8px;
  background: linear-gradient(180deg, var(--soc-card) 0%, var(--soc-card-soft) 100%);
  border-radius: 6px; overflow: hidden;
}
.ops-social .chart-area svg { width: 100%; height: 100%; display: block; }
.ops-social .chart-legend {
  display: flex; gap: 14px; margin-top: 8px;
  font-family: var(--soc-mono); font-size: 10.5px; color: var(--soc-ink-3); flex-wrap: wrap;
}
.ops-social .chart-legend .lk { display: inline-flex; align-items: center; gap: 5px; }
.ops-social .chart-legend .sw { width: 10px; height: 2px; border-radius: 1px; }

.ops-social .insights-pair {
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; margin-top: 14px;
}

/* === DEMO BARS === */
.ops-social .demo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ops-social .demo-bar {
  display: grid; grid-template-columns: 130px 1fr 60px; gap: 10px; align-items: center;
  font-size: 12px; margin-bottom: 7px;
}
.ops-social .demo-bar .cn { font-family: var(--soc-mono); font-size: 11.5px; color: var(--soc-ink-2); }
.ops-social .demo-bar .bar { height: 8px; background: var(--soc-card-soft); border-radius: 999px; overflow: hidden; }
.ops-social .demo-bar .bar i { display: block; height: 100%; background: var(--soc-accent); border-radius: 999px; }
.ops-social .demo-bar .v {
  font-family: var(--soc-num); font-weight: 800; font-size: 13px;
  color: var(--soc-ink); text-align: right; font-style: normal;
}

/* === RECO CARDS === */
.ops-social .reco-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ops-social .reco {
  background: var(--soc-accent-tint); border: 1px solid var(--soc-accent-soft);
  border-radius: 10px; padding: 14px 16px;
}
.ops-social .reco .tag {
  font-family: var(--soc-mono); font-size: 10px; color: var(--soc-accent-deep);
  text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; margin-bottom: 6px;
}
.ops-social .reco h4 { margin: 0 0 4px; font-weight: 600; font-size: 14px; color: var(--soc-ink); }
.ops-social .reco p { margin: 0 0 8px; font-size: 12.5px; line-height: 1.55; color: var(--soc-ink-2); }

/* === EMPTY STATE === */
.ops-social .empty-state {
  background: var(--soc-card-soft); border: 1px dashed var(--soc-rule-2); border-radius: 10px;
  padding: 32px 24px; text-align: center;
}
.ops-social .empty-state h4 { margin: 0 0 4px; font-weight: 600; font-size: 14px; color: var(--soc-ink); }
.ops-social .empty-state p { margin: 0; font-size: 12.5px; color: var(--soc-ink-3); line-height: 1.55; }
.ops-social .empty-state .sub {
  font-family: var(--soc-mono); font-size: 10.5px; color: var(--soc-ink-4);
  margin-top: 8px; letter-spacing: 0.04em;
}

/* === Responsive === */
@media (max-width: 1100px) {
  .ops-social .channel-strip { grid-template-columns: repeat(2, 1fr); }
  .ops-social .compare { grid-template-columns: 1fr; }
  .ops-social .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .ops-social .insights-pair { grid-template-columns: 1fr; }
  .ops-social .demo-grid { grid-template-columns: 1fr; }
  .ops-social .reco-grid { grid-template-columns: 1fr; }
  .ops-social .leader-row { grid-template-columns: 28px 50px 1fr 70px 70px; }
  .ops-social .leader-row .metric:nth-child(6),
  .ops-social .leader-row .metric:nth-child(7) { display: none; }
}

/* ===========================================================================
   Agents + Audit — ported from outreach-management mockup os/styles.css
   Used by: /agents, /agents/{id}, /agents/runs/{id}, /system/audit-log
   Color tokens reuse project's existing palette (--accent, --bg, --surface,
   --text, --muted, --border). Mockup-specific tokens are aliased below.
   =========================================================================== */
:root {
  --ag-card:        #FFFFFF;
  --ag-card-2:      #FBF8EF;
  --ag-bg-2:        #F3EFE5;
  --ag-bg-3:        #EBE5D4;
  --ag-rule:        #E3DCCB;
  --ag-rule-2:      #D5CDB8;
  --ag-ink:         #161513;
  --ag-ink-2:       #3A3733;
  --ag-ink-3:       #6B675E;
  --ag-ink-4:       #9A9588;

  --ag-violet:      #6A4CB7;
  --ag-violet-soft: #E3DAF3;
  --ag-live:        #1F8A4C;
  --ag-live-soft:   #D8EEDE;
  --ag-warn:        #B67610;
  --ag-warn-soft:   #F8E7C4;
  --ag-danger:      #A8311E;
  --ag-danger-soft: #F4D4CD;
  --ag-info:        #2A5FB0;
  --ag-info-soft:   #D6E2F3;
}

/* Page roots: keep them inside .ops-agents / .ops-audit to avoid leaking. */
.ops-agents, .ops-audit {
  color: var(--ag-ink);
  font-family: var(--ff-body);
  font-size: 13px;
  line-height: 1.45;
}
.ops-agents .crumb a, .ops-audit .crumb a { color: var(--ag-ink-3); text-decoration: none; }
.ops-agents .crumb a:hover, .ops-audit .crumb a:hover { color: var(--accent); }
.ops-agents .mono, .ops-audit .mono { font-family: var(--ff-mono); }
.ops-agents .tiny, .ops-audit .tiny { font-size: 10.5px; letter-spacing: 0.03em; }
.ops-agents .muted, .ops-audit .muted { color: var(--ag-ink-3); }

/* ── page-head override (matches mockup serif-italic h1) ── */
.ops-agents .page-head.ag-head, .ops-audit .page-head.ag-head {
  border-bottom: 1px solid var(--ag-rule);
  padding-bottom: 14px; margin-bottom: 18px;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 14px;
}
.ops-agents .page-head.ag-head h1, .ops-audit .page-head.ag-head h1 {
  font-family: 'Newsreader', var(--ff-display);
  font-weight: 500; font-style: italic;
  font-size: 32px; line-height: 1.05;
  margin: 6px 0 0; letter-spacing: -0.015em; color: var(--ag-ink);
}
.ops-agents .page-head.ag-head .sub, .ops-audit .page-head.ag-head .sub {
  font-family: var(--ff-mono);
  font-size: 11px; color: var(--ag-ink-3);
  letter-spacing: 0.03em; margin-top: 6px;
}
.ops-agents .page-head.ag-head .actions, .ops-audit .page-head.ag-head .actions {
  display: flex; gap: 8px; align-items: center;
}

/* ── dry-mode banner ── */
.ag-banner {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 12.5px;
  margin-bottom: 16px;
  border: 1px solid;
}
.ag-banner.dry {
  background: var(--ag-warn-soft);
  border-color: #E5C66B;
  color: #5C3A07;
}
.ag-banner strong {
  font-family: var(--ff-mono); font-size: 11px;
  letter-spacing: 0.08em; text-transform: uppercase;
  background: var(--ag-warn); color: #fff;
  padding: 2px 7px; border-radius: 4px;
  font-weight: 600;
}
.ag-banner em { font-style: italic; }
.ag-banner code {
  font-family: var(--ff-mono); font-size: 11px;
  background: rgba(0,0,0,0.06);
  padding: 1px 5px; border-radius: 3px;
}

/* ── buttons (scoped to .ops-agents / .ops-audit) ── */
.ag-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--ff-body); font-size: 12px; font-weight: 500;
  padding: 6px 11px; border-radius: 6px;
  border: 1px solid var(--ag-rule);
  background: var(--ag-card); color: var(--ag-ink);
  cursor: pointer; line-height: 1;
  text-decoration: none;
}
.ag-btn:hover { border-color: var(--ag-rule-2); background: var(--ag-bg-2); text-decoration: none; }
.ag-btn.primary { background: var(--accent); color: #fff; border-color: var(--accent-deep); }
.ag-btn.primary:hover { background: var(--accent-deep); color: #fff; }
.ag-btn.ghost { background: transparent; border-color: transparent; color: var(--ag-ink-2); }
.ag-btn.ghost:hover { background: var(--ag-bg-2); }
.ag-btn.live { background: var(--ag-live-soft); color: var(--ag-live); border-color: transparent; }
.ag-btn.live:hover { background: var(--ag-live); color: #fff; }
.ag-btn.warn { background: var(--ag-warn-soft); color: var(--ag-warn); border-color: transparent; }
.ag-btn.warn:hover { background: var(--ag-warn); color: #fff; }
.ag-btn.danger { background: var(--ag-danger-soft); color: var(--ag-danger); border-color: transparent; }
.ag-btn.danger:hover { background: var(--ag-danger); color: #fff; }
.ag-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.ag-btn.tiny { padding: 3px 8px; font-size: 11px; font-family: var(--ff-mono); }

/* ── pills (scoped) ── */
.ops-agents .pill, .ops-audit .pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--ff-mono); font-size: 10.5px;
  padding: 2px 7px; border-radius: 999px;
  border: 1px solid var(--ag-rule);
  background: var(--ag-card);
  color: var(--ag-ink-2);
  letter-spacing: 0.03em; white-space: nowrap;
}
.ops-agents .pill.live, .ops-audit .pill.live { background: var(--ag-live-soft); color: var(--ag-live); border-color: transparent; }
.ops-agents .pill.warn, .ops-audit .pill.warn { background: var(--ag-warn-soft); color: var(--ag-warn); border-color: transparent; }
.ops-agents .pill.danger, .ops-audit .pill.danger { background: var(--ag-danger-soft); color: var(--ag-danger); border-color: transparent; }
.ops-agents .pill.info, .ops-audit .pill.info { background: var(--ag-info-soft); color: var(--ag-info); border-color: transparent; }
.ops-agents .pill.violet, .ops-audit .pill.violet { background: var(--ag-violet-soft); color: var(--ag-violet); border-color: transparent; }
.ops-agents .pill.ghost, .ops-audit .pill.ghost { background: transparent; }

.ag-pill { /* alias used in agent_detail header */
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--ff-mono); font-size: 10.5px;
  padding: 2px 7px; border-radius: 999px;
  background: var(--ag-bg-2); color: var(--ag-ink-3);
}
.ag-pill.ghost { background: transparent; border: 1px solid var(--ag-rule); }

/* ── intro paragraph ── */
.ag-intro {
  font-size: 13px; color: var(--ag-ink-2);
  max-width: 880px; line-height: 1.6;
  margin: 4px 0 22px;
}
.ag-intro a { color: var(--accent); }

/* ── group head (per category) ── */
.ag-group-head {
  display: flex; align-items: baseline; gap: 12px;
  margin: 28px 0 12px;
}
.ag-group-head .g-name {
  font-family: 'Newsreader', var(--ff-display);
  font-style: italic; font-weight: 500;
  font-size: 22px; letter-spacing: -0.005em;
  color: var(--ag-ink);
}
.ag-group-head .g-meta {
  font-family: var(--ff-mono); font-size: 11px;
  color: var(--ag-ink-3); letter-spacing: 0.04em;
}

/* ── agent card (list) ── */
.ag-card {
  display: block;
  background: var(--ag-card);
  border: 1px solid var(--ag-rule);
  border-radius: 12px;
  margin-bottom: 14px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: border-color 120ms, box-shadow 120ms, transform 120ms;
}
.ag-card:hover {
  border-color: var(--ag-rule-2);
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
  text-decoration: none;
}
.ag-card-head {
  padding: 12px 18px;
  border-bottom: 1px solid var(--ag-rule);
  background: var(--ag-bg-2);
  display: grid; grid-template-columns: 1fr auto;
  gap: 12px; align-items: center;
}
.ag-card-title h3 {
  margin: 0;
  font-family: 'Newsreader', var(--ff-display);
  font-style: italic; font-weight: 500;
  font-size: 20px; line-height: 1.1;
  letter-spacing: -0.005em;
  color: var(--ag-ink);
}
.ag-card .ag-src {
  font-family: var(--ff-mono); font-size: 10.5px; color: var(--ag-ink-3);
  margin-top: 4px; display: inline-block;
}
.ag-card .ag-src code {
  background: transparent; padding: 0; border: 0;
}
.ag-card-badges { display: flex; gap: 6px; align-items: center; }
.ag-badge {
  font-family: var(--ff-mono); font-size: 9.5px;
  padding: 2px 7px; border-radius: 999px;
  letter-spacing: 0.06em; text-transform: uppercase; font-weight: 600;
}
.ag-badge.sop { background: var(--ag-live-soft); color: var(--ag-live); }
.ag-badge.custom { background: var(--ag-violet-soft); color: var(--ag-violet); }
.ag-badge.fetcher { background: #E8D4F4; color: #6B2A8E; }
.ag-badge.ver { background: var(--ag-bg-3); color: var(--ag-ink-2); }
.ag-card-body { padding: 14px 18px; }
.ag-card-desc {
  margin: 0 0 12px; font-size: 12.5px; line-height: 1.55;
  color: var(--ag-ink-2); max-width: 720px;
}
.ag-card-stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  padding-top: 8px;
  border-top: 1px dashed var(--ag-rule);
}
.ag-card-stats .stat .lab {
  font-family: var(--ff-mono); font-size: 9.5px;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--ag-ink-3); margin-bottom: 3px;
}
.ag-card-stats .stat .v { font-size: 12.5px; color: var(--ag-ink); }
.ag-card-stats .stat .v.mono { font-family: var(--ff-mono); font-size: 11px; }
.ag-card-stats .stat .v .pill { margin-left: 6px; }

/* ── empty states ── */
.ag-empty {
  background: var(--ag-card-2);
  border: 1px dashed var(--ag-rule-2);
  border-radius: 10px;
  padding: 18px 22px;
  font-size: 12.5px;
  color: var(--ag-ink-3);
  text-align: center;
}
.ag-empty.soft { padding: 12px 14px; text-align: left; }
.ag-empty code {
  background: var(--ag-bg-3); padding: 1px 5px; border-radius: 3px;
  font-family: var(--ff-mono); font-size: 11px;
}

/* ============================================================
   Agent detail
   ============================================================ */
.ag-detail-desc {
  font-size: 13px; color: var(--ag-ink-2);
  max-width: 880px; line-height: 1.6;
  margin: -8px 0 20px;
}
.ag-detail-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 18px;
}
.ag-col { display: flex; flex-direction: column; gap: 18px; }

.ag-section {
  background: var(--ag-card);
  border: 1px solid var(--ag-rule);
  border-radius: 10px;
  padding: 14px 16px;
}
.ag-section-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--ag-rule);
  padding-bottom: 8px;
}
.ag-section-head h3 {
  font-family: 'Newsreader', var(--ff-display);
  font-style: italic; font-weight: 500;
  font-size: 18px; line-height: 1.1;
  letter-spacing: -0.005em;
  color: var(--ag-ink);
  margin: 0;
}
.ag-section-head .meta { color: var(--ag-ink-3); }

/* prompt editor look (dark, monospace) */
.ae-prompt {
  background: var(--ag-ink);
  color: #E8E3D4;
  border-radius: 8px;
  padding: 14px 16px;
  font-family: var(--ff-mono);
  font-size: 12px;
  line-height: 1.65;
  white-space: pre-wrap;
  max-height: 520px;
  overflow-y: auto;
}
.ae-prompt .kw { color: #9AACD9; }
.ae-prompt .var { color: #F2A75C; font-weight: 500; }
.ae-prompt .inc { color: #79C4F4; }

/* memory rules list */
.ag-memory {
  margin: 0; padding-left: 18px;
  font-size: 12.5px; line-height: 1.6;
  color: var(--ag-ink-2);
}
.ag-memory li { margin-bottom: 4px; }

/* run form */
.ag-run-form { display: flex; flex-direction: column; gap: 12px; }
.ag-field { display: flex; flex-direction: column; gap: 4px; }
.ag-field label {
  font-family: var(--ff-mono); font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--ag-ink-3); font-weight: 500;
}
.ag-field label .req { color: var(--ag-danger); margin-left: 2px; }
.ag-field input[type="text"], .ag-field textarea, .ag-field select {
  font-family: var(--ff-body); font-size: 13px;
  background: var(--ag-card-2);
  border: 1px solid var(--ag-rule);
  border-radius: 6px;
  padding: 7px 10px;
  color: var(--ag-ink);
  outline: none;
  transition: border-color 120ms;
}
.ag-field input:focus, .ag-field textarea:focus, .ag-field select:focus {
  border-color: var(--accent);
}
.ag-field textarea { resize: vertical; min-height: 60px; line-height: 1.5; }
.ag-radio-row { display: flex; flex-wrap: wrap; gap: 8px; }
.ag-radio {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; padding: 4px 9px;
  border: 1px solid var(--ag-rule);
  border-radius: 999px;
  background: var(--ag-card);
  cursor: pointer;
}
.ag-radio input { margin: 0; accent-color: var(--accent); }
.ag-radio:hover { border-color: var(--ag-rule-2); }

.ag-form-actions {
  display: flex; align-items: center; gap: 10px;
  margin-top: 4px;
}
.ag-form-actions .ag-btn.primary { margin-left: auto; }

/* spinner — visible only while form has .loading */
.ag-spinner {
  width: 14px; height: 14px;
  border: 2px solid var(--ag-rule);
  border-top-color: var(--accent);
  border-radius: 50%;
  display: none;
  animation: ag-spin 0.7s linear infinite;
}
.ag-running-label {
  display: none;
  font-family: var(--ff-mono); font-size: 11px;
  color: var(--accent);
}
.ag-run-form.loading .ag-spinner,
.ag-run-form.loading .ag-running-label { display: inline-block; }
@keyframes ag-spin { to { transform: rotate(360deg); } }

/* recent runs table */
.ag-runs-table {
  width: 100%; border-collapse: collapse; font-size: 12px;
}
.ag-runs-table th {
  text-align: left;
  font-family: var(--ff-mono); font-size: 9.5px;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--ag-ink-3);
  padding: 6px 8px; border-bottom: 1px solid var(--ag-rule);
  font-weight: 500;
}
.ag-runs-table th.num, .ag-runs-table td.num { text-align: right; }
.ag-runs-table td {
  padding: 8px;
  border-bottom: 1px dashed var(--ag-rule);
}
.ag-runs-table tbody tr { cursor: pointer; }
.ag-runs-table tbody tr:hover { background: var(--ag-bg-2); }

/* ============================================================
   Run detail
   ============================================================ */
.ag-run-stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}
.ag-run-stats .stat-card {
  background: var(--ag-card);
  border: 1px solid var(--ag-rule);
  border-radius: 8px;
  padding: 10px 14px;
}
.ag-run-stats .stat-card.big { background: var(--accent-tint); border-color: var(--accent-soft); }
.ag-run-stats .stat-card .lab {
  font-family: var(--ff-mono); font-size: 9.5px;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--ag-ink-3); margin-bottom: 4px;
}
.ag-run-stats .stat-card .v {
  font-size: 15px; color: var(--ag-ink); font-weight: 600;
}
.ag-run-stats .stat-card .v.mono { font-family: var(--ff-mono); }

.ag-error {
  background: var(--ag-danger-soft);
  border: 1px solid var(--ag-danger);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 18px;
}
.ag-error h4 {
  font-family: var(--ff-mono); font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.08em;
  margin: 0 0 6px; color: var(--ag-danger);
}
.ag-error pre {
  margin: 0; font-family: var(--ff-mono); font-size: 11.5px;
  white-space: pre-wrap; color: var(--ag-ink-2);
}

.ag-run-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 18px;
}

.ag-input-table {
  width: 100%; border-collapse: collapse; font-size: 12.5px;
}
.ag-input-table th {
  text-align: left;
  font-family: var(--ff-mono); font-size: 10.5px;
  color: var(--ag-ink-3); padding: 6px 10px 6px 0;
  border-bottom: 1px dashed var(--ag-rule);
  font-weight: 500; vertical-align: top;
  width: 130px;
}
.ag-input-table td {
  padding: 6px 0; border-bottom: 1px dashed var(--ag-rule);
  color: var(--ag-ink); line-height: 1.5;
  white-space: pre-wrap;
}

.ag-output {
  background: var(--ag-card-2);
  border: 1px solid var(--ag-rule);
  border-radius: 8px;
  padding: 18px 22px;
  font-family: var(--ff-body);
  font-size: 14px; line-height: 1.7;
  color: var(--ag-ink);
  max-width: 640px;
}
.ag-output h1, .ag-output h2, .ag-output h3 {
  font-family: 'Newsreader', var(--ff-display);
  font-style: italic; font-weight: 500;
}
.ag-output p { margin: 0 0 10px; }
.ag-output ul, .ag-output ol { margin: 0 0 10px; padding-left: 22px; }

.ag-includes {
  margin: 0; padding-left: 18px;
  font-size: 12px; line-height: 1.65;
}
.ag-includes code {
  background: var(--ag-bg-3); padding: 1px 5px; border-radius: 3px;
  font-family: var(--ff-mono); font-size: 11px;
}

.ag-verdict-help {
  font-size: 12px; color: var(--ag-ink-2);
  line-height: 1.5; margin: 0 0 10px;
}
.ag-verdict-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.ag-verdict-grid form { margin: 0; }
.ag-verdict-grid .ag-btn { width: 100%; justify-content: center; }
.ag-verdict-grid .ag-btn.ghost { grid-column: span 2; }

.ag-feedback-form { display: flex; flex-direction: column; gap: 10px; }
.ag-feedback-form textarea {
  font-family: var(--ff-body); font-size: 13px;
  background: var(--ag-card-2);
  border: 1px solid var(--ag-rule);
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--ag-ink);
  outline: none; resize: vertical; line-height: 1.5;
}
.ag-feedback-form textarea:focus { border-color: var(--accent); }
.ag-feedback-actions {
  display: flex; align-items: center; gap: 10px;
}
.ag-feedback-actions label { color: var(--ag-ink-3); display: inline-flex; align-items: center; gap: 5px; }
.ag-feedback-actions .ag-btn { margin-left: auto; }

/* ============================================================
   Audit log
   ============================================================ */
.ops-audit .log-shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 14px;
}
.log-filters {
  background: var(--ag-card);
  border: 1px solid var(--ag-rule);
  border-radius: 10px;
  padding: 14px;
  align-self: flex-start;
  position: sticky; top: 14px;
}
.log-filters .lf-group { margin-bottom: 14px; }
.log-filters .lf-group:last-child { margin-bottom: 0; }
.log-filters h5 {
  margin: 0 0 8px;
  font-family: var(--ff-mono); font-size: 10px;
  color: var(--ag-ink-3);
  text-transform: uppercase; letter-spacing: 0.08em;
  font-weight: 500;
}
.log-filters .filter-opt {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 7px; border-radius: 5px;
  font-size: 11.5px;
  color: var(--ag-ink-2);
  text-decoration: none;
  cursor: pointer;
  gap: 8px;
}
.log-filters .filter-opt:hover {
  background: var(--ag-bg-2); color: var(--ag-ink); text-decoration: none;
}
.log-filters .filter-opt.on {
  background: var(--accent-tint);
  color: var(--accent-deep);
  font-weight: 500;
}
.log-filters .filter-opt .ct {
  font-family: var(--ff-mono); font-size: 10px;
  color: var(--ag-ink-3);
}
.log-filters .filter-opt.on .ct { color: var(--accent); }
.log-filters .filter-opt > span:first-child { display: inline-flex; align-items: center; gap: 6px; }
.log-filters .ic-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 2px;
}
.log-filters .ic-dot.ic-violet { background: var(--ag-violet); }
.log-filters .ic-dot.ic-live   { background: var(--ag-live); }
.log-filters .ic-dot.ic-warn   { background: var(--ag-warn); }
.log-filters .ic-dot.ic-danger { background: var(--ag-danger); }
.log-filters .ic-dot.ic-info   { background: var(--ag-info); }
.log-filters .ic-dot.ic-ghost  { background: var(--ag-ink-4); }

.log-table {
  background: var(--ag-card);
  border: 1px solid var(--ag-rule);
  border-radius: 10px;
  overflow: hidden;
}
.log-search {
  padding: 10px 14px;
  border-bottom: 1px solid var(--ag-rule);
  background: var(--ag-bg-2);
  display: flex; align-items: center; gap: 10px;
  font-family: var(--ff-mono); font-size: 11px;
  color: var(--ag-ink-3);
}
.log-search .ic-search { font-size: 13px; }
.log-search .spacer { flex: 1; }

.day-sep {
  padding: 10px 14px;
  background: var(--ag-bg-2);
  font-family: var(--ff-mono); font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--ag-ink-3);
  border-bottom: 1px solid var(--ag-rule);
  border-top: 1px solid var(--ag-rule);
}

.log-row {
  display: grid;
  grid-template-columns: 80px 22px 150px 1fr 130px 22px;
  gap: 10px; align-items: start;
  padding: 9px 14px;
  border-bottom: 1px dashed var(--ag-rule);
  font-size: 11.5px; line-height: 1.45;
}
.log-row:hover { background: var(--ag-bg-2); }
.log-row .t { font-family: var(--ff-mono); font-size: 10.5px; color: var(--ag-ink-3); padding-top: 2px; }
.log-row .ic {
  width: 18px; height: 18px; border-radius: 4px;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-family: var(--ff-mono); font-size: 9.5px; font-weight: 600;
  margin-top: 1px;
}
.log-row .ic.ic-violet { background: var(--ag-violet); }
.log-row .ic.ic-live   { background: var(--ag-live); }
.log-row .ic.ic-warn   { background: var(--ag-warn); }
.log-row .ic.ic-danger { background: var(--ag-danger); }
.log-row .ic.ic-info   { background: var(--ag-info); }
.log-row .ic.ic-ghost  { background: var(--ag-ink); }
.log-row .actor { font-family: var(--ff-mono); font-size: 10.5px; color: var(--ag-ink-3); padding-top: 2px; }
.log-row .msg b { font-weight: 500; color: var(--ag-ink); }
.log-row .ref { font-family: var(--ff-mono); font-size: 10px; color: var(--ag-ink-3); padding-top: 2px; word-break: break-all; }
.log-row .open { text-align: right; padding-top: 2px; }
.log-row .open a { color: var(--ag-ink-3); text-decoration: none; }
.log-row .open a:hover { color: var(--accent); }

.log-row .payload-tog { margin-top: 4px; }
.log-row .payload-tog summary {
  cursor: pointer; outline: none;
  list-style: none;
}
.log-row .payload-tog summary::-webkit-details-marker { display: none; }
.log-row .payload-short { color: var(--ag-ink-4); }
.log-row .payload-full {
  margin: 6px 0 0;
  background: var(--ag-card-2);
  border: 1px solid var(--ag-rule);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 10.5px;
  color: var(--ag-ink-2);
  white-space: pre-wrap; word-break: break-word;
  max-height: 240px; overflow-y: auto;
}

.log-paginator {
  display: flex; align-items: center; justify-content: center;
  gap: 14px; padding: 14px;
  border-top: 1px solid var(--ag-rule);
  background: var(--ag-bg-2);
}

/* ── responsive: collapse 2-col grids on narrow ── */
@media (max-width: 1100px) {
  .ag-detail-grid, .ag-run-grid { grid-template-columns: 1fr; }
  .ag-card-stats { grid-template-columns: repeat(2, 1fr); }
  .ag-run-stats { grid-template-columns: repeat(2, 1fr); }
  .ops-audit .log-shell { grid-template-columns: 1fr; }
  .log-filters { position: static; }
  .log-row { grid-template-columns: 60px 22px 110px 1fr 22px; }
  .log-row .ref { display: none; }
}


/* ============================================================
   Composer + Campaigns + Editor + Settings — Wave 3 pages
   Scoped via `.w3-*` class names; tokens reuse --ag-* + --accent.
   ============================================================ */

/* ── shared: form card / fields / labels ── */
.w3-form-card {
  background: var(--ag-card);
  border: 1px solid var(--ag-rule);
  border-radius: 10px;
  padding: 18px 22px;
  display: flex; flex-direction: column; gap: 14px;
  max-width: 880px;
}
.w3-field-block { display: flex; flex-direction: column; gap: 6px; }
.w3-label {
  font-family: var(--ff-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ag-ink-3);
  font-weight: 600;
}
.w3-label .req { color: var(--accent); margin-left: 3px; }
.w3-form-card input[type=text],
.w3-form-card input[type=number],
.w3-form-card input[type=date],
.w3-form-card select,
.w3-form-card textarea,
.w3-pane-form input[type=text],
.w3-pane-form input[type=number],
.w3-pane-form select,
.w3-pane-form textarea {
  font-family: var(--ff-body);
  font-size: 13px;
  padding: 8px 11px;
  border: 1px solid var(--ag-rule);
  border-radius: 6px;
  background: var(--ag-card-2);
  color: var(--ag-ink);
  outline: none;
  transition: border-color 120ms, box-shadow 120ms;
  width: 100%;
  box-sizing: border-box;
}
.w3-form-card textarea,
.w3-pane-form textarea {
  font-family: var(--ff-mono);
  font-size: 12.5px;
  line-height: 1.55;
  resize: vertical;
  min-height: 80px;
}
.w3-form-card input:focus,
.w3-form-card select:focus,
.w3-form-card textarea:focus,
.w3-pane-form input:focus,
.w3-pane-form select:focus,
.w3-pane-form textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.w3-hint { color: var(--ag-ink-3); margin-top: 2px; }
.w3-form-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
}
.w3-actions-bar {
  display: flex; gap: 10px; align-items: center; padding-top: 8px;
  border-top: 1px dashed var(--ag-rule);
}

/* ── filter bars + flash ── */
.w3-filter-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  background: var(--ag-card-2);
  border: 1px solid var(--ag-rule);
  border-radius: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.w3-filter-bar select {
  font-family: var(--ff-body);
  font-size: 12px;
  padding: 5px 10px;
  border: 1px solid var(--ag-rule);
  border-radius: 5px;
  background: var(--ag-card);
}
.w3-flash {
  padding: 8px 14px;
  background: var(--ag-live-soft);
  border: 1px solid var(--ag-live);
  color: var(--ag-live);
  border-radius: 6px;
  font-size: 12.5px;
  margin-bottom: 14px;
  font-family: var(--ff-mono);
}

/* ============================================================
   Composer · /composer/post
   ============================================================ */
.w3-cost-tile {
  background: var(--ag-card);
  border: 1px solid var(--ag-rule);
  border-radius: 8px;
  padding: 9px 14px;
  text-align: right;
  min-width: 140px;
}
.w3-cost-tile .lab {
  font-family: var(--ff-mono);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ag-ink-3);
}
.w3-cost-tile .v {
  font-family: 'Newsreader', var(--ff-display);
  font-style: italic; font-weight: 500;
  font-size: 22px; color: var(--accent);
  letter-spacing: -0.01em; line-height: 1.1;
}
.w3-cost-tile .sub { margin-top: 2px; color: var(--ag-ink-3); }

.w3-compose-shell {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: start;
}
.w3-pane {
  background: var(--ag-card);
  border: 1px solid var(--ag-rule);
  border-radius: 10px;
  padding: 18px 20px;
  display: flex; flex-direction: column; gap: 14px;
}
.w3-pane-form .ag-run-form { display: flex; flex-direction: column; gap: 14px; }
.w3-pane-head {
  display: flex; justify-content: space-between; align-items: baseline;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--ag-rule);
}
.w3-pane-head h3 {
  font-family: 'Newsreader', var(--ff-display);
  font-style: italic; font-weight: 500;
  font-size: 18px; margin: 0;
  color: var(--ag-ink);
}
.w3-preview-card {
  display: block;
  background: var(--ag-card-2);
  border: 1px solid var(--ag-rule);
  border-radius: 8px;
  padding: 11px 14px;
  text-decoration: none;
  color: var(--ag-ink);
  transition: border-color 120ms, transform 120ms;
}
.w3-preview-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  text-decoration: none;
}
.w3-preview-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 6px;
}
.w3-preview-body {
  font-family: var(--ff-body);
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ag-ink-2);
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: pre-wrap;
}
.w3-preview-error {
  font-family: var(--ff-mono);
  color: var(--ag-danger);
  background: var(--ag-danger-soft);
  padding: 4px 6px; border-radius: 4px;
}
.w3-preview-foot { margin-top: 6px; display: flex; gap: 8px; }
.w3-pane-foot {
  padding-top: 8px;
  border-top: 1px dashed var(--ag-rule);
}

/* ============================================================
   Editor · /editor/article/{slug}
   ============================================================ */
.w3-editor-shell {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 6px;
}
.w3-editor-pane {
  background: var(--ag-card);
  border: 1px solid var(--ag-rule);
  border-radius: 10px;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.w3-editor-pane-head {
  background: var(--ag-bg-2);
  padding: 8px 14px;
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid var(--ag-rule);
}
.w3-editor-md {
  font-family: var(--ff-mono);
  font-size: 13px;
  line-height: 1.6;
  padding: 16px;
  border: 0;
  outline: 0;
  background: #FBF8EF;
  color: var(--ag-ink);
  width: 100%;
  min-height: 60vh;
  height: 60vh;
  resize: vertical;
  box-sizing: border-box;
}
.w3-editor-preview {
  padding: 18px 22px;
  font-family: var(--ff-body);
  font-size: 14px;
  line-height: 1.7;
  color: var(--ag-ink);
  background: #fdfaf2;
  overflow-y: auto;
  max-height: calc(60vh + 36px);
}
.w3-editor-preview h1,
.w3-editor-preview h2,
.w3-editor-preview h3 {
  font-family: 'Newsreader', var(--ff-display);
  font-style: italic; font-weight: 500;
  color: var(--ag-ink);
  margin: 18px 0 10px;
  letter-spacing: -0.015em;
}
.w3-editor-preview h1 { font-size: 28px; }
.w3-editor-preview h2 { font-size: 22px; }
.w3-editor-preview h3 { font-size: 18px; }
.w3-editor-preview p { margin: 0 0 14px; }
.w3-editor-preview a { color: var(--accent); }
.w3-editor-preview code {
  font-family: var(--ff-mono);
  background: var(--ag-bg-3);
  padding: 1px 5px; border-radius: 3px;
  font-size: 12px;
}
.w3-editor-preview pre {
  background: var(--ag-ink);
  color: #f5f1e3;
  padding: 12px 14px;
  border-radius: 6px;
  overflow-x: auto;
  font-family: var(--ff-mono);
  font-size: 12px;
}
.w3-editor-preview img { max-width: 100%; height: auto; border-radius: 6px; }
.w3-editor-preview blockquote {
  border-left: 3px solid var(--accent);
  padding: 6px 14px;
  background: var(--accent-tint);
  font-style: italic;
  color: var(--ag-ink-2);
  margin: 14px 0;
  border-radius: 0 6px 6px 0;
}
.w3-saved-pill {
  background: var(--ag-live-soft);
  color: var(--ag-live);
  padding: 3px 9px;
  border-radius: 999px;
  font-family: var(--ff-mono);
  font-size: 11px;
  font-weight: 600;
}

/* ============================================================
   Campaigns · /campaigns + /campaigns/{id}
   ============================================================ */
.w3-camp-table {
  background: var(--ag-card);
  border: 1px solid var(--ag-rule);
  border-radius: 10px;
  overflow: hidden;
}
.w3-camp-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr 1fr;
  align-items: center;
  padding: 11px 16px;
  border-bottom: 1px dashed var(--ag-rule);
  text-decoration: none;
  color: var(--ag-ink);
  transition: background 100ms;
}
.w3-camp-row:hover { background: var(--ag-bg-2); text-decoration: none; }
.w3-camp-row:last-child { border-bottom: 0; }
.w3-camp-row.w3-camp-head {
  background: var(--ag-bg-2);
  font-family: var(--ff-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ag-ink-3);
  padding: 8px 16px;
}
.w3-camp-row.w3-camp-head:hover { background: var(--ag-bg-2); }
.w3-camp-name { display: flex; flex-direction: column; gap: 2px; }
.w3-camp-row .num { text-align: right; }
.w3-camp-row .num.mono { font-family: var(--ff-mono); font-size: 12px; }

/* Campaign hero */
.w3-camp-hero {
  background: linear-gradient(180deg, var(--ag-card) 0%, var(--ag-card-2) 100%);
  border: 1px solid var(--ag-rule);
  border-radius: 12px;
  padding: 22px 26px;
  margin-bottom: 16px;
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 22px;
}
.w3-camp-title {
  font-family: 'Newsreader', var(--ff-display);
  font-style: italic; font-weight: 500;
  font-size: 36px; line-height: 1.05;
  letter-spacing: -0.015em;
  margin: 4px 0 12px;
  color: var(--ag-ink);
}
.w3-camp-meta-row {
  display: flex; gap: 22px; flex-wrap: wrap;
  margin-top: 8px;
}
.w3-camp-meta-row .item { display: flex; flex-direction: column; gap: 2px; }
.w3-camp-meta-row .item .l {
  font-family: var(--ff-mono); font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--ag-ink-3);
}
.w3-camp-meta-row .item .v {
  font-family: 'Newsreader', var(--ff-display);
  font-style: italic; font-weight: 500;
  font-size: 16px; color: var(--ag-ink);
}
.w3-camp-progress h5 {
  margin: 0 0 6px;
  font-family: var(--ff-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ag-ink-3);
}
.w3-progress-bar {
  height: 8px;
  background: var(--ag-bg-2);
  border-radius: 999px;
  overflow: hidden;
}
.w3-progress-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--ag-live) 0%, var(--accent) 100%);
}

/* Campaign sections */
.w3-section {
  background: var(--ag-card);
  border: 1px solid var(--ag-rule);
  border-radius: 12px;
  padding: 18px 22px;
  margin-bottom: 14px;
}
.w3-section-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 12px;
  gap: 12px;
}
.w3-section-head h2 {
  font-family: 'Newsreader', var(--ff-display);
  font-style: italic; font-weight: 500;
  font-size: 22px; margin: 0;
  color: var(--ag-ink); letter-spacing: -0.005em;
}
.w3-md-render {
  font-family: var(--ff-body);
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--ag-ink-2);
}
.w3-md-render h1,
.w3-md-render h2,
.w3-md-render h3 {
  font-family: 'Newsreader', var(--ff-display);
  font-style: italic; font-weight: 500;
  color: var(--ag-ink);
  margin: 14px 0 6px;
}
.w3-md-render code {
  background: var(--ag-bg-3); padding: 1px 4px; border-radius: 3px;
  font-family: var(--ff-mono); font-size: 12px;
}

.w3-mat-list { display: flex; flex-direction: column; gap: 0; }
.w3-mat-row {
  display: grid;
  grid-template-columns: 3fr 1fr 1fr;
  padding: 9px 14px;
  border-bottom: 1px dashed var(--ag-rule);
  text-decoration: none;
  color: var(--ag-ink);
  background: var(--ag-card-2);
  transition: background 100ms;
}
.w3-mat-row:first-child { border-radius: 8px 8px 0 0; }
.w3-mat-row:last-child { border-bottom: 0; border-radius: 0 0 8px 8px; }
.w3-mat-row:hover { background: var(--ag-bg-2); text-decoration: none; }
.w3-mat-name { display: flex; flex-direction: column; gap: 2px; }

.w3-angles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
}
.w3-angle-card {
  background: var(--ag-card-2);
  border: 1px solid var(--ag-rule);
  border-radius: 8px;
  padding: 11px 14px;
}
.w3-angle-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 6px;
}
.w3-angle-body {
  font-family: 'Newsreader', var(--ff-display);
  font-style: italic;
  font-size: 15px;
  line-height: 1.45;
  color: var(--ag-ink);
}

.w3-plan-empty .w3-plan-grid {
  display: grid;
  grid-template-columns: 110px repeat(7, 1fr);
  border: 1px solid var(--ag-rule);
  border-radius: 6px;
  overflow: hidden;
  background: var(--ag-card-2);
}
.w3-plan-grid .cn,
.w3-plan-grid .h,
.w3-plan-grid .cell {
  padding: 7px 8px;
  text-align: center;
  border-bottom: 1px dashed var(--ag-rule);
  border-right: 1px solid var(--ag-rule);
  font-family: var(--ff-mono);
  font-size: 11px;
  color: var(--ag-ink-2);
}
.w3-plan-grid .cn { text-align: left; background: var(--ag-bg-2); }
.w3-plan-grid .h {
  background: var(--ag-bg-2);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ag-ink-3);
}
.w3-plan-grid .cell.empty { color: var(--ag-ink-4); }

.w3-quick-agents { display: flex; gap: 10px; flex-wrap: wrap; }

/* ============================================================
   Settings · /settings (gates + integrations tabs)
   ============================================================ */
.w3-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--ag-rule);
  margin-bottom: 16px;
}
.w3-tab {
  padding: 9px 16px;
  font-family: var(--ff-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  color: var(--ag-ink-3);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 120ms, border-color 120ms;
}
.w3-tab:hover {
  color: var(--ag-ink);
  text-decoration: none;
}
.w3-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.w3-cost-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}
.w3-cost-stat {
  background: var(--ag-card-2);
  border: 1px solid var(--ag-rule);
  border-radius: 8px;
  padding: 10px 14px;
}
.w3-cost-stat .lab {
  font-family: var(--ff-mono);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ag-ink-3);
}
.w3-cost-stat .v {
  font-family: 'Newsreader', var(--ff-display);
  font-style: italic; font-weight: 500;
  font-size: 24px;
  color: var(--ag-ink);
  margin-top: 4px;
  letter-spacing: -0.01em;
}
.w3-progress-cap { height: 10px; }

.w3-mode-form { display: flex; flex-direction: column; gap: 10px; }
.w3-mode-radio { font-size: 13px; }

.w3-thr-table {
  background: var(--ag-card);
  border: 1px solid var(--ag-rule);
  border-radius: 10px;
  overflow: hidden;
}
.w3-thr-row {
  display: grid;
  grid-template-columns: 2.5fr 1fr 1.4fr 0.5fr 0.7fr 0.7fr;
  align-items: center;
  padding: 9px 14px;
  border-bottom: 1px dashed var(--ag-rule);
  gap: 10px;
}
.w3-thr-row:last-child { border-bottom: 0; }
.w3-thr-row.w3-thr-head {
  background: var(--ag-bg-2);
  font-family: var(--ff-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ag-ink-3);
  padding: 8px 14px;
}
.w3-thr-name { display: flex; flex-direction: column; gap: 2px; }
.w3-thr-row .num { text-align: right; }
.w3-thr-input {
  width: 70px;
  font-family: var(--ff-mono);
  font-size: 12px;
  padding: 4px 7px;
  border: 1px solid var(--ag-rule);
  border-radius: 5px;
  background: var(--ag-card-2);
  text-align: right;
  box-sizing: border-box;
}
.w3-thr-input:focus { border-color: var(--accent); outline: 0; box-shadow: 0 0 0 3px var(--accent-soft); }

/* Integrations grid */
.w3-int-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}
.w3-int-card {
  background: var(--ag-card);
  border: 1px solid var(--ag-rule);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 10px;
  position: relative;
}
.w3-int-card.live {
  border-color: var(--ag-live);
  background: linear-gradient(180deg, var(--ag-live-soft) 0%, var(--ag-card) 35%);
}
.w3-int-head {
  display: flex; align-items: flex-start; gap: 10px;
}
.w3-int-logo {
  width: 36px; height: 36px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--ff-mono);
  font-size: 11px; font-weight: 600;
  flex-shrink: 0;
}
.w3-int-name { flex: 1; }
.w3-int-name .nm {
  font-family: 'Newsreader', var(--ff-display);
  font-style: italic; font-weight: 500;
  font-size: 17px;
  color: var(--ag-ink);
}
.w3-int-name .role {
  color: var(--ag-ink-3);
  letter-spacing: 0.04em;
}
.w3-int-kv {
  display: flex; flex-direction: column; gap: 2px;
  font-size: 11.5px;
}
.w3-int-kv .kv {
  display: flex; justify-content: space-between;
  padding: 3px 0;
  border-bottom: 1px dashed var(--ag-rule);
}
.w3-int-kv .kv:last-child { border-bottom: 0; }
.w3-int-kv .k { color: var(--ag-ink-3); }
.w3-int-kv .v { color: var(--ag-ink); }
.w3-int-actions { margin-top: auto; display: flex; gap: 6px; padding-top: 6px; }

/* Responsive collapses */
@media (max-width: 1100px) {
  .w3-compose-shell { grid-template-columns: 1fr; }
  .w3-editor-shell { grid-template-columns: 1fr; }
  .w3-camp-hero { grid-template-columns: 1fr; }
  .w3-cost-grid { grid-template-columns: repeat(2, 1fr); }
  .w3-camp-row { grid-template-columns: 2fr 1fr 1fr; }
  .w3-thr-row { grid-template-columns: 2fr 1fr 0.8fr 0.8fr; }
  .w3-form-row { grid-template-columns: 1fr; }
}

/* ============================================================
   Placeholder pages — Wave 3 IA completion
   ============================================================ */
.wip-banner { background:#FEF3C7; border:1px solid #FCD34D; color:#92400E; padding:10px 14px; border-radius:8px; margin-bottom:18px; font-size:13px; line-height:1.55; }
.wip-banner strong { color:#7C2D12; }
.wip-badge { display:inline-block; background:#FCA5A5; color:#7F1D1D; padding:2px 7px; border-radius:4px; font-size:10px; text-transform:uppercase; letter-spacing:0.6px; font-weight:700; }
.fake-data-note { font-size:11px; color:#92400E; font-style:italic; margin-top:6px; }
.placeholder-shell { max-width:900px; margin:0 auto; padding:24px; }

/* Kanban (pipeline) */
.kanban-col { background:var(--surface); border:1px solid var(--border); border-radius:9px; padding:10px; min-height:300px; }
.kanban-col-head { font-family:var(--ff-body); font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:0.6px; color:var(--muted); margin-bottom:8px; padding:4px 6px; border-bottom:1px solid var(--border); }
.kanban-card { background:var(--bg); border:1px solid var(--border); border-radius:7px; padding:9px 11px; margin-bottom:7px; font-size:12.5px; cursor:default; transition:border-color 140ms,box-shadow 140ms; }
.kanban-card:hover { border-color:var(--ghost); }
.kanban-card .name { font-weight:600; color:var(--text); }
.kanban-card .meta { font-size:11px; color:var(--muted); margin-top:3px; line-height:1.4; }

/* Workflow SVG canvas */
.workflow-svg { width:100%; height:auto; background:var(--surface); border:1px solid var(--border); border-radius:10px; padding:18px; }

/* Small ghost button reused by pipeline + contacts placeholder pages */
.ag-btn { display:inline-block; padding:6px 11px; border:1px solid var(--border); border-radius:6px; font-size:11.5px; color:var(--text); text-decoration:none; background:var(--bg); transition:border-color 140ms,background 140ms; font-family:var(--ff-body); font-weight:500; }
.ag-btn:hover { border-color:var(--accent); color:var(--accent); }
.ag-btn.primary { background:var(--accent); color:#fff; border-color:var(--accent-deep); }
.ag-btn.primary:hover { background:var(--accent-deep); color:#fff; }
