/* AdManage Mail redesign. Loaded after style.css and overrides it. */
:root {
  --ink: #0f172a;
  --body: #334155;
  --muted: #64748b;
  --border: #e5e7eb;
  --line: #eef0f3;
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --wash: #eff6ff;
  --bg: #f6f7f9;
  --navy: #0c1f33;
  --navy-2: #102841;
  --navy-line: #1e3a5f;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}
body {
  background: var(--bg);
  color: var(--ink);
}
/* Chart SVGs supply their own fills and strokes; these defaults are for icons. */
svg:not([role="img"]) {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
a {
  color: var(--brand);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- buttons ---------- */
button {
  border-radius: 8px;
  min-height: 38px;
  padding: 0 14px;
  font-weight: 500;
  border-color: #e2e8f0;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
button:hover {
  background: #f8fafc;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-weight: 600;
}
.primary:hover {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
}
.secondary {
  background: #fff;
  border: 1px solid #e2e8f0;
  color: var(--ink);
}
.quiet {
  background: transparent;
  border-color: transparent;
  color: var(--body);
}
.quiet:hover {
  background: #f1f5f9;
}
.icon-button {
  width: 36px;
  min-height: 36px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
}
.icon-button:hover {
  background: #f1f5f9;
  color: var(--ink);
}
input,
select,
textarea {
  border-radius: 8px !important;
  border-color: #e2e8f0;
}

/* ---------- sidebar ---------- */
aside.sidebar {
  width: 248px;
  padding: 18px 14px;
  background: var(--navy);
  border-right: 0;
  color: #cbd5e1;
  gap: 16px;
  overflow-y: auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.01em;
}
.brand img {
  width: 28px;
  height: 28px;
}
.brand-pill {
  font-size: 11px;
  font-weight: 600;
  color: #dbeafe;
  background: rgba(59, 130, 246, 0.28);
  padding: 2px 8px;
  border-radius: 999px;
}
.new-blast-button {
  width: 100%;
  min-height: 44px;
  margin: 0;
}
aside nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
aside nav button {
  justify-content: flex-start;
  width: 100%;
  min-height: 40px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #cbd5e1;
  font-weight: 500;
  text-align: left;
}
aside nav button span:first-of-type {
  flex: 1;
}
aside nav button:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}
aside nav button.active {
  background: rgba(59, 130, 246, 0.2);
  color: #fff;
}
aside nav button.active svg {
  color: #93c5fd;
}
.nav-group {
  margin: 14px 10px 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #8aa0bb;
}
.nav-count {
  font-size: 12px;
  color: #94a3b8;
}
.nav-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f59e0b;
  flex: none !important;
}
.aside-bottom {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0;
  border: 0;
  color: #cbd5e1;
}
.side-sync {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 12px;
  border: 1px solid var(--navy-line);
  border-radius: 10px;
  background: var(--navy-2);
  font-size: 12.5px;
  color: #e2e8f0;
  line-height: 1.35;
}
.side-sync .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  flex: none;
  margin: 0;
}
.side-sync .dot.warning {
  background: #f59e0b;
}
.side-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 4px;
  font-size: 13px;
}
.side-user #side-user-email {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.avatar-initials {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--navy-line);
  color: #dbeafe;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 12px;
  flex: none;
}
.side-user .icon-button {
  color: #94a3b8;
}
.side-user .icon-button:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

/* ---------- top bar ---------- */
main {
  margin-left: 248px;
}
main > header {
  position: sticky;
  top: 0;
  z-index: 5;
  height: 60px;
  padding: 0 clamp(16px, 3vw, 40px);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.crumbs {
  font-weight: 500;
}
.cmdk-trigger {
  min-width: 260px;
  justify-content: flex-start;
  color: var(--muted);
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  font-weight: 400;
}
.cmdk-trigger span {
  flex: 1;
  text-align: left;
}
kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  color: var(--muted);
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 0 5px;
  background: #fff;
}

/* ---------- pages ---------- */
.page {
  max-width: 1240px;
  padding: 28px clamp(16px, 3vw, 40px) 64px;
}
.page-heading {
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.page-heading .eyebrow {
  display: none;
}
.page-heading h1,
h1 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0 0 4px;
}
.page-heading p {
  margin: 0;
}
.section-heading {
  margin: 28px 0 10px;
}
.section-heading h2 {
  font-size: 16px;
  font-weight: 600;
}
.card {
  border-color: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.hint {
  color: var(--muted);
}
.note {
  border-radius: 12px;
  padding: 14px 16px;
  gap: 12px;
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1e3a8a;
}
.note > span {
  display: none;
}
.sync-health {
  border-radius: 10px;
}

/* stats become separate cards */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  background: transparent;
  border: 0;
  border-radius: 0;
  margin-bottom: 24px;
}
.stats > div,
.stats > div:last-child {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: var(--shadow);
}
.stats span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
}
.stats strong {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* chips + legacy badges */
.chip,
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border: 0;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.chip::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.7;
}
.chip-neutral,
.badge {
  background: #f1f5f9;
  color: #475569;
}
.chip-slate {
  background: #f1f5f9;
  color: #334155;
}
.chip-green,
.badge.delivered,
.badge.active,
.badge.completed {
  background: #dcfce7;
  color: #166534;
}
.chip-blue,
.badge.preparing,
.badge.ready,
.badge.queued,
.badge.running {
  background: #eff6ff;
  color: #1d4ed8;
}
.chip-amber,
.badge.paused,
.badge.unknown,
.badge.failed,
.badge.cancelled {
  background: #fef3c7;
  color: #92400e;
}
.chip-red,
.badge.bounced,
.badge.suppressed {
  background: #fee2e2;
  color: #991b1b;
}

/* tables */
.data-table th {
  background: #fafbfc;
  text-transform: none;
  letter-spacing: 0;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  padding: 10px 16px;
}
.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}
.data-table tbody tr:hover {
  background: #fafbfc;
}
.table-scroll {
  overflow-x: auto;
}
.muted-cell {
  color: var(--body);
  font-size: 13px;
  white-space: nowrap;
}
.num {
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}
.row {
  padding: 14px 18px;
}

/* ---------- overview attention ---------- */
.attention {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.attention h2 {
  margin: 0;
  padding: 8px 12px 6px;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
}
.attention-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 6px;
}
.attention-item {
  justify-content: flex-start;
  min-height: 60px;
  padding: 10px 14px;
  border: 0;
  border-radius: 10px;
  background: #f8fafc;
  text-align: left;
  gap: 12px;
}
.attention-item.tone-amber {
  background: #fffbeb;
}
.attention-item:hover {
  filter: brightness(0.98);
}
.attention-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  background: #e0e7ff;
  color: #3730a3;
}
.tone-amber .attention-icon {
  background: #fef3c7;
  color: #b45309;
}
.tone-blue .attention-icon {
  background: #dbeafe;
  color: #1d4ed8;
}
.attention-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.attention-text strong {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.attention-text span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}
.attention-item > svg {
  color: var(--muted);
}

/* ---------- campaigns ---------- */
.starters h2 {
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  margin: 0 0 10px;
}
.starter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.starter {
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 10px;
  padding: 16px;
  min-height: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  text-align: left;
  box-shadow: var(--shadow);
}
.starter:hover {
  border-color: #bfdbfe;
  background: #fff;
}
.starter-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  font-weight: 600;
}
.starter-mark.tone-slate {
  background: #f1f5f9;
  color: #334155;
}
.starter-mark.tone-blue {
  background: #eff6ff;
  color: #1d4ed8;
}
.starter-mark.tone-orange {
  background: #fff7ed;
  color: #c2410c;
}
.starter-mark.tone-green {
  background: #ecfdf5;
  color: #047857;
}
.starter-mark.tone-violet {
  background: #f5f3ff;
  color: #6d28d9;
}
.starter-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.starter-text strong {
  font-weight: 600;
}
.starter-text span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
}
.list-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.tab {
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: #475569;
}
.tab[aria-selected="true"] {
  background: var(--wash);
  color: var(--brand-dark);
}
.tab-count {
  font-size: 12px;
  color: var(--muted);
  background: #f1f5f9;
  border-radius: 999px;
  padding: 0 7px;
}
.search-input {
  min-height: 36px;
  width: min(260px, 100%);
  padding: 0 12px;
  border: 1px solid #e2e8f0;
  background: #fff;
}
.link-cell {
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  max-width: 380px;
}
.link-cell:hover {
  background: transparent;
}
.link-cell strong {
  font-weight: 600;
}
.link-cell span {
  color: var(--muted);
  font-weight: 400;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 380px;
}
.link-cell:hover strong {
  color: var(--brand);
}
.row-actions {
  text-align: right;
  white-space: nowrap;
}
.row-actions button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 13px;
}
.campaign-table {
  min-width: 760px;
}

/* ---------- composer ---------- */
.compose-grid {
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.compose-grid > div:last-child {
  position: sticky;
  top: 76px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.editor {
  padding: 20px;
}
.ab-toggle {
  margin: 4px 0 14px;
  min-height: 34px;
  border: 1px dashed #93c5fd;
  background: #f8fbff;
  color: var(--brand-dark);
  font-size: 13px;
}
.ab-fields {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  margin: 4px 0 8px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid var(--line);
}
.ab-rule {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #475569;
}
.ab-rule select {
  width: auto;
  min-height: 34px;
  padding: 0 8px;
}
.format-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfd;
}
.format-tools button {
  min-height: 32px;
  padding: 0 10px;
  border: 0;
  background: transparent;
  font-size: 13px;
  color: #334155;
}
.format-tools button:hover {
  background: #eef2f7;
}
.format-tools [data-insert] {
  color: var(--brand-dark);
}
#draft-body {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13.5px;
  line-height: 1.7;
}
.html-image-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.html-image-row > img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border-radius: 6px;
  background: white;
}
.html-image-row > div {
  flex: 1;
  min-width: 0;
}
.image-source {
  overflow-wrap: anywhere;
}
.claude-import-dialog {
  width: min(640px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  color: #172554;
}
.claude-import-dialog::backdrop {
  background: rgb(15 23 42 / 50%);
}
.claude-import-dialog h2 {
  margin-top: 0;
}
.claude-import-dialog details {
  margin: 18px 0;
}
.claude-import-dialog summary {
  cursor: pointer;
  font-weight: 600;
}
.claude-import-dialog .editor-actions {
  justify-content: flex-end;
}
.html-image-row .editor-actions {
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.ready-card {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.ready-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}
.ready-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}
#ready-count {
  font-size: 13px;
  color: #475569;
}
.ready-bar {
  height: 6px;
  margin: 10px 0 12px;
  border-radius: 999px;
  background: #eef2f7;
  overflow: hidden;
}
.ready-bar span {
  display: block;
  height: 100%;
  background: var(--brand);
  transition: width 0.2s ease-out;
}
#ready-items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px 16px;
}
#ready-items li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
#ready-items li > span:nth-child(2) {
  display: flex;
  flex-direction: column;
}
#ready-items strong {
  font-weight: 500;
}
#ready-items small {
  color: var(--muted);
  font-size: 12px;
}
.ready-mark {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  margin-top: 1px;
}
.ok .ready-mark {
  background: #dcfce7;
  color: #166534;
}
.todo .ready-mark {
  background: #fef3c7;
  color: #92400e;
}
.gmail-shell {
  border-radius: var(--radius);
  border-color: var(--border);
  box-shadow: var(--shadow);
}
.test-card,
.blast-audience {
  padding: 18px;
}
.blast-audience h2,
.test-card h2 {
  font-size: 15px;
  font-weight: 600;
}
.delivery-when {
  border: 0;
  margin: 14px 0 6px;
  padding: 0;
}
.delivery-when legend {
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 6px;
  padding: 0;
}
.delivery-when .segmented {
  margin-bottom: 8px;
}
.checkbox {
  flex-wrap: wrap;
}
.checkbox-hint {
  flex-basis: 100%;
  padding-left: 26px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}
.segmented {
  background: #eef1f5;
  border: 0;
  border-radius: 9px;
  padding: 3px;
  gap: 2px;
}
.segmented button {
  min-height: 32px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #475569;
}
.segmented button.active {
  background: #fff;
  color: var(--ink);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}
.blast-review {
  border: 1.5px solid #bfdbfe;
  margin-top: 20px;
  padding: 20px;
}
.review-summary {
  display: grid;
  grid-template-columns: minmax(110px, 160px) 1fr;
  margin: 0 0 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.review-summary dt,
.review-summary dd {
  margin: 0;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}
.review-summary dt {
  color: var(--muted);
  background: #fafbfc;
}
.review-summary dt:last-of-type,
.review-summary dd:last-of-type {
  border-bottom: 0;
}

/* ---------- segments ---------- */
.segments-card {
  padding: 0;
}
.segment-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
}
.segment-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.segment-text strong {
  font-weight: 600;
}
.segment-text span {
  color: var(--muted);
  font-size: 13px;
}
.segment-size {
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  color: var(--body);
  white-space: nowrap;
}
.segment-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  align-items: end;
  padding: 14px 18px;
  background: #fafbfc;
}
.segment-form label {
  margin: 0;
}
.pad {
  padding: 14px 18px;
  margin: 0;
}

/* ---------- send activity report ---------- */
.blast-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #475569;
  margin: 0;
}
.blast-picker select {
  min-width: 280px;
  max-width: 100%;
  margin: 0;
}
.blast-report {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 28px;
}
.report-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.report-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}
.report-head p {
  margin: 2px 0 0;
}
.report-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.quiet-link {
  font-weight: 500;
  text-decoration: none;
}
.report-warning {
  padding: 12px 14px;
  border-radius: 12px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #78350f;
}
.report-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}
.report-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.report-stat span {
  color: var(--muted);
  font-size: 13px;
}
.report-stat strong {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.report-stat small {
  color: #475569;
  font-size: 12px;
}
.report-columns {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-start;
}
.report-columns > .report-card {
  flex: 3 1 440px;
  min-width: 0;
}
.report-side {
  flex: 2 1 300px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.report-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
}
.report-card h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}
.report-card > .hint {
  margin: 2px 0 12px;
}
.card-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.bar-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 0;
  border-top: 1px solid #f1f5f9;
}
.bar-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}
.bar-label {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.bar-label span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bar-track {
  height: 6px;
  border-radius: 999px;
  background: #eef2f7;
  overflow: hidden;
}
.bar-track span {
  display: block;
  height: 100%;
  background: var(--brand);
  border-radius: 999px;
}
.variant {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 10px;
  padding: 10px 0;
  border-top: 1px solid #f1f5f9;
}
.variant small {
  grid-column: 2;
  color: #475569;
}
.variant-key {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  font-weight: 600;
  color: #475569;
  background: #f1f5f9;
  border-radius: 4px;
  padding: 1px 6px;
  align-self: start;
}
.variant.winner .variant-key {
  background: #dcfce7;
  color: #166534;
}
.variant.winner .variant-subject {
  font-weight: 600;
}
.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.filter-chip {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  color: #475569;
  background: #fff;
}
.filter-chip[aria-pressed="true"] {
  background: var(--wash);
  border-color: #bfdbfe;
  color: var(--brand-dark);
}
.report-card .table-scroll {
  margin: 0 -18px -16px;
}
.report-card .data-table {
  width: 100%;
}

/* ---------- command palette ---------- */
.cmdk {
  width: min(560px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.28);
  margin-top: 12vh;
}
.cmdk::backdrop {
  background: rgba(15, 23, 42, 0.45);
}
.cmdk-input {
  width: 100%;
  border: 0 !important;
  border-bottom: 1px solid var(--line) !important;
  border-radius: 0 !important;
  padding: 16px 18px;
  font-size: 15px;
  outline: none;
}
.cmdk-list {
  list-style: none;
  margin: 0;
  padding: 6px;
  max-height: 360px;
  overflow-y: auto;
}
.cmdk-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
}
.cmdk-list li[aria-selected="true"],
.cmdk-list li:hover {
  background: var(--wash);
}
.cmdk-list small {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 50%;
}
.cmdk-empty {
  color: var(--muted);
  cursor: default !important;
}

/* ---------- login ---------- */
.login {
  background: radial-gradient(circle at 50% 0%, #dbeafe, transparent 60%), var(--bg);
}
.login-card {
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.1);
}

/* ---------- responsive ---------- */
@media (max-width: 1150px) {
  aside.sidebar {
    width: 220px;
  }
  main {
    margin-left: 220px;
  }
}
@media (max-width: 980px) {
  .compose-grid {
    grid-template-columns: 1fr;
  }
  .compose-grid > div:last-child {
    position: static;
  }
}
@media (max-width: 760px) {
  aside.sidebar {
    position: static;
    width: auto;
    padding: 12px 16px;
    gap: 10px;
  }
  aside nav {
    flex-direction: row;
    overflow-x: auto;
    gap: 4px;
    padding-bottom: 4px;
  }
  aside nav button {
    width: auto;
    flex: none;
  }
  .nav-group,
  .aside-bottom .side-sync {
    display: none;
  }
  main {
    margin-left: 0;
  }
  main > header {
    position: static;
  }
  .cmdk-trigger {
    min-width: 0;
  }
  .cmdk-trigger span,
  .cmdk-trigger kbd {
    display: none;
  }
  .page {
    padding: 20px 16px 48px;
  }
  .blast-picker,
  .blast-picker select {
    width: 100%;
    min-width: 0;
  }
  #contacts-list .row {
    flex-direction: column;
    align-items: stretch;
  }
  #contacts-list .row > div:first-child {
    min-width: 0;
    overflow-wrap: anywhere;
  }
  #contacts-list .row-right {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  #contacts-list .row-right .quiet {
    font-size: 13px;
    min-height: 44px;
    padding: 0 10px;
  }
}

.draft-links-panel {
  margin-bottom: 24px;
}
.draft-links-panel input {
  width: 100%;
  font-size: 13px;
}
.draft-links-panel hr {
  border: 0;
  border-top: 1px solid var(--border, #e2e8f0);
  margin: 24px 0;
}
.draft-links-panel .editor-actions {
  flex-wrap: wrap;
}
.draft-links-panel a.button {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

/* ---------------------------------------------------------------- compose steps + autosave */
#save-status.is-saved::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: #16a34a;
  vertical-align: 1px;
}
.compose-grid[hidden],
.compose-email[hidden],
.compose-settings[hidden],
.compose-start[hidden] {
  display: none;
}
.compose-settings {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.compose-settings > .blast-audience {
  order: -1;
}
@media (max-width: 900px) {
  .compose-settings {
    grid-template-columns: 1fr;
  }
}

/* ---------------------------------------------------------------- version history */
.history-panel {
  margin-bottom: 18px;
}
.history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 420px;
  overflow: auto;
}
.history-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 12px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.history-meta {
  min-width: 0;
}
.history-meta strong {
  display: block;
  font-size: 13px;
}
.history-meta span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.history-actions {
  display: flex;
  gap: 6px;
}
.history-actions button {
  min-height: 32px;
  font-size: 13px;
}
.history-preview {
  grid-column: 1 / -1;
  height: 360px;
  max-width: none;
  border: 1px solid var(--line);
}

/* ---------------------------------------------------------------- AI rewrite menu */
.ai-menu {
  position: fixed;
  z-index: 50;
  display: flex;
  flex-direction: column;
  min-width: 170px;
  padding: 4px;
  border: 1px solid #c7d2fe;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.16);
}
.ai-menu[hidden] {
  display: none;
}
.ai-menu button {
  min-height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}
.ai-menu button:hover,
.ai-menu button:focus-visible {
  background: #eef2ff;
  outline: none;
}

/* ---------------------------------------------------------------- preview header */
.preview-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.preview-head .preview-views {
  margin: 0;
}
.preview-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.preview-head .segmented button {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}
.icon {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.edit-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--brand);
  border-radius: 9px;
  background: var(--brand);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.edit-toggle:hover {
  background: var(--brand-dark);
}
.edit-toggle .icon {
  width: 14px;
  height: 14px;
}

/* ---------------------------------------------------------------- email frame scaled to fit */
.gmail-shell .preview-frame {
  position: relative;
  display: block;
  overflow: hidden;
  height: var(--frame-height, 560px);
}
/* Out of flow, so the unscaled 640px frame never widens the column it is scaled to fit. */
.gmail-shell .preview-frame iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--email-width, 100%);
  max-width: none;
  height: calc(var(--frame-height, 560px) / var(--email-scale, 1));
  transform: scale(var(--email-scale, 1));
  transform-origin: 0 0;
}
#email-editor[hidden],
#email-preview[hidden] {
  display: none;
}

/* ---------------------------------------------------------------- canvas mode (visual editing) */
.compose-grid.canvas-mode {
  grid-template-columns: minmax(0, 1fr);
}
.compose-grid.canvas-mode > .editor,
.compose-grid.canvas-mode .preview-head,
.compose-grid.canvas-mode .preview-disclaimer,
.gmail-shell.editing .gmail-toolbar,
.gmail-shell.editing .gmail-message-heading,
.gmail-shell.editing .gmail-envelope {
  display: none;
}
.compose-grid.canvas-mode > div:last-child {
  position: static;
  gap: 0;
}
.gmail-shell.editing {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  border-top: 0;
  background: #f4f5f7;
}
.gmail-shell.editing .preview-frame {
  --frame-height: max(560px, calc(100vh - 230px));
  background: #f4f5f7;
}

.visual-toolbar {
  container-type: inline-size;
  position: sticky;
  top: 60px;
  z-index: 4;
  border: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  background: #fff;
}
.visual-toolbar[hidden] {
  display: none;
}
.visual-tools {
  display: flex;
  align-items: center;
  gap: 2px;
  min-height: 52px;
  padding: 0 10px;
  overflow-x: auto;
  scrollbar-width: none;
}
.visual-tools::-webkit-scrollbar {
  display: none;
}
.visual-tools > button,
.visual-color {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #475569;
  cursor: pointer;
}
.visual-tools > button:hover,
.visual-color:hover {
  background: #f1f5f9;
  color: var(--ink);
}
.visual-tools > button:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}
.visual-sep {
  flex: none;
  width: 1px;
  height: 20px;
  margin: 0 6px;
  background: var(--border);
}
.visual-color {
  position: relative;
  font-size: 14px;
  font-weight: 700;
}
.visual-color span {
  line-height: 1;
  padding-bottom: 1px;
  border-bottom: 3px solid var(--brand);
}
.visual-color input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.visual-tools > .ai-tool,
.format-tools .ai-tool {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: auto;
  padding: 0 10px;
  color: #4f46e5;
  font-size: 13px;
  font-weight: 600;
}
.visual-tools > .ai-tool:hover {
  background: #eef2ff;
  color: #4338ca;
}
.ai-tool .icon,
.ai-link .icon {
  width: 14px;
  height: 14px;
}
/* Pinned to the right so Done stays reachable while the tools scroll. */
.visual-tools-end {
  position: sticky;
  right: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  flex: none;
  margin-left: auto;
  padding-left: 12px;
  background: #fff;
}
.visual-status {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.visual-done {
  min-height: 34px;
  padding: 0 16px;
  font-size: 13px;
}
.visual-context {
  padding: 10px 12px 12px;
  border-top: 1px solid var(--border);
  background: #fafbfc;
}
.visual-context[hidden],
.visual-row[hidden] {
  display: none;
}
.visual-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px;
}
.visual-row + .visual-row {
  margin-top: 8px;
}
.visual-row label {
  flex: 1 1 240px;
  margin: 0;
  font-size: 12px;
}
.visual-row button {
  min-height: 38px;
}
.visual-row .ai-link {
  min-height: 38px;
}
@container (max-width: 820px) {
  .visual-status {
    display: none;
  }
}

/* ---------------------------------------------------------------- AI suggestions */
.field-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -10px 0 16px;
  min-height: 24px;
}
.field-meta .field-count {
  margin: 0;
}
.ab-fields .field-meta {
  margin: 0;
}
.ai-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: none;
  min-height: 26px;
  margin-left: auto;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #4f46e5;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.ai-link:hover {
  background: #eef2ff;
}
.ai-link[aria-busy="true"] {
  cursor: progress;
  opacity: 0.6;
}
.ai-status {
  color: var(--muted);
  font-size: 12px;
}
.ai-status:empty {
  display: none;
}
.ai-status-block {
  margin: -10px 0 8px;
}
.idea-list {
  display: flex;
  flex-direction: column;
  margin: 0 0 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}
.ab-fields .idea-list {
  margin: 0;
}
.idea-list:empty {
  display: none;
}
.idea {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 40px;
  padding: 9px 12px;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}
.idea:first-child {
  border-top: 0;
}
.idea:hover {
  background: #f8fafc;
}
.idea[aria-pressed="true"] {
  background: var(--wash);
  box-shadow: inset 3px 0 0 var(--brand);
}
.idea small {
  flex: none;
  color: var(--muted);
  font-size: 11px;
}
#image-alt-ai {
  margin: -6px 0 8px;
}

/* ================================================================ composer polish (Beehiiv-style) */
/* One control height everywhere in the composer chrome. */
#compose-page {
  --control: 36px;
}

/* ---------- header ---------- */
#compose-page .page-heading {
  align-items: center;
  margin-bottom: 0;
}
#compose-page .page-heading h1 {
  font-size: 22px;
  margin: 2px 0 2px;
}
#compose-page #back {
  min-height: 28px;
  margin-left: -8px;
  padding: 0 8px;
  font-size: 13px;
  color: var(--muted);
}
#save-status {
  font-size: 12px;
}
#compose-page .heading-controls {
  gap: 4px;
}
#compose-page .heading-controls button {
  min-height: var(--control);
  font-size: 13px;
}
#compose-page .heading-controls .ghost {
  gap: 6px;
  padding: 0 10px;
  border: 0;
  background: transparent;
  color: #475569;
}
#compose-page .heading-controls .ghost:hover,
#compose-page .heading-controls .ghost[aria-expanded="true"] {
  background: #eef1f5;
  color: var(--ink);
}
#compose-page .heading-controls .ghost .icon {
  width: 15px;
  height: 15px;
}
#compose-page .heading-controls .primary {
  margin-left: 8px;
  padding: 0 18px;
}

/* ---------- step tabs ---------- */
.compose-tabs {
  display: flex;
  gap: 24px;
  margin: 18px 0 22px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}
.compose-tabs button {
  position: relative;
  min-height: 42px;
  padding: 0 2px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}
.compose-tabs button:hover {
  background: transparent;
  color: var(--ink);
}
.compose-tabs button[aria-current="step"] {
  color: var(--ink);
  font-weight: 600;
}
.compose-tabs button[aria-current="step"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--brand);
}
.compose-tabs button.done::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 8px;
  border-radius: 50%;
  background: #16a34a;
  vertical-align: 2px;
}

/* ---------- controls share one height ---------- */
#compose-page .segmented {
  height: var(--control);
  padding: 3px;
  align-items: stretch;
}
#compose-page .segmented button {
  min-height: 0;
  height: 100%;
  padding: 0 12px;
  font-size: 13px;
}
#compose-page .edit-toggle {
  min-height: var(--control);
  height: var(--control);
}

/* ---------- sections + fields ---------- */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 14px;
}
.section-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}
.content-head {
  margin-top: 4px;
}
.field {
  margin: 0 0 18px;
}
.field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 24px;
  margin-bottom: 6px;
}
.field-label label {
  margin: 0;
  font-size: 13px;
}
.field-label-end {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.field-label .field-count {
  margin: 0;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.field-label .ai-link {
  margin: 0;
  min-height: 24px;
}
.field > input {
  height: 40px;
  margin: 0;
  font-size: 14px;
}
.field .ai-status {
  margin: 6px 0 0;
}
.ab-toggle {
  min-height: 28px;
  margin: -8px 0 16px;
  padding: 0 8px 0 0;
  border: 0;
  background: transparent;
  color: var(--brand);
  font-size: 13px;
  font-weight: 600;
}
.ab-toggle:hover {
  background: transparent;
  text-decoration: underline;
}
.ab-toggle::before {
  content: "+";
  font-weight: 500;
}
.ab-toggle[aria-expanded="true"]::before {
  content: "";
}
.ab-toggle[aria-expanded="true"] {
  color: var(--muted);
}
.ab-fields {
  margin: 0 0 12px;
  padding: 14px;
  gap: 12px;
}
.ab-fields .field {
  margin: 0;
}
.ab-fields .idea-list {
  margin: 0;
}

/* ---------- start-from (empty email only) ---------- */
.compose-start {
  margin: 0 0 22px;
  padding: 0 0 20px;
  border-bottom: 1px solid var(--line);
}
.compose-start .templates {
  margin: 0 0 12px;
  gap: 8px;
}
.compose-start .templates button {
  min-height: var(--control);
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
}
.compose-start .templates button:hover {
  border-color: #cbd5e1;
}
.compose-start .draft-builder {
  margin: 0;
}

/* ---------- Email step ---------- */
.email-step-preview {
  min-width: 0;
  position: sticky;
  top: 80px;
}
.email-step-preview .inbox-mock {
  position: static;
}
.email-step-preview-tabs {
  margin: 0 0 12px;
  width: fit-content;
}
.email-step-preview [role="tabpanel"][hidden] {
  display: none;
}
.email-opened-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 12px;
  color: var(--muted);
}
.email-opened-body {
  height: 620px;
  min-height: 0;
}
.email-opened-body iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}
.email-preview-dialog {
  width: min(1000px, calc(100vw - 32px));
  height: min(1000px, 90vh);
  max-width: none;
  max-height: 90vh;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #f8fafc;
  color: var(--ink);
}
.email-preview-dialog[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 16px;
}
.email-preview-dialog::backdrop {
  background: #0f172a80;
}
.email-preview-dialog header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.email-preview-dialog h2 {
  margin: 0;
  font-size: 18px;
}
.email-expanded-host {
  min-height: 0;
}
.email-preview-dialog .gmail-shell {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.email-preview-dialog .email-opened-body {
  flex: 1;
}
.compose-email {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 1fr);
  gap: 24px;
  align-items: start;
}
.email-settings .field:last-child {
  margin-bottom: 0;
}
.inbox-mock {
  position: sticky;
  top: 80px;
}
.inbox-mock-title {
  margin: 4px 0 10px;
  font-size: 13px;
  font-weight: 600;
}
.inbox-mock-list {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
}
.inbox-mock-row {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
}
.inbox-mock-row:first-child {
  border-top: 0;
}
.inbox-mock-row.is-new {
  background: #f8faff;
}
.inbox-mock-avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--wash);
}
.ghost-avatar {
  background: #f1f5f9;
}
.inbox-mock-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
}
.inbox-mock-top {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}
.inbox-mock-top small {
  color: var(--muted);
}
.inbox-mock-subject,
.inbox-mock-preview {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 13px;
}
.inbox-mock-preview {
  color: var(--muted);
}
.inbox-mock-line {
  display: block;
  height: 8px;
  margin: 4px 0;
  border-radius: 4px;
  background: #eef1f5;
}
.w40 {
  width: 40%;
}
.w60 {
  width: 60%;
}
.w80 {
  width: 80%;
}
.w90 {
  width: 90%;
}
.inbox-mock .hint {
  margin-top: 10px;
}
@media (max-width: 900px) {
  .compose-email {
    grid-template-columns: 1fr;
  }
  .inbox-mock {
    position: static;
  }
  .email-step-preview {
    position: static;
  }
}

/* ---------- drawers (History, Share) ---------- */
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  width: min(460px, 100vw);
  margin: 0;
  padding: 0 24px 28px;
  border: 0;
  border-left: 1px solid var(--border);
  border-radius: 0;
  background: #fff;
  box-shadow: -16px 0 40px rgba(15, 23, 42, 0.12);
  overflow-y: auto;
  animation: drawer-in 0.18s ease-out;
}
.drawer[hidden] {
  display: none;
}
.drawer > .section-heading {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 -24px 16px;
  padding: 14px 16px 14px 24px;
  border-bottom: 1px solid var(--border);
  background: #fff;
}
.drawer > .section-heading h2 {
  margin: 0;
  font-size: 16px;
}
.drawer h3 {
  margin: 0 0 6px;
  font-size: 14px;
}
.drawer .hint {
  margin: 6px 0 14px;
  font-size: 12px;
  line-height: 1.6;
}
.drawer label {
  margin-bottom: 4px;
}
.drawer input {
  height: 40px;
}
.drawer button:not(.icon-button) {
  min-height: 36px;
}
.drawer-intro {
  margin-top: 0 !important;
}
.drawer .history-list {
  max-height: none;
  overflow: visible;
}
.drawer .history-row {
  padding: 12px 0;
}
.drawer .history-preview {
  height: 300px;
}
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 59;
  background: rgba(15, 23, 42, 0.2);
}
.drawer-backdrop[hidden] {
  display: none;
}
@keyframes drawer-in {
  from {
    transform: translateX(24px);
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .drawer {
    animation: none;
  }
}

/* ---------- content section ---------- */
.html-import {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 4px;
}
.html-import > button {
  min-height: 36px;
  font-size: 13px;
}
.html-import .hint {
  flex-basis: 100%;
  margin: 2px 0 0;
  color: var(--muted);
}
.html-import .hint:empty {
  display: none;
}
.image-optimization {
  margin: 12px 0 18px;
}
.image-optimization .checkbox {
  margin: 0;
  font-weight: 500;
}
.image-optimization .hint:empty {
  display: none;
}

/* ---------- second pass: HTML-first Write tab, email tab fixes ---------- */
.compose-tabs button.done::before {
  content: none;
}
.device-switch button {
  width: 36px;
  padding: 0 !important;
}
.device-switch .icon {
  width: 15px;
  height: 15px;
}
.preview-head {
  flex-wrap: nowrap;
}
.preview-head .preview-views button {
  padding: 0 10px !important;
}
.email-settings {
  padding: 24px;
}
.inbox-mock {
  width: auto;
  padding: 0;
  background: transparent;
  border: 0;
}

.editor .html-only {
  display: none;
}
.editor.is-html .html-only {
  display: flex;
}
.editor.is-html .markdown-only {
  display: none;
}
.visual-callout {
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 18px;
  padding: 16px 18px;
  border: 1px solid #c7d7fe;
  border-radius: 12px;
  background: linear-gradient(180deg, #f5f8ff, #eef3ff);
}
.visual-callout div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.visual-callout strong {
  font-size: 14px;
}
.visual-callout span {
  color: #475569;
  font-size: 13px;
}
.visual-callout .primary {
  flex: none;
  min-height: 36px;
  font-size: 13px;
}
.visual-callout .primary span {
  color: inherit;
  font-size: inherit;
}

.source-details > summary,
.images-panel summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.source-details > summary::-webkit-details-marker,
.images-panel summary::-webkit-details-marker {
  display: none;
}
.source-details > summary::before,
.images-panel summary::before {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 1.5px solid #64748b;
  border-bottom: 1.5px solid #64748b;
  transform: rotate(-45deg);
  transition: transform 0.15s;
}
.source-details[open] > summary::before,
.images-panel details[open] summary::before {
  transform: rotate(45deg);
}
.source-details {
  margin: 0 0 12px;
}
.source-details[open] > summary {
  margin-bottom: 10px;
}
.editor:not(.is-html) .source-details > summary {
  display: none;
}
.editor.is-html .source-label {
  font-size: 0;
  margin: 0;
}
.editor.is-html .source-label textarea {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  margin: 0;
}
.images-panel {
  margin: 0 0 12px !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}
.images-panel details[open] {
  padding: 0 14px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}
.images-panel details[open] summary {
  margin: 0 -14px 6px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 10px 10px 0 0;
}
.summary-meta {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}
@media (prefers-reduced-motion: reduce) {
  .source-details > summary::before,
  .images-panel summary::before {
    transition: none;
  }
}
/* The canvas callout is the one way into visual editing; the header copy stays for JS state only. */
.preview-head #visual-edit {
  display: none !important;
}
.preview-head button {
  white-space: nowrap;
}
.writing-review {
  margin: 0 0 12px;
  padding: 0;
  border-radius: 10px;
}
.writing-review > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.writing-review > summary::-webkit-details-marker {
  display: none;
}
.writing-review > summary::before {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 1.5px solid #64748b;
  border-bottom: 1.5px solid #64748b;
  transform: rotate(-45deg);
}
.writing-review[open] > summary::before {
  transform: rotate(45deg);
}
.writing-review[open] {
  padding-bottom: 12px;
}
.writing-review > :not(summary) {
  margin-left: 14px;
  margin-right: 14px;
}
#live-preview-status:empty {
  display: none;
}
.compose-settings > .card {
  margin-top: 0;
}

/* ---------- review step ---------- */
.blast-review {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr);
  gap: 24px;
  align-items: start;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.blast-review[hidden] {
  display: none;
}
.review-main,
.review-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}
.review-side {
  position: sticky;
  top: 80px;
}
.review-status {
  border-radius: var(--radius);
  border: 1px solid;
  overflow: hidden;
}
.review-status.is-ready {
  border-color: #bbf7d0;
  background: #f0fdf4;
}
.review-status.is-blocked {
  border-color: #fde68a;
  background: #fffbeb;
}
.review-status-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
}
.review-status-head strong {
  font-size: 15px;
}
.review-status.is-ready .review-status-head strong::before {
  content: "✓";
  margin-right: 8px;
  color: #16a34a;
}
.review-status-head span {
  color: #64748b;
  font-size: 13px;
}
.review-issue {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px;
  border-top: 1px solid rgba(180, 130, 20, 0.18);
  background: rgba(255, 255, 255, 0.55);
}
.review-status.is-ready .review-issue {
  border-top-color: #dcfce7;
}
.review-issue div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.review-issue strong {
  font-size: 13px;
}
.review-issue strong::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 8px;
  border-radius: 50%;
  background: #d97706;
  vertical-align: 1px;
}
.review-issue.is-nudge strong::before {
  background: #94a3b8;
}
.review-issue span {
  color: #475569;
  font-size: 12px;
}
.review-issue .secondary {
  flex: none;
  min-height: 34px;
  font-size: 13px;
}

.review-card {
  padding: 8px 20px 12px;
}
.review-card .section-head {
  margin: 12px 0 4px;
}
.review-list {
  margin: 0;
}
.review-row {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr) auto;
  gap: 4px 16px;
  align-items: baseline;
  padding: 13px 0;
  border-top: 1px solid var(--line);
}
.review-row:first-child {
  border-top: 0;
}
.review-row dt {
  color: var(--muted);
  font-size: 13px;
}
.review-row dd {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  margin: 0;
}
.review-value {
  font-size: 14px;
  font-weight: 500;
  overflow-wrap: anywhere;
}
.review-note {
  color: var(--muted);
  font-size: 12px;
}
.review-note:empty {
  display: none;
}
.review-edit {
  min-height: 28px;
  padding: 0 8px;
  color: var(--brand);
  font-size: 13px;
  font-weight: 600;
}
.review-sample {
  margin: 4px 0 8px;
  border-top: 1px solid var(--line);
}
.review-sample > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.review-sample[hidden] {
  display: none;
}

.review-preview {
  padding: 0;
  overflow: hidden;
}
.review-inbox {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.review-thumb {
  position: relative;
  height: 340px;
  overflow: hidden;
  background: #f4f5f7;
}
.review-thumb iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 700px;
  max-width: none;
  height: calc(340px / var(--thumb-scale, 0.5));
  border: 0;
  border-radius: 0;
  transform: scale(var(--thumb-scale, 0.5));
  transform-origin: 0 0;
  pointer-events: none;
}
.review-send {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
}
#send-blast {
  width: 100%;
  min-height: 44px;
  font-size: 15px;
}
#send-blast:disabled {
  opacity: 1;
  background: #e2e8f0;
  border-color: #e2e8f0;
  color: #64748b;
}
#blast-send-reason {
  margin: 0;
  text-align: center;
}
#blast-send-reason:empty {
  display: none;
}
.review-send-links {
  display: flex;
  justify-content: space-between;
}
.review-send-links .quiet {
  min-height: 32px;
  padding: 0 8px;
  font-size: 13px;
}
@media (max-width: 960px) {
  .blast-review {
    grid-template-columns: 1fr;
  }
  .review-side {
    position: static;
  }
}
@media (max-width: 560px) {
  .review-row {
    grid-template-columns: 1fr auto;
  }
  .review-row dd {
    grid-column: 1;
  }
}
/* The global dl is a 2-column grid; review rows lay themselves out. */
.review-list {
  display: block;
  font-size: inherit;
}
.review-list dt,
.review-list dd {
  margin: 0;
  padding: 0;
  font-weight: inherit;
}

/* ================================================================ canvas-first Write tab (HTML) */
/* The email is the page; the form column becomes a slim tools panel on the right. */
.compose-grid.canvas-mode {
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 20px;
}
.compose-grid.canvas-mode > div:last-child {
  order: 1;
  position: static;
}
.compose-grid.canvas-mode:not(.is-editing) > div:last-child {
  gap: 12px;
}
.compose-grid.canvas-mode > .editor {
  display: block;
  order: 2;
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  padding: 18px;
}
.compose-grid.canvas-mode .preview-head {
  display: flex;
}
.compose-grid.canvas-mode.is-editing .preview-head,
.compose-grid.canvas-mode .preview-disclaimer,
.compose-grid.canvas-mode #preview {
  display: none;
}
.compose-grid.canvas-mode .preview-head #visual-edit {
  display: inline-flex !important;
}
.compose-grid.canvas-mode:not(.is-editing) .gmail-shell .preview-frame {
  --frame-height: max(560px, calc(100vh - 300px));
}
/* Side panel content, tightened for 300px. */
.canvas-mode > .editor .section-head h2 {
  font-size: 14px;
}
.canvas-mode > .editor .format-switch button {
  padding: 0 10px !important;
}
.canvas-mode > .editor .html-import > button {
  flex: 1 1 100%;
  font-size: 13px;
}
.canvas-mode > .editor .image-optimization {
  display: none;
}
.canvas-mode > .editor #ready-items {
  grid-template-columns: 1fr;
}
.canvas-mode > .editor .ready-card {
  padding: 14px;
}
.canvas-mode > .editor .editor-actions {
  justify-content: flex-end;
  margin-top: 8px;
}
.canvas-mode .visual-done {
  min-height: 34px;
  padding: 0 14px;
  font-size: 13px;
}
@media (max-width: 1180px) {
  .compose-grid.canvas-mode {
    grid-template-columns: minmax(0, 1fr);
  }
  .compose-grid.canvas-mode > .editor {
    position: static;
    max-height: none;
  }
  .canvas-mode > .editor #ready-items {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }
  .canvas-mode > .editor .html-import > button {
    flex: 1 1 0;
  }
}

/* ---------- Send test drawer + review entry ---------- */
.test-drawer #test-send-card > .muted {
  margin: 0 0 16px;
  font-size: 13px;
}
.test-drawer #send-test {
  width: 100%;
  min-height: 40px;
  margin-top: 4px;
}
.review-test {
  min-height: 40px;
  font-size: 14px;
}
.review-test .icon {
  width: 15px;
  height: 15px;
}
.review-test.is-done {
  color: #475569;
}
/* Audience is a single card now that Send test moved to a drawer. */
.compose-settings {
  grid-template-columns: minmax(0, 720px);
}

#audience-exclusions {
  margin: 12px 0 20px;
}
#audience-exclusions summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--primary, #2563eb);
}
.exclusions-list {
  max-height: 360px;
  overflow: auto;
  margin-bottom: 12px;
}
.exclusion-row {
  display: grid;
  gap: 4px;
  padding: 12px 0;
  border-bottom: 1px solid #e2e8f0;
  overflow-wrap: anywhere;
}
.exclusion-row .hint {
  margin: 0;
}

/* Recent launches are separate from alerts and audience date filters. */
.recent-launches {
  margin: 20px 0;
}
.recent-launches .section-heading {
  align-items: center;
  gap: 16px;
}
.recent-launches .section-heading h2 {
  margin-bottom: 4px;
}
.recent-launches .section-heading .hint {
  margin: 0;
}
.recent-launches-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 12px;
}
.recent-launches-controls .hint {
  margin: 0;
}
#recent-launches-list {
  padding: 0;
  overflow: hidden;
}
#recent-launches-list .link-cell {
  min-width: 220px;
}
#recent-launches-list th,
#recent-launches-list td {
  white-space: nowrap;
}
#recent-launches-list td:first-child {
  white-space: normal;
}

.recipient-controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 0 20px 12px;
}
.recipient-controls .search-input {
  flex: 1 1 220px;
  width: auto;
}
.recipient-controls select {
  width: auto;
  flex: 0 1 240px;
}
.recipient-hint {
  padding: 0 20px 12px;
  margin: 0;
}
.recipient-pagination {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
}
.recipient-pagination span {
  flex: 1 1 180px;
}
.recipient-address strong {
  font-weight: 500;
  overflow-wrap: anywhere;
}
.recipient-activity {
  display: block;
  color: #2563eb;
  margin-top: 4px;
}
.recipient-detail {
  max-width: 300px;
  margin-top: 6px;
  font-size: 12px;
  white-space: normal;
}
.recipient-detail summary,
.report-link-details summary {
  cursor: pointer;
  color: var(--muted);
}
.recipient-detail p {
  overflow-wrap: anywhere;
}
.report-link-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--border);
}
.report-link-destination {
  min-width: 0;
  flex: 1;
}
.report-link-title {
  display: block;
  overflow-wrap: anywhere;
  color: #2563eb;
  font-weight: 500;
  text-decoration: none;
}
.report-link-title:hover {
  text-decoration: underline;
}
.report-link-count {
  white-space: nowrap;
  font-size: 13px;
}
.report-link-details {
  margin-top: 6px;
  font-size: 12px;
}
.report-link-details code {
  display: block;
  margin-top: 8px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 11px;
}

.report-timing {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.recipient-preview-link {
  min-height: auto;
  padding: 0;
  background: none;
  border: 0;
  color: #2563eb;
  text-align: left;
  font-size: inherit;
  overflow-wrap: anywhere;
  white-space: normal;
}
.recipient-preview-link:hover {
  text-decoration: underline;
  background: none;
}
.recipient-unsubscribed {
  display: block;
  color: #b45309;
  margin-top: 4px;
}
.sent-message-dialog {
  width: min(960px, calc(100vw - 32px));
  height: min(900px, calc(100dvh - 48px));
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 16px;
  color: var(--ink);
  background: white;
}
.sent-message-dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
}
.sent-message-dialog header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}
.sent-message-dialog h2 {
  margin: 0 0 6px;
  font-size: 20px;
}
.sent-message-dialog iframe {
  width: 100%;
  height: calc(100% - 150px);
  min-height: 200px;
  border: 1px solid var(--border);
  background: white;
  border-radius: 8px;
}

/* ---------- send activity: compact layout with the email beside the numbers ---------- */
#activity-page .page-heading {
  margin-bottom: 14px;
}
#activity-page .page-heading p.muted {
  display: none;
}
.report-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  gap: 16px;
  align-items: start;
}
.report-main {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.blast-report .report-stats {
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.blast-report .report-stat {
  padding: 10px 14px;
  border: 0;
  border-right: 1px solid var(--border);
  border-radius: 0;
  box-shadow: none;
}
.blast-report .report-stat:last-child {
  border-right: 0;
}
.blast-report .report-stat strong {
  font-size: 18px;
}
.blast-report .report-stat span,
.blast-report .report-stat small {
  font-size: 12px;
}
.blast-report .report-stat small:empty {
  display: none;
}
.report-timing {
  margin: -4px 0 0;
  font-size: 12px;
  color: var(--muted);
  cursor: help;
}
.blast-report .report-card {
  padding: 12px 14px;
}
.blast-report .report-card h3 {
  margin-bottom: 4px;
}
.blast-report .report-link-row {
  padding: 7px 0;
  font-size: 13px;
}
.report-more-links summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
  padding-top: 6px;
}
.blast-report .card-head {
  margin-bottom: 8px;
}
.blast-report .table-scroll {
  max-height: 420px;
  overflow: auto;
}
.blast-report .data-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fff;
}
.blast-report .recipient-pagination {
  padding: 10px 0 0;
}
.report-email {
  position: sticky;
  top: 76px;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.report-email-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}
.report-email-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}
.report-email > .hint {
  padding: 12px;
  margin: 0;
}
.report-email-frame {
  display: block;
  width: 100%;
  height: calc(100vh - 150px);
  min-height: 420px;
  border: 0;
  background: #fff;
}
.activity-more {
  margin-top: 14px;
}
.activity-more > summary {
  cursor: pointer;
  list-style-position: inside;
  padding: 6px 0;
}
.activity-more > summary h2 {
  display: inline;
  font-size: 15px;
  font-weight: 600;
}
.activity-more > .card {
  margin-top: 8px;
}
@media (max-width: 1100px) {
  .report-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .report-email {
    position: static;
    order: -1;
  }
  .report-email-frame {
    height: 360px;
    min-height: 0;
  }
}
.blast-report .recipient-controls {
  padding: 0 0 8px;
}

/* ---------- searchable audience pickers ---------- */
.search-select {
  position: relative;
  width: 100%;
  margin-bottom: 8px;
}
.search-select::after {
  content: "";
  position: absolute;
  top: 20px;
  right: 14px;
  width: 7px;
  height: 7px;
  margin-top: -5px;
  border-right: 1.5px solid #334155;
  border-bottom: 1.5px solid #334155;
  transform: rotate(45deg);
  pointer-events: none;
}
.search-select-native {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}
.search-select-trigger {
  display: block;
  width: 100%;
  height: 40px;
  padding: 0 36px 0 16px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 400;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  box-shadow: none;
  transform: none;
}
.search-select-trigger:hover {
  background: #fff;
  border-color: #cbd5e1;
  color: var(--ink);
}
.search-select-trigger[aria-expanded="true"] {
  border-color: var(--brand);
}
.search-select-panel {
  position: absolute;
  z-index: 30;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.14);
}
.search-select-panel[hidden] {
  display: none;
}
.search-select-panel .search-select-input {
  width: 100%;
  margin: 0 0 6px;
}
.search-select-list {
  max-height: 260px;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
}
.search-select-list [role="option"] {
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--ink);
  cursor: pointer;
}
.search-select-list [role="option"].is-active {
  background: var(--wash);
}
.search-select-list [role="option"][aria-selected="true"] {
  font-weight: 600;
}
.search-select-empty {
  padding: 8px 10px;
  color: var(--muted);
}

.next-batch {
  display: grid;
  gap: 12px;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.next-batch h3 {
  margin: 0 0 2px;
  font-size: 15px;
  font-weight: 600;
}
.next-batch p {
  margin: 0;
}
.next-batch-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}
.next-batch-controls label {
  display: grid;
  gap: 4px;
  margin: 0;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}
.next-batch-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.next-batch-actions .hint {
  flex: 1 1 220px;
  margin: 0;
}

.campaign-summary {
  margin-bottom: 20px;
}
.campaign-progress {
  display: grid;
  gap: 6px;
}
.campaign-progress p {
  margin: 0;
  font-size: 13px;
  color: var(--body);
}
.campaign-progress-bar {
  height: 6px;
  overflow: hidden;
  background: var(--line);
  border-radius: 999px;
}
.campaign-progress-bar span {
  display: block;
  height: 100%;
  background: var(--brand);
}
.send-history {
  display: grid;
  gap: 10px;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.send-history h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}
.send-history-scroll {
  overflow-x: auto;
}
.send-history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  white-space: nowrap;
}
.send-history-table th {
  padding: 8px 10px;
  text-align: left;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}
.send-history-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--body);
}
.send-history-table tbody tr {
  cursor: pointer;
}
.send-history-table tbody tr:hover {
  background: var(--bg);
}
.send-history-table tbody tr.selected {
  background: var(--wash);
}
.send-history-table tfoot td {
  border-bottom: 0;
  font-weight: 600;
  color: var(--ink);
}
.history-open {
  padding: 0;
  min-height: 0;
  background: none;
  border: 0;
  color: var(--brand);
  cursor: pointer;
  font: inherit;
  font-weight: 500;
}

/* ---------- overview, /activity and /stats ---------- */
.page-heading .sync-health {
  margin: 4px 0 0;
  padding: 0;
  background: none;
  border: 0;
  font-size: 13px;
  color: var(--muted);
}
.page-heading .sync-health.warning {
  color: #b45309;
}
.sending-now {
  display: grid;
  gap: 12px;
  margin-bottom: 24px;
}
.sending-card {
  display: grid;
  gap: 14px;
  padding: 20px 24px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.sending-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.sending-top h2 {
  flex: 1 1 260px;
  margin: 0;
  font-size: 17px;
  font-weight: 600;
}
.sending-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 24px;
  margin: 0;
  font-size: 14px;
  color: var(--body);
}
.sending-facts strong {
  color: var(--ink);
}
.segment-bar {
  display: flex;
  gap: 2px;
  height: 10px;
  overflow: hidden;
  border-radius: 4px;
}
.segment-bar span {
  flex: 0 1 0;
  min-width: 4px;
  height: 100%;
}
.segment-sent {
  background: var(--brand);
}
.segment-queued {
  background: #93c5fd;
}
.segment-open {
  background: var(--line);
}
.email-table td {
  vertical-align: top;
}
.email-table th.num,
.stats-table th.num {
  text-align: right;
}
.email-figure strong {
  display: block;
  font-weight: 500;
}
.email-figure small,
.email-sent small {
  display: block;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
.email-table .email-figure .email-warn,
.stats-table .email-warn {
  color: #b45309;
}
.email-sent {
  min-width: 150px;
}
.email-sent small {
  margin-top: 6px;
  color: var(--body);
}
.mini-progress {
  height: 6px;
  margin-top: 6px;
  overflow: hidden;
  background: var(--line);
  border-radius: 3px;
}
.mini-progress span {
  display: block;
  height: 100%;
  background: var(--brand);
}
.email-child td {
  background: #fbfcfd;
}
.email-child .link-cell strong {
  font-weight: 500;
}
.activity-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.activity-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-right: auto;
}
.activity-chips .filter-chip {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 6px;
  font-size: 13px;
  background: #fff;
  color: var(--body);
}
.activity-chips .filter-chip.active {
  background: var(--wash);
  border-color: #bfdbfe;
  color: var(--brand-dark);
}
.activity-filters input {
  flex: 0 1 320px;
  min-width: 200px;
  margin: 0;
}
#activity-emails {
  padding: 0;
  overflow: hidden;
  margin-bottom: 8px;
}
#activity-emails .link-cell {
  max-width: 420px;
}
.activity-crumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  margin-bottom: 14px;
  font-size: 13px;
}
.activity-crumb a {
  font-weight: 500;
  text-decoration: none;
}
.activity-crumb code {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}
.campaign-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.campaign-title h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.campaign-title p {
  margin: 4px 0 0;
}
.stats-week {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}
.stats-week select {
  margin: 0;
  min-width: 180px;
}
.stats-body {
  display: grid;
  gap: 20px;
}
.stats-body > .hint {
  margin: -8px 0 0;
}
.stats-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(138px, 1fr));
  gap: 12px;
}
.stats-tile {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
}
.stats-tile > span {
  font-size: 13px;
  color: var(--muted);
}
.stats-tile strong {
  font-size: 26px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.stats-tile small {
  font-size: 13px;
  color: var(--muted);
}
.stats-tile .stats-change {
  font-weight: 500;
}
.stats-tile .stat-good {
  color: #047857;
}
.stats-tile .stat-bad {
  color: #b45309;
}
.stats-section {
  padding: 18px 20px;
  overflow: hidden;
}
.stats-section h2 {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 600;
}
.stats-section > .hint {
  margin: -6px 0 14px;
}
.stats-section > .stats-foot {
  margin: 12px 0 0;
}
.stats-table tr.selected td {
  background: var(--wash);
}
.stats-table .history-open {
  min-height: 0;
  padding: 0;
  font-weight: 600;
}
.stats-week-note {
  display: block;
  font-size: 12px;
  color: var(--muted);
}
.stats-strong {
  font-weight: 600;
}
.batch-chart {
  display: flex;
  gap: 8px;
  min-width: max-content;
}
.batch-column {
  flex: 1 0 64px;
  display: grid;
  gap: 8px;
}
.batch-plot {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  height: 200px;
  border-bottom: 1px solid #cbd5e1;
}
.batch-plot strong {
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.batch-bar {
  display: block;
  flex: 0 1 auto;
  width: 28px;
  min-height: 2px;
  max-height: 170px;
  background: var(--brand);
  border-radius: 4px 4px 0 0;
}
.batch-column:hover .batch-bar {
  background: var(--brand-dark);
}
.batch-label {
  display: grid;
  text-align: center;
  font-size: 12px;
  line-height: 1.35;
  color: var(--muted);
}
.email-table .link-cell {
  max-width: 300px;
}
.email-table td.num,
.stats-table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.email-table th,
.email-table td {
  padding-left: 12px;
  padding-right: 12px;
}
.email-table td:first-child,
.email-table th:first-child {
  padding-left: 16px;
}
.email-table .muted-cell {
  white-space: nowrap;
}
.email-table .email-child td:first-child {
  padding-left: 36px;
}
#recent-launches-list .email-table .link-cell,
#activity-emails .email-table .link-cell {
  width: 300px;
  max-width: 300px;
}
.email-table .link-cell > span,
.email-table .link-cell > strong {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.next-batch-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 10px;
}
