/* StandardMail UI system v2 — application chrome and shared components.
   Campaign-builder-specific controls intentionally remain in app.css. */

:root {
  --ui-space-1: 4px;
  --ui-space-2: 8px;
  --ui-space-3: 12px;
  --ui-space-4: 16px;
  --ui-space-5: 20px;
  --ui-space-6: 24px;
  --ui-space-8: 32px;
  --ui-control-height: 40px;
  --ui-content-gutter: clamp(18px, 2.6vw, 40px);
  --ui-panel-border: color-mix(in srgb, var(--border) 92%, var(--text));
  --ui-focus: 0 0 0 3px color-mix(in srgb, var(--primary) 20%, transparent);
  --ui-shadow-xs: none;
  --ui-shadow-sm: none;
  --ui-shadow-md: none;
  --ui-surface-subtle: color-mix(in srgb, var(--panel) 72%, var(--bg));
  --ui-surface-hover: color-mix(in srgb, var(--primary) 4%, var(--panel));
}

html {
  color-scheme: light;
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-feature-settings: "kern" 1, "liga" 1, "cv02" 1, "cv03" 1;
  line-height: 1.55;
}

.break-anywhere {
  overflow-wrap: anywhere;
  word-break: break-word;
}

::selection {
  background: color-mix(in srgb, var(--primary) 22%, transparent);
  color: var(--text);
}

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  box-shadow: var(--ui-focus);
}

:where(button, input, select, textarea):disabled,
:where(button, input, select, textarea)[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: .58;
}

a {
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

td, th, small, .muted {
  overflow-wrap: anywhere;
}

/* Application shell */
.app-shell {
  grid-template-columns: 252px minmax(0, 1fr);
}

.sidebar {
  width: 252px;
  padding: 16px 12px 14px;
  border-right-color: var(--ui-panel-border);
  box-shadow: none;
}

.sidebar-header {
  min-height: 52px;
  margin-bottom: 10px;
  padding: 0 8px 12px;
}

.sidebar .brand {
  min-height: 40px;
  font-size: 17px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  box-shadow: 0 8px 20px color-mix(in srgb, var(--primary) 20%, transparent);
}

.sidebar nav {
  gap: 3px;
  padding: 4px 2px 14px;
  scrollbar-color: color-mix(in srgb, var(--sidebar-text) 18%, transparent) transparent;
}

.sidebar nav > a,
.sidebar .nav-item,
.sidebar .nav-group summary {
  min-height: 40px;
  border-radius: 10px;
  font-size: 13px;
}

.sidebar nav > a:hover,
.sidebar .nav-item:hover,
.sidebar .nav-group summary:hover {
  transform: none;
}

.sidebar nav > a.active,
.sidebar .nav-item.active,
.sidebar .nav-subitems a.active {
  box-shadow: inset 3px 0 0 var(--primary);
  font-weight: 700;
}

.sidebar-footer {
  padding: 13px 10px 2px;
}

.workspace-plan-label {
  margin-top: 4px;
  padding: 3px 7px;
  line-height: 1.25;
}

.main {
  min-width: 0;
  background:
    radial-gradient(circle at 88% -12%, color-mix(in srgb, var(--primary) 5%, transparent), transparent 30rem),
    var(--bg);
}

.topbar {
  height: 64px;
  padding: 0 var(--ui-content-gutter);
  gap: 14px;
  border-bottom-color: var(--ui-panel-border);
  background: color-mix(in srgb, var(--panel) 96%, transparent);
  box-shadow: 0 1px 0 rgba(15, 23, 42, .02);
}

@supports (backdrop-filter: blur(12px)) {
  .topbar { backdrop-filter: saturate(140%) blur(12px); }
}

.topbar-company strong {
  max-width: min(42vw, 460px);
  overflow: hidden;
  font-size: 12.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-avatar {
  width: 32px;
  height: 32px;
  font-size: 12px;
}

.topbar-logout {
  border-radius: 9px;
}

.content {
  width: 100%;
  padding: 30px var(--ui-content-gutter) 52px;
}

/* Page hierarchy */
.page-header {
  min-height: 52px;
  align-items: flex-start;
  gap: var(--ui-space-5);
  margin-bottom: var(--ui-space-5);
}

.page-header > div:first-child {
  min-width: 0;
}

.page-header h1 {
  margin: 0;
  font-size: clamp(25px, 2vw, 30px);
  line-height: 1.2;
  letter-spacing: -.035em;
}

.page-header .muted {
  max-width: 760px;
  margin: 6px 0 0;
  line-height: 1.55;
}

.compact-page-header {
  min-height: 46px;
  margin-bottom: var(--ui-space-4);
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.eyebrow {
  margin-bottom: 5px;
  font-size: 10px;
  letter-spacing: .11em;
}

.section-heading {
  align-items: center;
  margin-bottom: 18px;
}

.section-heading h2 {
  font-size: 18px;
  line-height: 1.3;
}

/* Controls */
button,
.button,
.button-secondary {
  min-height: var(--ui-control-height);
  gap: 7px;
  padding: 9px 15px;
  border-radius: var(--button-radius);
  box-shadow: var(--ui-shadow-xs);
  font-size: 13px;
  font-weight: 700;
  transform: none;
  transition: background-color .14s ease, border-color .14s ease, color .14s ease, box-shadow .14s ease;
}

button:hover,
.button:hover,
.button-secondary:hover {
  transform: none;
  box-shadow: 0 4px 12px rgba(15, 23, 42, .07);
}

button:active,
.button:active,
.button-secondary:active {
  box-shadow: none;
}

.button-secondary {
  border-color: var(--ui-panel-border);
}

.link-button {
  min-height: 30px;
  padding: 4px 5px;
  border-radius: 7px;
  box-shadow: none;
}

.danger-button,
.link-button.danger {
  color: var(--danger) !important;
}

.form,
.campaign-details-form {
  gap: 16px;
}

.wide-form {
  width: min(100%, 960px);
  max-width: 960px;
  padding: 24px;
  border-color: var(--ui-panel-border);
  border-radius: calc(var(--card-radius) + 2px);
}

.form label,
.campaign-details-form label {
  gap: 6px;
  color: color-mix(in srgb, var(--text) 84%, var(--muted));
  font-size: 12.5px;
  font-weight: 700;
}

.form label > small,
.campaign-details-form label > small,
.progress-note {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.5;
}

.form input,
.form select,
.form textarea,
.filters input,
.filters select,
.bulk-bar select,
.inline-edit input,
.inline-edit select,
.inline-edit textarea,
.campaign-details-form input,
.campaign-details-form select,
.campaign-details-form textarea {
  min-height: var(--ui-control-height);
  padding: 9px 11px;
  border-color: var(--ui-panel-border);
  background: var(--panel);
  box-shadow: 0 1px 1px rgba(15, 23, 42, .02);
  transition: border-color .14s ease, box-shadow .14s ease, background-color .14s ease;
}

.form input:hover,
.form select:hover,
.form textarea:hover,
.filters input:hover,
.filters select:hover,
.bulk-bar select:hover {
  border-color: color-mix(in srgb, var(--primary) 28%, var(--border));
}

.form input:focus,
.form select:focus,
.form textarea:focus,
.filters input:focus,
.filters select:focus,
.bulk-bar select:focus,
.inline-edit input:focus,
.inline-edit select:focus,
.inline-edit textarea:focus,
.campaign-details-form input:focus,
.campaign-details-form select:focus,
.campaign-details-form textarea:focus {
  outline: 0;
  border-color: var(--primary);
  box-shadow: var(--ui-focus);
}

.form textarea,
.inline-edit textarea,
.campaign-details-form textarea {
  min-height: 112px;
  line-height: 1.55;
}

input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--primary);
}

.checkbox-row {
  min-height: 30px;
  gap: 10px;
  line-height: 1.45;
}

.fieldset {
  padding: 15px;
  border-color: var(--ui-panel-border);
  background: var(--ui-surface-subtle);
}

.fieldset legend {
  color: var(--text);
  font-size: 12px;
}

.field-error {
  margin-top: 2px;
  font-size: 11.5px;
}

/* Surfaces and feedback */
.card,
.table-card,
.panel-card,
.wide-form,
.detail-card {
  border-color: var(--ui-panel-border);
  box-shadow: var(--ui-shadow-xs);
}

.card,
.panel-card,
.detail-card {
  padding: 20px;
}

.cards {
  gap: 14px;
  margin-top: 18px;
}

.card > span:first-child {
  margin-bottom: 6px;
  font-size: 11.5px;
  font-weight: 600;
}

.card > strong {
  display: block;
  min-width: 0;
  font-size: clamp(21px, 2vw, 27px);
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.wide-form + .card,
.card + .wide-form {
  margin-top: 16px;
}

.alert {
  position: relative;
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 11px;
  box-shadow: none;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.55;
}

.alert-info {
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1e40af;
}

.badge,
.status-badge,
.mini-pill {
  max-width: 100%;
  line-height: 1.25;
  white-space: normal;
}

/* Status is an indivisible label. Names and subjects absorb table wrapping. */
.badge,
.status-badge {
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
  flex-shrink: 0;
  width: max-content;
  max-width: none;
}
.badge::before { flex-shrink: 0; }
.campaigns-table td:nth-child(1),
.campaigns-table td:nth-child(2) {
  min-width: 120px;
  width: 24%;
  overflow-wrap: anywhere;
  white-space: normal;
}
.campaigns-table td:nth-child(3) { white-space: nowrap; width: 1%; }
.campaigns-table td:nth-child(6) { min-width: 128px; overflow-wrap: normal; word-break: normal; }
@media (max-width: 700px) {
  .responsive-table td > .badge,
  .responsive-table td > .status-badge { justify-self: end; }
}

.badge,
.status-badge {
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 750;
}

.empty,
.empty-state {
  color: var(--muted);
}

.empty {
  padding: 36px 20px;
}

/* Filters, bulk actions and tables */
.filters,
.bulk-bar,
.bulk-selection-panel {
  border-color: var(--ui-panel-border);
}

.filters {
  gap: 9px;
  padding: 10px;
  margin: 0 0 14px !important;
  border-radius: 12px;
  box-shadow: var(--ui-shadow-xs);
}

.bulk-bar {
  gap: 9px;
  margin-bottom: 12px;
}

.bulk-selection-panel {
  margin: 0 0 12px;
  padding: 11px 13px;
  border: 1px solid var(--ui-panel-border);
  border-radius: 11px;
  background: var(--ui-surface-subtle);
}

.table-card {
  border-radius: calc(var(--card-radius) + 1px);
  overflow: hidden;
}

.scroll-x {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
}

table {
  font-variant-numeric: tabular-nums;
}

th,
td {
  padding: 12px 14px;
}

th {
  color: color-mix(in srgb, var(--muted) 88%, var(--text));
  font-size: 10.5px;
  letter-spacing: .065em;
  white-space: nowrap;
}

td {
  line-height: 1.45;
}

tbody tr {
  transition: background-color .12s ease;
}

tbody tr:hover {
  background: var(--ui-surface-hover);
}

td.actions {
  min-width: 150px;
  white-space: normal;
}

.actions a,
.actions .link-button {
  display: inline-flex;
  align-items: center;
  margin: 2px 0 2px 8px;
  font-size: 11.5px;
  font-weight: 700;
}

.actions form {
  margin-left: 0;
}

.compact-cell {
  min-width: 132px;
}

.pagination {
  min-height: 42px;
  gap: 10px;
  justify-content: flex-start;
  padding: 12px 0 0;
}

.pagination a {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-color: var(--ui-panel-border);
  background: var(--panel);
  font-size: 12px;
  font-weight: 700;
}

/* Navigation tabs and disclosure */
.tabs {
  gap: 4px;
  margin-bottom: 18px;
  padding: 4px;
  border-color: var(--ui-panel-border);
  border-radius: 11px;
  box-shadow: var(--ui-shadow-xs);
}

.tab {
  min-height: 36px;
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 12px;
}

.tab.active {
  box-shadow: 0 3px 10px color-mix(in srgb, var(--primary) 18%, transparent);
}

details:not(.nav-group) {
  border-color: var(--ui-panel-border);
  background: var(--ui-surface-subtle);
}

details:not(.nav-group) > summary {
  color: var(--text);
  font-weight: 700;
}

code {
  max-width: 100%;
  overflow-wrap: anywhere;
  border-color: var(--ui-panel-border);
  background: var(--ui-surface-subtle);
}

/* Dashboard and overview density */
.dashboard-hero {
  min-height: 210px;
  padding: 30px 34px;
  margin-bottom: 18px;
  border-radius: 20px;
  box-shadow: 0 16px 42px color-mix(in srgb, var(--primary) 8%, transparent);
}

.dashboard-hero h1 {
  font-size: clamp(30px, 3vw, 40px);
}

.dashboard-kpis,
.campaign-index-kpis {
  gap: 12px;
  margin-bottom: 18px;
}

.stat-card {
  min-height: 92px;
  padding: 16px;
  border-color: var(--ui-panel-border);
  box-shadow: var(--ui-shadow-xs);
}

a.stat-card:hover {
  transform: none;
  box-shadow: var(--ui-shadow-sm);
}

.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
}

.stat-card-copy strong {
  font-size: 23px;
}

.dashboard-grid {
  gap: 18px;
  margin-bottom: 18px;
}

.quick-action-list > a:hover {
  transform: none;
}

.workspace-snapshot {
  border-color: var(--ui-panel-border);
  background: var(--ui-panel-border);
}

.campaign-index-overview {
  gap: 16px;
}

/* Authentication and modal surfaces */
.guest-body {
  position: relative;
  min-height: 100dvh;
  padding: 24px;
  background:
    radial-gradient(circle at 15% 10%, color-mix(in srgb, var(--primary) 14%, transparent), transparent 28rem),
    radial-gradient(circle at 85% 90%, color-mix(in srgb, #7c3aed 10%, transparent), transparent 30rem),
    var(--bg);
}

.login-card,
.auth-card {
  width: min(100%, 420px);
  padding: 28px;
  border: 1px solid var(--ui-panel-border);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: var(--ui-shadow-md);
}

.login-card h1,
.auth-card h1 {
  font-size: 27px;
}

dialog {
  max-width: calc(100vw - 28px);
}

.send-request-dialog {
  border: 1px solid var(--ui-panel-border);
  border-radius: 18px;
  box-shadow: 0 28px 80px rgba(15, 23, 42, .24);
}

/* Integration summaries must never inherit oversized KPI typography. */
.integration-summary-cards .card > strong {
  font-size: 16px;
  line-height: 1.4;
}

.integration-details-card {
  max-width: 960px;
}

.integration-details-card p,
.integration-details-card li {
  font-size: 12.5px;
}

/* Responsive system */
@media (max-width: 1180px) {
  .cards-four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters.filters-wide,
  .bulk-bar-wide { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .app-shell { display: block; }
  .sidebar { width: min(86vw, 300px); }
  .topbar { height: 62px; padding-inline: 16px; }
  .content { padding: 24px 18px 42px; }
  .page-header { min-height: 0; }
  .filters.filters-wide,
  .bulk-bar-wide { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .content { padding: 20px 14px 36px; }
  .page-header { display: grid; gap: 13px; }
  .page-header h1 { font-size: 25px; }
  .header-actions { width: 100%; justify-content: stretch; }
  .header-actions > a,
  .header-actions > button,
  .header-actions > form,
  .header-actions > form button { width: 100%; }
  .header-actions > form { display: flex; }
  .cards,
  .cards-four,
  .form-grid,
  .form-grid-three { grid-template-columns: 1fr; }
  .wide-form,
  .card,
  .panel-card,
  .detail-card { padding: 17px; }
  .filters,
  .filters.filters-wide,
  .bulk-bar,
  .bulk-bar-wide { display: grid; grid-template-columns: 1fr; }
  .filters button,
  .bulk-bar button { width: 100%; }
  .dashboard-hero { padding: 23px 19px; }
  .dashboard-hero h1 { font-size: 30px; }
  .integration-summary-cards .card > strong { font-size: 15px; }
  .pagination { justify-content: center; flex-wrap: wrap; }
}

@media (max-width: 480px) {
  .guest-body { padding: 14px; }
  .login-card,
  .auth-card { padding: 22px 18px; border-radius: 16px; }
  .topbar-company { display: none; }
  .topbar-user { margin-left: auto; }
  .card > strong { font-size: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

@media print {
  .sidebar, .topbar, .header-actions, .filters, .bulk-bar, .pagination { display: none !important; }
  .app-shell { display: block; }
  .content { padding: 0; }
  .card, .panel-card, .table-card, .wide-form { box-shadow: none; break-inside: avoid; }
}

/* Flat application surfaces. Email content lives in isolated previews; the
   visual canvas is excluded so existing campaign styling remains visible. */
:root { --ui-panel-border: #edf0f3; --ui-focus: none; }
html { scroll-behavior: auto; scrollbar-gutter: stable; }
body, body :where(*):not(.campaign-builder-canvas *),
body :where(*)::before, body :where(*)::after {
  border-radius: 0 !important;
  box-shadow: none !important;
  text-shadow: none !important;
}
body, body :where(*):not(.campaign-builder-canvas *),
body :where(*)::before, body :where(*)::after {
  background-image: none !important;
}
.main, .guest-body { background-color: var(--bg); }
.topbar { background: var(--panel); backdrop-filter: none; }
.brand-mark, .button { background-color: var(--primary); }
.button-secondary { background-color: var(--ui-surface-subtle); }
.button:hover { background-color: color-mix(in srgb, var(--primary) 88%, #000); }
.button-secondary:hover { background-color: color-mix(in srgb, var(--primary) 8%, var(--panel)); }
.card, .panel-card, .detail-card, .wide-form, .table-card, .filters,
.sidebar, .topbar, .login-card, .auth-card { border-color: var(--ui-panel-border); }
.sidebar nav > a.active, .sidebar .nav-item.active, .sidebar .nav-subitems a.active {
  background-color: #29374c;
  color: #fff;
}
.sidebar { --sidebar-text: #d8e1ee; --muted: #aab8ca; background: #172233; color: #e7edf5; border-right: 0; }
.sidebar .brand, .sidebar .workspace-company, .sidebar-footer strong { color: #f8fafc; }
.sidebar nav a, .sidebar .nav-item, .sidebar .nav-group summary, .sidebar .nav-subitems a { color: #d8e1ee; }
.sidebar nav a:hover, .sidebar .nav-group summary:hover { background: #223047; color: #fff; }
.sidebar .sidebar-header, .sidebar .sidebar-footer { border-color: #29374c; }
.sidebar .brand-mark { background: #33445d; color: #fff; }
.sidebar .muted, .sidebar .workspace-label { color: #aab8ca; }
.dashboard-hero { background: #fff; color: #172233; border-color: #edf0f3; }
.dashboard-hero h1 { color: #172233; }
.dashboard-hero-copy > p, .dashboard-hero .muted { color: #526174; opacity: 1; }
.dashboard-hero .hero-quota { background: #f3f5f8; border: 0; backdrop-filter: none; color: #172233; justify-content: flex-start; }
.dashboard-hero .hero-quota > div:last-child > strong { color: #172233; }
.dashboard-hero .hero-quota small, .dashboard-hero .hero-quota > div:last-child > span { color: #526174; }
.dashboard-hero .metric-ring { width: 76px; height: auto; min-height: 76px; background: #e7ecf2; color: #172233; }
.dashboard-hero .metric-ring::after { display: none; }
.dashboard-hero .metric-ring strong { color: #172233; }
.dashboard-hero .metric-ring span { color: #526174; }
:where(input, select, textarea):not([type="checkbox"]):not([type="radio"]):not([type="color"]) {
  border-color: #dce2e8;
}
:where(a, button, input, select, textarea, summary, [tabindex], [contenteditable="true"]):focus-visible {
  outline: 2px solid var(--primary); outline-offset: 2px;
}

/* Scheduled delivery stays readable without widening the status column. */
.campaign-schedule { margin-bottom: 20px; }
.campaign-schedule .schedule-countdown { font-size: 16px; font-weight: 600; color: #172233; }
.campaign-schedule .schedule-due-note { color: #6b4c18; }
.campaign-schedule [hidden] { display: none; }
.campaign-reschedule-form { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 12px; margin: 20px 0 12px; }
.campaign-reschedule-form label { flex: 0 1 340px; min-width: 0; font-weight: 400; }
.campaign-reschedule-form input { display: block; width: 100%; min-width: 0; min-height: 46px; margin-top: 8px; padding: 10px 12px; font: inherit; color: #172233; background: #fff; border: 1px solid #dce2e8; }
.campaign-reschedule-form button { min-height: 46px; }
.campaign-list-schedule { margin-top: 8px; font-size: 12px; font-weight: 400; line-height: 1.5; }
.campaign-list-schedule small { display: block; font-size: inherit; color: #526174; }

/* Audience setup: restrained typography and one consistent action size. */
.audience-page { padding: 24px; }
.audience-page > h2 { margin: 0 0 18px; font-size: 20px; }
.audience-composer { display: grid; gap: 20px; margin: 0; }
.audience-composer h2, .audience-composer h3, .audience-composer p { margin: 0; }
.audience-composer h2 { font-size: 18px; font-weight: 600; }
.audience-composer h3 { font-size: 15px; font-weight: 600; }
.audience-composer p, .audience-composer label, .audience-composer select, .audience-composer input { font-size: 13px; }
.audience-composer strong, .audience-composer b { font-size: inherit; font-weight: 600; }
.audience-composer small { font-size: 12px; line-height: 1.6; color: #526174; }
.audience-composer [hidden] { display: none !important; }
.audience-mode-options, .audience-delivery-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.audience-mode-card { display: flex; align-items: flex-start; gap: 12px; padding: 18px; margin: 0; background: #f3f5f8; cursor: pointer; border: 1px solid transparent; }
.audience-mode-card:has(input:checked) { background: #eef3ff; border-color: #b7c8eb; }
.audience-mode-card > span { display: grid; gap: 5px; min-width: 0; }
.audience-mode-card b { color: #172233; }
.audience-composer input[type="checkbox"], .audience-composer input[type="radio"] { position: static; appearance: auto; width: 16px; height: 16px; min-width: 16px; flex: 0 0 16px; margin: 2px 0 0; accent-color: var(--primary); }
.audience-custom { border: 0; padding: 0; margin: 0; min-width: 0; }
.audience-source-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; }
.audience-source { background: #f7f9fb; padding: 16px; min-width: 0; }
.audience-source-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.audience-source-heading > span { font-size: 11px; color: #526174; }
.audience-composer select, .audience-composer input[type="search"], .audience-composer input[type="datetime-local"] { display: block; min-width: 0; width: 100%; min-height: 42px; padding: 10px 12px; font-family: inherit; color: #172233; background: #fff; border: 1px solid #dce2e8; }
.audience-search { margin: 10px 0; }
.audience-source-options { max-height: 230px; overflow-y: auto; overflow-wrap: anywhere; }
.audience-composer .audience-option { display: flex; align-items: flex-start; gap: 10px; padding: 9px 0; margin: 0; font-weight: 400; line-height: 1.5; cursor: pointer; }
.audience-option > span { min-width: 0; }
.audience-empty, .audience-no-results { color: #526174; padding: 12px 0; }
.audience-summary { padding: 16px 18px; background: #f3f5f8; overflow-wrap: anywhere; }
.audience-summary-label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 7px; color: #526174; }
.audience-summary > p { color: #172233; line-height: 1.7; margin-bottom: 8px; }
.audience-delivery-heading { display: grid; gap: 6px; margin-top: 6px; }
.audience-delivery-heading p, .audience-delivery-card > p { color: #526174; line-height: 1.6; }
.audience-delivery-card > p > span { display: inline; font: inherit; color: inherit; }
.audience-delivery-card { display: grid; grid-template-rows: auto auto 1fr auto; gap: 14px; padding: 20px; background: #f7f9fb; min-width: 0; }
.audience-delivery-card > label { display: grid; gap: 7px; align-content: end; font-weight: 400; }
.audience-delivery-card > .button { width: 100%; min-height: 44px; font-size: 13px; }
.audience-delivery-detail { align-self: end; color: #526174; font-size: 12px; padding: 12px 0; }
.audience-followup { padding: 16px 18px; background: #f7f9fb; }
.audience-followup > p { color: #526174; font-size: 12px; margin-left: 26px; line-height: 1.6; }
.audience-followup .resend-unopened-delay { margin: 14px 0 0 26px; max-width: 240px; }
.audience-followup select { margin-top: 7px; }
.audience-validation, .audience-missing { color: #a12727; }
.audience-footer { display: flex; }
@media (max-width: 1000px) { .audience-source-grid { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .audience-mode-options, .audience-delivery-grid { grid-template-columns: 1fr; } .audience-page { padding: 16px; } }.audience-advanced { margin-top: 14px; padding: 12px 0; }
.audience-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.audience-saved-summary { font-size: 14px; line-height: 1.7; overflow-wrap: anywhere; }

.audience-explanation { display: grid; gap: 8px; margin-bottom: 16px; color: #526174; line-height: 1.7; }
/* Compact campaign flow shared by design and audience pages. */
.page-header.campaign-flow-header { align-items: center; gap: 20px; }
.campaign-flow-header > div:first-child { min-width: 0; }
.campaign-flow-header h1 { overflow-wrap: anywhere; }
.header-actions.campaign-flow-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; flex-shrink: 0; }
.campaign-flow-actions .button, .campaign-flow-actions .button-secondary { min-height: 42px; padding: 11px 18px; font-size: 13px; white-space: nowrap; }
.campaign-flow-actions .campaign-previous { font-size: 13px; color: #64748b; padding: 10px 4px; text-decoration: none; }
.campaign-flow-actions .campaign-previous:hover { color: #172033; }
.campaign-flow-actions [hidden] { display: none; }
@media (max-width: 760px) {
    .page-header.campaign-flow-header { align-items: flex-start; flex-direction: column; }
    .header-actions.campaign-flow-actions { width: 100%; gap: 10px; }
}

/* Keep the workspace centered in main, independently of the navigation rail. */
.main > .content { width: min(100%, 1560px); margin-inline: auto; }
.desktop-nav-toggle { display: none; }
@media screen and (min-width: 901px) {
  .desktop-nav-toggle { display: inline-flex; align-items: center; gap: 7px; flex: none; height: 36px; padding: 0 12px; background: #182436; color: #fff; border: 0; font-size: 13px; font-weight: 600; white-space: nowrap; cursor: pointer; }
  .desktop-nav-toggle:hover, .desktop-nav-toggle:focus-visible { color: #fff; background: #2e4059; }
  .desktop-nav-toggle:focus-visible { outline: 2px solid #2563eb; outline-offset: -2px; }
  .topbar { justify-content: flex-start; padding-inline-start: 0; }
  .topbar-user { margin-inline-start: auto; }
  body.desktop-nav-collapsed .app-shell { grid-template-columns: minmax(0, 1fr); }
  body.desktop-nav-collapsed .app-shell > .sidebar { display: none; }
  body.desktop-nav-collapsed .desktop-nav-toggle svg { transform: scaleX(-1); }
}

.campaign-audience-estimate { display: grid; gap: 5px; min-width: 0; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; white-space: normal; }
.campaign-audience-estimate small { font-size: 11px; color: var(--muted); }

@media (min-width: 701px) { td[data-label="Recipients"]:has(.campaign-audience-estimate) { min-width: 190px; max-width: 280px; } }

/* Import metadata uses text labels, independently of the KPI card typography. */
.import-summary { margin: 18px 0 24px; padding: 6px 20px; background: var(--panel); border: 1px solid var(--ui-panel-border); border-radius: 12px; }
.import-summary > div { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 16px; padding: 11px 0; }
.import-summary > div + div { border-top: 1px solid var(--border); }
.import-summary dt { color: var(--muted); font-size: 12px; font-weight: 600; }
.import-summary dd { margin: 0; font-size: 13px; overflow-wrap: anywhere; }
.import-status-guide { margin: 16px 0; padding: 16px; border: 1px solid var(--ui-panel-border); border-radius: 10px; background: var(--panel); }
.import-status-guide h3 { margin: 0 0 8px; font-size: 14px; }
.import-status-guide p { margin: 8px 0 0; font-size: 12px; }
.import-status-values { margin: 12px 0; }
.import-status-values > div { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 12px; padding: 9px 0; }
.import-status-values > div + div { border-top: 1px solid var(--border); }
.import-status-values dt { font-size: 12px; font-weight: 700; }
.import-status-values dd { margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.import-status-guide code { padding: 2px 6px; border-radius: 5px; background: var(--ui-surface-subtle); font-size: 12px; }
.suppression-create { margin-bottom: 18px; background: var(--panel); border: 1px solid var(--ui-panel-border); border-radius: 12px; }
.suppression-create h2 { margin: 0; font-size: 16px; }
.suppression-create > p { margin: 6px 0 18px; font-size: 12px; }
.suppression-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); max-width: none; }
.suppression-form label { min-width: 0; }
.suppression-form input, .suppression-form select { width: 100%; min-width: 0; }
.suppression-form .suppression-reason { grid-column: 1 / -1; }
.suppression-form .form-actions { grid-column: 1 / -1; display: flex; margin: 0; }
.suppression-filters { display: grid; grid-template-columns: minmax(0, 1fr) 180px 140px auto; }
.suppression-filters > * { min-width: 0; width: 100%; }
.suppression-export-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 14px; }
.suppression-export-bar > p { margin: 0; font-size: 12px; }
.suppression-export-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.suppression-table table { min-width: 1040px; }
@media (max-width: 700px) {
  .import-summary { padding: 4px 16px; }
  .import-summary > div, .import-status-values > div { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .suppression-form, .suppression-filters { grid-template-columns: minmax(0, 1fr); }
  .suppression-export-actions { display: grid; grid-template-columns: minmax(0, 1fr); width: 100%; }
}
