/* Campaign Studio visual system — layered over the functional component styles. */
:root {
  --ink: #172033;
  --muted: #728096;
  --line: #e7eaf1;
  --paper: #fff;
  --canvas: #f6f7fb;
  --nav: #111525;
  --nav-soft: #242a40;
  --accent: #7766f2;
  --accent-dark: #6250df;
  --radius: 15px;
  --shadow: 0 10px 32px rgba(29, 36, 64, .045);
}

body {
  background: #f6f7fb;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: -.01em;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font-family: inherit; }
.icon-svg { display: inline-block; flex: none; vertical-align: middle; }

/* Persistent navigation */
.sidebar {
  width: 258px;
  padding: 27px 15px 17px;
  background: linear-gradient(180deg, #15192c 0%, #101423 100%);
  border-right: 1px solid rgba(255,255,255,.04);
}
.brand-lockup { padding: 0 10px 38px; gap: 12px; }
.brand-mark {
  position: relative;
  width: 38px; height: 38px; border-radius: 12px;
  background: linear-gradient(145deg, #a296ff 0%, #7461f0 60%, #5a4ada 100%);
  box-shadow: 0 7px 22px rgba(112, 94, 245, .28), inset 0 1px 0 rgba(255,255,255,.4);
  font-size: 15px; letter-spacing: -1.2px;
}
.brand-lockup strong { font-size: 14px; letter-spacing: -.45px; }
.brand-lockup small { font-size: 9px; letter-spacing: 1.55px; color: #8d96b1; }
.workspace-label { padding-left: 13px; color: #69738e; font-size: 9px; letter-spacing: 1.65px; }
.main-nav { gap: 5px; }
.nav-item {
  min-height: 43px; padding: 0 12px; gap: 12px; border-radius: 10px;
  color: #aab2c8; font-size: 12px; letter-spacing: 0;
}
.nav-item:hover { background: rgba(255,255,255,.055); color: #fff; }
.nav-item.active {
  background: linear-gradient(100deg, rgba(121,103,245,.22), rgba(121,103,245,.105));
  color: #fff; box-shadow: inset 3px 0 #9b8fff, 0 4px 14px rgba(0,0,0,.08);
}
.nav-icon { display: grid; place-items: center; width: 20px; height: 20px; color: #8791ad; }
.nav-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nav-item.active .nav-icon { color: #b9b1ff; }
.nav-count { background: #37345d; color: #d5d0ff; font-size: 10px; padding: 3px 7px; }
.sidebar-status {
  margin: 18px 3px 9px; padding: 13px 11px; border-color: #2d344c;
  background: rgba(255,255,255,.025); border-radius: 12px;
}
.sidebar-status strong { font-size: 11px; }
.sidebar-status small { color: #8993ad; font-size: 10px; }
.logout-button { border-radius: 9px; font-size: 12px; color: #8f99b2; }
.logout-button:hover { background: rgba(255,255,255,.055); }
.main-area { margin-left: 258px; }
.topbar {
  height: 68px; padding: 0 39px; border-bottom-color: #e9ebf2;
  background: rgba(255,255,255,.9); box-shadow: 0 3px 18px rgba(31,38,65,.025);
}
.breadcrumb { font-size: 12px; gap: 11px; }
.breadcrumb strong { color: #303950; font-weight: 650; }
.env-pill { border: 1px solid #e4e7ef; background: #fafbfe; border-radius: 999px; padding: 7px 11px; font-size: 9px; letter-spacing: .8px; }
.avatar { width: 33px; height: 33px; border: 2px solid white; box-shadow: 0 0 0 1px #e1e3ec; background: #eae7ff; color: #6250df; }
.page-content { max-width: 1640px; padding: 34px 39px 54px; }
.page-heading { margin-bottom: 25px; align-items: center; }
.page-heading h1 { font-size: 28px; letter-spacing: -1.1px; }
.page-heading p { margin-top: 7px; line-height: 1.6; font-size: 12px; color: #7b8598; }
.eyebrow { font-size: 9px; letter-spacing: 1.7px; color: #8170ef; }

/* Buttons, forms and reusable surfaces */
.btn { border-radius: 9px; padding: 10px 14px; gap: 8px; font-size: 11px; font-weight: 680; letter-spacing: .005em; }
.btn.primary { background: linear-gradient(135deg, #8170f8, #6a57e7); box-shadow: 0 5px 13px rgba(103,87,232,.2), inset 0 1px 0 rgba(255,255,255,.22); }
.btn.primary:hover { background: linear-gradient(135deg, #7664ee, #5c49d7); box-shadow: 0 7px 16px rgba(103,87,232,.27); transform: translateY(-1px); }
.btn.secondary { border-color: #e1e5ee; color: #3d465c; box-shadow: 0 1px 2px rgba(16,24,40,.025); }
.btn.secondary:hover { border-color: #cbc5ff; color: #5948d6; background: #fbfaff; }
.btn.small { padding: 7px 10px; font-size: 10px; }
.panel, .metric-card { border-color: #e8ebf2; border-radius: 15px; box-shadow: 0 5px 20px rgba(30,37,64,.025); }
.panel-header { padding: 18px 21px; border-bottom-color: #eff1f6; }
.panel-header h2 { font-size: 12px; letter-spacing: -.15px; color: #303951; }
.panel-header p { font-size: 10px; line-height: 1.5; color: #8a94a7; }
.panel-body { padding: 20px 21px; }
.table-wrap { scrollbar-color: #cfd4e3 transparent; scrollbar-width: thin; }
table { font-variant-numeric: tabular-nums; }
th { padding: 12px 16px; background: #f9fafe; color: #8992a5; font-size: 9px; letter-spacing: .8px; border-bottom-color: #e9ecf3; }
td { padding: 14px 16px; font-size: 11px; color: #667087; border-bottom-color: #f0f2f7; }
tbody tr { transition: background .12s ease; }
tbody tr:hover { background: #fafaff; }
.table-primary { color: #303951; font-weight: 640; }
.table-secondary { color: #929bb0; font-size: 10px; }
.event-badge, .status-badge { padding: 5px 9px; font-size: 9px; letter-spacing: .01em; border-radius: 7px; }
.link-button { display: inline-flex; align-items: center; gap: 5px; color: #7060e9; font-size: 10px; }
.link-button:hover { color: #5140cf; text-decoration: none; }
.empty-state { color: #8f98aa; font-size: 11px; line-height: 1.6; }
.empty-state strong { color: #3c455c; font-size: 12px; }
.empty-illustration { width: 48px; height: 48px; border-radius: 15px; background: linear-gradient(145deg,#f1efff,#f8f7ff); color: #7766f2; }
.field input, .field select, .field textarea, .stack-form input, .stack-form select, .stack-form textarea { border-color: #dfe3ed; border-radius: 9px; padding: 10px 12px; color: #303951; font-size: 12px; }
.field label, .stack-form label { color: #505b73; font-size: 10px; }
.field input:focus, .field select:focus, .field textarea:focus, .stack-form input:focus, .stack-form select:focus, .stack-form textarea:focus { border-color: #a69cff; outline: 3px solid #f0eeff; }
.filters { padding: 17px 19px; gap: 11px; background: #fff; }
.table-toolbar { padding: 13px 20px; background: #fcfcfe; }
.table-toolbar p, .pagination span { font-size: 10px; }
.tag { border-color: #e4e7ef; border-radius: 7px; background: #fafbfe; }
.tag.brand { background: #f4f1ff; border-color: #e6e0ff; }
.list-card { padding: 14px; border-radius: 12px; }
.list-card.selected { background: linear-gradient(90deg,#f8f6ff,#fdfcff); }
.quick-action { border-color: #e9ebf2; border-radius: 11px; }
.notice { background: #f8f6ff; border-color: #e4dfff; border-radius: 11px; line-height: 1.6; }
.metric-chip { background: #fbfbfe; border-color: #e8ebf2; border-radius: 8px; }
.modal-card { border: 1px solid rgba(255,255,255,.7); border-radius: 18px; padding: 25px; box-shadow: 0 24px 90px rgba(17,21,37,.27); }
.modal-heading h2 { color: #1d2539; }

/* Overview hero */
.dashboard-hero {
  position: relative; isolation: isolate; display: grid; grid-template-columns: minmax(0,1.08fr) minmax(340px,.92fr);
  min-height: 285px; overflow: hidden; margin: 0 0 28px; border-radius: 20px;
  color: #fff; background: radial-gradient(ellipse at 76% 21%, rgba(128,111,255,.25), transparent 35%), linear-gradient(115deg,#1a1f37 0%,#202443 53%,#29284d 100%);
  box-shadow: 0 16px 35px rgba(33,34,77,.13);
}
.dashboard-hero-copy { position: relative; z-index: 2; align-self: center; padding: 34px 38px 35px; max-width: 650px; }
.hero-meta { display: flex; align-items: center; gap: 9px; color: #aaaed0; font-size: 9px; letter-spacing: 1.45px; font-weight: 750; }
.live-dot, .pipeline-live i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #68dfb5; box-shadow: 0 0 0 4px rgba(104,223,181,.1); }
.hero-meta-divider { color: #666c92; }
.dashboard-hero h1 { margin: 18px 0 11px; color: #fff; font-size: clamp(30px, 3vw, 42px); line-height: 1.08; letter-spacing: -1.85px; font-weight: 750; }
.dashboard-hero h1 em { color: #aaa1ff; font-style: normal; }
.dashboard-hero-copy > p { max-width: 455px; margin: 0; color: #b1b8d1; font-size: 12px; line-height: 1.75; }
.hero-actions { display: flex; align-items: center; gap: 20px; margin-top: 22px; }
.dashboard-hero .btn.primary { color: #fff; background: #8171ff; box-shadow: 0 6px 18px rgba(10,11,28,.18), inset 0 1px 0 rgba(255,255,255,.25); padding: 11px 15px; }
.dashboard-hero .btn.primary:hover { background: #9285ff; }
.hero-text-action { display: inline-flex; align-items: center; gap: 8px; border: 0; background: transparent; color: #d2d5ec; font-size: 11px; font-weight: 650; padding: 8px 0; }
.hero-text-action:hover { color: #fff; }
.hero-visual { position: relative; min-height: 270px; overflow: hidden; }
.hero-grid-pattern { position: absolute; inset: 0; opacity: .3; background-image: linear-gradient(rgba(255,255,255,.07) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.07) 1px,transparent 1px); background-size: 27px 27px; mask-image: linear-gradient(90deg,transparent,#000 28%,#000); }
.hero-orbit { position: absolute; border: 1px solid rgba(171,160,255,.17); border-radius: 50%; transform: rotate(-18deg); }
.hero-orbit-one { width: 360px; height: 250px; right: -3px; top: 17px; }
.hero-orbit-two { width: 285px; height: 190px; right: 35px; top: 47px; border-color: rgba(171,160,255,.12); }
.pipeline-node { position: absolute; z-index: 2; display: flex; align-items: center; gap: 10px; padding: 11px 13px; border: 1px solid rgba(218,221,255,.19); border-radius: 12px; color: #fff; background: rgba(29,34,65,.87); box-shadow: 0 10px 25px rgba(7,10,29,.19), inset 0 1px 0 rgba(255,255,255,.06); backdrop-filter: blur(10px); }
.pipeline-node-source { top: 37px; left: 13%; width: 205px; }
.pipeline-node-engine { top: 116px; left: 31%; width: 228px; border-color: rgba(150,139,255,.5); background: rgba(56,51,107,.9); }
.pipeline-node-outcome { top: 202px; left: 18%; width: 265px; padding: 10px 13px; }
.pipeline-node-icon { display: grid; place-items: center; width: 35px; height: 35px; border-radius: 10px; color: #b9b1ff; background: rgba(139,126,255,.14); }
.pipeline-node-icon svg { stroke: currentColor; }
.engine-icon { color: #83e3c5; background: rgba(74,210,168,.12); }
.pipeline-node-copy { min-width: 0; display: grid; gap: 3px; }
.pipeline-node-copy small { color: #a0a9ca; font-size: 8px; letter-spacing: 1px; font-weight: 750; }
.pipeline-node-copy strong { color: #f5f5ff; font-size: 11px; font-weight: 650; white-space: nowrap; }
.pipeline-check { margin-left: auto; display: grid; place-items: center; width: 19px; height: 19px; background: rgba(96,218,177,.12); color: #71e2bd; border-radius: 50%; }
.pipeline-live { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; color: #a4f0d9; font-size: 8px; letter-spacing: .6px; font-weight: 800; }
.pipeline-live i { width: 5px; height: 5px; box-shadow: none; }
.pipeline-connector { position: absolute; z-index: 1; height: 42px; width: 1px; border-left: 1px dashed rgba(167,157,255,.6); }
.pipeline-connector span { position: absolute; left: -3px; bottom: -1px; width: 6px; height: 6px; border-radius: 50%; background: #a398ff; box-shadow: 0 0 10px #9f92ff; }
.connector-one { top: 77px; left: 25%; height: 40px; transform: rotate(-14deg); }
.connector-two { top: 157px; left: 51%; height: 45px; transform: rotate(15deg); }
.outcome-dot { width: 8px; height: 8px; border-radius: 3px; background: #71e2bd; box-shadow: 0 0 0 5px rgba(113,226,189,.1); margin: 0 4px; }
.hero-floating-stat { display: flex; align-items: center; gap: 9px; position: absolute; z-index: 3; right: 19px; bottom: 17px; padding: 9px 12px; border: 1px solid rgba(218,221,255,.15); border-radius: 10px; background: rgba(17,20,43,.76); box-shadow: 0 8px 20px rgba(8,10,28,.16); }
.hero-floating-stat > span { display: grid; place-items: center; color: #a9a0ff; }
.hero-floating-stat div { display: grid; gap: 2px; }
.hero-floating-stat small { color: #9ba4c6; font-size: 7px; letter-spacing: 1px; font-weight: 750; }
.hero-floating-stat strong { color: #e1e4f8; font-size: 9px; font-weight: 620; }
.hero-glow { position: absolute; right: -80px; top: -100px; z-index: -1; width: 290px; height: 290px; border-radius: 50%; background: rgba(114,94,245,.1); filter: blur(35px); }

.section-kicker { display: flex; align-items: center; gap: 11px; margin: 0 0 13px; color: #8a92a7; font-size: 9px; font-weight: 800; letter-spacing: 1.25px; }
.section-kicker-line { flex: 1; height: 1px; background: #e6e9f1; }
.snapshot-caption { color: #a0a7b7; font-size: 10px; letter-spacing: 0; font-weight: 450; }
.metric-grid { gap: 14px; margin-bottom: 21px; }
.metric-card { position: relative; overflow: hidden; padding: 17px 18px 15px; border-radius: 14px; box-shadow: 0 4px 15px rgba(29,36,64,.02); }
.metric-card::after { position: absolute; content: ""; left: 0; right: 0; bottom: 0; height: 2px; opacity: .55; background: linear-gradient(90deg,var(--metric-color,#8879f4),transparent 80%); }
.metric-brands { --metric-color: #8778f6; }
.metric-lists { --metric-color: #48bca8; }
.metric-contacts { --metric-color: #5a9be9; }
.metric-campaigns { --metric-color: #e4a45b; }
.metric-top { color: #737d92; font-size: 10px; }
.metric-icon { width: 33px; height: 33px; border-radius: 10px; background: #f1efff; color: #7968ee; }
.metric-lists .metric-icon { background: #eaf9f5; color: #219b88; }
.metric-contacts .metric-icon { background: #edf5ff; color: #4889d9; }
.metric-campaigns .metric-icon { background: #fff5e9; color: #ce8b3d; }
.metric-value { margin-top: 11px; font-size: 29px; line-height: 1.1; letter-spacing: -1.25px; color: #212a40; font-weight: 760; }
.metric-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; }
.metric-caption { color: #9aa2b3; font-size: 10px; }
.metric-chip-icon { color: #a3aabd; display: grid; place-items: center; }

/* Guided first-run experience */
.onboarding-panel { margin: 0 0 21px; padding: 21px 23px 17px; background: #fff; border: 1px solid #e8eaf2; border-radius: 16px; box-shadow: 0 5px 20px rgba(30,37,64,.025); }
.onboarding-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-bottom: 17px; }
.onboarding-kicker { color: #8575ee; font-size: 9px; font-weight: 800; letter-spacing: 1.4px; margin-bottom: 5px; }
.onboarding-heading h2 { margin: 0; color: #2d354c; font-size: 15px; letter-spacing: -.35px; }
.onboarding-heading p { margin: 5px 0 0; color: #8a93a6; font-size: 10px; }
.onboarding-progress { min-width: 113px; padding-left: 20px; border-left: 1px solid #eceef4; }
.onboarding-progress > strong { display: block; font-size: 20px; color: #7060e7; letter-spacing: -.8px; line-height: 1.1; }
.onboarding-progress > strong span { color: #b4b9c8; font-size: 13px; font-weight: 500; }
.onboarding-progress small { display: block; color: #919aae; font-size: 9px; margin: 4px 0 9px; }
.progress-track { height: 4px; background: #efedff; border-radius: 999px; overflow: hidden; }
.progress-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg,#9c8fff,#6f5ce8); transition: width .25s ease; }
.onboarding-steps { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 9px; }
.onboarding-step { min-width: 0; display: flex; align-items: center; gap: 10px; padding: 12px 10px; text-align: left; background: #fbfbfe; border: 1px solid #eceef5; border-radius: 11px; transition: .15s ease; }
.onboarding-step:hover { border-color: #d9d3ff; background: #faf9ff; transform: translateY(-1px); }
.onboarding-step.is-done { background: #f8fcfa; border-color: #e2f2eb; }
.onboarding-step-number { display: grid; place-items: center; flex: none; width: 29px; height: 29px; border-radius: 9px; background: #f0edff; color: #7968e9; font-size: 10px; font-weight: 800; }
.onboarding-step.is-done .onboarding-step-number { color: #148566; background: #e2f7ef; }
.onboarding-step-copy { display: grid; min-width: 0; gap: 3px; }
.onboarding-step-copy strong { color: #414b62; font-size: 10px; font-weight: 730; white-space: nowrap; }
.onboarding-step-copy small { color: #959db0; font-size: 9px; line-height: 1.4; }
.onboarding-step-arrow { margin-left: auto; color: #a4abc0; display: grid; place-items: center; }
.onboarding-step:hover .onboarding-step-arrow { color: #7564e9; }

/* Activity and delivery mix */
.dashboard-main-grid { display: grid; grid-template-columns: minmax(0,1.46fr) minmax(320px,.9fr); gap: 17px; align-items: start; }
.dashboard-activity-panel { min-width: 0; overflow: hidden; }
.panel-title-block { display: flex; align-items: center; gap: 11px; min-width: 0; }
.panel-icon { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 10px; }
.panel-icon-activity { color: #7161e7; background: #f1efff; }
.panel-icon-chart { color: #168e7d; background: #e9f9f4; }
.dashboard-activity-panel .panel-header { padding: 16px 18px; }
.dashboard-activity-panel .table-wrap { min-height: 210px; }
.dashboard-activity-panel td { padding: 13px 14px; }
.activity-panel-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 18px; background: #fbfbfe; border-top: 1px solid #eff1f6; color: #939caf; font-size: 9px; }
.activity-panel-footer strong { color: #5b657b; font-weight: 750; }
.activity-panel-footer > span:first-child { display: inline-flex; align-items: center; gap: 7px; }
.footer-status-dot { width: 6px; height: 6px; background: #8b7af4; border-radius: 50%; }
.footer-divider { margin: 0 4px; color: #c7cbd6; }
.dashboard-side-stack { display: grid; gap: 16px; min-width: 0; }
.subtle-count { background: #f7f7fc; padding: 6px 8px; border: 1px solid #eff0f6; color: #929ab0; border-radius: 7px; font-size: 9px; white-space: nowrap; }
.event-mix-body { padding: 18px 20px 14px; display: grid; gap: 15px; }
.event-mix-row { display: grid; gap: 7px; }
.event-mix-label { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: #69748b; font-size: 10px; }
.event-mix-label strong { color: #38435b; font-size: 10px; font-weight: 750; font-variant-numeric: tabular-nums; }
.event-mix-label strong small { color: #a0a8b9; font-size: 9px; font-weight: 550; margin-left: 4px; }
.event-mix-track { width: 100%; height: 6px; background: #f0f2f7; border-radius: 999px; overflow: hidden; }
.event-mix-track span { display: block; height: 100%; border-radius: 999px; min-width: 0; }
.mix-delivery { background: linear-gradient(90deg,#64d6b2,#36b894); }
.mix-bounce { background: linear-gradient(90deg,#ffb1aa,#ea776e); }
.mix-deferred { background: linear-gradient(90deg,#ffd38a,#efa843); }
.mix-rejected { background: linear-gradient(90deg,#b8adff,#8674ec); }
.event-mix-footer { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding: 12px 19px; border-top: 1px solid #f0f2f7; background: #fcfcfe; }
.event-legend { display: inline-flex; align-items: center; gap: 5px; color: #9099ad; font-size: 9px; }
.legend-dot { width: 6px; height: 6px; display: inline-block; border-radius: 50%; }
.legend-delivery { background: #45c29f; }
.legend-bounce { background: #e9857d; }
.event-mix-footer .link-button { margin-left: auto; }
.signal-empty { text-align: center; padding: 5px 10px 9px; }
.signal-empty-icon { width: 40px; height: 40px; display: grid; place-items: center; margin: 0 auto 10px; border-radius: 13px; color: #7869ec; background: #f2efff; }
.signal-empty strong { color: #404a61; font-size: 11px; }
.signal-empty p { max-width: 230px; margin: 5px auto 12px; color: #969eb0; font-size: 10px; line-height: 1.6; }
.quick-panel .panel-header { padding: 15px 18px 13px; }
.quick-panel-spark { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; color: #7b6aed; background: #f2efff; }
.quick-action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; padding: 13px; }
.quick-action { gap: 9px; padding: 11px 10px; min-width: 0; border-radius: 10px; }
.quick-action strong { color: #414b62; font-size: 10px; font-weight: 720; }
.quick-action small { font-size: 9px; line-height: 1.45; color: #929bb0; }
.quick-icon { width: 31px; height: 31px; border-radius: 9px; }
.quick-brand { color: #7765e9; background: #f0edff; }
.quick-list { color: #1d9a85; background: #e9f8f3; }
.quick-upload { color: #4989d7; background: #edf5ff; }
.quick-server { color: #bd873f; background: #fff5e7; }
.quick-action .arrow { display: grid; place-items: center; margin-left: auto; color: #abb2c2; }
.quick-action .arrow svg { width: 13px; height: 13px; }

/* Secondary pages inherit the same clean visual language. */
.detail-layout, .setup-grid, .content-grid { gap: 17px; }
.subscriber-head { background: #fcfcfe; }
.setup-list { gap: 18px; }
.step-number { border-radius: 9px; }
.metric-strip { margin-bottom: 16px; }
.footer-note { color: #929bb0; font-size: 10px; line-height: 1.6; background: #fcfcfe; border-top-color: #eff1f6; }
.login-screen { background: radial-gradient(ellipse at 14% 6%,rgba(131,113,255,.15) 0,transparent 36%),radial-gradient(ellipse at 90% 88%,rgba(62,197,165,.10) 0,transparent 32%),#f6f7fb; }
.login-card { border-color: #e9ebf2; border-radius: 20px; box-shadow: 0 24px 70px rgba(28,33,61,.12); padding: 35px; }
.login-card h1 { letter-spacing: -1.2px; }
.login-foot { color: #929bb0; }
.toast { border: 1px solid rgba(255,255,255,.08); border-radius: 11px; box-shadow: 0 15px 36px rgba(19,24,43,.22); }

@media (max-width: 1250px) {
  .page-content { padding-left: 27px; padding-right: 27px; }
  .dashboard-hero { grid-template-columns: minmax(0,1fr) minmax(300px,.85fr); }
  .dashboard-hero-copy { padding-left: 30px; padding-right: 20px; }
  .pipeline-node-source { left: 5%; }
  .pipeline-node-engine { left: 23%; }
  .pipeline-node-outcome { left: 11%; }
  .dashboard-main-grid { grid-template-columns: minmax(0,1.25fr) minmax(300px,.9fr); }
  .onboarding-steps { gap: 7px; }
  .onboarding-step { padding: 10px 8px; gap: 7px; }
}
@media (max-width: 1050px) {
  .sidebar { width: 220px; }
  .main-area { margin-left: 220px; }
  .dashboard-hero { grid-template-columns: minmax(0,1fr) 320px; }
  .dashboard-hero-copy { padding: 28px 24px; }
  .dashboard-hero h1 { font-size: 34px; }
  .hero-visual { transform: scale(.92); transform-origin: center left; margin-right: -20px; }
  .dashboard-main-grid { grid-template-columns: 1fr; }
  .dashboard-side-stack { grid-template-columns: 1fr 1fr; align-items: start; }
  .onboarding-steps { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 760px) {
  .sidebar { width: 64px; padding: 17px 7px; }
  .main-area { margin-left: 64px; }
  .brand-lockup { padding: 0 5px 25px; }
  .brand-mark { width: 36px; height: 36px; }
  .topbar { height: 58px; padding: 0 14px; }
  .page-content { padding: 20px 13px 33px; }
  .dashboard-hero { display: block; min-height: auto; }
  .dashboard-hero-copy { padding: 27px 22px 29px; }
  .dashboard-hero h1 { font-size: 34px; }
  .dashboard-hero-copy > p { font-size: 11px; }
  .hero-actions { gap: 14px; flex-wrap: wrap; }
  .hero-visual { display: none; }
  .section-kicker { flex-wrap: wrap; }
  .snapshot-caption { display: none; }
  .metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
  .metric-card { padding: 14px; }
  .metric-value { font-size: 25px; }
  .metric-caption { font-size: 9px; }
  .onboarding-panel { padding: 16px 13px 13px; }
  .onboarding-heading { align-items: flex-start; }
  .onboarding-progress { min-width: 85px; padding-left: 12px; }
  .onboarding-heading h2 { font-size: 13px; }
  .onboarding-heading p { max-width: 260px; line-height: 1.5; }
  .onboarding-steps { grid-template-columns: 1fr; }
  .onboarding-step { padding: 10px; }
  .dashboard-side-stack { grid-template-columns: 1fr; }
  .dashboard-activity-panel .panel-header { padding: 13px 14px; }
  .dashboard-activity-panel td { padding: 12px; }
  .activity-panel-footer { align-items: flex-start; flex-direction: column; }
  .quick-action-grid { padding: 10px; }
  .panel-header, .panel-body { padding: 14px; }
  .page-heading h1 { font-size: 24px; }
  .page-heading { margin-bottom: 19px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}


/* Throughput and managed DKIM operations */
.throughput-panel { margin: 20px 0 16px; overflow: hidden; }
.throughput-panel .panel-header { align-items: center; }
.panel-title-block { display: flex; align-items: center; gap: 11px; min-width: 0; }
.panel-icon { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 10px; }
.panel-icon-chart { color: #168e7d; background: #e9f9f4; }
.throughput-layout { display: grid; grid-template-columns: minmax(190px,.7fr) minmax(0,1.7fr); gap: 18px; padding: 19px; }
.throughput-cap-block { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; min-height: 185px; padding: 22px; border: 1px solid #e7e2ff; border-radius: 13px; background: radial-gradient(ellipse at 82% 8%,rgba(137,119,255,.12),transparent 40%),linear-gradient(140deg,#fbfaff,#f5f2ff); }
.throughput-eyebrow { color: #7869dd; font-size: 9px; font-weight: 800; letter-spacing: 1.25px; line-height: 1.5; }
.throughput-cap-value { display: flex; align-items: baseline; gap: 8px; margin: 12px 0 4px; color: #27224d; font-size: clamp(36px,4vw,52px); line-height: 1; font-weight: 800; letter-spacing: -2.5px; font-variant-numeric: tabular-nums; }
.throughput-cap-value small { color: #7768d8; font-size: 13px; font-weight: 750; letter-spacing: -.2px; }
.throughput-cap-block p { margin: 9px 0 16px; color: #777c99; font-size: 10px; line-height: 1.5; }
.throughput-cap-note { margin-top: auto; display: inline-flex; align-items: center; gap: 6px; color: #7f8a9d; font-size: 9px; }
.throughput-cap-note::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #9b8bf4; }
.throughput-observed-block { min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.throughput-stat-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.throughput-stat { min-width: 0; border: 1px solid #edf0f5; border-radius: 11px; padding: 13px 14px; background: #fff; }
.throughput-stat > span { display: block; color: #8490a4; font-size: 9px; line-height: 1.5; }
.throughput-stat > strong { display: block; margin-top: 7px; color: #303951; font-size: 23px; line-height: 1.15; letter-spacing: -.7px; font-weight: 780; font-variant-numeric: tabular-nums; }
.throughput-stat > strong small { margin-left: 3px; color: #7b6deb; font-size: 10px; letter-spacing: 0; }
.throughput-stat > small { display: block; margin-top: 6px; color: #9aa3b3; font-size: 9px; line-height: 1.45; }
.throughput-bar-label { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 17px 0 8px; color: #788399; font-size: 9px; }
.throughput-bar-label strong { color: #5d50cb; font-size: 10px; font-variant-numeric: tabular-nums; }
.throughput-bar { width: 100%; height: 7px; overflow: hidden; border-radius: 999px; background: #efedf9; }
.throughput-bar span { display: block; height: 100%; min-width: 0; border-radius: 999px; background: linear-gradient(90deg,#67d5b1,#7a68ee); transition: width .25s ease; }
.throughput-footnote { border-top: 1px solid #f0f2f7; padding: 13px 19px; color: #929bb0; background: #fcfcfe; font-size: 9px; line-height: 1.7; }
.throughput-footnote code { color: #69728b; font-size: 9px; }
.throughput-sync-ok { align-items: center; color: #116a58; background: #f0fbf7; border-color: #cdeee1; }
.throughput-sync-ok > div { flex: 1; min-width: 0; }
.throughput-compact .throughput-layout { grid-template-columns: minmax(160px,.55fr) minmax(0,1.6fr); padding: 14px; gap: 12px; }
.throughput-compact .throughput-cap-block { min-height: 150px; padding: 16px; }
.throughput-compact .throughput-cap-value { font-size: 38px; }
.throughput-compact .throughput-stat { padding: 10px; }
.throughput-compact .throughput-stat > strong { font-size: 19px; }
@media (max-width: 1050px) {
  .throughput-layout, .throughput-compact .throughput-layout { grid-template-columns: minmax(0,1fr); }
  .throughput-cap-block, .throughput-compact .throughput-cap-block { min-height: 0; }
  .throughput-cap-note { margin-top: 8px; }
}
@media (max-width: 760px) {
  .throughput-stat-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .throughput-layout, .throughput-compact .throughput-layout { padding: 12px; }
  .throughput-stat { padding: 11px; }
  .throughput-stat > strong { font-size: 20px; }
  .throughput-footnote { padding: 12px; }
  .throughput-sync-ok { align-items: flex-start; flex-wrap: wrap; }
  .throughput-sync-ok .btn { margin-left: 28px; }
}

/* Layout consistency pass: normalize rhythm, prevent squeezed controls, and keep responsive navigation usable. */
:root {
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
}
html { scroll-padding-top: 84px; }
body { line-height: 1.5; }
button, input, select, textarea { line-height: 1.45; }
#pageContent, .page-content { min-width: 0; }
.page-content { width: 100%; }
.page-heading { align-items: flex-start; margin-bottom: 24px; }
.page-heading > * { min-width: 0; }
.page-heading .inline-actions, .page-heading .campaign-actions { justify-content: flex-start; }
.page-heading h1 { line-height: 1.2; }
.page-heading p { max-width: 760px; }

/* Predictable vertical rhythm between dynamically rendered sections. */
#pageContent > * + * { margin-top: 20px; }
#pageContent > .page-heading + * { margin-top: 0; }
#pageContent .panel + .panel { margin-top: 16px; }
.panel { min-width: 0; margin-bottom: 0; }
.panel-header { min-height: 62px; padding: 17px 20px; }
.panel-header > * { min-width: 0; }
.panel-body { padding: 20px; }
.panel-body > * + * { margin-top: 16px; }
.panel-body > .notice:first-child, .panel-body > .metric-strip:first-child { margin-top: 0; }
.panel-body .stack-form { gap: 18px; }
.panel-body .stack-form > * { min-width: 0; }

/* Forms: consistent label/control/help-text spacing and sane full-width behavior. */
.field, .stack-form .field { gap: 7px; }
.field label, .stack-form label { line-height: 1.4; }
.field input, .field select, .field textarea,
.stack-form input, .stack-form select, .stack-form textarea,
#modalBody input, #modalBody select, #modalBody textarea {
  width: 100%; min-height: 42px; padding: 10px 12px; line-height: 1.45;
}
.field textarea, .stack-form textarea, #modalBody textarea { min-height: 104px; }
.field input[type="checkbox"], .stack-form input[type="checkbox"], #modalBody input[type="checkbox"],
.field input[type="radio"], .stack-form input[type="radio"], #modalBody input[type="radio"] {
  width: 16px; min-height: 16px; height: 16px; padding: 0;
}
.helper { display: block; margin-top: 1px; }
.form-row { gap: 16px; }
.form-actions { gap: 10px; margin-top: 4px; padding-top: 16px; }
.check-row { gap: 12px; padding: 14px 16px; }

/* Avoid flex children forcing pages wider than the viewport. */
.row, .inline-actions, .form-actions, .campaign-actions, .table-toolbar,
.subscriber-head, .panel-header, .page-heading { min-width: 0; }
.inline-actions > *, .form-actions > *, .campaign-actions > * { max-width: 100%; }
.table-wrap { max-width: 100%; }
.table-toolbar { flex-wrap: wrap; }
.filters { gap: 14px; }
.metric-strip { gap: 10px; }
.quick-actions, .quick-action-grid { gap: 12px; }

/* The modal heading should span the modal; avoid the previous double padding. */
.modal-card { padding: 0; }
.modal-heading { padding: 18px 22px; }
#modalBody { padding: 22px; }
.modal-card > * { min-width: 0; }

/* Footer settings and other long forms should remain readable at wide and narrow widths. */
#emailFooterForm { display: flex; flex-direction: column; gap: 18px; }
#emailFooterForm .field + .field { margin-top: 0; }
#emailFooterForm textarea { min-height: 100px; }
#emailFooterForm .form-actions { width: 100%; }

@media (max-width: 1050px) {
  .page-content { padding: 26px 24px 42px; }
  .topbar { padding-inline: 24px; }
  .page-heading { gap: 14px; }
  .panel-header { padding: 16px 18px; }
  .panel-body { padding: 18px; }
}

@media (max-width: 760px) {
  /* Keep navigation labels readable instead of squeezing them into a 64px rail. */
  .sidebar {
    position: static; inset: auto; width: 100%; min-height: 0;
    padding: 14px 14px 12px; overflow: visible;
  }
  .brand-lockup { padding: 0 4px 16px; }
  .workspace-label, .sidebar-status, .logout-button { display: none; }
  .main-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .nav-item { min-width: 0; min-height: 42px; padding: 8px 10px; gap: 8px; font-size: 11px; }
  .nav-item .nav-icon { flex: 0 0 18px; }
  .nav-count { margin-left: auto; }
  .sidebar-bottom { margin: 6px 0 0; padding: 0; }
  .main-area { margin-left: 0; min-width: 0; }
  .topbar { position: static; height: 56px; padding: 0 16px; }
  .page-content { padding: 22px 14px 36px; }
  .page-heading { flex-direction: column; align-items: stretch; gap: 12px; margin-bottom: 18px; }
  .page-heading h1 { font-size: 24px; }
  .page-heading .inline-actions, .page-heading .campaign-actions { width: 100%; }
  .panel-header { align-items: flex-start; flex-direction: column; gap: 10px; padding: 15px 16px; }
  .panel-header > .btn, .panel-header > .inline-actions { align-self: stretch; }
  .panel-body { padding: 16px; }
  .panel-body > * + * { margin-top: 14px; }
  .form-row, .detail-layout, .quick-actions, .dashboard-side-stack { grid-template-columns: minmax(0, 1fr); }
  .filters { grid-template-columns: minmax(0, 1fr); padding: 14px; }
  .subscriber-head { align-items: flex-start; flex-direction: column; padding: 14px 16px; }
  .table-toolbar { align-items: flex-start; flex-direction: column; gap: 10px; padding: 12px 16px; }
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { min-width: 620px; }
  .modal-layer { padding: 8px; }
  .modal-card { max-height: 96dvh; border-radius: 14px; }
  .modal-heading { padding: 15px 16px; }
  #modalBody { padding: 16px; }
  .login-card { padding: 24px; }
  .throughput-layout, .throughput-compact .throughput-layout { padding: 12px; }
}

@media (max-width: 420px) {
  .topbar { padding-inline: 12px; }
  .breadcrumb { gap: 6px; font-size: 11px; }
  .env-pill { padding: 6px 8px; font-size: 8px; }
  .page-content { padding-inline: 10px; }
  .panel-body { padding: 13px; }
  .panel-header { padding: 13px; }
  .btn { white-space: normal; text-align: center; }
  .form-actions { align-items: stretch; flex-direction: column; }
  .form-actions .btn { width: 100%; }
  .throughput-stat-grid { grid-template-columns: minmax(0, 1fr); }
}
