:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --ink: #101828;
  --muted: #667085;
  --line: #d9e0ea;
  --brand: #3157d5;
  --brand-dark: #2445b5;
  --aqua: #00d6bd;
  --aqua-dark: #00ad9c;
  --night: #080c10;
  --night-2: #0d1218;
  --landing-ink: #eaf2ff;
  --landing-muted: #8da0b8;
  --landing-line: rgba(255,255,255,.09);
  --ok: #067647;
  --bad: #b42318;
  --warn: #b54708;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

.landing {
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 12%, rgba(0,214,189,.13), transparent 28%),
    radial-gradient(circle at 82% 22%, rgba(81,116,255,.12), transparent 30%),
    linear-gradient(180deg, #080c10 0, #0d1218 690px, #f4f7fb 690px, #f4f7fb 100%);
  color: var(--landing-ink);
}
.landing-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(18px, 4vw, 52px);
  background: rgba(8,12,16,.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--landing-line);
}
.landing-logo {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--landing-ink);
  text-decoration: none;
  letter-spacing: .5px;
}
.landing-logo span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: #07100f;
  background: var(--aqua);
  font-weight: 900;
}
.landing-logo strong { font-size: 14px; text-transform: uppercase; letter-spacing: 1.8px; }
.landing-links {
  display: flex;
  align-items: center;
  gap: 26px;
}
.landing-links a {
  color: var(--landing-muted);
  text-decoration: none;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.1px;
}
.landing-links a:hover { color: var(--aqua); }
.landing .ghost {
  color: var(--landing-ink);
  border-color: rgba(255,255,255,.18);
  background: transparent;
}
.landing .ghost:hover { border-color: var(--aqua); color: var(--aqua); }
.landing .primary {
  color: #06110f;
  border-color: var(--aqua);
  background: var(--aqua);
  box-shadow: 0 14px 32px rgba(0,214,189,.2);
}
.landing .primary:hover { background: #3cebd7; }
.landing main {
  max-width: 1210px;
  margin: 0 auto;
  padding: 0 24px 58px;
}
.landing-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, .92fr);
  gap: 42px;
  align-items: center;
  padding: 84px 0 34px;
}
.hero-copy { min-width: 0; }
.landing-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  border: 1px solid rgba(0,214,189,.28);
  border-radius: 999px;
  padding: 6px 14px;
  color: var(--aqua);
  background: rgba(0,214,189,.08);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1.4px;
  text-transform: uppercase;
}
.landing-badge i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--aqua);
  box-shadow: 0 0 0 5px rgba(0,214,189,.13);
}
.landing-hero h1 {
  max-width: 780px;
  margin: 22px 0 18px;
  color: var(--landing-ink);
  font-size: clamp(38px, 5.3vw, 68px);
  line-height: .98;
  letter-spacing: 0;
}
.landing-hero p {
  margin: 0;
  max-width: 690px;
  color: var(--landing-muted);
  font-size: 18px;
  line-height: 1.68;
}
.landing-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 30px;
}
.landing-actions .primary,
.landing-actions .ghost {
  padding: 14px 22px;
  border-radius: 6px;
}
.hero-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}
.hero-trust span {
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 999px;
  padding: 7px 11px;
  color: #9fb0c7;
  background: rgba(255,255,255,.035);
  font-size: 12px;
  font-weight: 700;
}
.hero-product {
  position: relative;
  min-height: 455px;
  display: grid;
  align-items: center;
}
.mini-window {
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 12px;
  padding: 16px;
  background: linear-gradient(180deg, rgba(20,28,38,.96), rgba(13,18,24,.98));
  box-shadow: 0 28px 80px rgba(0,0,0,.42);
}
.mini-window-bar {
  display: flex;
  gap: 6px;
  padding: 4px 2px 16px;
}
.mini-window-bar span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255,255,255,.2);
}
.mini-window-bar span:first-child { background: #ff6868; }
.mini-window-bar span:nth-child(2) { background: #ffc857; }
.mini-window-bar span:nth-child(3) { background: var(--aqua); }
.mini-panel,
.mini-letter,
.mini-flow div {
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 8px;
  background: rgba(255,255,255,.045);
}
.mini-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
}
.mini-panel.active { border-color: rgba(0,214,189,.32); background: rgba(0,214,189,.08); }
.mini-panel small,
.mini-letter small {
  display: block;
  color: var(--landing-muted);
  font-size: 12px;
  margin-bottom: 6px;
}
.mini-panel strong { color: white; }
.mini-panel b { color: var(--aqua); white-space: nowrap; }
.mini-flow {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}
.mini-flow div { padding: 14px; }
.mini-flow strong { display: block; color: var(--aqua); font-size: 12px; margin-bottom: 6px; }
.mini-flow span { color: #d9e6f7; font-size: 13px; font-weight: 800; }
.mini-letter { padding: 18px; }
.mini-letter p { color: #dbe6f5; font-size: 14px; line-height: 1.55; }
.pipeline-band {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr;
  align-items: stretch;
  gap: 0;
  margin: 16px 0 70px;
  border: 1px solid var(--landing-line);
  border-radius: 10px;
  background: rgba(255,255,255,.035);
  overflow: hidden;
}
.pipe-item { padding: 22px; }
.pipe-item span {
  display: block;
  color: var(--aqua);
  font-size: 11px;
  font-weight: 900;
  margin-bottom: 10px;
}
.pipe-item strong { display: block; color: white; margin-bottom: 6px; }
.pipe-item small { color: var(--landing-muted); line-height: 1.45; }
.pipe-arrow {
  display: grid;
  place-items: center;
  min-width: 34px;
  color: rgba(0,214,189,.6);
  border-left: 1px solid var(--landing-line);
  border-right: 1px solid var(--landing-line);
}
.landing-section,
.demo-section,
.box-cta {
  color: var(--ink);
}
.landing-section {
  padding: 70px 0 0;
}
.section-kicker {
  color: var(--aqua-dark);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.section-head {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(300px, .55fr);
  gap: 28px;
  align-items: end;
  margin: 10px 0 26px;
}
.section-head h2,
.box-cta h2 {
  margin: 0;
  color: #101828;
  font-size: clamp(28px, 3.4vw, 44px);
  line-height: 1.05;
  letter-spacing: 0;
}
.section-head p,
.box-cta p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.feature-grid article,
.plan-card {
  border: 1px solid #d7deea;
  border-radius: 10px;
  background: white;
  box-shadow: 0 14px 34px rgba(16,24,40,.06);
}
.feature-grid article {
  min-height: 190px;
  padding: 24px;
}
.feature-grid span,
.plan-card > span {
  display: inline-block;
  margin-bottom: 14px;
  color: var(--aqua-dark);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}
.feature-grid h3 {
  margin: 0 0 10px;
  font-size: 20px;
}
.feature-grid p,
.plan-card p,
.plan-card li {
  color: var(--muted);
  line-height: 1.58;
}
.demo-section {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: 18px;
  padding-top: 76px;
}
.video-placeholder {
  min-height: 360px;
  display: grid;
  place-content: center;
  gap: 8px;
  text-align: center;
  border: 1px dashed #90a1b8;
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(0,214,189,.08), rgba(49,87,213,.08)),
    #ffffff;
}
.video-placeholder strong { font-size: 22px; }
.video-placeholder span { color: var(--muted); }
.screenshots {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
.screenshot-card {
  min-height: 110px;
  border: 1px solid #d7deea;
  border-radius: 10px;
  padding: 18px;
  background: white;
  box-shadow: 0 12px 28px rgba(16,24,40,.05);
}
.screenshot-card strong, .screenshot-card span { display: block; }
.screenshot-card strong { font-size: 18px; }
.screenshot-card span { margin-top: 7px; color: var(--muted); font-size: 13px; }
.parser-shot { background: linear-gradient(135deg, #ffffff 0%, #eefcf9 100%); }
.letters-shot { background: linear-gradient(135deg, #ffffff 0%, #eef3ff 100%); }
.account-shot { background: linear-gradient(135deg, #ffffff 0%, #fff7e8 100%); }
.pricing-section { padding-top: 80px; }
.landing-pricing {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.plan-card {
  position: relative;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.plan-card.featured {
  border-color: var(--aqua-dark);
  box-shadow: 0 18px 42px rgba(0,173,156,.16);
}
.plan-card > b {
  position: absolute;
  top: -12px;
  left: 24px;
  border-radius: 999px;
  padding: 5px 12px;
  color: #06110f;
  background: var(--aqua);
  font-size: 11px;
}
.plan-card h3 {
  margin: 0;
  font-size: 33px;
}
.plan-card h3 small {
  color: var(--muted);
  font-size: 13px;
}
.plan-card ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
  flex: 1;
}
.plan-card li {
  border-top: 1px solid #edf1f7;
  padding-top: 8px;
}
.box-cta {
  display: grid;
  grid-template-columns: minmax(0, .72fr) minmax(0, 1fr);
  gap: 26px;
  align-items: stretch;
  margin-top: 74px;
  padding: 34px;
  border: 1px solid rgba(0,214,189,.26);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(0,214,189,.1), rgba(49,87,213,.08)),
    #ffffff;
  box-shadow: 0 20px 46px rgba(16,24,40,.08);
}
.box-cta h2 { margin: 8px 0 12px; }
.box-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.box-options.single {
  grid-template-columns: minmax(260px, 420px);
  justify-content: end;
}
.box-options article {
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-width: 0;
  border: 1px solid #d7deea;
  border-radius: 10px;
  padding: 16px;
  background: rgba(255,255,255,.82);
}
.box-options strong { font-size: 17px; }
.box-options span {
  color: var(--brand-dark);
  font-size: 22px;
  font-weight: 900;
}
.box-options small {
  flex: 1;
  color: var(--muted);
  line-height: 1.45;
}

#app { display: flex; min-height: 100vh; }
.sidebar {
  width: 260px;
  position: fixed;
  inset: 0 auto 0 0;
  background: #101828;
  color: white;
  display: flex;
  flex-direction: column;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 22px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--brand);
  font-weight: 800;
}
.brand h1 { font-size: 15px; margin: 0; }
.brand p { font-size: 12px; color: #aeb8ca; margin: 2px 0 0; }
/* ── Navigation ─────────────────────────────────── */
.nav { padding: 10px 8px; display: grid; gap: 2px; }
.nav-group-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255,255,255,.3);
  padding: 14px 13px 6px;
}
.nav button {
  width: 100%;
  color: #94a3b8;
  background: transparent;
  border: 0;
  border-left: 3px solid transparent;
  border-radius: 0 7px 7px 0;
  padding: 10px 13px;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  transition: color .15s, background .15s, border-color .15s;
}
.nav button:hover {
  color: #e2e8f0;
  background: rgba(255,255,255,.06);
}
.nav button.active {
  color: white;
  background: rgba(79,131,247,.18);
  border-left-color: #4f83f7;
  font-weight: 600;
}
.nav-icon {
  width: 18px;
  text-align: center;
  font-size: 14px;
  flex-shrink: 0;
  opacity: .75;
}
.nav button.active .nav-icon,
.nav button:hover .nav-icon { opacity: 1; }
.license-box {
  margin-top: auto;
  padding: 14px 16px;
  color: #64748b;
  font-size: 11px;
  border-top: 1px solid rgba(255,255,255,.07);
  line-height: 1.5;
}

/* ── Topbar ──────────────────────────────────────── */
.main { margin-left: 260px; width: calc(100% - 260px); }
.topbar {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: white;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 5;
  gap: 16px;
}
.top-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.user-badge { color: #344054; font-size: 13px; font-weight: 700; }
.topbar h2 { margin: 0; font-size: 17px; font-weight: 700; flex-shrink: 0; }
.topbar p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }

/* ── Workflow stepper ────────────────────────────── */
.workflow-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  justify-content: center;
  overflow: hidden;
}
.workflow-bar.hidden { display: none; }
.ws {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: #94a3b8;
  white-space: nowrap;
  padding: 4px 8px;
  border-radius: 6px;
}
.ws .ws-num {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #94a3b8;
  font-size: 10px;
  font-weight: 800;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.ws.ws-done { color: var(--ok); }
.ws.ws-done .ws-num { background: #dcfce7; color: var(--ok); }
.ws.ws-active { color: var(--brand); }
.ws.ws-active .ws-num { background: var(--brand); color: white; }
.ws-sep { color: #cbd5e1; font-size: 12px; }

/* ── Input focus states ──────────────────────────── */
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(49,87,213,.1);
}
input:hover:not(:focus), select:hover:not(:focus) { border-color: #93ade8; }

/* ── Settings section labels ─────────────────────── */
.settings-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  padding: 16px 18px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.settings-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
.settings-label:first-child { padding-top: 18px; }

/* ── Empty states ────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 40px 24px;
  color: var(--muted);
}
.empty-state .es-icon {
  font-size: 28px;
  margin-bottom: 12px;
  opacity: .5;
}
.empty-state h4 {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 700;
  color: #475467;
}
.empty-state p {
  margin: 0 0 16px;
  font-size: 13px;
  line-height: 1.5;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}

/* ── Panel head — improved ───────────────────────── */
.panel-head h3 { font-size: 15px; font-weight: 700; }
.panel-head p { font-size: 12.5px; }

/* ── Improved .view padding ──────────────────────── */
.view { display: none; padding: 24px; }
.view.active { display: block; }
.grid { display: grid; gap: 18px; }
.grid.two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.spaced { margin-top: 18px; }
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.panel-head { padding: 18px 18px 12px; border-bottom: 1px solid var(--line); }
.panel-head h3 { margin: 0; font-size: 16px; }
.panel-head p { margin: 6px 0 0; color: var(--muted); font-size: 13px; line-height: 1.4; }
.panel-head.row { display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; padding: 18px; }
.form-grid.compact { padding: 12px 0; grid-template-columns: 160px; }
label { display: grid; gap: 6px; color: #344054; font-size: 13px; font-weight: 600; }
input, select, textarea {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  padding: 9px 10px;
  background: white;
  color: var(--ink);
}
textarea { resize: vertical; line-height: 1.45; }
.check { display: flex; align-items: center; gap: 9px; grid-column: 1 / -1; }
.check input { width: auto; }
.legal { line-height: 1.45; }
.primary, .ghost {
  border: 1px solid var(--brand);
  border-radius: 7px;
  padding: 10px 13px;
  font-weight: 700;
}
.primary { color: white; background: var(--brand); margin: 0 18px 18px; }
.primary:hover { background: var(--brand-dark); }
.ghost { color: var(--brand); background: white; }
.ghost.danger { color: var(--bad); border-color: var(--bad); }
.ghost.danger:hover { background: #fff0f0; }
.small { padding: 7px 10px; font-size: 12px; }
.no-margin { margin: 0; }
button:disabled { opacity: .58; cursor: not-allowed; }
.actions { display: flex; gap: 10px; padding: 0 18px 18px; }
.actions .primary, .actions .ghost { margin: 0; }
.status { min-height: 22px; color: var(--muted); padding: 0 18px 18px; font-size: 13px; white-space: pre-wrap; }
.status.ok { color: var(--ok); }
.status.bad { color: var(--bad); }
.smtp-extra { padding: 0 18px 18px; display: grid; gap: 12px; }
.smtp-extra-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.smtp-extra-head h4 { margin: 0; font-size: 14px; }
.smtp-account-list { display: grid; gap: 12px; }
.smtp-empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 12px;
  color: var(--muted);
  font-size: 13px;
}
.smtp-account-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
  overflow: hidden;
}
.smtp-account-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}
.smtp-active-row { grid-column: auto; margin-left: auto; }
.smtp-account-grid { padding: 12px; }
.counter {
  min-width: 34px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #eef2ff;
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 800;
}
.dataset-list, .letters-list, .history-list, .send-preview {
  padding: 14px 18px 18px;
  display: grid;
  gap: 10px;
}
.dataset-card, .letter-card, .history-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcff;
}
.dataset-card strong, .letter-card strong { display: block; margin-bottom: 5px; }
.dataset-card .download-link {
  display: inline-block;
  margin-left: 8px;
  text-decoration: none;
}
.recipient-card { padding: 10px; }
.meta { color: var(--muted); font-size: 12px; line-height: 1.45; }
.empty {
  color: var(--muted);
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fbfcff;
}
.table-wrap { overflow: auto; max-height: calc(100vh - 190px); }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: #f8fafc; color: #475467; position: sticky; top: 0; z-index: 1; }
td { max-width: 280px; overflow-wrap: anywhere; }
.letter-card textarea {
  margin: 8px 0 0;
  width: 100%;
  min-height: 140px;
}
.letter-card input { margin-top: 8px; }
.letter-card .remove-letter {
  margin-top: 10px;
}
.letter-filters-block {
  padding: 14px 18px 6px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin: 4px 0 8px;
}
.letter-filters-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.letter-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}
.check-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--panel);
  font-size: 13px;
  color: var(--ink);
  cursor: pointer;
  transition: background .15s, border-color .15s;
  user-select: none;
}
.check-pill:hover { border-color: var(--brand); }
.check-pill input[type="checkbox"] { accent-color: var(--brand); width: 14px; height: 14px; margin: 0; }
.check-pill:has(input:checked) {
  background: #eef1ff;
  border-color: var(--brand);
  color: var(--brand);
  font-weight: 600;
}
.letter-filter-stats {
  font-size: 12px;
  color: var(--muted);
  padding-bottom: 4px;
  line-height: 1.6;
}
.pill {
  display: inline-block;
  padding: 3px 7px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475467;
  font-size: 12px;
  font-weight: 700;
}
.pill.pill-sent { background: #dcfce7; color: #166534; }
.pill.pill-demo { background: #e0f2fe; color: #075985; }
.pill.pill-error { background: #fee2e2; color: #991b1b; }
.pill.pill-pending { background: #f1f5f9; color: #64748b; }
.pill.pill-sending { background: #fef9c3; color: #854d0e; }
.pill.pill-stopped { background: #fef3c7; color: #92400e; }
.pill.pill-opened { background: #d1fae5; color: #065f46; }
.pill.pill-unread { background: #f1f5f9; color: #64748b; }
.pill.pill-replied { background: #ede9fe; color: #5b21b6; font-weight: 600; }

.reply-list { display: flex; flex-direction: column; gap: 10px; padding: 10px 0; }
.reply-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  background: var(--surface);
  transition: border-color .15s, background .15s;
}
.reply-card.unread {
  border-color: #6366f1;
  background: linear-gradient(0deg, rgba(99,102,241,.04), rgba(99,102,241,.04));
  box-shadow: 0 0 0 2px rgba(99,102,241,.08);
}
.reply-card .reply-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 4px;
}
.reply-card .reply-from { font-weight: 600; color: var(--ink); font-size: 14px; }
.reply-card .reply-date { color: var(--muted); font-size: 12px; white-space: nowrap; }
.reply-card .reply-subject { font-size: 13px; color: var(--ink); margin-bottom: 6px; }
.reply-card .reply-snippet {
  font-size: 12.5px;
  color: var(--muted);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 4.5em;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  margin-bottom: 8px;
}
.reply-card .reply-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.status-msg.status-ok { color: #065f46; background: #d1fae5; padding: 6px 10px; border-radius: 6px; }
.status-msg.status-error { color: #991b1b; background: #fee2e2; padding: 6px 10px; border-radius: 6px; }

.history-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 0 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
}
.history-subject {
  color: var(--ink);
  font-size: 13px;
  margin-left: 4px;
}
.history-date {
  color: var(--muted);
  font-size: 12px;
  margin-left: 4px;
}
.history-error {
  color: var(--bad);
  font-size: 12px;
}
.history-card.clickable {
  cursor: pointer;
  transition: background .15s, box-shadow .15s;
  user-select: none;
}
.history-card.clickable:hover {
  background: #f0f4ff;
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(49,87,213,.12);
}
.history-error-detail {
  color: var(--bad);
  font-size: 13px;
  word-break: break-all;
}
.history-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.history-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.filter-btn {
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  transition: background .15s, color .15s, border-color .15s;
}
.filter-btn:hover { border-color: var(--brand); color: var(--brand); }
.filter-btn.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}
.history-pager { padding: 12px 0 4px; }
.modal-wide { max-width: 600px !important; }
.pager {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--muted);
}
.detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.detail-table th {
  text-align: left;
  color: var(--muted);
  font-weight: 600;
  padding: 8px 12px 8px 0;
  white-space: nowrap;
  vertical-align: top;
  width: 110px;
}
.detail-table td {
  padding: 8px 0;
  word-break: break-word;
}
.history-detail-content {
  padding: 4px 0 12px;
}

/* ── License Gate ─────────────────────────────────────────── */
.license-gate-card { max-width: 500px; }

.lg-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 22px 24px 20px;
  border-bottom: 1px solid var(--line);
}
.lg-head-icon { font-size: 28px; line-height: 1; flex-shrink: 0; }
.lg-head-title { font-size: 17px; font-weight: 700; color: var(--ink); }
.lg-head-sub { font-size: 12px; color: var(--muted); margin-top: 3px; line-height: 1.4; }

.lg-block {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}
.lg-block:last-of-type { border-bottom: 0; }

.lg-block-label {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}
.lg-num {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.lg-code-box {
  background: var(--night-2);
  border: 1.5px solid #1e3553;
  border-radius: 10px;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.lg-code-caption {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #5eead4;
  font-weight: 600;
}
.lg-code-value {
  font-family: "Cascadia Code", "Fira Code", Consolas, monospace;
  color: #aef0e0;
  font-size: 20px;
  letter-spacing: 3px;
  word-break: break-all;
  line-height: 1.3;
  background: none;
  padding: 0;
}

.lg-copy-btn {
  width: 100%;
  padding: 11px;
  background: #0f1f38;
  border: 1.5px solid #2d5a9e;
  color: #93c5fd;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.lg-copy-btn:hover { background: #172d50; border-color: var(--brand); color: #fff; }
.lg-copy-btn.lg-copied { background: #052e16; border-color: #15803d; color: #86efac; }

.lg-copy-done {
  font-size: 12.5px;
  color: var(--ok);
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 7px;
  padding: 9px 12px;
  line-height: 1.55;
}

.lg-divider {
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  padding: 10px 24px;
  background: var(--bg);
  letter-spacing: 0.4px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.lg-key-hint {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}
.lg-key-sample {
  font-family: "Cascadia Code", "Fira Code", Consolas, monospace;
  background: #eef2ff;
  color: var(--brand);
  border: 1px solid #c7d2fe;
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 11px;
}

.lg-key-input {
  width: 100%;
  font-family: "Cascadia Code", "Fira Code", Consolas, monospace;
  font-size: 13px;
  padding: 11px 14px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  letter-spacing: 0.3px;
  transition: border-color .15s, box-shadow .15s;
}
.lg-key-input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(49,87,213,.1);
}
.lg-key-input::placeholder {
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  font-size: 13px;
  color: #aab0bc;
  letter-spacing: 0;
}

.lg-terms {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 12.5px;
  color: var(--muted);
  cursor: pointer;
  padding: 10px 13px;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  line-height: 1.5;
  transition: border-color .15s, background .15s;
}
.lg-terms:hover { border-color: var(--brand); background: #eef1fd; }
.lg-terms input[type="checkbox"] {
  margin-top: 1px;
  flex-shrink: 0;
  width: 15px;
  height: 15px;
  cursor: pointer;
  accent-color: var(--brand);
}
.lg-terms.lg-terms-error {
  border-color: var(--bad);
  background: #fff5f5;
  animation: lg-shake .35s ease;
}
@keyframes lg-shake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-6px); }
  60%       { transform: translateX(6px); }
  80%       { transform: translateX(-3px); }
}

.lg-activate-btn {
  width: 100%;
  padding: 13px;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
}
.lg-activate-btn:hover { background: var(--brand-dark); }
.lg-activate-btn:active { transform: scale(.98); }
.lg-activate-btn:disabled { background: #93a3c0; cursor: not-allowed; transform: none; }

/* Status inside license gate */
.lg-block .status {
  min-height: 0;
  padding: 0;
  font-size: 13px;
}
.lg-block .status:not(:empty) {
  padding: 9px 12px;
  border-radius: 7px;
}
.lg-block .status.bad {
  background: #fff1f1;
  border: 1px solid #fecaca;
}
.lg-block .status.ok {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
}
.license-current {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
  display: flex;
  gap: 8px;
  align-items: center;
}
.license-active {
  color: var(--ok);
  font-weight: 600;
}
.license-inactive {
  color: var(--bad);
  font-weight: 600;
}

.send-log-pre {
  background: #0d1218;
  color: #c8d8e8;
  font-family: "Cascadia Code", "Fira Code", Consolas, monospace;
  font-size: 12px;
  line-height: 1.6;
  padding: 14px 16px;
  border-radius: 8px;
  max-height: 320px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
  margin: 0;
}

.send-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcff;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  transition: opacity .2s, background .2s;
}
.send-card.excluded {
  opacity: .45;
  background: #f8f8f8;
}
.send-card.sent-ok { border-left: 3px solid #22c55e; }
.send-card.sent-demo { border-left: 3px solid #38bdf8; }
.send-card.sent-error { border-left: 3px solid #ef4444; }
.send-card .send-card-check {
  margin-top: 2px;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  accent-color: var(--brand);
}
.send-card .send-card-body { flex: 1; min-width: 0; }
.send-card .send-card-body strong { display: block; margin-bottom: 3px; }
.send-card .send-card-body .meta { margin-top: 2px; }
.send-card .send-card-status { flex-shrink: 0; }
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 18px;
}
.pricing-grid .primary { align-self: flex-start; }
.compact-pricing { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.price-card {
  min-height: 190px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcff;
}
.price-card.selected {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(49, 87, 213, .12);
}
.price-card h4 { margin: 9px 0 4px; font-size: 15px; }
.price-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.4; }
.price-card ul { margin: 0; padding-left: 18px; color: #344054; font-size: 13px; line-height: 1.6; }
.price { display: block; font-size: 23px; margin-top: 6px; }
.price small { color: var(--muted); font-size: 12px; font-weight: 600; }
.strategy-list {
  display: grid;
  gap: 10px;
  padding: 18px;
}
.strategy-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
  background: #fbfcff;
}
.strategy-item.warn { border-color: #fedf89; background: #fffcf5; }
.strategy-item strong { display: block; margin-bottom: 5px; }
.strategy-item span { color: var(--muted); font-size: 13px; line-height: 1.45; }
.summary-box {
  display: grid;
  gap: 4px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}
.summary-box strong { font-size: 18px; }
.summary-box span { color: var(--muted); font-size: 13px; }
.usage-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 18px;
}
.usage-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcff;
}
.usage-card strong, .usage-card span { display: block; }
.usage-card span { margin-top: 5px; color: var(--muted); font-size: 12px; }
.meter {
  height: 7px;
  margin-top: 11px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}
.meter i {
  display: block;
  height: 100%;
  background: var(--brand);
}
.inline-action {
  display: flex;
  align-items: center;
  gap: 8px;
}
.inline-action input {
  width: 180px;
  padding: 7px 9px;
}
.modal {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  background: rgba(16, 24, 40, .52);
  z-index: 100;
  padding: 24px;
}
.modal.open { display: grid; }
.modal-card {
  width: min(720px, 100%);
  background: white;
  border-radius: 10px;
  border: 1px solid var(--line);
  box-shadow: 0 24px 80px rgba(16, 24, 40, .28);
}
.modal-card h2 { margin: 0; padding: 22px 22px 0; }
.modal-card p { color: var(--muted); padding: 8px 22px 0; margin: 0; line-height: 1.45; }
.payment-card { max-width: 620px; }
.payment-summary {
  display: grid;
  gap: 4px;
  margin: 18px 22px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
}
.payment-summary strong { font-size: 18px; }
.payment-summary span { color: var(--brand-dark); font-size: 22px; font-weight: 800; }
.payment-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 0 22px 18px;
}
.payment-note {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 8px 12px;
  margin: 0 22px 18px;
  color: var(--muted);
  font-size: 13px;
}
.payment-note strong { color: var(--ink); }
.tour-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(2, 6, 12, .62);
  pointer-events: none;
}
.tour-card {
  position: fixed;
  width: min(420px, calc(100vw - 32px));
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 12px;
  padding: 18px;
  background: #ffffff;
  color: var(--ink);
  box-shadow: 0 28px 80px rgba(0,0,0,.34);
  pointer-events: auto;
}
.tour-card span {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 900;
}
.tour-card h3 { margin: 0 0 8px; font-size: 20px; }
.tour-card p { margin: 0 0 16px; color: var(--muted); line-height: 1.5; }
.tour-highlight {
  position: relative;
  z-index: 121 !important;
  outline: 3px solid var(--aqua);
  outline-offset: 5px;
  box-shadow: 0 0 0 9999px rgba(2,6,12,.08), 0 18px 46px rgba(0,214,189,.22);
}

/* ─── SMTP STATUS ─────────────────────────────────────────────── */
.smtp-status-list { padding: 12px 18px 4px; }
.smtp-status-header { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 6px; }
.smtp-status-rows { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.smtp-status-row { display: flex; align-items: center; gap: 10px; padding: 7px 10px; background: var(--bg); border-radius: 8px; border: 1px solid var(--line); }
.smtp-status-row.smtp-inactive { opacity: .55; }
.smtp-status-label { flex: 1; min-width: 0; }
.smtp-status-email { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.smtp-tag-inactive { font-size: 11px; color: var(--muted); background: #f1f5f9; border-radius: 4px; padding: 1px 5px; margin-left: 6px; }
.smtp-status-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.smtp-error-hint { width: 18px; height: 18px; border-radius: 50%; background: var(--bad); color: #fff; font-size: 11px; display: flex; align-items: center; justify-content: center; cursor: help; }
.smtp-pill { display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.smtp-pill-ok { background: #dcfce7; color: #166534; }
.smtp-pill-demo { background: #e0f2fe; color: #075985; }
.smtp-pill-blocked { background: #fee2e2; color: #991b1b; }
.smtp-pill-bad { background: #fef3c7; color: #92400e; }
.smtp-pill-offline { background: #f1f5f9; color: #64748b; }
.smtp-pill-unknown { background: #f1f5f9; color: #94a3b8; }

/* ─── SMTP COMPACT CARDS ──────────────────────────────────────── */
.smtp-compact-row { display: flex; align-items: center; gap: 8px; padding: 10px 14px; cursor: pointer; border-radius: 8px; transition: background .12s; user-select: none; }
.smtp-compact-row:hover { background: #f5f7fb; }
.smtp-active-check { display: flex; align-items: center; }
.smtp-row-label { flex: 1; font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.smtp-label-inactive { color: var(--muted); text-decoration: line-through; }
.smtp-expand-icon { font-size: 14px; color: var(--muted); flex-shrink: 0; }
.smtp-expand-body { padding: 0 14px 12px; border-top: 1px solid var(--line); }
.smtp-empty-hint { padding: 8px 18px 12px; font-size: 12px; color: var(--muted); }

/* ─── TASKS VIEW ──────────────────────────────────────────────── */
.tasks-badge { display: inline-flex; align-items: center; justify-content: center; background: var(--bad); color: #fff; border-radius: 20px; min-width: 18px; height: 18px; font-size: 11px; font-weight: 700; padding: 0 5px; margin-left: 4px; }
.tasks-list { display: flex; flex-direction: column; gap: 10px; padding: 4px 0; }
.task-card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.task-card.task-active { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(49,87,213,.1); }
.task-card.task-resumable { border-color: #f59e0b; }
.resume-task-btn { color: #059669 !important; border-color: #059669 !important; }
.resume-task-btn:hover { background: #059669 !important; color: #fff !important; }
.task-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.task-type { font-size: 13px; font-weight: 700; color: var(--ink); }
.task-time { font-size: 12px; color: var(--muted); margin-left: auto; }
.task-msg { font-size: 12px; color: var(--muted); margin: 4px 0; }
.task-smtp { font-size: 12px; color: var(--muted); margin-top: 2px; }
.task-stats { font-size: 13px; color: var(--ink); margin-top: 4px; }
.task-progress-text { font-size: 11px; color: var(--muted); margin-top: 4px; }
.task-progress { background: #e9edf5; border-radius: 4px; height: 4px; margin: 6px 0 2px; overflow: hidden; }
.task-bar { height: 100%; background: var(--brand); border-radius: 4px; transition: width .3s; }
.task-smtp-edit-panel { margin-top: 10px; padding: 10px 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; }
.task-smtp-edit-accounts { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.task-smtp-check { display: flex; align-items: center; gap: 7px; font-size: 13px; cursor: pointer; user-select: none; }
.task-smtp-check input { width: 15px; height: 15px; cursor: pointer; flex-shrink: 0; }

.letter-type-badge { display: inline-block; padding: 3px 8px; border-radius: 12px; font-size: 11px; font-weight: 600; background: var(--line); color: var(--muted); white-space: nowrap; flex-shrink: 0; }
.letter-type-badge.html { background: #dbeafe; color: #1d4ed8; }

.templates-list { display: flex; flex-direction: column; gap: 8px; }
.template-card { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: var(--bg); }
.template-card-head { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.template-card-head strong { flex: 1; font-size: 13px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.template-subject { font-size: 12px; color: var(--muted); margin-top: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
button.danger { color: var(--bad); border-color: var(--bad); }

/* ─── A/B per-job blocks in stats ──────────────────────────── */
.ab-jobs-list { display: flex; flex-direction: column; gap: 18px; }
.ab-job-block {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  background: #fafbfd;
}
.ab-job-block__head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--line);
}
.ab-job-block__head strong { font-size: 14px; color: var(--ink); }
.ab-job-block__meta { font-size: 12px; color: var(--muted); margin-left: auto; }

/* ─── Web Auth login gate ──────────────────────────────────── */
.web-auth-gate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 30% 20%, rgba(49,87,213,.15), transparent 40%),
              radial-gradient(circle at 70% 80%, rgba(0,214,189,.10), transparent 40%),
              #080c10;
  padding: 20px;
}
.wa-card {
  width: 100%;
  max-width: 420px;
  background: #131f30;
  border: 1px solid #1e3553;
  border-radius: 14px;
  padding: 28px 28px 24px;
  box-shadow: 0 30px 80px rgba(0,0,0,.5);
}
.wa-head {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid #1e3553;
}
.wa-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
  font-size: 16px;
  flex-shrink: 0;
}
.wa-head h1 { margin: 0; font-size: 16px; color: #e2e8f0; }
.wa-head p { margin: 3px 0 0; font-size: 12px; color: #8da0b8; }
.wa-form { display: flex; flex-direction: column; gap: 14px; }
.wa-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #8da0b8;
}
.wa-form input {
  padding: 11px 13px;
  border-radius: 8px;
  border: 1.5px solid #1e3553;
  background: #0d1520;
  color: #e2e8f0;
  font-size: 14px;
  font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.wa-form input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(49,87,213,.18);
}
.wa-error {
  padding: 9px 12px;
  border-radius: 7px;
  background: rgba(239,68,68,.1);
  border: 1px solid rgba(239,68,68,.3);
  color: #fca5a5;
  font-size: 13px;
}
.wa-submit {
  margin-top: 4px;
  padding: 12px;
  background: var(--brand);
  color: #fff;
  border: 0;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, transform .1s;
}
.wa-submit:hover { background: var(--brand-dark); }
.wa-submit:active { transform: scale(.98); }
.wa-submit:disabled { background: #475569; cursor: not-allowed; }

/* ─── Hamburger toggle (hidden on desktop) ───────────────── */
.sidebar-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
  flex-shrink: 0;
  cursor: pointer;
}
.sidebar-toggle span {
  display: block;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: opacity .15s;
}
.sidebar-toggle:hover span { background: var(--brand); }

/* ─── Sidebar overlay (hidden by default) ────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 199;
}
.sidebar-overlay.open { display: block; }

@media (max-width: 980px) {
  /* Landing page layout collapses */
  .landing-links { display: none; }
  .landing-hero,
  .section-head,
  .demo-section,
  .landing-pricing,
  .feature-grid,
  .box-cta { grid-template-columns: 1fr; }
  .landing-hero { padding-top: 48px; }
  .pipeline-band { grid-template-columns: 1fr; }
  .pipe-arrow {
    min-height: 28px;
    border: 0;
    border-top: 1px solid var(--landing-line);
    border-bottom: 1px solid var(--landing-line);
  }
  .hero-product { min-height: auto; }
  .box-options { grid-template-columns: 1fr; }
  /* App grids collapse */
  .grid.two, .form-grid { grid-template-columns: 1fr; }
  .pricing-grid, .compact-pricing, .usage-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  /* ── Sidebar drawer ─────────────────────────────── */
  .sidebar {
    position: fixed;
    top: 0; bottom: 0;
    left: -280px;
    width: 280px;
    z-index: 200;
    overflow-y: auto;
    transition: left .25s ease;
  }
  .sidebar.open { left: 0; }

  /* ── App shell ──────────────────────────────────── */
  #app { display: flex; }
  .main { margin-left: 0; width: 100%; }

  /* ── Topbar ─────────────────────────────────────── */
  .topbar {
    position: sticky;
    top: 0;
    z-index: 5;
    height: auto;
    padding: 10px 14px;
    gap: 10px;
  }
  .topbar h2 { font-size: 15px; }
  .topbar p { font-size: 11px; }
  .workflow-bar { display: none !important; }
  .sidebar-toggle { display: flex; }

  /* ── Views ──────────────────────────────────────── */
  .view { padding: 12px; }
  .grid { gap: 12px; }
  .grid.two { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; padding: 12px; }
  .form-grid--aligned { padding: 14px; }

  /* ── Panels ─────────────────────────────────────── */
  .panel-head { padding: 12px 14px; }
  .panel-head.row { flex-wrap: wrap; gap: 8px; }
  .actions { padding: 0 14px 14px; flex-wrap: wrap; }
  .status { padding: 0 14px 14px; }
  .smtp-extra { padding: 0 14px 14px; }
  .dataset-list, .letters-list, .history-list, .send-preview { padding: 10px 14px 14px; }
  .primary { margin: 0 14px 14px; }

  /* ── Send bar ───────────────────────────────────── */
  .send-bar { grid-template-columns: 1fr; gap: 12px; }
  .send-bar__controls { grid-template-columns: 1fr 1fr; }
  .send-bar__actions { padding-top: 0; flex-wrap: wrap; }

  /* ── Stats dashboard ────────────────────────────── */
  .kpi-grid { grid-template-columns: 1fr 1fr; padding: 12px; gap: 10px; }
  .kpi-card__value { font-size: 22px; }
  .err-type-row { grid-template-columns: 1fr 60px 36px; gap: 8px; }
  .ab-stats-row { grid-template-columns: 1fr; }
  .dash-section { padding: 12px; }

  /* ── SMTP account grid ──────────────────────────── */
  .smtp-account-grid .form-grid { padding: 10px 0 0; }
  .smtp-account-head { flex-wrap: wrap; }

  /* ── Tables: horizontal scroll ──────────────────── */
  .table-wrap { overflow-x: auto; max-height: none; }
  table { min-width: 520px; }
  td, th { padding: 8px 10px; }

  /* ── Reply cards ────────────────────────────────── */
  .reply-card .reply-head { flex-wrap: wrap; gap: 2px; }
  .reply-card .reply-actions { gap: 4px; }

  /* ── History toolbar ────────────────────────────── */
  .history-toolbar { gap: 8px; }
  .history-filters { gap: 4px; }

  /* ── Modals ─────────────────────────────────────── */
  .modal-card { margin: 12px; max-width: calc(100vw - 24px) !important; }
  .modal-wide { max-width: calc(100vw - 24px) !important; }
}

@media (max-width: 640px) {
  /* Landing page fine-tuning */
  .landing-nav { height: auto; gap: 14px; padding-top: 14px; padding-bottom: 14px; flex-wrap: wrap; }
  .landing-logo strong { font-size: 12px; }
  .landing .top-actions { width: 100%; justify-content: stretch; }
  .landing .top-actions button { flex: 1; }
  .landing main { padding-left: 16px; padding-right: 16px; }
  .landing-hero h1 { font-size: 36px; }
  .landing-hero p { font-size: 16px; }
  .landing-actions .primary,
  .landing-actions .ghost { width: 100%; }
  .mini-flow { grid-template-columns: 1fr; }
  .feature-grid article,
  .plan-card,
  .box-cta { padding: 18px; }
  .payment-options { grid-template-columns: 1fr; }
  .payment-note { grid-template-columns: 1fr; }
  .smtp-extra-head { align-items: stretch; flex-direction: column; }
  .smtp-extra-head .ghost { width: 100%; }

  /* App fine-tuning for small phones */
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .send-bar__controls { grid-template-columns: 1fr; }
  .top-actions .ghost.small { font-size: 11px; padding: 6px 8px; }
}

/* ── Statistics ─────────────────────────────── */
.stats-cards { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 24px; }
.stat-card {
  flex: 1 1 140px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 20px 16px;
  border-left: 4px solid var(--stat-color, var(--brand));
}
.stat-value { font-size: 32px; font-weight: 800; color: var(--stat-color, var(--brand)); line-height: 1; letter-spacing: -1px; }
.stat-label { font-size: 13px; color: var(--fg); margin-top: 8px; font-weight: 500; }
.stat-sub   { font-size: 11px; color: var(--muted); margin-top: 2px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }

.stats-section { margin-top: 28px; }
.stats-section-title {
  font-size: 11px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .08em; margin: 0 0 14px;
  display: flex; align-items: center; gap: 8px;
}
.stats-section-title::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* Error rows with mini progress bar */
.error-type-row {
  display: flex; align-items: center;
  padding: 9px 0; border-bottom: 1px solid var(--line);
  font-size: 14px; gap: 12px;
}
.error-type-row:last-child { border-bottom: none; }
.error-type-name { flex: 1; }
.error-bar-bg { width: 100px; height: 6px; background: rgba(239,68,68,.15); border-radius: 3px; flex-shrink: 0; }
.error-bar-fill { height: 100%; background: #ef4444; border-radius: 3px; transition: width .4s; }

/* Timeline bar chart */
.stats-timeline {
  display: flex; align-items: stretch; gap: 6px;
  height: 180px; overflow-x: auto; overflow-y: visible;
}
.tl-col {
  display: flex; flex-direction: column; align-items: center;
  min-width: 44px; flex: 1 0 44px;
}
.tl-bar-wrap { flex: 1; width: 100%; display: flex; align-items: flex-end; min-height: 0; }
.tl-bar {
  width: 72%; margin: 0 auto;
  background: var(--brand); border-radius: 5px 5px 0 0;
  min-height: 3px; transition: height .35s ease; opacity: .82;
}
.tl-bar:hover { opacity: 1; }
.tl-label {
  font-size: 10px; color: var(--muted); white-space: nowrap;
  height: 20px; line-height: 20px; flex-shrink: 0;
  position: static; text-align: center;
}

/* Domains table */
.stats-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.stats-table thead tr { background: var(--bg); }
.stats-table th {
  text-align: left; padding: 9px 12px;
  color: var(--muted); font-weight: 700; font-size: 11px;
  text-transform: uppercase; letter-spacing: .05em;
  border-bottom: 2px solid var(--line);
}
.stats-table td { padding: 8px 12px; border-bottom: 1px solid var(--line); }
.stats-table tr:last-child td { border-bottom: none; }
.stats-table tr:hover td { background: var(--bg); }
.rate-good { color: #059669; font-weight: 700; }
.rate-ok   { color: #d97706; font-weight: 700; }
.rate-bad  { color: #dc2626; font-weight: 700; }

.smtp-imap-details { margin-top: 12px; border-top: 1px dashed var(--line); padding-top: 8px; }
.smtp-imap-details summary { font-size: 13px; color: var(--muted); cursor: pointer; padding: 4px 0; }
.smtp-imap-details summary:hover { color: var(--ink); }

/* ═══════════════════════════════════════════════════════════════
   NEW SAAS LANDING
═══════════════════════════════════════════════════════════════ */

/* ── Nav ─────────────────────────────────────────────────────── */
.ln-nav {
  position: sticky; top: 0; z-index: 50;
  height: 66px; display: flex; align-items: center;
  justify-content: space-between;
  padding: 0 clamp(18px, 5vw, 72px);
  background: rgba(8,12,16,.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.ln-logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: #eaf2ff; }
.ln-logo-mark {
  width: 32px; height: 32px; border-radius: 8px;
  background: linear-gradient(135deg,#3157d5,#7c3aed);
  display: grid; place-items: center;
  font-weight: 900; font-size: 13px; color: #fff;
}
.ln-logo strong { font-size: 13px; letter-spacing: 1.5px; text-transform: uppercase; }
.ln-links { display: flex; gap: 28px; }
.ln-links a { color: #8da0b8; text-decoration: none; font-size: 14px; transition: color .15s; }
.ln-links a:hover { color: #eaf2ff; }
.ln-nav-actions { display: flex; gap: 10px; align-items: center; }
.ln-btn-ghost {
  background: transparent; border: 1px solid rgba(255,255,255,.18);
  color: #eaf2ff; padding: 8px 18px; border-radius: 8px;
  font-size: 14px; font-weight: 500; cursor: pointer; transition: background .15s;
}
.ln-btn-ghost:hover { background: rgba(255,255,255,.08); }
.ln-btn-primary {
  background: linear-gradient(135deg,#3157d5,#7c3aed);
  border: none; color: #fff; padding: 9px 20px; border-radius: 8px;
  font-size: 14px; font-weight: 600; cursor: pointer;
  box-shadow: 0 2px 12px rgba(49,87,213,.35);
  transition: opacity .15s, box-shadow .15s;
}
.ln-btn-primary:hover { opacity: .9; box-shadow: 0 4px 20px rgba(49,87,213,.5); }
.ln-btn-lg { padding: 14px 32px; font-size: 16px; border-radius: 10px; }

/* ── Hero ────────────────────────────────────────────────────── */
.ln-hero {
  min-height: 620px; display: flex; align-items: center; gap: 48px;
  padding: 80px clamp(18px, 5vw, 72px) 60px;
  background: linear-gradient(180deg,#080c10 0,#0d1218 500px,#f4f7fb 500px,#f4f7fb 100%);
  color: #eaf2ff;
  flex-wrap: wrap;
}
.ln-hero-copy { flex: 1 1 380px; max-width: 580px; }
.ln-badge {
  display: inline-block; padding: 5px 13px; border-radius: 20px;
  background: rgba(49,87,213,.2); border: 1px solid rgba(49,87,213,.4);
  font-size: 12px; font-weight: 600; letter-spacing: .5px;
  color: #93c5fd; margin-bottom: 22px;
}
.ln-hero-copy h1 {
  font-size: clamp(32px, 5vw, 56px); font-weight: 800; line-height: 1.1;
  letter-spacing: -.5px; margin: 0 0 20px; color: #fff;
}
.ln-hero-sub { font-size: 17px; line-height: 1.6; color: #8da0b8; margin: 0 0 32px; max-width: 480px; }
.ln-hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; }
.ln-hero-proof { display: flex; flex-wrap: wrap; gap: 18px; font-size: 13px; color: #5d7a93; }
.ln-hero-proof span::before { content: ""; }

/* ── Mockup ─────────────────────────────────────────────────── */
.ln-hero-visual { flex: 1 1 300px; max-width: 460px; }
.ln-mockup {
  background: #111827; border-radius: 14px;
  border: 1px solid rgba(255,255,255,.1);
  box-shadow: 0 24px 64px rgba(0,0,0,.5);
  overflow: hidden;
}
.ln-mockup-bar {
  height: 36px; background: #1f2937;
  display: flex; align-items: center; gap: 6px; padding: 0 14px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.ln-mockup-bar i {
  width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,.2);
}
.ln-mockup-body { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.ln-mock-row {
  display: flex; gap: 12px; align-items: flex-start;
  background: rgba(255,255,255,.04); border-radius: 8px; padding: 10px 12px;
  border: 1px solid rgba(255,255,255,.06);
}
.ln-mock-row.active-row { border-color: rgba(49,87,213,.4); background: rgba(49,87,213,.08); }
.ln-mock-dot {
  width: 8px; height: 8px; border-radius: 50%; margin-top: 4px; flex-shrink: 0;
}
.ln-mock-dot.green { background: #10b981; box-shadow: 0 0 6px #10b981; }
.ln-mock-dot.blue  { background: #3b82f6; box-shadow: 0 0 6px #3b82f6; }
.ln-mock-row strong { font-size: 13px; color: #e2e8f0; display: block; margin-bottom: 2px; }
.ln-mock-row small  { font-size: 11px; color: #64748b; }
.ln-mock-letter {
  background: rgba(255,255,255,.04); border-radius: 8px; padding: 12px;
  border: 1px solid rgba(255,255,255,.06);
}
.ln-mock-letter-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px;
}
.ln-mock-letter-head small { font-size: 11px; color: #64748b; }
.ln-pill-green {
  background: rgba(16,185,129,.15); color: #10b981;
  font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 20px;
}
.ln-mock-letter p { font-size: 12px; color: #94a3b8; line-height: 1.5; margin: 0; }

/* ── Pipeline ────────────────────────────────────────────────── */
.ln-pipeline {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 0;
  background: #f8fafc; padding: 40px clamp(18px,5vw,72px);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.ln-pipe-item {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 0 28px; text-align: center;
}
.ln-pipe-item span {
  font-size: 11px; font-weight: 700; color: var(--brand);
  letter-spacing: 1px; text-transform: uppercase;
}
.ln-pipe-item strong { font-size: 15px; color: var(--ink); }
.ln-pipe-item small  { font-size: 12px; color: var(--muted); }
.ln-pipe-arrow { font-size: 20px; color: var(--line); padding: 0 4px; }

/* ── Features ────────────────────────────────────────────────── */
.ln-features {
  padding: 80px clamp(18px,5vw,72px);
  background: #fff;
}
.ln-section-head { text-align: center; margin-bottom: 56px; }
.ln-kicker {
  display: inline-block; font-size: 12px; font-weight: 700;
  letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--brand); margin-bottom: 12px;
}
.ln-section-head h2 {
  font-size: clamp(26px,4vw,42px); font-weight: 800;
  color: var(--ink); margin: 0 0 16px; line-height: 1.15;
}
.ln-section-head p { color: var(--muted); font-size: 17px; max-width: 560px; margin: 0 auto; }
.ln-feat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px; max-width: 1100px; margin: 0 auto;
}
.ln-feat-card {
  background: #f8fafc; border-radius: 14px;
  border: 1px solid var(--line); padding: 28px 24px;
  transition: box-shadow .2s, transform .2s;
}
.ln-feat-card:hover { box-shadow: 0 8px 32px rgba(0,0,0,.08); transform: translateY(-2px); }
.ln-feat-icon { font-size: 28px; margin-bottom: 14px; }
.ln-feat-card h3 { font-size: 16px; font-weight: 700; color: var(--ink); margin: 0 0 8px; }
.ln-feat-card p  { font-size: 14px; color: var(--muted); line-height: 1.6; margin: 0; }

/* ── Pricing ─────────────────────────────────────────────────── */
.ln-pricing {
  padding: 80px clamp(18px,5vw,72px);
  background: #f8fafc;
  border-top: 1px solid var(--line);
}
.ln-plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px; max-width: 980px; margin: 0 auto 24px; align-items: start;
}
.ln-plan-card {
  background: #fff; border-radius: 16px;
  border: 1px solid var(--line); padding: 28px 24px;
  position: relative; display: flex; flex-direction: column; gap: 20px;
  transition: box-shadow .2s;
}
.ln-plan-card:hover { box-shadow: 0 8px 32px rgba(0,0,0,.1); }
.ln-plan-card.popular {
  border: 2px solid var(--brand);
  box-shadow: 0 4px 24px rgba(49,87,213,.15);
}
.ln-plan-badge {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--brand); color: #fff;
  font-size: 11px; font-weight: 700; letter-spacing: .5px;
  padding: 3px 14px; border-radius: 20px; white-space: nowrap;
}
.ln-plan-name { font-size: 16px; font-weight: 700; color: var(--ink); margin-bottom: 8px; }
.ln-plan-price { display: flex; align-items: baseline; gap: 4px; margin-bottom: 4px; }
.ln-plan-price strong { font-size: 32px; font-weight: 800; color: var(--ink); line-height: 1; }
.ln-plan-price span  { font-size: 14px; color: var(--muted); }
.ln-plan-desc { font-size: 13px; color: var(--muted); }
.ln-plan-features { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ln-plan-features li { font-size: 13.5px; color: var(--ink); }
.ln-plan-features li:first-child { color: var(--muted); }
.ln-plan-features li[style*="cross"], .ln-plan-features li:has(span.cross) { color: #ccc; }
.ln-plan-btn {
  width: 100%; padding: 11px; border-radius: 9px;
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: opacity .15s;
}
.ln-plan-btn.primary {
  background: linear-gradient(135deg,#3157d5,#7c3aed);
  color: #fff; border: none;
  box-shadow: 0 2px 12px rgba(49,87,213,.3);
}
.ln-plan-btn.primary:hover { opacity: .88; }
.ln-plan-btn.ghost { background: #f1f5f9; color: var(--ink); border: 1px solid var(--line); }
.ln-plan-btn.ghost:hover { background: var(--line); }
.ln-pricing-note { text-align: center; font-size: 13px; color: var(--muted); max-width: 600px; margin: 0 auto; }

/* ── CTA band ────────────────────────────────────────────────── */
.ln-cta-band {
  text-align: center; padding: 80px clamp(18px,5vw,72px);
  background: linear-gradient(135deg,#0d1218,#111827);
  color: #fff;
}
.ln-cta-band h2 { font-size: clamp(24px,4vw,38px); font-weight: 800; margin: 0 0 12px; }
.ln-cta-band p  { color: #8da0b8; font-size: 16px; margin: 0 0 32px; }

/* ── Footer ─────────────────────────────────────────────────── */
.ln-footer {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: 16px; padding: 28px clamp(18px,5vw,72px);
  background: #080c10; border-top: 1px solid rgba(255,255,255,.07);
  color: #64748b;
}
.ln-footer-left { display: flex; flex-direction: column; gap: 6px; }
.ln-footer-left .ln-logo { margin-bottom: 2px; }
.ln-footer small { font-size: 12px; color: #475569; }

/* ═══════════════════════════════════════════════════════════════
   AUTH MODALS
═══════════════════════════════════════════════════════════════ */
.auth-card { max-width: 420px; width: 100%; padding: 36px 32px; position: relative; }
.auth-header { text-align: center; margin-bottom: 24px; }
.auth-header .auth-logo { margin-bottom: 12px; }
.auth-header h2 { font-size: 22px; font-weight: 800; color: var(--ink); margin: 0 0 6px; }
.auth-header p  { color: var(--muted); font-size: 14px; margin: 0; }
.auth-form { padding: 0; }
.auth-actions { margin-top: 16px; }
.auth-submit { width: 100%; padding: 12px; font-size: 15px; font-weight: 600; border-radius: 10px; }
.auth-switch { margin-top: 16px; text-align: center; font-size: 13px; color: var(--muted); }
.link-btn {
  background: none; border: none; color: var(--brand);
  cursor: pointer; font-size: inherit; font-weight: 600;
  text-decoration: underline; padding: 0;
}
.link-btn:hover { opacity: .8; }
.modal-close {
  position: absolute; top: 12px; right: 14px;
  background: none; border: none; color: var(--muted);
  font-size: 18px; cursor: pointer; line-height: 1; padding: 4px 8px;
  border-radius: 6px; transition: background .12s;
}
.modal-close:hover { background: var(--line); color: var(--ink); }
.reg-step2-hint {
  font-size: 14px; color: var(--muted); margin: 0 0 16px;
  text-align: center; line-height: 1.5;
}
.reg-step2-hint strong { color: var(--ink); }
@keyframes psSlide { 0% { left: -40%; } 100% { left: 100%; } }

/* ═══════════════════════════════════════════════════════════════
   SIDEBAR USER BLOCK
═══════════════════════════════════════════════════════════════ */
.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; margin: 8px 10px;
  background: rgba(0,0,0,.15); border-radius: 10px; cursor: pointer;
}
.sidebar-user:hover { background: rgba(0,0,0,.25); }
.su-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg,#3157d5,#7c3aed);
  display: grid; place-items: center;
  font-size: 13px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.su-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.su-info #suName { font-size: 13px; font-weight: 600; color: #eaf2ff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.su-plan { font-size: 11px; color: #5d7a93; }

/* ═══════════════════════════════════════════════════════════════
   ACCOUNT VIEW
═══════════════════════════════════════════════════════════════ */
.subscription-summary {
  background: linear-gradient(135deg,#eff6ff,#f0f4ff);
  border: 1px solid #c7d9ff; border-radius: 10px;
  padding: 14px 16px; margin: 18px 18px 14px;
}
.subscription-summary strong { font-size: 15px; color: var(--ink); display: block; margin-bottom: 4px; }
.subscription-summary span   { font-size: 13px; color: var(--muted); }
.usage-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 18px 18px; }
.usage-card {
  background: #f8fafc; border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px; display: flex; flex-direction: column; gap: 6px;
}
.usage-card strong { font-size: 13px; font-weight: 700; color: var(--ink); }
.usage-card span   { font-size: 12px; color: var(--muted); }
.usage-card .meter { height: 5px; background: var(--line); border-radius: 3px; overflow: hidden; }
.usage-card .meter i { display: block; height: 100%; background: var(--brand); border-radius: 3px; transition: width .4s; }
.plans-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px; padding: 14px 18px 18px;
}
.price-card {
  background: #f8fafc; border: 1px solid var(--line); border-radius: 12px;
  padding: 18px 16px; display: flex; flex-direction: column; gap: 12px;
}
.price-card.selected { border-color: var(--brand); background: #eff6ff; }
.price-card h4 { font-size: 15px; font-weight: 700; margin: 0; color: var(--ink); }
.price-card .price { font-size: 22px; font-weight: 800; color: var(--ink); }
.price-card .price small { font-size: 13px; font-weight: 400; color: var(--muted); }
.price-card ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.price-card ul li { font-size: 12.5px; color: var(--muted); }
.plan-current-badge {
  display: inline-block; background: var(--brand); color: #fff;
  font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 20px;
}

/* ── Edition-specific spacing ────────────────────── */
/* Summary box (base context in letters panel) */
.summary-box {
  padding: 8px 18px 4px;
  font-size: 13px;
  color: var(--muted);
  min-height: 4px;
}
/* Template select row in letters panel */
.template-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px 6px;
}
/* Save-as-template button row */
.tpl-save-row {
  padding: 0 18px 8px;
}
/* Workspaces + invoices lists inside panels */
#workspacesList,
#invoicesList {
  padding: 14px 18px 18px;
  display: grid;
  gap: 10px;
}
/* License status in sidebar */
.license-active  { color: #4ade80; }
.license-inactive { color: #94a3b8; }

/* A/B variants block */
.ab-toggle { display: flex; align-items: center; gap: 6px; }
.ab-toggle .hint { color: var(--muted); font-size: 12px; }
.ab-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-top: 8px;
  flex-wrap: wrap;
}
.ab-tab {
  padding: 6px 12px;
  font-size: 13px;
  background: transparent;
  border: 1px solid var(--line);
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  cursor: pointer;
  color: var(--muted);
  font-weight: 500;
  position: relative;
  margin-bottom: -1px;
}
.ab-tab.active {
  background: var(--bg);
  color: var(--text);
  border-bottom: 1px solid var(--bg);
}
.ab-tab .ab-tab-pct {
  margin-left: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
}
.ab-tab .ab-tab-close {
  margin-left: 8px;
  color: var(--muted);
  font-weight: 700;
}
.ab-tab .ab-tab-close:hover { color: #ef4444; }
.ab-panels { padding: 10px 0; }
.ab-panel { display: grid; gap: 8px; }
.ab-panel-row {
  display: grid;
  grid-template-columns: 1fr 100px;
  gap: 8px;
  align-items: center;
}
.ab-panel input[type="text"],
.ab-panel input[type="number"],
.ab-panel select,
.ab-panel textarea {
  font-size: 13px;
  width: 100%;
  box-sizing: border-box;
}
.ab-panel .ab-percent-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
}

/* ═══════════════════════════════════════════════════════════════
   SESSION 9: layout polish + dashboard + tags + rules + followups
═══════════════════════════════════════════════════════════════ */

/* ── Form grid: aligned cells, hints under inputs ─────────────── */
.form-grid--aligned { grid-auto-rows: min-content; gap: 16px 20px; padding: 20px; }
.form-grid--aligned label { align-content: start; }
.form-grid .grid-col-span-2 { grid-column: 1 / -1; }
.field-hint { display: block; color: var(--muted); font-size: 11.5px; line-height: 1.35; margin-top: 4px; font-weight: 400; }

/* ── Send bar (Отправка) ──────────────────────────────────────── */
.send-bar {
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(0, 1fr) auto;
  align-items: start;
  gap: 22px;
  padding: 18px 20px 16px;
  border-bottom: 1px solid var(--line);
}
.send-bar__title { padding-top: 4px; }
.send-bar__title h3 { margin: 0; font-size: 16px; font-weight: 700; }
.send-bar__title p { margin: 4px 0 0; color: var(--muted); font-size: 12.5px; }
.send-bar__controls {
  display: grid;
  grid-template-columns: 110px 110px 1fr 1fr;
  gap: 12px 16px;
  align-items: start;
}
.send-bar__actions { display: flex; gap: 8px; align-items: center; padding-top: 26px; }
.send-bar__actions .primary { margin: 0; white-space: nowrap; }
.send-field { display: grid; gap: 5px; font-size: 12px; font-weight: 600; color: #344054; min-width: 0; }
.send-field > span { font-size: 12px; font-weight: 600; color: #344054; line-height: 1.2; }
.send-field input { width: 100%; padding: 8px 10px; font-size: 13px; }
.send-field--wide { min-width: 180px; }
.send-field__range { display: flex; align-items: center; gap: 6px; }
.send-field__range input { flex: 1; min-width: 0; }
.send-field__range .range-sep { color: var(--muted); }
.danger-btn { color: var(--bad) !important; border-color: var(--bad) !important; }
@media (max-width: 1100px) {
  .send-bar { grid-template-columns: 1fr; gap: 14px; }
  .send-bar__actions { padding-top: 0; }
  .send-bar__controls { grid-template-columns: repeat(2, 1fr); }
}

/* ── Lead status badges ───────────────────────────────────────── */
.lead-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}
.lead-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.lead-status[data-status="new"] { background: #eef2ff; color: #4338ca; }
.lead-status[data-status="interested"] { background: #d1fae5; color: #047857; }
.lead-status[data-status="not_interested"] { background: #fee2e2; color: #b91c1c; }
.lead-status[data-status="unsubscribed"] { background: #fef3c7; color: #92400e; }
.lead-status[data-status="spam"] { background: #f3e8ff; color: #6b21a8; }
.lead-status[data-status="customer"] { background: #cffafe; color: #0e7490; }
.lead-status-select {
  font-size: 11px;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  margin-left: 4px;
}

/* ── Dashboard: KPI cards ─────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  padding: 18px;
}
.kpi-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.kpi-card__label { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.kpi-card__value { font-size: 26px; font-weight: 800; color: var(--ink); line-height: 1.1; }
.kpi-card__sub { font-size: 12px; color: var(--muted); }
.kpi-card--ok { border-left: 3px solid #10b981; }
.kpi-card--warn { border-left: 3px solid #f59e0b; }
.kpi-card--bad { border-left: 3px solid #ef4444; }
.kpi-card--brand { border-left: 3px solid var(--brand); }

/* ── Dashboard: section heads ─────────────────────────────────── */
.dash-section { padding: 18px; border-top: 1px solid var(--line); }
.dash-section__head {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin: 0 0 12px;
}

/* ── Dashboard: error-type bars ───────────────────────────────── */
.err-types { display: flex; flex-direction: column; gap: 8px; }
.err-type-row { display: grid; grid-template-columns: 200px 1fr 40px; align-items: center; gap: 14px; }
.err-type-name { font-size: 13px; color: var(--ink); }
.err-type-bar { height: 6px; background: #fee2e2; border-radius: 3px; overflow: hidden; position: relative; }
.err-type-bar i { display: block; height: 100%; background: #ef4444; border-radius: 3px; transition: width .3s; }
.err-type-count { font-size: 12px; font-weight: 700; color: var(--ink); text-align: right; }

/* ── Dashboard: A/B variant cards (grid layout, эталон) ───────── */
.ab-stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}
.ab-stat-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
}
.ab-stat-card__head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.ab-stat-card__name { font-size: 14px; font-weight: 700; color: var(--ink); }
.ab-stat-card__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.ab-stat-card__cell { display: flex; flex-direction: column; gap: 2px; }
.ab-stat-card__cell label { font-size: 11px; color: var(--muted); font-weight: 600; }
.ab-stat-card__cell .val { font-size: 14px; font-weight: 700; color: var(--ink); }
.ab-stat-card__cell .val.ok { color: #047857; }
.ab-stat-card__cell .val.warn { color: #b45309; }
.ab-stat-card__cell .val.bad { color: #b91c1c; }

/* ── Dashboard: activity bars ─────────────────────────────────── */
.act-chart { display: flex; align-items: flex-end; gap: 8px; height: 140px; padding: 12px 4px 4px; }
.act-chart__bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 30px; }
.act-chart__bar {
  width: 100%;
  background: linear-gradient(180deg, #6177e3 0%, #3157d5 100%);
  border-radius: 4px 4px 0 0;
  min-height: 4px;
  transition: opacity .15s;
  cursor: default;
}
.act-chart__bar:hover { opacity: .85; }
.act-chart__label { font-size: 10px; color: var(--muted); }

/* ── Dashboard: domains table ─────────────────────────────────── */
.domains-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.domains-table th { text-align: left; padding: 10px 12px; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; border-bottom: 1px solid var(--line); font-weight: 700; }
.domains-table th:not(:first-child) { text-align: center; }
.domains-table td { padding: 10px 12px; border-bottom: 1px solid #eef2f7; }
.domains-table td:not(:first-child) { text-align: center; }
.domains-table tr:last-child td { border-bottom: 0; }
.domains-table .dom-pill { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: #fee2e2; color: #b91c1c; font-size: 12px; font-weight: 700; }
.domains-table .dom-rate { font-weight: 700; color: #047857; }
.domains-table .dom-rate.low { color: #b45309; }
.domains-table .dom-rate.bad { color: #b91c1c; }

/* ── Reply rules / followups ──────────────────────────────────── */
.rule-card, .fu-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  background: #fff;
  margin-bottom: 12px;
}
.rule-card__head, .fu-card__head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.rule-card__name, .fu-card__name { flex: 1; font-size: 14px; font-weight: 700; color: var(--ink); border: 0; padding: 4px 6px; border-radius: 6px; background: transparent; }
.rule-card__name:focus, .fu-card__name:focus { background: #f1f5f9; outline: 1px solid var(--brand); }
.rule-cond-row, .fu-step-row {
  display: grid;
  grid-template-columns: 140px 140px 1fr auto;
  gap: 8px;
  margin-bottom: 6px;
  align-items: center;
}
.rule-action-row { display: grid; grid-template-columns: 180px 1fr auto; gap: 8px; margin-bottom: 6px; align-items: center; }
.rule-section-label { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 12px 0 6px; }
.rule-card input, .rule-card select, .fu-card input, .fu-card select, .fu-card textarea { font-size: 13px; padding: 7px 9px; }
.fu-step-card { border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: #fbfcff; margin-bottom: 10px; }
.fu-step-card__head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.fu-step-card__num { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: var(--brand); color: #fff; font-size: 12px; font-weight: 700; }
.toggle-switch { position: relative; display: inline-block; width: 36px; height: 20px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-switch .slider { position: absolute; cursor: pointer; inset: 0; background: #cbd5e1; border-radius: 20px; transition: .2s; }
.toggle-switch .slider::before { position: absolute; content: ""; height: 14px; width: 14px; left: 3px; top: 3px; background: white; border-radius: 50%; transition: .2s; }
.toggle-switch input:checked + .slider { background: var(--brand); }
.toggle-switch input:checked + .slider::before { transform: translateX(16px); }

/* ── Sidebar: чуть контрастнее активный + бейджи ─────────────── */
.nav button.active { background: rgba(79,131,247,.22); }
.tasks-badge { background: #ef4444; }

/* ── Unsubscribe quick toggle (send bar) ──────────────────────── */
.unsub-toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
  color: #475467;
  transition: background .15s, border-color .15s, color .15s;
  user-select: none;
  white-space: nowrap;
}
.unsub-toggle:hover { background: #eef2f7; }
.unsub-toggle__icon { font-size: 14px; opacity: .8; }
.unsub-toggle.is-on {
  background: #ecfdf5;
  border-color: #6ee7b7;
  color: #047857;
}
.unsub-toggle.is-on .unsub-toggle__icon { opacity: 1; }


.ab-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 0 10px;
}
.ab-sum-note { font-size: 12px; color: var(--muted); }
.ab-sum-note.bad { color: #ef4444; }
.ab-sum-note.ok { color: #10b981; }

/* Variant badge on letter cards / history */
.variant-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  background: #e0e7ff;
  color: #4338ca;
  margin-left: 6px;
}
.variant-badge[data-variant="B"] { background: #fef3c7; color: #b45309; }
.variant-badge[data-variant="C"] { background: #d1fae5; color: #047857; }
.variant-badge[data-variant="D"] { background: #fce7f3; color: #be185d; }
.variant-badge[data-variant="E"] { background: #ede9fe; color: #6d28d9; }

/* Variant stats cards */
.variant-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  padding: 18px;
}
.variant-stat-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  background: var(--bg);
}
.variant-stat-card .head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  font-weight: 600;
}
.variant-stat-card .metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 12px;
  font-size: 12px;
  color: var(--muted);
}
.variant-stat-card .metrics b { color: var(--text); font-size: 14px; }

/* ── Suppression list (block-list page) ───────────────── */
.supp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
@media (max-width: 900px) { .supp-grid { grid-template-columns: 1fr; } }
.supp-list {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  max-height: 540px;
  overflow-y: auto;
}
.supp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.supp-row:last-child { border-bottom: 0; }
.supp-row__value { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; }
.supp-row__reason { color: var(--muted); font-size: 11.5px; margin-left: 8px; }
.supp-row__remove {
  background: transparent; border: 0; color: #ef4444; cursor: pointer;
  font-size: 14px; padding: 2px 6px; border-radius: 4px;
}
.supp-row__remove:hover { background: #fef2f2; }
.supp-empty { padding: 22px; text-align: center; color: var(--muted); font-size: 13px; }

/* ── Reply AI-category badge (inbox) ──────────────────── */
.ai-cat {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .03em;
  text-transform: uppercase;
  margin-left: 6px;
  vertical-align: middle;
}
.ai-cat[data-cat="interested"]    { background: #d1fae5; color: #047857; }
.ai-cat[data-cat="not_interested"]{ background: #fee2e2; color: #b91c1c; }
.ai-cat[data-cat="question"]      { background: #dbeafe; color: #1d4ed8; }
.ai-cat[data-cat="auto_reply"]    { background: #e5e7eb; color: #4b5563; }
.ai-cat[data-cat="spam"]          { background: #fde68a; color: #92400e; }
.ai-cat[data-cat="unknown"]       { background: #f3f4f6; color: #6b7280; }
.ai-cat__conf { opacity: .7; font-weight: 500; margin-left: 4px; }

/* ── Pre-send validation modal ────────────────────────── */
.ps-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin: 14px 0 18px 0;
}
.ps-sum-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}
.ps-sum-card .lbl { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.ps-sum-card .val { font-size: 20px; font-weight: 700; margin-top: 4px; }
.ps-sum-card.warn { border-color: #fbbf24; }
.ps-sum-card.bad  { border-color: #ef4444; }
.ps-sum-card.warn .val { color: #b45309; }
.ps-sum-card.bad  .val { color: #b91c1c; }

.ps-list {
  border: 1px solid var(--line);
  border-radius: 8px;
  max-height: 460px;
  overflow-y: auto;
}
.ps-row {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
}
.ps-row:last-child { border-bottom: 0; }
.ps-row__to { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; }
.ps-row__subj { color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.ps-row__issues { color: #b45309; font-size: 11px; margin-top: 3px; }
.ps-row.is-risky { background: #fffbeb; }
.ps-row.is-bad   { background: #fef2f2; }
.ps-score { font-weight: 700; padding: 2px 8px; border-radius: 8px; background: #ecfdf5; color: #047857; font-size: 11.5px; }
.ps-score.warn { background: #fef3c7; color: #92400e; }
.ps-score.bad  { background: #fee2e2; color: #b91c1c; }
.ps-mx-ok    { font-size: 10.5px; padding: 1px 6px; border-radius: 6px; background: #d1fae5; color: #065f46; font-weight: 600; }
.ps-mx-bad   { font-size: 10.5px; padding: 1px 6px; border-radius: 6px; background: #fee2e2; color: #b91c1c; font-weight: 600; }

/* ── KPI variants for stats dashboard ─────────────────── */
.kpi-card--info { border-left-color: #6366f1; }

/* ── AI reply modal ──────────────────────────────────── */
.ai-reply__ctx {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 8px;
  font-size: 12px;
}
.ai-reply__ctx b { color: var(--text); }
.ai-reply__ctx .snip { color: var(--muted); margin-top: 4px; max-height: 84px; overflow-y: auto; }
.ai-reply__loading {
  display: flex; align-items: center; gap: 10px;
  margin: 24px 0; padding: 16px;
  background: #f1f5f9; border-radius: 8px; color: var(--muted); font-size: 13px;
}
.ai-reply__to {
  background: #eef2f7; border: 1px solid var(--line); border-radius: 6px;
  padding: 6px 10px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px;
  margin-top: 4px;
}
.ai-reply__err { color: #b91c1c; font-size: 12px; flex: 1; }
.spinner {
  display: inline-block; width: 14px; height: 14px;
  border: 2px solid #cbd5e1; border-top-color: var(--brand);
  border-radius: 50%; animation: lcs-spin .8s linear infinite;
}
@keyframes lcs-spin { to { transform: rotate(360deg); } }

/* AI-reply button on reply card */
.reply-actions .ai-reply-btn {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff; border: 0; font-weight: 600;
}
.reply-actions .ai-reply-btn:hover { opacity: .92; }

/* ── Form helper for digest hour/minute side-by-side ─── */
#settings input[type="number"][id^="digest"] { width: 110px; }
#settings input[type="number"][id="validationSpamThreshold"] { width: 110px; }

