/* ==========================================================================
   UHURU 2USHARP STUDIO — one-page editorial UI
   ========================================================================== */

:root {
  --ink: #17231e;
  --ink-2: #24332c;
  --ink-3: #4c5b53;
  --muted: #7a857e;
  --paper: #ffffff;
  --paper-deep: #f7f7f2;
  --card: #ffffff;
  --card-2: #faf9f3;
  --line: #e7e3d6;
  --line-soft: #f1eee5;
  --accent: #8a6500;
  --accent-dark: #6f5200;
  --accent-bright: #f4c81e;
  --accent-soft: #fff8dc;
  --green: #1f7a58;
  --green-dark: #176148;
  --green-soft: #e6f4ec;
  --amber: #9a6714;
  --amber-soft: #fbf2dd;
  --red: #ae3b2d;
  --red-soft: #fbe9e5;
  --blue: #2d5b8c;
  --blue-soft: #e9f0f8;
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 26px 48px -38px rgba(35, 43, 38, .45), 0 2px 0 rgba(255, 255, 255, .7) inset;
  --sans: "DM Sans", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --serif: "Fraunces", ui-serif, Georgia, "Times New Roman", serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 94px; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(ellipse 44rem 26rem at -4% -8%, rgba(244, 200, 30, .14), transparent 70%),
    radial-gradient(ellipse 40rem 28rem at 104% 18%, rgba(31, 122, 88, .06), transparent 70%),
    var(--paper);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .32;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 140 140' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.055'/%3E%3C/svg%3E");
}

[hidden] { display: none !important; }

::selection { background: #f9e28a; color: var(--ink); }

button, input, select, textarea { font: inherit; }
button { color: inherit; }
a { color: inherit; }
img { max-width: 100%; }

.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.icon {
  width: 18px;
  height: 18px;
  display: inline-block;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -3px;
}
.icon-sm { width: 15px; height: 15px; stroke-width: 1.9; }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1000;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  transform: translateY(-150%);
  transition: transform .18s ease;
}
.skip-link:focus { transform: translateY(0); }

/* --------------------------------------------------------------------------
   Top bar
   -------------------------------------------------------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, .88);
  border-bottom: 1px solid rgba(231, 227, 214, .78);
  backdrop-filter: blur(16px) saturate(130%);
  -webkit-backdrop-filter: blur(16px) saturate(130%);
}

.topbar-inner {
  width: min(1440px, 100%);
  height: 72px;
  margin: 0 auto;
  padding: 0 30px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  flex: none;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--accent-bright);
  border: 1px solid #e2b900;
  color: var(--ink);
  line-height: 1;
  position: relative;
  box-shadow: 0 5px 12px -7px rgba(138, 101, 0, .65);
}
.brand-mark svg { width: 32px; height: 32px; display: block; }

.brand-copy { display: flex; flex-direction: column; line-height: 1.08; }
.brand-copy strong {
  font-family: var(--serif);
  font-size: 16.5px;
  letter-spacing: -.015em;
  font-weight: 600;
  white-space: nowrap;
}
.brand-copy small {
  margin-top: 3px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .17em;
  text-transform: uppercase;
  color: var(--muted);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 18px;
  padding: 4px;
  border: 1px solid rgba(231, 227, 214, .75);
  border-radius: 999px;
  background: rgba(255, 255, 255, .45);
}

.nav-link {
  padding: 7px 14px;
  border-radius: 999px;
  color: var(--ink-3);
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 600;
  transition: background .18s ease, color .18s ease;
}
.nav-link:hover { color: var(--ink); background: rgba(255, 255, 255, .8); }
.nav-link.is-active { color: var(--ink); background: var(--card); box-shadow: 0 3px 9px -7px rgba(23, 35, 30, .6); }

.topbar-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }

.capacity-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-3);
  font-size: 11.5px;
  white-space: nowrap;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .5);
}
.capacity-pill b { color: var(--ink); font-size: 12px; }
.capacity-pill .icon { width: 14px; height: 14px; color: var(--accent); }

.smtp-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: #ffffff;
  padding: 9px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .18s ease, background .18s ease;
}
.smtp-pill:hover { transform: translateY(-1px); background: var(--ink-2); }
.smtp-pill .icon-sm { opacity: .6; }
.smtp-pill.is-ready { border-color: #2c8a66; background: #1d6e51; }
.smtp-pill.is-failed { border-color: #a53b2e; background: #97362b; }

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #a8a398;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .1);
}
.smtp-pill.is-ready .status-dot { background: #b9f3d6; box-shadow: 0 0 0 3px rgba(185, 243, 214, .16); }
.smtp-pill.is-failed .status-dot { background: #ffc4b8; box-shadow: 0 0 0 3px rgba(255, 196, 184, .15); }

/* --------------------------------------------------------------------------
   Page / hero
   -------------------------------------------------------------------------- */

.page {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 0 30px 46px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, .65fr);
  gap: 58px;
  align-items: end;
  padding: 50px 2px 38px;
}

.hero-kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.kicker-line { display: block; width: 30px; height: 1px; background: var(--accent); }

.hero h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(54px, 5.7vw, 84px);
  line-height: .93;
  letter-spacing: -.045em;
  font-weight: 500;
  color: var(--ink);
}
.hero h1 em {
  font-weight: 400;
  color: var(--accent);
  letter-spacing: -.035em;
}

.hero-copy > p {
  max-width: 580px;
  margin: 22px 0 0;
  color: var(--ink-3);
  font-size: 15px;
  line-height: 1.62;
}

.hero-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.hero-tags span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .62);
  color: var(--ink-3);
  font-size: 11.5px;
  font-weight: 600;
}
.hero-tags .icon { width: 14px; height: 14px; color: var(--accent); }

.guard-card {
  position: relative;
  padding: 24px 24px 19px;
  border-radius: 22px;
  overflow: hidden;
  background:
    radial-gradient(circle at 100% 0%, rgba(244, 200, 30, .30), transparent 45%),
    linear-gradient(140deg, #1b2b24, #12201a);
  color: #f6f1e7;
  box-shadow: 0 30px 55px -36px rgba(16, 28, 22, .7);
}
.guard-card::after {
  content: "";
  position: absolute;
  width: 160px;
  height: 160px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 50%;
  right: -60px;
  bottom: -75px;
}
.guard-head { display: flex; align-items: center; gap: 11px; padding-bottom: 17px; border-bottom: 1px solid rgba(255, 255, 255, .13); }
.guard-icon {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 11px;
  background: rgba(255, 255, 255, .09);
  border: 1px solid rgba(255, 255, 255, .12);
  color: #b9f3d6;
}
.guard-head > div { display: flex; flex-direction: column; line-height: 1.2; }
.guard-head strong { font-size: 13px; letter-spacing: .01em; }
.guard-head > div span { color: rgba(246, 241, 231, .52); font-size: 10.5px; margin-top: 3px; }
.live-pill {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(185, 243, 214, .1);
  border: 1px solid rgba(185, 243, 214, .2);
  color: #b9f3d6;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.live-pill i { width: 5px; height: 5px; border-radius: 50%; background: #b9f3d6; animation: pulse 2.2s infinite; }

.guard-card ul { list-style: none; margin: 15px 0 12px; padding: 0; display: grid; gap: 9px; }
.guard-card li {
  display: flex;
  align-items: center;
  gap: 9px;
  color: rgba(246, 241, 231, .82);
  font-size: 12px;
}
.guard-card li .icon { width: 13px; height: 13px; color: #8dd9b8; stroke-width: 2.2; }
.guard-card > p { margin: 0; color: rgba(246, 241, 231, .38); font-size: 9.5px; line-height: 1.5; }

@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(185, 243, 214, .25); }
  50% { opacity: .65; box-shadow: 0 0 0 4px rgba(185, 243, 214, 0); }
}

/* --------------------------------------------------------------------------
   Workspace / cards
   -------------------------------------------------------------------------- */

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.46fr) minmax(360px, .78fr);
  gap: 24px;
  align-items: start;
}

.workspace-main, .workspace-rail { display: grid; gap: 20px; min-width: 0; }

.card {
  position: relative;
  min-width: 0;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}

.card-head {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  margin-bottom: 22px;
}
.card-head-compact { align-items: center; margin-bottom: 18px; }

.step-badge {
  flex: none;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink-3);
  background: var(--card-2);
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -.03em;
}

.card-title { min-width: 0; }
.card-title h2, .modal-title h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -.028em;
}
.card-title > p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.45;
}
.eyebrow-small {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .15em;
  text-transform: uppercase;
}
.card-title .eyebrow-small { margin-bottom: 5px; }

.scan-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid #cfe8da;
  background: #eff9f3;
  color: var(--green-dark);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.scan-state i {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--green);
  animation: pulse 2.2s infinite;
}

/* Fields */

.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-grid-3 { grid-template-columns: 1.05fr 1.2fr .9fr; }
.smtp-address-grid { grid-template-columns: minmax(0, 1fr) 116px; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; margin-top: 14px; }
.field-grid .field { margin-top: 0; }
.field-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .01em;
}
.field-label em {
  color: var(--muted);
  font-style: normal;
  font-size: 10px;
  font-weight: 500;
}
.field-label-row { justify-content: space-between; width: 100%; }

.meter {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0;
}
.meter.is-over { color: var(--red); }

input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="number"],
select,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid #dcd8ca;
  border-radius: 10px;
  background: #ffffff;
  color: var(--ink);
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="number"],
select {
  height: 44px;
  padding: 0 12px;
  font-size: 13px;
}
textarea { padding: 12px; resize: vertical; }

input::placeholder, textarea::placeholder { color: #9aa096; }
input:hover, select:hover, textarea:hover { border-color: #c7c2b2; }
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(138, 101, 0, .16);
  background: #fff;
}
input:disabled { opacity: .55; cursor: not-allowed; }
select {
  appearance: none;
  padding-right: 34px;
  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='%237a857e' 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;
}

.select-wrap { position: relative; margin-left: auto; flex: none; }
.select-wrap select { height: 36px; font-size: 11.5px; padding: 0 31px 0 11px; border-radius: 999px; background-color: var(--card-2); }
.select-wrap > .icon { position: absolute; right: 11px; top: 50%; transform: translateY(-50%); pointer-events: none; display: none; }
.select-wrap .sr-only + select { min-width: 155px; }

.input-with-chip { position: relative; display: block; }
.input-with-chip input { padding-right: 106px; }
.risk-chip {
  position: absolute;
  right: 7px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 9.5px;
  line-height: 1.2;
  font-weight: 700;
  white-space: nowrap;
  background: #f4f2ea;
  color: var(--muted);
  border: 1px solid #e8e5da;
  pointer-events: none;
}
.risk-chip::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .75; }
.risk-chip.good { color: var(--green-dark); background: var(--green-soft); border-color: #c6e5d5; }
.risk-chip.warn { color: var(--amber); background: var(--amber-soft); border-color: #eeddb5; }
.risk-chip.bad { color: var(--red); background: var(--red-soft); border-color: #f0c8c0; }

.field-help {
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.4;
}
.field-help.is-warn { color: var(--amber); }
.field-help.is-bad { color: var(--red); }
.field-help .suggest-subject {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--accent-dark);
  font-weight: 700;
  font-size: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.fine-print {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 0;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.5;
}
.fine-print code, .test-send code {
  padding: 1px 4px;
  border-radius: 4px;
  background: #f4f1e8;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: .92em;
}
.fine-print .icon { margin-top: 1px; color: var(--green); }

/* Details panels */

.advanced-panel {
  margin-top: 18px;
  border: 1px solid var(--line-soft);
  border-radius: 13px;
  background: #fbfaf6;
  overflow: hidden;
}
.advanced-panel summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 14px;
  cursor: pointer;
  user-select: none;
}
.advanced-panel summary::-webkit-details-marker { display: none; }
.advanced-panel summary > span:nth-child(2) { display: flex; flex-direction: column; min-width: 0; }
.advanced-panel summary strong { font-size: 11.5px; font-weight: 700; }
.advanced-panel summary small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.summary-icon {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 8px;
  background: #f4f1e6;
  color: var(--ink-3);
  flex: none;
}
.summary-icon .icon { width: 14px; height: 14px; }
.summary-chevron { margin-left: auto; color: var(--muted); transition: transform .2s ease; }
.advanced-panel[open] .summary-chevron { transform: rotate(90deg); }
.advanced-inner { padding: 0 14px 14px; border-top: 1px solid var(--line-soft); }
.advanced-inner .field { margin-top: 12px; }
.advanced-inner .fine-print { margin-top: 10px; }
.advanced-panel.compact .advanced-inner { padding-top: 6px; }

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink-3);
  font-size: 11.5px;
  cursor: pointer;
}
.checkbox-row input {
  width: 16px; height: 16px;
  accent-color: var(--accent);
  flex: none;
}
.checkbox-row > span { color: var(--muted); font-size: 10.5px; }

/* Audience */

.audience-count {
  margin-left: auto;
  display: flex;
  align-items: baseline;
  gap: 4px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card-2);
  white-space: nowrap;
}
.audience-count strong { font-family: var(--serif); font-size: 17px; font-weight: 600; line-height: 1; }
.audience-count span { color: var(--muted); font-size: 9.5px; }

.audience-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.audience-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: var(--muted);
  font-size: 10.5px;
}
.audience-meta span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tiny-dot { width: 6px; height: 6px; border-radius: 50%; background: #b4b0a4; flex: none; }
.tiny-dot.is-ready { background: var(--green); box-shadow: 0 0 0 3px rgba(31, 122, 88, .09); }
.tiny-dot.is-warn { background: var(--amber); }

.toolbar-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

.recipient-input {
  min-height: 136px;
  max-height: 280px;
  border-color: #dcd8ca;
  background:
    linear-gradient(90deg, rgba(231, 227, 214, .5) 1px, transparent 1px) 0 0 / 40px 100%,
    #ffffff;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.8;
  letter-spacing: -.015em;
}
.recipient-input:focus { background: #fff; }
.audience-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 10px; }
.over-limit { color: var(--red); font-size: 10.5px; font-weight: 700; white-space: nowrap; }

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: transform .16s ease, background .16s ease, border-color .16s ease, color .16s ease, opacity .16s ease;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(0); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:focus-visible, .icon-btn:focus-visible, .segment:focus-visible, .smtp-pill:focus-visible, .viewport-toggle button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.btn.is-loading .icon { animation: spin .9s linear infinite; }
.btn-sm { min-height: 31px; padding: 0 10px; font-size: 10.5px; border-radius: 7px; }
.btn-quiet {
  border-color: var(--line);
  background: #ffffff;
  color: var(--ink-3);
}
.btn-quiet:hover:not(:disabled) { border-color: #c7c2b2; color: var(--ink); background: #fff; }
.btn-dark { background: var(--ink); border-color: var(--ink); color: #ffffff; }
.btn-dark:hover:not(:disabled) { background: var(--ink-2); }
.btn-accent {
  background: var(--accent-bright);
  border-color: #e2b900;
  color: #201a00;
  box-shadow: 0 9px 18px -13px rgba(196, 154, 0, .85);
}
.btn-accent:hover:not(:disabled) { background: #ffd633; border-color: #e2b900; }
.btn-large { min-height: 50px; padding: 0 20px; border-radius: 12px; font-size: 13px; width: 100%; }

.icon-btn {
  width: 34px; height: 34px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink-3);
  cursor: pointer;
  transition: border-color .16s ease, color .16s ease, background .16s ease;
}
.icon-btn:hover { border-color: #c7c2b2; color: var(--ink); }
.icon-btn.sm { width: 30px; height: 30px; }
.icon-btn.danger:hover { color: var(--red); border-color: #e7beb6; background: var(--red-soft); }

/* --------------------------------------------------------------------------
   Editor
   -------------------------------------------------------------------------- */

.editor-card { padding-bottom: 18px; }

.editor-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
  background: var(--card-2);
  flex-wrap: wrap;
}
.segmented {
  display: flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f0eee6;
}
.segment {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
}
.segment.is-active { background: #ffffff; color: var(--ink); box-shadow: 0 2px 6px -4px rgba(23, 35, 30, .6); }

.format-tools { display: flex; align-items: center; gap: 2px; }
.format-tools .icon-btn { border-color: transparent; background: transparent; }
.format-tools .icon-btn:hover { background: #f4f1e6; border-color: #e8e5da; }
.toolbar-divider { width: 1px; height: 18px; margin: 0 4px; background: var(--line); }
.text-icon { font-family: var(--serif); font-size: 11px; font-weight: 600; }

.editor-actions { display: flex; align-items: center; gap: 5px; margin-left: auto; }

.editor-shell {
  border: 1px solid var(--line);
  border-radius: 0 0 12px 12px;
  overflow: hidden;
  background: #f5f3ec;
}

.visual-pane iframe {
  display: block;
  width: 100%;
  height: 560px;
  border: 0;
  background: #efece3;
}

.code-pane { background: #142019; }
.code-pane textarea {
  display: block;
  width: 100%;
  height: 520px;
  padding: 18px;
  border: 0;
  border-radius: 0;
  background: #142019;
  color: #e6e1d5;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.7;
  resize: vertical;
  tab-size: 2;
  caret-color: #f4c81e;
}
.code-pane textarea:focus { box-shadow: inset 0 0 0 2px rgba(138, 101, 0, .45); background: #142019; }
.code-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  border-top: 1px solid rgba(255, 255, 255, .08);
  background: #101a15;
  color: #89968e;
  font-family: var(--mono);
  font-size: 9.5px;
}
.code-status span { display: inline-flex; align-items: center; gap: 5px; }
.code-status .icon { color: #f4c81e; }

.editor-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding-top: 11px;
  color: var(--muted);
  font-size: 9.5px;
}
.editor-foot span { display: inline-flex; align-items: center; gap: 5px; }
.editor-foot .icon { color: var(--accent); }
#editorStatus { color: var(--green); font-weight: 600; }

/* --------------------------------------------------------------------------
   Right rail / preview
   -------------------------------------------------------------------------- */

.preview-card { padding-bottom: 16px; }

.viewport-toggle {
  display: flex;
  gap: 2px;
  margin-left: auto;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card-2);
}
.viewport-toggle button {
  width: 28px; height: 26px;
  display: grid; place-items: center;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.viewport-toggle button.is-active { background: #ffffff; color: var(--ink); box-shadow: 0 2px 6px -5px #000; }

.mail-meta { display: flex; align-items: center; gap: 9px; padding: 10px 0; }
.mail-avatar {
  width: 31px; height: 31px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: var(--accent-bright);
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 600;
  flex: none;
}
.mail-from { display: flex; flex-direction: column; line-height: 1.18; min-width: 0; }
.mail-from strong { font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-from small { color: var(--muted); font-size: 9.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-time { margin-left: auto; color: var(--muted); font-size: 9px; white-space: nowrap; }
.mail-subject {
  margin: 1px 0 2px;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mail-preheader {
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mail-preheader:empty { display: none; }

.preview-stage {
  margin-top: 13px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background:
    linear-gradient(45deg, rgba(231, 227, 214, .20) 25%, transparent 25%, transparent 75%, rgba(231, 227, 214, .20) 75%) 0 0 / 14px 14px,
    linear-gradient(45deg, rgba(231, 227, 214, .20) 25%, transparent 25%, transparent 75%, rgba(231, 227, 214, .20) 75%) 7px 7px / 14px 14px,
    #f7f5ef;
  overflow: hidden;
}
.preview-stage iframe {
  display: block;
  width: 100%;
  height: 410px;
  margin: 0 auto;
  border: 0;
  border-radius: 5px;
  background: #fff;
  box-shadow: 0 12px 28px -18px rgba(23, 35, 30, .55);
  transition: width .28s cubic-bezier(.2, .8, .2, 1);
}
.preview-stage.is-mobile iframe { width: 330px; max-width: 100%; }

.preview-foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding-top: 11px;
  color: var(--muted);
  font-size: 9px;
}
.preview-foot span { display: inline-flex; align-items: center; gap: 5px; }
.safe-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--green); }

/* Readiness */

.readiness-card { padding-bottom: 18px; }
.readiness-head { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.score-ring {
  --score: 0;
  --score-color: var(--accent);
  width: 82px;
  height: 82px;
  border-radius: 50%;
  background: conic-gradient(var(--score-color) calc(var(--score) * 1%), #f0eee6 0);
  display: grid;
  place-items: center;
  flex: none;
  position: relative;
  transition: background .35s ease;
}
.score-ring::before { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: var(--card); }
.score-inner { position: relative; display: flex; align-items: baseline; gap: 2px; }
.score-inner strong { font-family: var(--serif); font-size: 29px; font-weight: 600; letter-spacing: -.05em; line-height: 1; }
.score-inner span { color: var(--muted); font-size: 8.5px; }
.readiness-copy { min-width: 0; }
.readiness-copy h2 { margin: 0; font-family: var(--serif); font-size: 21px; font-weight: 500; line-height: 1.1; letter-spacing: -.025em; }
.readiness-copy p { margin: 5px 0 0; color: var(--muted); font-size: 10.5px; line-height: 1.45; }

.check-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line-soft); }
.check-list li {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  min-height: 39px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line-soft);
}
.check-icon {
  width: 19px; height: 19px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #f4f2ea;
  color: var(--muted);
}
.check-icon .icon { width: 11px; height: 11px; stroke-width: 2.3; }
.check-icon.pass { background: var(--green-soft); color: var(--green); }
.check-icon.warn { background: var(--amber-soft); color: var(--amber); }
.check-icon.fail { background: var(--red-soft); color: var(--red); }
.check-icon.pending { background: var(--blue-soft); color: var(--blue); }
.check-copy { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.check-copy strong { font-size: 10.5px; font-weight: 700; }
.check-copy small { color: var(--muted); font-size: 9.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.check-state {
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.check-state.pass { color: var(--green); }
.check-state.warn { color: var(--amber); }
.check-state.fail { color: var(--red); }
.check-state.pending { color: var(--blue); }

.auth-box {
  margin-top: 15px;
  padding: 12px;
  border: 1px dashed #dcd8ca;
  border-radius: 12px;
  background: #fbfaf6;
}
.auth-head { display: flex; align-items: center; gap: 9px; }
.auth-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.auth-icon {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 8px;
  background: var(--green-soft);
  color: var(--green);
  flex: none;
}
.auth-icon .icon { width: 15px; height: 15px; }
.auth-title > div { display: flex; flex-direction: column; line-height: 1.2; }
.auth-title strong { font-size: 10.5px; }
.auth-title small { color: var(--muted); font-size: 9px; margin-top: 2px; }
.auth-head .btn { margin-left: auto; }
.auth-body { margin-top: 9px; }
.auth-body > p { margin: 0; color: var(--muted); font-size: 9.5px; line-height: 1.4; }
.auth-grid { display: grid; gap: 4px; }
.auth-row { display: grid; grid-template-columns: 46px 18px minmax(0, 1fr); gap: 6px; align-items: center; font-size: 9.5px; }
.auth-row b { font-weight: 700; color: var(--ink-3); }
.auth-row .auth-pill {
  display: inline-grid;
  place-items: center;
  width: 16px; height: 16px;
  border-radius: 50%;
  font-size: 9px;
  background: #f2f0e8;
  color: var(--muted);
}
.auth-row .auth-pill.pass { background: var(--green-soft); color: var(--green); }
.auth-row .auth-pill.warn { background: var(--amber-soft); color: var(--amber); }
.auth-row .auth-pill.fail { background: var(--red-soft); color: var(--red); }
.auth-row span:last-child { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auth-domain { color: var(--ink-3); font-weight: 600; }
.auth-advanced { margin-top: 9px; }
.auth-advanced summary { color: var(--muted); font-size: 9.5px; cursor: pointer; }
.auth-advanced summary span { opacity: .65; }
.auth-advanced input { height: 34px; margin-top: 7px; font-size: 11px; }

.benchmark-box {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
}
.benchmark-box summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
}
.benchmark-box summary::-webkit-details-marker { display: none; }
.benchmark-box summary strong { font-size: 10.5px; }
.benchmark-box summary b {
  display: inline-block;
  margin-left: 5px;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 9px;
}
.benchmark-action { display: inline-flex; align-items: center; gap: 2px; color: var(--muted); font-size: 9px; }
.benchmark-box[open] .benchmark-action .icon { transform: rotate(90deg); }
.benchmark-box .benchmark-action .icon { transition: transform .2s ease; }
.benchmark-bars { display: grid; gap: 7px; margin-top: 12px; }
.benchmark-row { display: grid; grid-template-columns: 92px minmax(0, 1fr) 30px; gap: 8px; align-items: center; font-size: 9px; color: var(--muted); }
.benchmark-track { height: 5px; border-radius: 999px; background: #f1efe7; overflow: hidden; }
.benchmark-track i { display: block; height: 100%; border-radius: inherit; background: var(--green); transition: width .3s ease; }
.benchmark-row b { text-align: right; color: var(--ink-3); font-size: 9px; font-weight: 600; }
.benchmark-box > p { margin: 10px 0 0; color: var(--muted); font-size: 8.5px; line-height: 1.4; }

/* --------------------------------------------------------------------------
   Send card
   -------------------------------------------------------------------------- */

.send-card {
  position: relative;
  overflow: hidden;
  padding: 23px;
  border-radius: var(--radius);
  color: #f7f2e8;
  background:
    radial-gradient(circle at 92% 4%, rgba(244, 200, 30, .35), transparent 36%),
    radial-gradient(circle at 8% 100%, rgba(80, 150, 120, .18), transparent 40%),
    linear-gradient(145deg, #1a2a23, #111d18);
  box-shadow: 0 30px 55px -38px rgba(16, 28, 22, .75);
}
.send-card::after {
  content: "";
  position: absolute;
  width: 220px; height: 220px;
  border: 1px solid rgba(255, 255, 255, .065);
  border-radius: 50%;
  right: -110px; top: -120px;
  pointer-events: none;
}
.send-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.send-card .eyebrow-small { color: rgba(247, 242, 232, .45); }
.send-head h2 { margin: 0; font-family: var(--serif); font-size: 27px; font-weight: 500; letter-spacing: -.03em; line-height: 1.05; }
.send-count { display: flex; align-items: baseline; gap: 3px; padding-top: 4px; }
.send-count strong { font-family: var(--serif); font-size: 25px; font-weight: 500; line-height: 1; }
.send-count span { color: rgba(247, 242, 232, .45); font-size: 9.5px; white-space: nowrap; }

.send-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin: 19px 0 18px;
  border-top: 1px solid rgba(255, 255, 255, .11);
  border-bottom: 1px solid rgba(255, 255, 255, .11);
}
.send-summary > div { padding: 12px 0; }
.send-summary > div + div { padding-left: 13px; border-left: 1px solid rgba(255, 255, 255, .09); }
.send-summary span { display: block; color: rgba(247, 242, 232, .42); font-size: 8.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.send-summary strong { display: block; margin-top: 2px; font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.send-card .btn-accent { background: #f4c81e; border-color: #e2b900; color: #201a00; box-shadow: 0 12px 22px -16px rgba(244, 200, 30, .9); }
.send-card .btn-accent:hover:not(:disabled) { background: #ffd633; border-color: #ffd633; }
.send-card .btn-accent:disabled { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .12); color: rgba(255, 255, 255, .45); box-shadow: none; }
.send-note { margin: 9px 0 0; color: rgba(247, 242, 232, .42); font-size: 9.5px; line-height: 1.45; text-align: center; }
.send-note.is-warn { color: #f7d979; }

.test-send { margin-top: 16px; border-top: 1px solid rgba(255, 255, 255, .11); }
.test-send summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 13px;
  color: rgba(247, 242, 232, .7);
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
}
.test-send summary::-webkit-details-marker { display: none; }
.test-send summary span { color: #b9f3d6; font-size: 8.5px; letter-spacing: .08em; text-transform: uppercase; }
.test-form { display: flex; gap: 6px; margin-top: 9px; }
.test-form input {
  height: 37px;
  border-color: rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .07);
  color: #fff;
  font-size: 11px;
}
.test-form input::placeholder { color: rgba(255, 255, 255, .35); }
.test-form input:focus { background: rgba(255, 255, 255, .1); border-color: #b9f3d6; box-shadow: 0 0 0 3px rgba(185, 243, 214, .08); }
.test-form .btn { flex: none; background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .16); color: #fff; }
.test-form .btn:hover { background: rgba(255, 255, 255, .16); }
.test-send > p { margin: 8px 0 0; color: rgba(247, 242, 232, .35); font-size: 8.5px; }
.test-send code { background: rgba(255, 255, 255, .1); color: rgba(255, 255, 255, .7); }

.rail-disclaimer {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin: 0 3px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.45;
}
.rail-disclaimer .icon { color: var(--amber); margin-top: 1px; }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 8px 30px 28px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  border-top: 1px solid rgba(231, 227, 214, .8);
  color: var(--muted);
  font-size: 9.5px;
}
.site-footer span:first-child { color: var(--ink-3); font-weight: 600; }

/* --------------------------------------------------------------------------
   Modals
   -------------------------------------------------------------------------- */

.modal {
  width: min(620px, calc(100vw - 28px));
  max-width: none;
  max-height: none;
  padding: 0;
  border: 0;
  border-radius: 23px;
  background: transparent;
  color: var(--ink);
  overflow: visible;
}
.modal::backdrop {
  background: rgba(15, 25, 20, .5);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}
.modal[open] { animation: modal-in .22s cubic-bezier(.2, .8, .2, 1); }
@keyframes modal-in {
  from { opacity: 0; transform: translateY(10px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-panel {
  max-height: calc(100vh - 30px);
  overflow: auto;
  border: 1px solid rgba(231, 227, 214, .9);
  border-radius: 23px;
  background: var(--card);
  box-shadow: 0 40px 90px -35px rgba(10, 20, 15, .65);
  scrollbar-width: thin;
  scrollbar-color: #cfc4b2 transparent;
}

.modal-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 23px 24px 18px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(8px);
}
.modal-icon {
  width: 43px; height: 43px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: var(--card-2);
  border: 1px solid var(--line);
  color: var(--ink-3);
  flex: none;
}
.modal-icon.accent { background: var(--accent-soft); border-color: #efd98a; color: var(--accent-dark); }
.modal-title { min-width: 0; }
.modal-title h2 { font-size: 26px; }
.modal-title p { margin: 4px 0 0; color: var(--muted); font-size: 10.5px; }
.modal-head .icon-btn { margin-left: auto; flex: none; }

.modal-body { padding: 19px 24px 23px; }
.modal-body .field { margin-top: 14px; }
.modal-body .field-grid .field { margin-top: 0; }
.modal-body .field-grid + .field-grid { margin-top: 14px; }
.modal-body .field-grid + .field { margin-top: 14px; }

.password-wrap { position: relative; display: block; }
.password-wrap input { padding-right: 44px; }
.password-toggle {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.password-toggle:hover { background: #f7f5ef; color: var(--ink); }

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}
.modal-actions .btn { min-height: 43px; }
.modal-actions .btn-dark { flex: 1; }
.security-note {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.45;
}
.security-note .icon { color: var(--green); margin-top: 1px; }

/* Dynamic SMTP notice — the required green/red bars */

.notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 15px;
  padding: 12px 13px;
  border: 1px solid #e0dccf;
  border-radius: 11px;
  background: #f7f5ef;
  color: var(--ink-3);
  animation: notice-in .22s ease;
}
@keyframes notice-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.notice.success {
  border-color: #b7dfcb;
  background: var(--green-soft);
  color: var(--green-dark);
}
.notice.error {
  border-color: #efc1b8;
  background: var(--red-soft);
  color: var(--red);
}
.notice.testing {
  border-color: #c8d7e7;
  background: var(--blue-soft);
  color: var(--blue);
}
.notice-icon {
  width: 23px; height: 23px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, .6);
  flex: none;
}
.notice-icon .icon { width: 13px; height: 13px; stroke-width: 2.3; }
.notice-icon.is-spinning .icon { animation: spin .9s linear infinite; }
.notice-copy { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.notice-copy strong { font-size: 11.5px; font-weight: 700; }
.notice-copy > span { margin-top: 3px; font-size: 10px; opacity: .82; word-break: break-word; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Confirm dialog */

.confirm-panel { width: 100%; }
.confirm-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--card-2);
}
.confirm-summary > div { padding: 12px 14px; min-width: 0; }
.confirm-summary > div:nth-child(odd) { border-right: 1px solid var(--line); }
.confirm-summary > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
.confirm-summary span { display: block; color: var(--muted); font-size: 8.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.confirm-summary strong { display: block; margin-top: 3px; font-size: 12px; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.confirm-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 15px;
  padding: 11px 12px;
  border: 1px solid #cce6d7;
  border-radius: 10px;
  background: #f1f9f4;
  color: var(--green-dark);
  font-size: 10.5px;
  line-height: 1.45;
}
.confirm-note.is-warn { border-color: #eeddb5; background: var(--amber-soft); color: var(--amber); }
.confirm-note .icon { margin-top: 1px; flex: none; }
.risk-ack {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid #eeddb5;
  border-radius: 10px;
  background: #fdf8eb;
  align-items: flex-start;
  line-height: 1.45;
}
.risk-ack input { margin-top: 1px; }

.send-progress-panel { padding-top: 22px; }
.progress-status-row { display: flex; align-items: flex-start; gap: 11px; }
.progress-status-row > div { display: flex; flex-direction: column; }
.progress-status-row strong { font-family: var(--serif); font-size: 20px; font-weight: 500; line-height: 1.15; }
.progress-status-row span:not(.progress-spinner) { margin-top: 3px; color: var(--muted); font-size: 10.5px; }
.progress-spinner {
  width: 22px; height: 22px;
  border: 2px solid #e8e5db;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  flex: none;
  margin-top: 3px;
}
.progress-spinner.is-done { border: 0; background: var(--green-soft); animation: none; position: relative; }
.progress-spinner.is-done::after { content: "✓"; color: var(--green); font-size: 13px; font-weight: 700; display: grid; place-items: center; height: 100%; }
.progress-spinner.is-error { border: 0; background: var(--red-soft); animation: none; position: relative; }
.progress-spinner.is-error::after { content: "!"; color: var(--red); font-size: 13px; font-weight: 800; display: grid; place-items: center; height: 100%; }

.progress-track { height: 8px; margin-top: 18px; border-radius: 999px; background: #f0eee6; overflow: hidden; }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #f4c81e, #8a6500); transition: width .35s ease; }
.progress-stats { display: flex; flex-wrap: wrap; gap: 13px; margin-top: 10px; color: var(--muted); font-size: 9.5px; }
.progress-stats span { display: inline-flex; align-items: center; gap: 5px; }
.progress-stats b { color: var(--ink-3); }
.progress-ok i, .progress-fail i { width: 5px; height: 5px; border-radius: 50%; background: var(--green); }
.progress-fail i { background: var(--red); }
.send-log {
  margin-top: 15px;
  max-height: 150px;
  overflow: auto;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: #fbfaf6;
  font-family: var(--mono);
  font-size: 9.5px;
  line-height: 1.55;
}
.send-log:empty { display: none; }
.log-row { display: flex; align-items: center; gap: 7px; padding: 5px 9px; border-bottom: 1px solid #f2efe6; }
.log-row:last-child { border-bottom: 0; }
.log-row i { width: 5px; height: 5px; border-radius: 50%; background: var(--green); flex: none; }
.log-row.fail i { background: var(--red); }
.log-row span:first-of-type { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-row span:last-child { margin-left: auto; color: var(--muted); white-space: nowrap; }
#cancelJob[disabled] { opacity: .4; }

/* Toasts */

.toast-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 100;
  display: grid;
  gap: 8px;
  width: min(360px, calc(100vw - 36px));
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 12px 13px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 11px;
  background: #17231e;
  color: #f8f2e7;
  box-shadow: 0 18px 34px -18px rgba(8, 15, 11, .65);
  font-size: 11px;
  line-height: 1.4;
  pointer-events: auto;
  animation: toast-in .24s cubic-bezier(.2, .8, .2, 1);
}
.toast.leaving { animation: toast-out .2s ease forwards; }
.toast .icon { color: #9fe1c1; margin-top: 1px; flex: none; }
.toast.error { background: #4a231e; }
.toast.error .icon { color: #ffb7a7; }
.toast.warn { background: #3e321b; }
.toast.warn .icon { color: #f4ca81; }
.toast strong { display: block; font-size: 11px; }
.toast span { display: block; margin-top: 1px; color: rgba(255, 255, 255, .62); font-size: 10px; }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toast-out {
  to { opacity: 0; transform: translateY(5px); }
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1220px) {
  .topbar-inner, .page { padding-left: 24px; padding-right: 24px; }
  .hero { gap: 34px; }
  .workspace { grid-template-columns: minmax(0, 1.35fr) minmax(340px, .8fr); }
}

@media (max-width: 1080px) {
  .main-nav { display: none; }
  .hero { grid-template-columns: minmax(0, 1.4fr) minmax(310px, .6fr); gap: 30px; }
  .workspace { grid-template-columns: 1fr; }
  .workspace-rail { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  .preview-card { grid-column: 1; grid-row: 1; }
  .readiness-card { grid-column: 2; grid-row: 1 / span 2; }
  .send-card { grid-column: 1; grid-row: 2; }
  .rail-disclaimer { grid-column: 1 / -1; }
}

@media (max-width: 840px) {
  .hero { grid-template-columns: 1fr; gap: 27px; padding-top: 38px; }
  .hero-copy > p { max-width: 620px; }
  .guard-card { max-width: 620px; }
  .workspace-rail { grid-template-columns: 1fr; }
  .preview-card, .readiness-card, .send-card, .rail-disclaimer { grid-column: 1; grid-row: auto; }
  .field-grid-3 { grid-template-columns: 1fr 1fr; }
  .field-grid-3 .field:last-child { grid-column: 1 / -1; }
  .preview-stage iframe { height: 450px; }
}

@media (max-width: 680px) {
  .topbar-inner { height: 64px; padding: 0 16px; gap: 12px; }
  .brand-copy small { display: none; }
  .brand-mark { width: 36px; height: 36px; }
  .brand-mark svg { width: 27px; height: 27px; }
  .capacity-pill { display: none; }
  .smtp-pill { padding: 8px 11px; font-size: 10.5px; }
  .smtp-pill .icon-sm { display: none; }
  .page { padding: 0 16px 36px; }
  .site-footer { padding: 8px 16px 24px; flex-direction: column; gap: 5px; }
  .hero { padding: 35px 0 28px; }
  .hero h1 { font-size: clamp(47px, 13vw, 64px); }
  .hero-copy > p { font-size: 13.5px; }
  .hero-tags { gap: 6px; }
  .hero-tags span { padding: 6px 9px; font-size: 10px; }
  .card { padding: 19px; border-radius: 16px; }
  .card-title h2 { font-size: 22px; }
  .scan-state { display: none; }
  .field-grid, .field-grid-3 { grid-template-columns: 1fr; }
  .field-grid-3 .field:last-child { grid-column: auto; }
  .smtp-address-grid { grid-template-columns: 1fr 90px; }
  .editor-toolbar { gap: 6px; }
  .format-tools { order: 4; width: 100%; padding-top: 5px; border-top: 1px solid var(--line); }
  .editor-actions { margin-left: auto; }
  .editor-actions .btn span { display: none; }
  .editor-shell { border-radius: 0 0 10px 10px; }
  .visual-pane iframe { height: 440px; }
  .code-pane textarea { height: 400px; }
  .audience-toolbar { align-items: flex-start; flex-direction: column; }
  .audience-meta { width: 100%; }
  .toolbar-actions { width: 100%; justify-content: flex-start; }
  .audience-foot { align-items: flex-start; flex-direction: column; }
  .editor-foot { align-items: flex-start; flex-direction: column; gap: 5px; }
  .preview-stage iframe { height: 400px; }
  .preview-stage.is-mobile iframe { width: 300px; }
  .modal { width: calc(100vw - 18px); }
  .modal-head { padding: 18px 18px 15px; }
  .modal-body { padding: 16px 18px 19px; }
  .modal-title h2 { font-size: 23px; }
  .confirm-summary { grid-template-columns: 1fr; }
  .confirm-summary > div { border-right: 0 !important; }
  .confirm-summary > div + div { border-top: 1px solid var(--line); }
  .confirm-summary > div:nth-child(-n+2) { border-bottom: 0; }
  .send-summary { grid-template-columns: 1fr 1fr; }
  .send-summary > div:nth-child(3) { display: none; }
  .site-footer span:nth-child(2) { display: none; }
}

@media (max-width: 430px) {
  .brand-copy strong { font-size: 13.5px; letter-spacing: -.02em; }
  .smtp-pill { max-width: 148px; }
  .smtp-pill #smtpPillText { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .hero h1 { font-size: 45px; }
  .guard-card { padding: 20px; }
  .subject-field .input-with-chip input { padding-right: 12px; padding-bottom: 27px; }
  .subject-field .risk-chip { top: auto; bottom: 6px; right: 6px; transform: none; }
  .editor-actions .btn { padding: 0 8px; }
  .select-wrap select { min-width: 0; max-width: 142px; }
  .card-head { gap: 10px; }
  .step-badge { width: 34px; height: 34px; font-size: 13px; }
  .preview-stage iframe { height: 380px; }
  .preview-stage.is-mobile iframe { width: 270px; }
  .modal-actions { flex-direction: column-reverse; }
  .modal-actions .btn { width: 100%; }
  .notice { align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
