/* ============================================================================
   Pulse — shared house-style stylesheet (PULSE-103)
   Dragnet house style: Inter; red #E71615 / black #141414 / charcoal #242424.
   This is the single source of visual truth — views must NOT carry inline
   styles. Responsive down to a standard laptop width; no mobile requirement
   in v1.
   ========================================================================== */

/* --- Design tokens ------------------------------------------------------- */
:root {
  /* House palette */
  --pulse-red: #e71615;
  --pulse-black: #141414;
  --pulse-charcoal: #242424;

  /* Derived neutrals (a usable UI needs a few supporting tones) */
  --pulse-charcoal-2: #2f2f2f;
  --pulse-red-dark: #b91110;
  --pulse-ink: #141414;
  --pulse-muted: #6b6b6b;
  --pulse-line: #e3e3e3;
  --pulse-surface: #ffffff;
  --pulse-canvas: #f5f5f6;
  --pulse-on-dark: #f4f4f4;
  --pulse-on-dark-muted: #a8a8a8;

  /* Type — Inter (self-hosted WOFF2, OFL license, weights 400/500/600/700) */
  --pulse-font: "Inter", -apple-system, "Segoe UI", sans-serif;

  /* Layout metrics */
  --pulse-header-h: 60px;
  --pulse-sidenav-w: 232px;
  --pulse-radius: 8px;
  --pulse-maxw: 1400px;
}

@font-face {
  font-family: "Inter";
  src: url("/public/fonts/inter/inter-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/public/fonts/inter/inter-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/public/fonts/inter/inter-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/public/fonts/inter/inter-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

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

html,
body {
  margin: 0;
  padding: 0;
}

/* The `hidden` attribute must always win. The UA rule `[hidden]{display:none}`
   is a *normal* declaration, so any author `display` rule (e.g. a modal's
   `.modal-backdrop{display:flex}`) overrides it and leaves the element on
   screen — a full-screen backdrop then silently intercepts every click. This
   `!important` reset (the normalize.css idiom) guarantees `el.hidden = true`
   actually hides, for modals and every other hidden-toggled element. */
[hidden] {
  display: none !important;
}

body {
  font-family: var(--pulse-font);
  color: var(--pulse-ink);
  background: var(--pulse-canvas);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--pulse-red);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

h1,
h2,
h3 {
  color: var(--pulse-black);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 0.5em;
}

/* --- App frame ----------------------------------------------------------- */
/* Grid: header spans the top; sidenav on the left; content fills the rest. */
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--pulse-sidenav-w) 1fr;
  grid-template-rows: var(--pulse-header-h) 1fr auto;
  grid-template-areas:
    "header header"
    "sidenav main"
    "sidenav footer";
}

/* --- Header -------------------------------------------------------------- */
.app-header {
  grid-area: header;
  background: var(--pulse-black);
  color: var(--pulse-on-dark);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  border-bottom: 3px solid var(--pulse-red);
  position: sticky;
  top: 0;
  z-index: 20;
}

.app-header__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--pulse-on-dark);
}

.app-header__mark {
  display: inline-block;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: var(--pulse-red);
  position: relative;
}
.app-header__mark::after {
  content: "";
  position: absolute;
  inset: 9px 6px;
  background: var(--pulse-on-dark);
  border-radius: 1px;
}

.app-header__title {
  font-size: 18px;
}
.app-header__subtitle {
  color: var(--pulse-on-dark-muted);
  font-size: 12px;
  font-weight: 400;
  margin-left: 2px;
}

.app-header__spacer {
  flex: 1;
}

/* Global search (PULSE-608) */
.app-header__search {
  flex: 1;
  max-width: 420px;
}
.app-header__search-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid #3a3a3a;
  border-radius: 6px;
  color: var(--pulse-on-dark);
  padding: 7px 12px;
  font-size: 13px;
}
.app-header__search-input::placeholder {
  color: var(--pulse-on-dark-muted);
}
.app-header__search-input:focus {
  outline: none;
  border-color: var(--pulse-red);
  background: rgba(255, 255, 255, 0.12);
}

/* Logged-in user chip (identity from the auth plugin) */
.app-header__user {
  display: flex;
  align-items: center;
  gap: 10px;
}
.app-header__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--pulse-red);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}
.app-header__user-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.app-header__user-name {
  font-size: 13px;
  font-weight: 700;
}
.app-header__user-role {
  font-size: 11px;
  color: var(--pulse-on-dark-muted);
  text-transform: capitalize;
}

.app-header__logout {
  margin: 0;
}

.app-header__logout-btn {
  appearance: none;
  border: 1px solid #4a4a4a;
  border-radius: 6px;
  background: transparent;
  color: var(--pulse-on-dark);
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 10px;
}

.app-header__logout-btn:hover,
.app-header__logout-btn:focus {
  border-color: var(--pulse-red);
  outline: none;
}

.app-header__navtoggle {
  display: none;
  background: transparent;
  border: 1px solid #3a3a3a;
  color: var(--pulse-on-dark);
  border-radius: 6px;
  padding: 6px 9px;
  cursor: pointer;
  font-size: 15px;
}

/* --- Auth shell ---------------------------------------------------------- */
.auth-page {
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(20, 20, 20, 0.96), rgba(36, 36, 36, 0.92)),
    var(--pulse-black);
  color: var(--pulse-ink);
}

.auth-main {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
}

.auth-card {
  width: min(100%, 420px);
  background: var(--pulse-surface);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--pulse-radius);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  padding: 32px;
}

.auth-card__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}

.auth-card__mark {
  display: inline-block;
  width: 34px;
  height: 34px;
  border-radius: 7px;
  background: var(--pulse-red);
  position: relative;
}

.auth-card__mark::after {
  content: "";
  position: absolute;
  inset: 12px 8px;
  background: #fff;
  border-radius: 1px;
}

.auth-card__brand-text {
  display: flex;
  flex-direction: column;
  font-weight: 800;
  line-height: 1.1;
}

.auth-card__brand-text small {
  color: var(--pulse-muted);
  font-size: 12px;
  font-weight: 600;
  margin-top: 3px;
}

.auth-card__header {
  margin-bottom: 24px;
}

.auth-card__header h1 {
  font-size: 2rem;
  margin: 0 0 8px;
}

.auth-form {
  display: grid;
  gap: 16px;
}

.auth-form__submit {
  justify-content: center;
  min-height: 44px;
  width: 100%;
}

/* --- Side nav ------------------------------------------------------------ */
.app-sidenav {
  grid-area: sidenav;
  background: var(--pulse-charcoal);
  color: var(--pulse-on-dark);
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.app-sidenav__section {
  color: var(--pulse-on-dark-muted);
  font-size: 11px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 14px 12px 6px;
}

.app-sidenav__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 6px;
  color: var(--pulse-on-dark);
  font-size: 14px;
  border-left: 3px solid transparent;
}
.app-sidenav__link:hover {
  background: var(--pulse-charcoal-2);
  text-decoration: none;
}
.app-sidenav__link[aria-current="page"] {
  background: var(--pulse-charcoal-2);
  border-left-color: var(--pulse-red);
  font-weight: 700;
}
.app-sidenav__icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.9;
}
.app-sidenav__link[aria-disabled="true"] {
  opacity: 0.45;
  pointer-events: none;
}
.app-sidenav__soon {
  margin-left: auto;
  font-size: 9px;
  letter-spacing: 0.5px;
  background: #3a3a3a;
  color: var(--pulse-on-dark-muted);
  padding: 2px 6px;
  border-radius: 10px;
  text-transform: uppercase;
}

/* --- Main content -------------------------------------------------------- */
.app-main {
  grid-area: main;
  padding: 26px 30px;
}
.app-main__inner {
  max-width: var(--pulse-maxw);
  margin: 0 auto;
}

.page-head {
  margin-bottom: 20px;
}
.page-head__title {
  font-size: 24px;
}
.page-head__desc {
  color: var(--pulse-muted);
  margin: 0;
}

.card {
  background: var(--pulse-surface);
  border: 1px solid var(--pulse-line);
  border-radius: var(--pulse-radius);
  padding: 20px 22px;
  margin-bottom: 18px;
}

.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 20px;
  background: var(--pulse-red);
  color: #fff;
}

.kv {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 6px 14px;
  font-size: 14px;
}
.kv dt {
  color: var(--pulse-muted);
}
.kv dd {
  margin: 0;
  font-weight: 700;
}

/* --- Footer -------------------------------------------------------------- */
.app-footer {
  grid-area: footer;
  background: var(--pulse-surface);
  border-top: 1px solid var(--pulse-line);
  color: var(--pulse-muted);
  font-size: 12px;
  padding: 14px 30px;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.app-footer__accent {
  color: var(--pulse-red);
  font-weight: 700;
}
.app-footer__spacer {
  flex: 1;
}

/* --- Responsive: laptop-first; graceful narrowing only (no mobile in v1) -- */
@media (max-width: 1024px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-areas:
      "header"
      "main"
      "footer";
  }
  .app-sidenav {
    position: fixed;
    top: var(--pulse-header-h);
    bottom: 0;
    left: 0;
    width: var(--pulse-sidenav-w);
    transform: translateX(-100%);
    transition: transform 0.18s ease;
    z-index: 30;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.25);
  }
  .app-shell.nav-open .app-sidenav {
    transform: translateX(0);
  }
  .app-header__navtoggle {
    display: inline-block;
  }
  .app-header__search {
    max-width: none;
  }
  .app-header__subtitle {
    display: none;
  }
}

@media (max-width: 900px) {
  .collection-settings__grid,
  .collection-settings__grid--rules,
  .collection-settings__grid--messages,
  .collection-settings__grid--contact,
  .insight-kpis,
  .metric-banner,
  .takeaway-callout,
  .report-meta-strip,
  .quant-grid,
  .question-insights,
  .action-matrix {
    grid-template-columns: 1fr;
  }
  .feature-matrix {
    grid-template-columns: 1fr;
  }
  .chart-list__row {
    grid-template-columns: minmax(80px, 1fr) minmax(100px, 1.5fr) 34px 42px;
  }
}

/* ============================================================================
   Dashboard — campaign list (PULSE-104)
   ========================================================================== */

.page-head--row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.page-head__actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* --- Buttons ------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  padding: 10px 16px;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover {
  text-decoration: none;
}
.btn--primary {
  background: var(--pulse-red);
  color: #fff;
}
.btn--primary:hover {
  background: var(--pulse-red-dark);
}
.btn--dark {
  background: var(--pulse-black);
  color: var(--pulse-on-dark);
}
.btn--dark:hover {
  background: var(--pulse-charcoal-2);
}
.btn--ghost {
  background: transparent;
  color: var(--pulse-charcoal);
  border-color: var(--pulse-line);
}
.btn--ghost:hover {
  border-color: var(--pulse-muted);
}
.btn--danger {
  color: var(--pulse-red-dark);
  border-color: #f3b8b8;
}
.btn--danger:hover {
  border-color: var(--pulse-red-dark);
}
.inline-form {
  display: inline-flex;
  margin: 0;
}

.export-menu {
  position: relative;
  display: inline-block;
}
.export-menu__summary {
  list-style: none;
}
.export-menu__summary::-webkit-details-marker {
  display: none;
}
.export-menu__summary::after {
  content: "▾";
  font-size: 10px;
  margin-left: 2px;
}
.export-menu__panel {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 160px;
  background: var(--pulse-surface);
  border: 1px solid var(--pulse-line);
  border-radius: 6px;
  box-shadow: 0 10px 24px rgba(20, 20, 20, 0.14);
  padding: 6px;
  z-index: 40;
}
.export-menu__item {
  display: block;
  padding: 9px 10px;
  border-radius: 4px;
  color: var(--pulse-ink);
  font-size: 13px;
  font-weight: 600;
}
.export-menu__item:hover {
  background: var(--pulse-canvas);
  text-decoration: none;
}

/* --- Inputs / filter bar ------------------------------------------------- */
.input {
  font-family: inherit;
  font-size: 14px;
  color: var(--pulse-ink);
  background: var(--pulse-surface);
  border: 1px solid var(--pulse-line);
  border-radius: 6px;
  padding: 9px 11px;
  width: 100%;
}
.input:focus {
  outline: none;
  /* Focus is a neutral (charcoal) state — red is reserved for errors and
     destructive actions per house style, never a resting/focus state. */
  border-color: var(--pulse-charcoal);
  box-shadow: 0 0 0 3px rgba(20, 20, 20, 0.1);
}

.filterbar {
  margin-bottom: 18px;
}
.filterbar__search {
  margin-bottom: 12px;
}
.filterbar__search .input {
  max-width: 420px;
}
.filterbar__filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 150px;
}
.field__label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--pulse-muted);
}
.filterbar__actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* --- Table --------------------------------------------------------------- */
.card--flush {
  padding: 0;
  /* Wide table scrolls horizontally within its own container rather than
     forcing the page body to scroll sideways. */
  overflow-x: auto;
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.table th,
.table td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--pulse-line);
  vertical-align: middle;
}
.table thead th {
  background: #fafafa;
  color: var(--pulse-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  white-space: nowrap;
  border-bottom: 2px solid var(--pulse-line);
}
.table tbody tr:last-child td {
  border-bottom: none;
}
.table tbody tr:hover {
  background: #fbfbfb;
}
/* Landed on via a search result's #response-<id> deep link (PULSE-608). */
.table tbody tr:target {
  background: #fff6d6;
}
.table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.table__name {
  font-weight: 700;
  color: var(--pulse-black);
}

/* --- Status pills -------------------------------------------------------- */
.pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid transparent;
}
.pill--draft {
  background: #eeeeee;
  color: #555;
}
.pill--scheduled {
  background: #e8eefc;
  color: #2a4ba0;
}
.pill--sending {
  background: #fff3d6;
  color: #8a6100;
}
.pill--live {
  background: #e2f5e9;
  color: #1c7a43;
}
.pill--suspended {
  background: #fff3d6;
  color: #8a6100;
}
.pill--closed {
  background: #fde3e3;
  color: var(--pulse-red-dark);
}

/* --- Empty states -------------------------------------------------------- */
.empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--pulse-muted);
}
.empty p {
  margin: 0 0 12px;
}

/* ============================================================================
   New Campaign wizard — Step 1 (PULSE-105)
   ========================================================================== */

/* Step indicator */
.wizard-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
}
.wizard-steps__item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 20px;
  background: var(--pulse-surface);
  border: 1px solid var(--pulse-line);
  font-size: 13px;
  color: var(--pulse-muted);
}
.wizard-steps__num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  background: var(--pulse-line);
  color: var(--pulse-charcoal);
}
.wizard-steps__item.is-current {
  border-color: var(--pulse-red);
  color: var(--pulse-black);
  font-weight: 700;
}
.wizard-steps__item.is-current .wizard-steps__num {
  background: var(--pulse-red);
  color: #fff;
}
.wizard-steps__item.is-done .wizard-steps__num {
  background: var(--pulse-black);
  color: #fff;
}

/* Forms */
.form .field-row {
  margin-bottom: 16px;
}
.collection-settings {
  margin-top: 16px;
}
.collection-settings__grid {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
  align-items: end;
}
.collection-settings__grid--rules {
  grid-template-columns: minmax(240px, 1.3fr) minmax(220px, 1fr) minmax(180px, 0.8fr);
}
.collection-settings__grid--messages {
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  align-items: stretch;
}
.collection-settings__grid--contact {
  grid-template-columns: minmax(220px, 0.8fr) minmax(260px, 1fr) auto;
}
.collection-settings .field {
  min-width: 0;
}
.field--full {
  width: 100%;
  min-width: 0;
}
.field textarea.input {
  resize: vertical;
  font-family: inherit;
}
.req {
  color: var(--pulse-red);
}
.field__opt {
  color: var(--pulse-muted);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}
.field__error {
  color: var(--pulse-red-dark);
  font-size: 12px;
  font-weight: 600;
  margin-top: 4px;
}
.input--error,
.input--error:focus {
  /* Only genuine validation errors get the red treatment — and a focused
     error field stays red rather than reverting to the neutral focus style. */
  border-color: var(--pulse-red);
  box-shadow: 0 0 0 3px rgba(231, 22, 21, 0.12);
}
.form__actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 4px;
}

/* Notices */
.notice {
  border-radius: 6px;
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: 14px;
  border: 1px solid transparent;
}
.notice--success {
  background: #e2f5e9;
  color: #1c7a43;
  border-color: #bfe6cd;
}

.card--muted {
  background: #fafafa;
  color: var(--pulse-muted);
}

/* Resumable draft link in the dashboard table */
.table__name a {
  color: var(--pulse-black);
}
.table__name a:hover {
  color: var(--pulse-red);
  text-decoration: none;
}

/* ============================================================================
   Recipient upload — Step 2 (PULSE-106)
   ========================================================================== */

.muted { color: var(--pulse-muted); }

.field__hint {
  font-size: 12px;
  color: var(--pulse-muted);
  margin-top: 4px;
}

.notice--error {
  background: #fde3e3;
  color: var(--pulse-red-dark);
  border-color: #f3c2c2;
}

/* Column mapping */
.map-grid {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}
.map-grid__row {
  display: grid;
  grid-template-columns: minmax(120px, 260px) 1fr;
  gap: 12px;
  align-items: center;
}
.map-grid__col {
  font-weight: 700;
  color: var(--pulse-black);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Horizontal scroll wrapper for wide preview tables */
.table-scroll { overflow-x: auto; }
.card__pad { padding: 16px 16px 0; }

/* Summary stats */
.stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  margin-bottom: 6px;
}
.stat { display: flex; flex-direction: column; }
.stat__num { font-size: 26px; font-weight: 700; color: var(--pulse-black); }
.stat__label { font-size: 12px; color: var(--pulse-muted); text-transform: uppercase; letter-spacing: 0.4px; }

/* Flagged-rows list */
.flag-list { list-style: none; padding: 0; margin: 8px 0 0; }
.flag-list__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--pulse-line);
}
.flag-list__item:last-child { border-bottom: none; }
.flag-list__label {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  cursor: pointer;
}
.flag-list__row { font-weight: 700; min-width: 64px; }
.flag-list__who { color: var(--pulse-ink); }
.flag-list__issue { color: var(--pulse-red-dark); font-size: 13px; }
.flag-list__note { font-size: 12px; }

/* ============================================================================
   Survey question builder — Step 3 core (PULSE-201)
   ========================================================================== */

.qb-toolbar {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.qb-toolbar__spacer { flex: 1; }
.qb-add__row { display: flex; gap: 8px; align-items: center; }
.qb-add__row .input { min-width: 220px; }
.qb-toolbar__save { display: flex; align-items: center; gap: 12px; }

.qb-status { font-size: 13px; color: var(--pulse-muted); }
.qb-status--ok { color: #1c7a43; font-weight: 700; }
.qb-status--error { color: var(--pulse-red-dark); font-weight: 700; }

.qb-list { display: flex; flex-direction: column; gap: 14px; }

.qb-q {
  background: var(--pulse-surface);
  border: 1px solid var(--pulse-line);
  border-radius: var(--pulse-radius);
  padding: 16px 18px;
}
.qb-q--over { border-color: var(--pulse-red); box-shadow: 0 0 0 3px rgba(231, 22, 21, 0.1); }

.qb-q__head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.qb-q__handle { cursor: grab; color: var(--pulse-muted); font-size: 16px; user-select: none; }
.qb-q__num { font-weight: 700; color: var(--pulse-black); }
.qb-q__type { background: var(--pulse-charcoal); color: #fff; }
.qb-q__spacer { flex: 1; }

.qb-icon-btn {
  border: 1px solid var(--pulse-line);
  background: var(--pulse-surface);
  color: var(--pulse-charcoal);
  border-radius: 6px;
  width: 30px; height: 30px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}
.qb-icon-btn:hover { border-color: var(--pulse-muted); }
.qb-icon-btn--danger:hover { border-color: var(--pulse-red); color: var(--pulse-red); }

.qb-q__text { margin-bottom: 10px; }
.qb-q__body { margin: 6px 0 10px; }

.qb-q__req { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }

.qb-opts { border-left: 3px solid var(--pulse-line); padding-left: 12px; margin: 6px 0; }
.qb-opts__head { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; color: var(--pulse-muted); margin-bottom: 6px; }
.qb-opt { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.qb-opt .input { flex: 1; }

.btn--sm { padding: 6px 10px; font-size: 12px; }

.qb-range { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; margin: 6px 0; }
.qb-range__label { width: 100%; }
.qb-num { display: flex; flex-direction: column; gap: 4px; }
.qb-num .input { width: 90px; }

.qb-note { color: var(--pulse-muted); font-size: 13px; margin: 4px 0; }
.qb-trans__cleared { color: var(--pulse-red-dark); font-weight: 600; }

/* Skip logic + piping (PULSE-202) */
.qb-logic {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--pulse-line);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.qb-logic__row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.qb-logic__lead { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; color: var(--pulse-muted); }
.qb-logic__row .input { width: auto; min-width: 160px; flex: 0 1 auto; }
.qb-logic__op { min-width: 90px; }

/* Block randomization + multilingual (PULSE-203) */
.qb-langs__row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.qb-lang-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: #eee; color: var(--pulse-charcoal);
  border-radius: 20px; padding: 4px 10px; font-size: 13px; font-weight: 700;
}
.qb-lang-chip--default { background: var(--pulse-charcoal); color: #fff; }
.qb-lang-chip__x { border: none; background: transparent; color: inherit; cursor: pointer; font-size: 12px; padding: 0; }
.qb-langs__add { width: auto; min-width: 240px; }

.qb-block .input { min-width: 260px; }

.qb-trans {
  margin-top: 10px; padding-top: 10px;
  border-top: 1px dashed var(--pulse-line);
}
.qb-trans__locale { margin: 8px 0; }
.qb-trans__code { background: var(--pulse-charcoal); color: #fff; margin-bottom: 6px; display: inline-block; }
.qb-trans__opts { margin-top: 6px; padding-left: 12px; border-left: 3px solid var(--pulse-line); }
.qb-trans__deflabel { min-width: 140px; color: var(--pulse-muted); font-size: 13px; }

/* =========================================================
   PULSE-204 — Question Bank: choice screen, pickers, modal
   ========================================================= */

/* Choice screen — three equal cards */
.choose-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 24px;
}
@media (max-width: 780px) {
  .choose-grid { grid-template-columns: 1fr; }
}
.choose-card {
  border: 1px solid var(--pulse-line);
  border-radius: var(--radius);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--pulse-white);
}
.choose-card--muted { opacity: 0.7; }
.choose-card__icon { font-size: 2rem; line-height: 1; }
.choose-card__title { font-size: 1.1rem; font-weight: 700; margin: 0; }
.choose-card__desc { color: var(--pulse-muted); font-size: 0.9rem; margin: 0; flex: 1; }

/* Template / clone picker list */
.template-list { display: flex; flex-direction: column; gap: 12px; margin-top: 20px; }
.template-card {
  border: 1px solid var(--pulse-line);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--pulse-white);
}
.template-card__body { flex: 1; min-width: 0; }
.template-card__name { font-size: 1rem; font-weight: 700; margin: 0 0 4px; }
.template-card__desc {
  font-size: 0.875rem;
  color: var(--pulse-muted);
  margin: 0 0 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.template-card__meta { font-size: 0.8125rem; margin: 0; }
.template-card__action { flex-shrink: 0; }

/* Save-to-bank modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}
.modal {
  background: var(--pulse-white);
  border-radius: var(--radius);
  padding: 28px 32px;
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}
.modal__title { font-size: 1.2rem; font-weight: 700; margin: 0; }
.modal__desc { font-size: 0.875rem; margin: 0; }
.modal__actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }

/* =========================================================
   PULSE-206 — Review & send (Step 4)
   ========================================================= */

/* Campaign summary strip */
.review-summary {
  display: flex;
  gap: 0;
  flex-wrap: wrap;
  padding: 0;
  overflow: hidden;
}
.review-summary__item {
  flex: 1;
  min-width: 160px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 20px 24px;
  border-right: 1px solid var(--pulse-line);
}
.review-summary__item:last-child { border-right: none; }
.review-summary__label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--pulse-muted); }
.review-summary__value { font-size: 1.05rem; font-weight: 600; }
.text--warn { color: #b45309; }

/* Card heading variant */
.card__heading { font-size: 1rem; font-weight: 700; margin: 0 0 16px; }
.card__heading-note { font-size: 0.8125rem; font-weight: 400; color: var(--pulse-muted); }

/* Hint text below label */
.field__hint { font-size: 0.8125rem; color: var(--pulse-muted); margin: 2px 0 8px; }

/* Monospace textarea */
.input--mono { font-family: 'Courier New', Courier, monospace; font-size: 0.875rem; }

/* Email preview box */
.email-preview {
  border: 1px solid var(--pulse-line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--pulse-white);
}
.email-preview__header {
  background: var(--pulse-bg);
  border-bottom: 1px solid var(--pulse-line);
  padding: 10px 16px;
  font-size: 0.875rem;
}
.email-preview__field { display: block; }
.email-preview__body {
  padding: 20px 24px;
  font-size: 0.9rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}
.email-preview__token {
  display: inline-block;
  background: #fef9c3;
  color: #854d0e;
  border: 1px solid #fde68a;
  border-radius: 3px;
  padding: 0 4px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.8125rem;
}
.email-preview__note {
  padding: 8px 16px;
  border-top: 1px solid var(--pulse-line);
  font-size: 0.8125rem;
  margin: 0;
}

/* Radio labels */
.radio-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.9375rem;
  margin-right: 24px;
}

/* Prereq error list */
.prereq-list { margin: 6px 0 0; padding-left: 20px; }
.prereq-list li { margin-bottom: 4px; }

/* "Continue to review" nudge card at bottom of builder */
.review-next {
  display: flex;
  align-items: center;
  gap: 20px;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-top: 16px;
}
.review-next__body { flex: 1; min-width: 0; }
.review-next__title { font-size: 1rem; font-weight: 700; margin: 0 0 4px; }

/* =========================================================
   Epic 3 — Delivery tracking, timeline & recipient notes
   ========================================================= */

/* Per-recipient dispatch-state pills (PSA §4.4). State names are UPPERCASE,
   so these never collide with the lowercase campaign-status pills above. */
.pill--dispatch { border-color: transparent; }
.pill--CREATED   { background: #eeeeee; color: #555; }
.pill--QUEUED    { background: #e8eefc; color: #2a4ba0; }
.pill--SENT      { background: #e3ecff; color: #1f47b3; }
.pill--DELIVERED { background: #dff1ef; color: #0f6b60; }
.pill--OPENED    { background: #e2f5e9; color: #1c7a43; }
.pill--STARTED   { background: #efe6fb; color: #5b2a9e; }
.pill--COMPLETED { background: #cdefd8; color: #146c37; }
.pill--FAILED    { background: #fde3e3; color: var(--pulse-red-dark); }
.pill--note      { background: #f0f0f0; color: #333; }
/* Tags an event on the recipient timeline with which survey it belongs to
   (PULSE-6xx-multisurvey — a recipient's history now spans several surveys). */
.pill--survey    { background: #f0f0f0; color: var(--pulse-charcoal); border-color: var(--pulse-line); }

/* Survey selector tabs (PULSE-6xx-multisurvey) — Delivery/Responses/Analysis
   each show one survey at a time; switch via these tabs. */
.survey-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--pulse-line);
  padding-bottom: 10px;
}
.survey-tabs__tab {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  color: var(--pulse-muted);
  text-decoration: none;
  padding: 7px 14px;
  border-radius: 20px;
  border: 1px solid transparent;
}
.survey-tabs__tab:hover {
  color: var(--pulse-ink);
  border-color: var(--pulse-line);
}
.survey-tabs__tab.is-active {
  background: var(--pulse-black);
  color: var(--pulse-on-dark);
}
.survey-tabs__single {
  margin: 0 0 18px;
}

/* Delivery summary strip (PULSE-303) */
.delivery-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}
.delivery-summary__tile {
  flex: 1 1 120px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 16px;
  background: var(--pulse-surface);
  border: 1px solid var(--pulse-line);
  border-radius: var(--pulse-radius);
}
.delivery-summary__count { font-size: 1.6rem; font-weight: 700; line-height: 1; }

/* Generic list-screen pager (scale audit, SCALABILITY.md — shared across
   Delivery/Responses/Activity Log's server-side pagination). */
.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.pager__links { display: flex; align-items: center; gap: 10px; }
.pager__page { font-size: 13px; color: var(--pulse-muted); }
.pager__summary { font-size: 13px; }

/* Recipient timeline (PULSE-304) + note form (PULSE-305) */
.timeline-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  align-items: start;
}
@media (max-width: 900px) {
  .timeline-grid { grid-template-columns: 1fr; }
}
.card__title { font-size: 1.05rem; font-weight: 700; margin: 0 0 14px; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline__item {
  position: relative;
  display: flex;
  gap: 12px;
  padding: 0 0 18px 4px;
}
.timeline__item::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 16px;
  bottom: 0;
  width: 2px;
  background: var(--pulse-line);
}
.timeline__item:last-child::before { display: none; }
.timeline__dot {
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--pulse-charcoal);
  z-index: 1;
}
.timeline__item--note .timeline__dot { background: var(--pulse-red); }
.timeline__body { flex: 1; min-width: 0; }
.timeline__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.timeline__time { font-size: 12px; color: var(--pulse-muted); }
.timeline__text { margin: 6px 0 0; white-space: pre-wrap; word-break: break-word; }
.timeline__error {
  margin: 8px 0 0;
  padding: 8px 10px;
  border: 1px solid #f6b8b8;
  border-radius: 6px;
  background: #fff5f5;
  color: var(--pulse-red-dark);
  font-size: 13px;
  white-space: pre-wrap;
  word-break: break-word;
}
.timeline__meta { font-size: 12px; margin: 4px 0 0; }

.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 12px; }

/* =========================================================
   Epic 4 — Public respondent survey (PULSE-401)
   ========================================================= */
body.respondent {
  background: var(--pulse-canvas);
  color: var(--pulse-ink);
  font-family: var(--pulse-font);
}
.respondent-header {
  height: 56px;
  display: flex;
  align-items: center;
  padding: 0 24px;
  background: var(--pulse-black);
}
.respondent-header__brand { color: #fff; font-weight: 700; letter-spacing: 0.3px; }
.respondent-main { padding: 32px 16px; }
.respondent-main__inner { max-width: 720px; margin: 0 auto; }
.respondent-footer { max-width: 720px; margin: 0 auto 40px; padding: 0 16px; }
.respondent-footer .muted { font-size: 12px; }

.respondent-card {
  background: var(--pulse-surface);
  border: 1px solid var(--pulse-line);
  border-radius: var(--pulse-radius);
  padding: 28px 28px 8px;
}
.respondent-card--message { padding: 40px 28px; text-align: center; }
.respondent-card__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.respondent-card__title { font-size: 1.5rem; font-weight: 700; margin: 0 0 8px; }
.respondent-card__lead { color: var(--pulse-muted); margin: 8px 0 0; }

.respondent-lang { display: flex; gap: 6px; }
.respondent-lang__opt {
  font-size: 12px; text-transform: uppercase; font-weight: 700;
  padding: 4px 10px; border-radius: 20px; border: 1px solid var(--pulse-line);
  color: var(--pulse-muted); text-decoration: none;
}
.respondent-lang__opt.is-active { background: var(--pulse-black); color: #fff; border-color: var(--pulse-black); }

.q { border: none; border-top: 1px solid var(--pulse-line); margin: 0; padding: 22px 0; }
.q:first-of-type { border-top: none; }
.q[hidden] { display: none !important; }
.q__legend { font-size: 1rem; font-weight: 600; padding: 0; margin: 0 0 12px; display: block; }
.q__num { color: var(--pulse-muted); margin-right: 4px; }
.q__req { color: var(--pulse-red); margin-left: 4px; }
.q__error { color: var(--pulse-red-dark); font-size: 13px; font-weight: 600; margin: 0 0 10px; }
.q__open { width: 100%; }
.q__opts { display: flex; flex-direction: column; gap: 8px; }
.q__opt { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
.q__opt input { min-width: 20px; min-height: 20px; }
.q__scale { display: flex; flex-wrap: wrap; gap: 8px; }
.q__scale-opt {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px;
  border: 1px solid var(--pulse-line); border-radius: 6px; padding: 8px 12px; cursor: pointer;
}
.q__rank-row { margin-bottom: 8px; }
.q__rank-sel { width: 70px; margin-right: 10px; }
.q__matrix-wrap { overflow-x: auto; }
.q__matrix { width: 100%; border-collapse: collapse; }
.q__matrix th, .q__matrix td { border: 1px solid var(--pulse-line); padding: 8px 10px; text-align: center; }
.q__matrix th[scope="row"] { text-align: left; font-weight: 600; }
.pipe { font-weight: 600; }

.respondent-actions { padding: 20px 0 24px; }
.btn--lg { padding: 12px 24px; font-size: 1rem; }

/* =========================================================
   Epic 4 — AI Analysis screen (PULSE-405)
   ========================================================= */
.analysis-report__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.analysis-report__h { font-size: 0.95rem; font-weight: 700; margin: 20px 0 8px; }
.analysis-report__summary { line-height: 1.6; margin: 0; }
.analysis-report__legend { font-size: 12px; margin: 6px 0 0; }
.analysis-report--executive {
  border-top: 4px solid var(--pulse-red);
}
.analysis-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--pulse-line);
}
.analysis-brand__mark {
  width: 34px;
  height: 34px;
  border-radius: 7px;
  background: var(--pulse-red);
  position: relative;
  flex: 0 0 34px;
}
.analysis-brand__mark::after {
  content: "";
  position: absolute;
  inset: 12px 8px;
  background: #fff;
  border-radius: 1px;
}
.analysis-brand strong,
.analysis-brand span {
  display: block;
}
.analysis-brand strong {
  font-size: 15px;
  color: var(--pulse-black);
}
.analysis-brand span {
  color: var(--pulse-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  font-weight: 700;
}
.insight-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 12px;
  margin: 18px 0;
}
.insight-kpi {
  border: 1px solid var(--pulse-line);
  border-radius: 6px;
  padding: 14px;
  background: #fafafa;
}
.insight-kpi span {
  display: block;
  color: var(--pulse-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.insight-kpi strong {
  display: block;
  color: var(--pulse-black);
  font-size: 28px;
  line-height: 1.1;
  margin-top: 4px;
}
.metric-banner {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 12px;
  margin: 18px 0;
}
.metric-card {
  border: 1px solid var(--pulse-line);
  border-left: 4px solid var(--pulse-muted);
  border-radius: 6px;
  padding: 16px;
  background: #fff;
}
.metric-card--positive { border-left-color: #1c7a43; }
.metric-card--neutral { border-left-color: #8a8a8a; }
.metric-card--negative { border-left-color: var(--pulse-red-dark); }
.metric-card span,
.takeaway-callout__label {
  display: block;
  color: var(--pulse-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.metric-card strong {
  display: block;
  margin: 6px 0 4px;
  color: var(--pulse-black);
  font-size: 30px;
  line-height: 1.05;
}
.metric-card small {
  color: var(--pulse-muted);
}
.takeaway-callout {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(280px, 1.2fr);
  gap: 18px;
  align-items: start;
  margin: 18px 0;
  padding: 18px;
  border: 1px solid #f1c4c4;
  border-radius: 6px;
  background: #fff8f8;
}
.takeaway-callout p {
  margin: 6px 0 0;
  color: var(--pulse-black);
  font-size: 17px;
  line-height: 1.55;
  font-weight: 600;
}
.takeaway-callout ol {
  margin: 0;
  padding-left: 20px;
  color: var(--pulse-ink);
  line-height: 1.55;
}
.report-meta-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 10px;
  margin: 18px 0;
}
.report-meta-strip span {
  border: 1px solid var(--pulse-line);
  border-radius: 6px;
  padding: 10px 12px;
  background: #fafafa;
  color: var(--pulse-ink);
  font-size: 13px;
}
.report-meta-strip strong {
  display: block;
  color: var(--pulse-muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 3px;
}
.sentiment-bar { display: flex; height: 28px; border-radius: 6px; overflow: hidden; background: var(--pulse-line); }
.sentiment-bar__seg { display: flex; align-items: center; justify-content: center; color: #fff; font-size: 12px; font-weight: 700; min-width: 24px; }
.sentiment-bar__seg--positive { background: #1c7a43; }
.sentiment-bar__seg--neutral { background: #8a8a8a; }
.sentiment-bar__seg--negative { background: var(--pulse-red-dark); }
.theme-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.theme-list__item { background: var(--pulse-surface); border: 1px solid var(--pulse-line); border-radius: 20px; padding: 6px 12px; font-size: 13px; }
.theme-list__term { font-weight: 600; }
.question-insights {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 14px;
}
.question-insight {
  border: 1px solid var(--pulse-line);
  border-radius: 6px;
  padding: 16px;
  background: #fff;
}
.question-insight__head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
}
.question-insight__index {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 6px;
  background: var(--pulse-black);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  flex: 0 0 34px;
}
.question-insight h4 {
  margin: 0 0 3px;
  color: var(--pulse-black);
  font-size: 15px;
}
.question-insight p {
  margin: 0;
}
.chart-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.chart-list__row {
  display: grid;
  grid-template-columns: minmax(80px, 1fr) minmax(120px, 2fr) 34px 42px;
  gap: 9px;
  align-items: center;
  font-size: 13px;
}
.chart-list__track {
  height: 10px;
  border-radius: 10px;
  background: var(--pulse-line);
  overflow: hidden;
}
.chart-list__fill {
  height: 100%;
  border-radius: 10px;
  background: var(--pulse-red);
}
.chart-list__row strong,
.chart-list__row em {
  font-style: normal;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.comment-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.comment-stack blockquote {
  margin: 0;
  padding: 10px 12px;
  border-left: 3px solid var(--pulse-red);
  background: #fafafa;
  color: var(--pulse-ink);
  font-size: 13px;
}
.quant-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 14px;
}
.quant-panel {
  border: 1px solid var(--pulse-line);
  border-radius: 6px;
  padding: 16px;
  background: #fff;
}
.quant-panel h4,
.action-card h4 {
  margin: 0 0 12px;
  color: var(--pulse-black);
  font-size: 15px;
}
.segment-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.segment-row__head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
  font-size: 13px;
}
.segment-row small {
  display: block;
  color: var(--pulse-muted);
  margin-top: 5px;
}
.segment-bar {
  display: flex;
  height: 12px;
  overflow: hidden;
  border-radius: 12px;
  background: var(--pulse-line);
}
.segment-bar span {
  display: block;
  min-width: 2px;
}
.segment-bar__promoters { background: #1c7a43; }
.segment-bar__passives { background: #9b9b9b; }
.segment-bar__detractors { background: var(--pulse-red); }
.feature-matrix {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.feature-point {
  min-height: 112px;
  border: 1px solid var(--pulse-line);
  border-top: 4px solid #9b9b9b;
  border-radius: 6px;
  padding: 12px;
  background: #fafafa;
}
.feature-point--priority-fix { border-top-color: var(--pulse-red); }
.feature-point--critical-issue { border-top-color: var(--pulse-red); }
.feature-point--core-strength { border-top-color: #1c7a43; }
.feature-point--secondary-area { border-top-color: #9b9b9b; }
.feature-point--secondary-concern { border-top-color: #9b9b9b; }
.feature-point--high-performer { border-top-color: #2a4ba0; }
.feature-point--satisfactory { border-top-color: #2a4ba0; }
.feature-point strong,
.feature-point span,
.feature-point small {
  display: block;
}
.feature-point strong {
  color: var(--pulse-black);
  font-size: 13px;
  line-height: 1.35;
}
.feature-point span {
  margin: 7px 0 4px;
  color: var(--pulse-red-dark);
  font-size: 12px;
  font-weight: 700;
}
.feature-point small {
  color: var(--pulse-muted);
  line-height: 1.4;
}
.theme-table-wrap {
  overflow-x: auto;
}
.theme-table td:last-child {
  max-width: 360px;
  line-height: 1.45;
}
.sentiment-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.sentiment-pill--positive { background: #e2f5e9; color: #1c7a43; }
.sentiment-pill--neutral { background: #f1f1f1; color: #555; }
.sentiment-pill--negative { background: #fde3e3; color: var(--pulse-red-dark); }
.sentiment-pill--mixed { background: #fff4d6; color: #846108; }
.action-matrix {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 12px;
}
.action-card {
  border: 1px solid var(--pulse-line);
  border-radius: 6px;
  padding: 16px;
  background: #fff;
}
.action-card span {
  display: block;
  color: var(--pulse-red-dark);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 8px;
}
.action-card p {
  margin: 0 0 10px;
  color: var(--pulse-ink);
  line-height: 1.55;
}
.action-card small {
  color: var(--pulse-muted);
  line-height: 1.45;
}

@media print {
  .analysis-report,
  .metric-card,
  .takeaway-callout,
  .quant-panel,
  .question-insight,
  .action-card,
  .theme-table tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .app-header,
  .app-sidenav,
  .app-footer,
  .page-head__actions,
  .survey-tabs {
    display: none !important;
  }
  .app-shell,
  .app-main,
  .app-main__inner {
    display: block;
    padding: 0;
    max-width: none;
  }
  .card {
    box-shadow: none;
  }
}

/* Campaign sharing (PULSE-505) */
.share-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.share-form .field { flex: 1; min-width: 240px; margin: 0; }

/* PULSE-501/502 — Role pills, alert banners, user-management form elements */
.pill--role { border: 1px solid transparent; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.pill--admin    { background: #e8eeff; color: #2a4ba0; border-color: #c5d2fc; }
.pill--staff    { background: #e2f5e9; color: #1c7a43; border-color: #b0e5c3; }
.pill--analyst  { background: #f4f4f4; color: #555;   border-color: #ddd; }

.alert { padding: 12px 16px; border-radius: 6px; margin-bottom: 20px; font-size: 14px; }
.alert--ok    { background: #e2f5e9; border: 1px solid #b0e5c3; color: #1c7a43; }
.alert--error { background: #fde3e3; border: 1px solid #f7b4b4; color: var(--pulse-red-dark); }

.select--sm { font-size: 13px; padding: 4px 8px; }

/* =========================================================
   PULSE-601 — Intro page + multi-page surveys
   ========================================================= */

/* Intro page */
.survey-intro { padding: 8px 0 24px; }
.survey-intro__title { font-size: 1.3rem; margin: 0 0 14px; }
.survey-intro__body { font-size: 0.95rem; line-height: 1.7; color: var(--pulse-muted); margin: 0 0 24px; white-space: pre-wrap; }

/* Page navigation row (Back / Next / Submit) */
.survey-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 0 24px; }
.survey-nav > :only-child { margin-left: auto; }
.survey-nav__submit { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

/* Progress indicator */
.survey-progress { margin-bottom: 20px; }
.survey-progress__label { font-size: 13px; color: var(--pulse-muted); display: block; margin-bottom: 6px; }
.survey-progress__bar { height: 4px; background: var(--pulse-line); border-radius: 2px; overflow: hidden; }
.survey-progress__fill { height: 100%; background: var(--pulse-red); border-radius: 2px; transition: width 0.2s ease; }

@media (max-width: 480px) {
  .respondent-main { padding: 20px 10px; }
  .respondent-card { padding: 18px 16px; }
  .q__scale { flex-direction: column; }
  .q__scale-opt { width: 100%; }
  .q__matrix, .q__matrix thead, .q__matrix tbody, .q__matrix tr, .q__matrix th, .q__matrix td { display: block; }
  .q__matrix thead { display: none; }
  .q__matrix tr { border: 1px solid var(--pulse-line); margin-bottom: 12px; padding: 8px; }
  .q__matrix td { border: 0; text-align: left; min-height: 44px; }
  .survey-nav { align-items: stretch; }
  .survey-nav .btn { min-height: 44px; }
}

/* Client-side required validation highlight */
.q--invalid { outline: 2px solid var(--pulse-red); border-radius: 4px; padding: 0 8px; }

/* Builder intro card */
.qb-intro { margin-bottom: 12px; }
.qb-intro__header { margin-bottom: 16px; }
.qb-intro__heading { font-size: 1rem; margin: 0 0 6px; display: flex; align-items: center; gap: 8px; }
