/* ============================================================================
   Influence — Deal Studio
   Warm neutral design system on Inter. A near-black accent; state is carried
   through soft tinted pills, hairline borders and a delivery-tracking timeline.
   ========================================================================== */
:root {
  --bg: #f5f4f0;            /* app background (warm off-white) */
  --surface: #ffffff;      /* cards, sidebar, topbar */
  --surface-2: #faf9f6;    /* inset wells / inputs */
  --surface-3: #f2f0eb;    /* hover wells / neutral chips */

  --ink: #191817;          /* primary text */
  --ink-2: #4d4b46;        /* secondary text */
  --muted: #8a8880;        /* meta text */
  --faint: #a3a19b;        /* faint labels / icons */
  --faint-2: #b4b2ac;      /* faintest text / empty dashes */

  --line: #e6e4de;         /* hairline borders */
  --line-2: #dcdad3;       /* input / stronger borders */
  --line-3: #eeece6;       /* faintest dividers (stat cells, rows) */

  --accent: #191817;       /* near-black accent (primary buttons) */
  --accent-strong: #000000;
  --accent-faded: #efedea; /* active campaign row bg */
  --accent-badge: #d8d5d0; /* active count badge bg */
  --accent-dot: #b4b2ac;   /* faded timeline dot */
  --accent-rgba: 25,24,23;

  --green: #147a52;        /* positive terminal state / rate */
  --green-live: #3fae74;   /* live indicator */
  --danger: #c53127;       /* delegate badge / destructive */
  --danger-live: #e0463f;  /* pending dot */
  --warn: #b4471f;         /* remove-all / warnings */

  --radius: 16px;
  --radius-md: 12px;
  --radius-sm: 10px;
  --radius-xs: 8px;

  --shadow-card: 0 1px 2px rgba(20, 18, 15, 0.03);
  --shadow-btn: 0 2px 6px rgba(20, 18, 15, 0.18);
  --ring: 0 0 0 3px rgba(25, 24, 23, 0.12);

  --font: 'Inter', ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
/* Keep the `hidden` attribute authoritative even when an element also carries a
   class that sets `display` (e.g. .stats/.scrape-progress use display:flex). */
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
::selection { background: #d9d1fb; }
.num { font-variant-numeric: tabular-nums; }
.meta { color: var(--muted); }
a { color: var(--ink); }

/* Scrollbars */
.io-scroll { scrollbar-width: thin; scrollbar-color: #dcdad3 var(--bg); }
.io-scroll::-webkit-scrollbar { width: 10px; height: 10px; }
.io-scroll::-webkit-scrollbar-thumb { background: #dcdad3; border-radius: 8px; border: 3px solid var(--bg); }
.io-scroll::-webkit-scrollbar-thumb:hover { background: var(--faint); }

/* --- Top bar ------------------------------------------------------------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; height: 60px; flex-shrink: 0;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-logo { height: 14px; width: auto; display: block; }
.topbar-logo path { fill: var(--ink); }
.topbar-divider { width: 1px; height: 16px; background: #e0ded7; }
.topbar-title { font-weight: 500; font-size: 15px; letter-spacing: 0.01em; color: var(--ink-2); }
.auth {
  display: flex; align-items: center; gap: 9px;
  color: var(--muted); font-size: 13px;
}
.auth b { color: var(--accent); font-weight: 600; }
.auth a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.live-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--green-live); box-shadow: 0 0 0 3px rgba(63, 174, 116, 0.16);
}

/* Hamburger — hidden on desktop, shown on narrow screens. */
.icon-btn {
  display: none; background: transparent; border: 0; padding: 6px; cursor: pointer;
  width: 36px; height: 36px; border-radius: var(--radius-xs);
}
.icon-btn:hover { background: var(--surface-3); }
.hamburger, .hamburger::before, .hamburger::after {
  display: block; width: 20px; height: 2px; background: var(--ink);
  border-radius: 2px; position: relative;
}
.hamburger::before { content: ''; position: absolute; top: -6px; left: 0; }
.hamburger::after  { content: ''; position: absolute; top:  6px; left: 0; }

/* --- Layout -------------------------------------------------------------- */
.layout { display: flex; flex: 1; min-height: 0; position: relative; }
.sidebar {
  width: 290px; flex-shrink: 0; background: var(--surface);
  border-right: 1px solid var(--line); padding: 22px 16px;
  overflow-y: auto; display: flex; flex-direction: column; gap: 2px;
}
.sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(20, 18, 15, 0.45); z-index: 19; }
.sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 8px; margin-bottom: 2px;
}
.sidebar-header h3 {
  margin: 0; font-size: 11px; font-weight: 600; letter-spacing: 0.09em;
  color: var(--faint); text-transform: uppercase;
}
.sidebar-synced { padding: 0 8px; margin: 0 0 14px; font-size: 11.5px; color: var(--faint-2); }

.tree { display: flex; flex-direction: column; }
.tree .brand-group { margin-bottom: 12px; }
.tree .brand-name {
  padding: 0 8px 7px; font-size: 10.5px; font-weight: 600; letter-spacing: 0.11em;
  color: var(--faint-2); text-transform: uppercase;
}
.tree .campaign-item {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; margin: 1px 0; border-radius: 9px; cursor: pointer;
  transition: background 0.12s;
}
.tree .campaign-item:hover { background: var(--surface-3); }
.tree .campaign-item.active { background: var(--accent-faded); }
.tree .campaign-name {
  flex: 0 1 auto; font-size: 14px; font-weight: 500; color: var(--ink-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-right: auto;
}
.tree .campaign-item.active .campaign-name { font-weight: 600; color: var(--ink); }
.tree .campaign-item.has-pending .campaign-name { margin-right: 0; }
.tree .pending-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--danger-live);
  box-shadow: 0 0 0 3px rgba(224, 70, 63, 0.18);
  margin-left: auto; margin-right: 2px; flex-shrink: 0;
}
.tree .count-pill {
  font-size: 12px; font-weight: 500; color: var(--faint); background: var(--surface-3);
  border-radius: 20px; padding: 2px 9px; min-width: 26px; text-align: center; flex-shrink: 0;
}
.tree .campaign-item.active .count-pill { color: var(--accent); background: var(--accent-badge); }

.sidebar-footer { margin-top: auto; padding-top: 14px; }
.sidebar-nav-link {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius-md); cursor: pointer; font-family: inherit;
}
.sidebar-nav-link:hover { background: var(--surface-3); }
.sidebar-nav-link span:first-child { font-size: 14px; font-weight: 600; color: #2b2a27; }
.sidebar-nav-link .arrow { font-size: 16px; color: #9b9a95; }

/* --- Main ---------------------------------------------------------------- */
.main { flex: 1; min-width: 0; overflow-y: auto; padding: 34px 40px 60px; }
.main-inner { max-width: 1180px; margin: 0 auto; }

.main-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 32px; flex-wrap: wrap; margin-bottom: 30px;
}
.eyebrow {
  font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 6px;
}
.main-heading h1 {
  font-weight: 700; font-size: 32px; letter-spacing: -0.025em; margin: 0; line-height: 1.1;
}
.main-heading .subhead { max-width: 62ch; margin-top: 10px; }
.back-btn { margin-bottom: 12px; }

/* Stats bar */
.stats {
  display: flex; align-items: stretch; background: var(--surface);
  border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
}
.stats .stat-cell {
  display: flex; flex-direction: column; gap: 5px; padding: 14px 20px;
  /* Reset button chrome — these are clickable filters, not buttons visually. */
  background: none; border: 0; margin: 0; font: inherit; text-align: left;
  cursor: pointer; position: relative; transition: background 0.12s ease;
}
.stats .stat-cell + .stat-cell { border-left: 1px solid var(--line-3); }
.stats .stat-cell:hover { background: var(--surface-2); }
/* Active filter: tinted well + a bottom marker so it reads as the selected tab. */
.stats .stat-cell.active { background: var(--surface-3); }
.stats .stat-cell.active::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0;
  height: 2px; background: var(--green);
}
.stats .stat-cell:focus-visible { outline: 2px solid var(--green); outline-offset: -2px; }
.stats .stat-label {
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--faint); white-space: nowrap;
}
.stats .stat-cell.active .stat-label { color: var(--ink-2); }
.stats .stat-value { font-size: 22px; font-weight: 600; line-height: 1; color: var(--ink); }
.stats .stat-value.accent { color: var(--green); }

/* --- Cards --------------------------------------------------------------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; margin-bottom: 22px; box-shadow: var(--shadow-card);
}
.card h2 { font-weight: 600; font-size: 18px; letter-spacing: -0.01em; margin: 0 0 16px; }
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 20px;
}
.card-header h2 { font-size: 20px; margin: 0; }
.card-header .actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }

.form-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; margin-top: 16px; flex-wrap: wrap;
}
.form-foot.end { justify-content: flex-end; }
.form-foot .push { margin-right: auto; }

.field-label { font-weight: 600; font-size: 13px; display: block; margin-bottom: 8px; color: var(--ink-2); }
.toggle-row { display: flex; align-items: center; gap: 12px; }
.checkbox-label { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
input[type="checkbox"] { accent-color: var(--accent); width: 15px; height: 15px; }

/* --- Form controls ------------------------------------------------------- */
input[type=text], input[type=email], input[type=url], input[type=number], select, textarea {
  font-family: inherit; font-size: 13.5px; color: var(--ink);
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 11px; padding: 12px 14px; outline: none;
  transition: border-color 0.12s, box-shadow 0.12s;
}
input:focus, select:focus, textarea:focus { border-color: var(--ink); box-shadow: var(--ring); }
textarea {
  width: 100%; min-height: 116px; resize: vertical; line-height: 1.7; padding: 15px 16px;
}
textarea::placeholder, input::placeholder { color: var(--faint-2); }

/* --- Buttons ------------------------------------------------------------- */
button {
  font-family: inherit; cursor: pointer; font-size: 13.5px; font-weight: 500;
  border-radius: 9px; padding: 9px 15px; border: 1px solid var(--line-2);
  background: var(--surface); color: var(--ink-2);
  transition: background 0.12s, color 0.12s, border-color 0.12s, opacity 0.12s;
}
button:hover { background: var(--surface-3); }
button:disabled { opacity: 0.5; cursor: default; }

.btn-primary {
  font-weight: 600; color: #fff; background: var(--accent); border: 1px solid var(--accent);
}
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn-lg { font-size: 14px; padding: 12px 40px; border-radius: 10px; box-shadow: var(--shadow-btn); }

.ghost { color: var(--ink-2); background: var(--surface); border: 1px solid var(--line-2); }
.ghost:hover { background: var(--surface-3); }
.ghost.small { font-size: 12px; font-weight: 500; padding: 4px 11px; border-radius: 7px; background: var(--surface-3); border-color: var(--line); color: var(--ink-2); }
.ghost.small:hover { background: var(--line); }
.ghost.danger { color: var(--warn); border-color: #ecc9bb; background: var(--surface); }
.ghost.danger:hover { background: #fbeee7; }

.has-badge { position: relative; display: inline-flex; align-items: center; gap: 8px; }
.count-badge {
  font-size: 11.5px; font-weight: 700; color: var(--danger); background: #fdecec;
  border: 1px solid #f5c8c4; border-radius: 20px; padding: 1px 8px; line-height: 1.5;
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.hint { font-size: 13px; color: var(--muted); margin: 0; }

/* --- Settings chips ------------------------------------------------------ */
.settings-rows { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 6px; }
.setting-chip {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 11px; padding: 12px 16px;
}
.setting-chip.grow { flex: 1; min-width: 320px; }
.setting-label { font-size: 13px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.setting-chip input {
  font-size: 13px; background: var(--surface); border: 1px solid var(--line-2);
  border-radius: 8px; padding: 8px 11px; width: 130px;
}
.setting-chip input.grow-input { flex: 1; min-width: 0; width: auto; color: var(--ink-2); }
.setting-chip .hint { flex-basis: 100%; }
.setting-chip .hint:empty { display: none; }

/* --- Segmented toggle (3-way), e.g. the campaign Usage Rights control ---- */
.segmented {
  display: inline-flex; background: var(--surface); border: 1px solid var(--line-2);
  border-radius: 8px; padding: 2px; gap: 2px;
}
.segmented-opt {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  font-family: inherit; font-size: 13px; font-weight: 500; color: var(--ink-2);
  padding: 7px 12px; border-radius: 6px; white-space: nowrap;
  transition: background .12s, color .12s;
}
.segmented-opt:hover { color: var(--ink); }
.segmented-opt.active { background: var(--accent); color: #fff; font-weight: 600; }
.segmented-opt:disabled { opacity: .5; cursor: not-allowed; }

.scrape-progress { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
#scrape-progress-text { flex: 1; }
#fetch-status { margin-top: 12px; }

/* --- Creator grid table -------------------------------------------------- */
.table-scroll { width: 100%; overflow-x: auto; }
.creator-grid { min-width: 860px; margin-top: 14px; }
.grid-head, .creator-row {
  display: grid; grid-template-columns: 2fr 1.7fr 1.6fr 1fr 2fr; gap: 20px;
}
.grid-head {
  padding: 0 6px 12px; border-bottom: 1px solid var(--line);
}
.grid-head > div {
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint);
}
.creator-row { padding: 20px 6px; border-bottom: 1px solid var(--line-3); align-items: start; }
.creator-row:last-child { border-bottom: none; }

/* Creator cell */
.cr-creator { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cr-avatar {
  width: 38px; height: 38px; border-radius: 50%; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 15px; flex-shrink: 0;
}
.cr-identity { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.cr-handle { font-size: 13.5px; font-weight: 500; color: var(--ink); line-height: 1.2; }
.cr-handle a { color: inherit; text-decoration: none; }
.cr-handle a:hover { text-decoration: underline; }
/* First name / Full name — two separate editable rows. The tag reuses the
   same tiny uppercase-label language as the grid column headers so it reads
   as a label, not extra body text. */
.cr-name-row { display: flex; align-items: baseline; gap: 5px; min-width: 0; }
.cr-name-tag {
  flex-shrink: 0; font-size: 10px; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--faint);
}
.cr-name-value {
  font-size: 13px; color: var(--muted); line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
.cr-name-value.empty { color: var(--faint-2); }

/* Email cell */
.cr-email { display: flex; flex-direction: column; justify-content: center; gap: 3px; font-size: 12.5px; color: var(--ink-2); word-break: break-all; }
.cr-email .empty { color: var(--faint-2); }
.cr-email-src { font-size: 11px; color: var(--faint); }
.cr-email-src a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.cr-email-src a:hover { color: var(--ink-2); }

/* Reach cell */
.cr-reach { display: flex; flex-direction: column; justify-content: center; gap: 3px; }
.cr-reach .reach-main { font-size: 15px; font-weight: 600; color: var(--ink); }
.cr-reach .reach-main .unit { font-size: 11.5px; font-weight: 400; color: var(--faint); }
.cr-reach .reach-sub { font-size: 12px; color: var(--muted); }
.cr-reach .empty { font-size: 13px; color: var(--faint-2); }

/* Rate cell (Deals column) */
.cr-rate { display: flex; flex-direction: column; justify-content: center; gap: 4px; font-size: 15px; font-weight: 500; }
.cr-rate .rate-value { color: var(--green); }
.cr-rate .rate-value.empty { color: var(--faint-2); }
/* Deliverables shown once the creator has accepted. Offer type is a coloured
   pill (badge) so the deal shape reads at a glance; the individual fields are
   tiny-tag prefixed rows so each line is self-explanatory. */
.cr-rate .deal-badge {
  align-self: flex-start;
  margin-top: 3px;
  padding: 3px 9px;
  background: var(--surface-3);
  color: var(--ink);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.3;
}
.cr-rate .deal-line {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
  min-width: 0;
}
.cr-rate .deal-tag {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--faint);
}
.cr-rate .deal-val { min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* Editable Deals column (pending contracts). A faint header tells the admin the
   terms below are editable; the paid-ads value is a click-to-toggle chip. */
.cr-rate .deal-edit-hint {
  margin-top: 6px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint-2);
}
.cr-rate .deal-toggle {
  cursor: pointer;
  border-radius: 6px;
  padding: 0 5px;
  font-weight: 600;
  color: var(--faint);
  box-shadow: inset 0 0 0 1px var(--surface-3);
}
.cr-rate .deal-toggle:hover { background: var(--surface-3); }
.cr-rate .deal-toggle.on { color: var(--green); box-shadow: inset 0 0 0 1px var(--green); }

/* Status cell — pill, copy-link and delete-icon share a single left-aligned
   row so they read as one group. Previously the delete icon was pushed to the
   far right via space-between, which created a large empty gap on wide
   columns and made the pill visually detached from the timeline below it. */
.cr-status { display: flex; flex-direction: column; gap: 12px; position: relative; }
.cr-status-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cr-status-left { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.cr-status-left .status-pill { flex-shrink: 0; }
.cr-copy-contract { flex-shrink: 0; }
.status-pill {
  display: inline-flex; align-items: center; font-size: 11px; font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase; border-radius: 7px;
  padding: 5px 10px; white-space: nowrap;
}
.status-pill.pending_extraction { background: var(--surface-3); color: var(--muted); }
.status-pill.email_found        { background: #e9edf4; color: #47566e; }
.status-pill.no_email           { background: var(--surface-3); color: var(--faint); }
.status-pill.outreach_queued    { background: #eef2f7; color: #5a6b86; }
.status-pill.outreach_sent      { background: #f6ecd8; color: #9a6412; }
.status-pill.followup_sent      { background: #f3e4cb; color: #855a1a; }
.status-pill.replied            { background: #dde7f7; color: #2952a3; }
.status-pill.accepted           { background: #e1f1e9; color: #147a52; }
.status-pill.failed             { background: #fbe6e3; color: #c53127; }
.status-pill.invalid_email      { background: #fbe6e3; color: #b4471f; }
.status-pill.duplicate          { background: #ece9f5; color: #6b5aa8; }
.status-pill.stopped            { background: #eceff3; color: #5b6472; }

.icon-btn-sq {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line-3);
  background: var(--surface); color: var(--warn); cursor: pointer; flex-shrink: 0; padding: 0;
}
.icon-btn-sq:hover { background: #fbeee7; border-color: #ecc9bb; }

.cr-send-btn { align-self: flex-start; }

/* Rate substep (used when a "Creator quoted rates" timeline step expands into
   its per-option list). Same dot-prefix as the plain substep, but with an
   amount+description row so "$3,500 · for 300,000 combined views" reads
   cleanly. */
.timeline-substep-rate {
  display: flex; align-items: baseline; gap: 8px;
  padding-right: 4px;
}
.timeline-substep-amt {
  flex-shrink: 0; color: var(--green); font-weight: 600; font-size: 11px;
}
.timeline-substep-desc {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Status timeline (delivery-tracking) */
.timeline { display: flex; flex-direction: column; }
.timeline-step { display: flex; align-items: flex-start; gap: 10px; position: relative; }
.timeline-rail { display: flex; flex-direction: column; align-items: center; align-self: stretch; }
.timeline-dot { border-radius: 50%; flex-shrink: 0; }
.timeline-dot.done { width: 9px; height: 9px; background: var(--accent-dot); margin-top: 3px; margin-left: 1px; margin-right: 1px; }
.timeline-dot.current {
  width: 11px; height: 11px; background: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgba), 0.18); margin-top: 2px;
}
.timeline-dot.tone-success.current { background: var(--green); box-shadow: 0 0 0 3px rgba(20, 122, 82, 0.18); }
.timeline-dot.tone-muted { background: var(--faint-2); }
.timeline-line { width: 2px; flex: 1; background: var(--line); margin-top: 2px; min-height: 10px; }
.timeline-body { min-width: 0; }
.timeline-label { font-size: 12.5px; font-weight: 500; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.timeline-step.current .timeline-label { font-weight: 600; color: #2b2a27; }
.timeline-step.tone-success.current .timeline-label { color: var(--green); }
.timeline-time { font-size: 11px; color: var(--faint-2); }

/* Outreach read-receipt ticks (WhatsApp-style), rendered inline inside the
   "Outreach sent" timeline step. Gray = sent / not-seen, green = seen or
   replied. Fed by Instantly opens + follow-up sends via the webhook. */
.outreach-ticks { display: inline-flex; align-items: center; line-height: 0; }
.outreach-ticks svg { display: block; }
.outreach-ticks.tone-gray  { color: var(--faint); }
.outreach-ticks.tone-green { color: #1aa06d; }

/* Collapsed run of repeated statuses (e.g. "Creator replied ×3"). */
.timeline-group-head {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  user-select: none; border-radius: 6px; margin: -1px -4px; padding: 1px 4px;
}
.timeline-group-head:hover { background: var(--surface-3); }
.timeline-count {
  font-size: 10px; font-weight: 600; color: var(--ink-2); background: var(--surface-3);
  border: 1px solid var(--line); border-radius: 20px; padding: 0 6px; line-height: 16px;
}
.timeline-group-head:hover .timeline-count { background: var(--surface); }
.timeline-chevron { font-size: 9px; color: var(--faint); transition: transform 0.15s; }
.timeline-group-head.open .timeline-chevron { transform: rotate(180deg); }
.timeline-substeps { display: flex; flex-direction: column; gap: 4px; margin-top: 5px; }
.timeline-substep { position: relative; padding-left: 12px; font-size: 10.5px; color: var(--faint); }
.timeline-substep::before {
  content: ''; position: absolute; left: 1px; top: 5px;
  width: 4px; height: 4px; border-radius: 50%; background: var(--accent-dot);
}

/* Editable cells */
.editable { cursor: text; border-radius: 6px; }
.editable:hover { background: var(--surface-3); box-shadow: 0 0 0 4px var(--surface-3); }
.editable input {
  width: 100%; box-sizing: border-box; padding: 5px 7px; font: inherit;
  border: 1px solid var(--line-2); border-radius: 7px; background: var(--surface);
}

/* --- Delegate window ----------------------------------------------------- */
.delegate-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px; margin-bottom: 16px; box-shadow: var(--shadow-card);
}
.delegate-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.delegate-head a { font-weight: 600; color: var(--ink); text-decoration: none; }
.delegate-head a:hover { text-decoration: underline; }
.delegate-head .meta { font-size: 12.5px; margin-top: 2px; }
.delegate-reason {
  flex: 0 0 auto; font-size: 11px; font-weight: 600; color: var(--ink-2);
  background: var(--surface-3); padding: 4px 10px; border-radius: 999px; max-width: 55%;
}
.delegate-reason.offer { color: #fff; background: var(--accent); }
.delegate-question {
  margin-top: 12px; padding: 12px 14px; background: var(--surface-2);
  border-left: 3px solid var(--accent); border-radius: var(--radius-xs);
  font-size: 13px; color: var(--ink); white-space: pre-wrap; word-break: break-word;
}
.delegate-subtitle { margin-top: 12px; }
/* A mid-approval reply surfaced beneath the offer configurator. */
.delegate-handoff-msg { margin-top: 20px; }
.delegate-handoff-label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.delegate-handoff-msg .delegate-question { margin-top: 8px; }
.delegate-reply-block { margin-top: 4px; }
.delegate-reply-block label { display: block; margin-top: 12px; font-size: 12px; color: var(--muted); }
.delegate-reply { width: 100%; box-sizing: border-box; margin-top: 6px; min-height: 110px; }
.delegate-reply-foot {
  display: flex; align-items: center; justify-content: flex-end; gap: 9px; margin-top: 10px;
}
.delegate-status { margin-right: auto; }

/* --- Offer configurator (delegate page) ---------------------------------- */
/* Offer items render directly on the app background so their white sub-cards
   pop, matching the redesign. */
.delegate-offer-item { margin-bottom: 34px; }
.delegate-offer-item + .delegate-offer-item,
.delegate-offer-item + .delegate-card,
.delegate-card + .delegate-offer-item {
  padding-top: 30px; border-top: 1px solid var(--line);
}
.offer-config { display: flex; flex-direction: column; gap: 16px; }

.oc-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.oc-id { display: flex; align-items: center; gap: 14px; }
.oc-avatar {
  width: 46px; height: 46px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, #111, #3a3a3a); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 700;
}
.oc-handle { font-size: 19px; font-weight: 700; }
.oc-handle a { color: var(--ink); text-decoration: none; }
.oc-handle a:hover { text-decoration: underline; }
.oc-handle .oc-name { color: var(--faint-2); font-weight: 500; }
.oc-email { font-size: 13.5px; color: var(--muted); margin-top: 2px; }
.oc-badge {
  font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 7px 12px; border-radius: 9px; white-space: nowrap;
}
.oc-badge.pending { color: #b45309; background: #fef3e2; border: 1px solid #fbe0ba; }
.oc-badge.sent { color: var(--green); background: #e7f6ec; border: 1px solid #c5e9cf; }
.oc-subtitle { font-size: 14px; color: var(--muted); margin-top: -4px; }

/* Safe-floor card */
.oc-floor {
  display: flex; align-items: flex-end; gap: 22px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 24px; box-shadow: var(--shadow-card);
}
.oc-floor-main { flex: 0 0 auto; }
.oc-floor-label {
  display: flex; align-items: center; gap: 8px; margin-bottom: 7px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted);
}
.oc-scraped { font-size: 9.5px; font-weight: 700; letter-spacing: 0.06em; color: #2563eb; background: #eaf0fe; padding: 3px 7px; border-radius: 6px; }
.oc-floor-input { width: 220px; font-size: 18px; font-weight: 700; }
.oc-floor-desc { flex: 1; min-width: 220px; font-size: 13px; color: var(--muted); line-height: 1.5; padding-bottom: 2px; }
.oc-sub { font-size: 12px; color: var(--faint); margin-top: 6px; }

/* Deal cards */
.oc-deals { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.oc-deal {
  position: relative; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px; display: flex; flex-direction: column; gap: 16px;
  box-shadow: var(--shadow-card);
}
.oc-deal.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.oc-deal-head { display: flex; align-items: center; gap: 12px; }
.oc-deal-icon {
  width: 38px; height: 38px; border-radius: 11px; color: #fff; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.oc-deal-icon.view { background: #2563eb; }
.oc-deal-icon.video { background: #16a34a; }
.oc-deal-icon.bonus { background: #f59e0b; }
.oc-deal-kicker { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; color: var(--faint); }
.oc-deal-title { font-size: 17px; font-weight: 700; }
.oc-deal-desc { font-size: 13px; color: var(--muted); line-height: 1.45; margin-top: -6px; }

.oc-fields { display: flex; flex-direction: column; gap: 14px; }
.oc-field-pair { display: flex; gap: 10px; }
.oc-field-pair .oc-field { flex: 1; }
.oc-field-label {
  display: block; font-size: 11px; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 6px;
}
.oc-input {
  width: 100%; font-size: 15px; font-weight: 600; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px;
}
.oc-money { display: flex; align-items: center; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); overflow: hidden; }
.oc-money:focus-within { border-color: var(--accent); box-shadow: var(--ring); }
.oc-money-prefix { padding: 10px 4px 10px 12px; color: var(--faint); font-size: 15px; font-weight: 600; }
.oc-money-input { border: none !important; border-radius: 0; padding-left: 2px; }
.oc-money-input:focus { box-shadow: none; }

.oc-divider { height: 1px; background: var(--line-3); }
.oc-rows { display: flex; flex-direction: column; gap: 10px; }
.oc-row { display: flex; justify-content: space-between; align-items: baseline; }
.oc-row span { font-size: 13px; color: var(--muted); }
.oc-row b { font-size: 14px; font-weight: 600; color: var(--ink); }
.oc-row .oc-plus { color: var(--green); }
.oc-row-inset { background: var(--surface-2); border: 1px solid var(--line-3); border-radius: 9px; padding: 9px 11px; }
.oc-row-inset b { font-size: 15px; font-weight: 800; }
.oc-row-total { margin-top: 4px; }
.oc-row-total span:first-child {
  font-size: 12px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted);
}
/* .oc-row-total prefix bumps specificity above ".oc-row span" (which also
   matches this element, being both a class+type selector) so the intended
   white text isn't silently overridden by the muted gray meant for the other
   row labels. */
.oc-row-total .oc-fee {
  display: inline-flex; align-items: center; background: var(--accent); color: #fff;
  padding: 9px 15px; border-radius: 11px; font-size: 20px; font-weight: 700; letter-spacing: -0.01em;
}
.oc-choose {
  width: 100%; margin-top: auto; padding: 12px; border: 1px solid var(--accent);
  background: var(--surface); color: var(--accent); border-radius: 11px; font-size: 14px; font-weight: 700;
}
.oc-choose:hover { background: var(--surface-3); }
.oc-choose.is-selected { background: var(--accent); color: #fff; }
.oc-choose.is-selected:hover { background: var(--accent-strong); }

/* Send bar */
.oc-sendbar {
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 24px; box-shadow: var(--shadow-card);
}
.oc-sendbar-label { font-size: 11px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--faint); }
.oc-sendbar-headline { font-size: 20px; font-weight: 800; letter-spacing: -0.01em; margin-top: 5px; }
.oc-sendbar-headline .oc-dash { color: var(--faint-2); }
.oc-sendbar-meta { font-size: 13px; color: var(--muted); margin-top: 3px; }
.oc-sendbar-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.oc-approve { padding: 14px 26px; font-size: 15px; border-radius: 12px; }
/* Dismiss sits next to Approve. Ghost-styled and slightly muted so Approve
   still reads as the primary CTA — but tall enough to be an equal click
   target. */
.oc-dismiss { padding: 12px 20px; font-size: 14px; border-radius: 12px; }
/* Accept-the-creator's-rate: an alternative to sending a counter. Green so it
   reads as the "agree & close" path, distinct from the near-black counter CTA. */
.btn-accept {
  padding: 13px 22px; font-size: 14px; font-weight: 600; border-radius: 12px;
  color: #fff; background: var(--green); border: 1px solid var(--green);
}
.btn-accept:hover { background: #0f5f40; border-color: #0f5f40; }
.oc-send-status { font-size: 13px; }

/* --- Responsive ---------------------------------------------------------- */
@media (max-width: 900px) {
  .main { padding: 24px 20px 48px; }
  .main-header { gap: 20px; }
  .main-heading h1 { font-size: 26px; }
  .stats { flex-wrap: wrap; }
  .stats .stat-cell { flex: 1 1 30%; }
}

@media (max-width: 720px) {
  .topbar { padding: 0 14px; }
  .topbar-title, .topbar-divider { display: none; }
  .icon-btn { display: inline-flex; align-items: center; justify-content: center; }
  /* The sender-status blurb is non-essential on a phone — free the header. */
  .auth { display: none; }

  .sidebar {
    position: fixed; top: 60px; left: 0; bottom: 0;
    width: min(85vw, 300px); z-index: 20;
    transform: translateX(-100%); transition: transform 0.2s ease;
    box-shadow: 2px 0 16px rgba(20, 18, 15, 0.12);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop { display: block; opacity: 0; pointer-events: none; transition: opacity 0.2s; }
  .sidebar-backdrop.open { opacity: 1; pointer-events: auto; }

  .card { padding: 18px; }
  .card-header .actions { width: 100%; }
  .card-header .actions button { flex: 1 1 auto; }
  .setting-chip.grow { min-width: 100%; }
  .btn-lg { padding: 12px 24px; }
}
