/* GNSW Mail — bulk email. Uses the workspace tokens, so light and dark follow. */

[hidden] {
  display: none !important;
}

.module-panel:has(.bulk) {
  padding: 0;
}

.bulk {
  --bulk-radius: 16px;
  --bulk-good: #0a7a4c;
  --bulk-warn: #9a6700;
  --bulk-bad: #b42318;
  min-height: 100%;
  padding: 26px clamp(16px, 2.4vw, 34px) 0;
  color: var(--ink);
  font-size: 14px;
}

[data-theme="dark"] .bulk {
  --bulk-good: #7ee2b8;
  --bulk-warn: #f8cf7a;
  --bulk-bad: #fca5a5;
}

/* ── header ─────────────────────────────────────────────────────────── */

.bulk-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px 28px;
  margin: 0 0 24px;
}

.bulk-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.bulk-dot {
  width: 22px;
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(90deg, #e31e24 0 33%, #1e2c72 33% 66%, #0b6b3a 66%);
}

.bulk-head h2 {
  margin: 0;
  font-size: clamp(24px, 2.4vw, 32px);
  font-weight: 750;
  line-height: 1.15;
  letter-spacing: -0.025em;
}

.bulk-lede {
  max-width: 560px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.55;
}

.bulk-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-soft);
}

.bulk-tabs button {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 16px;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
}

.bulk-tabs button[aria-selected="true"] {
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(14, 22, 48, 0.1);
}

.bulk-tab-count {
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 11.5px;
  font-weight: 700;
}

.bulk-live {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-left: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
  animation: bulk-pulse 1.8s ease-in-out infinite;
}

@keyframes bulk-pulse {
  50% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.05); }
}

/* ── buttons ────────────────────────────────────────────────────────── */

.bulk-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 650;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}

.bulk-button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bulk label.bulk-button {
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: none;
}

.bulk-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.bulk-button-primary {
  background: linear-gradient(180deg, #3550c4, #22348a);
  color: #fff;
  box-shadow: 0 6px 16px rgba(34, 52, 138, 0.25);
}

.bulk-button-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(34, 52, 138, 0.32);
}

.bulk-button-ghost {
  border-color: var(--line-strong);
  background: var(--panel);
  color: var(--ink);
}

.bulk-button-ghost:hover:not(:disabled) {
  border-color: var(--blue);
  color: var(--blue);
}

.bulk-button-quiet {
  border-color: transparent;
  color: var(--muted);
}

.bulk-button-danger {
  border-color: rgba(180, 35, 24, 0.35);
  background: var(--panel);
  color: var(--bulk-bad);
}

.bulk-button-danger:hover:not(:disabled) {
  background: rgba(180, 35, 24, 0.08);
}

.bulk-link {
  padding: 2px 0;
  background: transparent;
  color: var(--blue);
  font-size: 13px;
  font-weight: 600;
}

.bulk-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── compose layout ─────────────────────────────────────────────────── */

.bulk-compose {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 44%);
  gap: 24px;
  align-items: start;
}

.bulk-form {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.bulk-step {
  padding: 22px 22px 24px;
  border: 1px solid var(--line);
  border-radius: var(--bulk-radius);
  background: var(--panel);
}

.bulk-step-head {
  display: flex;
  gap: 14px;
  margin: 0 0 18px;
}

.bulk-step-num {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent-dark);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}

.bulk-step-head h3 {
  margin: 3px 0 2px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.bulk-step-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.55;
}

.bulk-step-head code {
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--panel-soft);
  font-size: 12.5px;
}

.merge-tag {
  margin: 0 4px 0 0;
  padding: 1px 8px;
  border: 1px dashed var(--blue);
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 12.5px;
  font-weight: 600;
}

.merge-tag:hover {
  border-style: solid;
}

/* Template gallery */
.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 12px;
}

.template-card {
  position: relative;
  display: grid;
  gap: 10px;
  padding: 8px 8px 12px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  color: var(--ink);
  text-align: left;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.template-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--workspace-shadow);
  transform: translateY(-2px);
}

.template-card.is-selected {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-soft);
}

.template-card.is-selected::after {
  content: "✓";
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-dark);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.template-thumb {
  position: relative;
  display: block;
  height: 176px;
  overflow: hidden;
  border-radius: 9px;
  background: #eef1f7;
}

.template-thumb iframe {
  position: absolute;
  top: 0;
  left: 50%;
  width: 640px;
  height: 1100px;
  border: 0;
  pointer-events: none;
  transform: translateX(-50%) scale(0.27);
  transform-origin: top center;
}

.template-thumb-loading {
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.5) 50%, transparent 80%) #e6eaf3;
  background-size: 200% 100%;
  animation: bulk-shimmer 1.3s linear infinite;
}

[data-theme="dark"] .template-thumb-loading {
  background-color: #1b2640;
}

@keyframes bulk-shimmer {
  to { background-position: -200% 0; }
}

.template-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 4px;
}

.template-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--blue-soft);
  color: var(--blue);
}

.template-card[data-tone="forest"] .template-icon { background: rgba(11, 107, 58, 0.12); color: #0b6b3a; }
.template-card[data-tone="slate"] .template-icon { background: rgba(183, 121, 31, 0.14); color: #9a6700; }
.template-card[data-tone="crimson"] .template-icon { background: rgba(180, 35, 24, 0.1); color: #b42318; }

[data-theme="dark"] .template-card[data-tone="forest"] .template-icon { color: #7ee2b8; }
[data-theme="dark"] .template-card[data-tone="slate"] .template-icon { color: #f8cf7a; }
[data-theme="dark"] .template-card[data-tone="crimson"] .template-icon { color: #fca5a5; }

.template-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.template-meta strong {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.25;
}

.template-meta small {
  color: var(--muted);
  font-size: 11.5px;
}

.template-desc {
  padding: 0 4px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.45;
}

/* Fields */
.bulk-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
}

.bulk-template-fields {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px dashed var(--line-strong);
}

.bulk-fields-title {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.bulk .bulk-field {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.bulk-field-wide {
  grid-column: 1 / -1;
}

.bulk-field em {
  margin-left: 6px;
  color: var(--faint);
  font-style: normal;
  font-weight: 500;
}

.bulk-required {
  margin-left: 3px;
  color: #d92d20;
}

.bulk .bulk-field input,
.bulk .bulk-field textarea,
.bulk .bulk-field select,
.bulk .bulk-recipients {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1.5px solid var(--line-strong);
  border-radius: 10px;
  background: var(--field);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 450;
  line-height: 1.5;
}

.bulk .bulk-field textarea,
.bulk .bulk-recipients {
  resize: vertical;
}

.bulk .bulk-field input:focus,
.bulk .bulk-field textarea:focus,
.bulk .bulk-field select:focus,
.bulk .bulk-recipients:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px var(--blue-soft);
  outline: none;
}

.bulk-field small {
  color: var(--faint);
  font-size: 12px;
  font-weight: 500;
}

/* Recipients */
.bulk-recipient-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
}

.bulk-recipients {
  font-family: "JetBrains Mono", ui-monospace, monospace !important;
  font-size: 13px !important;
}

.bulk-check {
  margin-top: 12px;
}

.bulk-check-idle {
  color: var(--faint);
  font-size: 13px;
}

.bulk-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.bulk-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--ink-soft);
  font-size: 12.5px;
  font-weight: 600;
}

.bulk-chip.good { background: rgba(16, 185, 129, 0.12); color: var(--bulk-good); }
.bulk-chip.warn { background: rgba(217, 154, 30, 0.14); color: var(--bulk-warn); }
.bulk-chip.bad { background: rgba(217, 45, 32, 0.1); color: var(--bulk-bad); }

.bulk-invalid {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.bulk-invalid summary {
  cursor: pointer;
  font-weight: 600;
}

.bulk-invalid ul {
  max-height: 140px;
  margin: 8px 0 0;
  padding-left: 18px;
  overflow: auto;
}

/* Preview */
.bulk-preview {
  position: sticky;
  top: 14px;
  display: grid;
  gap: 10px;
  min-width: 0;
}

.bulk-preview-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}

.bulk-preview-inbox {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.bulk-preview-inbox > * {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bulk-preview-inbox strong {
  font-size: 13.5px;
}

.bulk-preview-inbox span {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
}

.bulk-preview-inbox small {
  color: var(--muted);
  font-size: 12.5px;
}

.bulk-device {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 2px;
  padding: 3px;
  border-radius: 10px;
  background: var(--panel-soft);
}

.bulk-device button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 30px;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
}

.bulk-device button[aria-pressed="true"] {
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(14, 22, 48, 0.12);
}

.bulk-device svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bulk-preview-stage {
  display: grid;
  justify-items: center;
  height: min(78vh, 900px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    radial-gradient(circle at 1px 1px, rgba(120, 130, 160, 0.18) 1px, transparent 0) 0 0 / 16px 16px,
    #e3e8f2;
}

[data-theme="dark"] .bulk-preview-stage {
  background:
    radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.06) 1px, transparent 0) 0 0 / 16px 16px,
    #0b1224;
}

.bulk-preview-stage iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #eef1f7;
  transition: width 260ms cubic-bezier(0.22, 1, 0.36, 1), margin 260ms ease, border-radius 260ms ease;
}

.bulk-preview-stage[data-device="mobile"] iframe {
  width: 375px;
  max-width: calc(100% - 24px);
  margin: 16px 0;
  height: calc(100% - 32px);
  border: 8px solid #0e1630;
  border-radius: 30px;
}

.bulk-preview-note {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  text-align: center;
}

/* Action bar */
.bulk-actionbar {
  position: sticky;
  bottom: 0;
  z-index: 4;
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 4px calc(-1 * clamp(16px, 2.4vw, 34px)) 0;
  padding: 14px clamp(16px, 2.4vw, 34px);
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  backdrop-filter: blur(12px);
}

.bulk-actionbar-summary {
  color: var(--muted);
  font-size: 13.5px;
}

.bulk-actionbar-summary strong {
  color: var(--ink);
}

.bulk-actionbar-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ── campaigns ──────────────────────────────────────────────────────── */

.bulk-campaigns {
  display: grid;
  gap: 10px;
  padding-bottom: 32px;
}

.bulk-campaign {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) auto minmax(180px, 1fr) 90px;
  align-items: center;
  gap: 18px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  color: var(--ink);
  text-align: left;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.bulk-campaign:hover {
  border-color: var(--line-strong);
  box-shadow: var(--workspace-shadow);
}

.bulk-campaign-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.bulk-campaign-main strong,
.bulk-campaign-main span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bulk-campaign-main strong {
  font-size: 15px;
}

.bulk-campaign-main span {
  color: var(--muted);
  font-size: 13px;
}

.bulk-campaign-progress {
  display: grid;
  gap: 6px;
}

.bulk-campaign-progress small {
  color: var(--muted);
  font-size: 12px;
}

.bulk-campaign-date {
  color: var(--muted);
  font-size: 12.5px;
  text-align: right;
}

.bulk-status {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 11px;
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.bulk-status[data-status="sending"] { background: rgba(59, 86, 196, 0.12); color: var(--blue); }
.bulk-status[data-status="completed"] { background: rgba(16, 185, 129, 0.12); color: var(--bulk-good); }
.bulk-status[data-status="paused"] { background: rgba(217, 154, 30, 0.14); color: var(--bulk-warn); }
.bulk-status[data-status="cancelled"] { background: rgba(217, 45, 32, 0.1); color: var(--bulk-bad); }

.bulk-progress {
  display: flex;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--panel-soft);
}

.bulk-progress span {
  height: 100%;
  transition: width 500ms cubic-bezier(0.22, 1, 0.36, 1);
}

.bulk-progress .is-sent { background: linear-gradient(90deg, #10b981, #0a7a4c); }
.bulk-progress .is-failed { background: #d92d20; }
.bulk-progress .is-skipped { background: var(--faint); }

.bulk-empty {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 64px 24px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--bulk-radius);
  text-align: center;
}

.bulk-empty h3 {
  margin: 6px 0 0;
  font-size: 20px;
}

.bulk-empty p {
  max-width: 380px;
  margin: 0 0 12px;
  color: var(--muted);
}

.bulk-empty-art svg {
  width: 64px;
  height: 64px;
  fill: none;
  stroke: var(--blue);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ── detail ─────────────────────────────────────────────────────────── */

.bulk-detail {
  padding-bottom: 32px;
}

.bulk-back {
  margin: 0 0 14px;
  padding: 0;
  background: transparent;
  color: var(--blue);
  font-size: 13.5px;
  font-weight: 600;
}

.bulk-detail-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 20px;
}

.bulk-detail-head h3 {
  margin: 10px 0 4px;
  font-size: 24px;
  letter-spacing: -0.02em;
}

.bulk-detail-head p {
  margin: 0;
  color: var(--muted);
}

.bulk-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.bulk-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 14px;
}

.bulk-stat {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}

.bulk-stat span {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
}

.bulk-stat strong {
  font-size: 26px;
  font-weight: 750;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.bulk-stat[data-tone="good"] strong { color: var(--bulk-good); }
.bulk-stat[data-tone="warn"] strong { color: var(--bulk-warn); }
.bulk-stat[data-tone="bad"] strong { color: var(--bulk-bad); }

.bulk-detail-meta {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.bulk-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 1fr);
  gap: 20px;
  margin-top: 22px;
}

.bulk-detail-grid h4 {
  margin: 0 0 10px;
  font-size: 14px;
}

.bulk-table-wrap {
  max-height: 620px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}

.bulk-table-wrap table {
  width: 100%;
  border-collapse: collapse;
}

.bulk-table-wrap th {
  position: sticky;
  top: 0;
  padding: 10px 14px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-align: left;
}

.bulk-table-wrap td {
  padding: 11px 14px;
  border-top: 1px solid var(--line);
  vertical-align: top;
}

.bulk-table-wrap td strong {
  display: block;
  font-size: 13.5px;
}

.bulk-table-wrap td small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.bulk-error {
  color: var(--bulk-bad) !important;
}

.bulk-rstatus {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.bulk-rstatus[data-status="sent"] { background: rgba(16, 185, 129, 0.12); color: var(--bulk-good); }
.bulk-rstatus[data-status="deferred"] { background: rgba(217, 154, 30, 0.14); color: var(--bulk-warn); }
.bulk-rstatus[data-status="failed"] { background: rgba(217, 45, 32, 0.1); color: var(--bulk-bad); }

.bulk-detail-preview .bulk-preview-stage {
  height: 620px;
}

/* ── dialog ─────────────────────────────────────────────────────────── */

.bulk-dialog {
  width: min(460px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 30px 80px rgba(6, 12, 40, 0.35);
}

.bulk-dialog::backdrop {
  background: rgba(6, 17, 44, 0.45);
  backdrop-filter: blur(4px);
}

.bulk-dialog form {
  padding: 24px;
}

.bulk-dialog h3 {
  margin: 0 0 14px;
  font-size: 20px;
  letter-spacing: -0.01em;
}

.bulk-dialog p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.bulk-summary {
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
  padding: 14px;
  border-radius: 12px;
  background: var(--panel-soft);
}

.bulk-summary div {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr);
  gap: 10px;
}

.bulk-summary dt {
  color: var(--muted);
  font-size: 13px;
}

.bulk-summary dd {
  margin: 0;
  font-size: 13.5px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.bulk-dialog-note {
  font-size: 13px;
}

.bulk-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}

/* ── responsive ─────────────────────────────────────────────────────── */

@media (max-width: 1200px) {
  .bulk-compose {
    grid-template-columns: 1fr;
  }

  .bulk-preview {
    position: static;
  }

  .bulk-preview-stage {
    height: 640px;
  }

  .bulk-detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .bulk {
    padding-top: 16px;
  }

  .bulk-fields {
    grid-template-columns: 1fr;
  }

  .template-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .template-thumb {
    height: 140px;
  }

  .template-thumb iframe {
    transform: translateX(-50%) scale(0.22);
  }

  .bulk-campaign {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .bulk-campaign-progress {
    grid-column: 1 / -1;
  }

  .bulk-campaign-date {
    display: none;
  }

  .bulk-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bulk-actionbar {
    position: static;
    margin-top: 0;
    backdrop-filter: none;
  }

  .bulk-actionbar-buttons {
    width: 100%;
  }

  .bulk-actionbar-buttons .bulk-button {
    flex: 1;
  }
}

/* ── recipient source: modules or a pasted list ─────────────────────── */

.bulk-source {
  display: inline-flex;
  gap: 4px;
  margin: 0 0 16px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-soft);
}

.bulk-source button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
}

.bulk-source button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bulk-source button[aria-selected="true"] {
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(14, 22, 48, 0.12);
}

.bulk-source button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.bulk-modules-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.bulk-modules-head div {
  display: flex;
  gap: 12px;
}

.module-audiences {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
  gap: 10px;
}

.audience-card {
  display: grid;
  grid-template-columns: 22px 10px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 13px 14px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  color: var(--ink);
  text-align: left;
  transition: border-color 140ms ease, box-shadow 140ms ease, background-color 140ms ease;
}

.audience-card:hover {
  border-color: var(--line-strong);
}

.audience-card.is-selected {
  border-color: var(--blue);
  background: var(--blue-soft);
}

.audience-check {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1.5px solid var(--line-strong);
  border-radius: 7px;
  background: var(--panel);
}

.audience-check svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: #fff;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
}

.audience-card.is-selected .audience-check {
  border-color: var(--accent-dark);
  background: var(--accent-dark);
}

.audience-card.is-selected .audience-check svg {
  opacity: 1;
}

.audience-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.audience-meta {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.audience-meta strong {
  overflow: hidden;
  font-size: 14px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audience-meta small {
  overflow: hidden;
  color: var(--muted);
  font-size: 12.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bulk-modules-empty {
  padding: 22px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.6;
}

.bulk-modules-empty p {
  margin: 0;
  max-width: 62ch;
}

@media (prefers-reduced-motion: reduce) {
  .bulk-live,
  .template-thumb-loading {
    animation: none;
  }
}
