/* Outreacher. One stylesheet, tokens first; light and dark from the same tokens.
   No inline styles anywhere (the CSP forbids them), so every visual state is a class. */

@font-face { font-family: 'IBM Plex Sans'; src: url("../fonts/IBMPlexSans-Regular.4bc2240b8b83.ttf") format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'IBM Plex Sans'; src: url("../fonts/IBMPlexSans-Medium.46ca4f803eb1.ttf") format('truetype'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'IBM Plex Sans'; src: url("../fonts/IBMPlexSans-SemiBold.f75f5cc52c38.ttf") format('truetype'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'IBM Plex Sans'; src: url("../fonts/IBMPlexSans-Bold.9c3c89006de0.ttf") format('truetype'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'IBM Plex Mono'; src: url("../fonts/IBMPlexMono-Regular.78f79731a2a6.ttf") format('truetype'); font-weight: 400; font-display: swap; }

:root {
  --bg: #F4F6FA; --surface: #FFFFFF; --surface-2: #F8FAFD; --ink: #101E33; --sub: #52617A;
  --faint: #8391A6; --line: #E3E8F0; --line-strong: #CFD7E3;
  --accent: #1F55C4; --accent-ink: #17418F; --accent-bg: #E9F0FC; --on-accent: #FFFFFF;
  --ok: #1B7349; --ok-bg: #E4F4EB; --warn: #8A5E10; --warn-bg: #FAF0DA;
  --bad: #A63A2C; --bad-bg: #FBE9E6; --info: #3D4C63; --info-bg: #EEF1F6;
  --focus: #1F55C4; --shadow: 0 1px 2px rgba(16, 30, 51, .06), 0 4px 16px rgba(16, 30, 51, .05);
  --radius: 10px; --radius-sm: 7px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0E131B; --surface: #151C27; --surface-2: #1A2230; --ink: #E7ECF4; --sub: #A3B0C4;
    --faint: #75839A; --line: #253041; --line-strong: #33415A;
    --accent: #7AA2FF; --accent-ink: #A9C2FF; --accent-bg: #1B2A47; --on-accent: #0B1220;
    --ok: #6FD3A0; --ok-bg: #13301F; --warn: #F0C36D; --warn-bg: #33270E;
    --bad: #FF9C8E; --bad-bg: #3A1C18; --info: #C7D1E0; --info-bg: #1F2837;
    --focus: #7AA2FF; --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 22px; font-weight: 600; }
h2 { font-size: 16px; font-weight: 600; }
h3 { font-size: 14px; font-weight: 600; }
p { margin: 0 0 10px; }
code, .mono { font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: 12.5px; }
[hidden] { display: none !important; }
::selection { background: var(--accent-bg); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: var(--radius-sm); z-index: 50; }
.skip:focus { left: 8px; }

/* ---------- shell ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: 236px; flex: none; background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand img { width: 28px; height: 28px; }
.brand-name { font-weight: 700; font-size: 16px; letter-spacing: -.01em; }
.brand-by { display: block; font-size: 10px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.company-switch { margin: 0 12px 10px; }
.company-switch select { width: 100%; }
.company-name { margin: 0 18px 12px; font-size: 12.5px; font-weight: 600; color: var(--sub); }
.company-add { display: flex; align-items: center; gap: 6px; margin: -4px 12px 8px; padding: 6px 8px; min-height: 32px; border-radius: var(--radius-sm); font-size: 12.5px; font-weight: 500; color: var(--sub); }
.company-add:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.company-add svg { width: 14px; height: 14px; }
/* Only the links scroll: the brand stays on top and the account (Sign out) at the
   bottom, however short the window. */
.nav { display: flex; flex-direction: column; gap: 2px; padding: 4px 10px 10px; flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.nav-label { padding: 14px 10px 6px; font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--sub); font-weight: 500; min-height: 38px; }
.nav a:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.nav a[aria-current="page"] { background: var(--accent-bg); color: var(--accent-ink); font-weight: 600; }
.nav svg { width: 18px; height: 18px; flex: none; }
.sidebar-foot { flex: none; margin-top: auto; padding: 14px 18px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--sub); }
.sidebar-foot .who { font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-foot form { margin-top: 6px; }
.feedback-link { width: 100%; margin-bottom: 12px; }
.plain-list { margin: 0 0 12px; padding-left: 18px; }
.plain-list li + li { margin-top: 4px; }
.topbar { display: none; }
.main { flex: 1; min-width: 0; }
.content { max-width: 1140px; margin: 0 auto; padding: 28px 32px 64px; }

@media (max-width: 900px) {
  .shell { display: block; }
  .topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line); padding: 8px 16px; min-height: 56px; }
  .sidebar { position: fixed; inset: 0 auto 0 0; height: 100vh; height: 100dvh; width: min(300px, 86vw); z-index: 40; transform: translateX(-100%); transition: transform .25s var(--ease); box-shadow: var(--shadow); }
  body[data-nav-open] .sidebar { transform: none; }
  body[data-nav-open] .scrim { display: block; }
  .scrim { display: none; position: fixed; inset: 0; background: rgba(8, 12, 20, .45); z-index: 30; }
  .content { padding: 20px 16px 48px; }
}

/* ---------- page header ---------- */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head p { color: var(--sub); margin: 4px 0 0; max-width: 64ch; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs { font-size: 12.5px; color: var(--faint); margin-bottom: 6px; }
.crumbs a { color: var(--sub); }

/* ---------- surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; min-width: 0; }
.card + .card, .stack > * + * { margin-top: 16px; }
.grid > .card + .card, .split > .card + .card { margin-top: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head p { margin: 2px 0 0; color: var(--sub); font-size: 13px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
/* Where the right column holds an email rather than a summary. */
.split-wide { grid-template-columns: minmax(0, 1fr) 400px; }
@media (max-width: 1100px) { .split-wide { grid-template-columns: minmax(0, 1fr) 320px; } }
@media (max-width: 1000px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .split, .split-wide { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); } .card { padding: 16px; } }

.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.stat-label { font-size: 12px; font-weight: 500; color: var(--sub); }
.stat-value { font-size: 26px; font-weight: 600; letter-spacing: -.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat-note { font-size: 12px; color: var(--faint); margin-top: 2px; }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; }
.kv dt { color: var(--sub); font-size: 13px; }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 8px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, box-shadow .15s; text-decoration: none; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.btn-danger { color: var(--bad); border-color: var(--line-strong); }
.btn-danger:hover { background: var(--bad-bg); border-color: var(--bad); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--sub); }
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn-sm { min-height: 32px; padding: 5px 10px; font-size: 13px; }
.btn[disabled], .btn[aria-busy="true"] { opacity: .6; cursor: progress; }
.btn svg { width: 16px; height: 16px; }
.inline-form { display: inline; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- forms ---------- */
.form { display: grid; gap: 16px; max-width: 640px; }
.form-wide { max-width: none; }
.field { display: grid; gap: 6px; align-content: start; }
.field label, .label { font-weight: 500; font-size: 13px; }
.field .help { font-size: 12.5px; color: var(--sub); }
.field .error, .form-error { font-size: 12.5px; color: var(--bad); }
.form-error { background: var(--bad-bg); padding: 10px 12px; border-radius: var(--radius-sm); }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=number], input[type=search], input[type=time], input[type=datetime-local], input[type=file], select, textarea {
  width: 100%; min-height: 40px; padding: 8px 11px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); font: inherit; font-size: 16px; transition: border-color .15s, box-shadow .15s;
}
@media (min-width: 901px) { input, select, textarea { font-size: 14px !important; } }
textarea { min-height: 120px; resize: vertical; line-height: 1.55; }
textarea.body-editor { min-height: 260px; font-family: 'IBM Plex Sans', system-ui, sans-serif; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--sub) 50%), linear-gradient(135deg, var(--sub) 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
.field-invalid input, .field-invalid select, .field-invalid textarea { border-color: var(--bad); }
/* Read only for this role: it should look it, not like a form missing its Save button. */
input:disabled, select:disabled, textarea:disabled { background-color: var(--surface-2); color: var(--sub); border-style: dashed; cursor: not-allowed; opacity: 1; }
.readonly-note { font-size: 12.5px; color: var(--faint); }
/* Appears under the table and stays in view at the bottom, so selecting a lead
   never pushes the table down. */
.bulk-bar { position: sticky; bottom: 12px; z-index: 10; margin-top: 12px; padding: 12px 14px; box-shadow: var(--shadow); }
.bulk-bar input[type=text], .bulk-bar select { width: auto; flex: 1 1 170px; min-width: 0; }
.bulk-bar strong { flex: 0 0 auto; margin-right: 4px; }
@media (max-width: 640px) { .bulk-bar { bottom: 8px; } .bulk-bar input[type=text], .bulk-bar select { flex-basis: 100%; } }
.check { display: flex; gap: 10px; align-items: flex-start; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.check .help { display: block; }
.days { display: flex; flex-wrap: wrap; gap: 6px; }
.days label { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--line-strong); border-radius: 999px; font-weight: 500; cursor: pointer; min-height: 36px; }
.days input { accent-color: var(--accent); }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { font-weight: 600; margin-bottom: 8px; padding: 0; }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 500; background: var(--info-bg); color: var(--info); white-space: nowrap; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge-plain::before { display: none; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-bad { background: var(--bad-bg); color: var(--bad); }
.badge-accent { background: var(--accent-bg); color: var(--accent-ink); }
.tag { display: inline-block; padding: 1px 8px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); font-size: 12px; color: var(--sub); margin: 1px 2px 1px 0; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; font-weight: 600; color: var(--sub); background: var(--surface-2); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--surface-2); }
td .sub, .sub { color: var(--sub); font-size: 12.5px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.cell-main { font-weight: 500; color: var(--ink); }
.w-check { width: 40px; }
@media (max-width: 640px) {
  .table-stack thead { display: none; }
  .table-stack tr { display: block; padding: 10px 4px; border-bottom: 1px solid var(--line); }
  .table-stack td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 4px 12px; }
  .table-stack td::before { content: attr(data-label); color: var(--sub); font-size: 12px; font-weight: 500; }
  .table-stack td.w-check::before { content: ''; }
  .table-stack td.w-check { width: auto; }
  .table-stack td.w-check input[type=checkbox] { width: 22px; height: 22px; margin: 6px 0; flex: none; }
  .table-stack td.cell-primary { display: block; padding-top: 8px; }
  .table-stack td.cell-primary::before { display: none; }
  .toolbar input[type=search] { max-width: none; flex: 1 1 100%; }
  .toolbar select { flex: 1 1 40%; }
}

/* ---------- filters, pagination, tabs ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.toolbar input[type=search] { max-width: 280px; }
.toolbar select { width: auto; min-width: 140px; }
.pagination { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 14px; color: var(--sub); font-size: 13px; flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 10px 12px; color: var(--sub); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a[aria-current="page"] { color: var(--accent-ink); border-color: var(--accent); }

/* ---------- messages, empty states, callouts ---------- */
.messages { display: grid; gap: 8px; margin-bottom: 18px; }
.alert { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; padding: 11px 14px; border-radius: var(--radius-sm); background: var(--info-bg); color: var(--info); animation: rise .3s var(--ease); }
.alert-success { background: var(--ok-bg); color: var(--ok); }
.alert-warning { background: var(--warn-bg); color: var(--warn); }
.alert-error { background: var(--bad-bg); color: var(--bad); }
.alert button { background: none; border: 0; color: inherit; cursor: pointer; font-size: 18px; line-height: 1; padding: 0 2px; min-width: 32px; min-height: 32px; }
.callout { border: 1px solid var(--line); border-left: 3px solid var(--accent); background: var(--surface-2); padding: 12px 14px; border-radius: var(--radius-sm); color: var(--sub); }
.callout strong { color: var(--ink); }
.callout-warn { border-left-color: var(--warn); }
.callout-bad { border-left-color: var(--bad); }
/* The test-server banner: on every page, never mistaken for production. */
.callout-test { border-color: var(--warn); border-left-width: 3px; background: var(--warn-bg); color: var(--warn); }
.callout-test strong, .callout-test .mono { color: inherit; }
.empty { text-align: center; padding: 44px 20px; border: 1px dashed var(--line-strong); border-radius: var(--radius); background: var(--surface); }
.empty svg { width: 40px; height: 40px; color: var(--faint); margin-bottom: 10px; }
.empty h2 { margin-bottom: 6px; }
.empty p { color: var(--sub); max-width: 48ch; margin: 0 auto 16px; }

/* ---------- onboarding checklist ---------- */
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.checklist li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.checklist .dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-strong); flex: none; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--faint); }
.checklist .done .dot { background: var(--ok); border-color: var(--ok); color: var(--surface); }
.checklist .done .step-title { color: var(--sub); text-decoration: line-through; }
.checklist .step-title { font-weight: 600; }
.checklist p { margin: 2px 0 0; color: var(--sub); font-size: 13px; }

/* ---------- meters ---------- */
progress { appearance: none; width: 100%; height: 6px; border: 0; border-radius: 999px; background: var(--line); overflow: hidden; }
progress::-webkit-progress-bar { background: var(--line); border-radius: 999px; }
progress::-webkit-progress-value { background: var(--accent); border-radius: 999px; }
progress::-moz-progress-bar { background: var(--accent); border-radius: 999px; }
.meter { display: grid; gap: 4px; min-width: 120px; }
.meter-label { display: flex; justify-content: space-between; font-size: 12px; color: var(--sub); font-variant-numeric: tabular-nums; }

/* ---------- lists ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list > li:first-child { padding-top: 0; }
.list > li:last-child { border-bottom: 0; padding-bottom: 0; }
.list .grow { min-width: 0; flex: 1; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- guided flow ---------- */
/* The rail over the four moments a campaign is decided in. Navigation, not a
   gate: a tick says settled, never that the next step is locked. */
.wizard { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 2px; margin: 0 0 20px; padding: 0; }
.wizard-step { display: flex; align-items: center; }
.wizard-step + .wizard-step::before { content: ''; width: 16px; height: 1px; background: var(--line-strong); flex: none; }
.wizard-link { display: inline-flex; align-items: center; gap: 8px; padding: 6px 13px 6px 7px; border-radius: 999px; color: var(--sub); font-size: 13px; font-weight: 500; }
a.wizard-link:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.wizard-num { width: 22px; height: 22px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line-strong); color: var(--faint); font-size: 12px; font-weight: 700; }
.wizard-num svg { width: 13px; height: 13px; }
.wizard-step.is-done .wizard-num { background: var(--ok-bg); border-color: var(--ok); color: var(--ok); }
.wizard-step.is-current .wizard-link { background: var(--accent-bg); color: var(--accent-ink); }
.wizard-step.is-current .wizard-num { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
/* On a phone the four titles don't fit on one line: only the current one is
   spelled out, the others keep their number (and their name for screen readers). */
@media (max-width: 520px) {
  .wizard { flex-wrap: nowrap; }
  .wizard-link { min-height: 40px; }
  .wizard-step:not(.is-current) .wizard-link { padding: 6px 9px; }
  .wizard-step:not(.is-current) .wizard-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* ---------- guide ---------- */
.guide-toc { columns: 2 220px; column-gap: 24px; margin: 0; padding-left: 18px; }
.guide-toc li { margin-bottom: 5px; break-inside: avoid; }
.guide-section { scroll-margin-top: 72px; }
.guide-section h3 { margin: 18px 0 6px; }
.guide-section p, .guide-section li { max-width: 80ch; }
.guide-section ol, .guide-section ul { margin: 0 0 10px; padding-left: 20px; }
.guide-section li + li { margin-top: 4px; }
.guide-section .table-wrap { margin: 8px 0 12px; }
.guide-section pre.secret { margin: 8px 0 12px; }
.guide-section td code { overflow-wrap: anywhere; }
@media (max-width: 640px) { .guide-section th, .guide-section td { padding: 9px 10px; } }

/* ---------- sequence ---------- */
.sequence { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.seq-step { position: relative; padding: 0 0 20px 44px; }
.seq-step::before { content: ''; position: absolute; left: 15px; top: 36px; bottom: 0; width: 2px; background: var(--line); }
.seq-step:last-child::before { display: none; }
.seq-node { position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 50%; background: var(--accent-bg); color: var(--accent-ink); border: 1px solid transparent; display: grid; place-items: center; }
.seq-node svg { width: 16px; height: 16px; }
.seq-step.is-sent .seq-node { background: var(--ok-bg); color: var(--ok); }
.seq-wait { font-size: 12.5px; color: var(--sub); padding-top: 7px; margin-bottom: 8px; }
.seq-label { font-weight: 600; color: var(--ink); margin-right: 6px; }
.seq-add { padding-bottom: 0; }
.seq-add .seq-node { background: var(--surface); border: 1px dashed var(--line-strong); color: var(--faint); }
.seq-add-link { display: block; padding-top: 6px; font-weight: 500; }
.seq-add-link .sub { display: block; font-weight: 400; margin-top: 2px; }
a.seq-add-link:hover { text-decoration: none; }
.seq-card { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; background: var(--surface); }
.seq-card .subject { font-weight: 600; }
.seq-card .excerpt { color: var(--sub); font-size: 13px; margin-top: 4px; white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.seq-actions { display: flex; gap: 4px; margin-top: 10px; flex-wrap: wrap; }

.merge-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.merge-tags button { font: 12px 'IBM Plex Mono', monospace; padding: 4px 8px; border-radius: 6px; border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--ink); cursor: pointer; min-height: 30px; }
.merge-tags button:hover { border-color: var(--accent); }
@media (max-width: 640px) { .merge-tags { gap: 8px; } .merge-tags button { min-height: 40px; padding: 6px 12px; } }

/* ---------- email preview ---------- */
.email-preview { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.email-meta { padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); display: grid; gap: 4px; font-size: 13px; }
.email-meta span { color: var(--sub); display: inline-block; min-width: 64px; }
.email-body { padding: 18px 16px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.6; }
/* Beside the editor the preview has to stay in view while the body grows, so it
   scrolls on its own instead of pushing the page down. */
.preview-pane .email-preview { border-radius: var(--radius-sm); }
.preview-pane .email-body { max-height: 46vh; overflow-y: auto; font-size: 13.5px; }
/* The email itself, in a frame with its own policy (campaigns.design_views): a mail
   client's white page, whatever the app's theme. */
.email-frame { display: block; width: 100%; height: 520px; border: 0; background: #fff; }
.preview-pane .email-frame { height: 46vh; min-height: 340px; }
.email-text { border-top: 1px solid var(--line); }
.email-text > summary { padding: 10px 16px; font-size: 12.5px; color: var(--sub); cursor: pointer; min-height: 40px; display: flex; align-items: center; }
.email-text .email-body { border-top: 1px solid var(--line); max-height: 260px; overflow-y: auto; font-size: 13px; }
.frame-wrap { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; margin: 0 auto; transition: max-width .2s var(--ease); max-width: 100%; }
.frame-wrap[data-width="phone"] { max-width: 390px; }
.frame-wrap .email-frame { height: 640px; }
.split-design { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); align-items: start; }
@media (min-width: 1001px) { .split-design .preview-card { position: sticky; top: 16px; } }
@media (max-width: 1000px) { .split-design { grid-template-columns: minmax(0, 1fr); } }
.only-small { display: none; }
@media (max-width: 1000px) { .only-small { display: block; } }
.preset-list { display: grid; gap: 8px; }
.preset { display: grid; gap: 2px; width: 100%; text-align: left; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; min-height: 44px; }
.preset:hover { border-color: var(--accent); }
.preset span { font-size: 12.5px; color: var(--sub); }
input[type=color] { width: 100%; height: 40px; padding: 3px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; }
.field [id^=id_layout] > div, .field [id^=id_header] > div { margin-bottom: 6px; }
.field [id^=id_layout] label, .field [id^=id_header] label { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; min-height: 32px; }
.field input[type=radio] { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--accent); flex: none; }
.logo-current { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; padding: 10px; border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); background: #fff; }
.logo-current img { max-height: 60px; width: auto; }

/* ---------- step progress ---------- */
.dots { display: inline-flex; gap: 3px; margin-right: 8px; vertical-align: middle; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); }
.dot.is-on { background: var(--accent); }
.cell-progress { white-space: nowrap; }

/* ---------- timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 110px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.timeline li:last-child { border-bottom: 0; }
.timeline time { color: var(--faint); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.sent-mail > summary { display: inline-flex; align-items: center; min-height: 32px; color: var(--accent); font-size: 12.5px; font-weight: 500; }
.sent-mail > summary:hover { text-decoration: underline; }
.sent-mail .email-body { font-size: 13px; padding: 14px; }
@media (max-width: 640px) { .timeline li { grid-template-columns: 1fr; gap: 2px; } }

/* ---------- auth + public pages ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 32px 28px; box-shadow: var(--shadow); }
.auth-card .brand { padding: 0 0 18px; }
.auth-card h1 { font-size: 20px; margin-bottom: 6px; }
.auth-card .lead { color: var(--sub); margin-bottom: 20px; }
.auth-card .btn-primary { width: 100%; }
.auth-foot { margin-top: 18px; font-size: 13px; color: var(--sub); text-align: center; }
.public-note { margin-top: 16px; font-size: 12px; color: var(--faint); text-align: center; }

/* ---------- key reveal ---------- */
.secret { display: flex; gap: 8px; align-items: center; background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 8px 10px; }
.secret code { flex: 1; overflow-x: auto; white-space: nowrap; }

/* ---------- confirm dialog ---------- */
dialog.confirm { border: 1px solid var(--line); border-radius: 14px; padding: 22px; max-width: 420px; width: calc(100% - 32px); background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
dialog.confirm::backdrop { background: rgba(8, 12, 20, .5); }
dialog.confirm h2 { margin-bottom: 8px; }
dialog.confirm p { color: var(--sub); }
dialog.confirm .btn-row { justify-content: flex-end; margin-top: 18px; }

@keyframes rise { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.empty .btn-row { justify-content: center; }
.w-auto { width: auto; min-width: 160px; }
pre.secret { display: block; overflow-x: auto; white-space: pre; margin: 0; line-height: 1.6; }
details > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }
details[open] > summary { margin-bottom: 4px; }
.muted { color: var(--sub); }
.small { font-size: 12.5px; }
.mt-0 { margin-top: 0; } .mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
