/* Sales & Media — iOS-inspired styling on the brand palette.
   Brand: yellow #FFE600 (sidebar and login background), black #000000 (text), teal #67D1D2 (accent).
   Teal only ever carries black text (11.6:1) — never white text or teal text on white (1.8:1).
   Stage colours live in config/stage-colours.js and are served as /css/stages.css. */
:root {
  --brand-yellow: #FFE600;
  --brand-black: #000000;
  --brand-teal: #67D1D2;

  --bg: var(--brand-yellow);
  --page-bg: #f2f2f7;          /* main content area; the yellow stays on the sidebar and login */
  --surface: #ffffff;
  --text: #000000;
  --muted: #5c5c61;            /* iOS secondary label, darkened for 4.5:1 on white */
  --separator: rgba(60, 60, 67, 0.18);
  --fill: rgba(118, 118, 128, 0.12);       /* iOS tertiary fill: inputs, secondary buttons */
  --fill-strong: rgba(118, 118, 128, 0.2);
  /* Chart series, in this fixed order (validated for colour-blind separation on white) */
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --glass: rgba(255, 255, 255, 0.72);
  --control-border: #8e8e93;   /* checkbox/switch outlines: 3.3:1 on white */
  --focus: #0b6e70;            /* dark teal focus ring: 5.9:1 on white */
  --bad: #c4271c;
  --bad-tint: #ffe5e3;
  --ok-ink: #1e7a39;
  --ok-tint: #dff6e5;
  --warn-ink: #8a5100;
  --warn-tint: #fff0d9;

  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 8px 24px rgba(0, 0, 0, 0.08);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { letter-spacing: -0.02em; }
.muted { color: var(--muted); }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.skip-link { position: absolute; left: -9999px; top: 0; padding: 8px 12px; background: var(--brand-teal); color: var(--brand-black); z-index: 30; border-radius: var(--radius-sm); }
.skip-link:focus { left: 8px; top: 8px; }

/* ---------- Logo mark ---------- */
.logo-mark {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--brand-black);
  color: var(--brand-yellow);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: -0.04em;
  flex: none;
}

/* ---------- Top bar (frosted glass) ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 56px;
  padding: 0 20px;
  background: var(--glass);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid var(--separator);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; color: var(--text); text-decoration: none; letter-spacing: -0.02em; }
.topbar-right { display: flex; align-items: center; gap: 14px; }

/* Top bar search (public/js/global-search.js) */
.gsearch { position: relative; flex: 1 1 auto; max-width: 560px; min-width: 0; }
.gsearch-icon { position: absolute; left: 11px; top: 50%; width: 17px; height: 17px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.gsearch-input { width: 100%; height: 36px; margin: 0; padding: 0 34px 0 34px; border: 1px solid transparent; border-radius: 999px; background: var(--fill); color: var(--text); font: inherit; font-size: 14.5px; }
.gsearch-input::placeholder { color: var(--muted); }
.gsearch-input:focus { outline: none; border-color: var(--focus); background: var(--surface); box-shadow: 0 0 0 3px rgba(11, 110, 112, 0.18); }
.gsearch-input::-webkit-search-cancel-button { display: none; }
.gsearch-key { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); padding: 0 6px; border: 1px solid var(--separator); border-radius: 5px; font: 600 11.5px/18px inherit; color: var(--muted); background: var(--surface); }
.gsearch.is-open .gsearch-key, .gsearch-input:focus + .gsearch-key { display: none; }
.gsearch-panel { position: absolute; left: 0; right: 0; top: calc(100% + 6px); max-height: min(70vh, 560px); overflow-y: auto; padding: 6px; border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); z-index: 30; }
.gsearch-heading { margin: 8px 10px 4px; font-size: 12px; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; color: var(--muted); }
.gsearch-heading:first-child { margin-top: 4px; }
.gsearch-item { display: flex; flex-direction: column; gap: 1px; width: 100%; padding: 7px 10px; border: 0; border-radius: var(--radius-sm); background: none; color: var(--text); font: inherit; text-align: left; text-decoration: none; cursor: pointer; }
.gsearch-item.is-active, .gsearch-item:hover, .gsearch-more.is-active, .gsearch-more:hover { background: var(--fill); }
.gsearch-item-title { font-size: 14.5px; font-weight: 600; overflow-wrap: anywhere; }
.gsearch-item-sub { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.gsearch-ask { flex-direction: row; align-items: center; gap: 10px; }
.gsearch-ask .gsearch-item-title { font-weight: 500; }
.gsearch-ask-badge { flex: none; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 700; background: var(--brand-teal); color: var(--brand-black); }
.gsearch-more { display: block; padding: 5px 10px 7px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; color: var(--text); text-decoration: underline; text-decoration-color: var(--brand-teal); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.gsearch-tip { margin: 6px 10px; font-size: 13px; color: var(--muted); }
@media (max-width: 900px) {
  .brand-name { display: none; }
}
@media (max-width: 600px) {
  .topbar { gap: 10px; }
  .gsearch-key { display: none; }
  .gsearch-panel { position: fixed; left: 8px; right: 8px; top: 60px; }
  .topbar .status-label { display: none; }
}
.topbar-user { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px 4px 8px; border-radius: 999px; background: var(--fill); color: var(--text); font-size: 14px; font-weight: 700; white-space: nowrap; }
.topbar-user-icon { width: 18px; height: 18px; flex: none; }
button.topbar-user { border: 0; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
button.topbar-user:hover, button.topbar-user[aria-expanded="true"] { background: var(--fill-strong); }
.usermenu { position: relative; }
.usermenu-caret { width: 14px; height: 14px; flex: none; color: var(--muted); }
.usermenu-panel { position: absolute; z-index: 30; top: calc(100% + 8px); right: 0; width: 240px; padding: 6px; border-radius: var(--radius); background: var(--surface); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 12px 32px rgba(0, 0, 0, 0.16); }
.usermenu-panel[hidden] { display: none; }
.usermenu-panel form { margin: 0; }
.usermenu-who { display: grid; gap: 1px; margin: 0 0 4px; padding: 8px 10px 10px; border-bottom: 0.5px solid var(--separator); font-size: 14px; }
.usermenu-who .muted { font-size: 12.5px; }
.usermenu-item { display: block; width: 100%; padding: 9px 10px; border: 0; border-radius: var(--radius-sm); background: none; color: var(--text); font: inherit; font-size: 14.5px; text-align: left; text-decoration: none; cursor: pointer; }
.usermenu-item:hover, .usermenu-item:focus-visible { background: var(--fill); }
.usermenu-logout { color: var(--bad); }

/* Profile page */
.profile-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 0 20px; align-items: start; }
@media (max-width: 900px) { .profile-grid { grid-template-columns: 1fr; } }
.profile-subs { display: grid; gap: 4px; }
.profile-sub { align-items: center; padding: 10px 0; border-bottom: 0.5px solid var(--separator); }
.profile-sub > span { display: grid; gap: 2px; }
.profile-sub-label { font-size: 16px; font-weight: 600; }
.profile-sub-detail { font-size: 13.5px; font-weight: 400; color: var(--muted); }
.profile-subs .hint { margin: 10px 0 14px; }
.profile-subs .button { width: auto; justify-self: start; }
/* Account + password forms: outlined inputs, sentence-case labels */
.profile-form { display: grid; gap: 18px; margin-top: 18px; }
.profile-form .field { gap: 6px; }
.profile-form .field > label { margin: 0; font-size: 14px; font-weight: 600; color: var(--text); text-transform: none; letter-spacing: 0; }
.profile-form .field input[type="email"], .profile-form .field input[type="password"] {
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid rgba(60, 60, 67, 0.22);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.profile-form .field input::placeholder { color: #9a9aa0; }
.profile-form .field input:hover { border-color: rgba(60, 60, 67, 0.4); }
.profile-form .field input:focus { border-color: var(--focus); box-shadow: 0 0 0 4px rgba(11, 110, 112, 0.16); }
.profile-form .field.has-error input { border-color: var(--bad); box-shadow: 0 0 0 4px rgba(196, 39, 28, 0.12); }
.profile-form .field-error { font-size: 13px; }
.profile-form .hint { font-size: 13px; }
.profile-form .button { width: auto; min-height: 40px; margin: 2px 0 0; padding: 8px 18px; justify-self: start; font-size: 15px; background: var(--brand-black); color: #ffffff; }
.profile-form .button:hover { background: #2c2c2e; filter: none; }
.topbar-right form { margin: 0; }

.link-button {
  background: none;
  border: 0;
  padding: 6px 4px;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 6px;
}
.link-button:hover { text-decoration: underline; text-decoration-color: var(--brand-teal); text-decoration-thickness: 2px; text-underline-offset: 3px; }

/* AC connection status */
.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status--checking { background: var(--fill); color: var(--muted); }
.status--synced { background: var(--ok-tint); color: var(--ok-ink); }
.status--synced .status-dot { background: #34c759; box-shadow: 0 0 0 3px rgba(52, 199, 89, 0.25); }
.status--unsynced { background: var(--bad-tint); color: var(--bad); }
.status--unsynced .status-dot { background: #ff3b30; }

/* ---------- Shell + sidebar (frosted, iPadOS-style) ---------- */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: calc(100vh - 56px); }
.sidebar {
  position: sticky;
  top: 56px;
  align-self: start;
  height: calc(100vh - 56px);
  height: calc(100dvh - 56px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px 12px;
  background: rgba(255, 255, 255, 0.5);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-right: 0.5px solid var(--separator);
}
.sidebar ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
}
.nav-icon { width: 20px; height: 20px; flex: none; }
a.nav-item:hover { background: rgba(0, 0, 0, 0.06); }
.nav-item.is-current { background: var(--brand-black); color: #ffffff; font-weight: 600; }
.nav-item--soon { color: var(--muted); cursor: default; }
/* Sub-menu items (e.g. Contacts > Recent replies): indented under their parent, a little smaller */
.nav-sub .nav-item { min-height: 34px; padding: 6px 12px 6px 24px; font-size: 14px; }
.nav-sub .nav-icon { width: 16px; height: 16px; }
.soon-tag { margin-left: auto; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: var(--fill); color: var(--muted); }

.page { width: 100%; padding: 28px 32px 48px; background: var(--page-bg); }
.page h1 { margin: 0 0 4px; font-size: 34px; line-height: 1.15; font-weight: 700; letter-spacing: -0.025em; }
.page > .muted { margin-top: 4px; }

/* ---------- Cards ---------- */
.card {
  margin-top: 20px;
  padding: 20px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.card h2 { margin: 0 0 14px; font-size: 20px; font-weight: 700; }
.card-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; }
.card-head h2 { margin: 0; }
.card-summary { margin: 0; color: var(--muted); font-size: 14px; }
.card.is-loading .table-wrap { opacity: 0.5; transition: opacity 0.2s; }

/* ---------- Buttons ---------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  margin-top: 8px;
  padding: 10px 20px;
  border: 0;
  border-radius: 999px;
  background: var(--brand-teal);
  color: var(--brand-black);
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.1s, filter 0.15s;
}
.button:hover { filter: brightness(0.95); }
.button:active { transform: scale(0.98); }
.button:disabled { opacity: 0.45; cursor: not-allowed; filter: none; transform: none; }
.button--secondary { background: var(--fill); margin-top: 0; }
.button--secondary:hover { background: var(--fill-strong); filter: none; }
.button--small { min-height: 32px; margin: 0; padding: 4px 14px; font-size: 14px; }
.button--big { width: 100%; min-height: 52px; font-size: 17px; }

.text-link { color: var(--text); text-decoration-color: var(--brand-teal); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.deal-link { color: var(--text); text-decoration: none; }
.deal-link:hover { text-decoration: underline; text-decoration-color: var(--brand-teal); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.open-link { color: var(--muted); font-size: 13px; font-weight: 600; text-decoration: none; padding: 4px 6px; border-radius: 6px; }
.open-link:hover { color: var(--text); background: var(--fill); }

/* ---------- Form controls (iOS filled style) ---------- */
.filters select, .filters input,
.field select, .field textarea,
.field input[type="text"], .field input[type="email"], .field input[type="date"], .field input[type="time"], .field input[type="password"],
.added-tools input, .inline-form select,
.feedback-panel select, .feedback-panel textarea,
.login-card input {
  width: 100%;
  min-height: 40px;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--fill);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  transition: background 0.15s, box-shadow 0.15s;
}
.filters input:focus, .filters select:focus,
.field select:focus, .field textarea:focus, .field input:focus,
.feedback-panel select:focus, .feedback-panel textarea:focus,
.login-card input:focus {
  outline: none;
  background: var(--surface);
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(11, 110, 112, 0.25);
}
select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 34px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%233c3c43' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
textarea { resize: vertical; }

/* ---------- Filters ---------- */
.filters {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) minmax(180px, 1.4fr) minmax(180px, 1.6fr) minmax(140px, 1fr);
  gap: 12px;
  margin: 16px 0 12px;
}
.filters label { display: grid; gap: 5px; min-width: 0; }
.filters label > span { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }

/* ---------- Stage colours ---------- */
.stage-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--stage-tint, #f2f2f7);
  color: var(--stage-ink, #3a3a3c);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}
.stage-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--stage-dot, #aeaeb2); }

.legend { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; padding: 0; list-style: none; }
.legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 4px 12px;
  border: 1.5px solid transparent;
  border-radius: 999px;
  background: var(--stage-tint);
  color: var(--stage-ink);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.legend-chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--stage-dot); }
.legend-chip .legend-count { font-weight: 500; opacity: 0.85; font-variant-numeric: tabular-nums; }
.legend-chip:hover { filter: brightness(0.97); }
.legend-chip[aria-pressed="true"] { border-color: var(--stage-ink); box-shadow: 0 0 0 2px var(--surface) inset; }

/* ---------- Tables as iOS lists ---------- */
.table-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
.deals-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.deals-table th {
  padding: 8px 12px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 0.5px solid var(--separator);
  white-space: nowrap;
}
.deals-table td { padding: 12px; border-bottom: 0.5px solid var(--separator); vertical-align: middle; }
.deals-table tbody tr:last-child td { border-bottom: 0; }
.deals-table tbody tr { transition: background 0.12s; }
.deals-table tbody tr:hover { background: rgba(118, 118, 128, 0.06); }
.deals-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.deals-table td.stage-cell-first { position: relative; padding-left: 18px; }
.deals-table td.stage-cell-first::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 10px;
  bottom: 10px;
  width: 4px;
  border-radius: 4px;
  background: var(--stage-dot, transparent);
}
.nowrap { white-space: nowrap; }
.cell-strong { font-weight: 600; }
.cell-sub { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.table-message { margin: 0; padding: 32px 12px; text-align: center; color: var(--muted); }
.row-actions { display: flex; align-items: center; gap: 6px; }
.change-cell { max-width: 420px; overflow-wrap: anywhere; }

/* Recent campaigns widget */
.campaign-list { list-style: none; margin: 10px -20px -8px; padding: 0; }
.campaign-list li + li { border-top: 0.5px solid var(--separator); }
.campaign-row { display: grid; gap: 8px; padding: 14px 20px; color: var(--text); text-decoration: none; transition: background 0.12s; }
.campaign-row:hover { background: rgba(118, 118, 128, 0.06); }
.campaign-row:focus-visible { outline-offset: -3px; border-radius: var(--radius-sm); }
.campaign-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.campaign-title { font-weight: 600; font-size: 16px; min-width: 0; overflow-wrap: anywhere; }
.campaign-count { flex: none; color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.campaign-count strong { color: var(--text); font-weight: 700; }
.campaign-bar { display: flex; gap: 2px; height: 8px; border-radius: 999px; overflow: hidden; background: var(--fill); }
.campaign-seg { flex-basis: 0; min-width: 4px; background: var(--stage-dot); }
.campaign-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; font-size: 13px; color: var(--muted); }
.campaign-keys { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.campaign-key { display: inline-flex; align-items: center; gap: 5px; }
.campaign-key::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--stage-dot); }
@media (max-width: 600px) {
  .campaign-list { margin: 10px -16px -4px; }
  .campaign-row { padding: 12px 16px; }
}

/* Dashboard widget grid: three equal columns on wide screens; new widgets just drop in.
   Steps down to two columns, then one, so each widget stays at least ~340px wide. */
.widget-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 20px; align-items: start; }
@media (max-width: 1360px) {
  .widget-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .widget-grid { grid-template-columns: 1fr; }
}
/* Masonry (public/js/dashboard-masonry.js): thin rows, each widget spans as many as it needs. */
.widget-grid.is-masonry { grid-auto-rows: 4px; }
.widget { position: relative; min-width: 0; }
.widget--full { grid-column: 1 / -1; }

/* Dashboard "Arrange" mode (public/js/dashboard-layout.js) */
.dashboard-head { align-items: center; }
.dashboard-head h1 { margin-bottom: 0; }
.arrange-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.arrange-status { font-size: 13px; }
.arrange-status:empty, .arrange-controls [hidden] { display: none; }
.arrange-help { margin: 8px 0 0; font-size: 14px; }
.widget-arrange { position: absolute; inset: 20px 0 0; z-index: 5; border-radius: var(--radius-lg); background: rgba(255, 255, 255, 0.55); outline: 2px dashed var(--focus); outline-offset: -2px; cursor: grab; }
.widget-arrange[hidden] { display: none; }
.widget-arrange-bar { position: sticky; top: 12px; display: flex; align-items: center; gap: 6px; margin: 12px; padding: 6px 6px 6px 4px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow); }
.widget-grip { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 999px; color: var(--muted); touch-action: none; cursor: grab; }
.widget-grip svg { width: 20px; height: 20px; }
.widget-arrange-label { flex: 1; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.widget-move { width: 36px; height: 36px; border: 0; border-radius: 999px; background: var(--fill); color: var(--text); font: inherit; font-size: 16px; cursor: pointer; }
.widget-move:hover { background: var(--fill-strong); }
.widget:first-child .widget-move[data-move="-1"], .widget:last-child .widget-move[data-move="1"] { opacity: 0.35; }
.has-drag, .has-drag * { cursor: grabbing !important; user-select: none; }
.widget.is-dragging .card { opacity: 0.55; transform: scale(0.98); transition: transform 0.12s, opacity 0.12s; }
.widget.is-dragging .widget-arrange { background: rgba(103, 209, 210, 0.25); }

/* Compact card for half-width widgets */
.card--compact { padding: 16px 16px 8px; }
.card--compact h2 { font-size: 17px; }
.card--compact .card-summary { font-size: 13px; }
.card--compact .campaign-list { margin: 8px -16px 0; }
.card--compact .campaign-row { gap: 6px; padding: 10px 16px; }
.card--compact .campaign-title { font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card--compact .campaign-count { font-size: 13px; }
.card--compact .campaign-bar { height: 6px; }
.card--compact .campaign-meta { font-size: 12px; }
.card--compact .campaign-key:nth-child(n + 3) { display: none; } /* keep the two biggest colours */
.card--compact .table-message { padding: 20px 8px; }

/* Pager */
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 14px; font-size: 14px; color: var(--muted); }
.pager-button {
  min-height: 34px;
  padding: 6px 14px;
  border: 0;
  border-radius: 999px;
  background: var(--fill);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.pager-button:hover:not(:disabled) { background: var(--fill-strong); }
.pager-button:disabled { opacity: 0.4; cursor: default; }

/* ---------- Flash messages ---------- */
.flash { margin-bottom: 20px; padding: 14px 18px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.flash ul { margin: 6px 0 0; padding-left: 20px; }
.flash--success { background: var(--ok-tint); color: #0f3d1c; }
.flash--warning { background: var(--warn-tint); color: #4a2c00; }
.flash--error { background: var(--bad-tint); color: #5c120c; }

/* ---------- Deal page ---------- */
.breadcrumb { display: flex; gap: 6px; font-size: 14px; margin-bottom: 6px; color: var(--muted); }
.breadcrumb a { color: var(--text); font-weight: 600; text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.deal-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.deal-sub { margin: 4px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.deal-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 0 20px; align-items: start; }
.deal-side .card:first-child { margin-top: 20px; }
/* Contact page: emails (main) left, details + campaigns (side) right. Phones stack side first. */
.contact-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); grid-template-areas: "main side"; gap: 0 20px; align-items: start; }
.contact-main { grid-area: main; }
.contact-side { grid-area: side; }
.contact-grid--no-email { grid-template-columns: minmax(0, 640px); grid-template-areas: "side"; }
.contact-side .campaign-history-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 14px; }

.notice { padding: 12px 14px; border-radius: var(--radius); margin-bottom: 16px; font-size: 14px; }
.notice p { margin: 4px 0 0; }
.notice--test { background: var(--warn-tint); color: #4a2c00; }

.outcome-form { display: grid; gap: 22px; }
.field { display: grid; gap: 6px; border: 0; margin: 0; padding: 0; min-width: 0; }
.field > label, .field legend {
  padding: 0;
  margin-bottom: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.req, .optional { font-weight: 500; text-transform: none; letter-spacing: 0; }
.field.has-error select, .field.has-error textarea, .field.has-error input { border-color: var(--bad); }
.hint { margin: 0; font-size: 13px; color: var(--muted); }
.field-error { margin: 0; color: var(--bad); font-size: 14px; font-weight: 600; }

/* Outcome choices: iOS-style selectable tiles */
.outcome-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.outcome-option {
  position: relative;
  display: grid;
  gap: 2px;
  padding: 14px 14px 14px 46px;
  border-radius: var(--radius);
  background: var(--fill);
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.outcome-option:active { transform: scale(0.99); }
.outcome-option:has(input:checked) { background: var(--brand-teal); }
.outcome-option:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.outcome-option.is-invalid { opacity: 0.45; cursor: not-allowed; }
.field.has-error .outcome-option { box-shadow: inset 0 0 0 1.5px var(--bad); }
.outcome-name { font-weight: 600; font-size: 16px; }
.outcome-hint { font-size: 12.5px; color: var(--muted); }
.outcome-option:has(input:checked) .outcome-hint { color: var(--brand-black); }

/* Round iOS checkmarks for radios and checkboxes */
.outcome-option input,
.check input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  flex: none;
  width: 22px;
  height: 22px;
  margin: 0;
  border: 1.5px solid var(--control-border);
  border-radius: 50%;
  background: var(--surface);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.outcome-option input { position: absolute; left: 14px; top: 16px; }
.outcome-option input:checked,
.check input[type="checkbox"]:checked {
  border-color: var(--brand-black);
  background: var(--brand-black) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='10' viewBox='0 0 12 10'%3E%3Cpath d='M1.5 5.2l3 3 6-6.7' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center no-repeat;
}
.outcome-option input:focus-visible,
.check input[type="checkbox"]:focus-visible { outline: none; }

/* Sales actions: grouped inset list */
.action-groups { display: grid; gap: 16px; }
.action-group-title { margin: 0 0 6px 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
.action-list { border-radius: var(--radius); background: var(--fill); overflow: hidden; }
.check {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 10px 14px;
  font-size: 15px;
  cursor: pointer;
}
.action-list .check + .check { border-top: 0.5px solid var(--separator); }
.check:hover { background: rgba(118, 118, 128, 0.08); }
.check:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: -3px; border-radius: var(--radius-sm); }
.check:has(input:disabled) { opacity: 0.45; cursor: not-allowed; }
.tag-note { color: var(--muted); font-size: 12.5px; }

/* Follow-up task with iOS switch */
.task-box { padding: 4px 16px 16px; border-radius: var(--radius); background: var(--fill); }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; cursor: pointer; font-size: 16px; font-weight: 600; }
.switch {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  flex: none;
  width: 51px;
  height: 31px;
  margin: 0;
  border-radius: 999px;
  background: #d1d1d6;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  transition: background 0.2s;
}
.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15), 0 1px 1px rgba(0, 0, 0, 0.16);
  transition: transform 0.2s;
}
.switch:checked { background: var(--brand-black); box-shadow: none; }
.switch:checked::after { transform: translateX(20px); }
.task-fields { display: grid; gap: 14px; padding-top: 6px; border-top: 0.5px solid var(--separator); }
.task-fields[hidden] { display: none; }
.task-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; padding-top: 10px; }
.task-box .field select, .task-box .field input, .task-box .field textarea { background: var(--surface); }

/* Details list */
.details { display: grid; grid-template-columns: 110px minmax(0, 1fr); margin: 0; font-size: 14.5px; }
.details dt, .details dd { padding: 10px 0; border-bottom: 0.5px solid var(--separator); }
.details dt { color: var(--muted); font-weight: 500; }
.details dd { margin: 0; overflow-wrap: anywhere; }
.details dt:last-of-type, .details dd:last-of-type { border-bottom: 0; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }

.timeline { list-style: none; margin: 0; padding: 0; display: grid; font-size: 14.5px; }
.timeline li { padding: 10px 0; border-bottom: 0.5px solid var(--separator); }
.timeline li:last-child { border-bottom: 0; }
.timeline p { margin: 2px 0 0; }
.timeline-when { font-size: 12.5px; color: var(--muted); }

.status-tag { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; text-transform: capitalize; background: var(--fill); color: #3a3a3c; }
.status-tag--success { background: var(--ok-tint); color: var(--ok-ink); }
.status-tag--failed { background: var(--bad-tint); color: var(--bad); }
.status-tag--blocked, .status-tag--scheduled { background: var(--warn-tint); color: var(--warn-ink); }

/* ---------- Login ---------- */
.login-page { display: grid; place-items: center; min-height: 100vh; padding: 16px; }
.login-card {
  width: 100%;
  max-width: 380px;
  padding: 36px 32px 32px;
  background: var(--surface);
  border-radius: 24px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04), 0 20px 48px rgba(0, 0, 0, 0.12);
  text-align: center;
}
.login-card .logo-mark { width: 56px; height: 56px; border-radius: 14px; font-size: 20px; margin-bottom: 14px; }
.login-card h1 { margin: 0 0 4px; font-size: 26px; font-weight: 700; }
.login-card form { display: grid; gap: 10px; margin-top: 24px; text-align: left; }
.login-card label { font-size: 13px; font-weight: 600; color: var(--muted); margin: 4px 0 -4px 4px; }
.login-card input { min-height: 46px; font-size: 16px; }
.login-card .button { width: 100%; margin-top: 12px; }
.alert { margin: 16px 0 0; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--bad-tint); color: var(--bad); font-size: 14px; text-align: left; }

/* ---------- Responsive ----------
   Desktop  > 1100px : full sidebar
   Tablet   701-1100 : icon rail with small labels (iPadOS style)
   Phone   <= 700px  : bottom tab bar (iOS style), tables become stacked cards */
.nav-short { display: none; }
.deal-actions { display: flex; flex-wrap: wrap; gap: 8px; }

@media (max-width: 1100px) {
  .filters { grid-template-columns: 1fr 1fr; }

  /* Icon rail */
  .shell { grid-template-columns: 84px minmax(0, 1fr); }
  .sidebar { padding: 12px 8px; }
  .nav-item {
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    min-height: 60px;
    padding: 8px 4px;
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    line-height: 1.2;
  }
  .nav-icon { width: 22px; height: 22px; }
  .sidebar li:has(.nav-item--soon) { display: none; }
  .nav-sub .nav-item { min-height: 60px; padding: 8px 4px; font-size: 11px; } /* a normal rail item */
  .nav-sub .nav-icon { width: 22px; height: 22px; }
  .page { padding: 24px 24px 40px; }
  .page h1 { font-size: 30px; }
}

@media (max-width: 1000px) {
  .deal-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "side" "main"; }
  /* Tablet: drop the least important deal columns (Created, Next task) so the table fits */
  #active-deals .deals-table th:nth-child(5), #active-deals .deals-table td:nth-child(5),
  #active-deals .deals-table th:nth-child(6), #active-deals .deals-table td:nth-child(6) { display: none; }
}

@media (max-width: 700px) {
  /* Bottom tab bar */
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .shell { display: block; min-height: 0; }
  .sidebar {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 25;
    height: auto;
    overflow: visible;
    padding: 4px max(8px, env(safe-area-inset-left)) calc(4px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-right));
    background: rgba(255, 243, 128, 0.94); /* the desktop sidebar's pale yellow; the page behind it is grey now */
    border-right: 0;
    border-top: 0.5px solid var(--separator);
  }
  .sidebar ul { display: flex; justify-content: space-around; gap: 0; }
  .sidebar li { flex: 1; }
  .sidebar li:not(.nav-phone) { display: none; }
  .nav-item { min-height: 56px; padding: 6px 2px; border-radius: 10px; font-size: 11px; font-weight: 500; }
  .nav-icon { width: 24px; height: 24px; }
  .nav-item.is-current { background: transparent; color: var(--text); font-weight: 700; }
  .nav-item.is-current .nav-icon { stroke-width: 2.2; }
  .nav-item.is-current::before { content: ""; position: absolute; top: 2px; width: 22px; height: 3px; border-radius: 3px; background: var(--brand-black); }
  .nav-item { position: relative; }
  .nav-short { display: block; }
  .nav-item:has(.nav-short) .nav-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

  .topbar { padding: 0 16px; padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
  .topbar-user-name, .brand-name { display: none; }
  .topbar-user { padding: 6px; } /* icon only on phones */
  .page { padding: 18px 16px 32px; }
  .page h1 { font-size: 28px; }
  .card { padding: 16px; border-radius: 16px; }
  .table-wrap { margin: 0 -16px; padding: 0 16px; }
  .filters { grid-template-columns: 1fr; }
  .pager { justify-content: space-between; }
  .deal-head { align-items: flex-start; }
  .deal-actions { width: 100%; }
  .deal-actions .button { flex: 1; }
  .details { grid-template-columns: 96px minmax(0, 1fr); }

  /* Active deals table → stacked rows: contact / org / stage on the left, actions on the right */
  #active-deals .deals-table thead { display: none; }
  #active-deals .deals-table tbody tr {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 10px;
    padding: 10px 0 10px 14px;
    border-bottom: 0.5px solid var(--separator);
  }
  #active-deals .deals-table tbody tr:last-child { border-bottom: 0; }
  #active-deals .deals-table tbody tr::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 4px; border-radius: 4px; background: var(--stage-dot, transparent); }
  #active-deals .deals-table td { display: block; padding: 2px 0; border: 0; }
  #active-deals .deals-table td.stage-cell-first { padding-left: 0; }
  #active-deals .deals-table td.stage-cell-first::before { display: none; }
  #active-deals .deals-table td:nth-child(1) { grid-column: 1; grid-row: 1; }
  #active-deals .deals-table td:nth-child(2) { grid-column: 1; font-size: 13.5px; color: var(--muted); }
  #active-deals .deals-table td:nth-child(3) { grid-column: 1; padding-top: 4px; }
  #active-deals .deals-table td:nth-child(4),
  #active-deals .deals-table td:nth-child(5),
  #active-deals .deals-table td:nth-child(6) { display: none; }
  #active-deals .deals-table td:nth-child(7) { grid-column: 2; grid-row: 1 / span 3; align-self: center; }
  #active-deals .row-actions { flex-direction: column; align-items: stretch; }

  /* Long chip rows scroll sideways instead of wrapping into a tall block */
  .legend, .result-filters { flex-wrap: nowrap; overflow-x: auto; margin-left: -16px; margin-right: -16px; padding: 2px 16px 4px; scrollbar-width: none; }
  .legend::-webkit-scrollbar, .result-filters::-webkit-scrollbar { display: none; }
  .legend-chip, .result-chip { flex: none; white-space: nowrap; }

  /* Controls with desktop minimum widths */
  .inline-form select, .lead-filter select { min-width: 0; width: 100%; }
  .lead-filter label { width: 100%; }
  .added-tools { flex-wrap: wrap; }
  .added-tools input { max-width: none; }
  .page-head .segmented { width: 100%; }
  .page-head .segmented > a, .page-head .segmented > button { flex: 1; justify-content: center; }
  .step-nav .button { flex: 1; }
}

@media (max-width: 900px) {
  /* Generic stacked table (Activity log, send-outs, journeys): each row becomes a labelled card */
  .table--stack thead { display: none; }
  .table--stack tbody tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 12px; padding: 12px 0; border-bottom: 0.5px solid var(--separator); }
  .table--stack tbody tr:last-child { border-bottom: 0; }
  .table--stack td { display: block; padding: 0; border: 0; min-width: 0; }
  .table--stack td::before { content: attr(data-label); display: block; font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
  .table--stack td:not([data-label])::before, .table--stack td[data-label=""]::before { display: none; }
  .table--stack td.change-cell { grid-column: 1 / -1; max-width: none; }
  .table--stack td.nowrap { white-space: normal; }
}
@media (max-width: 700px) {
  .table--stack tbody tr { grid-template-columns: 1fr 1fr; }
}

/* Touch screens (phones, iPads): bigger tap targets, and 16px inputs so iOS doesn't zoom on focus */
@media (pointer: coarse) {
  input, select, textarea { font-size: 16px !important; }
  .button--small { min-height: 40px; padding: 6px 16px; }
  .pager-button { min-height: 44px; padding: 8px 18px; }
  .segmented > button, .segmented > a { min-height: 34px; padding: 4px 14px; }
  .legend-chip { min-height: 38px; }
  .open-link { padding: 10px 8px; }
  .link-button { padding: 10px 6px; }
  .status { height: 34px; }
  .check { min-height: 48px; }
  .deals-table tbody tr:hover, .queue-row:hover, .campaign-row:hover { background: transparent; }
}

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

/* "Coming soon" widget (AI assistant placeholder) */
.card--soon { padding-bottom: 16px; }
.card--soon h2 { display: inline-flex; align-items: center; gap: 8px; }
.card--soon .card-head { align-items: center; }
.card--soon .soon-tag { margin-left: 0; }
.soon-icon { width: 20px; height: 20px; flex: none; }
.soon-lead { margin: 10px 0 8px; font-size: 14.5px; }
.soon-examples { margin: 0 0 14px; padding: 0; list-style: none; display: grid; gap: 6px; }
.soon-examples li { padding: 8px 12px; border-radius: var(--radius-sm); background: var(--fill); font-size: 13.5px; color: var(--muted); }
.soon-input {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 40px;
  padding: 6px 6px 6px 14px;
  border-radius: 999px;
  border: 1px dashed var(--control-border);
  color: var(--muted);
  font-size: 14px;
}
.soon-send { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--fill-strong); color: var(--muted); font-weight: 700; }

/* AI assistant widget */
.assistant h2 { display: inline-flex; align-items: center; gap: 8px; }
.assistant .card-head { align-items: center; }
.assistant { padding-bottom: 12px; }
.assistant-lead { margin: 10px 0 8px; font-size: 14.5px; }
.assistant-intro[hidden] { display: none; }
.assistant-examples { margin: 0 0 12px; padding: 0; list-style: none; display: grid; gap: 6px; }
.assistant-examples button {
  width: 100%;
  padding: 8px 12px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--fill);
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
}
.assistant-examples button:hover { background: var(--fill-strong); }
.assistant-log { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 10px; max-height: 420px; overflow-y: auto; }
.assistant-log:empty { display: none; }
.assistant-msg { font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.assistant-msg p { margin: 0 0 6px; }
.assistant-msg p:last-child { margin-bottom: 0; }
.assistant-msg ul { margin: 0 0 6px; padding-left: 20px; }
.assistant-msg li + li { margin-top: 3px; }
.assistant-msg a { color: var(--text); font-weight: 600; }
.assistant-msg--user { justify-self: end; max-width: 85%; padding: 8px 12px; border-radius: 16px 16px 4px 16px; background: var(--brand-teal); color: #000; }
.assistant-msg--assistant { padding: 10px 12px; border-radius: 16px 16px 16px 4px; background: var(--fill); }
.assistant-msg--error { background: var(--bad-tint); color: var(--bad); }
.assistant-thinking { color: var(--muted); animation: assistant-pulse 1.4s ease-in-out infinite; }
@keyframes assistant-pulse { 50% { opacity: 0.45; } }
@media (prefers-reduced-motion: reduce) { .assistant-thinking { animation: none; } }
.assistant-sources { margin-top: 6px !important; font-size: 12px; color: var(--muted); }
.assistant-form {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-top: 12px;
  padding: 5px 5px 5px 14px;
  border-radius: 20px;
  border: 1px solid var(--control-border);
  background: var(--surface);
}
.assistant-form:focus-within { outline: 2px solid var(--focus); outline-offset: 1px; }
.assistant-form textarea { flex: 1; min-height: 30px; padding: 5px 0; border: 0; outline: 0; resize: none; background: transparent; font: inherit; font-size: 14px; color: var(--text); }
.assistant-send { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 50%; background: var(--brand-black); color: var(--brand-yellow); font-weight: 700; cursor: pointer; }
.assistant-send:disabled { opacity: 0.4; cursor: default; }
.assistant-note { margin: 6px 4px 0; font-size: 12px; color: var(--muted); }

/* Deal page: the contact's other campaigns */
.campaigns-summary { margin: -4px 0 8px; font-size: 14px; color: var(--muted); }
.campaigns-summary strong { color: var(--text); }
.campaign-history { list-style: none; margin: 0 -20px; padding: 0; }
.campaign-history li + li { border-top: 0.5px solid var(--separator); }
.campaign-history-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 20px; color: var(--text); text-decoration: none; }
.campaign-history-row:hover { background: rgba(118, 118, 128, 0.06); }
.campaign-history-row:focus-visible { outline-offset: -3px; border-radius: var(--radius-sm); }
.campaign-history-main { display: grid; gap: 4px; min-width: 0; }
.campaign-history-title { font-weight: 600; font-size: 14.5px; overflow-wrap: anywhere; }
.campaign-history-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 12.5px; color: var(--muted); }
.campaign-history-cta { color: var(--text); font-weight: 600; text-decoration: underline; text-decoration-color: var(--brand-teal); text-decoration-thickness: 2px; text-underline-offset: 3px; }

/* Result badges: how a deal turned out */
.result-badge { flex: none; padding: 4px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; white-space: nowrap; background: var(--fill); color: #3a3a3c; }
.result--won { background: var(--brand-black); color: var(--brand-yellow); }
.result--interested { background: #dff6e5; color: #1e7a39; }
.result--meeting { background: #f3e5fb; color: #7a2e9e; }
.result--objection { background: #fff0d9; color: #8a5100; }
.result--declined, .result--lost { background: #ffe5e3; color: #b3261e; }
.result--bounced { background: #e5e5ea; color: #3a3a3c; }
.result--pending, .result--not-contacted, .result--nurture, .result--other { background: var(--fill); color: var(--muted); }
@media (max-width: 600px) {
  .campaign-history { margin: 0 -16px; }
  .campaign-history-row { padding: 10px 16px; }
}

/* iOS segmented control (Mine / Everyone) */
.segmented { display: inline-flex; padding: 2px; border-radius: 9px; background: var(--fill); }
.segmented > button, .segmented > a {
  min-height: 28px;
  padding: 3px 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}
.segmented > [aria-pressed="true"] { background: var(--surface); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 0 0 0.5px rgba(0, 0, 0, 0.04); }

/* Call-list rows (Sales calls widget + Follow-ups page) */
.queue-list { list-style: none; margin: 8px -16px 0; padding: 0; }
.queue-list li + li { border-top: 0.5px solid var(--separator); }
.queue-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 46px; padding: 8px 16px; color: var(--text); text-decoration: none; }
.queue-row:hover { background: rgba(118, 118, 128, 0.06); }
.queue-row:focus-visible { outline-offset: -3px; border-radius: var(--radius-sm); }
.queue-label { font-size: 15px; font-weight: 500; min-width: 0; }
.queue-sub { color: var(--muted); font-size: 12.5px; font-weight: 400; }
.queue-count { flex: none; min-width: 34px; padding: 2px 10px; border-radius: 999px; background: var(--brand-teal); color: var(--brand-black); font-weight: 700; font-size: 14px; text-align: center; font-variant-numeric: tabular-nums; }
.queue-row.is-empty .queue-count { background: var(--fill); color: var(--muted); }
.queue-row.is-urgent .queue-count { background: #c4271c; color: #ffffff; }
.queue-row.is-hot .queue-count { background: var(--brand-teal); color: var(--brand-black); }
.queue-row::after { content: "›"; color: #8e8e93; font-size: 20px; line-height: 1; margin-left: -4px; }
.queue-list--page { margin: 8px -20px 0; }
.queue-list--page .queue-row { padding: 10px 20px; }
.queue-list--page .stage-pill { margin-left: 6px; }
.card.is-loading .queue-count { opacity: 0.5; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0 4px; border-top: 0.5px solid var(--separator); margin-top: 0; }
.card-foot--stacked { flex-direction: column; align-items: flex-start; gap: 6px; } /* the link sits under the note, not beside it */
.card-foot--end { justify-content: flex-end; }
.view-all { color: var(--text); font-size: 14px; font-weight: 600; text-decoration: none; }
.view-all:hover { text-decoration: underline; text-decoration-color: var(--brand-teal); text-decoration-thickness: 2px; text-underline-offset: 3px; }

/* Follow-ups page */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.count-badge { display: inline-block; margin-left: 6px; padding: 1px 9px; border-radius: 999px; background: var(--fill); font-size: 14px; font-weight: 600; vertical-align: middle; }
.due-overdue { color: #c4271c; font-weight: 700; }
.due-today { font-weight: 700; }
.empty-note { margin: 4px 0 6px; }

/* ---------- Follow-ups Kanban board ---------- */
.board {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(272px, 1fr);
  gap: 14px;
  margin-top: 20px;
  padding-bottom: 12px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  align-items: start;
}
.board:focus-visible { outline-offset: 4px; border-radius: var(--radius); }
.board-col {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 210px);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.55);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  box-shadow: inset 0 0 0 0.5px var(--separator);
  scroll-snap-align: start;
  scroll-margin-top: 80px;
}
.board-col-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 14px 10px; }
.board-col-head h2 { margin: 0; font-size: 16px; font-weight: 700; }
.board-col-head .count-badge { margin: 0; background: var(--surface); }
.board-col--urgent .board-col-head .count-badge { background: #c4271c; color: #ffffff; }
.board-col--today .board-col-head .count-badge { background: var(--brand-black); color: #ffffff; }
.board-col-body { display: grid; gap: 10px; padding: 0 10px 12px; overflow-y: auto; }
.board-col-note { margin: 0 4px 2px; font-size: 12.5px; color: var(--muted); }
.board-empty { margin: 0; padding: 18px 12px; border-radius: var(--radius); border: 1.5px dashed rgba(60, 60, 67, 0.25); text-align: center; font-size: 13.5px; color: var(--muted); }

.board-card {
  position: relative;
  display: grid;
  gap: 6px;
  padding: 12px 12px 12px 16px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 4px 12px rgba(0, 0, 0, 0.06);
  color: var(--text);
  text-decoration: none;
  overflow: hidden;
}
.board-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--stage-dot, #aeaeb2); }
.board-card--link:hover { box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08), 0 8px 20px rgba(0, 0, 0, 0.1); }
.board-card--link:focus-visible { outline-offset: 2px; }
.board-card-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.board-card-title { font-weight: 600; font-size: 15px; min-width: 0; overflow-wrap: anywhere; }
.board-card-sub { margin: -4px 0 0; font-size: 13px; color: var(--muted); }
.board-due { flex: none; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.board-due--overdue { color: #c4271c; }
.board-task { margin: 0; font-size: 14px; }
.board-task-type { display: inline-block; margin-right: 2px; padding: 0 7px; border-radius: 6px; background: var(--fill); font-size: 12px; font-weight: 600; }
.board-overdue { margin: 0; font-size: 12.5px; font-weight: 600; color: #c4271c; }
.board-card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.board-campaign { font-size: 12.5px; color: var(--muted); }
.board-card-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.board-big-count { flex: none; font-size: 22px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.board-footnote { margin-top: 10px; }

@media (max-width: 900px) {
  .board { grid-auto-columns: 82%; scroll-snap-type: x mandatory; }
  .board-col { max-height: none; }
}
@media (max-width: 700px) {
  .board { grid-auto-columns: 88%; margin-left: -16px; margin-right: -16px; padding-left: 16px; padding-right: 16px; scroll-padding-left: 16px; }
}

/* Archive contact */
.archived-banner { margin-top: 16px; padding: 12px 16px; border-radius: var(--radius); background: #e5e5ea; color: #1c1c1e; font-size: 14.5px; }
.card--danger h2 { color: #1c1c1e; }
.archive-details { margin-top: 4px; }
.archive-details summary { list-style: none; width: 100%; }
.archive-details summary::-webkit-details-marker { display: none; }
.archive-details[open] summary { display: none; }
.archive-form { display: grid; gap: 12px; margin-top: 4px; padding: 14px; border-radius: var(--radius); background: #fff3f2; }
.archive-what { margin: 0; }
.archive-list { margin: -6px 0 0; padding-left: 20px; font-size: 14px; display: grid; gap: 4px; }
.archive-form .field select, .archive-form .field textarea { background: var(--surface); }
.button--danger { width: 100%; margin-top: 0; background: #c4271c; color: #ffffff; }
.button--danger-outline { width: 100%; margin-top: 16px; background: #c4271c; color: #ffffff; } /* white on red: 5.6:1 */
.button--danger-outline:hover { background: #a91f15; filter: none; }
.status-tag--lost { background: #e5e5ea; color: #3a3a3c; }

/* Follow-ups: New leads strip above the board */
.leads-card { padding-bottom: 16px; }
.leads-grid { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.lead-tile {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
  padding: 8px 12px 8px 16px;
  border-radius: var(--radius-sm);
  background: var(--fill);
  color: var(--text);
  text-decoration: none;
  overflow: hidden;
}
.lead-tile::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--stage-dot, #aeaeb2); }
.lead-tile:hover { background: var(--fill-strong); }
.lead-tile-title { min-width: 0; font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lead-tile-count { flex: none; font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Keep counts in a straight column at the right of each call-list row */
.queue-label { flex: 1; }
.queue-count { margin-left: auto; }
@media (max-width: 700px) {
  /* Phone: one compact row per campaign so full names stay readable */
  .leads-card .leads-grid { grid-template-columns: 1fr; gap: 4px; }
  .lead-tile { min-height: 42px; padding: 6px 12px 6px 14px; }
  .lead-tile-title { white-space: normal; font-size: 14px; line-height: 1.25; }
}

/* Contacts page */
.filters--contacts { grid-template-columns: minmax(220px, 1.6fr) minmax(180px, 1.2fr) minmax(180px, 1.2fr) minmax(150px, 1fr); }
.filters--contacts-assign { grid-template-columns: minmax(200px, 1.8fr) repeat(5, minmax(0, 1fr)); }
@media (max-width: 1300px) {
  .filters--contacts-assign { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .filters--contacts, .filters--contacts-assign { grid-template-columns: 1fr 1fr; }
  .contacts-table th:nth-child(6), .contacts-table td:nth-child(6) { display: none; }
}
@media (max-width: 1000px) {
  .contacts-table th:nth-child(5), .contacts-table td:nth-child(5) { display: none; }
}
.contacts-table td:nth-child(7) { white-space: nowrap; }
.assigned-cell { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.priority-tag--high { background: var(--bad-tint); color: var(--bad); }
.priority-tag--medium { background: var(--warn-tint); color: var(--warn-ink); }
.priority-tag--low { background: var(--fill); color: var(--muted); }
@media (max-width: 700px) {
  .filters--contacts { grid-template-columns: 1fr; }
  /* Phone: each contact becomes a compact card — name, organisation, industry › subindustry */
  .contacts-table thead { display: none; }
  .contacts-table tbody tr { display: block; padding: 10px 0; border-bottom: 0.5px solid var(--separator); }
  .contacts-table tbody tr:last-child { border-bottom: 0; }
  .contacts-table td { display: block; padding: 1px 0; border: 0; }
  .contacts-table td:nth-child(2), .contacts-table td:nth-child(3), .contacts-table td:nth-child(4) { font-size: 13.5px; color: var(--muted); }
  .contacts-table td:nth-child(3), .contacts-table td:nth-child(4) { display: inline; }
  .contacts-table td:nth-child(4)::before { content: " › "; }
  .contacts-table td:nth-child(7) { padding: 4px 0 0; }
  .contacts-table td:nth-child(7).is-unassigned { display: none; }
}
@media (max-width: 700px) {
  .contacts-table td.is-blank { display: none !important; }
}

/* Industry review */
.rule-card p { margin: 0; font-size: 14.5px; }
.rule-card h2 { margin-bottom: 8px; }
.segmented--wide { flex-wrap: wrap; }
.seg-count { margin-left: 4px; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.filters--review { grid-template-columns: minmax(200px, 1.6fr) minmax(140px, 1fr) minmax(180px, 1.3fr) auto; }
.filters-go { align-self: end; }
.bulk-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 8px; padding: 10px 14px; border-radius: var(--radius); background: var(--ok-tint); color: #0f3d1c; font-size: 14px; font-weight: 600; }
.review-list { list-style: none; margin: 0 -20px; padding: 0; }
.review-item { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 12px 20px; align-items: center; padding: 14px 20px; border-top: 0.5px solid var(--separator); }
.review-company { display: grid; gap: 2px; min-width: 0; }
.review-org { font-weight: 600; font-size: 15px; overflow-wrap: anywhere; }
.review-domain, .review-current, .review-reason { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.review-error { font-size: 13px; color: var(--bad); }
.conf { display: inline-block; padding: 0 7px; border-radius: 999px; font-size: 11.5px; font-weight: 700; text-transform: capitalize; }
.conf--high { background: var(--ok-tint); color: var(--ok-ink); }
.conf--medium { background: var(--warn-tint); color: var(--warn-ink); }
.conf--low { background: var(--bad-tint); color: var(--bad); }
.review-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.review-form select { width: 100%; min-height: 38px; padding: 6px 30px 6px 10px; border: 1px solid transparent; border-radius: var(--radius-sm); background-color: var(--fill); font: inherit; font-size: 14px; color: var(--text); }
.review-actions { display: flex; gap: 6px; }
.review-final { font-size: 14.5px; }
@media (max-width: 1100px) {
  .review-item { grid-template-columns: 1fr; }
  .filters--review { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
  .review-list { margin: 0 -16px; }
  .review-item { padding: 12px 16px; }
  .review-form { grid-template-columns: 1fr; }
  .filters--review { grid-template-columns: 1fr; }
}
.nav-emoji { display: inline-grid; place-items: center; font-size: 17px; line-height: 1; }

/* ---------- Feedback ---------- */
.feedback-form { margin-top: 14px; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.feedback-form .field { width: 100%; margin: 0; }
.feedback-form textarea { width: 100%; }
.feedback-list { list-style: none; margin: 16px 0 0; padding: 0; }
.feedback-item { padding: 12px 0; border-top: 1px solid var(--fill); }
.feedback-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-size: 14px; }
.feedback-meta .muted { font-size: 13px; }
.feedback-delete { margin: 0 0 0 auto; }
.feedback-delete .link-button { font-size: 13px; color: var(--muted); }
.feedback-body { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.feedback-where { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 5px; margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.feedback-where svg { width: 14px; height: 14px; flex: none; }
.feedback-where a { color: var(--focus); font-weight: 600; }
.feedback-all-link { display: inline-block; margin-top: 12px; }

/* Feedback page (views/feedback.ejs) */
.filters--feedback { grid-template-columns: minmax(160px, 1fr) minmax(240px, 2fr) auto; align-items: end; }
.filters--feedback .filters-actions { align-items: center; }
.feedback-table td { vertical-align: top; }
.feedback-table .feedback-comment { min-width: 280px; white-space: pre-wrap; overflow-wrap: anywhere; }
.feedback-table .feedback-actions { text-align: right; }
.feedback-table .feedback-actions form { margin: 0; }
.feedback-table .feedback-actions .link-button { font-size: 13px; color: var(--muted); }
@media (max-width: 900px) {
  .feedback-table .feedback-comment { grid-column: 1 / -1; min-width: 0; }
  .feedback-table .feedback-actions { grid-column: 1 / -1; text-align: left; }
  .feedback-table .feedback-actions:empty { display: none; }
}
@media (max-width: 700px) {
  .filters--feedback { grid-template-columns: 1fr; }
}

/* ---------- Send-outs ---------- */
.filters--sendouts { grid-template-columns: minmax(220px, 2fr) minmax(180px, 1fr); }
.filters--sendout { grid-template-columns: minmax(220px, 2fr) auto; align-items: end; }
.filters-actions { display: flex; gap: 8px; align-items: end; }
.back-link { margin: 0 0 8px; }
.stat-row { list-style: none; margin: 16px 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.stat-row li { background: var(--surface); border-radius: 14px; padding: 14px 16px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04); }
.stat-label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.stat-value { display: block; margin-top: 4px; font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-sub { display: block; font-size: 13px; color: var(--muted); }
.sendout-note { margin: 10px 0 0; font-size: 14px; }
.result-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; }
.result-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 4px 12px; border: 1px solid transparent; border-radius: 999px; background: var(--fill); color: var(--text); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.result-chip .legend-count { font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.result-chip[aria-pressed="true"] { background: var(--surface); border-color: var(--text); }
.result-tag { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; background: var(--fill); color: #3a3a3c; }
.result-tag--clicked { background: var(--ok-tint); color: var(--ok-ink); }
.result-tag--opened { background: #e3effd; color: #0b4f9c; }
.result-tag--bounced, .result-tag--unsubscribed { background: var(--bad-tint); color: var(--bad); }
.link-list { list-style: none; margin: 0; padding: 0; }
.link-list li { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-top: 0.5px solid var(--separator); font-size: 14px; }
.link-list li:first-child { border-top: 0; }
.link-url { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 900px) {
  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .filters--sendouts, .filters--sendout { grid-template-columns: 1fr; }
}

/* ---------- New campaign wizard ---------- */
.save-state { margin: 0; font-size: 14px; }
.stepper { list-style: none; margin: 16px 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.stepper button { width: 100%; display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 12px; border: 0; border-radius: var(--radius-sm); background: rgba(255, 255, 255, 0.55); color: var(--text); font: inherit; font-size: 15px; font-weight: 600; text-align: left; cursor: pointer; }
.stepper button:hover { background: rgba(255, 255, 255, 0.8); }
.stepper button[aria-current="step"] { background: var(--surface); box-shadow: var(--shadow); }
.step-num { flex: none; display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--brand-black); color: #ffffff; font-size: 13px; }
.stepper button.has-problem .step-num { background: var(--bad); }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.field--wide { grid-column: 1 / -1; }
.field > span { font-size: 13px; font-weight: 600; color: var(--muted); }
.field > span em { font-weight: 400; font-style: normal; }
.field small { color: var(--muted); font-size: 12.5px; }
.step-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 20px; padding-top: 16px; border-top: 0.5px solid var(--separator); }
.step-nav .button { margin: 0; }
.subhead { margin: 24px 0 8px; font-size: 16px; font-weight: 700; }
.template-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.template-card { width: 100%; display: grid; gap: 6px; padding: 12px; border: 1px solid var(--separator); border-radius: var(--radius); background: var(--surface); color: var(--text); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.template-card:hover { border-color: var(--text); }
.template-thumb { width: 100%; height: 260px; border: 0; border-radius: var(--radius-sm); background: #f4f4f4; pointer-events: none; }
.editor-tip { font-size: 14px; }
.email-editor { border: 1px solid var(--separator); border-radius: var(--radius-sm); overflow: hidden; }
.picker-tabs { display: flex; gap: 8px; margin: 16px 0 0; }
.picker-tabs button { min-height: 36px; padding: 6px 14px; border: 0; border-radius: 999px; background: var(--fill); color: var(--text); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.picker-tabs button[aria-selected="true"] { background: var(--brand-black); color: #ffffff; }
.filters--sendout-pick { grid-template-columns: minmax(240px, 2fr) minmax(180px, 1fr) auto; align-items: end; }
.check-col { width: 44px; }
.check-col input { width: 20px; height: 20px; }
.added-tools { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.added-tools input { max-width: 320px; }
.warn-text { color: var(--warn-ink); }
.review-list { display: grid; gap: 0; margin: 0; }
.review-list > div { display: grid; grid-template-columns: 140px 1fr; gap: 12px; padding: 10px 0; border-bottom: 0.5px solid var(--separator); }
.review-list dt { color: var(--muted); font-weight: 600; font-size: 14px; }
.review-list dd { margin: 0; overflow-wrap: anywhere; }
.email-preview { width: 100%; height: 560px; border: 1px solid var(--separator); border-radius: var(--radius-sm); background: #f4f4f4; }
.send-box { margin-top: 20px; padding: 16px; border-radius: var(--radius); background: var(--fill); }
.send-box .subhead { margin-top: 0; }
.inline-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.inline-form .button { margin: 0; }
.inline-form select { min-width: 280px; background: var(--surface); }
.check-line { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; }
.check-line input { width: 20px; height: 20px; margin-top: 2px; }
.send-note { font-size: 14px; }
.send-error { color: var(--bad); font-weight: 600; }
#progress-bar { width: 100%; height: 10px; }
.delete-draft { margin-top: 12px; text-align: right; }
.danger-link { border: 0; background: none; color: var(--bad); cursor: pointer; font: inherit; font-size: 13px; font-weight: 600; }
.sendouts-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
@media (max-width: 900px) {
  .stepper, .template-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .filters--sendout-pick { grid-template-columns: 1fr; }
  .review-list > div { grid-template-columns: 1fr; gap: 2px; }
}
.wizard-step [hidden], #wizard [hidden] { display: none !important; } /* .button etc. set display, which would beat [hidden] */
.added-table button.open-link { border: 0; background: none; cursor: pointer; font-family: inherit; }

/* Recent replies widget (Gmail) */
.reply-row { gap: 2px; padding-top: 9px; padding-bottom: 9px; }
.reply-row .campaign-title { font-size: 15px; }
.reply-subject { font-size: 13px; font-weight: 600; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.reply-snippet { font-size: 12.5px; color: var(--muted); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.count-badge--alert { background: #c4271c; color: #ffffff; }
.reply-alert { margin: 20px 0 0; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--fill); font-size: 13.5px; font-weight: 600; }
.reply-alert--urgent { background: var(--warn-tint); color: var(--warn-ink); }
.reply-more { display: block; width: 100%; padding: 10px 20px; border: 0; border-top: 0.5px solid var(--separator); background: none; color: var(--muted); font: inherit; font-size: 13px; font-weight: 600; text-align: left; cursor: pointer; }
.reply-more:hover { color: var(--text); }
#email-replies [hidden] { display: none; }
.reply-row .campaign-meta { justify-content: flex-start; margin-top: 2px; }
.reply-row .result-badge { padding: 2px 8px; font-size: 11.5px; }
.reply-to { font-weight: 600; color: var(--text); }
/* Recent replies page: replies (main) left, engagement overview + hot / cold lists (side) right. */
.replies-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); grid-template-areas: "main side"; gap: 0 20px; align-items: start; }
.replies-main { grid-area: main; }
.replies-side { grid-area: side; }
.replies-side .card { margin-top: 20px; }
.temp--hot { background: #ff6b3d; }
.temp--warm { background: #f5c242; }
.temp--cold { background: #5ea3e0; }
.engagement-pill { padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; }
.engagement-pill.temp--hot { background: #ffe6dc; color: #a33a12; }
.engagement-pill.temp--warm { background: #fff3d1; color: #7a5300; }
.engagement-pill.temp--cold { background: #e2effb; color: #1d5a91; }
.engagement-list, .temp-list { list-style: none; margin: 8px -16px 0; padding: 0; }
.engagement-row { display: grid; gap: 6px; width: 100%; padding: 8px 16px; border: 0; background: none; font: inherit; color: var(--text); text-align: left; cursor: pointer; }
.engagement-row:hover { background: var(--fill); }
.engagement-row[aria-pressed="true"] { background: var(--fill-strong); }
.engagement-top { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.engagement-label { flex: 1; min-width: 0; font-weight: 500; }
.engagement-row[aria-pressed="true"] .engagement-label { font-weight: 700; }
.engagement-count { font-weight: 700; font-variant-numeric: tabular-nums; }
.temp-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; }
.engagement-bar { display: block; height: 5px; border-radius: 3px; background: var(--fill); overflow: hidden; }
.engagement-bar > span { display: block; height: 100%; border-radius: 3px; }
.engagement-note { padding: 8px 16px; font-size: 12.5px; color: var(--muted); }
.temp-card--hot { box-shadow: inset 4px 0 0 #ff6b3d, var(--shadow); }
.temp-card--cold { box-shadow: inset 4px 0 0 #5ea3e0, var(--shadow); }
.temp-toggle { display: inline-flex; align-items: center; padding: 0; border: 0; background: none; font: inherit; color: inherit; cursor: pointer; }
.temp-toggle:hover, .temp-toggle[aria-pressed="true"] { text-decoration: underline; text-decoration-color: var(--brand-teal); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.temp-list { max-height: 360px; overflow-y: auto; }
.temp-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 7px 16px; color: var(--text); text-decoration: none; font-size: 14px; }
.temp-row:hover { background: var(--fill); }
.temp-name { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 600; }
.temp-why { flex: none; font-size: 12px; color: var(--muted); }
.reply-filter { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 12px 0 0; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--fill); font-size: 13.5px; font-weight: 600; }
.text-button { padding: 0; border: 0; background: none; font: inherit; color: var(--text); text-decoration: underline; text-decoration-color: var(--brand-teal); text-decoration-thickness: 2px; text-underline-offset: 3px; cursor: pointer; }
@media (max-width: 1000px) {
  .replies-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "side" "main"; }
  .replies-side .card:first-child { margin-top: 0; }
}
.unread-dot { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: #0a84ff; vertical-align: middle; }
.email-tag { display: inline-block; margin-right: 6px; padding: 1px 7px; border-radius: 999px; background: var(--fill); color: var(--muted); font-size: 11px; font-weight: 600; vertical-align: 1px; }

/* Emails card (contact + deal pages) */
.email-list { list-style: none; margin: 10px -20px 0; padding: 0; }
.email-list li + li { border-top: 0.5px solid var(--separator); }
.email-row { display: grid; gap: 3px; padding: 10px 20px; color: var(--text); text-decoration: none; border-left: 3px solid transparent; }
.email-row:hover { background: rgba(118, 118, 128, 0.06); }
.email-row:focus-visible { outline-offset: -3px; border-radius: var(--radius-sm); }
.email-item--in .email-row { border-left-color: #34c759; }
.email-top { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); }
.email-dir { font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; }
.email-item--in .email-dir { color: #1e7a39; }
.email-subject { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.email-snippet { font-size: 13px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.email-mailbox { font-size: 11.5px; color: var(--muted); }
#contact-emails .table-message { padding: 16px 8px; }
button.email-row { width: 100%; margin: 0; border-top: 0; border-right: 0; border-bottom: 0; background: none; font: inherit; text-align: left; cursor: pointer; }
.email-item.is-open .email-row { background: rgba(118, 118, 128, 0.06); }
.email-item.is-open .email-snippet { display: none; }
.email-full { padding: 4px 20px 16px 23px; border-left: 3px solid transparent; }
.email-item--in .email-full { border-left-color: #34c759; }
.email-full[hidden], .email-quoted[hidden] { display: none; }
.email-full-head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 10px; margin: 0 0 10px; font-size: 12.5px; }
.email-full-head dt { color: var(--muted); font-weight: 600; }
.email-full-head dd { margin: 0; overflow-wrap: anywhere; }
.email-body { padding: 12px 14px; border-radius: var(--radius-sm); background: var(--fill); font-size: 14px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 480px; overflow-y: auto; }
.email-quoted { margin-top: 8px; color: var(--muted); font-size: 13px; }
.email-quoted-toggle { margin-top: 8px; font-size: 13px; }
.email-attachments { margin: 10px 0 0; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.email-gmail-link { display: inline-block; margin-top: 10px; font-size: 13px; font-weight: 600; }
.email-status { padding: 2px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 700; background: var(--fill); color: var(--muted); }
.email-status--replied { background: #dff6e5; color: #1e7a39; }
.email-status--awaiting { background: #fff0d9; color: #8a5100; }
@media (max-width: 600px) {
  .email-list { margin: 10px -16px 0; }
  .email-row { padding: 10px 16px; }
  .email-full { padding: 4px 16px 14px 19px; }
}

/* ---------- Campaign journey ---------- */
.stat-row--6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
/* Emails left to right, an arrow between each; scrolls sideways when they don't fit. */
.step-track { list-style: none; margin: 14px 0 0; padding: 4px 2px 10px; display: flex; gap: 36px; overflow-x: auto; scroll-snap-type: x proximity; }
.step-tile { position: relative; flex: 0 0 240px; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 14px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--separator); scroll-snap-align: start; }
.step-tile + .step-tile::before { content: "→"; position: absolute; left: -28px; top: 50%; transform: translateY(-50%); font-size: 20px; color: var(--muted); }
.step-tile--sent { border-color: transparent; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); }
.step-tile--failed, .step-tile--overdue { border-color: var(--bad); }
.step-tile--draft { border-style: dashed; }
.step-tile-head { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.step-tile-subject { font-size: 14px; line-height: 1.35; overflow-wrap: anywhere; }
.step-tile-empty { margin: 4px 0 0; font-size: 14px; flex: 1; }
.step-stats { width: 100%; margin: 4px 0 0; display: grid; gap: 0; flex: 1; }
.step-stats div { display: flex; justify-content: space-between; gap: 8px; padding: 5px 0; border-top: 0.5px solid var(--separator); font-size: 14px; }
.step-stats dt { color: var(--muted); }
.step-stats dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.step-stats .is-zero dd { font-weight: 500; color: var(--muted); }
.step-stat-sub { font-weight: 500; color: var(--muted); }
.step-tile--add { padding: 0; border-style: dashed; background: transparent; }
.step-add { flex: 1; width: 100%; min-height: 180px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 14px; background: transparent; color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }
.step-add:hover { background: var(--fill); }
.step-add-plus { font-size: 28px; line-height: 1; }
.journey-step-links { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 2px; font-size: 14px; }
.result-tag--declined, .result-tag--failed { background: var(--bad-tint); color: var(--bad); }
.result-tag--replied { background: var(--brand-black); color: var(--brand-yellow); }
@media (min-width: 1101px) {
  .stat-row--6:has(> li:nth-child(7)) { grid-template-columns: repeat(7, minmax(0, 1fr)); }
}
.result-tag--no-opens, .result-tag--not-opened, .result-tag--waiting, .result-tag--skipped, .result-tag--not-emailed { background: var(--fill); color: var(--muted); }
.journey-table td { vertical-align: top; }
.audience-box { margin: 16px 0 0; padding: 14px 16px; border-radius: 14px; background: var(--fill); }
.audience-box p { margin: 0; }
.audience-count { font-size: 17px; font-weight: 700; }
.audience-box .muted { margin-top: 4px; font-size: 14px; }
@media (max-width: 1100px) {
  .stat-row--6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .stat-row--6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Email templates ---------- */
.card-head-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.template-list--saved { margin: 16px 0 0; }
.template-item { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 12px; }
.template-item .cell-sub { margin-bottom: 4px; }
.template-preview { display: block; border-radius: var(--radius-sm); outline-offset: 2px; }
.template-preview:hover .template-thumb { box-shadow: 0 0 0 2px var(--text); }
.template-name { font-size: 15px; overflow-wrap: anywhere; }
.template-desc { font-size: 14px; }
/* Primary action full width, then Edit / Copy / Delete as an even row of soft buttons */
.template-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: auto; padding-top: 10px; border-top: 0.5px solid var(--separator); }
.template-actions form { margin: 0; display: contents; }
.template-actions form:first-child .button { grid-column: 1 / -1; width: 100%; min-height: 38px; }
.template-actions .open-link, .template-actions .danger-link {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 34px; padding: 6px 10px; border: 0; border-radius: 999px;
  background: var(--fill); color: var(--text);
  font: inherit; font-size: 13.5px; font-weight: 600; text-decoration: none; cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.template-actions .open-link:hover { background: var(--fill-strong); color: var(--text); }
.template-actions .danger-link { color: var(--bad); }
.template-actions .danger-link:hover { background: var(--bad-tint); color: var(--bad); }
.save-design-result { max-width: 260px; margin: 6px 0 0; font-size: 13px; text-align: right; }
.howto-list { margin: 0 0 8px; padding-left: 20px; line-height: 1.7; }
.template-group-title { margin: 18px 0 0; font-size: 15px; }
.template-group-title:first-child { margin-top: 0; }
@media (max-width: 700px) {
  .template-list--saved { grid-template-columns: 1fr; }
}

/* "What's new" pop-up (views/partials/announcement.ejs) */
.announcement { width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 0; border: 0; border-radius: var(--radius-lg); background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3); }
.announcement::backdrop { background: rgba(0, 0, 0, 0.45); }
.announcement-box { padding: 24px; }
.announcement-head h2 { margin: 8px 0 4px; font-size: 24px; }
.announcement-head .muted { margin: 0; }
.announcement-tag { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--brand-yellow); font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.announcement-list { margin: 18px 0 0; padding: 0; list-style: none; }
.announcement-item { display: flex; gap: 14px; padding: 14px 0; border-top: 1px solid var(--separator); }
.announcement-icon { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 12px; background: var(--brand-teal); }
.announcement-icon svg { width: 22px; height: 22px; }
.announcement-item h3 { margin: 0 0 4px; font-size: 17px; }
.announcement-item p { margin: 0; font-size: 15px; line-height: 1.45; }
.announcement-pin { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: var(--fill); color: var(--muted); font-size: 11.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; vertical-align: 2px; }
.announcement-link { display: inline-block; margin-top: 6px; color: var(--focus); font-size: 14px; font-weight: 600; }
button.announcement-link { padding: 0; border: 0; background: none; font-family: inherit; cursor: pointer; text-decoration: underline; }
.announcement-actions { display: flex; justify-content: flex-end; margin: 6px 0 0; }
.announcement-actions .button { margin: 0; min-width: 120px; }
@media (max-width: 600px) {
  .announcement-box { padding: 20px 16px; }
  .announcement-head h2 { font-size: 21px; }
  .announcement-actions .button { width: 100%; }
}

/* Ask AI + Feedback buttons, bottom right of every page (views/partials/shell-bottom.ejs).
   Their panels open above the bar, right-aligned, one at a time. */
.page { padding-bottom: 96px; } /* room so the buttons never sit over the last row of a page */
.float-bar { position: fixed; right: max(20px, env(safe-area-inset-right)); bottom: max(20px, env(safe-area-inset-bottom)); z-index: 24; display: flex; align-items: center; gap: 10px; }
.float-panel { position: absolute; right: 0; bottom: calc(100% + 10px); }
.feedback-toggle { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 10px 18px 10px 14px; border: 0; border-radius: 999px; background: var(--brand-black); color: #fff; font: inherit; font-size: 15px; font-weight: 600; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.22); cursor: pointer; transition: transform 0.1s; }
.feedback-toggle:hover { transform: translateY(-1px); }
.feedback-toggle svg { width: 20px; height: 20px; }
.feedback-bar.is-open .feedback-toggle { background: var(--surface); color: var(--text); }
.float-panel[hidden] { display: none; }
.feedback-panel { width: min(380px, calc(100vw - 32px)); padding: 16px; border-radius: var(--radius-lg); background: var(--surface); box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25); }
.feedback-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.feedback-panel-head h2 { margin: 0; font-size: 18px; }
.feedback-panel-close { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: 0; border-radius: 999px; background: var(--fill); color: var(--text); cursor: pointer; }
.feedback-panel-close svg { width: 16px; height: 16px; }
.feedback-about { display: grid; gap: 4px; margin: 12px 0 10px; font-size: 13px; font-weight: 600; color: var(--muted); }
.feedback-about select { width: 100%; }
.feedback-panel textarea { width: 100%; resize: vertical; }
.feedback-panel-status { min-height: 0; margin: 8px 0 0; font-size: 14px; }
.feedback-panel-status:empty { display: none; }
.feedback-panel-status.is-ok { color: var(--ok-ink); }
.feedback-panel-status.is-error { color: var(--bad); }
.feedback-panel-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.feedback-panel-all { font-size: 14px; color: var(--focus); }
.ask-ai-toggle { background: var(--brand-yellow); color: #000; }
.ask-ai.is-open .ask-ai-toggle { background: var(--surface); color: var(--text); }
.ask-ai-panel {
  display: flex;
  flex-direction: column;
  width: min(440px, calc(100vw - 32px));
  max-height: min(620px, calc(100vh - 120px));
  padding: 16px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}
.ask-ai-panel[hidden] { display: none; }
.ask-ai-actions { display: flex; align-items: center; gap: 8px; }
.ask-ai-panel .assistant-log { flex: 1 1 auto; min-height: 0; max-height: none; }
.ask-ai-panel .assistant-intro { margin-top: 10px; }
@media (max-width: 700px) {
  /* above the bottom menu bar */
  .float-bar { right: 16px; bottom: calc(64px + 12px + env(safe-area-inset-bottom)); }
  .feedback-toggle { min-height: 44px; padding: 10px; }
  .feedback-toggle span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .page { padding-bottom: 80px; }
}

/* ---------- Contacts → Bulk import ---------- */
.import-panel { margin-top: 16px; }
.import-help { margin: 10px 0 0; font-size: 14px; }
.drop-zone { display: grid; gap: 6px; justify-items: center; padding: 40px 16px; border: 2px dashed var(--control-border); border-radius: var(--radius); background: var(--fill); text-align: center; cursor: pointer; transition: background 0.15s, border-color 0.15s; }
.drop-zone:hover, .drop-zone.is-over { border-color: var(--focus); background: rgba(103, 209, 210, 0.18); }
.drop-zone:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.drop-zone strong { font-size: 17px; }
.import-link { align-items: end; }
.import-link .field { flex: 1 1 320px; }
.import-headings { margin: 12px 0 4px; }
.map-table td { vertical-align: top; }
.map-table td:last-child { width: 280px; }
.map-table tr.is-skipped td:not(:last-child) { opacity: 0.55; }
.map-examples { font-size: 13.5px; color: var(--muted); }
.map-examples div { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.import-tools { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(0, 2fr); gap: 16px; margin: 16px 0 8px; align-items: end; }
.import-fill { display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; align-items: end; }
.import-fill .button { margin: 0; min-height: 40px; }
.import-filter { margin: 8px 0; }
.import-grid-wrap { max-height: 70vh; overflow: auto; }
.import-grid { font-size: 14px; }
.import-grid th { position: sticky; top: 0; z-index: 1; background: var(--surface); white-space: nowrap; }
.import-grid td { padding: 4px 3px; vertical-align: top; }
.import-grid input { width: 100%; min-width: 120px; min-height: 34px; padding: 6px 8px; border: 1px solid transparent; border-radius: 8px; background: var(--fill); color: var(--text); font: inherit; font-size: 14px; }
.import-grid input[data-key="email"] { min-width: 210px; }
.import-grid input:focus { outline: none; background: var(--surface); border-color: var(--focus); box-shadow: 0 0 0 3px rgba(11, 110, 112, 0.25); }
.import-grid .grid-num { width: 36px; padding-top: 12px; color: var(--muted); font-size: 12.5px; text-align: right; }
.import-grid .grid-status { min-width: 150px; max-width: 260px; padding-top: 8px; }
.import-grid .grid-remove { width: 36px; }
.import-grid tr.has-error input[aria-invalid="true"] { border-color: var(--bad); background: var(--bad-tint); }
.import-grid tr.is-skipped input { opacity: 0.6; }
.grid-notes { margin: 6px 0 0; padding-left: 16px; font-size: 12.5px; color: var(--warn-ink); }
.grid-notes .is-bad { color: var(--bad); }
.result-badge.is-ok { background: var(--ok-tint); color: var(--ok-ink); }
.result-badge.is-bad { background: var(--bad-tint); color: var(--bad); }
.result-badge.is-warn { background: var(--warn-tint); color: var(--warn-ink); }
.icon-button { width: 32px; height: 32px; margin-top: 2px; border: 0; border-radius: 999px; background: none; color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer; }
.icon-button:hover { background: var(--bad-tint); color: var(--bad); }
.import-add { margin-top: 10px; }
#contact-import [hidden] { display: none !important; }
@media (max-width: 900px) {
  .import-tools { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .import-fill { grid-template-columns: 1fr; }
  .map-table td:last-child { width: auto; }
}

/* Follow-ups: hot leads and find a new lead (from dashboard campaigns) */
.lead-cards { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.lead-card { margin: 0; }
.lead-card .board-card-actions form { margin: 0; }
.lead-card--hot { --stage-dot: var(--brand-teal); }
.lead-signal { flex: none; padding: 2px 8px; border-radius: 999px; background: rgba(103, 209, 210, 0.3); font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.lead-signal--none { background: var(--fill); color: var(--muted); }
.notice--done { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; background: var(--ok-tint); color: var(--ok-ink); }
.campaign-hot { flex: none; padding: 1px 8px; border-radius: 999px; background: rgba(103, 209, 210, 0.35); color: var(--brand-black); font-weight: 700; }
.lead-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 12px 0 0; }
.lead-filter label { font-size: 14px; font-weight: 600; color: var(--muted); }
.lead-filter select { width: auto; min-width: 260px; max-width: 100%; }
/* Follow-ups: Hot leads (left) and Find a new lead (right) side by side */
.leads-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 20px; align-items: start; }
.leads-pair > .card { margin-top: 0; }
.leads-pair .lead-cards { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
@media (max-width: 900px) {
  .leads-pair { grid-template-columns: 1fr; }
}
.lead-stage { margin: 6px 0 0; font-size: 13px; font-weight: 600; color: var(--muted); }
.lead-stage--due { color: var(--warn-ink); }
.lead-card--waiting { opacity: 0.7; }
.lead-card--waiting:hover, .lead-card--waiting:focus-within { opacity: 1; }
.lead-card--no-reply { --stage-dot: var(--warn-ink); }
.lead-done { margin: 6px 0 0; text-align: right; }
.lead-done .link-button { padding: 2px 0; color: var(--muted); font-size: 12.5px; }
.button.is-unavailable { opacity: 0.5; cursor: default; }

/* "Start a new campaign" dashboard widget: the main action, so a light brand-teal tile (30% teal)
   that stands out among the white cards. */
.card.start-campaign { background: color-mix(in srgb, var(--brand-teal) 30%, var(--surface)); box-shadow: inset 0 0 0 2px var(--brand-teal), var(--shadow); }
.start-campaign h2 { display: flex; align-items: center; gap: 8px; }
.start-campaign h2::before { content: "+"; display: grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--brand-black); color: var(--brand-teal); font-size: 18px; font-weight: 700; line-height: 1; }
.start-campaign .card-summary,
.start-campaign .field > span,
.start-campaign .field small { color: #3d4a4a; } /* --muted is a little faint on the teal */
.start-campaign .field input[type="text"] { background: var(--surface); }
.start-campaign-form { display: grid; gap: 12px; margin: 12px 0 8px; }
.start-campaign-form .button { justify-self: start; margin: 0; }
.notice--campaign { background: var(--ok-tint); color: var(--ok-ink); }

/* ---------- Lists ---------- */
.label-pill { display: inline-block; margin: 1px 0; padding: 2px 9px; border-radius: 999px; background: var(--brand-teal); color: #000; font-size: 12px; font-weight: 600; white-space: nowrap; }
.label-suggestions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.label-pill--add { border: 0; background: var(--fill); color: var(--text); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.label-pill--add:hover { background: var(--fill-strong); }
.list-new > summary { list-style: none; cursor: pointer; }
.list-new > summary::-webkit-details-marker { display: none; }
.list-new > summary .button { margin: 0; }
.list-new[open] > summary { margin-bottom: 16px; }
.list-form { display: grid; gap: 16px; max-width: 640px; }
.list-form .field > span { font-size: 13px; font-weight: 600; color: var(--muted); }
.list-description { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.list-count-note { margin-top: 10px; }
.filters--lists { grid-template-columns: minmax(220px, 2fr) minmax(160px, 1fr) minmax(160px, 1fr); }
.filters--list-members { grid-template-columns: minmax(220px, 420px); }
.list-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 0 20px; align-items: start; }
.add-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 14px 0 10px; }
.add-actions .button { margin: 0; }
.add-progress { margin: 0 0 12px; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--fill); font-size: 14px; }
.add-progress p { margin: 0; }
.add-progress p + p { margin-top: 4px; }
.add-progress details { margin-top: 8px; }
.add-progress ul { margin: 6px 0 0; padding-left: 20px; max-height: 220px; overflow-y: auto; font-size: 13px; }
.add-progress[hidden] { display: none; }
@media (max-width: 1000px) {
  .list-grid { grid-template-columns: minmax(0, 1fr); }
  .filters--lists { grid-template-columns: 1fr; }
}
#members-bulk { background: var(--fill); color: var(--text); justify-content: flex-start; gap: 8px 16px; }
#members-bulk[hidden] { display: none; }
#members-bulk .button--danger { width: auto; margin: 0 0 0 auto; }
.row-actions { white-space: nowrap; text-align: right; }
.row-actions .link-button + .link-button { margin-left: 12px; }
.danger-link { color: var(--bad); }
.edit-dialog { width: min(560px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: var(--radius-lg); box-shadow: var(--shadow); background: var(--surface); color: var(--text); }
.edit-dialog::backdrop { background: rgba(0, 0, 0, 0.35); }
.edit-dialog-box { display: grid; gap: 12px; padding: 22px; }
.edit-dialog-box h2 { margin: 0; font-size: 20px; }
.edit-dialog-box > .muted { margin: -6px 0 0; font-size: 14px; }
.edit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.edit-grid .field > span { font-size: 13px; font-weight: 600; color: var(--muted); }
.edit-dialog-status { margin: 0; min-height: 1.4em; font-size: 14px; }
.edit-dialog-actions { display: flex; justify-content: flex-end; gap: 10px; }
.edit-dialog-actions .button { width: auto; margin: 0; }
.summary-card h2 { display: flex; align-items: center; gap: 8px; }
.summary-ai { padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: 0.04em; background: var(--brand-teal); color: var(--brand-black); }
.summary-text { margin: 0 0 8px; font-size: 15px; line-height: 1.5; }
.summary-card[aria-busy="true"] .summary-text { color: var(--muted); }
.summary-next { margin: 0 0 8px; font-size: 14.5px; }
.summary-meta { margin: 0; }
.summary-start { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.summary-start p { flex: 1 1 260px; margin: 0; font-size: 14px; }
.summary-start .button { width: auto; margin: 0; }
.summary-cost { display: block; margin-top: 4px; font-size: 12.5px; }
.send-email-options { grid-template-columns: 1fr 1fr; }
.edit-dialog-actions .send-email-mailto { margin-right: auto; align-self: center; font-size: 13px; }
@media (max-width: 600px) {
  .send-email-options { grid-template-columns: 1fr; }
  .edit-dialog-actions:has(.send-email-mailto) { flex-wrap: wrap; }
  .edit-dialog-actions .send-email-mailto { flex-basis: 100%; }
}
@media (max-width: 600px) {
  .edit-grid { grid-template-columns: 1fr; }
}
/* List page tables: compact rows so more people fit on screen; the email sits beside the name. */
#list-page .deals-table td { padding: 5px 10px; font-size: 14px; }
#list-page .deals-table th { padding-top: 6px; padding-bottom: 6px; }
#list-page .deals-table td .cell-sub { display: inline; margin-left: 8px; font-size: 12.5px; }
#list-page .deals-table input[type="checkbox"] { margin: 0; vertical-align: middle; }
#list-page .row-actions .link-button { font-size: 13px; }
@media (max-width: 700px) {
  #list-page .deals-table td .cell-sub { display: block; margin-left: 0; }
}

/* ---------- Multi-select dropdown (public/js/multiselect.js) ---------- */
.ms-field { display: grid; gap: 5px; min-width: 0; }
.ms-field > span { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.ms { position: relative; min-width: 0; }
.ms-button {
  display: flex; align-items: center; width: 100%; min-height: 40px; padding: 9px 34px 9px 12px;
  border: 1px solid transparent; border-radius: var(--radius-sm); background: var(--fill); color: var(--text);
  font: inherit; font-size: 15px; text-align: left; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%233c3c43' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.ms-button:focus-visible { outline: none; background-color: var(--surface); border-color: var(--focus); box-shadow: 0 0 0 3px rgba(11, 110, 112, 0.25); }
.ms-button.has-value { font-weight: 600; }
.ms-value { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ms-panel { position: absolute; z-index: 15; top: calc(100% + 6px); left: 0; width: max(100%, 300px); max-width: calc(100vw - 32px); padding: 10px; border-radius: var(--radius); background: var(--surface); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 12px 32px rgba(0, 0, 0, 0.14); }
.ms-panel[hidden] { display: none; }
.ms-search,
.filters .ms-search {
  width: 100%; min-height: 36px; padding: 7px 10px 7px 32px;
  border: 1px solid transparent; border-radius: var(--radius-sm); background-color: var(--fill); color: var(--text);
  font: inherit; font-size: 14px; transition: background-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Ccircle cx='6' cy='6' r='4.6' fill='none' stroke='%235c5c61' stroke-width='1.6'/%3E%3Cpath d='M9.4 9.4L13 13' stroke='%235c5c61' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 11px center;
}
.ms-search::placeholder { color: var(--muted); }
.ms-search::-webkit-search-cancel-button { cursor: pointer; }
.ms-search:focus,
.filters .ms-search:focus { outline: none; background-color: var(--surface); border-color: var(--focus); box-shadow: 0 0 0 3px rgba(11, 110, 112, 0.25); }
.ms-list { list-style: none; margin: 8px 0 0; padding: 0; max-height: 260px; overflow-y: auto; }
.ms-list label { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; font-size: 14px; cursor: pointer; }
.ms-list label:hover { background: var(--fill); }
.ms-list input { flex: none; width: 16px; height: 16px; min-height: 0; margin: 0; padding: 0; }
.ms-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.ms-count { flex: none; color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.ms-empty { margin: 10px 8px; color: var(--muted); font-size: 14px; }
.ms-empty[hidden] { display: none; }
.ms-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; padding-top: 8px; border-top: 0.5px solid var(--separator); }
.ms-foot .button { width: auto; margin: 0; }

/* List page: search + industry + subindustry on one row, "Choose all matching" on the next. */
.filters--add-people { grid-template-columns: minmax(220px, 1.4fr) minmax(180px, 1fr) minmax(180px, 1fr); }
.filters--add-people .filters-actions { grid-column: 1 / -1; align-items: center; }
@media (max-width: 700px) {
  .filters--add-people { grid-template-columns: 1fr; }
}
.filters .ms-list label > span { font-size: 14px; font-weight: 400; color: var(--text); text-transform: none; letter-spacing: 0; }
.filters .ms-list label > .ms-count { font-size: 12.5px; color: var(--muted); }
.reply-campaign { display: flex; align-items: baseline; gap: 6px; min-width: 0; font-size: 12.5px; }
.reply-campaign-tag { flex: none; padding: 1px 7px; border-radius: 999px; background: var(--brand-teal); color: #000; font-size: 11px; font-weight: 700; }
.reply-campaign--guess .reply-campaign-tag { background: var(--fill); color: var(--muted); }
.reply-campaign-name { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 600; }
.reply-campaign--guess .reply-campaign-name { font-weight: 500; color: var(--muted); }
.reply-campaign--direct .reply-campaign-tag { background: var(--brand-yellow); }

/* ---------- Contact notes ---------- */
.note-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 10px; }
.note { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--fill); }
.note.is-target { box-shadow: 0 0 0 2px var(--brand-teal); }
.note-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-size: 13px; }
.note-head .muted { font-size: 12px; }
.note-body { margin-top: 4px; font-size: 14.5px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.mention { padding: 0 3px; border-radius: 4px; background: var(--brand-yellow); font-weight: 600; }
.note-actions { display: flex; gap: 14px; margin-top: 6px; font-size: 13px; }
.note-about-chip { display: flex; align-items: baseline; gap: 6px; min-width: 0; margin-top: 6px; font-size: 12.5px; }
.note-about-dir { flex: none; padding: 1px 7px; border-radius: 999px; background: var(--ok-tint); color: var(--ok-ink); font-size: 11px; font-weight: 700; }
.note-about-chip--out .note-about-dir { background: var(--surface); color: var(--muted); }
.note-about-subject { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--muted); }
.note-form { display: grid; gap: 8px; margin-top: 14px; }
.note-about { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 6px 10px; border-radius: var(--radius-sm); background: var(--ok-tint); color: var(--ok-ink); font-size: 13px; }
.note-about[hidden] { display: none; }
.note-about strong { overflow-wrap: anywhere; }
.note-input-wrap { position: relative; }
.note-input-wrap textarea { width: 100%; min-height: 70px; padding: 9px 12px; border: 1px solid transparent; border-radius: var(--radius-sm); background: var(--fill); color: var(--text); font: inherit; font-size: 15px; resize: vertical; }
.note .note-input-wrap textarea { background: var(--surface); }
.note-input-wrap textarea:focus { outline: none; background: var(--surface); border-color: var(--focus); box-shadow: 0 0 0 3px rgba(11, 110, 112, 0.25); }
.note-form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 6px; }
.note-form-actions .button { width: auto; margin: 0; }
.note-status { margin-right: auto; font-size: 13px; }
.mention-menu { position: absolute; z-index: 15; left: 8px; top: calc(100% - 4px); min-width: 180px; margin: 0; padding: 6px; list-style: none; border-radius: var(--radius-sm); background: var(--surface); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 12px 32px rgba(0, 0, 0, 0.14); }
.mention-menu[hidden] { display: none; }
.mention-menu li { padding: 6px 10px; border-radius: 6px; font-size: 14px; cursor: pointer; }
.mention-menu li.is-active, .mention-menu li:hover { background: var(--fill); }
.email-full-links { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; margin-top: 10px; }
.email-full-links .email-gmail-link { margin-top: 0; }
.email-note-link { font-size: 13px; font-weight: 600; }

/* ---------- Notification bell ---------- */
.bell { position: relative; }
.bell-button { position: relative; display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: var(--fill); color: var(--text); cursor: pointer; }
.bell-button:hover { background: var(--fill-strong); }
.bell-button svg { width: 19px; height: 19px; }
.bell-count { position: absolute; top: -3px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #c4271c; color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.bell-count[hidden] { display: none; }
.bell-panel { position: absolute; z-index: 30; top: calc(100% + 8px); right: 0; width: min(360px, calc(100vw - 24px)); max-height: min(480px, calc(100vh - 80px)); overflow-y: auto; padding: 10px; border-radius: var(--radius); background: var(--surface); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 12px 32px rgba(0, 0, 0, 0.16); }
.bell-panel[hidden] { display: none; }
.bell-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 8px; font-size: 15px; }
.bell-head .link-button { font-size: 13px; }
.bell-list { list-style: none; margin: 0; padding: 0; }
.bell-item { display: grid; gap: 2px; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--text); text-decoration: none; font-size: 13.5px; }
.bell-item:hover { background: var(--fill); }
.is-unread .bell-item { background: rgba(103, 209, 210, 0.16); }
.bell-snippet { color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.bell-time { font-size: 12px; color: var(--muted); }
.bell-empty { margin: 6px; font-size: 13.5px; }
.bell-empty[hidden] { display: none; }
.mention-menu li.mention-none { max-width: 260px; color: var(--muted); font-size: 13px; cursor: default; }
.mention-menu li.mention-none:hover { background: none; }
/* Ask AI pop-up as a chat window: fixed height, messages fill it, the box sits at the bottom. */
.ask-ai-panel { height: min(620px, calc(100vh - 120px)); }
.ask-ai-panel .assistant-intro--chat { margin-top: 12px; display: grid; }
.ask-ai-panel .assistant-intro--chat[hidden] { display: none; }
.ask-ai-panel .assistant-intro--chat .assistant-msg { max-width: 90%; }
.ask-ai-panel .assistant-form { margin-top: auto; }
.ask-ai-panel .assistant-log:not(:empty) + .assistant-form { margin-top: 10px; }

/* ---------- Email editor instructions ---------- */
#editor-wrap { margin-top: 18px; } /* gap under the Email heading */
.editor-tips { margin-bottom: 14px; font-size: 14px; }
.email-tags { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px 24px; margin: 6px 0 4px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--fill); }
.email-tag-group h4 { margin: 0 0 6px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.email-tag-group ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 13px; }
.email-tag-copy { padding: 0; border: 0; background: none; font: inherit; cursor: pointer; }
.email-tag-copy code { display: inline-block; padding: 1px 6px; border-radius: 5px; background: var(--surface); font-size: 12.5px; }
.email-tag-copy:hover code { box-shadow: 0 0 0 1.5px var(--brand-teal); }
.email-tag-copy.is-copied code { background: var(--ok-tint); color: var(--ok-ink); }
.editor-tips > summary, .email-tags-section > summary { cursor: pointer; font-weight: 600; }
.email-tags-section { margin: 8px 0 4px; }
.email-tags-section > summary { font-size: 14px; }
.email-tags-section[open] > summary { margin-bottom: 6px; }

/* ---------- Assigned to card (contact page) ---------- */
.assignment-card { display: grid; gap: 12px; }
.assignment-now { margin: 0; }
.assignment-now .cell-sub { display: block; margin-top: 4px; }
.assignment-form { display: grid; gap: 10px; }
.assignment-form .hint { margin: 0; }
.assignment-form .hint:empty { display: none; }
.assignment-fields { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 10px; }

/* ---------- Follow up card (contact page) ---------- */
.follow-up-card { display: grid; gap: 12px; }
.fu-suggestion { padding: 12px 14px; border-radius: var(--radius-sm); background: #e8f8f8; box-shadow: inset 3px 0 0 var(--brand-teal); }
.fu-suggestion p { margin: 0; }
.fu-suggestion-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--focus); }
.fu-suggestion-when { margin-top: 4px !important; font-weight: 700; }
.fu-suggestion-desc { margin: 2px 0 4px !important; }
.fu-suggestion-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.fu-suggestion-actions .button { width: auto; }
.fu-status { font-size: 13px; }
.fu-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.fu-item { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--fill); }
.fu-item.is-overdue { background: var(--bad-tint); }
.fu-item.is-done { background: transparent; padding: 6px 0; border-bottom: 1px solid var(--separator); border-radius: 0; }
.fu-item.is-done .fu-item-desc { color: var(--muted); }
.fu-item-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fu-item-due { font-weight: 700; font-size: 14px; }
.is-overdue .fu-item-due { color: var(--bad); }
.fu-item-desc { margin: 2px 0 0; overflow-wrap: anywhere; }
.fu-item-meta { margin: 2px 0 0; font-size: 13px; }
.fu-item .note-actions { margin-top: 4px; display: flex; gap: 14px; }
.fu-empty { margin: 0; font-size: 14px; }
.fu-form { display: grid; gap: 10px; padding-top: 12px; border-top: 1px solid var(--separator); }
.fu-when { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr) auto; align-items: end; gap: 8px; }
.fu-mail { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 999px; flex: none; cursor: help; }
.fu-when .fu-mail { height: 40px; width: 36px; }
.fu-mail--scheduled { color: var(--focus); background: #e8f8f8; }
.fu-mail--sent { color: var(--ok-ink); background: var(--ok-tint); }
.fu-mail--off { color: var(--muted); background: var(--fill); }
.fu-mail--failed { color: var(--warn-ink); background: var(--warn-tint); }
.fu-mail--off .fu-mail-icon { opacity: 0.55; }
.fu-done summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--muted); }
.fu-done .fu-list { margin-top: 6px; gap: 0; }

/* ---------- Reports: campaign report ---------- */
.report-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.report-actions .button { text-decoration: none; color: var(--text); display: inline-flex; align-items: center; }
.report-picker { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 16px; margin: 16px 0 4px; }
.report-picker-field { display: grid; gap: 5px; width: min(440px, 100%); }
.report-picker-label, .report-sort > span { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.report-picker .ms-button { width: 100%; background: var(--surface); }
.report-suggest { margin: 0 0 8px; font-size: 14px; color: var(--muted); }
.report-meta { margin: 8px 0 0; font-size: 13.5px; }
.report-note { margin: 0 0 14px; font-size: 13.5px; max-width: 72ch; }
.report-h3 { margin: 22px 0 8px; font-size: 15px; font-weight: 700; }
.report-sort { display: inline-flex; align-items: center; gap: 8px; }
.report-sort select { min-height: 32px; padding: 4px 10px; border: 0; border-radius: var(--radius-sm); background: var(--fill); font: inherit; font-size: 14px; }
.card-head .button--small { text-decoration: none; color: var(--text); display: inline-flex; align-items: center; }

.stat-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; margin-top: 14px; }
.stat-tile { display: grid; gap: 2px; padding: 12px 14px; border-radius: var(--radius); background: var(--page-bg); min-width: 0; }
.stat-label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.stat-value { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
.stat-sub { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.stat-tile--good { background: var(--ok-tint); }
.stat-tile--bad { background: var(--bad-tint); }

/* Stacked response bar: 2px surface gaps between segments, rounded ends */
.rbar { display: flex; height: 12px; min-width: 60px; }
.rbar-inner { display: flex; gap: 2px; height: 100%; border-radius: 4px; overflow: hidden; }
.rbar--hero { height: 20px; display: flex; gap: 2px; border-radius: 6px; overflow: hidden; }
.rbar-seg { min-width: 3px; height: 100%; }
.report-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 10px 0 0; padding: 0; list-style: none; font-size: 13.5px; }
.report-key { display: inline-flex; align-items: center; gap: 6px; }
.report-swatch { width: 10px; height: 10px; border-radius: 3px; flex: none; }

.report-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 0 32px; }
.funnel, .stage-bars { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.hbar { display: grid; grid-template-columns: minmax(96px, 9.5em) minmax(60px, 1fr) auto; align-items: center; gap: 10px; font-size: 14px; }
.hbar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { height: 14px; border-radius: 4px; background: var(--fill); overflow: hidden; }
.hbar-fill { display: block; height: 100%; border-radius: 0 4px 4px 0; background: #0b6e70; }
.hbar-fill[class*="stage--"] { background: var(--stage-dot); }
.hbar-value { white-space: nowrap; font-variant-numeric: tabular-nums; font-size: 13.5px; }

.report-summary h2 { margin-bottom: 8px; }
.summary-list { margin: 0; padding-left: 20px; display: grid; gap: 6px; max-width: 90ch; }
.summary-list li::marker { color: var(--muted); }

.group-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 32px; }
.group-col { min-width: 0; }
.group-col .report-h3 { margin-top: 6px; }
.group-table { table-layout: fixed; }
.group-table th:first-child { width: 36%; }
.group-table th:nth-child(3) { width: 24%; }
.group-table th:nth-child(4) { width: 17%; }
.group-table td, .group-table th[scope="row"] { padding: 8px 6px; }
.group-table th[scope="row"] { text-align: left; font-weight: 600; }
.group-bar-col .rbar { min-width: 0; }
.group-pick { padding: 0; border: 0; background: none; font: inherit; font-weight: 600; color: var(--text); text-align: left; cursor: pointer; overflow-wrap: anywhere; text-decoration: underline; text-decoration-color: var(--brand-teal); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.group-more { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding-top: 8px; font-size: 13.5px; }
.group-more .link-button { font-weight: 600; }
@media (max-width: 1100px) { .group-cols { grid-template-columns: 1fr; } }

.report-filter { position: sticky; top: 64px; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; margin-top: 20px; padding: 10px 16px; border-radius: var(--radius); background: var(--brand-teal); color: var(--brand-black); font-weight: 600; scroll-margin-top: 72px; }
.report-filter .link-button { color: var(--brand-black); text-decoration: underline; }

.reason-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.reason-chip { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--fill); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.reason-chip--hot { background: var(--ok-tint); color: var(--ok-ink); }
.reason-chip--warm { background: var(--warn-tint); color: var(--warn-ink); }
.reason-chip--cold { background: #e3effd; color: #0b4f9c; }
.priority-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* Loading bar while a campaign report builds */
.report-loading { max-width: 560px; margin: 24px auto; padding: 16px 18px; border-radius: var(--radius); background: var(--fill); }
.report-loading[hidden] { display: none; }
.report-loading-text { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 0 0 8px; font-size: 14.5px; }
.report-loading-pct { font-variant-numeric: tabular-nums; }
.report-loading progress { display: block; width: 100%; height: 10px; }
.report-loading .hint { margin: 8px 0 0; }

.assign-cell { min-width: 150px; }
.assign-select { display: block; width: 100%; max-width: 180px; min-height: 32px; padding: 4px 8px; border: 1px solid transparent; border-radius: var(--radius-sm); background-color: var(--fill); color: var(--text); font: inherit; font-size: 13.5px; }
.assign-select:focus { outline: none; background-color: var(--surface); border-color: var(--focus); box-shadow: 0 0 0 3px rgba(11, 110, 112, 0.25); }
.assign-select--priority { margin-top: 4px; }
.assign-cell.is-assigned .assign-select:first-child { font-weight: 600; }
.assign-status:empty { display: none; }

.chart-tip { position: fixed; top: 0; left: 0; z-index: 50; max-width: 280px; padding: 6px 10px; border-radius: 8px; background: rgba(0, 0, 0, 0.86); color: #fff; font-size: 13px; pointer-events: none; }

@media (max-width: 700px) {
  .group-table th:first-child { width: 40%; }
  .group-table th:nth-child(2), .group-table td:nth-child(2) { display: none; } /* bar: the numbers carry it on a phone */
  .hbar { grid-template-columns: minmax(80px, 7.5em) minmax(40px, 1fr) auto; }
  .stat-value { font-size: 22px; }
}

/* ---------- Journey: How each email did (chart) ---------- */
.chain-card { position: relative; }
.chain-takeaway { margin: 0 0 10px; font-weight: 600; }
.chain-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0 0 6px; padding: 0; list-style: none; font-size: 13.5px; }
.chain-legend li { display: inline-flex; align-items: center; gap: 6px; }
.chain-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: none; }
.chain-chart { width: 100%; overflow: hidden; }
.chain-chart svg { display: block; max-width: 100%; height: auto; }
.chain-grid { stroke: var(--separator); stroke-width: 1; }
.chain-axis { stroke: rgba(60, 60, 67, 0.4); stroke-width: 1; }
.chain-tick { fill: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.chain-label { fill: var(--text); font-size: 13px; font-weight: 600; }
.chain-hit { fill: transparent; cursor: default; outline: none; }
.chain-hit:hover, .chain-hit:focus { fill: rgba(118, 118, 128, 0.08); }
.chain-tip { position: absolute; z-index: 5; min-width: 190px; padding: 8px 10px; border-radius: 8px; background: rgba(0, 0, 0, 0.86); color: #fff; font-size: 13px; pointer-events: none; }
.chain-tip[hidden] { display: none; }
.chain-tip-sub { color: rgba(255, 255, 255, 0.75); font-size: 12px; }
.chain-tip-row { display: flex; align-items: center; gap: 6px; margin-top: 3px; }
.chain-table-box { margin-top: 10px; }
.chain-table-box summary { cursor: pointer; font-size: 14px; font-weight: 600; }
.chain-table tbody th[scope="row"] { text-align: left; font-size: 14px; font-weight: 600; letter-spacing: normal; text-transform: none; color: var(--text); }

/* ---------- Decks ---------- */
/* New deck: just the button when closed; the form gets the card look when opened. */
.deck-new-panel { margin-top: 16px; }
.deck-new-panel[open] > summary { margin-bottom: 12px; }
.deck-new-button svg { flex: none; }
.deck-new-panel[open] > .deck-new { padding: 20px; background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
@media (max-width: 600px) { .deck-new-panel[open] > .deck-new { padding: 16px; border-radius: 16px; } }
/* New deck: drop zone (3/4) on the left, details (1/4) on the right. */
.deck-new { display: grid; grid-template-columns: minmax(0, 3fr) minmax(240px, 1fr); gap: 20px; align-items: stretch; }
.deck-drop { min-height: 440px; align-content: center; padding: 24px; }
.deck-drop-icon { width: 56px; height: 56px; color: var(--muted); }
.deck-drop-preview { display: grid; place-items: center; width: 100%; max-height: 300px; }
.deck-drop-preview .deck-doc-icon { width: 96px; height: 120px; }
.deck-drop-canvas { max-width: 100%; max-height: 300px; width: auto; height: auto; border-radius: 6px; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15); background: #fff; }
.deck-drop #deck-drop-title { overflow-wrap: anywhere; }
.deck-new-details { display: grid; gap: 12px; align-content: start; }
.deck-new-actions { display: grid; gap: 8px; }
.deck-new-actions .button { margin: 4px 0 0; width: 100%; }
.deck-new progress, .deck-version-upload progress { width: 100%; height: 8px; accent-color: var(--focus); }
.deck-version-upload progress { width: min(260px, 100%); }
.filters--decks { grid-template-columns: minmax(220px, 2fr) repeat(4, minmax(140px, 1fr)); }
@media (max-width: 1100px) { .filters--decks { grid-template-columns: repeat(4, minmax(0, 1fr)); } .filters--decks .filters-search { grid-column: 1 / -1; } }
.deck-view-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin: -2px 0 14px; }
.deck-view-bar .segmented button { display: inline-flex; align-items: center; gap: 6px; }
.deck-archived-toggle { font-size: 14px; font-weight: 500; }

/* Grid view: Finder-style tiles with a page-1 thumbnail, name and date. */
#decks-section [hidden] { display: none !important; } /* .deck-tiles / .deck-tile set display, which would beat [hidden] */
.deck-tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 22px 16px; }
.deck-tile-link { position: relative; display: grid; justify-items: center; gap: 4px; padding: 10px 8px 12px; border-radius: var(--radius); color: var(--text); text-decoration: none; text-align: center; transition: background 0.12s; }
.deck-tile-link:hover { background: var(--fill); }
.deck-tile-link:hover .deck-thumb { box-shadow: 0 0 0 2px var(--brand-teal), 0 4px 14px rgba(0, 0, 0, 0.12); }
.deck-thumb { position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 4 / 3; margin-bottom: 6px; border-radius: 8px; background: #e9e9ee; overflow: hidden; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); transition: box-shadow 0.12s; }
.deck-thumb img, .deck-thumb-canvas { position: absolute; inset: 0; margin: auto; display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12); }
/* More than one version: a sheet peeking out behind, like a stack of paper. */
.deck-thumb--stack { overflow: visible; }
.deck-thumb--stack::before { content: ""; position: absolute; inset: -4px 6px auto 6px; height: 100%; border-radius: 8px; background: #d8d8de; z-index: -1; }
.deck-tile-link { isolation: isolate; }
.deck-thumb-badge { position: absolute; left: 6px; bottom: 6px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12); }
.deck-doc-icon { width: 54px; height: 68px; }
.deck-doc-icon .sheet { fill: #fff; stroke: #c7c7cc; stroke-width: 2; }
.deck-doc-icon .fold { fill: #e5e5ea; stroke: #c7c7cc; stroke-width: 2; stroke-linejoin: round; }
.deck-doc-icon text { font: 700 13px var(--font); fill: #6c6c70; }
.deck-doc-icon--doc .sheet { stroke: #3b78c4; } .deck-doc-icon--doc text { fill: #174b8f; } .deck-doc-icon--doc .fold { fill: #e0ebfb; stroke: #3b78c4; }
.deck-doc-icon--ppt .sheet { stroke: #d2692d; } .deck-doc-icon--ppt text { fill: #8a3a0c; } .deck-doc-icon--ppt .fold { fill: #fde8dc; stroke: #d2692d; }
.deck-doc-icon--xls .sheet { stroke: #2f8a4c; } .deck-doc-icon--xls text { fill: #1e6a35; } .deck-doc-icon--xls .fold { fill: #dff3e6; stroke: #2f8a4c; }
.deck-doc-icon--pdf .sheet { stroke: #c4271c; } .deck-doc-icon--pdf text { fill: #8f1d14; } .deck-doc-icon--pdf .fold { fill: #fde3e1; stroke: #c4271c; }
.deck-folder-icon { width: 72px; height: 58px; fill: #8fd3d4; }
.deck-tile-name { font-size: 14px; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.deck-tile-date { font-size: 12.5px; color: var(--muted); }
.deck-tile-tag { position: absolute; top: 16px; right: 14px; }
.deck-tile.is-archived .deck-thumb { opacity: 0.55; }
.deck-labels { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 4px; }
.label-pill--soft { background: var(--fill); color: var(--text); }
.file-badge { display: inline-block; padding: 1px 8px; border-radius: 6px; font-size: 12px; font-weight: 700; letter-spacing: 0.02em; background: var(--fill); color: #3a3a3c; }
.file-badge--pdf { background: #fde3e1; color: #8f1d14; }
.file-badge--doc { background: #e0ebfb; color: #174b8f; }
.file-badge--ppt { background: #fde8dc; color: #8a3a0c; }
.file-badge--xls { background: #dff3e6; color: #1e6a35; }

.deck-head { align-items: flex-start; }
.deck-head-main { min-width: 0; flex: 1 1 420px; }
.deck-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 6px 0 0; font-size: 14px; color: var(--muted); }
.deck-meta strong { color: var(--text); }
.deck-description { margin: 10px 0 0; max-width: 72ch; }
.deck-head-actions { display: flex; gap: 8px; padding-top: 8px; }
.archived-banner .deck-restore { display: inline-flex; margin-left: 8px; }
.deck-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr); gap: 0 20px; align-items: start; }
.deck-file-line { margin: 6px 0 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.deck-frame { display: block; width: 100%; height: min(78vh, 820px); min-height: 420px; border: 0.5px solid var(--separator); border-radius: var(--radius-sm); background: #e5e5ea; }
.deck-viewer > .hint { margin-top: 8px; }
.deck-placeholder { display: grid; gap: 8px; justify-items: start; padding: 28px 20px; border-radius: var(--radius); background: var(--fill); }
.deck-placeholder strong { font-size: 17px; }
.deck-placeholder form .button { margin: 0; }
.deck-version-upload { display: grid; gap: 8px; margin-top: 16px; }
.drop-zone--compact { padding: 18px 16px; }
.drop-zone--compact strong { font-size: 15px; }

.deck-people { list-style: none; margin: 0; padding: 0; }
.deck-person { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 10px 0; border-bottom: 0.5px solid var(--separator); }
.deck-person:last-child { border-bottom: 0; }
.deck-person-main { display: grid; gap: 2px; min-width: 0; }
.deck-person-note { color: var(--text); font-style: italic; }
.deck-kind { display: inline-block; padding: 0 7px; border-radius: 6px; background: var(--fill); font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.deck-acnote--written { color: var(--ok-ink); }
.deck-acnote--blocked { color: var(--warn-ink); }
.deck-acnote--failed { color: var(--bad); }
.deck-add-team { display: flex; gap: 8px; align-items: center; margin-top: 12px; }
.deck-add-team .field { flex: 1; }
.deck-add-team + .hint { margin-top: 6px; }
.deck-share-form { display: grid; gap: 10px; margin-top: 14px; padding-top: 14px; border-top: 0.5px solid var(--separator); }
.deck-share-form .segmented { justify-self: start; }
.deck-share-form .button { justify-self: start; }
.deck-picker { position: relative; }
.deck-picker-results { position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; right: 0; max-height: 320px; overflow-y: auto; margin: 0; padding: 4px; list-style: none; background: var(--surface); border-radius: var(--radius-sm); box-shadow: var(--shadow), 0 0 0 0.5px var(--separator); }
.deck-picker-results button { display: grid; gap: 1px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.deck-picker-results button:hover, .deck-picker-results button:focus { background: var(--fill); outline: none; }
.deck-picker-empty { padding: 8px 10px; color: var(--muted); font-size: 14px; }
.deck-picked { margin: 0; padding: 9px 12px; border-radius: var(--radius-sm); background: rgba(103, 209, 210, 0.18); font-size: 14.5px; }

.deck-links { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; }
.deck-link-item { display: grid; gap: 6px; padding: 12px; border-radius: var(--radius); background: var(--fill); }
.deck-link-item--expired, .deck-link-item--off { opacity: 0.7; }
.deck-link-item p { margin: 0; }
.deck-link-item form { justify-self: start; }
.deck-link-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.deck-link-top strong { overflow-wrap: anywhere; }
.deck-link-copy { display: flex; gap: 6px; }
.deck-link-copy input { flex: 1; min-width: 0; min-height: 32px; padding: 4px 10px; border: 0.5px solid var(--separator); border-radius: 8px; background: var(--surface); font: inherit; font-size: 13px; color: var(--text); }
.deck-link-new { margin-top: 12px; }
.deck-link-new > summary { display: inline-block; cursor: pointer; list-style: none; }
.deck-link-new > summary::-webkit-details-marker { display: none; }
.deck-link-form { display: grid; gap: 12px; margin-top: 10px; }
.deck-link-form .check-line { font-weight: 500; font-size: 14.5px; }
.deck-edit > summary { display: flex; align-items: baseline; justify-content: space-between; cursor: pointer; list-style: none; }
.deck-edit > summary::-webkit-details-marker { display: none; }
.deck-edit > summary h2 { margin: 0; }
.deck-edit[open] > summary .open-link { visibility: hidden; }
.deck-edit-form { display: grid; gap: 12px; margin-top: 14px; }
.deck-created { margin: 12px 0 6px; }
.record-decks-form { display: grid; gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 0.5px solid var(--separator); }
.record-decks-form .field > label { font-size: 13px; font-weight: 600; color: var(--muted); }

@media (max-width: 900px) {
  .deck-new { grid-template-columns: minmax(0, 1fr); }
  .deck-drop { min-height: 220px; }
}
@media (max-width: 1000px) {
  .deck-grid { grid-template-columns: minmax(0, 1fr); }
  .filters--decks { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .filters--decks { grid-template-columns: minmax(0, 1fr); }
  .deck-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 8px; }
  .deck-frame { height: 70vh; min-height: 320px; }
}

/* Client link page (/d/<token>): no sidebar, no login. */
.share-page { background: var(--page-bg); min-height: 100vh; }
.share-top { display: flex; align-items: center; gap: 10px; padding: 12px 24px; background: var(--brand-yellow); }
.share-top .logo-mark { width: 36px; height: 36px; font-size: 12px; }
.share-brand { font-weight: 700; font-size: 17px; }
.share-main { max-width: 1100px; margin: 0 auto; padding: 24px 24px 40px; }
.share-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.share-head h1 { margin: 0; font-size: 30px; line-height: 1.2; }
.share-description { margin: 6px 0 0; max-width: 72ch; }
.share-actions { display: flex; gap: 8px; }
.share-frame { display: block; width: 100%; height: calc(100vh - 220px); min-height: 480px; border: 0; border-radius: var(--radius); background: #e5e5ea; box-shadow: var(--shadow); }
.share-gone { margin: 48px auto; max-width: 520px; padding: 28px; background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow); text-align: center; }
.share-gone h1, .share-gone h2 { margin: 0 0 8px; }
.share-foot { margin: 16px 0 0; font-size: 13px; text-align: center; }
@media (max-width: 600px) {
  .share-top { padding: 10px 16px; }
  .share-main { padding: 16px 16px 32px; }
  .share-head h1 { font-size: 24px; }
  .share-frame { height: 72vh; min-height: 360px; }
}
