/* ── Tokens ────────────────────────────────────────────────────────────────── */

:root {
  /* Neutrals: cool gray so the single brand accent stands out. */
  --page: #f5f6f9;
  --card: #ffffff;
  --surface-2: #fafbfc;
  --subtle: #f0f2f6;
  --hover: #e8ebf1;
  --border: #e3e6ec;
  --border-strong: #cdd2dc;
  --text: #111827;
  --text-muted: #566072;
  --placeholder: #8a93a3;

  /* Brand accent (indigo): ≥4.5:1 against white for text and button labels. */
  --accent: #3d2b3f;
  --accent-hover: #2c1f2e;
  --accent-subtle: #f4eff5;
  --accent-border: #d9cddb;
  --accent-text: #3d2b3f;

  /* LeadMe green: #618346 on light backgrounds, #91ba54 on purple. */
  --brand-green: #618346;
  --brand-green-hover: #4f6c39;
  --brand-green-light: #91ba54;
  /* Chart bars: brand green, checked for lightness, chroma and contrast on white (dataviz validator). */
  --chart-bar: #6f9a4a;
  --chart-bar-active: #618346;
  --brand-green-bg: #eef5e6;
  --brand-green-border: #cfe2b8;
  --on-accent: #ffffff;

  /* Status colors: always paired with a text label, never color alone. */
  --error: #b42318;
  --error-bg: #fdf0ef;
  --success: #167045;
  --success-bg: #e9f7ef;
  --warning: #8a5300;
  --warning-bg: #fdf4e1;
  --info: #175cad;
  --info-bg: #ebf3fd;
  --warm: #b4430c;
  --warm-bg: #fff0e6;
  --cold: #1663a8;
  --cold-bg: #e8f2fc;
  --neutral: #4b5565;
  --neutral-bg: #eef0f4;

  /* Section colors: orientation only (Leads / Aanvragen / Instellingen). */
  --sec-leads: #3d2b3f;
  --sec-leads-bg: #f4eff5;
  --sec-requests: #4f6c39;
  --sec-requests-bg: #eef5e6;
  --sec-settings: #566072;
  --sec-settings-bg: #eef0f4;

  /* Avatar tones per business type: dark text on a soft tint, all ≥4.5:1. */
  --tone-1-bg: #f4eff5; --tone-1-fg: #3d2b3f;
  --tone-2-bg: #eef5e6; --tone-2-fg: #4f6c39;
  --tone-3-bg: #fdf1e2; --tone-3-fg: #95500a;
  --tone-4-bg: #fdecf2; --tone-4-fg: #a3214f;
  --tone-5-bg: #e6f2fd; --tone-5-fg: #175cad;
  --tone-6-bg: #ecf6e4; --tone-6-fg: #3f6d14;
  --tone-7-bg: #f3ecfd; --tone-7-fg: #6b35b0;

  --focus-ring: 0 0 0 3px rgba(61, 43, 63, 0.24);
  --error-ring: 0 0 0 3px rgba(180, 35, 24, 0.18);
  --backdrop: rgba(17, 24, 39, 0.45);
  --shadow-overlay: 0 24px 64px rgba(17, 24, 39, 0.18);

  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', Consolas, monospace;

  --nav-h: 60px;
  --bottom-nav-h: 64px;

  --z-sticky: 10;
  --z-nav: 100;
  --z-tour: 300;
  --z-toast: 400;
}

/* ── Reset & base ──────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* Safety net: the page never scrolls sideways. clip (not hidden) keeps position: sticky working. */
html { font-size: 16px; -webkit-text-size-adjust: 100%; overflow-x: clip; }
body { overflow-x: clip; }

body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'cv11', 'ss01';
  min-height: 100dvh;
}

a { color: inherit; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.skip-link {
  position: absolute; left: 16px; top: -48px; z-index: 300;
  padding: 8px 12px; background: var(--accent); color: var(--on-accent);
  border-radius: var(--radius-sm); font-size: 14px; text-decoration: none;
}
.skip-link:focus { top: 8px; }

/* !important: component rules like .field input { width: 100% } must never resize hidden helpers
   (a full-width hidden file input once made the whole page scroll sideways). */
.visually-hidden {
  position: absolute !important; width: 1px !important; height: 1px !important;
  padding: 0 !important; margin: -1px !important; border: 0 !important;
  overflow: hidden !important; clip: rect(0 0 0 0) !important; white-space: nowrap !important;
}

.muted { color: var(--text-muted); }
.tabular { font-variant-numeric: tabular-nums; }

.icon { width: 18px; height: 18px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 24px; height: 24px; }

kbd {
  font-family: var(--font);
  font-size: 11px;
  font-weight: 500;
  padding: 1px 5px;
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--card);
  color: var(--text-muted);
}

/* ── Buttons ───────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  height: 40px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 150ms var(--ease-out), border-color 150ms var(--ease-out),
              color 150ms var(--ease-out), opacity 150ms var(--ease-out), transform 120ms var(--ease-out);
  touch-action: manipulation;
  user-select: none;
}
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn-secondary { background: var(--card); color: var(--text); border-color: var(--border-strong); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-danger { background: var(--card); color: var(--error); border-color: var(--border-strong); }

@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
  .btn-secondary:hover:not(:disabled) { background: var(--subtle); }
  .btn-ghost:hover:not(:disabled) { background: var(--hover); color: var(--text); }
  .btn-danger:hover:not(:disabled) { background: var(--error-bg); border-color: var(--error); }
}

.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; gap: 6px; }
.btn-sm .icon { width: 16px; height: 16px; }
.btn-full { width: 100%; }
.btn-icon { width: 40px; padding: 0; }
.btn-sm.btn-icon { width: 32px; }

@media (pointer: coarse) {
  .btn, .btn-sm { min-height: 44px; }
  .btn-icon, .btn-sm.btn-icon { min-width: 44px; }
}

/* ── Cards ─────────────────────────────────────────────────────────────────── */

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.card-pad { padding: var(--space-5) var(--space-4); }
@media (min-width: 768px) { .card-pad { padding: var(--space-5); } }

.card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); }
.card-title { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.card-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

/* ── Form fields ───────────────────────────────────────────────────────────── */

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label, .field-label { font-size: 13px; font-weight: 500; color: var(--text); }
.field .required { color: var(--error); }

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 0 12px;
  height: 42px;
  font-family: var(--font);
  font-size: 16px;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  outline: none;
  transition: border-color 150ms var(--ease-out), box-shadow 150ms var(--ease-out);
}
.field select {
  appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23566072' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.field textarea { height: auto; min-height: 96px; padding: 10px 12px; line-height: 1.6; resize: vertical; }
/* Settings: boxes are as tall as their text (settings.js autoGrow), so page scrolling never stops inside one. */
.settings-form .field textarea { resize: none; overflow: hidden; field-sizing: content; }
.field input[type="color"] { padding: 4px; cursor: pointer; }

.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); box-shadow: var(--focus-ring); }
.field input::placeholder, .field textarea::placeholder { color: var(--placeholder); }
.field input[readonly], .field textarea[readonly] { background: var(--subtle); color: var(--text-muted); }

/* A wrong field gets a clear red outline, also while it has focus, so it's obvious what still needs fixing. */
.field[data-invalid] input, .field[data-invalid] textarea, .field[data-invalid] select,
.field[data-invalid] input:focus, .field[data-invalid] textarea:focus, .field[data-invalid] select:focus {
  border-color: var(--error); box-shadow: var(--error-ring);
}
.field[data-invalid] .day-picker { padding: 4px; margin: -4px; border-radius: var(--radius); box-shadow: 0 0 0 2px var(--error); }
.field-hint { font-size: 12px; color: var(--text-muted); line-height: 1.5; }
.field-label-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); min-height: 32px; }
.field-label-row .btn { margin-right: -8px; }
.ai-btn { color: var(--accent-text); }
.ai-btn .icon { color: var(--accent); }
.field textarea.mono-ish { font-size: 14px; line-height: 1.55; }

.ai-proposal {
  display: flex; flex-direction: column; gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--accent-subtle); border: 1px solid var(--accent-border); border-radius: var(--radius);
  transition: opacity 180ms var(--ease-out), transform 180ms var(--ease-out);
}
@starting-style { .ai-proposal { opacity: 0; transform: translateY(-4px); } }
.ai-proposal-head { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--accent-text); }
.ai-proposal-head .icon { width: 15px; height: 15px; color: var(--accent); }
.ai-proposal-text { font-family: var(--font); font-size: 14px; line-height: 1.6; white-space: pre-wrap; color: var(--text); }
.field-error { font-size: 12px; color: var(--error); display: flex; gap: 4px; align-items: center; }
.field-error:empty { display: none; }

.field-row { display: grid; gap: var(--space-4); grid-template-columns: 1fr; }
@media (min-width: 768px) {
  .field-row.cols-2 { grid-template-columns: 1fr 1fr; }
  .field-row.cols-3 { grid-template-columns: repeat(3, 1fr); }
}

.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; min-height: 42px; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }

.day-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.day-picker label {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; height: 40px; padding: 0 10px;
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  font-size: 13px; font-weight: 500; cursor: pointer; background: var(--card);
  transition: background-color 150ms var(--ease-out), color 150ms var(--ease-out), border-color 150ms var(--ease-out);
}
.day-picker label, .segmented label { position: relative; }
/* Visually hidden radios/checkboxes; explicit size so .field input { width: 100% } can't widen the page. */
.field .day-picker input, .field .segmented input, .day-picker input, .segmented input {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; pointer-events: none;
}
.day-picker label:has(input:checked) { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.day-picker label:has(input:focus-visible), .segmented label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

.segmented { display: inline-flex; flex-wrap: wrap; background: var(--subtle); border-radius: var(--radius); padding: 3px; gap: 2px; }
.segmented label {
  display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px;
  font-size: 13px; font-weight: 500; border-radius: 6px; cursor: pointer; color: var(--text-muted);
  transition: background-color 150ms var(--ease-out), color 150ms var(--ease-out);
}
.segmented label:has(input:checked) { background: var(--card); color: var(--text); box-shadow: 0 0 0 1px var(--border); }

/* ── Alerts, badges, spinner ───────────────────────────────────────────────── */

.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius); font-size: 13px; line-height: 1.5; }
.alert .icon { width: 16px; height: 16px; margin-top: 2px; }
.alert a { font-weight: 500; }
.alert-error { background: var(--error-bg); color: var(--error); }
.alert-success { background: var(--success-bg); color: var(--success); }
.alert-warning { background: var(--warning-bg); color: var(--warning); }
.alert-info { background: var(--info-bg); color: var(--info); }
.alert:empty { display: none; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  height: 22px; padding: 0 8px;
  font-size: 12px; font-weight: 500; line-height: 1;
  border-radius: 999px; background: var(--subtle); color: var(--text-muted); white-space: nowrap;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-error { background: var(--error-bg); color: var(--error); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-accent { background: var(--accent-subtle); color: var(--accent-text); }
.badge-warm { background: var(--warm-bg); color: var(--warm); }
.badge-cold { background: var(--cold-bg); color: var(--cold); }
.badge-neutral { background: var(--neutral-bg); color: var(--neutral); }
.badge-busy::before { display: none; }
.badge .spinner { width: 10px; height: 10px; border-width: 1.5px; }

.spinner {
  width: 16px; height: 16px;
  border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%;
  animation: spin 0.7s linear infinite; display: inline-block; flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

.progress-banner {
  display: flex; align-items: center; gap: var(--space-3);
  padding: 12px 16px; margin-bottom: var(--space-5);
  font-size: 14px; background: var(--accent-subtle);
  border: 1px solid var(--accent-border); border-radius: var(--radius-lg);
  transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out);
}
@starting-style { .progress-banner { opacity: 0; transform: translateY(-4px); } }
.progress-banner .spinner { width: 18px; height: 18px; color: var(--accent); }
.progress-banner-text strong { color: var(--accent-text); }
.progress-banner-text { display: flex; flex-direction: column; min-width: 0; }
.progress-banner-text strong { font-weight: 600; }
.progress-banner-text span { font-size: 13px; color: var(--text-muted); }

/* ── App shell: top bar + bottom nav ───────────────────────────────────────── */

.navbar {
  position: sticky; top: 0; z-index: var(--z-nav);
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
  padding: 0 var(--space-4); height: var(--nav-h);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
@media (min-width: 768px) { .navbar { padding: 0 var(--space-5); } }

.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600; text-decoration: none; letter-spacing: -0.01em; }
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--accent); color: var(--on-accent);
  font-size: 15px; font-weight: 700; letter-spacing: -0.04em;
}
.brand-tag { font-weight: 500; color: var(--text-muted); }

.nav-links { display: none; align-items: center; gap: 2px; }
@media (min-width: 1024px) { .nav-links { display: flex; } }

.nav-link {
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 12px;
  font-size: 14px; font-weight: 500; color: var(--text-muted);
  text-decoration: none; border-radius: var(--radius);
  transition: background-color 150ms var(--ease-out), color 150ms var(--ease-out);
}
.nav-link[aria-current="page"] { background: var(--accent-subtle); color: var(--accent-text); }
@media (hover: hover) and (pointer: fine) { .nav-link:hover { color: var(--text); background: var(--subtle); } }

.nav-count {
  min-width: 20px; height: 20px; padding: 0 6px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums;
  border-radius: 999px; background: var(--accent); color: var(--on-accent);
}

.navbar-right { display: flex; align-items: center; gap: var(--space-2); }
.navbar-user { display: none; font-size: 13px; color: var(--text-muted); max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (min-width: 1024px) { .navbar-user { display: inline; } }

.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-nav);
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-top: 1px solid var(--border);
}
.bottom-nav a {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 11px; font-weight: 500; color: var(--text-muted); text-decoration: none;
  touch-action: manipulation;
}
.bottom-nav a .icon { width: 22px; height: 22px; }
.bottom-nav a[aria-current="page"] { color: var(--accent-text); }
.bottom-nav a[aria-current="page"] .icon { stroke-width: 2.25; }
.bottom-nav .nav-count { position: absolute; top: 8px; left: calc(50% + 6px); height: 18px; min-width: 18px; font-size: 10px; }
@media (min-width: 1024px) { .bottom-nav { display: none; } }

/* ── Page shell ────────────────────────────────────────────────────────────── */

.page-content { max-width: 1240px; margin: 0 auto; padding: var(--space-5) var(--space-4) calc(var(--bottom-nav-h) + 48px + env(safe-area-inset-bottom)); }
@media (min-width: 768px) { .page-content { padding: var(--space-6) var(--space-5) 80px; } }
.page-admin .page-content { padding-bottom: 80px; }

.page-header { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-5); }
.page-header h1 { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.25; }
.page-header p { margin-top: 4px; font-size: 14px; color: var(--text-muted); max-width: 60ch; }
.page-header-spaced { margin-top: var(--space-4); }
@media (min-width: 768px) { .page-header h1 { font-size: 28px; } }

.section-title { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }

/* ── Lead review ───────────────────────────────────────────────────────────── */

.review-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-4); }

.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px; margin: -2px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 12px;
  font-size: 13px; font-weight: 500; color: var(--text-muted);
  background: var(--card); border: 1px solid var(--border); border-radius: 999px;
  cursor: pointer; touch-action: manipulation;
  transition: background-color 150ms var(--ease-out), color 150ms var(--ease-out), border-color 150ms var(--ease-out);
}
.chip .tabular { color: inherit; opacity: 0.75; }
.chip[aria-pressed="true"] { background: var(--accent-subtle); color: var(--accent-text); border-color: var(--accent-border); }
/* Leads filters: four phases as tabs on top, the filters of the open phase as small pills below. */
#statusChips { display: flex; flex-direction: column; gap: 12px; min-width: 0; max-width: 100%; flex: 1 1 auto; }
.filter-groups { display: flex; gap: 4px; max-width: 100%; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--border); }
.filter-groups::-webkit-scrollbar { display: none; }
.filter-group {
  position: relative; flex-shrink: 0; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px;
  font: inherit; font-size: 14px; font-weight: 500; color: var(--text-muted); background: transparent; border: 0;
  cursor: pointer; touch-action: manipulation; transition: color 150ms var(--ease-out);
}
/* The active phase: darker text and an underline on the tab bar. */
.filter-group::after {
  content: ''; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px 2px 0 0;
  background: var(--accent); opacity: 0; transform: scaleX(0.6); transition: opacity 150ms var(--ease-out), transform 150ms var(--ease-out);
}
.filter-group[aria-pressed="true"] { color: var(--text); font-weight: 600; }
.filter-group[aria-pressed="true"]::after { opacity: 1; transform: scaleX(1); }
.filter-group:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 6px; }
@media (hover: hover) and (pointer: fine) { .filter-group[aria-pressed="false"]:hover { color: var(--text); } }
.filter-count-pill {
  display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 20px; padding: 0 7px;
  border-radius: 999px; background: var(--subtle); color: var(--text-muted); font-size: 12px; font-weight: 600;
}
.filter-group[aria-pressed="true"] .filter-count-pill { background: var(--accent-subtle); color: var(--accent-text); }
.filter-count-pill.is-attention { background: var(--accent); color: #ffffff; }
.filter-group[aria-pressed="true"] .filter-count-pill.is-attention { background: var(--accent); color: #ffffff; }
.sub-chips { padding-left: 4px; }
.sub-chips .chip { height: 30px; padding: 0 12px; font-size: 13px; background: transparent; }
.sub-chips .chip[aria-pressed="true"] { background: var(--accent-subtle); }
@media (prefers-reduced-motion: reduce) { .filter-group::after { transition: none; } }
@media (max-width: 559px) {
  #statusChips { width: 100%; }
  .filter-groups { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 0.85fr); gap: 0; }
  .filter-group { flex-direction: column; justify-content: center; gap: 3px; min-height: 52px; padding: 6px 2px; font-size: 13px; line-height: 1.2; }
  .filter-group::after { left: 6px; right: 6px; }
  .filter-count-pill { height: 18px; min-width: 20px; font-size: 11px; padding: 0 6px; }
  .sub-chips { padding-left: 0; }
}
@media (hover: hover) and (pointer: fine) { .chip:hover:not([aria-pressed="true"]) { border-color: var(--border-strong); color: var(--text); } }
@media (pointer: coarse) { .chip { min-height: 44px; } }

.shortcut-hint { display: none; font-size: 12px; color: var(--text-muted); gap: 12px; align-items: center; }
@media (min-width: 1024px) and (hover: hover) { .shortcut-hint { display: inline-flex; } }

/* minmax(0, …) and min-width: 0 stop long content (URLs, addresses) from widening the page. */
.review { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); align-items: start; }
.review > *, .requests-layout > *, .settings-layout > * { min-width: 0; }
@media (min-width: 1024px) { .review { grid-template-columns: minmax(300px, 360px) minmax(0, 1fr); gap: var(--space-5); } }

/* Mobile detail view: focus on the lead, hide the page chrome above it. */
@media (max-width: 1023px) {
  #view-leads:has(.review.show-detail) .page-header,
  #view-leads:has(.review.show-detail) .review-toolbar,
  #view-leads:has(.review.show-detail) #setupHint { display: none; }
}

.lead-pane { display: flex; flex-direction: column; overflow: hidden; }
@media (min-width: 1024px) {
  .lead-pane { position: sticky; top: calc(var(--nav-h) + 16px); max-height: calc(100dvh - var(--nav-h) - 32px); }
}

.list-tools { display: flex; gap: var(--space-2); padding: var(--space-3); border-bottom: 1px solid var(--border); }
.search-box { position: relative; flex: 1; min-width: 0; }
.search-box .icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-muted); width: 16px; height: 16px; pointer-events: none; }
.search-box input, .list-tools select {
  width: 100%; height: 36px; font-family: var(--font); font-size: 14px; color: var(--text);
  background: var(--subtle); border: 1px solid transparent; border-radius: var(--radius); outline: none;
  transition: border-color 150ms var(--ease-out), background-color 150ms var(--ease-out);
}
.search-box input { padding: 0 10px 0 32px; }
.list-tools select {
  width: auto; padding: 0 30px 0 10px; appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23566072' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.search-box input:focus, .list-tools select:focus { background-color: var(--card); border-color: var(--accent); }
@media (max-width: 767px) { .search-box input, .list-tools select { font-size: 16px; height: 44px; } }

.lead-list { overflow-y: auto; overscroll-behavior: contain; }

.lead-item {
  display: flex; flex-direction: column; gap: 3px;
  width: 100%; padding: 12px 16px;
  text-align: left; background: var(--card);
  border: none; border-bottom: 1px solid var(--border);
  cursor: pointer; touch-action: manipulation;
  transition: background-color 120ms var(--ease-out);
}
.lead-item:last-child { border-bottom: none; }
.lead-item[aria-current="true"] { background: var(--accent-subtle); box-shadow: inset 3px 0 0 var(--accent); }
@media (hover: hover) and (pointer: fine) { .lead-item:hover:not([aria-current="true"]) { background: var(--surface-2); } }

.lead-item-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.lead-item-name { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lead-item-meta { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); overflow: hidden; white-space: nowrap; }
.lead-item-meta span { overflow: hidden; text-overflow: ellipsis; }
.lead-item-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; flex-shrink: 0; }

.list-footer { padding: 10px 16px; font-size: 12px; color: var(--text-muted); border-top: 1px solid var(--border); background: var(--card); }

/* Detail */
.lead-detail { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }

.lead-head { padding: var(--space-5) var(--space-4); display: flex; flex-direction: column; gap: var(--space-4); }
@media (min-width: 768px) { .lead-head { padding: var(--space-5); } }
.lead-title-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-3); align-items: flex-start; }
.lead-title-row h2 { font-size: 20px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.3; outline: none; }
.lead-title-row .muted { font-size: 14px; margin-top: 2px; }
.lead-badges { display: flex; gap: 6px; flex-wrap: wrap; }

.contact-links { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--text-muted); }
.contact-links > * { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; max-width: 100%; }
.contact-links a { color: var(--text); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-links a:hover { text-decoration: underline; text-underline-offset: 2px; }
.contact-links .icon { width: 15px; height: 15px; color: var(--text-muted); }

.insight { border-top: 1px solid var(--border); padding-top: var(--space-4); }
.insight-title { font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); margin-bottom: var(--space-2); }
.insight dl { display: grid; grid-template-columns: 1fr; gap: 6px; font-size: 14px; }
.insight dl > div { display: grid; grid-template-columns: 96px 1fr; gap: var(--space-3); }
.insight dt { color: var(--text-muted); font-size: 13px; padding-top: 1px; }
.insight dd { line-height: 1.5; }
.insight dl > div.highlight { margin: 2px -10px; padding: 6px 10px; background: var(--accent-subtle); border-radius: var(--radius-sm); }
.insight .highlight dt { color: var(--accent-text); font-weight: 500; }
.insight .highlight dd { font-weight: 500; }

/* Composer */
.composer { overflow: hidden; }
.composer-row {
  display: flex; align-items: center; gap: var(--space-3);
  padding: 0 var(--space-4); min-height: 48px; border-bottom: 1px solid var(--border);
}
@media (min-width: 768px) { .composer-row { padding: 0 var(--space-5); } }
.composer-row label { flex-shrink: 0; width: 72px; font-size: 13px; color: var(--text-muted); font-weight: 500; }
.composer-row input {
  flex: 1; min-width: 0; height: 46px; padding: 0;
  font-family: var(--font); font-size: 15px; color: var(--text);
  background: transparent; border: none; outline: none;
}
.composer-row:focus-within { background: var(--surface-2); }
.composer-row[data-invalid] { box-shadow: inset 3px 0 0 var(--error); }
.composer-row .field-error { flex-basis: 100%; }
.composer-error { padding: 6px var(--space-4) 0; }
@media (min-width: 768px) { .composer-error { padding: 6px var(--space-5) 0; } }

.composer-body { padding: var(--space-4); }
@media (min-width: 768px) { .composer-body { padding: var(--space-5); } }
.composer-body textarea {
  display: block; width: 100%; min-height: 160px; padding: 0; overflow: hidden;
  font-family: var(--font); font-size: 15px; line-height: 1.65; color: var(--text);
  background: transparent; border: none; outline: none; resize: none;
  field-sizing: content; /* grows with the text; app.js does the same for browsers without it */
}
.composer-body textarea[readonly] { color: var(--text-muted); }

.composer-meta {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2);
  padding: 10px var(--space-4); border-top: 1px solid var(--border); background: var(--surface-2);
  font-size: 12px; color: var(--text-muted);
}
@media (min-width: 768px) { .composer-meta { padding: 10px var(--space-5); } }
.word-count { font-variant-numeric: tabular-nums; display: inline-flex; gap: 6px; align-items: center; }
.word-count.over { color: var(--warning); font-weight: 500; }

.regen { padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-3); border-top: 1px solid var(--border); }
@media (min-width: 768px) { .regen { padding: var(--space-4) var(--space-5) var(--space-5); } }
.regen-title { font-size: 13px; font-weight: 500; }
.regen-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.regen-chips .chip { height: 32px; }
.regen-row { display: flex; gap: var(--space-2); }
.regen-row input {
  flex: 1; min-width: 0; height: 40px; padding: 0 12px;
  font-family: var(--font); font-size: 15px; color: var(--text);
  background: var(--card); border: 1px solid var(--border-strong); border-radius: var(--radius); outline: none;
  transition: border-color 150ms var(--ease-out), box-shadow 150ms var(--ease-out);
}
.regen-row input:focus { border-color: var(--accent); box-shadow: var(--focus-ring); }
@media (max-width: 767px) { .regen-row input { height: 44px; font-size: 16px; } }

.actions { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.actions .spacer { flex: 1; }

@media (max-width: 767px) {
  .actions.sticky-mobile {
    position: sticky; bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom)); z-index: var(--z-sticky);
    margin: 0 calc(-1 * var(--space-4));
    padding: var(--space-3) var(--space-4);
    background: rgba(245, 246, 249, 0.96);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    border-top: 1px solid var(--border);
  }
  .actions.sticky-mobile .btn-primary { flex: 1; }
  .actions .spacer { display: none; }
}

.back-to-list { align-self: flex-start; }
@media (min-width: 1024px) { .back-to-list { display: none; } }

@media (max-width: 1023px) {
  .review.show-detail .lead-pane { display: none; }
  .review:not(.show-detail) #leadDetail { display: none; }
}

/* Detail cross-fade when switching leads */
.lead-detail { transition: opacity 160ms var(--ease-out); }
@starting-style { .lead-detail { opacity: 0; } }

/* ── Requests ──────────────────────────────────────────────────────────────── */

.requests-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-5); align-items: start; }
@media (min-width: 1024px) { .requests-layout { grid-template-columns: minmax(0, 1.4fr) minmax(320px, 1fr); } }

.stack { display: flex; flex-direction: column; gap: var(--space-5); }
.stack-sm { display: flex; flex-direction: column; gap: var(--space-4); }

.suggestions { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-3); background: var(--accent-subtle); border: 1px solid var(--accent-border); border-radius: var(--radius); margin-top: 2px; }
.suggestions-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.suggestions-title { font-size: 12px; font-weight: 600; color: var(--accent-text); }
.suggestions-head .btn { color: var(--accent-text); }
.suggestions .term-presets .chip { border-color: var(--accent-border); }
.suggestions .term-presets .chip .icon { color: var(--accent); }
.term-presets .skeleton { background: var(--accent-border); }
.suggestions-head .btn { margin: -4px -8px -4px 0; }
.term-presets { display: flex; flex-wrap: wrap; gap: 6px; min-height: 30px; }
.term-presets .muted { font-size: 13px; }
.term-presets .skeleton { width: 84px; height: 30px; border-radius: 999px; background: var(--hover); }
.term-presets .chip { height: 30px; font-size: 12px; padding: 0 10px; }
.term-presets .chip .icon { width: 14px; height: 14px; }
@media (pointer: coarse) { .term-presets .chip { min-height: 40px; } }

.estimate { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--text-muted); font-variant-numeric: tabular-nums; padding: 12px 14px; background: var(--subtle); border-radius: var(--radius); }
.estimate:empty { display: none; }
.estimate .icon { width: 16px; height: 16px; margin-top: 2px; }

.request-list { display: flex; flex-direction: column; }
.request-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.request-row:first-child { padding-top: 0; }
.request-row:last-child { border-bottom: none; padding-bottom: 0; }
.request-terms { font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
.request-where { font-size: 13px; color: var(--text-muted); grid-column: 1 / -1; display: flex; gap: 6px; align-items: center; }
.request-where .icon { width: 14px; height: 14px; }
.request-stats { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.request-stats strong { color: var(--text); font-weight: 600; }
.request-error { font-size: 12px; color: var(--error); grid-column: 1 / -1; }
.request-actions { grid-column: 1 / -1; flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 4px 8px; margin-left: -12px; }
.request-toggle { justify-self: start; }
.request-results-wrap { grid-column: 1 / -1; }
.request-results { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-3); background: var(--subtle); border-radius: var(--radius); }
.request-results ul { list-style: none; display: flex; flex-direction: column; max-height: 360px; overflow-y: auto; overscroll-behavior: contain; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); }
.result-item .lead-badges { flex-shrink: 0; flex-wrap: nowrap; }
.request-results li + li { border-top: 1px solid var(--border); }
.request-results > .btn { align-self: flex-start; }
.result-item {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  width: 100%; min-height: 48px; padding: 8px 12px; text-align: left;
  background: var(--card); border: none; cursor: pointer; touch-action: manipulation;
  transition: background-color 120ms var(--ease-out);
}
@media (hover: hover) and (pointer: fine) { .result-item:hover { background: var(--surface-2); } }
.result-name { display: flex; flex-direction: column; min-width: 0; font-size: 13px; font-weight: 500; }
.result-name .muted { font-size: 12px; font-weight: 400; }

/* ── Settings ──────────────────────────────────────────────────────────────── */

.settings-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-5); align-items: start; }
@media (min-width: 1024px) { .settings-layout { grid-template-columns: 200px minmax(0, 1fr); gap: var(--space-6); } }

.settings-nav { display: none; }
@media (min-width: 1024px) {
  .settings-nav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: calc(var(--nav-h) + 24px); }
}
.settings-nav a {
  display: flex; align-items: center; height: 36px; padding: 0 12px;
  font-size: 14px; color: var(--text-muted); text-decoration: none; border-radius: var(--radius);
  transition: background-color 150ms var(--ease-out), color 150ms var(--ease-out);
}
.settings-nav a[aria-current="true"] { background: var(--card); color: var(--text); font-weight: 500; box-shadow: 0 0 0 1px var(--border); }
@media (hover: hover) and (pointer: fine) { .settings-nav a:hover { color: var(--text); } }

.settings-form { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }
.settings-section { display: flex; flex-direction: column; gap: var(--space-4); scroll-margin-top: calc(var(--nav-h) + 16px); }
.settings-section h2 { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.settings-hint { font-size: 13px; color: var(--text-muted); line-height: 1.6; max-width: 70ch; margin-top: -8px; }

.settings-footer {
  position: sticky; bottom: 0; z-index: var(--z-sticky);
  display: flex; align-items: center; justify-content: flex-end; gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
}
/* With the bottom nav (phones and tablets) the bar docks onto it, full width, instead of floating above it. */
@media (max-width: 1023px) {
  .settings-footer {
    position: fixed; left: 0; right: 0; bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom));
    justify-content: space-between; padding: 10px 16px;
    background: var(--card); backdrop-filter: none; -webkit-backdrop-filter: none;
    border: none; border-top: 1px solid var(--border); border-radius: 0;
  }
  .settings-footer .btn { min-height: 44px; padding-inline: 24px; }
  .settings-form { padding-bottom: 72px; } /* the last field stays clear of the docked bar */
}
.save-state { font-size: 13px; color: var(--text-muted); display: inline-flex; gap: 6px; align-items: center; }
.save-state.dirty { color: var(--warning); }

.preview-frame { width: 100%; min-height: 360px; border: 1px solid var(--border); border-radius: var(--radius); background: #ffffff; }

/* ── Admin ─────────────────────────────────────────────────────────────────── */

.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-3); margin-bottom: var(--space-5); }
@media (min-width: 768px) { .stats { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--space-4); } }
.stat { padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-3); }
.stat-icon {
  width: 36px; height: 36px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
}
.stat-icon .icon { width: 18px; height: 18px; }
.stat-icon.tone-accent { background: var(--accent-subtle); color: var(--accent); }
.stat-icon.tone-info { background: var(--info-bg); color: var(--info); }
.stat-icon.tone-warning { background: var(--warning-bg); color: var(--warning); }
.stat-icon.tone-success { background: var(--success-bg); color: var(--success); }
.stat-label { font-size: 13px; color: var(--text-muted); }
.stat-sub { font-size: 12px; line-height: 1.5; margin-top: 2px; }
.revenue { margin-top: var(--space-6, 32px); display: flex; flex-direction: column; gap: var(--space-4); }
.revenue-head { display: flex; flex-direction: column; gap: 4px; }
.revenue-note { font-size: 13px; max-width: 70ch; }
.mail-stats-head { gap: var(--space-3, 12px); }
.mail-stats-filter { margin: 0; max-width: 320px; }
@media (min-width: 768px) { .mail-stats-head { flex-direction: row; justify-content: space-between; align-items: flex-end; } .mail-stats-filter { min-width: 240px; } }
.revenue-stats { margin-bottom: 0; }
@media (min-width: 768px) { .revenue-stats { grid-template-columns: repeat(3, 1fr); } }
.revenue-tables { display: grid; gap: var(--space-4); grid-template-columns: 1fr; align-items: start; }
.revenue-chart-card { margin: 0; padding-bottom: 8px; }
.revenue-chart { position: relative; padding: 8px 16px 0; }
.rc-plot { position: relative; height: 220px; margin-left: 48px; }
.rc-grid { position: absolute; inset: 0 0 40px 0; }
.rc-gridline { position: absolute; left: 0; right: 0; bottom: calc(var(--y) * 100%); border-top: 1px solid var(--border); }
.rc-gridline span { position: absolute; right: calc(100% + 8px); top: -8px; font-size: 11px; color: var(--text-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.rc-bars { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(var(--n, 12), minmax(0, 1fr)); gap: 2px; }
.rc-slot { display: flex; flex-direction: column; align-items: center; min-width: 0; cursor: default; outline: none; border-radius: 6px; }
.rc-slot:focus-visible { box-shadow: 0 0 0 2px var(--accent); }
.rc-bar-area { position: relative; flex: 1; width: 100%; display: flex; justify-content: center; align-items: flex-end; }
.rc-bar { width: min(24px, 70%); height: calc(var(--h) * 100%); min-height: 0; background: var(--chart-bar); border-radius: 4px 4px 0 0; transition: background-color 120ms var(--ease-out); }
.rc-slot.is-active .rc-bar { background: var(--chart-bar-active); }
.rc-slot.is-active .rc-bar-area { background: var(--subtle); border-radius: 4px 4px 0 0; }
.rc-value { position: absolute; bottom: calc(var(--h) * 100% + 4px); font-size: 11px; font-weight: 600; color: var(--text); white-space: nowrap; }
.rc-month { height: 40px; padding-top: 6px; font-size: 11px; line-height: 1.3; color: var(--text-muted); text-align: center; }
.rc-tooltip {
  position: absolute; top: 0; left: 0; z-index: 2; display: flex; flex-direction: column; gap: 2px;
  padding: 8px 12px; border-radius: 8px; background: var(--card); border: 1px solid var(--border);
  font-size: 12px; line-height: 1.4; pointer-events: none; white-space: nowrap;
}
.rc-empty { position: absolute; left: 0; right: 0; top: 80px; text-align: center; font-size: 13px; }
.revenue-details { padding: 0 16px 8px; }
.revenue-details summary { cursor: pointer; padding: 10px 0; font-size: 13px; color: var(--text-muted); min-height: 44px; display: flex; align-items: center; }
.revenue-details .table-wrap { border-top: 1px solid var(--border); }
.revenue-caption { caption-side: top; text-align: left; padding: 14px 16px 10px; font-size: 14px; font-weight: 600; }
.revenue-caption .muted { font-weight: 400; }
.stat-value { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; margin-top: 2px; }

/* position: relative keeps absolutely positioned children (e.g. visually hidden labels) inside the scroller. */
.table-wrap { position: relative; width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  padding: 12px 16px; text-align: left; font-size: 12px; font-weight: 500;
  color: var(--text-muted); border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--surface-2);
}
td { padding: 14px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
td.num, th.num { font-variant-numeric: tabular-nums; text-align: right; }
tbody tr:last-child td { border-bottom: none; }
@media (hover: hover) and (pointer: fine) { tbody tr:hover td { background: var(--surface-2); } }
.client-cell { display: flex; align-items: center; gap: 12px; min-width: 200px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-subtle); color: var(--accent-text); font-size: 13px; font-weight: 600;
}
.client-cell strong { font-weight: 500; display: block; }
.client-cell .muted { font-size: 13px; }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; white-space: nowrap; }

/* ── Modal ─────────────────────────────────────────────────────────────────── */

dialog.modal {
  margin: auto; width: calc(100% - 32px); max-width: 480px; max-height: calc(100dvh - 32px);
  border: none; border-radius: var(--radius-lg); background: var(--card); color: var(--text);
  box-shadow: var(--shadow-overlay);
  opacity: 1; transform: scale(1);
  transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out),
              overlay 200ms allow-discrete, display 200ms allow-discrete;
}
dialog.modal.wide { max-width: 760px; }
dialog.modal:not([open]) { opacity: 0; transform: scale(0.96); transition-duration: 140ms; }
@starting-style { dialog.modal[open] { opacity: 0; transform: scale(0.96); } }
dialog.modal::backdrop { background: var(--backdrop); }

.modal-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 24px 0; }
.modal-title { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.modal-body { padding: 16px 24px 20px; display: flex; flex-direction: column; gap: 16px; font-size: 14px; color: var(--text-muted); }
.modal-body .field label { color: var(--text); }
.modal-footer { padding: 0 24px 20px; display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; margin: -8px -10px -8px 0;
  background: none; border: none; border-radius: var(--radius); color: var(--text-muted); cursor: pointer;
  transition: background-color 150ms var(--ease-out), color 150ms var(--ease-out);
}
@media (hover: hover) and (pointer: fine) { .icon-btn:hover { background: var(--subtle); color: var(--text); } }
@media (pointer: coarse) { .icon-btn { width: 44px; height: 44px; } }

/* ── Toast ─────────────────────────────────────────────────────────────────── */

.toast-region {
  position: fixed; left: 16px; right: 16px; z-index: var(--z-toast);
  bottom: calc(16px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none;
}
@media (max-width: 767px) { .has-bottom-nav .toast-region { bottom: calc(var(--bottom-nav-h) + 12px + env(safe-area-inset-bottom)); } }
.toast {
  display: flex; align-items: center; gap: 12px;
  max-width: 440px; padding: 10px 10px 10px 16px; min-height: 44px;
  border-radius: var(--radius); background: var(--accent); color: var(--on-accent);
  font-size: 14px; box-shadow: var(--shadow-overlay); pointer-events: auto;
  transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out);
}
.toast:not(:has(button)) { padding-right: 16px; }
.toast.error { background: var(--error); }
.toast button {
  height: 30px; padding: 0 10px; border: none; border-radius: 6px; cursor: pointer;
  background: rgba(255, 255, 255, 0.16); color: inherit; font-size: 13px; font-weight: 600; white-space: nowrap;
}
@starting-style { .toast { opacity: 0; transform: translateY(8px); } }
.toast.leaving { opacity: 0; transform: translateY(8px); transition-duration: 140ms; }

/* ── Login ─────────────────────────────────────────────────────────────────── */

.page-login { display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.login-card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 32px 24px; width: 100%; max-width: 400px; }
@media (min-width: 768px) { .login-card { padding: 40px; } }
.login-card .brand { margin-bottom: 28px; }
.login-title { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.login-subtitle { font-size: 14px; color: var(--text-muted); margin: 4px 0 28px; }
.login-form { display: flex; flex-direction: column; gap: 16px; }
.login-footer { margin-top: 16px; text-align: center; }
.link-muted {
  font-size: 13px; color: var(--text-muted); text-decoration: none;
  background: none; border: none; cursor: pointer;
  min-height: 44px; display: inline-flex; align-items: center;
}
@media (hover: hover) and (pointer: fine) { .link-muted:hover { color: var(--text); } }

.password-wrap { position: relative; }
.password-wrap input { padding-right: 72px; }
.password-toggle {
  position: absolute; right: 5px; top: 50%; transform: translateY(-50%);
  height: 32px; padding: 0 10px; font-size: 12px; font-weight: 500;
  color: var(--text-muted); background: none; border: none; border-radius: 6px; cursor: pointer;
}
@media (hover: hover) and (pointer: fine) { .password-toggle:hover { background: var(--subtle); color: var(--text); } }

/* ── Empty & loading ───────────────────────────────────────────────────────── */

.empty-state { display: flex; flex-direction: column; align-items: center; padding: 56px 24px; text-align: center; color: var(--text-muted); font-size: 14px; }
.empty-icon {
  width: 48px; height: 48px; border-radius: 12px; margin-bottom: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-subtle); color: var(--accent);
}
.empty-icon .icon { width: 22px; height: 22px; }
.empty-state strong { display: block; color: var(--text); font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.empty-state p { max-width: 36ch; }
.empty-state .btn { margin-top: 18px; }

.skeleton { border-radius: var(--radius-sm); background: var(--subtle); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.5; } }
.skeleton-item { padding: 14px 16px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.skeleton-line { height: 12px; }
.w-60 { width: 60%; }
.w-40 { width: 40%; }

/* ── Reduced motion ────────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
  /* A loading indicator carries information, so it keeps turning, just slower. */
  .spinner { animation-duration: 1.5s !important; animation-iteration-count: infinite !important; }
  .btn:active:not(:disabled) { transform: none; }
  dialog.modal, dialog.modal:not([open]), .toast, .toast.leaving, .progress-banner { transform: none; }
  @starting-style { dialog.modal[open], .toast, .progress-banner { transform: none; } }
}

/* ── Color & motion layer ──────────────────────────────────────────────────── */

/* Section identity: icon tile next to each page title, tinted nav icons. */
.page-title { display: flex; align-items: center; gap: var(--space-3); }
.title-icon {
  width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
}
.title-icon .icon { width: 20px; height: 20px; }
[data-section-tone="leads"] .title-icon { background: var(--sec-leads-bg); color: var(--sec-leads); }
[data-section-tone="aanvragen"] .title-icon { background: var(--sec-requests-bg); color: var(--sec-requests); }
[data-section-tone="instellingen"] .title-icon { background: var(--sec-settings-bg); color: var(--sec-settings); }

.nav-link[data-tab="aanvragen"][aria-current="page"] { background: var(--sec-requests-bg); color: var(--sec-requests); }
.nav-link[data-tab="instellingen"][aria-current="page"] { background: var(--sec-settings-bg); color: var(--sec-settings); }

/* Requests page leans teal, settings amber, for the main action and tint panels. */
#view-aanvragen .btn-primary { background: var(--brand-green); border-color: var(--brand-green); }
@media (hover: hover) and (pointer: fine) { #view-aanvragen .btn-primary:hover:not(:disabled) { background: var(--brand-green-hover); border-color: var(--brand-green-hover); } }
#view-aanvragen .suggestions { background: var(--sec-requests-bg); border-color: var(--brand-green-border); }
#view-aanvragen .suggestions-title, #view-aanvragen .suggestions-head .btn { color: var(--sec-requests); }
#view-aanvragen .suggestions .term-presets .chip { border-color: var(--brand-green-border); }
#view-aanvragen .suggestions .term-presets .chip .icon { color: var(--sec-requests); }
#view-aanvragen .term-presets .skeleton { background: var(--brand-green-border); }
#view-instellingen .settings-nav a[aria-current="true"] { color: var(--sec-settings); box-shadow: inset 3px 0 0 var(--sec-settings), 0 0 0 1px var(--border); }

/* Lead avatars, colored by business type. */
.lead-avatar {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; letter-spacing: -0.02em;
}
.lead-avatar.lg { width: 48px; height: 48px; border-radius: 12px; font-size: 16px; }
.tone-1 { background: var(--tone-1-bg); color: var(--tone-1-fg); }
.tone-2 { background: var(--tone-2-bg); color: var(--tone-2-fg); }
.tone-3 { background: var(--tone-3-bg); color: var(--tone-3-fg); }
.tone-4 { background: var(--tone-4-bg); color: var(--tone-4-fg); }
.tone-5 { background: var(--tone-5-bg); color: var(--tone-5-fg); }
.tone-6 { background: var(--tone-6-bg); color: var(--tone-6-fg); }
.tone-7 { background: var(--tone-7-bg); color: var(--tone-7-fg); }

.lead-item { flex-direction: row; align-items: center; gap: var(--space-3); }
.lead-item-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.lead-title-main { display: flex; align-items: center; gap: var(--space-3); min-width: 0; }

/* Staggered entrance for the first items of a freshly loaded list. */
@keyframes item-in { from { opacity: 0; transform: translateY(6px); } }
.lead-list.animate .lead-row { animation: item-in 260ms var(--ease-out) both; }
.lead-list.animate .lead-row:nth-child(2) { animation-delay: 30ms; }
.lead-list.animate .lead-row:nth-child(3) { animation-delay: 60ms; }
.lead-list.animate .lead-row:nth-child(4) { animation-delay: 90ms; }
.lead-list.animate .lead-row:nth-child(5) { animation-delay: 120ms; }
.lead-list.animate .lead-row:nth-child(6) { animation-delay: 150ms; }
.lead-list.animate .lead-row:nth-child(7) { animation-delay: 180ms; }
.lead-list.animate .lead-row:nth-child(n+8) { animation-delay: 210ms; }

/* A handled lead slides out before the next one opens. */
.lead-row.leaving { opacity: 0; transform: translateX(24px); transition: opacity 180ms var(--ease-out), transform 180ms var(--ease-out); }

/* Nav counter bump when new leads arrive. */
@keyframes bump { 40% { transform: scale(1.3); } }
.nav-count.bump { animation: bump 260ms var(--ease-out); }

/* Word meter under the composer. */
.word-meter { width: 100%; height: 4px; border-radius: 999px; background: var(--subtle); overflow: hidden; }
.word-meter span {
  display: block; height: 100%; width: 100%; border-radius: inherit;
  background: var(--success); transform-origin: left; transform: scaleX(0);
  transition: transform 200ms var(--ease-out), background-color 200ms var(--ease-out);
}
.word-meter.over span { background: var(--warning); }

/* Indeterminate progress strip on the running-request banner. */
.progress-banner { position: relative; overflow: hidden; }
.progress-banner::after {
  content: ''; position: absolute; left: 0; bottom: 0; height: 3px; width: 40%;
  background: var(--brand-green-light); border-radius: 999px;
  animation: indeterminate 1.4s var(--ease-in-out) infinite;
}
@keyframes indeterminate { from { transform: translateX(-100%); } to { transform: translateX(250%); } }

/* Interactive surfaces respond to the pointer. */
@media (hover: hover) and (pointer: fine) {
  .lead-item:hover:not([aria-current="true"]) { background: var(--surface-2); }
  .lead-item:hover .lead-avatar { transform: scale(1.06); }
  .result-item:hover { background: var(--sec-requests-bg); }
  .chip:hover:not([aria-pressed="true"]) { border-color: var(--accent-border); color: var(--accent-text); }
  .card.stat:hover { border-color: var(--accent-border); transform: translateY(-2px); }
  .btn-primary:hover:not(:disabled) { transform: translateY(-1px); }
  .btn-primary:active:not(:disabled) { transform: scale(0.97); }
}
.lead-avatar { transition: transform 160ms var(--ease-out); }
.card.stat { transition: border-color 160ms var(--ease-out), transform 160ms var(--ease-out); }

/* Toggle card (settings). */
.toggle-card {
  display: flex; gap: var(--space-3); align-items: flex-start; cursor: pointer;
  padding: var(--space-3) var(--space-4); border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface-2); transition: border-color 150ms var(--ease-out), background-color 150ms var(--ease-out);
}
.toggle-card:has(input:checked) { border-color: var(--accent-border); background: var(--accent-subtle); }
.toggle-card input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle-switch {
  position: relative; flex-shrink: 0; width: 38px; height: 22px; margin-top: 1px;
  border-radius: 999px; background: var(--border-strong); transition: background-color 160ms var(--ease-out);
}
.toggle-switch::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%;
  background: #ffffff; box-shadow: 0 1px 2px rgba(17, 24, 39, 0.25); transition: transform 160ms var(--ease-out);
}
.toggle-card input:checked + .toggle-switch { background: var(--accent); }
.toggle-card input:checked + .toggle-switch::after { transform: translateX(16px); }
.toggle-card input:focus-visible + .toggle-switch { outline: 2px solid var(--accent); outline-offset: 2px; }
.toggle-text { display: flex; flex-direction: column; gap: 2px; font-size: 13px; color: var(--text-muted); }
.toggle-text strong { font-size: 14px; font-weight: 500; color: var(--text); }

@media (prefers-reduced-motion: reduce) {
  .lead-list.animate .lead-row, .nav-count.bump { animation: none; }
  .lead-item.leaving { transform: none; }
  .progress-banner::after { animation: none; width: 100%; opacity: 0.35; }
  .card.stat:hover, .btn-primary:hover:not(:disabled), .lead-item:hover .lead-avatar { transform: none; }
}

/* ── Email button style picker (settings) ──────────────────────────────────── */

.cta-styles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }
@media (min-width: 768px) { .cta-styles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.cta-option {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  min-height: 96px; padding: var(--space-4) var(--space-3);
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  cursor: pointer; touch-action: manipulation;
  transition: border-color 150ms var(--ease-out), background-color 150ms var(--ease-out), transform 120ms var(--ease-out);
}
.cta-option:active { transform: scale(0.98); }
.cta-option:has(input:checked) { border-color: var(--accent); background: var(--accent-subtle); box-shadow: inset 0 0 0 1px var(--accent); }
.cta-option:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) { .cta-option:hover:not(:has(input:checked)) { border-color: var(--accent-border); } }
/* Explicit size so the generic .field input { width: 100% } rule can't widen the page. */
.field .cta-option input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.cta-option-name { font-size: 12px; font-weight: 500; color: var(--text-muted); }
.cta-option:has(input:checked) .cta-option-name { color: var(--accent-text); }

/* Previews mirror ctaStyle() in lib/mailer.js. Colors come from the user's chosen button color. */
.cta-prev {
  display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: 8px 14px; font-size: 13px; font-weight: 600; line-height: 1.3; pointer-events: none;
}
.cta-filled { background: var(--cta); color: var(--cta-on); border-radius: 6px; }
.cta-pill { background: var(--cta); color: var(--cta-on); border-radius: 999px; padding: 8px 18px; }
.cta-square { background: var(--cta); color: var(--cta-on); border-radius: 0; }
.cta-outline { background: #ffffff; color: var(--cta-ink); border: 2px solid var(--cta-ink); border-radius: 6px; padding: 6px 12px; }
.cta-soft { background: var(--cta-soft); color: var(--cta-ink); border-radius: 8px; }
.cta-link { padding: 0; color: var(--cta-ink); text-decoration: underline; text-underline-offset: 3px; }

/* ── Signature upload (settings) ───────────────────────────────────────────── */

.sig-upload { display: flex; flex-direction: column; gap: var(--space-3); align-items: flex-start; }
.sig-drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  width: 100%; min-height: 140px; padding: var(--space-4);
  background: var(--surface-2); border: 1.5px dashed var(--border-strong); border-radius: var(--radius);
  font-size: 13px; color: var(--text-muted); text-align: center; cursor: pointer; touch-action: manipulation;
  transition: border-color 150ms var(--ease-out), background-color 150ms var(--ease-out);
}
.sig-drop strong { font-size: 14px; font-weight: 500; color: var(--text); }
.sig-drop .empty-icon { margin-bottom: 4px; width: 40px; height: 40px; }
@media (hover: hover) and (pointer: fine) { .sig-drop:hover { border-color: var(--accent); background: var(--accent-subtle); } }
.sig-upload.dragging .sig-drop { border-color: var(--accent); background: var(--accent-subtle); }
.sig-preview {
  display: block; max-width: 100%; width: auto; height: auto; max-height: 140px;
  padding: var(--space-2); background: #ffffff; border: 1px solid var(--border); border-radius: var(--radius);
}
.sig-loading { display: flex; align-items: center; gap: 8px; min-height: 140px; font-size: 13px; color: var(--text-muted); }
.sig-url { font-size: 13px; color: var(--text-muted); }
.sig-url summary { cursor: pointer; min-height: 32px; display: inline-flex; align-items: center; }
.sig-url[open] summary { margin-bottom: var(--space-2); }
.field-warning { display: flex; gap: 6px; align-items: flex-start; font-size: 12px; line-height: 1.5; color: var(--warning); }
.field-warning:empty { display: none; }
.field-warning .icon { margin-top: 2px; }

/* ── Provider help (mail server settings) ──────────────────────────────────── */

#smtpHelp { display: block; }
.provider-help { display: flex; flex-direction: column; gap: 6px; font-size: 13px; line-height: 1.55; color: var(--text); }
.provider-help strong { font-weight: 600; color: var(--info); }
.provider-help ol { margin: 0 0 2px; padding-left: 20px; display: flex; flex-direction: column; gap: 3px; }
.provider-help li::marker { color: var(--info); font-weight: 600; }
.provider-note { display: flex; gap: 6px; align-items: flex-start; color: var(--warning); }
.provider-note .icon { margin-top: 3px; }
.provider-help .btn { align-self: flex-start; margin-top: 4px; }

/* ── Multi-select (lead list) ──────────────────────────────────────────────── */

.lead-row { display: flex; align-items: stretch; border-bottom: 1px solid var(--border); background: var(--card); transition: background-color 120ms var(--ease-out); }
.lead-row:last-child { border-bottom: none; }
.lead-row .lead-item { flex: 1; min-width: 0; border-bottom: none; padding-left: 4px; }
.lead-row.is-selected, .lead-row.is-selected .lead-item:not([aria-current="true"]) { background: var(--accent-subtle); }

.lead-check, .select-all {
  flex-shrink: 0; width: 44px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.select-all { width: 36px; height: 36px; border-radius: var(--radius); }
@media (hover: hover) and (pointer: fine) { .select-all:hover { background: var(--subtle); } }
.lead-check input, .select-all input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); cursor: pointer; }
@media (pointer: coarse) { .select-all { width: 44px; height: 44px; } }

.bulk-bar {
  position: sticky; top: calc(var(--nav-h) + 8px); z-index: var(--z-sticky);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3);
  margin-bottom: var(--space-4); padding: 10px 12px 10px 16px;
  background: var(--accent); color: var(--on-accent); border-radius: var(--radius-lg);
  box-shadow: 0 8px 24px rgba(61, 43, 63, 0.28);
  transition: opacity 180ms var(--ease-out), transform 180ms var(--ease-out);
}
@starting-style { .bulk-bar { opacity: 0; transform: translateY(-6px); } }
.bulk-count { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.bulk-bar .btn-primary { background: #ffffff; color: var(--accent-text); border-color: #ffffff; }
.bulk-bar .btn-danger { background: transparent; color: #ffffff; border-color: rgba(255, 255, 255, 0.5); }
.bulk-bar .btn-ghost { color: rgba(255, 255, 255, 0.85); }
@media (hover: hover) and (pointer: fine) {
  .bulk-bar .btn-primary:hover:not(:disabled) { background: var(--accent-subtle); border-color: var(--accent-subtle); }
  .bulk-bar .btn-danger:hover:not(:disabled) { background: rgba(255, 255, 255, 0.12); border-color: #ffffff; }
  .bulk-bar .btn-ghost:hover:not(:disabled) { background: rgba(255, 255, 255, 0.12); color: #ffffff; }
}
@media (max-width: 767px) {
  .bulk-bar { position: fixed; left: 12px; right: 12px; top: auto; bottom: calc(var(--bottom-nav-h) + 12px + env(safe-area-inset-bottom)); margin: 0; }
  .bulk-bar .actions { width: 100%; }
  .bulk-bar .btn-primary { flex: 1; }
}
@media (prefers-reduced-motion: reduce) { @starting-style { .bulk-bar { transform: none; } } }

/* The open lead is marked on the whole row, so the bar sits left of the checkbox. */
.lead-row:has(.lead-item[aria-current="true"]) { background: var(--accent-subtle); box-shadow: inset 3px 0 0 var(--accent); }
.lead-row .lead-item[aria-current="true"] { box-shadow: none; }

/* ── Company profile questions (settings) ──────────────────────────────────── */

.profile-group {
  display: flex; flex-direction: column; gap: var(--space-4);
  margin: 0; padding: var(--space-4); min-width: 0;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2);
}
.profile-group legend { padding: 0 6px; margin-left: -6px; font-size: 13px; font-weight: 600; color: var(--text); }

/* ── Request history: bounded height with its own scroll ───────────────────── */

.history-card { display: flex; flex-direction: column; min-height: 0; max-height: 65dvh; overflow: hidden; }
@media (min-width: 1024px) {
  .history-card { position: sticky; top: calc(var(--nav-h) + 16px); max-height: calc(100dvh - var(--nav-h) - 32px); }
}
.history-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3);
  padding: var(--space-5) var(--space-4) var(--space-3); border-bottom: 1px solid var(--border);
}
@media (min-width: 768px) { .history-head { padding: var(--space-5) var(--space-5) var(--space-3); } }
.history-card .request-list {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  padding: var(--space-3) var(--space-4) var(--space-4); scrollbar-width: thin;
}
@media (min-width: 768px) { .history-card .request-list { padding: var(--space-3) var(--space-5) var(--space-5); } }
.history-card .request-list:focus-visible { outline-offset: -2px; }
.history-card .request-row:first-child { padding-top: var(--space-2); }

/* ── LeadMe brand ──────────────────────────────────────────────────────────── */

.brand-logo { display: block; height: 28px; width: auto; }
@media (max-width: 380px) { .brand-logo { height: 24px; } }
.brand .brand-tag { margin-left: 2px; font-size: 13px; padding: 2px 8px; border-radius: 999px; background: var(--accent-subtle); color: var(--accent-text); }

/* Login: brand purple background, white card with the full logo. */
.page-login { background: var(--accent); }
.login-card { border: none; box-shadow: 0 24px 64px rgba(0, 0, 0, 0.25); }
.login-logo { display: block; height: 36px; width: auto; margin-bottom: 28px; }
.page-login .btn-primary { background: var(--accent); border-color: var(--accent); }
.page-login .link-muted { color: var(--text-muted); }

/* ── Purple top bar ────────────────────────────────────────────────────────── */
/* Same purple as the dark logo's background, so the logo sits on it seamlessly. */

.navbar { background: var(--accent); border-bottom-color: var(--accent); backdrop-filter: none; -webkit-backdrop-filter: none; }
.navbar :focus-visible { outline-color: #ffffff; }
.navbar .nav-link { color: rgba(255, 255, 255, 0.72); }
.navbar .nav-link[aria-current="page"],
.navbar .nav-link[data-tab="aanvragen"][aria-current="page"],
.navbar .nav-link[data-tab="instellingen"][aria-current="page"] { background: rgba(255, 255, 255, 0.14); color: #ffffff; }
.navbar .nav-count { background: var(--brand-green-light); color: var(--accent); }
.navbar-user { color: rgba(255, 255, 255, 0.7); }
.navbar .btn-ghost { color: rgba(255, 255, 255, 0.78); }
.navbar .brand .brand-tag { background: rgba(255, 255, 255, 0.14); color: #ffffff; }
@media (hover: hover) and (pointer: fine) {
  .navbar .nav-link:hover { background: rgba(255, 255, 255, 0.1); color: #ffffff; }
  .navbar .btn-ghost:hover:not(:disabled) { background: rgba(255, 255, 255, 0.12); color: #ffffff; }
}

/* ── Contacten ─────────────────────────────────────────────────────────────── */

[data-section-tone="contacten"] .title-icon { background: var(--accent-subtle); color: var(--accent); }
.contacts-card { overflow: hidden; margin-bottom: var(--space-5); }
.contacts-tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); padding: var(--space-3); border-bottom: 1px solid var(--border); }
.contacts-tools .search-box { flex: 1 1 240px; }
.contacts-tools select {
  height: 36px; padding: 0 30px 0 10px; font-family: var(--font); font-size: 14px; color: var(--text);
  background-color: var(--subtle); border: 1px solid transparent; border-radius: var(--radius); appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23566072' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.contacts-tools select:focus { outline: none; border-color: var(--accent); background-color: var(--card); }
@media (max-width: 767px) { .contacts-tools select, .contacts-tools .search-box input { height: 44px; font-size: 16px; } }
.contact-count { margin-left: auto; font-size: 13px; }
.contacts-card td a { color: var(--text); text-decoration: none; }
.contacts-card td a:hover { text-decoration: underline; text-underline-offset: 2px; }
.contacts-card tr.is-unsubscribed td { color: var(--text-muted); }
.contact-more { border-radius: 0; border-top: 1px solid var(--border); height: 44px; }

.campaign-row { display: flex; flex-direction: column; gap: 8px; padding: var(--space-3) 0; border-bottom: 1px solid var(--border); }
.campaign-row:last-child { border-bottom: none; padding-bottom: 0; }
.campaign-top { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); }
.campaign-top strong { font-weight: 500; overflow-wrap: anywhere; }
.campaign-progress { height: 6px; border-radius: 999px; background: var(--subtle); overflow: hidden; }
.campaign-progress span { display: block; height: 100%; background: var(--brand-green); transform-origin: left; transform: scaleX(0); transition: transform 300ms var(--ease-out); }
.campaign-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; font-size: 12px; color: var(--text-muted); }
.campaign-meta strong { color: var(--text); font-weight: 600; }
.campaign-meta .btn { margin-left: auto; }
.text-error { color: var(--error); }
.audience-options { display: flex; flex-wrap: wrap; gap: 4px 20px; }

/* ── LeadMe arrow cursor ───────────────────────────────────────────────────── */
/* The logo's arrow as the default pointer (hotspot = arrow tip). Links and buttons keep the hand
   and text fields the text cursor, so it's still clear what you can click or type in. */
@media (hover: hover) and (pointer: fine) {
  html { cursor: url("/brand/cursor.svg") 2 2, url("/brand/cursor.png") 2 2, auto; }
}

/* Tablets (768–1023px) also use the bottom nav: keep content and fixed bars clear of it. */
@media (min-width: 768px) and (max-width: 1023px) {
  .page-content { padding-bottom: calc(var(--bottom-nav-h) + 48px + env(safe-area-inset-bottom)); }
  .has-bottom-nav .toast-region { bottom: calc(var(--bottom-nav-h) + 12px + env(safe-area-inset-bottom)); }
}

/* ── Landing page (login) ──────────────────────────────────────────────────── */

.page-landing { background: var(--page); }
.page-landing .login-card { border: none; box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28); }
.page-landing .btn-primary { background: var(--accent); border-color: var(--accent); }

.landing-hero { background: var(--accent); color: #ffffff; padding: 32px 16px 48px; position: relative; overflow: hidden; }
/* Big faint arrow from the logo, as a playful backdrop. */
.landing-hero::before {
  content: ''; position: absolute; right: -120px; bottom: -160px; width: 520px; height: 520px; opacity: 0.07; pointer-events: none;
  background: url("/brand/leadme-mark.svg") center / contain no-repeat;
  filter: brightness(0) invert(1);
}
.landing-hero-inner { position: relative; max-width: 1120px; margin: 0 auto; display: grid; gap: 32px; align-items: center; }
@media (min-width: 960px) {
  .landing-hero { padding: 56px 24px 72px; min-height: min(760px, 100dvh); display: flex; align-items: center; }
  .landing-hero-inner { grid-template-columns: minmax(0, 1.15fr) minmax(340px, 400px); gap: 64px; width: 100%; }
}
.hero-logo { display: block; height: 32px; width: auto; margin-bottom: 28px; }
.hero-title { font-size: clamp(30px, 5.2vw, 52px); line-height: 1.08; font-weight: 800; letter-spacing: -0.03em; max-width: 16ch; text-wrap: balance; }
.hero-title span { display: block; margin-top: 4px; color: var(--brand-green-light); }
.hero-lead { margin-top: 18px; font-size: 17px; line-height: 1.6; color: rgba(255, 255, 255, 0.8); max-width: 48ch; }
.scroll-cue {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 28px; min-height: 44px;
  font-size: 15px; font-weight: 600; color: #ffffff; text-decoration: none;
}
.scroll-cue .icon { animation: nudge 1.8s var(--ease-in-out) infinite; }
@keyframes nudge { 50% { transform: translateY(4px); } }
@media (hover: hover) and (pointer: fine) { .scroll-cue:hover span { text-decoration: underline; text-underline-offset: 4px; } }

/* Hero: one clear next step for new visitors, and the demo right next to it. */
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; margin-top: 28px; }
.hero-actions .scroll-cue { margin-top: 0; }
.hero-cta {
  height: 48px; padding: 0 24px; font-size: 16px; font-weight: 600; border-radius: 999px;
  background: var(--brand-green-light); color: var(--accent); border-color: var(--brand-green-light);
  transition: background-color 150ms var(--ease-out), transform 120ms var(--ease-out);
}
@media (hover: hover) and (pointer: fine) { .hero-cta:hover { background: #ffffff; border-color: #ffffff; } }
.hero-cta:active { transform: scale(0.97); }
/* Demo: its own block after "Zo werkt het", the video as wide as the content. */
.demo-figure { margin: 0; }
.demo-figure .demo-video { margin-top: 0; border-radius: 12px; background: #2c1f2e; box-shadow: 0 24px 64px rgba(0, 0, 0, 0.3); }
.demo-figure figcaption { margin-top: 12px; font-size: 14px; color: rgba(255, 255, 255, 0.65); }
.login-card { scroll-margin-top: 72px; } /* clear of the fixed menu bar when "Inloggen" scrolls to it */

.landing-section { padding: 72px 16px; }
.landing-section.alt { background: var(--card); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
@media (min-width: 768px) { .landing-section { padding: 96px 24px; } }
.landing-inner { max-width: 1120px; margin: 0 auto; }
.eyebrow { font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--brand-green); margin-bottom: 10px; }
.section-heading { font-size: clamp(24px, 3.4vw, 36px); line-height: 1.2; font-weight: 700; letter-spacing: -0.02em; max-width: 26ch; text-wrap: balance; margin-bottom: 40px; }

.how-layout { display: grid; gap: 40px; align-items: start; }
@media (min-width: 960px) { .how-layout { grid-template-columns: minmax(0, 1fr) minmax(320px, 420px); gap: 64px; } }
.steps { list-style: none; display: flex; flex-direction: column; gap: 28px; counter-reset: none; }
.step { display: grid; grid-template-columns: 44px 1fr; gap: 16px; align-items: start; }
.step-num {
  width: 44px; height: 44px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: var(--brand-green-light); font-size: 18px; font-weight: 800;
}
.step h3 { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 4px; }
.step p { color: var(--text-muted); max-width: 52ch; }

.mail-demo { background: var(--card); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; box-shadow: 0 16px 40px rgba(61, 43, 63, 0.12); }
@media (min-width: 960px) { .mail-demo { position: sticky; top: 32px; } }
.mail-demo-bar { display: flex; gap: 6px; padding: 12px 14px; background: var(--subtle); border-bottom: 1px solid var(--border); }
.mail-demo-head { padding: 12px 18px; border-bottom: 1px solid var(--border); font-size: 13px; display: flex; flex-direction: column; gap: 4px; }
.mail-demo-head .muted { display: inline-block; width: 78px; }
.mail-demo-body { padding: 18px; font-size: 14px; line-height: 1.65; display: flex; flex-direction: column; gap: 10px; }
.mail-demo figcaption { padding: 12px 18px; font-size: 12px; color: var(--text-muted); background: var(--surface-2); border-top: 1px solid var(--border); }

.who-grid { list-style: none; display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .who-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .who-grid { grid-template-columns: repeat(3, 1fr); } }
/* The closing "and many more" card fills the last row, so an odd number of cards never leaves a gap. */
.who-card-wide { grid-column: 1 / -1; }
.who-card { padding: 22px; border: 1px solid var(--border); border-radius: 14px; background: var(--page); transition: transform 180ms var(--ease-out), border-color 180ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .who-card:hover { transform: translateY(-3px); border-color: var(--brand-green-border); } }
.who-icon { width: 44px; height: 44px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; background: var(--brand-green-bg); color: var(--brand-green); margin-bottom: 14px; }
.who-icon .icon { width: 22px; height: 22px; }
.who-card h3 { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.who-card p { font-size: 14px; color: var(--text-muted); }

.why-grid { display: grid; gap: 28px 40px; grid-template-columns: 1fr; }
@media (min-width: 768px) { .why-grid { grid-template-columns: repeat(2, 1fr); } }
.why-item { padding-left: 18px; border-left: 3px solid var(--brand-green-light); }
.why-item h3 { font-size: 17px; font-weight: 700; margin-bottom: 4px; }
.why-item p { color: var(--text-muted); max-width: 52ch; }

.landing-cta { background: var(--accent); color: #ffffff; text-align: center; padding: 72px 16px; }
.landing-cta .landing-inner { display: flex; flex-direction: column; align-items: center; gap: 14px; max-width: 640px; }
.cta-mark { width: 56px; height: 56px; border-radius: 14px; }
.landing-cta h2 { font-size: clamp(24px, 3.4vw, 34px); font-weight: 800; letter-spacing: -0.02em; text-wrap: balance; }
.landing-cta p { color: rgba(255, 255, 255, 0.8); max-width: 46ch; }
.btn-cta { margin-top: 8px; height: 48px; padding: 0 24px; font-size: 15px; background: var(--brand-green-light); color: var(--accent); border-color: var(--brand-green-light); }
@media (hover: hover) and (pointer: fine) { .btn-cta:hover { background: #a3c96a; border-color: #a3c96a; } }


/* Scroll reveal: only when JS confirmed motion is OK (class on <html>). */
.can-reveal .reveal { opacity: 0; transform: translateY(14px); transition: opacity 500ms var(--ease-out), transform 500ms var(--ease-out); }
.can-reveal .reveal.is-visible { opacity: 1; transform: none; }
.can-reveal .steps .step:nth-child(2), .can-reveal .who-grid .who-card:nth-child(2), .can-reveal .why-grid .why-item:nth-child(2) { transition-delay: 60ms; }
.can-reveal .steps .step:nth-child(3), .can-reveal .who-grid .who-card:nth-child(3), .can-reveal .why-grid .why-item:nth-child(3) { transition-delay: 120ms; }
.can-reveal .steps .step:nth-child(4), .can-reveal .who-grid .who-card:nth-child(4), .can-reveal .why-grid .why-item:nth-child(4) { transition-delay: 180ms; }

@media (prefers-reduced-motion: reduce) {
  .scroll-cue .icon { animation: none; }
  .mail-demo { transform: none; }
  .who-card:hover { transform: none; }
}
/* The hero sets white text; the login card inside it needs the normal dark text again. */
.page-landing .login-card { color: var(--text); }

/* ── Colorful demo mail (landing) ──────────────────────────────────────────── */

.mail-demo { border: none; box-shadow: 0 24px 56px rgba(61, 43, 63, 0.22); }
.mail-demo-bar { justify-content: space-between; align-items: center; background: var(--accent); border-bottom: none; padding: 12px 14px; }
.mail-demo-bar .dots { display: inline-flex; gap: 6px; }
.mail-demo-bar .dots span { width: 11px; height: 11px; border-radius: 50%; }
.mail-demo-bar .dots span:nth-child(1) { background: #ff6159; }
.mail-demo-bar .dots span:nth-child(2) { background: #ffbd2e; }
.mail-demo-bar .dots span:nth-child(3) { background: #28c941; }
.mail-demo-badge {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px;
  border-radius: 999px; background: rgba(145, 186, 84, 0.18); color: var(--brand-green-light);
  font-size: 12px; font-weight: 600;
}
.mail-demo-badge .icon { width: 13px; height: 13px; }
.mail-demo-head { background: var(--card); gap: 6px; }
.mail-demo-from { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; font-size: 14px; }
.mail-demo-avatar {
  width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--brand-green-light); color: var(--accent); font-weight: 800; font-size: 14px;
}
.mail-demo-head strong { font-weight: 600; }
/* The mail text itself stays plain, like a real mail. */
.mail-demo-body { background: var(--card); color: var(--text); }
.mail-demo figcaption { background: var(--card); }

/* Demo mail: button, website link and signature, in the same order as a real LeadMe mail. */
.mail-demo-btn {
  align-self: flex-start; display: inline-block; margin-top: 6px; padding: 11px 20px; border-radius: 6px;
  background: var(--accent); color: #ffffff; font-size: 14px; font-weight: 600;
}
.mail-demo-link { align-self: flex-start; font-size: 13px; color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.mail-demo-signature {
  display: flex; align-items: center; gap: 12px; margin-top: 8px; padding-top: 14px;
  border-top: 1px solid var(--border);
}
.mail-demo-sig-logo {
  width: 44px; height: 44px; border-radius: 10px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--text); color: #ffffff; font-size: 14px; font-weight: 800; letter-spacing: -0.02em;
}
.mail-demo-sig-text { display: flex; flex-direction: column; font-size: 12px; line-height: 1.45; color: var(--text-muted); }
.mail-demo-sig-text strong { font-size: 13px; color: var(--text); font-weight: 700; }
.mail-demo-sig-site { color: var(--text); }

/* Two equal halves: steps left, demo mail centered in the right half (closer to the page center). */
.how-layout { align-items: start; }
.mail-demo { width: 100%; }
@media (min-width: 960px) {
  .how-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; }
  .mail-demo { position: static; }
}

/* ── Dotted path between the steps, with the travelling logo arrow ─────────── */

.steps { position: relative; }
.steps-path { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; z-index: 0; }
.steps-path path { fill: none; stroke: var(--brand-green-light); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 0 9; }
.step-num { position: relative; z-index: 2; box-shadow: 0 0 0 6px var(--page); }
.steps-arrow {
  position: absolute; left: 0; top: 0; z-index: 1; width: 30px; height: 30px; pointer-events: none;
  filter: drop-shadow(0 2px 3px rgba(61, 43, 63, 0.25));
  will-change: transform;
}

/* ── Landing: anchor menu + "Wat onderscheidt ons?" ────────────────────────── */

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
.landing-section { scroll-margin-top: calc(var(--top-nav-h) + 16px); }

.diff-grid { display: grid; gap: 20px; grid-template-columns: 1fr; margin-bottom: 40px; }
@media (min-width: 860px) { .diff-grid { grid-template-columns: repeat(2, 1fr); gap: 24px; } }
.diff-card { padding: 28px; border-radius: 18px; background: var(--page); border: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.diff-card:nth-child(1) { background: var(--accent); color: #ffffff; border-color: var(--accent); }
.diff-card:nth-child(1) p, .diff-card:nth-child(1) .diff-points li { color: rgba(255, 255, 255, 0.82); }
.diff-card:nth-child(2) { background: var(--brand-green-bg); border-color: var(--brand-green-border); }
.diff-icon { width: 48px; height: 48px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; margin-bottom: 6px; }
.diff-card:nth-child(1) .diff-icon { background: rgba(145, 186, 84, 0.18); color: var(--brand-green-light); }
.diff-card:nth-child(2) .diff-icon { background: var(--card); color: var(--brand-green); }
.diff-icon .icon { width: 24px; height: 24px; }
.diff-card h3 { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.diff-card p { color: var(--text-muted); max-width: 52ch; }
.diff-points { list-style: none; display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.diff-points li { position: relative; padding-left: 28px; font-size: 14px; font-weight: 500; color: var(--text); }
.diff-points li::before {
  content: ''; position: absolute; left: 0; top: 2px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--brand-green-light) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233d2b3f' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 11px no-repeat;
}

.compare { border: 1px solid var(--border); border-radius: 16px; overflow: hidden; background: var(--card); }
.compare-row { display: grid; grid-template-columns: 1fr; gap: 4px; padding: 14px 18px; border-bottom: 1px solid var(--border); font-size: 14px; }
.compare-row:last-child { border-bottom: none; }
@media (min-width: 720px) { .compare-row { grid-template-columns: 160px 1fr 1fr; gap: 16px; align-items: center; } }
.compare-head { background: var(--surface-2); font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }
@media (max-width: 719px) { .compare-head { display: none; } }
.compare-row [role="rowheader"] { font-weight: 700; }
.compare-old { color: var(--text-muted); display: flex; gap: 8px; align-items: center; }
.compare-old::before { content: '×'; flex-shrink: 0; width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--subtle); color: var(--text-muted); font-weight: 700; }
.compare-new { color: var(--text); font-weight: 600; display: flex; gap: 8px; align-items: center; }
.compare-new::before {
  content: ''; flex-shrink: 0; width: 20px; height: 20px; border-radius: 50%;
  background: var(--brand-green-light) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233d2b3f' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 12px no-repeat;
}
@media (max-width: 719px) {
  .compare-old::after { content: ' (klassiek)'; font-size: 12px; }
}

/* ── Landing: small top navbar ────────────────────────────────────────────── */
/* Sticky, same purple as the hero so it blends in at the top. Section links from 768px; below that logo + Inloggen. */

.page-landing { --top-nav-h: 56px; padding-top: var(--top-nav-h); }
.top-nav { position: fixed; top: 0; left: 0; right: 0; z-index: var(--z-nav); background: var(--accent); border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
.top-nav-inner { display: flex; align-items: center; gap: 16px; height: var(--top-nav-h); max-width: 1120px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 768px) { .top-nav-inner { padding: 0 24px; } }
.top-brand { display: inline-flex; border-radius: 6px; }
.top-brand img { display: block; height: 24px; width: auto; }
.top-links { display: none; gap: 2px; margin-left: auto; }
@media (min-width: 1200px) { .top-links { display: flex; } }
.top-links a, .top-login, .top-signin {
  display: inline-flex; align-items: center; height: 36px; padding: 0 12px; border-radius: 999px;
  font-size: 14px; font-weight: 500; text-decoration: none; white-space: nowrap;
  transition: background-color 150ms var(--ease-out), color 150ms var(--ease-out);
}
.top-links a, .top-signin { color: rgba(255, 255, 255, 0.78); }
.top-signin { margin-left: auto; color: #ffffff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4); padding: 0 16px; }
@media (min-width: 1200px) { .top-signin { margin-left: 8px; } }
.top-links a[aria-current="true"] { color: #ffffff; background: rgba(255, 255, 255, 0.14); }
.top-login { padding: 0 16px; background: var(--brand-green-light); color: var(--accent); font-weight: 600; }
.top-login-long { display: none; }
@media (min-width: 560px) { .top-login-long { display: inline; } .top-login-short { display: none; } }
@media (hover: hover) and (pointer: fine) {
  .top-links a:hover, .top-signin:hover { color: #ffffff; background: rgba(255, 255, 255, 0.1); }
  .top-login:hover { background: #ffffff; }
}
.top-login:active { transform: scale(0.97); }

/* "Wat onderscheidt ons?" on the brand purple: both cards and the comparison share one translucent
   surface, white text, and the brand green as the single highlight (icons, checks, LeadMe column). */
.section-purple { background: var(--accent); color: #ffffff; }
.section-purple .eyebrow { color: var(--brand-green-light); }
.section-purple .section-heading { color: #ffffff; }
.section-purple .diff-card,
.section-purple .diff-card:nth-child(1),
.section-purple .diff-card:nth-child(2) { background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.12); color: #ffffff; }
.section-purple .diff-card .diff-icon,
.section-purple .diff-card:nth-child(1) .diff-icon,
.section-purple .diff-card:nth-child(2) .diff-icon { background: var(--brand-green-light); color: var(--accent); }
.section-purple .diff-card h3 { color: #ffffff; }
.section-purple .diff-card p { color: rgba(255, 255, 255, 0.74); }
.section-purple .diff-points li,
.section-purple .diff-card:nth-child(1) .diff-points li { color: #ffffff; }

.section-purple .compare { background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.12); }
.section-purple .compare-row { border-bottom-color: rgba(255, 255, 255, 0.1); }
.section-purple .compare-head { background: rgba(0, 0, 0, 0.16); color: rgba(255, 255, 255, 0.6); }
.section-purple .compare-head [role="columnheader"]:last-child { color: var(--brand-green-light); }
.section-purple .compare-row [role="rowheader"] { color: #ffffff; }
.section-purple .compare-old { color: rgba(255, 255, 255, 0.6); }
.section-purple .compare-old::before { background: rgba(255, 255, 255, 0.1); color: rgba(255, 255, 255, 0.6); }
.section-purple .compare-new { color: #ffffff; }

/* ── Landing: account request form ─────────────────────────────────────────── */

.request-section { background: var(--accent); color: #ffffff; }
.request-section .eyebrow { color: var(--brand-green-light); }
.request-section .section-heading { color: #ffffff; }
.request-layout { display: grid; gap: 40px; align-items: center; }
@media (min-width: 960px) { .request-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 520px); gap: 64px; } }
.request-lead { color: rgba(255, 255, 255, 0.78); max-width: 46ch; margin-top: 4px; }
.request-points { list-style: none; display: flex; flex-direction: column; gap: 12px; margin-top: 24px; }
.request-points li { display: flex; align-items: center; gap: 12px; font-weight: 500; }
.request-points .icon, .request-done-icon .icon { width: 14px; height: 14px; stroke-width: 3.5; }
.request-points .icon {
  box-sizing: content-box; padding: 4px; border-radius: 50%; flex-shrink: 0;
  background: var(--brand-green-light); color: var(--accent);
}
.request-card { background: var(--card); color: var(--text); border-radius: 18px; padding: 24px; }
@media (min-width: 768px) { .request-card { padding: 32px; } }
.request-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .request-grid { grid-template-columns: 1fr 1fr; } .request-wide { grid-column: 1 / -1; } }
.request-card textarea { resize: vertical; min-height: 88px; }
.request-card .alert { margin-top: 16px; }
.request-submit { margin-top: 20px; height: 48px; font-size: 15px; }
.request-note { margin-top: 12px; font-size: 12px; color: var(--text-muted); text-align: center; }
/* Honeypot: off-screen for people, still filled in by naive bots. */
.request-trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.request-done { text-align: center; padding: 24px 8px; display: flex; flex-direction: column; align-items: center; gap: 10px; outline: none; }
.request-done-icon { width: 56px; height: 56px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--brand-green-bg); color: var(--brand-green); }
.request-done-icon .icon { width: 26px; height: 26px; stroke-width: 3; }
.request-done h3 { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.request-done p { color: var(--text-muted); max-width: 36ch; }
.request-done:not([hidden]) { transition: opacity 250ms var(--ease-out), transform 250ms var(--ease-out); }
@starting-style { .request-done:not([hidden]) { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { @starting-style { .request-done:not([hidden]) { transform: none; } } }

.login-request { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); text-align: center; font-size: 14px; color: var(--text-muted); }
.login-request a { color: var(--accent); font-weight: 600; text-underline-offset: 2px; }

/* ── Admin: account requests ───────────────────────────────────────────────── */

.requests-card { margin-bottom: var(--space-5); }
.requests-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; }
.requests-head .card-title { display: flex; align-items: center; gap: 8px; }
.requests-toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted); cursor: pointer; min-height: 44px; }
.request-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 12px 24px; padding: var(--space-3) 0; border-top: 1px solid var(--border); }
.request-main { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.request-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.request-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--text-muted); overflow-wrap: anywhere; }
.request-meta a { color: var(--accent); text-underline-offset: 2px; }
.request-message { font-size: 14px; color: var(--text); background: var(--subtle); border-radius: var(--radius); padding: 10px 12px; white-space: pre-line; overflow-wrap: anywhere; }
.requests-empty { padding-top: var(--space-3); border-top: 1px solid var(--border); font-size: 14px; }

/* ── Credits ───────────────────────────────────────────────────────────────── */

[data-section-tone="credits"] .title-icon { background: var(--brand-green-bg); color: var(--brand-green); }
.nav-count-credits { background: var(--brand-green-light); color: var(--accent); }
.credit-balance { display: flex; align-items: center; gap: var(--space-4); }
.credit-amount { font-size: 32px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.credit-amount span { font-size: 16px; font-weight: 500; color: var(--text-muted); letter-spacing: 0; }
.credit-rules { list-style: none; display: grid; gap: 10px; padding: var(--space-4); border-radius: var(--radius-lg, 14px); background: var(--brand-green-bg); border: 1px solid var(--brand-green-border); }
@media (min-width: 768px) { .credit-rules { grid-template-columns: 1fr 1fr; } }
.credit-rules li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.5; }
.credit-rules .icon { width: 18px; height: 18px; flex-shrink: 0; margin-top: 2px; color: var(--brand-green); }
.credit-heading { margin-top: var(--space-3); }
.packs { display: grid; gap: var(--space-3); grid-template-columns: 1fr; }
@media (min-width: 768px) { .packs { grid-template-columns: repeat(3, 1fr); } }
.pack-group-title { font-size: 16px; font-weight: 600; margin-top: var(--space-2); }
.pack-group-intro { font-size: 14px; margin-top: calc(var(--space-2) - var(--space-5)); }
.clients-section { display: flex; flex-direction: column; gap: var(--space-3); margin-top: var(--space-5); }
.clients-section-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.clients-section-head .section-title { display: flex; align-items: center; gap: 4px; }
.filter-count { margin-left: 6px; font-size: 12px; color: var(--text-muted); }
.pay-cell .badge { margin-bottom: 4px; }
.pay-detail { display: block; font-size: 12px; line-height: 1.5; color: var(--text-muted); }
/* Admin client list: fits the page width without sideways scrolling. */
.clients-table th, .clients-table td { padding: 12px 10px; vertical-align: top; }
.clients-table th:first-child, .clients-table td:first-child { padding-left: 16px; }
.clients-table th:last-child, .clients-table td:last-child { padding-right: 16px; }
.clients-table .client-cell { min-width: 0; align-items: flex-start; }
.clients-table .client-email { display: block; overflow-wrap: anywhere; }
.client-status { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; margin-top: 6px; font-size: 12px; }
.clients-table .row-actions { flex-wrap: wrap; white-space: normal; justify-content: flex-end; }
.clients-table .client-credits { font-size: 15px; font-weight: 600; }
.client-row.is-open td { border-bottom-color: transparent; }
.client-toggle .chevron { width: 14px; height: 14px; margin-left: 2px; transition: transform 150ms var(--ease-out); }
.client-toggle[aria-expanded="true"] .chevron { transform: rotate(180deg); }
.client-details td { padding-top: 0; background: var(--surface-2); }
.client-details-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding: 12px 0 4px 46px; }
.client-stats { display: flex; flex-wrap: wrap; gap: 8px 28px; }
.client-stat { display: flex; flex-direction: column; }
.client-stat-value { font-size: 15px; font-weight: 600; }
.client-stat-label { font-size: 12px; color: var(--text-muted); }
.client-details-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; font-size: 12px; }
@media (prefers-reduced-motion: reduce) { .client-toggle .chevron { transition: none; } }
.plan-info { display: flex; flex-direction: column; gap: 4px; padding: var(--space-3) var(--space-4); border-radius: var(--radius-md, 10px); background: var(--subtle); font-size: 14px; overflow-wrap: anywhere; }
.stats-section { margin-top: var(--space-6, 32px); display: flex; flex-direction: column; gap: var(--space-3); }
.stats-4 { margin-bottom: 0; }
@media (min-width: 768px) { .stats-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stats-note { font-size: 12px; max-width: 75ch; }
/* Mobile lead detail is a focused view: no statistics underneath. */
@media (max-width: 1023px) { #view-leads:has(.review.show-detail) .stats-section { display: none; } }
.reply-state { align-items: center; flex-wrap: wrap; }
.reply-state > span { flex: 1 1 240px; }
/* The answer itself, under "Beantwoord": their words, without the quoted original. */
.reply-body { margin: var(--space-3, 12px) 0 0; padding: 12px 14px; border: 1px solid var(--border); border-left: 3px solid var(--success); border-radius: var(--radius); background: var(--card); }
.reply-body figcaption { font-size: 12px; color: var(--text-muted); }
.reply-body blockquote { margin: 6px 0 0; font-size: 14px; line-height: 1.6; color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; }
.followup-card { display: flex; flex-direction: column; gap: var(--space-3); border-color: var(--accent-border); }
.followup-title { font-size: 15px; font-weight: 600; }
.followup-status { display: flex; gap: 6px; align-items: flex-start; font-size: 13px; line-height: 1.5; }
.followup-status .icon { flex-shrink: 0; margin-top: 2px; }
.followup-status.is-error { color: var(--error); }
.field-hint.is-error { color: var(--error); }
.campaign-cost { border: 1px solid var(--border); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 12px; background: var(--surface-2); }
.campaign-cost-main { display: flex; align-items: center; gap: 8px; font-size: 16px; }
.campaign-cost-main .icon { color: var(--brand-green); flex: none; }
.campaign-cost-main strong { font-weight: 700; }
.campaign-cost-rows { margin: 0; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.campaign-cost-rows div { display: flex; justify-content: space-between; gap: 16px; }
.campaign-cost-rows dt { color: var(--text-muted); }
.campaign-cost-rows dd { margin: 0; font-variant-numeric: tabular-nums; }
.campaign-cost-after { border-top: 1px solid var(--border); padding-top: 6px; margin-top: 2px; font-weight: 600; }
.campaign-cost-after dt { color: var(--text); }
.campaign-cost-note { margin: 0; font-size: 13px; line-height: 1.5; color: var(--text-muted); }
.campaign-cost.is-short { border-color: var(--error); background: var(--error-bg); }
.campaign-cost.is-short .campaign-cost-after, .campaign-cost.is-short .campaign-cost-note { color: var(--error); }
.campaign-cost.is-short .campaign-cost-after dt { color: var(--error); }
.followup-status.is-ok { color: var(--success); }
.followup-card textarea { width: 100%; min-height: 120px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); font: inherit; font-size: 15px; line-height: 1.6; resize: vertical; background: var(--card); color: var(--text); }
.followup-card textarea[readonly] { background: var(--surface-2); color: var(--text-muted); }
.followup-card .actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.plan-card {
  display: grid; gap: var(--space-5); padding: var(--space-5);
  background: var(--accent-subtle); border-color: var(--accent-border);
}
@media (min-width: 768px) { .plan-card { grid-template-columns: 1.3fr 1fr; align-items: center; padding: var(--space-6, 32px); } }
.plan-eyebrow { font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent-text); }
.plan-price { margin-top: 8px; font-size: 16px; color: var(--text-muted); display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.plan-price strong { font-size: 36px; font-weight: 800; letter-spacing: -0.02em; color: var(--text); line-height: 1.1; }
.plan-from, .plan-unit { font-size: 15px; }
.plan-text { margin-top: 10px; font-size: 15px; line-height: 1.6; color: var(--text-muted); max-width: 52ch; }
.plan-status { margin-top: 12px; display: flex; gap: 8px; align-items: flex-start; font-size: 14px; line-height: 1.5; color: var(--text); }
.plan-status .icon { flex-shrink: 0; margin-top: 3px; color: var(--success); }
.plan-side { display: flex; flex-direction: column; gap: var(--space-3); }
.plan-side .btn { align-self: stretch; }
.plan-benefits { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.plan-benefits li { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; line-height: 1.5; }
.plan-benefits .icon { flex-shrink: 0; margin-top: 3px; color: var(--brand-green); }
.plan-note { font-size: 12px; color: var(--text-muted); text-align: center; }
.pack { position: relative; padding: var(--space-5); display: flex; flex-direction: column; gap: 4px; }
.pack.is-popular { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.pack-flag { position: absolute; top: -11px; left: var(--space-5); padding: 2px 10px; border-radius: 999px; background: var(--accent); color: #ffffff; font-size: 12px; font-weight: 600; }
.pack-name { font-size: 14px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.pack-credits { font-size: 16px; }
.pack-credits strong { font-size: 32px; font-weight: 800; letter-spacing: -0.02em; }
.pack-price { font-size: 20px; font-weight: 700; margin-top: 4px; }
.pack-unit { font-size: 13px; margin-bottom: var(--space-3); }
.pack .btn { margin-top: auto; }
.pack-status { display: flex; gap: 6px; align-items: flex-start; font-size: 13px; line-height: 1.5; color: var(--text-muted); margin-bottom: var(--space-3); }
.pack-status .icon { flex-shrink: 0; margin-top: 3px; }
.pack-status.is-active { color: var(--success); }
.pack-status.is-warning { color: var(--warning); }
.pack-note { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.credit-desc { overflow-wrap: anywhere; }
.credit-plus { color: var(--success); font-weight: 600; }
.credit-minus { color: var(--text-muted); }
.credit-hint { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; line-height: 1.5; color: var(--text-muted); }
.credit-hint .icon { width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; color: var(--brand-green); }
.credit-hint.is-empty { color: var(--error); }
.credit-hint.is-empty .icon { color: var(--error); }
.credit-hint a { color: inherit; font-weight: 600; text-underline-offset: 2px; }
.regen-cost { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 12px; color: var(--text-muted); }
.regen-cost .icon { color: var(--brand-green); }

/* ── Landing: pricing ──────────────────────────────────────────────────────── */

.pricing-lead { max-width: 60ch; color: var(--text-muted); margin: -24px 0 40px; }
.price-grid { display: grid; gap: 20px; grid-template-columns: 1fr; align-items: stretch; }
@media (min-width: 860px) { .price-grid { grid-template-columns: repeat(3, 1fr); gap: 24px; } }
.price-group + .price-group { margin-top: 56px; }
.price-group-head { margin-bottom: 24px; }
.price-group-title { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.price-group-intro { margin-top: 4px; color: var(--text-muted); max-width: 60ch; }
.price-card.is-custom { border-style: dashed; }
.price-custom-text { font-size: 15px; line-height: 1.6; color: var(--text-muted); margin-top: 4px; max-width: 52ch; }
@media (min-width: 860px) {
  .price-card.is-custom { grid-column: 1 / -1; display: grid; grid-template-columns: 1.2fr 1fr; column-gap: 48px; align-items: start; }
  .price-card.is-custom .price-custom-main { grid-row: 1 / span 2; }
  .price-card.is-custom .price-points { margin: 0 0 20px; padding-top: 0; border-top: 0; }
}
.price-card {
  position: relative; display: flex; flex-direction: column; gap: 6px; padding: 28px;
  background: var(--card); border: 1px solid var(--border); border-radius: 18px;
}
.price-card.is-loading { min-height: 360px; background: var(--subtle); border-color: transparent; }
.price-card.is-popular { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 16px 40px rgba(61, 43, 63, 0.12); }
@media (min-width: 860px) { .price-card.is-popular { transform: translateY(-8px); } }
.price-flag { position: absolute; top: -12px; left: 28px; padding: 3px 12px; border-radius: 999px; background: var(--accent); color: #ffffff; font-size: 12px; font-weight: 600; }
.price-name { font-size: 14px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
.price-amount { font-size: 44px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; margin-top: 4px; }
.price-credits { font-size: 16px; color: var(--text); }
.price-credits strong { font-weight: 700; }
.price-per { font-size: 14px; color: var(--text-muted); display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.price-save { padding: 2px 8px; border-radius: 999px; background: var(--brand-green-bg); color: var(--brand-green); font-size: 12px; font-weight: 700; }
.price-points { list-style: none; display: flex; flex-direction: column; gap: 10px; margin: 18px 0 24px; padding-top: 18px; border-top: 1px solid var(--border); }
.price-points li { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; }
.price-points .icon { width: 16px; height: 16px; flex-shrink: 0; margin-top: 3px; color: var(--brand-green); stroke-width: 3; }
.price-card .btn { margin-top: auto; height: 48px; }

.credit-explain { margin-top: 64px; }
.credit-explain-title { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 24px; }
.credit-explain-grid { display: grid; gap: 24px 40px; grid-template-columns: 1fr; }
@media (min-width: 768px) { .credit-explain-grid { grid-template-columns: repeat(2, 1fr); } }
.credit-item, .credit-example { display: flex; gap: 16px; align-items: flex-start; }
.credit-item h4, .credit-example h4 { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.credit-item p, .credit-example p { font-size: 15px; line-height: 1.6; color: var(--text-muted); max-width: 52ch; }
.credit-item-icon { flex-shrink: 0; width: 44px; height: 44px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; background: var(--accent-subtle); color: var(--accent); }
.credit-item-icon .icon { width: 22px; height: 22px; }
.credit-example { margin-top: 32px; padding: 24px; border-radius: 16px; background: var(--brand-green-bg); border: 1px solid var(--brand-green-border); }
.credit-example .credit-item-icon { background: var(--card); color: var(--brand-green); }
.credit-example p { max-width: 72ch; color: var(--text); }

.price-vat, .pack-vat, .price-from { font-size: 14px; font-weight: 500; letter-spacing: 0; color: var(--text-muted); }
.price-note { margin-top: 24px; font-size: 14px; color: var(--text-muted); text-align: center; }

/* ── Site footer (landing + legal pages) ───────────────────────────────────── */

.site-footer { background: var(--card); border-top: 1px solid var(--border); padding: 48px 16px 32px; }
@media (min-width: 768px) { .site-footer { padding: 56px 24px 32px; } }
.site-footer-inner { max-width: 1120px; margin: 0 auto; display: grid; gap: 32px; grid-template-columns: 1fr; }
@media (min-width: 768px) { .site-footer-inner { grid-template-columns: 2fr 1fr 1fr; } }
.site-footer-brand p { margin-top: 12px; font-size: 14px; color: var(--text-muted); }
.site-footer-col h2 { font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 12px; }
.site-footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.site-footer-col a { display: inline-flex; align-items: center; min-height: 32px; font-size: 14px; color: var(--text); text-decoration: none; }
@media (hover: hover) and (pointer: fine) { .site-footer-col a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; } }
.site-footer-legal { max-width: 1120px; margin: 40px auto 0; padding-top: 20px; border-top: 1px solid var(--border); font-size: 12px; line-height: 1.6; color: var(--text-muted); }
.request-note a { color: inherit; text-underline-offset: 2px; }

/* ── Legal pages ───────────────────────────────────────────────────────────── */

.page-legal { background: var(--page); }
.legal-top { position: sticky; top: 0; z-index: var(--z-nav); background: var(--accent); }
.legal-top-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 56px; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 768px) { .legal-top-inner { padding: 0 24px; } }
.legal { max-width: 720px; margin: 0 auto; padding: 56px 16px 80px; }
@media (min-width: 768px) { .legal { padding: 72px 24px 96px; } }
.legal h1 { font-size: clamp(28px, 4vw, 40px); font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; }
.legal-meta { margin-top: 8px; font-size: 14px; color: var(--text-muted); }
.legal h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; margin: 40px 0 12px; scroll-margin-top: 72px; }
.legal p, .legal li { font-size: 16px; line-height: 1.7; color: var(--text); }
.legal p + p { margin-top: 12px; }
.legal ul { margin: 12px 0 0 20px; display: flex; flex-direction: column; gap: 8px; }
.legal a { color: var(--accent); font-weight: 500; text-underline-offset: 2px; }
.legal > p:first-of-type + p, .legal .legal-meta + p { margin-top: 24px; }
/* Demo page: a link to send to interested clients; the video is the page. */
.demo { max-width: 960px; margin: 0 auto; padding: 40px 16px 72px; }
@media (min-width: 768px) { .demo { padding: 64px 24px 96px; } }
.demo h1 { font-size: clamp(28px, 4vw, 40px); font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; text-wrap: balance; }
.demo-intro { max-width: 60ch; margin-top: 12px; font-size: 16px; line-height: 1.6; color: var(--text-muted); }
.demo-video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; margin-top: 32px; border-radius: var(--radius); background: var(--accent); }
.demo-note { margin-top: 8px; font-size: 14px; color: var(--text-muted); }
.demo-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; margin-top: 32px; }
.demo-cta-btn { height: 48px; padding: 0 24px; font-size: 16px; }
.demo-more { display: inline-flex; align-items: center; min-height: 44px; font-size: 16px; font-weight: 500; color: var(--accent); text-underline-offset: 2px; }
.price-incl { font-size: 13px; color: var(--text-muted); margin-top: -2px; }
.pack-incl { font-size: 13px; margin-top: -2px; }

/* ── Billing details ───────────────────────────────────────────────────────── */

.billing-card { margin-top: var(--space-2); }
.billing-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.billing-intro { margin: 4px 0 16px; font-size: 14px; }
.billing-grid { display: grid; gap: 16px; grid-template-columns: 1fr; margin-top: 8px; }
@media (min-width: 640px) { .billing-grid { grid-template-columns: 1fr 1fr; } .billing-wide { grid-column: 1 / -1; } }
.billing-grid select {
  width: 100%; height: 44px; padding: 0 36px 0 12px; font-family: var(--font); font-size: 16px; color: var(--text);
  background-color: var(--card); border: 1px solid var(--border-strong); border-radius: var(--radius); appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23566072' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.billing-grid select:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus-ring); }
[data-profile-error] { margin-top: 16px; }
.billing-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.billing-summary { font-style: normal; font-size: 14px; line-height: 1.7; color: var(--text); margin-top: 8px; }
#billingDialogIntro { font-size: 14px; color: var(--text-muted); margin-bottom: 8px; }

/* ── Mobile polish ─────────────────────────────────────────────────────────── */

/* Dialogs: header and buttons stay in view, only the content scrolls. */
dialog.modal[open] { display: flex; flex-direction: column; }
dialog.modal > form { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
dialog.modal .modal-body { overflow-y: auto; min-height: 0; overscroll-behavior: contain; }
dialog.modal .modal-header, dialog.modal .modal-footer { flex-shrink: 0; }
@media (max-width: 639px) {
  dialog.modal { width: calc(100% - 16px); max-height: calc(100dvh - 16px); }
  .modal-header { padding: 16px 16px 0; }
  .modal-body { padding: 12px 16px 16px; }
  .modal-footer { padding: 12px 16px 16px; border-top: 1px solid var(--border); }
  .modal-footer .btn { flex: 1 1 auto; justify-content: center; }
}

@media (max-width: 639px) {
  /* Header buttons share the width instead of stacking ragged. */
  .page-header .actions { width: 100%; }
  .page-header .actions .btn { flex: 1 1 0; justify-content: center; }

  /* Compact stat tiles: icon beside the number. */
  .stats { gap: 8px; }
  .stat { padding: 12px; flex-direction: row; align-items: center; gap: 10px; }
  .stat-icon { width: 32px; height: 32px; flex-shrink: 0; }
  .stat-label { font-size: 12px; }
  .stat-value { font-size: 20px; margin-top: 0; }

  /* Billing form: postcode and city side by side, the rest full width. */
  .billing-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 14px 12px; }
  .billing-grid > .field { grid-column: 1 / -1; }
  .billing-grid > .field:has(input[name="postal_code"]) { grid-column: 1; }
  .billing-grid > .field:has(input[name="city"]) { grid-column: 2; }

  /* Landing: "Voor wie?" as compact rows with the icon on the left. */
  .who-grid { gap: 10px; }
  .who-card { display: grid; grid-template-columns: 40px minmax(0, 1fr); column-gap: 14px; padding: 16px; }
  .who-card .who-icon { width: 40px; height: 40px; margin-bottom: 0; grid-row: span 2; }
}

/* Tables become stacked rows on small screens: no sideways scrolling. */
@media (max-width: 767px) {
  .contacts-card .table-wrap, #creditsRoot .table-wrap { overflow: visible; }
  .contacts-card thead, #creditsRoot thead { display: none; }
  .contacts-card table, .contacts-card tbody, #creditsRoot table, #creditsRoot tbody { display: block; }
  .contacts-card tr, #creditsRoot tbody tr {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: start;
    padding: 14px 16px; border-bottom: 1px solid var(--border);
  }
  .contacts-card td, #creditsRoot td { display: block; padding: 0; border: 0; min-width: 0; text-align: left; }
  .contacts-card td[colspan], #creditsRoot td[colspan] { grid-column: 1 / -1; }

  /* Contacts: name + status, then e-mail, then place + last mail, then actions. */
  .contacts-card td:nth-child(1) { grid-column: 1; grid-row: 1; }
  .contacts-card td:nth-child(4) { grid-column: 2; grid-row: 1; }
  .contacts-card td:nth-child(2) { grid-column: 1 / -1; font-size: 14px; overflow-wrap: anywhere; }
  .contacts-card td:nth-child(3) { grid-column: 1; font-size: 13px; color: var(--text-muted); }
  .contacts-card td:nth-child(5) { grid-column: 2; font-size: 13px; color: var(--text-muted); text-align: right; }
  .contacts-card td:nth-child(5)::before { content: 'Gemaild '; }
  .contacts-card td:nth-child(6) { grid-column: 1 / -1; margin-top: 4px; }
  .contacts-card td:nth-child(6) .row-actions { justify-content: flex-start; }

  /* Credit history: description + amount, then date + balance. */
  #creditsRoot td:nth-child(3) { grid-column: 1; grid-row: 1; font-weight: 500; }
  #creditsRoot td:nth-child(4) { grid-column: 2; grid-row: 1; text-align: right; font-size: 15px; }
  #creditsRoot td:nth-child(1) { grid-column: 1; grid-row: 2; font-size: 12px; color: var(--text-muted); }
  #creditsRoot td:nth-child(2) { display: none; }
  #creditsRoot td:nth-child(5) { grid-column: 2; grid-row: 2; font-size: 12px; color: var(--text-muted); text-align: right; }
  #creditsRoot td:nth-child(5)::before { content: 'saldo '; }
}
@media (max-width: 767px) {
  .contacts-card td.is-empty { display: none; }
}
@media (max-width: 639px) {
  /* Lead actions: approve across the full width, the rest in a tidy row below. */
  .actions.sticky-mobile { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .actions.sticky-mobile .spacer { display: none; }
  .actions.sticky-mobile #approveBtn { grid-column: 1 / -1; }
  .actions.sticky-mobile .btn { justify-content: center; padding-left: 8px; padding-right: 8px; min-width: 0; }
  /* Own rewrite instruction gets the full width, the button goes below it. */
  .regen-row { flex-wrap: wrap; }
  .regen-row input { flex: 1 1 100%; }
  .regen-row .btn { flex: 1 1 100%; justify-content: center; }
}

/* ── Favourites ────────────────────────────────────────────────────────────── */

.fav-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin: -6px -8px -6px 0;
  border: none; border-radius: 999px; background: transparent; color: var(--text-muted); cursor: pointer;
  transition: color 150ms var(--ease-out), background-color 150ms var(--ease-out), transform 120ms var(--ease-out);
}
.fav-btn .icon { width: 22px; height: 22px; }
.fav-btn[aria-pressed="true"] { color: #d99a00; }
.fav-btn[aria-pressed="true"] .icon { fill: currentColor; }
.fav-btn:active { transform: scale(0.92); }
.fav-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) { .fav-btn:hover { background: var(--subtle); color: #d99a00; } }
.fav-btn-sm { margin: 0; }
.fav-btn-sm .icon { width: 18px; height: 18px; }
.fav-mark { display: inline-flex; vertical-align: -2px; margin-right: 6px; color: #d99a00; }
.fav-mark .icon { fill: currentColor; }
.chip-fav .icon { color: #d99a00; fill: currentColor; margin-right: 2px; }
.fav-note { display: flex; flex-direction: column; gap: 6px; margin-top: var(--space-3); padding: 12px; border-radius: var(--radius); background: #fff8e6; border: 1px solid #f3dfa8; }
.fav-note label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text); }
.fav-note textarea {
  width: 100%; padding: 8px 10px; font-family: var(--font); font-size: 16px; line-height: 1.5; color: var(--text);
  background: var(--card); border: 1px solid var(--border-strong); border-radius: var(--radius); resize: vertical;
}
.fav-note textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus-ring); }
.fav-note-inline { display: block; margin-top: 4px; font-size: 13px; color: var(--text); background: #fff8e6; border-radius: 6px; padding: 4px 8px; }
@media (prefers-reduced-motion: reduce) { .fav-btn:active { transform: none; } }
/* Star in line with the score and status badges: same row height, still a 44px tap target. */
.lead-badges { align-items: center; }
.lead-badges .fav-btn { width: 44px; height: 44px; margin: -11px -10px -11px -6px; }
.lead-badges .fav-btn .icon { width: 20px; height: 20px; }

/* Notice above the actions when approving isn't possible yet. */
.approve-blocked { flex-basis: 100%; grid-column: 1 / -1; }
.approve-blocked a { font-weight: 600; }

/* Exclamation mark on the mailserver while it still has to be filled in. */
.nav-alert {
  display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; margin-left: 6px;
  border-radius: 50%; background: var(--warning); color: #ffffff; font-size: 12px; font-weight: 700; line-height: 1; vertical-align: 2px;
}
.nav-alert[hidden] { display: none; }
h2 .nav-alert { vertical-align: 3px; }

/* Terms checkbox in the welcome dialog. */
.terms-check { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.terms-check .check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; line-height: 1.5; color: var(--text); cursor: pointer; }
.terms-check input[type="checkbox"] { width: 20px; height: 20px; flex-shrink: 0; margin-top: 1px; accent-color: var(--accent); }
.terms-check a { color: var(--accent); font-weight: 600; text-underline-offset: 2px; }

/* Why each suggested search term fits. */
.term-why { flex-basis: 100%; margin-top: 4px; font-size: 13px; color: var(--text-muted); }
.term-why summary { cursor: pointer; display: inline-flex; align-items: center; min-height: 32px; font-weight: 500; color: var(--brand-green); }
.term-why ul { list-style: none; display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.term-why strong { color: var(--text); font-weight: 600; }

.estimate-credits { display: block; margin-top: 4px; color: var(--warning); font-weight: 500; }
.request-skipped { color: var(--warning); font-weight: 500; }

/* ── Domain check (Mailserver) ─────────────────────────────────────────────── */
.domain-check { margin-top: var(--space-4); padding-top: var(--space-4); border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.domain-check-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.domain-check-head h3 { font-size: 15px; font-weight: 600; }
.domain-summary { font-size: 14px; font-weight: 500; color: var(--text); }
.domain-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.domain-item { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: var(--radius); border: 1px solid var(--border); font-size: 14px; }
.domain-item p { margin-top: 2px; color: var(--text-muted); line-height: 1.5; }
.domain-item code { display: block; margin-top: 4px; font-size: 12px; color: var(--text-muted); overflow-wrap: anywhere; }
.domain-icon { flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; margin-top: 1px; }
.domain-icon .icon { width: 14px; height: 14px; stroke-width: 3; }
.domain-item.is-ok .domain-icon { background: var(--success-bg); color: var(--success); }
.domain-item.is-warn .domain-icon { background: var(--warning-bg); color: var(--warning); }
.domain-item.is-error .domain-icon { background: var(--error-bg); color: var(--error); }
.send-rhythm { margin-top: 4px; }

/* − / + around a number field (phones show no spinner arrows). */
.stepper { display: flex; align-items: stretch; }
.stepper input { height: auto; text-align: center; border-radius: 0; -moz-appearance: textfield; appearance: textfield; min-width: 0; }
.stepper input::-webkit-inner-spin-button, .stepper input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.stepper-btn {
  flex: 0 0 44px; display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0; color: var(--text); background: var(--card);
  border: 1px solid var(--border-strong); cursor: pointer; touch-action: manipulation;
  transition: background-color 150ms var(--ease-out), transform 100ms var(--ease-out);
}
.stepper-btn:first-child { border-right: none; border-radius: var(--radius) 0 0 var(--radius); }
.stepper-btn:last-child { border-left: none; border-radius: 0 var(--radius) var(--radius) 0; }
.stepper-btn:active { transform: scale(0.97); background: var(--subtle); }
.stepper-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; position: relative; z-index: 1; }
@media (hover: hover) and (pointer: fine) { .stepper-btn:hover { background: var(--subtle); } }
.stepper:has(input:focus) .stepper-btn { border-color: var(--accent); }

/* ── Onboarding questionnaire (/welkom) ─────────────────────────────────────── */

.page-onboarding { min-height: 100dvh; background: var(--page); }
.onb-header {
  position: sticky; top: 0; z-index: var(--z-sticky);
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
  padding: 12px 16px; background: var(--accent); color: var(--on-accent);
}
.onb-logo { height: 24px; width: auto; }
.onb-progress-wrap { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; width: min(220px, 50%); }
.onb-step-label { font-size: 12px; color: rgba(255, 255, 255, 0.8); }
.onb-progress { width: 100%; height: 4px; border-radius: 999px; background: rgba(255, 255, 255, 0.2); overflow: hidden; }
.onb-progress span {
  display: block; height: 100%; background: var(--brand-green-light); transform-origin: left; transform: scaleX(0);
  transition: transform 250ms var(--ease-out);
}

.onb-shell { width: 100%; max-width: 640px; margin: 0 auto; padding: 24px 16px 48px; }
@media (min-width: 768px) { .onb-shell { padding-top: 48px; } }
.onb-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px 16px; display: flex; flex-direction: column; gap: var(--space-5); }
@media (min-width: 768px) { .onb-card { padding: 32px; } }
.onb-title { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.onb-title:focus { outline: none; }
.onb-intro { margin-top: 4px; font-size: 14px; line-height: 1.6; color: var(--text-muted); max-width: 60ch; }
.onb-questions { display: flex; flex-direction: column; gap: var(--space-5); margin-top: var(--space-5); }
.onb-questions .field textarea { resize: none; overflow: hidden; field-sizing: content; min-height: 48px; }

/* Ja / Nee: the label is the question, the switch sits below it. */
.onb-choice { border: none; padding: 0; margin: 0; min-width: 0; }
.onb-choice legend { padding: 0; margin-bottom: 8px; font-size: 14px; font-weight: 500; line-height: 1.5; }
.onb-choice .segmented label { min-height: 44px; min-width: 72px; justify-content: center; font-size: 14px; touch-action: manipulation; }
.onb-choice .segmented input { position: absolute; opacity: 0; pointer-events: none; }
.onb-choice .segmented label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.onb-choice .field-hint { margin-top: 6px; display: block; }
.onb-followup { margin-top: var(--space-3); padding-left: var(--space-4); border-left: 2px solid var(--border); }

.onb-loading { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-muted); }
.onb-actions { display: flex; justify-content: space-between; gap: var(--space-3); padding-top: var(--space-4); border-top: 1px solid var(--border); }
.onb-actions .btn-primary { margin-left: auto; min-height: 44px; padding-inline: 24px; }
.onb-actions .btn { min-height: 44px; }
.onb-later { margin-top: 16px; text-align: center; font-size: 14px; }
@media (prefers-reduced-motion: reduce) { .onb-progress span { transition: none; } }
.onb-cta {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3);
  padding: 12px 14px; border-radius: var(--radius); background: var(--accent-subtle); font-size: 14px; color: var(--accent-text);
}

/* ── Guided tour ───────────────────────────────────────────────────────────── */

.tour-layer { position: fixed; inset: 0; z-index: var(--z-tour); }
/* Catches clicks on the page during the tour; a click on the ringed element is forwarded by tour.js. */
.tour-blocker { position: absolute; inset: 0; }
.tour-dim .tour-blocker { background: rgba(17, 24, 39, 0.55); }
.tour-clickable .tour-blocker { cursor: pointer; }
/* The ring: its huge shadow dims everything around the element. */
.tour-ring {
  position: fixed; left: 0; top: 0; pointer-events: none;
  border-radius: var(--radius); box-shadow: 0 0 0 2px var(--brand-green-light), 0 0 0 9999px rgba(17, 24, 39, 0.55);
}
.tour-card {
  position: fixed; display: flex; flex-direction: column; gap: 6px;
  padding: 16px 16px 12px; background: var(--card); border-radius: var(--radius-lg);
  box-shadow: 0 16px 48px rgba(17, 24, 39, 0.24);
}
.tour-card:focus { outline: none; }
.tour-in { animation: tour-in 180ms var(--ease-out); }
@keyframes tour-in { from { opacity: 0; transform: scale(0.97); } }
.tour-busy .tour-card { opacity: 0; }
.tour-still .tour-in { animation: none; }
.tour-count { font-size: 12px; color: var(--text-muted); }
.tour-title { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.tour-text { font-size: 14px; line-height: 1.6; color: var(--text); }
.tour-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.tour-nav { display: flex; gap: 8px; margin-left: auto; }
.tour-actions .btn { min-height: 40px; }
@media (pointer: coarse) { .tour-actions .btn { min-height: 44px; } }

/* ── Contact import ────────────────────────────────────────────────────────── */

.drop-zone {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 32px 16px; text-align: center;
  border: 1.5px dashed var(--border-strong); border-radius: var(--radius-lg); background: var(--surface-2);
  color: var(--text-muted); cursor: pointer; transition: border-color 150ms var(--ease-out), background-color 150ms var(--ease-out);
}
.drop-zone strong { color: var(--text); font-weight: 600; }
.drop-zone.is-over, .drop-zone:focus-within { border-color: var(--accent); background: var(--accent-subtle); }
@media (hover: hover) and (pointer: fine) { .drop-zone:hover { border-color: var(--accent); } }
.drop-icon .icon { width: 28px; height: 28px; color: var(--accent); }
.import-reading { display: flex; align-items: center; gap: 10px; padding: 24px 0; color: var(--text-muted); }
.import-file { font-size: 13px; color: var(--text-muted); overflow-wrap: anywhere; }
.import-stats { display: flex; flex-wrap: wrap; gap: 8px; }
.import-stat { padding: 6px 10px; border-radius: var(--radius); background: var(--subtle); font-size: 13px; color: var(--text-muted); }
.import-stat strong { color: var(--text); }
.import-stat.is-ok { background: var(--success-bg); color: var(--success); }
.import-stat.is-ok strong { color: var(--success); }
.import-table-wrap { overflow-x: auto; }
.import-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.import-table th { text-align: left; font-weight: 500; color: var(--text-muted); padding: 6px 8px; border-bottom: 1px solid var(--border); }
.import-table td { padding: 8px; border-bottom: 1px solid var(--border); color: var(--text); vertical-align: top; overflow-wrap: anywhere; }
.import-table td .muted { display: block; font-size: 12px; }
.import-more { font-size: 13px; margin-top: 6px; }
.import-mode { border: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.import-mode legend { font-size: 14px; font-weight: 500; color: var(--text); margin-bottom: 8px; }
.import-mode .toggle-card input { position: static; opacity: 1; width: 18px; height: 18px; margin: 2px 0 0; flex-shrink: 0; accent-color: var(--accent); }
.import-mode .toggle-card:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.import-cost-tag { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: var(--warning-bg); color: var(--warning); font-size: 12px; font-weight: 500; vertical-align: 1px; }
.import-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.import-all { min-height: 44px; color: var(--text); }
.import-search { flex: 1 1 160px; max-width: 260px; }
.import-scroll { max-height: min(50vh, 420px); overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.import-scroll .import-table th { position: sticky; top: 0; background: var(--card); z-index: 1; }
.import-table td:first-child, .import-table th:first-child { width: 36px; padding-right: 0; }
.import-table input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; }
.import-table tr.is-off td:not(:first-child) { opacity: 0.45; text-decoration: line-through; text-decoration-color: var(--border-strong); }
.sent-today { padding: 8px 12px; border-bottom: 1px solid var(--border); }
.sent-today .chip { min-height: 36px; }
.regen-cost strong { font-weight: 600; color: var(--text); }
.regen-cost.is-paid { color: var(--warning); }
.regen-cost.is-paid strong { color: var(--warning); }
.regen-cost.is-blocked { color: var(--error); }
.regen-cost.is-blocked strong { color: var(--error); }
.regen-meter { display: inline-flex; gap: 3px; margin-left: 8px; vertical-align: middle; }
.regen-meter i { width: 10px; height: 4px; border-radius: 2px; background: var(--brand-green-light); }
.regen-meter i.used { background: var(--border-strong); }
.offer-examples { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: -8px; font-size: 13px; }
.offer-examples .chip { min-height: 32px; }
@media (pointer: coarse) { .offer-examples .chip { min-height: 40px; } }

/* ── Landing: animations ──────────────────────────────────────────────────────
   Everything that moves only does so when motion is OK: either under .can-reveal (set by JS when
   prefers-reduced-motion is off) or inside a no-preference media query. Only transform/opacity move. */

/* Hero: the second line of the title arrives just after the first. */
@keyframes hero-line-in { from { opacity: 0; transform: translateY(10px); filter: blur(4px); } }
@media (prefers-reduced-motion: no-preference) {
  .hero-title span { animation: hero-line-in 600ms var(--ease-out) 250ms both; }
}

/* Next to the steps: a mail that writes itself and gets approved (driven by login.js). */
.write-demo-wrap { width: 100%; max-width: 460px; justify-self: center; }
/* Desktop: as tall as the four steps next to it; the mail text takes up the extra room. */
@media (min-width: 960px) {
  .write-demo-wrap { justify-self: end; align-self: stretch; display: flex; }
  .write-demo { display: flex; flex-direction: column; width: 100%; }
  .write-demo-inner { flex: 1; display: flex; flex-direction: column; }
  .write-demo-body { flex: 1; align-content: start; }
}
.write-demo { border-radius: 16px; overflow: hidden; background: var(--card); color: var(--text); font-size: 14px; box-shadow: 0 24px 56px rgba(61, 43, 63, 0.22); }
.write-demo-inner { padding: 16px 18px; }
.write-demo-row { display: flex; gap: 8px; padding-bottom: 8px; margin-bottom: 8px; border-bottom: 1px solid var(--border); min-width: 0; }
.write-demo-row > span:first-child { width: 78px; flex-shrink: 0; color: var(--text-muted); }
.write-demo-row > :last-child { min-width: 0; overflow-wrap: anywhere; }
.write-demo-row strong { font-weight: 600; min-height: 1.5em; }
.write-demo-body { display: grid; margin: 4px 0 14px; line-height: 1.55; white-space: pre-line; }
.write-demo-body > span { grid-area: 1 / 1; }
.write-demo-ghost { visibility: hidden; }
.write-demo .is-typing::after {
  content: ''; display: inline-block; width: 2px; height: 1.1em; margin-left: 1px; vertical-align: text-bottom;
  background: var(--accent); animation: caret 900ms steps(1) infinite;
}
@keyframes caret { 50% { opacity: 0; } }
.write-demo-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.write-demo-status { font-size: 13px; color: var(--text-muted); }
.write-demo-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 128px; height: 34px; padding: 0 14px;
  border-radius: 8px; background: var(--accent); color: var(--on-accent); font-size: 13px; font-weight: 600;
  transition: transform 120ms var(--ease-out), background-color 200ms var(--ease-out), color 200ms var(--ease-out);
}
.write-demo-btn .icon { width: 15px; height: 15px; stroke-width: 3; }
.write-demo-btn.is-pressed { transform: scale(0.94); }
.write-demo-btn.is-approved { background: var(--brand-green-light); color: var(--accent); }
/* The steps no longer stretch to match a tall stack next to them. */
/* Section after the steps: the three example mails side by side, full width. On desktop the row is
   pinned while scrolling brings mails 2 and 3 in (login.js sets .is-pinned and the track height). */
.mail-showcase-head { display: grid; gap: 16px 48px; margin-bottom: 40px; }
.mail-showcase-head .section-heading { margin-bottom: 0; }
.mail-showcase-text { color: var(--text-muted); max-width: 52ch; }
.mail-showcase-head .followup-chip { margin: 16px 0 0; }
.mail-row { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr); max-width: 480px; margin: 0 auto; }
.mail-row .mail-demo { display: flex; flex-direction: column; }
.mail-row .mail-demo-body { flex: 1; }
.mail-track.is-pinned .mail-row { position: sticky; }
.mail-dots { display: none; }
/* Narrow screens: swipe through the mails (native scrolling, snaps to each mail); the next one peeks in. */
@media (max-width: 959px) {
  .mail-row {
    display: flex; gap: 16px; max-width: none; margin: 0 -16px; padding: 8px 16px 40px;
    overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none;
  }
  .mail-row::-webkit-scrollbar { display: none; }
  .mail-row .mail-demo { flex: 0 0 88%; max-width: 440px; scroll-snap-align: center; }
  .mail-dots { display: flex; justify-content: center; gap: 8px; margin-top: -16px; }
  .mail-dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); transition: background-color 200ms var(--ease-out), transform 200ms var(--ease-out); }
  .mail-dots span.is-current { background: var(--accent); transform: scale(1.25); }
}
@media (max-width: 959px) and (min-width: 768px) { .mail-row { margin: 0 -24px; padding-left: 24px; padding-right: 24px; } }
@media (min-width: 960px) {
  .mail-showcase-head { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: end; margin-bottom: 56px; }
  .mail-row { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: none; align-items: stretch; zoom: 0.86; }
}

/* Steps: a number lights up once the travelling arrow has reached it. */
.step-num { transition: background-color 250ms var(--ease-out), color 250ms var(--ease-out); }
.step-num.is-reached { background: var(--brand-green-light); color: var(--accent); }

/* Reminder note next to the example mails. */
.followup-chip {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: fit-content; margin: 20px auto 0; padding: 8px 14px;
  border-radius: 999px; background: var(--brand-green-bg); border: 1px solid var(--brand-green-border);
  color: var(--text); font-size: 13px; font-weight: 500; line-height: 1.4;
}
.followup-chip .icon { width: 16px; height: 16px; color: var(--brand-green); }

/* Compare table: per row, the classic way gets crossed out, then the LeadMe check pops in. */
.compare-old > span { text-decoration: line-through; text-decoration-thickness: 1.5px; text-decoration-color: currentColor; }
.compare-row:nth-child(2) { --d: 300ms; }
.compare-row:nth-child(3) { --d: 380ms; }
.compare-row:nth-child(4) { --d: 460ms; }
.compare-row:nth-child(5) { --d: 540ms; }
.compare-row:nth-child(6) { --d: 620ms; }
.can-reveal .compare-old > span { transition: text-decoration-color 300ms var(--ease-out) var(--d, 0ms); }
.can-reveal .compare-new::before { transition: opacity 250ms var(--ease-out) calc(var(--d, 0ms) + 150ms), transform 250ms var(--ease-out) calc(var(--d, 0ms) + 150ms); }
.can-reveal .compare:not(.is-visible) .compare-old > span { text-decoration-color: transparent; }
.can-reveal .compare:not(.is-visible) .compare-new::before { opacity: 0; transform: scale(0.6); }

/* Difference cards: the line icons draw themselves (shapes carry pathLength="1"). */
.can-reveal .diff-icon .icon > * { stroke-dasharray: 1 1.1; stroke-dashoffset: 1.05; transition: stroke-dashoffset 800ms var(--ease-out) 250ms; }
.can-reveal .diff-icon .icon > :nth-child(2) { transition-delay: 350ms; }
.can-reveal .diff-icon .icon > :nth-child(3) { transition-delay: 450ms; }
.can-reveal .diff-card.is-visible .diff-icon .icon > * { stroke-dashoffset: 0; }

/* Prices: figures count up (login.js); they keep their final width meanwhile. */
[data-count] { display: inline-block; }

/* Price cards come in one by one, "Meest gekozen" last so the eye lands on it. */
.can-reveal .reveal-group .price-card:not(.is-loading) {
  opacity: 0; transform: translateY(16px);
  transition: opacity 500ms var(--ease-out), transform 500ms var(--ease-out);
}
.can-reveal .reveal-group .price-card:nth-child(3) { transition-delay: 80ms; }
.can-reveal .reveal-group .price-card.is-popular { transition-delay: 220ms; }
.can-reveal .reveal-group.is-visible .price-card { opacity: 1; transform: none; }
@media (min-width: 860px) { .can-reveal .reveal-group.is-visible .price-card.is-popular { transform: translateY(-8px); } }
/* Cards that arrive after the group is already in view (prices still loading) still animate in. */
@starting-style { .can-reveal .reveal-group.is-visible .price-card { opacity: 0; transform: translateY(16px); } }

/* Press feedback on the landing links that act like buttons. */
.scroll-cue { transition: transform 120ms var(--ease-out); }
.top-signin { transition: background-color 150ms var(--ease-out), color 150ms var(--ease-out), transform 120ms var(--ease-out); }
.scroll-cue:active, .top-signin:active { transform: scale(0.97); }

/* Request sent: the check circle pops and the check draws itself. */
.request-done:not([hidden]) .request-done-icon { transition: transform 300ms var(--ease-out) 80ms; }
.request-done:not([hidden]) .request-done-icon path { stroke-dasharray: 1 1.1; transition: stroke-dashoffset 450ms var(--ease-out) 200ms; }
@starting-style {
  .request-done:not([hidden]) .request-done-icon { transform: scale(0.8); }
  .request-done:not([hidden]) .request-done-icon path { stroke-dashoffset: 1.05; }
}

@media (prefers-reduced-motion: reduce) {
  .write-demo .is-typing::after { animation: none; }
  .scroll-cue:active, .top-signin:active { transform: none; }
  @starting-style { .request-done:not([hidden]) .request-done-icon { transform: none; } }
}

/* Settings: send a test mail to yourself or another address. */
.test-mail { margin-top: 8px; }
.test-mail-row { display: flex; gap: 8px; }
.test-mail-row input { flex: 1; min-width: 0; }
.test-mail-row .btn { flex-shrink: 0; }

/* Settings: example mail to a made-up business. */
.example-controls { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px 12px; }
.example-controls .field { flex: 1 1 260px; }
.example-controls .btn { margin-top: 26px; }
.example-mail { margin-top: 16px; border: 1px solid var(--border); border-radius: var(--radius-lg, 14px); background: var(--card); overflow: hidden; }
.example-mail[aria-busy="true"] { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.example-mail-head { display: flex; flex-direction: column; gap: 6px; padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2); font-size: 14px; }
.example-mail-head > div { display: flex; gap: 10px; min-width: 0; }
.example-mail-head .muted { width: 78px; flex-shrink: 0; }
.example-tag { margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: var(--subtle); color: var(--text-muted); font-size: 12px; font-weight: 500; }
.example-mail-body { padding: 16px; font-size: 15px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 599px) { .example-controls .btn { margin-top: 0; width: 100%; } }
.example-send { padding: 14px 16px 16px; border-top: 1px solid var(--border); background: var(--surface-2); }
