/* EngageCycle pages. Mobile first, light and dark, WCAG AA, visible focus, no CDN assets.
   The tenant's primary color arrives as --brand from /brand.css; everything else derives from it.
   The proposal is laid out as a document: sticky top bar, table of contents, paper-like pages. */
:root {
  --brand: #1f3a5f;
  --brand-ink: #ffffff;
  --highlight: #d97706;
  --highlight-ink: #1a1200;

  --bg: #f3f4f6;
  --paper: #ffffff;
  --surface: #f7f8fa;
  --text: #1a1a1a;
  --body: #3d4552;
  --muted: #6b7280;
  --border: #dde1e7;
  --border-strong: #b9c2cf;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --success: #15803d;
  --success-soft: #e7f6ec;
  --focus: #f59e0b;

  --brand-text: var(--brand);
  --brand-soft: color-mix(in srgb, var(--brand) 7%, var(--paper));
  --brand-border: color-mix(in srgb, var(--brand) 45%, var(--paper));
  --brand-dark: color-mix(in srgb, var(--brand) 85%, black);

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 10px 30px rgba(16, 24, 40, 0.08);
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif:
    Georgia, "Iowan Old Style", "Palatino Linotype", "Book Antiqua", "Times New Roman", serif;
  --topbar-h: 60px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1117;
    --paper: #171a22;
    --surface: #1f232d;
    --text: #eef0f4;
    --body: #c3c9d4;
    --muted: #97a0af;
    --border: #2f3542;
    --border-strong: #454c5b;
    --danger: #ff9a90;
    --danger-soft: #3a1c1a;
    --success: #7ad69f;
    --success-soft: #15301f;
    --brand-text: color-mix(in srgb, var(--brand) 45%, white);
    --brand-soft: color-mix(in srgb, var(--brand) 28%, var(--paper));
    --brand-border: color-mix(in srgb, var(--brand) 55%, var(--paper));
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  }
}
:root[data-theme="dark"] {
  --bg: #0f1117;
  --paper: #171a22;
  --surface: #1f232d;
  --text: #eef0f4;
  --body: #c3c9d4;
  --muted: #97a0af;
  --border: #2f3542;
  --border-strong: #454c5b;
  --danger: #ff9a90;
  --danger-soft: #3a1c1a;
  --success: #7ad69f;
  --success-soft: #15301f;
  --brand-text: color-mix(in srgb, var(--brand) 45%, white);
  --brand-soft: color-mix(in srgb, var(--brand) 28%, var(--paper));
  --brand-border: color-mix(in srgb, var(--brand) 55%, var(--paper));
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}
:root[data-theme="light"] {
  color-scheme: light;
}
:root[data-theme="dark"] {
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 var(--sans);
}
a {
  color: var(--brand-text);
}
h1 {
  font-size: 1.75rem;
  line-height: 1.2;
  margin: 0 0 0.75rem;
  letter-spacing: -0.01em;
}
h2 {
  font-size: 1.35rem;
  line-height: 1.3;
  margin: 0 0 0.75rem;
}
h3 {
  font-size: 1.05rem;
  margin: 1rem 0 0.5rem;
}
p {
  margin: 0 0 0.85rem;
  color: var(--body);
}
ul,
ol {
  margin: 0.25rem 0 0.75rem 1.25rem;
  padding: 0;
  color: var(--body);
}
li {
  margin: 0.2rem 0;
}
.muted {
  color: var(--muted);
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* Narrow pages (state pages, admin) */
.brand-stripe {
  height: 6px;
  background: var(--brand);
}
.page {
  max-width: 44rem;
  margin: 0 auto;
  padding: 1rem 0.75rem 3rem;
}

/* The hidden attribute always wins over layout rules like display: flex. */
[hidden] {
  display: none !important;
}

/* Document shell */
.doc-shell {
  margin: 0;
  padding: 0;
}
.doc {
  display: block;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: var(--topbar-h);
  padding: 0.5rem 1rem;
  background: var(--paper);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(16, 24, 40, 0.04);
}
.topbar::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 4px;
  background: var(--brand);
}
.topbar-title {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1 1 auto;
  line-height: 1.25;
}
.topbar-title strong {
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-sub {
  font-size: 0.85rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-total {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.15;
}
.topbar-total-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.topbar-total-amount {
  font-weight: 800;
  font-size: 1.1rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.topbar-cta {
  flex: 0 0 auto;
}

.doc-body {
  display: block;
  padding: 0.75rem 0.75rem 4rem;
}
.toc {
  position: sticky;
  top: var(--topbar-h);
  z-index: 5;
  margin: 0 -0.75rem 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg);
}
.toc-title {
  display: none;
  margin: 0 0 0.6rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.toc-list::-webkit-scrollbar {
  display: none;
}
.toc-list li {
  margin: 0;
  flex: 0 0 auto;
}
.toc-list a {
  display: block;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--body);
  text-decoration: none;
  background: var(--paper);
  border: 1px solid var(--border);
}
.toc-list a.is-active {
  background: var(--brand);
  color: var(--brand-ink);
  border-color: var(--brand);
}
.doc-main {
  min-width: 0;
}

/* Pages */
.page-wrap {
  margin: 0 0 1.5rem;
}
.page-label {
  margin: 0 0 0.4rem 0.1rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}
.sheet {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 4px;
  box-shadow: var(--shadow);
  overflow: hidden;
  font-family: var(--serif);
}
.sheet h1,
.sheet h2,
.sheet h3 {
  font-family: var(--serif);
  color: var(--text);
}
.sheet h1 {
  font-size: 1.7rem;
}
.sheet h2 {
  font-size: 1.4rem;
  margin-bottom: 0.9rem;
}
.sheet p,
.sheet li {
  font-size: 1rem;
  line-height: 1.6;
}
.page-inner {
  padding: 1.5rem 1.25rem 1.75rem;
}
.letter-sign {
  margin-top: 1.5rem;
  font-weight: 600;
  color: var(--text);
}

/* Cover band */
.cover-band {
  position: relative;
  background: var(--brand);
  color: var(--brand-ink);
  padding: 1.25rem 1.25rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.cover-logo-plate {
  flex: 0 0 auto;
  background: #fff;
  border-radius: 999px;
  padding: 0.75rem;
  width: 6.5rem;
  height: 6.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}
.cover-logo {
  max-width: 100%;
  max-height: 100%;
  display: block;
}
.cover-wordmark {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--brand);
  text-align: center;
  line-height: 1.1;
}
.cover-tagline {
  margin: 0;
  flex: 1 1 12rem;
  font-family: var(--serif);
  font-size: 1.35rem;
  line-height: 1.25;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--brand-ink);
}

/* Summary cards (cover) */
.summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
  margin: 0.75rem 0 1.5rem;
  font-family: var(--sans);
}
.summary-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
  min-width: 0;
}
.summary-item dt {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 0.15rem;
}
.summary-item dd {
  margin: 0;
  font-weight: 600;
  color: var(--text);
  overflow-wrap: anywhere;
}
.summary-item.is-accent {
  border-color: var(--brand-border);
  background: var(--brand-soft);
}

/* Details table (fee comparison) */
.details {
  border-collapse: collapse;
  margin: 0.75rem 0 1.25rem;
  width: 100%;
  max-width: 30rem;
  font-size: 0.98rem;
}
.details th,
.details td {
  border: 1px solid var(--border);
  padding: 0.55rem 0.8rem;
  text-align: left;
  vertical-align: top;
}
.details th {
  font-weight: 600;
  color: var(--text);
  width: 42%;
  background: var(--surface);
}
.details td {
  color: var(--body);
}

/* Option groups (the pick) */
.option-group {
  border: 0;
  padding: 0;
  margin: 0.25rem 0 1rem;
  min-width: 0;
}
.option-legend {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0;
  margin-bottom: 0.6rem;
}
.option-legend .required-note {
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
}
.option-list {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.option-card {
  position: relative;
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
  font-family: var(--sans);
  border: 2px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--paper);
  padding: 1rem 1rem 1rem 0.9rem;
  cursor: pointer;
  transition:
    border-color 120ms,
    background 120ms;
}
.option-card.is-recommended {
  border-color: var(--brand-border);
}
.option-card:hover {
  border-color: var(--brand-border);
}
.option-card:has(.option-input:checked) {
  border-color: var(--brand);
  background: var(--brand-soft);
}
.option-card:has(.option-input:focus-visible) {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.option-input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.option-check {
  flex: 0 0 auto;
  width: 1.4rem;
  height: 1.4rem;
  margin-top: 0.1rem;
  border-radius: 999px;
  border: 2px solid var(--border-strong);
  background: var(--paper);
  position: relative;
}
.option-card[data-mode="multi"] .option-check {
  border-radius: 6px;
}
.option-card:has(.option-input:checked) .option-check {
  border-color: var(--brand);
  background: var(--brand);
}
.option-card:has(.option-input:checked) .option-check::after {
  content: "";
  position: absolute;
  left: 0.42rem;
  top: 0.16rem;
  width: 0.32rem;
  height: 0.65rem;
  border: solid var(--brand-ink);
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
}
.option-body {
  flex: 1 1 auto;
  min-width: 0;
}
.badge {
  display: inline-block;
  margin-bottom: 0.35rem;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--highlight-ink);
  background: var(--highlight);
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
}
.option-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.75rem;
}
.option-title {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
}
.option-price {
  margin-left: auto;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.option-desc {
  display: block;
  color: var(--body);
  margin-top: 0.2rem;
}
.includes {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  font-size: 0.93rem;
  color: var(--body);
}
.includes li {
  position: relative;
  padding-left: 1.4rem;
  margin: 0.2rem 0;
}
.includes li::before {
  content: "";
  position: absolute;
  left: 0.15rem;
  top: 0.42rem;
  width: 0.3rem;
  height: 0.6rem;
  border: solid var(--success);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.action-link {
  display: inline-block;
  margin-top: 0.6rem;
  font-weight: 600;
}

/* Add-ons outside a table (legacy partial) */
.addons {
  margin-top: 0.5rem;
}
.addons-title {
  margin-top: 0;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.addon[data-disabled="1"] {
  opacity: 0.55;
}
.addon-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
  cursor: pointer;
  margin: 0;
}
.addon-input[type="checkbox"] {
  width: 1.25rem;
  height: 1.25rem;
  accent-color: var(--brand);
  margin: 0;
}
.addon-title {
  font-weight: 600;
  flex: 1 1 10rem;
  color: var(--text);
}
.addon-price {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.addon-qty {
  width: 4.6rem;
  font: inherit;
  font-family: var(--sans);
  padding: 0.35rem 0.4rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--text);
}
.addon-desc,
.addon-note {
  margin: 0.35rem 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

/* Fee schedule table */
.fee-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.5rem 0 1rem;
  font-family: var(--sans);
  font-size: 0.95rem;
}
.fee-table th,
.fee-table td {
  border: 1px solid var(--border);
  padding: 0.7rem 0.75rem;
  vertical-align: top;
  text-align: left;
}
.fee-head th {
  background: var(--brand);
  color: var(--brand-ink);
  font-weight: 700;
  border-color: var(--brand);
}
.fee-price-col,
.fee-price {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.fee-price {
  color: var(--text);
  font-weight: 600;
}
.fee-each {
  font-weight: 400;
  color: var(--muted);
  font-size: 0.85rem;
}
.fee-mark {
  width: 3.2rem;
  text-align: center;
  vertical-align: middle;
}
.fee-mark input[type="checkbox"] {
  width: 1.25rem;
  height: 1.25rem;
  accent-color: var(--brand);
  margin: 0;
}
.fee-check {
  display: inline-block;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 999px;
  background: var(--brand);
  position: relative;
}
.fee-check::after {
  content: "";
  position: absolute;
  left: 0.36rem;
  top: 0.14rem;
  width: 0.25rem;
  height: 0.55rem;
  border: solid var(--brand-ink);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.fee-check.is-fixed {
  background: var(--success);
}
.fee-title {
  display: block;
  font-weight: 700;
  color: var(--brand-text);
}
.fee-desc {
  display: block;
  color: var(--body);
  font-size: 0.9rem;
  margin-top: 0.15rem;
}
.fee-includes {
  margin: 0.4rem 0 0 1.1rem;
  font-size: 0.9rem;
  color: var(--body);
}
.fee-row.addon[data-disabled="1"] td {
  opacity: 0.55;
}
.fee-subtotal td {
  background: var(--surface);
  font-weight: 600;
  text-align: right;
}
.fee-total td {
  background: var(--brand);
  color: var(--brand-ink);
  font-weight: 800;
  text-align: right;
  border-color: var(--brand);
}
.fee-total .fee-price {
  color: var(--brand-ink);
  font-size: 1.05rem;
}
.fee-empty td {
  font-style: italic;
}

/* Total card (legacy partial) */
.total-card {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 1rem 1.1rem;
  margin: 0.5rem 0 1rem;
  border-radius: var(--radius);
  background: var(--brand);
  color: var(--brand-ink);
  font-family: var(--sans);
}
.total-label {
  font-weight: 600;
  opacity: 0.9;
}
.total-amount {
  font-size: 1.6rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

/* Initials */
.initials {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.25rem;
  flex-wrap: wrap;
  font-family: var(--sans);
}
.initials-tab {
  display: inline-flex;
  align-items: stretch;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 2px solid var(--highlight);
}
.initials-tab-label {
  background: var(--highlight);
  color: var(--highlight-ink);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0 0.6rem;
  display: flex;
  align-items: center;
}
.initials-tab .initials-input {
  width: 6rem;
  border: 0;
  border-radius: 0;
  font: inherit;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 0.55rem 0.7rem;
  background: var(--paper);
  color: var(--text);
  min-height: 44px;
}
.initials-label {
  font-size: 0.95rem;
  color: var(--body);
}

/* Consent and signature */
.consent {
  margin: 0.5rem 0 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-family: var(--sans);
}
.consent-row {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  font-size: 0.92rem;
  color: var(--body);
  margin: 0;
}
.consent-row input {
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.15rem;
  flex: 0 0 auto;
  accent-color: var(--brand);
}
.signature-block {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  font-family: var(--sans);
}
.signature-block label {
  font-weight: 600;
  color: var(--text);
}
.signature-line {
  position: relative;
}
.signature-line .signature-input {
  width: 100%;
  font-family: "Segoe Script", "Brush Script MT", "Snell Roundhand", "Apple Chancery", cursive;
  font-size: 1.7rem;
  padding: 0.5rem 0.75rem 0.4rem 2.2rem;
  min-height: 64px;
  border: 0;
  border-bottom: 2px solid var(--text);
  border-radius: 0;
  background: transparent;
  color: var(--text);
}
.signature-x {
  position: absolute;
  left: 0.5rem;
  bottom: 0.7rem;
  font-size: 1.1rem;
  color: var(--muted);
}
.signature-meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--muted);
}
.signature-help {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0;
}

/* Closing block */
.closing {
  margin: 1.5rem 0 0.5rem;
  padding: 1.25rem 1.5rem;
  background: var(--brand);
  color: var(--brand-ink);
  border-radius: 4px;
}
.closing p {
  color: var(--brand-ink);
  font-size: 1.05rem;
  margin-bottom: 0.6rem;
}
.closing p:last-child {
  margin-bottom: 0;
}

/* Buttons and inputs */
.btn {
  display: inline-block;
  font: inherit;
  font-family: var(--sans);
  font-weight: 700;
  min-height: 48px;
  padding: 0.75rem 1.25rem;
  border-radius: 10px;
  border: 2px solid transparent;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition:
    filter 120ms,
    background 120ms;
}
.btn-primary {
  background: var(--brand);
  color: var(--brand-ink);
}
.btn-primary:hover {
  background: var(--brand-dark);
}
.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-block {
  width: 100%;
}
.btn-small {
  min-height: 40px;
  padding: 0.4rem 0.9rem;
}
.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}
input[type="email"],
input[type="url"],
input[type="tel"],
input[type="search"],
input[type="date"],
input[type="text"],
input[type="password"],
input[type="number"],
select,
textarea {
  font: inherit;
  color: var(--text);
  background: var(--paper);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
  min-height: 44px;
}

/* Decline */
.decline {
  margin: 1.25rem 0 0.5rem;
  padding: 0.75rem 1rem;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  font-family: var(--sans);
}
.decline summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--body);
}
.decline label {
  display: block;
  margin-top: 0.75rem;
  font-size: 0.95rem;
  color: var(--text);
}
.decline select,
.decline textarea {
  width: 100%;
  margin-top: 0.25rem;
}
.decline .btn {
  margin-top: 0.75rem;
}

/* Footer */
.doc-footer {
  margin: 0.5rem 0 0;
  padding: 0.5rem 0.25rem;
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1rem;
}
.doc-footer p {
  margin: 0;
  color: var(--muted);
}

/* Alerts and state pages */
/* Status notices after an action: toasts that slide up from the bottom (see Flash). */
.toast-region {
  position: fixed;
  left: 50%;
  bottom: 1.25rem;
  transform: translateX(-50%);
  z-index: 60;
  width: min(34rem, calc(100vw - 2rem));
  display: grid;
  gap: 0.5rem;
  pointer-events: none;
}
/* Stay above a page's pinned save bar. */
body:has(.form-save-bar) .toast-region {
  bottom: 5.25rem;
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin: 0;
  box-shadow: 0 10px 30px rgb(0 0 0 / 0.18);
  animation: toast-in 0.25s ease-out;
}
.toast.is-leaving {
  animation: toast-out 0.25s ease-in forwards;
}
.toast-body {
  flex: 1;
  min-width: 0;
}
.toast-body ul {
  margin: 0.4rem 0 0;
  padding-left: 1.1rem;
}
.toast-close {
  flex: none;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 1.25rem;
  line-height: 1;
  padding: 0 0.15rem;
  cursor: pointer;
  opacity: 0.7;
}
.toast-close:hover,
.toast-close:focus-visible {
  opacity: 1;
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(1rem);
  }
}
@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(1rem);
  }
}
@media (prefers-reduced-motion: reduce) {
  .toast,
  .toast.is-leaving {
    animation: none;
  }
}
.alert {
  padding: 0.9rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  border: 1px solid;
  background: var(--paper);
  font-family: var(--sans);
}
.alert-error {
  background: var(--danger-soft);
  border-color: var(--danger);
  color: var(--text);
}
.alert-error ul {
  margin-bottom: 0;
}
.alert-success {
  background: var(--success-soft);
  border-color: var(--success);
}
.alert-info {
  background: var(--brand-soft);
  border-color: var(--brand-border);
}
.state {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 1.25rem;
  text-align: center;
  box-shadow: var(--shadow);
}
.state h1 {
  font-size: 1.5rem;
}
.state .btn {
  margin-top: 1rem;
}
.brand-bar .logo {
  display: block;
  max-height: 48px;
  max-width: min(14rem, 60vw);
  width: auto;
  height: auto;
  object-fit: contain;
}
.business-contact {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.35rem 1rem;
  max-width: 24rem;
  margin: 1.75rem auto 0;
  text-align: left;
}
.business-contact dt {
  color: var(--muted);
}
.business-contact dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.brand-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0 1rem;
}
.brand-bar .spacer {
  flex: 1;
}
.brand-bar .brand-name {
  font-weight: 700;
  color: var(--text);
}
.summary-list {
  list-style: none;
  margin: 1rem 0;
  padding: 0;
  text-align: left;
}
.summary-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  color: var(--body);
}
.summary-list li.total-line {
  font-weight: 800;
  color: var(--text);
  border-bottom: 0;
}
/* The public signing demo (ARCHITECTURE 23.4). */
.demo-banner {
  background: var(--text);
  color: var(--paper);
  padding: 0.5rem 1rem;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.01em;
}
.preview-banner {
  background: var(--highlight);
  color: var(--highlight-ink);
  padding: 0.5rem 1rem;
  font-weight: 700;
  text-align: center;
}

/* Admin */
.admin {
  max-width: 68rem;
}
.admin nav {
  display: flex;
  gap: 1rem;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}
.admin nav .spacer {
  flex: 1;
}
.admin form.inline {
  display: inline;
}
.admin table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.admin th,
.admin td {
  text-align: left;
  padding: 0.55rem 0.6rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.admin th {
  color: var(--muted);
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
/* A column heading that sorts the table (ops Businesses: Setup). */
.th-sort {
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}
.th-sort:hover,
.th-sort:focus-visible {
  color: var(--text);
  text-decoration: underline;
}
.admin .field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.75rem;
}
.admin .field input,
.admin .field select {
  max-width: 28rem;
}
.admin .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
}
.admin .btn {
  min-height: 40px;
  padding: 0.45rem 0.9rem;
}
.admin .pill,
.cv-top .pill {
  display: inline-block;
  white-space: nowrap;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  background: var(--surface);
  border: 1px solid var(--border);
}
.admin .pill-signed,
.cv-top .pill-signed {
  background: var(--success-soft);
  border-color: var(--success);
}
.admin .pill-declined,
.admin .pill-revoked,
.admin .pill-expired {
  background: var(--danger-soft);
  border-color: var(--danger);
}
.admin .pill-sent,
.admin .pill-viewed,
.admin .pill-default,
.cv-top .pill-sent {
  background: var(--brand-soft);
  border-color: var(--brand-border);
}
.field-key {
  font-size: 0.85em;
}
.pack-fields tr.is-hidden td {
  color: var(--muted);
}
.column-guide {
  display: grid;
  grid-template-columns: minmax(8rem, max-content) 1fr;
  gap: 0.3rem 1rem;
  margin: 0.25rem 0 1rem;
}
.column-guide dd {
  margin: 0;
}
.import-map select {
  width: 100%;
  min-width: 12rem;
}
.table-scroll {
  overflow-x: auto;
}
.admin tr.has-problem td {
  background: var(--danger-soft);
}
.logo-preview img {
  display: block;
  max-height: 64px;
  max-width: 240px;
  object-fit: contain;
  background: #fff;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.wording-kind {
  margin-top: 0.75rem;
}
.dns-value {
  word-break: break-all;
}
.dev-mail {
  white-space: pre-wrap;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
}
.starter-packs {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}
.starter-packs li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.admin .row-actions {
  white-space: nowrap;
}
.admin .row-actions form.inline + form.inline {
  margin-left: 0.4rem;
}
.admin .counts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0.5rem 0 1rem;
}
.admin .count {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.9rem;
  min-width: 6rem;
}
.admin .count b {
  display: block;
  font-size: 1.3rem;
}
.admin code {
  background: var(--surface);
  padding: 0.1rem 0.35rem;
  border-radius: 6px;
  word-break: break-all;
}
.admin .mt-2 {
  margin-top: 2rem;
}
.link-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  word-break: break-all;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

@media (min-width: 640px) {
  .page {
    padding: 1.5rem 1.5rem 3rem;
  }
  .page-inner {
    padding: 2.25rem 2.5rem 2.5rem;
  }
  .sheet h1 {
    font-size: 2rem;
  }
  .cover-band {
    padding: 1.75rem 2.5rem;
    gap: 1.5rem;
  }
  .cover-logo-plate {
    width: 8rem;
    height: 8rem;
  }
  .cover-tagline {
    font-size: 1.7rem;
  }
  .topbar {
    padding: 0.5rem 1.5rem;
  }
  .topbar-title strong {
    font-size: 1.05rem;
  }
  .topbar-total-amount {
    font-size: 1.25rem;
  }
}
@media (min-width: 1024px) {
  .doc-body {
    display: grid;
    grid-template-columns: 15rem minmax(0, 52rem);
    gap: 2rem;
    justify-content: center;
    padding: 2rem 2rem 5rem;
  }
  .toc {
    position: sticky;
    top: calc(var(--topbar-h) + 1.5rem);
    align-self: start;
    margin: 0;
    padding: 0;
    background: transparent;
    z-index: 1;
  }
  .toc-title {
    display: block;
  }
  .toc-list {
    flex-direction: column;
    gap: 0.25rem;
    overflow: visible;
  }
  .toc-list a {
    border-radius: var(--radius-sm);
    background: transparent;
    border-color: transparent;
    padding: 0.5rem 0.75rem;
  }
  .toc-list a:hover {
    background: var(--paper);
  }
  .toc-list a.is-active {
    background: var(--text);
    color: var(--bg);
    border-color: var(--text);
  }
  .page-wrap {
    margin-bottom: 2.25rem;
  }
  .page-inner {
    padding: 2.75rem 3.25rem 3rem;
  }
}
@media print {
  body {
    background: #fff;
  }
  .topbar,
  .toc,
  .decline,
  .preview-banner,
  .brand-stripe {
    display: none;
  }
  .doc-body {
    display: block;
    padding: 0;
  }
  .sheet {
    box-shadow: none;
    border: 0;
    page-break-after: always;
  }
  .page-label {
    display: none;
  }
}

/* Summary cards widen on larger screens */
@media (min-width: 640px) {
  .summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Theme toggle */
.theme-toggle {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--paper);
  color: var(--text);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.theme-toggle::before {
  content: "\263E";
}
.theme-toggle[data-current="dark"]::before {
  content: "\2600";
}
.theme-toggle:hover {
  border-color: var(--brand-border);
}

/* Signed state (print view and confirmation) */
.signature-label {
  font-weight: 600;
  color: var(--text);
  font-family: var(--sans);
}
.signature-typed {
  display: block;
}

/* Admin auth */
.auth-card {
  max-width: 30rem;
  margin: 2rem auto;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.auth-card form + form {
  margin-top: 1rem;
}
.qr-box {
  display: inline-block;
  background: #fff;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin: 0.5rem 0;
}
.backup-codes {
  columns: 2;
  list-style: none;
  margin: 0.5rem 0 1rem;
  padding: 0;
}
.backup-codes li {
  margin: 0.2rem 0;
}

/* Admin shell */
.admin {
  max-width: none;
  padding: 0;
}
/*
 * Admin page width, one rule: every page uses the standard column; pages built around a data
 * table with many columns (Clients, Proposals, a campaign, Check the rows) pass `wide`. Both
 * keep the same side gutters as the nav, narrower on a phone.
 */
.admin {
  --gutter: 1.25rem;
}
@media (max-width: 600px) {
  .admin {
    --gutter: 1rem;
  }
}
/* .admin-nav is also a <nav> inside .admin, so it restates what the older .admin nav rule set. */
.admin .admin-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem 1rem;
  padding: 0.5rem var(--gutter);
  margin-bottom: 0;
  background: var(--paper);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
@media (max-width: 600px) {
  /* Phones: account controls on the first row, the sections on one row that swipes. */
  .admin .admin-nav {
    gap: 0.4rem 0.6rem;
  }
  .admin .admin-nav .nav-links {
    order: 10;
    flex: 1 0 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    margin: 0 calc(-1 * var(--gutter));
    padding: 0 var(--gutter);
    scrollbar-width: none;
  }
  .admin .admin-nav .nav-links a {
    white-space: nowrap;
  }
  .admin .admin-nav .user-chip {
    max-width: 8rem;
  }
  /* One business: its name is in the page title; the switcher still shows for several. */
  .admin .admin-nav > .muted {
    display: none;
  }
}
.admin-nav .brand {
  font-weight: 800;
  color: var(--text);
  text-decoration: none;
}
.nav-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 0.15rem;
  flex-wrap: wrap;
}
.nav-links a {
  display: block;
  padding: 0.45rem 0.7rem;
  border-radius: var(--radius-sm);
  color: var(--body);
  text-decoration: none;
  font-weight: 600;
}
.nav-links a:hover {
  background: var(--surface);
}
.nav-links a.is-active {
  background: var(--brand);
  color: var(--brand-ink);
}
.tenant-switch {
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
}
.tenant-switch select {
  min-height: 36px;
  padding: 0.3rem 0.5rem;
}
.user-chip {
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-body {
  max-width: 68rem;
  margin: 0 auto;
  padding: 1.25rem var(--gutter) 4rem;
}
.admin-body.admin-wide {
  max-width: 90rem;
}
.admin .count.is-bad {
  border-color: var(--danger);
  background: var(--danger-soft);
}
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin: 0.75rem 0 1rem;
}
/* A long campaign name or search box must not push the page wider than a phone. */
.filters > * {
  max-width: 100%;
  min-width: 0;
}
.filters input[type="search"] {
  min-width: 16rem;
}
.filters .spacer {
  flex: 1;
}
.two-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}
@media (min-width: 900px) {
  .two-col {
    grid-template-columns: 1fr 1fr;
  }
}
.timeline {
  margin: 0 0 1rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.35rem;
}
.timeline div {
  display: flex;
  gap: 0.75rem;
}
.timeline dt {
  width: 7rem;
  color: var(--muted);
  flex: 0 0 auto;
}
.timeline dd {
  margin: 0;
}
.offer-list {
  margin: 0 0 1rem 1.1rem;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin: 0.5rem 0 1rem;
}
.stack label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-weight: 600;
}
.stack input,
.stack select,
.stack textarea {
  font-weight: 400;
}
.stack.narrow {
  max-width: 28rem;
}
.inline-form {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
  margin: 0.5rem 0;
}
.audit-list {
  list-style: none;
  margin: 0.5rem 0;
  padding: 0;
}
.audit-list li {
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
}
.check-row {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  font-weight: 400;
}
.settings-form {
  max-width: 40rem;
}
.settings-form h2 {
  margin-top: 1.5rem;
}
.settings-form textarea {
  width: 100%;
}
.is-muted td {
  opacity: 0.55;
}
.getting-started {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  margin-bottom: 1.25rem;
}
.getting-started-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
}
.getting-started-head h2 {
  margin: 0;
}
.getting-started-head .spacer {
  flex: 1;
}
.checklist {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}
.checklist li {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}
.checklist p {
  margin: 0.15rem 0 0;
}
.checklist .check {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  border: 2px solid var(--border);
  font-size: 0.8rem;
  font-weight: 700;
}
.checklist .is-done .check {
  border-color: var(--success);
  background: var(--success-soft);
  color: var(--success);
}
.checklist .is-done strong {
  color: var(--muted);
}
.funnel {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  margin-bottom: 0.9rem;
}
.funnel-head {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 0.6rem;
}
.funnel-bars {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.3rem;
}
.funnel-bar {
  display: grid;
  grid-template-columns: 5rem 1fr 7rem;
  gap: 0.6rem;
  align-items: center;
  font-size: 0.9rem;
}
.funnel-label {
  color: var(--muted);
  text-transform: capitalize;
}
.funnel-track {
  display: block;
  height: 0.7rem;
  background: var(--surface);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.funnel-fill {
  display: block;
  height: 100%;
  background: var(--brand);
  width: 0;
}
.funnel-fill.fill-signed {
  background: var(--success);
}
.funnel-fill.fill-declined,
.funnel-fill.fill-expired {
  background: var(--danger);
}
.funnel-fill.fill-draft {
  background: var(--border-strong);
}
.funnel-fill[data-width="0%"] {
  width: 0;
}
.funnel-fill[data-width="5%"] {
  width: 5%;
}
.funnel-fill[data-width="10%"] {
  width: 10%;
}
.funnel-fill[data-width="15%"] {
  width: 15%;
}
.funnel-fill[data-width="20%"] {
  width: 20%;
}
.funnel-fill[data-width="25%"] {
  width: 25%;
}
.funnel-fill[data-width="30%"] {
  width: 30%;
}
.funnel-fill[data-width="35%"] {
  width: 35%;
}
.funnel-fill[data-width="40%"] {
  width: 40%;
}
.funnel-fill[data-width="45%"] {
  width: 45%;
}
.funnel-fill[data-width="50%"] {
  width: 50%;
}
.funnel-fill[data-width="55%"] {
  width: 55%;
}
.funnel-fill[data-width="60%"] {
  width: 60%;
}
.funnel-fill[data-width="65%"] {
  width: 65%;
}
.funnel-fill[data-width="70%"] {
  width: 70%;
}
.funnel-fill[data-width="75%"] {
  width: 75%;
}
.funnel-fill[data-width="80%"] {
  width: 80%;
}
.funnel-fill[data-width="85%"] {
  width: 85%;
}
.funnel-fill[data-width="90%"] {
  width: 90%;
}
.funnel-fill[data-width="95%"] {
  width: 95%;
}
.funnel-fill[data-width="100%"] {
  width: 100%;
}

/* Template editor */
.btn-link-danger {
  background: transparent;
  color: var(--danger);
  border-color: transparent;
}
.btn-link-danger:hover {
  background: var(--danger-soft);
}
.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9rem;
}
input.num {
  max-width: 9rem;
}
.editor-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  margin: 0.75rem 0 1rem;
}
.template-editor .editor-fields {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}
.template-editor label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-weight: 600;
}
.template-editor label.check-row {
  flex-direction: row;
  align-items: center;
  font-weight: 400;
}
.template-editor textarea,
.template-editor input[type="text"],
.template-editor input[type="url"] {
  width: 100%;
  font-weight: 400;
}
.template-editor .inline-form input[type="text"],
.template-editor .inline-form input[type="url"] {
  width: auto;
  flex: 1 1 12rem;
}
.template-editor select {
  font-weight: 400;
}
.editor-actions {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  gap: 0.6rem;
  padding: 0.6rem 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.editor-actions-end {
  position: static;
  border-bottom: 0;
  margin-top: 1.5rem;
}
.editor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 0.75rem 1rem;
  margin: 0.5rem 0;
}
.editor-group {
  border-left: 3px solid var(--brand);
  padding-left: 1rem;
  margin: 1rem 0 1.5rem;
}
.editor-card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem 1rem;
  margin: 0.9rem 0;
  scroll-margin-top: 4.5rem;
}
.editor-card legend {
  font-weight: 700;
  padding: 0 0.35rem;
}
.editor-card h4 {
  margin: 1rem 0 0.35rem;
}
.card-actions {
  border-top: 1px solid var(--border);
  padding-top: 0.6rem;
  margin-top: 0.9rem;
}
.rule-editor {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.cond-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.cond-row > div {
  flex: 1 1 10rem;
}
.cond-row input[type="text"] {
  width: 100%;
}
.cond-group {
  border: 1px dashed var(--border-strong);
  border-radius: 10px;
  padding: 0.5rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  align-items: flex-start;
}
.check-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.25rem;
}
.copy-block {
  margin: 0.9rem 0;
}
.merge-fields ul {
  columns: 2 18rem;
  margin: 0.5rem 0 1rem 1.1rem;
}
#options,
#addons,
#who {
  scroll-margin-top: 4.5rem;
}
.editor-card,
.editor-group,
.template-editor .editor-fields {
  min-width: 0;
}
.template-editor select {
  max-width: 100%;
}
@media (max-width: 600px) {
  .editor-group {
    padding-left: 0.6rem;
  }
  .editor-card {
    padding: 0.6rem 0.7rem 0.8rem;
  }
}

/* Canvas template editor */
.cv-app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: var(--bg);
  font-family: var(--sans);
}
.cv-top {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
  padding: 0.55rem 1rem;
  background: var(--paper);
  border-bottom: 1px solid var(--border);
  border-top: 4px solid var(--brand);
}
.cv-back {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
}
.cv-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}
.cv-title strong {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 22rem;
}
.cv-status {
  color: var(--muted);
  font-size: 0.88rem;
  flex: 1 1 auto;
}
.cv-status.is-saving {
  color: var(--text);
}
.cv-status.is-error,
.cv-status.is-offline {
  color: var(--danger);
  font-weight: 600;
}
.cv-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}
.cv-client {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.88rem;
  color: var(--muted);
}
.cv-client select {
  max-width: 13rem;
}
.cv-alert {
  margin: 0.5rem 1rem 0;
}
.cv-alert ul {
  margin: 0.35rem 0 0.5rem 1.1rem;
}
.cv-alert .btn {
  margin-top: 0.4rem;
  margin-right: 0.4rem;
}
.cv-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 15.5rem minmax(0, 1fr) 18rem;
}
.cv-rail,
.cv-inspector {
  overflow-y: auto;
  padding: 1rem 0.9rem 2rem;
  background: var(--paper);
}
.cv-rail {
  border-right: 1px solid var(--border);
}
.cv-inspector {
  border-left: 1px solid var(--border);
}
.cv-rail-title,
.cv-insp-title {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0.25rem 0 0.6rem;
}
.cv-rail-hint,
.cv-insp-hint {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.45;
  margin: 0 0 0.75rem;
}
.cv-pages {
  list-style: none;
  margin: 0 0 0.6rem;
  padding: 0;
}
.cv-pages li {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  border-radius: 8px;
  padding: 0.1rem 0.25rem;
}
.cv-pages li.is-current {
  background: var(--brand-soft);
}
.cv-page-handle {
  cursor: grab;
  color: var(--muted);
  padding: 0 0.2rem;
  user-select: none;
}
.cv-page-name {
  flex: 1;
  text-align: left;
  background: none;
  border: 0;
  padding: 0.45rem 0.3rem;
  font: inherit;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cv-page-input {
  flex: 1;
  min-width: 0;
}
.cv-page-del {
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: 6px;
  opacity: 0;
}
.cv-pages li:hover .cv-page-del,
.cv-page-del:focus {
  opacity: 1;
}
.cv-page-del:hover {
  color: var(--danger);
  background: var(--danger-soft);
}
.cv-add-page {
  width: 100%;
  margin-bottom: 1.5rem;
}
.cv-palette {
  display: grid;
  gap: 0.35rem;
}
.cv-palette-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.5rem 0.65rem;
  font: inherit;
  color: var(--text);
  cursor: pointer;
}
.cv-palette-item:hover:not([disabled]) {
  border-color: var(--brand);
  background: var(--brand-soft);
}
.cv-palette-item[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}
.cv-palette-label {
  font-weight: 700;
  font-size: 0.92rem;
}
.cv-palette-hint {
  font-size: 0.78rem;
  color: var(--muted);
}
.cv-canvas {
  overflow-y: auto;
  padding: 1.5rem 2.5rem 6rem;
}
.cv-doc {
  max-width: 52rem;
  margin: 0 auto;
}
.cv-doc .sheet {
  overflow: visible;
}
.cv-block {
  position: relative;
  border-radius: 6px;
  outline: 2px solid transparent;
  outline-offset: 6px;
  cursor: pointer;
  transition: outline-color 120ms;
}
.cv-block * {
  pointer-events: none;
}
.cv-block .cv-tools,
.cv-block .cv-tools *,
.cv-block .cv-handle,
.cv-block.is-editing .cv-edit,
.cv-block.is-editing .cv-edit *,
.cv-block.is-editing > h1,
.cv-block.is-editing > h2,
.cv-block.is-editing > h3 {
  pointer-events: auto;
}
.is-readonly .cv-block {
  cursor: default;
}
.cv-block:hover {
  outline-color: color-mix(in srgb, var(--brand) 30%, transparent);
}
.cv-block.is-selected {
  outline-color: var(--brand);
}
.cv-block.is-editing {
  cursor: text;
  outline-style: dashed;
}
.cv-block[data-type="cover"] {
  outline-offset: -2px;
}
.cv-edit,
.cv-block.is-editing > h1,
.cv-block.is-editing > h2,
.cv-block.is-editing > h3 {
  outline: none;
  caret-color: var(--brand);
}
.cv-chip {
  display: inline-block;
  padding: 0 0.4em;
  border-radius: 999px;
  background: var(--brand-soft);
  border: 1px solid color-mix(in srgb, var(--brand) 35%, transparent);
  font-family: var(--sans);
  font-size: 0.85em;
  line-height: 1.5;
  white-space: nowrap;
  user-select: all;
}
.cv-handle {
  position: absolute;
  left: -1.9rem;
  top: 0.1rem;
  width: 1.4rem;
  text-align: center;
  color: var(--muted);
  cursor: grab;
  opacity: 0;
  font-family: var(--sans);
  user-select: none;
}
.cv-block:hover .cv-handle,
.cv-block.is-selected .cv-handle {
  opacity: 1;
}
.cv-tools {
  position: absolute;
  top: -2.55rem;
  right: -0.4rem;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  font-family: var(--sans);
  font-size: 0.85rem;
  white-space: nowrap;
}
.cv-tools-label {
  font-weight: 700;
  color: var(--muted);
  padding: 0 0.4rem;
}
.cv-tools button,
.cv-tools select {
  font: inherit;
  border: 1px solid transparent;
  background: none;
  color: var(--text);
  border-radius: 7px;
  padding: 0.25rem 0.55rem;
  cursor: pointer;
}
.cv-tools button:hover {
  background: var(--surface);
  border-color: var(--border);
}
.cv-tools select {
  border-color: var(--border);
}
.cv-tools .is-danger {
  color: var(--danger);
}
.cv-tools .is-primary {
  background: var(--brand);
  color: var(--brand-ink);
}
.cv-ghost {
  opacity: 0.35;
}
.cv-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.88rem;
  font-weight: 600;
  margin: 0 0 0.8rem;
}
.cv-field input,
.cv-field select {
  font-weight: 400;
}
.cv-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  margin: 0 0 0.6rem;
}
.cv-insp-list {
  margin: 0 0 0.75rem 1rem;
  font-size: 0.9rem;
}
.cv-toast {
  position: fixed;
  left: 50%;
  bottom: 1.25rem;
  transform: translate(-50%, 1rem);
  opacity: 0;
  pointer-events: none;
  background: var(--text);
  color: var(--bg);
  padding: 0.6rem 1rem;
  border-radius: 10px;
  box-shadow: var(--shadow);
  font-size: 0.92rem;
  transition:
    opacity 160ms,
    transform 160ms;
  z-index: 50;
}
.cv-toast.is-shown {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}
.cv-toast-action {
  margin-left: 0.6rem;
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}
@media (max-width: 1100px) {
  .cv-body {
    grid-template-columns: 13rem minmax(0, 1fr);
  }
  .cv-inspector {
    display: none;
  }
  .cv-canvas {
    padding: 1rem 1.5rem 5rem;
  }
}
.cv-tools-sep {
  width: 1px;
  align-self: stretch;
  background: var(--border);
  margin: 0 0.15rem;
}
.cv-insp-sub {
  font-size: 0.9rem;
  margin: 0.5rem 0 0.4rem;
}
.cv-reasons {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 0.6rem;
}
.cv-reason {
  display: flex;
  gap: 0.3rem;
}
.cv-reason input {
  flex: 1;
  min-width: 0;
}
.cv-reason-remove {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  padding: 0 0.6rem;
}
.cv-reason-remove:hover {
  color: var(--danger);
  border-color: var(--danger);
}
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.page-head h1 {
  margin-bottom: 0.25rem;
}
/* "New" and other page actions sit at the right edge, lined up with the table below, even
   when they wrap under the heading on a phone. */
.page-head > :last-child:not(:first-child) {
  margin-left: auto;
}
.admin .pill-draft,
.admin .pill-campaign-draft,
.cv-top .pill-draft {
  background: var(--surface);
  border-style: dashed;
  border-color: var(--border-strong);
}
.admin .pill-campaign-ready,
.admin .pill-campaign-sending {
  background: var(--brand-soft);
  border-color: var(--brand-border);
}
.admin .pill-campaign-completed {
  background: var(--success-soft);
  border-color: var(--success);
}
.admin .pill-campaign-cancelled {
  background: var(--danger-soft);
  border-color: var(--danger);
}
.admin .pill-campaign-paused,
.admin .pill-superseded {
  background: var(--surface);
  border-color: var(--border-strong);
}
.editor-switch {
  display: inline-flex;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  overflow: hidden;
  font-weight: 700;
  font-size: 0.9rem;
}
.editor-switch-item {
  padding: 0.45rem 0.9rem;
  color: var(--text);
  text-decoration: none;
  background: var(--paper);
}
.editor-switch-item + .editor-switch-item {
  border-left: 1px solid var(--border-strong);
}
.editor-switch-item.is-active {
  background: var(--text);
  color: var(--bg);
}
a.editor-switch-item:hover {
  background: var(--surface);
}
.user-chip {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  padding: 0.35rem 0.6rem;
  border-radius: 8px;
}
.user-chip:hover,
.user-chip.is-active {
  color: var(--text);
  background: var(--surface);
}
.account-section {
  border-top: 1px solid var(--border);
  padding-top: 0.5rem;
  margin-top: 1.25rem;
}
.cv-field textarea {
  width: 100%;
  font-weight: 400;
  line-height: 1.5;
  resize: vertical;
}
.cv-insert {
  width: 100%;
  margin: -0.4rem 0 0.8rem;
  font-size: 0.88rem;
}
.cv-reason-handle {
  cursor: grab;
  color: var(--muted);
  align-self: center;
  padding: 0 0.15rem;
  user-select: none;
}
.cv-reason-move {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  padding: 0 0.45rem;
}
.cv-reason-move[disabled] {
  opacity: 0.35;
  cursor: default;
}
/* Basic editor: options, add-ons, conditions, phone view */
.cv-body.is-wide-panel {
  grid-template-columns: 15.5rem minmax(0, 1fr) 24rem;
}
.cv-field-hint {
  font-weight: 400;
  font-size: 0.8rem;
  color: var(--muted);
}
.cv-field-error {
  color: var(--danger);
  font-size: 0.85rem;
  font-weight: 600;
  margin: 0.25rem 0 0.6rem;
}
.cv-back-link {
  background: none;
  border: 0;
  padding: 0;
  margin: 0 0 0.75rem;
  font: inherit;
  font-weight: 700;
  color: var(--brand);
  cursor: pointer;
}
.cv-note {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.65rem;
}
.cv-group {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.65rem 0.7rem 0.4rem;
  margin: 0 0 0.8rem;
  background: var(--surface);
}
.cv-group-settings {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  align-items: center;
}
.cv-opt-list {
  list-style: none;
  margin: 0.25rem 0 0.5rem;
  padding: 0;
  display: grid;
  gap: 0.3rem;
}
.cv-opt-list li {
  display: flex;
  gap: 0.25rem;
  align-items: stretch;
}
.cv-opt-item {
  flex: 1;
  min-width: 0;
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  text-align: left;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.45rem 0.6rem;
  font: inherit;
  color: var(--text);
  cursor: pointer;
}
.cv-opt-item:hover {
  border-color: var(--brand);
}
.cv-opt-item span:first-child {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cv-opt-price {
  color: var(--muted);
  white-space: nowrap;
  font-size: 0.85rem;
}
.cv-mini {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  padding: 0 0.45rem;
}
.cv-mini[disabled] {
  opacity: 0.35;
  cursor: default;
}
.cv-rule {
  margin: 0.25rem 0 0.9rem;
}
.cv-rule > select {
  width: 100%;
  margin-bottom: 0.4rem;
}
.cv-cond {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.3rem;
  margin: 0 0 0.45rem;
  padding: 0.45rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--paper);
  position: relative;
}
.cv-cond > [data-cond-value] {
  grid-column: 1 / -1;
}
.cv-cond select,
.cv-cond input {
  min-width: 0;
  width: 100%;
}
.cv-cond-remove {
  position: absolute;
  top: -0.55rem;
  right: -0.45rem;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--paper);
  color: var(--muted);
  cursor: pointer;
  line-height: 1;
  padding: 0;
}
.cv-cond-remove:hover {
  color: var(--danger);
  border-color: var(--danger);
}
.cv-cond-group {
  border: 1px dashed var(--border-strong);
  border-radius: 10px;
  padding: 0.45rem;
  margin: 0 0 0.45rem;
}
.cv-cond-group > select {
  width: 100%;
  margin-bottom: 0.4rem;
}
.cv-rule-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin: 0.35rem 0 0.5rem;
}
.cv-action {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: 0.3rem;
  margin: 0 0 0.45rem;
  position: relative;
}
.cv-action select,
.cv-action input {
  min-width: 0;
}
.cv-checks {
  display: grid;
  gap: 0.2rem;
}
.cv-danger-zone {
  border-top: 1px solid var(--border);
  padding-top: 0.6rem;
  margin-top: 1rem;
}
/* Basic editor: the offer question builder */
.cv-q-list {
  list-style: none;
  margin: 0.25rem 0 0.5rem;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}
.cv-q-row {
  display: flex;
  gap: 0.25rem;
  align-items: stretch;
}
.cv-q-item {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: 2.1rem minmax(0, 1fr);
  gap: 0.55rem;
  align-items: center;
  text-align: left;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.5rem 0.6rem;
  font: inherit;
  color: var(--text);
  cursor: pointer;
}
.cv-q-item:hover {
  border-color: var(--brand);
}
.cv-q-item.has-problem {
  border-color: var(--danger);
}
.cv-q-type {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.72rem;
  color: var(--brand-text, var(--brand));
}
.cv-q-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 0.1rem;
}
.cv-q-text b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.9rem;
}
.cv-q-text span {
  font-size: 0.78rem;
  color: var(--muted);
}
.cv-q-text .cv-q-if {
  color: var(--text);
  font-style: italic;
}
.cv-q-text .cv-q-problem {
  color: var(--danger);
  font-weight: 600;
}
.cv-seg {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  font-weight: 400;
}
.cv-seg button {
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.4rem 0.65rem;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--paper);
  color: var(--text);
  cursor: pointer;
}
.cv-seg button[aria-pressed="true"] {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-text, var(--brand));
}
.cv-optional {
  font-style: normal;
  font-weight: 400;
  color: var(--muted);
}
.cv-q-range {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}
.cv-q-choices {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}
.cv-q-choice {
  display: grid;
  grid-template-columns: 1rem minmax(0, 1.3fr) minmax(0, 1fr) 1.9rem;
  gap: 0.3rem;
  align-items: center;
}
.cv-q-choice input {
  min-width: 0;
  width: 100%;
}
.cv-q-choice .cv-reason-remove {
  align-self: stretch;
}
.cv-q-choice-head {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
}
.cv-q-create {
  margin: -0.4rem 0 0.8rem;
}
.cv-q-deps {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
  font-size: 0.85rem;
  margin: 0.4rem 0 0.6rem;
}
.cv-q-deps ul {
  margin: 0.3rem 0 0 1rem;
  padding: 0;
}
.cv-q-preview {
  border: 1px dashed var(--border-strong);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  font-family: var(--sans);
  font-size: 0.92rem;
}
.cv-q-preview-head {
  font-weight: 700;
  margin: 0 0 0.35rem;
}
.cv-q-preview ol {
  margin: 0 0 0.4rem 1.2rem;
  padding: 0;
}
.cv-q-preview li span,
.cv-q-preview-hint {
  color: var(--muted);
  font-size: 0.85rem;
}
.cv-q-preview-hint {
  margin: 0;
}
.cv-doc .cv-sub-selected {
  outline: 3px solid var(--brand);
  outline-offset: 3px;
  border-radius: 10px;
}
.cv-view-switch {
  display: inline-flex;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  overflow: hidden;
}
.cv-view-switch button {
  background: var(--paper);
  border: 0;
  padding: 0.45rem 0.8rem;
  font: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text);
  cursor: pointer;
}
.cv-view-switch button + button {
  border-left: 1px solid var(--border-strong);
}
.cv-view-switch button.is-active {
  background: var(--text);
  color: var(--bg);
}
.cv-phone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}
.cv-phone[hidden] {
  display: none;
}
.cv-phone-frame {
  width: 402px;
  height: 820px;
  max-height: calc(100vh - 11rem);
  border: 12px solid #1f2430;
  border-radius: 38px;
  overflow: hidden;
  background: var(--paper);
  box-shadow: var(--shadow);
}
.cv-phone-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
/* Admin form layout: section intro on the left, fields in a card on the right */
.form-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.75rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
}
.form-section:first-of-type {
  border-top: 0;
}
@media (min-width: 900px) {
  .form-section {
    grid-template-columns: minmax(12rem, 17rem) minmax(0, 1fr);
    gap: 2.5rem;
  }
}
.form-section-intro h2 {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
}
.form-section-intro p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.5;
}
.form-card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.25rem 1rem;
  min-width: 0;
}
.form-card > table {
  margin: 0 0 1rem;
}
.form-card > h3 {
  margin: 0.5rem 0 0.75rem;
  font-size: 1rem;
}
.form-card + .form-card {
  margin-top: 1rem;
}
.form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem 1.25rem;
}
@media (min-width: 640px) {
  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .form-grid .is-wide {
    grid-column: 1 / -1;
  }
}
.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
}
.form-field > label {
  font-weight: 600;
  font-size: 0.92rem;
}
.form-field input:not([type="checkbox"]):not([type="radio"]),
.form-field select,
.form-field textarea {
  width: 100%;
}
.color-field {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}
.form-field .color-field input[type="color"] {
  flex: 0 0 3rem;
  width: 3rem;
  min-height: 2.5rem;
  padding: 0.2rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface, var(--bg));
  cursor: pointer;
}
.color-field input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}
.color-field input[type="color"]::-webkit-color-swatch {
  border: 0;
  border-radius: 5px;
}
.color-field input[type="color"]::-moz-color-swatch {
  border: 0;
  border-radius: 5px;
}
.form-check > label {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 400;
}
.form-help {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.4;
}
/* The Terms and Privacy line above "Create my business" (join.tsx). */
.join-consent {
  margin: 1rem 0 0.5rem;
}
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  justify-content: flex-end;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.form-actions.is-plain {
  border-top: 0;
  padding-top: 0;
  justify-content: flex-start;
}
.form-save-bar {
  position: sticky;
  bottom: 0;
  z-index: 4;
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem 0;
  margin-top: 0.5rem;
  background: var(--bg);
  border-top: 1px solid var(--border);
}
.form-card .form-grid + .form-grid {
  margin-top: 1rem;
}
.form-subgrid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.25rem;
}
@media (min-width: 720px) {
  .form-subgrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.form-subgrid > form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.form-subgrid h3 {
  margin: 0;
  font-size: 1rem;
}
.form-subgrid p {
  margin: 0;
}
@media (max-width: 700px) {
  /* Wide tables scroll inside the page instead of widening it. */
  .admin table {
    display: block;
    overflow-x: auto;
  }
}
.cv-block:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 6px;
}
.cv-help {
  min-width: 40px;
  font-weight: 800;
}
.cv-dialog {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--text);
  padding: 1.25rem 1.5rem;
  max-width: 28rem;
  width: calc(100% - 2rem);
  box-shadow: var(--shadow);
}
.cv-dialog::backdrop {
  background: rgba(15, 17, 23, 0.45);
}
.cv-dialog h2 {
  margin: 0 0 0.75rem;
  font-size: 1.15rem;
}
.cv-keys {
  display: grid;
  gap: 0.4rem;
  margin: 0 0 0.75rem;
}
.cv-keys div {
  display: grid;
  grid-template-columns: 9.5rem 1fr;
  gap: 0.75rem;
  align-items: center;
}
.cv-keys dd {
  margin: 0;
}
.cv-keys kbd {
  font-family: var(--sans);
  font-size: 0.85rem;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 0.1rem 0.45rem;
  white-space: nowrap;
}
.cv-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}
#cv-ask-text {
  margin: 0;
}
/* "What's the difference?": each Proposal block with a tiny drawing of how it looks. */
.cv-guide {
  max-width: 40rem;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
}
.cv-guide h2:focus {
  outline: none;
}
.cv-guide-list {
  list-style: none;
  margin: 0.75rem 0 1rem;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}
.cv-guide-list li {
  display: grid;
  grid-template-columns: 13rem 1fr;
  gap: 0.85rem;
  align-items: center;
  padding: 0.5rem 0;
  border-top: 1px solid var(--border);
}
.cv-guide-words {
  display: grid;
  gap: 0.1rem;
  font-size: 0.9rem;
}
.cv-guide-words em {
  color: var(--muted);
}
.cv-mini {
  display: block;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  font-size: 0.72rem;
  line-height: 1.35;
  color: var(--text);
}
.cv-mini b,
.cv-mini i {
  font-style: normal;
  font-weight: 700;
}
.cv-mini-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
}
.cv-mini-card {
  display: grid;
  gap: 0.05rem;
  padding: 0.3rem 0.4rem;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: var(--paper);
}
.cv-mini-card em {
  font-style: normal;
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--brand-text);
}
.cv-mini-rows {
  display: grid;
  gap: 0.2rem;
}
.cv-mini-rows > span,
.cv-mini-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
}
.cv-mini-rows i,
.cv-mini-line.is-strong i {
  margin-left: auto;
}
.cv-mini-rows.is-table > span + span {
  border-top: 1px solid var(--border);
  padding-top: 0.2rem;
}
.cv-mini .is-strong {
  font-weight: 700;
}
.cv-mini-box {
  width: 0.7rem;
  height: 0.7rem;
  flex: none;
  border: 1.5px solid var(--border-strong);
  border-radius: 3px;
  background: var(--paper);
}
.cv-mini-field {
  min-width: 5.5rem;
  padding: 0.1rem 0.35rem;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  background: var(--paper);
  color: var(--muted);
}
.cv-mini-field.is-short {
  min-width: 1.8rem;
}
.cv-mini-button {
  padding: 0.12rem 0.55rem;
  border-radius: 4px;
  background: var(--brand);
  color: var(--brand-ink);
  font-weight: 700;
}
.cv-mini-link {
  color: var(--muted);
  text-decoration: underline;
}
.cv-mini-note {
  font-style: italic;
}
.cv-mini-pair {
  display: grid;
  gap: 0.2rem;
}
.cv-mini-tag {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.cv-mini-box.is-ticked {
  background: var(--brand);
  border-color: var(--brand);
}
@media (max-width: 560px) {
  .cv-guide-list li {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }
}
/* Clients list: tabs, selection, bulk actions */
.tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid var(--border);
  margin: 0.5rem 0 0.75rem;
}
.tab {
  padding: 0.5rem 0.9rem;
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
}
.tab.is-active {
  color: var(--text);
  border-bottom-color: var(--brand);
}
.tab-count {
  display: inline-block;
  min-width: 1.6rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.8rem;
  text-align: center;
  color: var(--muted);
}
.select-col {
  width: 2.5rem;
  text-align: center;
}
.select-table input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
}
.bulk-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  padding: 0.6rem 0.8rem;
  margin: 0 0 0.6rem;
  background: var(--paper);
  border: 1px solid var(--brand);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.bulk-bar[hidden] {
  display: none;
}
.bulk-count {
  font-weight: 700;
}
.btn-link {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--brand);
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}
.bulk-bar .spacer {
  flex: 1;
}
.form-details {
  margin-top: 1rem;
}
.form-details summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

/* Label and value pairs (business details, sign-in details) */
.detail-list {
  display: grid;
  grid-template-columns: minmax(8rem, max-content) minmax(0, 1fr);
  gap: 0.5rem 1.25rem;
  margin: 0 0 1rem;
}
.detail-list dt {
  font-weight: 600;
  color: var(--muted);
}
.detail-list dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}
.detail-list dd .link-box {
  margin: 0;
}

/* EngageCycle's logo (static/brand/svg): the light or dark file by theme, on every platform page.
   In the admin sidebar the mark alone stands in for the logo while the sidebar is collapsed. */
.brand-logo,
.brand-logo-full,
.brand-logo-mark {
  display: inline-flex;
  align-items: center;
  flex: none;
}
.brand-logo img {
  display: block;
  height: 28px;
  width: auto;
}
.brand-logo-mark {
  display: none;
}
.brand-logo .on-dark {
  display: none;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .brand-logo .on-light {
    display: none;
  }
  :root:not([data-theme="light"]) .brand-logo .on-dark {
    display: block;
  }
}
:root[data-theme="dark"] .brand-logo .on-light {
  display: none;
}
:root[data-theme="dark"] .brand-logo .on-dark {
  display: block;
}

/* EngageCycle's own brand (static/brand/README.md) on the marketing site, the help center, and the
   API docs (<html class="mk-site">). Scoped, so a business's pages keep their own brand color. */
@font-face {
  font-family: "Sora";
  src: url("/static/fonts/sora-latin-wght.woff2?v=714cfbc8e4") format("woff2");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("/static/fonts/atkinson-hyperlegible-latin-400.woff2?v=b09653e3ba") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("/static/fonts/atkinson-hyperlegible-latin-700.woff2?v=d8e8b1e0e9") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
:root.mk-site {
  --brand: #2459e0;
  --brand-ink: #ffffff;
  --brand-text: var(--brand);
  --brand-soft: #e8efff;
  --deep: #10245e;
  --bg: #f6f8fc;
  --paper: #ffffff;
  --surface: #f6f8fc;
  --text: #0f172a;
  --body: #3b4558;
  --muted: #5f687a;
  --border: #e3e8f1;
  --border-strong: #c9d1de;
  --success: #14804a;
  --success-soft: #e5f5ec;
  --sans: "Atkinson Hyperlegible", "Segoe UI", system-ui, -apple-system, sans-serif;
  --display: "Sora", "Segoe UI", system-ui, -apple-system, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root.mk-site:not([data-theme="light"]) {
    --brand: #7196ff;
    --brand-ink: #0b1020;
    --brand-text: var(--brand);
    --brand-soft: #1a2747;
    --deep: #eef2fb;
    --bg: #0b1020;
    --paper: #121a2e;
    --surface: #0e1527;
    --text: #eef2fb;
    --body: #c3cbd9;
    --muted: #8b95a8;
    --border: #243049;
    --border-strong: #34425f;
    --success: #5fd08f;
    --success-soft: #10291c;
  }
}
:root.mk-site[data-theme="dark"] {
  --brand: #7196ff;
  --brand-ink: #0b1020;
  --brand-text: var(--brand);
  --brand-soft: #1a2747;
  --deep: #eef2fb;
  --bg: #0b1020;
  --paper: #121a2e;
  --surface: #0e1527;
  --text: #eef2fb;
  --body: #c3cbd9;
  --muted: #8b95a8;
  --border: #243049;
  --border-strong: #34425f;
  --success: #5fd08f;
  --success-soft: #10291c;
}
.mk-site h1,
.mk-site h2,
.mk-site h3 {
  font-family: var(--display);
  font-weight: 600;
}

/* Marketing site (bare product domain). Mobile first; same tokens as the product. */
.mk {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px 48px;
}
.mk-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 18px 0;
}
.mk-nav .spacer {
  flex: 1;
}
.mk-nav nav {
  display: none;
  gap: 1.25rem;
}
.mk-nav nav a {
  color: var(--body);
  text-decoration: none;
  font-weight: 500;
}
.mk-nav nav a:hover {
  color: var(--brand-text);
}
.mk-wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font: 600 1.2rem/1 var(--display, var(--sans));
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
}
.mk-wordmark .brand-logo img {
  height: 30px;
}
.mk-hero {
  display: grid;
  gap: 2rem;
  align-items: center;
  padding: 32px 0 48px;
}
.mk-eyebrow {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brand-text);
}
.mk-hero h1 {
  margin: 0 0 1rem;
  font-size: clamp(2rem, 6vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
  color: var(--text);
}
.mk-lede {
  margin: 0 0 1.5rem;
  font-size: 1.12rem;
  line-height: 1.6;
  color: var(--body);
  max-width: 36rem;
}
.mk-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.mk-preview {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  display: grid;
  gap: 0.75rem;
  max-width: 440px;
  width: 100%;
  justify-self: center;
}
.mk-preview-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.mk-preview-logo {
  font-weight: 700;
  color: var(--text);
}
.mk-pill {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-text);
}
.mk-preview-title {
  margin: 0.25rem 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}
.mk-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.mk-option strong {
  display: block;
  color: var(--text);
}
.mk-option small {
  color: var(--muted);
}
.mk-option.is-picked {
  border: 2px solid var(--brand-border);
  background: var(--brand-soft);
}
.mk-price {
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}
.mk-preview-sign {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px dashed var(--border-strong);
  padding-top: 0.75rem;
}
.mk-signature {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.3rem;
  color: var(--text);
}
.mk-signed {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--success);
  background: var(--success-soft);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
}
.mk-section {
  padding: 48px 0;
  border-top: 1px solid var(--border);
}
.mk-section h2 {
  margin: 0 0 1.5rem;
  font-size: clamp(1.5rem, 4vw, 2.1rem);
  letter-spacing: -0.02em;
  color: var(--text);
}
.mk-section h3 {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
  color: var(--text);
}
.mk-section p {
  margin: 0;
  line-height: 1.6;
  color: var(--body);
}
.mk-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.25rem;
}
.mk-step-number {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  margin-bottom: 0.6rem;
  border-radius: 999px;
  background: var(--brand);
  color: var(--brand-ink);
  font-weight: 700;
}
.mk-grid {
  display: grid;
  gap: 1rem;
}
.mk-card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.mk-split {
  display: grid;
  gap: 2rem;
}
.mk-audiences {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.mk-audiences li {
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--paper);
  color: var(--body);
}
.mk-waitlist {
  display: grid;
  gap: 1.5rem;
}
.mk-form {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  display: grid;
  gap: 1rem;
}
.mk-form-grid {
  display: grid;
  gap: 1rem;
}
.mk-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}
.mk-field label {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text);
}
.mk-field input,
.mk-field select,
.mk-field textarea {
  width: 100%;
}
.mk-form .btn {
  justify-self: start;
}
.mk-thanks h3 {
  margin: 0;
}
/* A checkbox with its words beside it (the demo's and the waitlist's opt-ins). */
.mk-check {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  font-size: 0.92rem;
  color: var(--body);
}
.mk-check input {
  margin-top: 0.2rem;
  flex: none;
}
.mk-error {
  color: var(--danger, #b42318);
  font-size: 0.85rem;
}
/* Kept off screen for people, still in the form for bots. */
.mk-trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.mk-footer-links {
  display: flex;
  gap: 1rem;
}
.mk-fine {
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}
.mk-legal {
  max-width: 44rem;
}
.mk-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
}
@media (min-width: 720px) {
  .mk-nav nav {
    display: flex;
  }
  .mk-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .mk-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .mk-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .mk-split {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 960px) {
  .mk-hero {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    padding: 56px 0 72px;
  }
  .mk-steps {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .mk-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .mk-waitlist {
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
    align-items: start;
  }
}
.alert form.inline .btn {
  margin-left: 0.5rem;
}
.auth-aside {
  margin-top: 1rem;
}
.fact-list {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.4rem 1rem;
  margin: 0 0 1rem;
}
.fact-list dt {
  color: var(--muted);
}
.fact-list dd {
  margin: 0;
  overflow-wrap: anywhere;
}
@media (max-width: 560px) {
  .fact-list {
    grid-template-columns: 1fr;
  }
  .fact-list dd {
    margin-bottom: 0.5rem;
  }
}
.plain-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.plain-list li {
  padding: 0.25rem 0;
}
.stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}
.stat {
  flex: 1 1 10rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  background: var(--paper);
}
.stat-warn {
  border-color: var(--danger);
}
.stat-value {
  font-size: 1.6rem;
  font-weight: 600;
}
.stat-label {
  font-size: 0.9rem;
}
.stat-help {
  font-size: 0.8rem;
}
.setting {
  border-top: 1px solid var(--border);
  padding: 1rem 0;
}
.setting:first-child {
  border-top: 0;
  padding-top: 0;
}
.setting-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}
.setting p {
  margin: 0.35rem 0;
}
.offer-share {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin: 0.75rem 0;
}
/* Offer sharing: the link, the QR code, and the embed code, each with its own action. */
.share-item + .share-item {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}
.share-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.share-head h3 {
  margin: 0;
  font-size: 1rem;
}
.share-item .link-box,
.share-item .embed-snippet {
  margin: 0.5rem 0 0;
}
.offer-share .qr-box svg {
  width: 160px;
  height: 160px;
}
.admin .pill-offer-open {
  background: var(--success-soft);
  border-color: var(--success);
}
.admin .pill-offer-paused,
.admin .pill-offer-closed,
.admin .pill-offer-ended {
  background: var(--danger-soft);
  border-color: var(--danger);
}
.offer {
  max-width: 40rem;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}
.offer-embed {
  padding-top: 0.5rem;
}
.offer-intro {
  color: var(--muted);
}
.offer fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 1.5rem;
}
.offer-contact {
  border-top: 1px solid var(--border);
  padding-top: 1rem !important;
}
.offer-contact legend {
  font-weight: 600;
  font-size: 1.1rem;
}
.offer-contact[disabled] {
  opacity: 0.55;
}
.offer-question .field-error,
.offer .field-error {
  color: var(--danger);
  font-size: 0.9rem;
}
.offer-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
}
.offer-price {
  margin: 1rem 0 1.5rem;
}
.offer-total {
  font-size: 1.25rem;
}
.offer-options {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0;
}
.offer-options li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border);
}
.offer-consent {
  display: block;
  margin: 0.75rem 0;
}
.embed-snippet {
  white-space: pre-wrap;
  word-break: break-all;
  font-size: 0.85rem;
  background: var(--paper);
  border: 1px solid var(--border);
  padding: 0.75rem;
  border-radius: var(--radius-sm);
}

/* A build's items on the proposal (Milestone 10): each line with its quantity and amount. */
.build-lines {
  list-style: none;
  margin: 0.55rem 0 0;
  padding: 0;
  font-size: 0.93rem;
  color: var(--body);
}
.build-lines li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.3rem 0;
  border-top: 1px dashed var(--border);
}
.build-lines li:first-child {
  border-top: 0;
}
.build-line-amount {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--text);
}
/* A line's description and what it includes, under its name (snapshots from 2026-10-02 on). */
.build-lines li.build-line-full {
  flex-wrap: wrap;
  row-gap: 0;
}
.build-line-full .build-line-name {
  font-weight: 600;
  color: var(--text);
}
.build-line-desc {
  flex-basis: 100%;
  font-size: 0.9rem;
  margin-top: 0.15rem;
}
.build-line-includes,
.addon-includes {
  flex-basis: 100%;
  list-style: disc;
  margin: 0.3rem 0 0 1.1rem;
  padding: 0;
  font-size: 0.9rem;
  color: var(--body);
}
.build-lines .build-line-includes li,
.build-line-includes li,
.addon-includes li {
  display: list-item;
  padding: 0;
  margin: 0.1rem 0;
  border-top: 0;
}
/* One price to approve: shown as the proposal, not a choice. */
.option-card.is-fixed {
  cursor: default;
  border-color: var(--brand-border);
}
.option-card.is-fixed:hover {
  border-color: var(--brand-border);
}
.option-card.is-fixed:has(.option-input:checked) {
  background: var(--paper);
}
.letter-note {
  margin: 1rem 0;
  padding: 0.8rem 1rem;
  border-left: 3px solid var(--brand);
  background: var(--surface);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.letter-note p:first-child {
  margin-top: 0;
}
.letter-note p:last-child {
  margin-bottom: 0;
}
.fee-monthly td {
  text-align: right;
  font-weight: 600;
}

/* ------------------------------------------------------------------ billing frequencies (Milestone 24)
 * Totals by frequency and rates billed as used. New class names only, so documents made before
 * look exactly as before. */
.price-term {
  display: block;
  text-align: right;
}
.price-term + .price-term {
  font-size: 0.92em;
}
/* Amounts with a frequency may wrap in a narrow Fee schedule. */
.fee-price .price-term,
.fee-foot .fee-price,
.fee-rates .fee-price {
  white-space: normal;
}
.fee-total.fee-term td {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
  font-weight: 700;
}
.fee-total.fee-term .fee-price {
  color: var(--text);
  font-size: 1rem;
}
.total-split {
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
}
.total-terms {
  display: grid;
  gap: 0.2rem;
  margin: 0;
}
.total-term {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}
.total-term dt {
  font-weight: 600;
  opacity: 0.9;
}
.total-term dd {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
/* The top bar's total reads each frequency ("$250 one time and $450 a quarter"), so it wraps. */
.topbar-total.is-terms {
  min-width: 0;
  flex: 0 1 17rem;
}
.topbar-total.is-terms .topbar-total-amount,
html.sg .topbar-total.is-terms .topbar-total-amount {
  white-space: normal;
  text-align: right;
  font-size: 0.85rem;
  line-height: 1.25;
}
@media (min-width: 720px) {
  .topbar-total.is-terms {
    flex-basis: 28rem;
  }
  .topbar-total.is-terms .topbar-total-amount,
  html.sg .topbar-total.is-terms .topbar-total-amount {
    font-size: 1rem;
  }
}
.build-line-rate .build-line-amount,
.svc-line-rate .svc-line-amount {
  color: var(--muted);
  font-style: italic;
}
.addon-rate .addon-price {
  margin-left: auto;
}

/* ------------------------------------------------------------------ content blocks (Milestone 11)
 * Only new class names (blk-*), so documents made before these blocks look exactly as before. */
.blk-image {
  margin: 1.25rem 0;
}
.blk-image img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
}
.blk-image-wide img {
  width: 100%;
}
.blk-image-full {
  margin-left: -0.5rem;
  margin-right: -0.5rem;
}
.blk-image-inline {
  max-width: 50%;
}
.blk-image figcaption,
.blk-video figcaption {
  margin-top: 0.4rem;
  font-size: 0.85rem;
  color: var(--muted);
}
.blk-video {
  margin: 1.25rem 0;
}
.blk-video-frame,
.blk-video-player {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}
.blk-video-poster {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.blk-video-plain {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding: 1rem;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.blk-video-play {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 64px;
  height: 64px;
  margin: -32px 0 0 -32px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: var(--shadow);
}
.blk-video-play::after {
  content: "";
  position: absolute;
  left: 26px;
  top: 20px;
  border-style: solid;
  border-width: 12px 0 12px 20px;
  border-color: transparent transparent transparent var(--brand-ink);
}
.blk-video-frame:hover .blk-video-play,
.blk-video-frame:focus-visible .blk-video-play {
  transform: scale(1.06);
}
.blk-video-frame:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.blk-print-url {
  display: none;
}
.blk-divider {
  margin: 1.5rem 0;
  border: 0;
  border-top: 1px solid var(--border);
}
.blk-spacer-s {
  height: 0.75rem;
}
.blk-spacer-m {
  height: 1.75rem;
}
.blk-spacer-l {
  height: 3.5rem;
}
.blk-break {
  display: none;
}
.blk-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin: 1rem 0;
}
.blk-col > :first-child {
  margin-top: 0;
}
.blk-button-wrap {
  margin: 1.25rem 0;
}
.blk-button {
  display: inline-block;
  padding: 0.7rem 1.2rem;
  border-radius: var(--radius-sm);
  background: var(--brand);
  color: var(--brand-ink);
  font-weight: 600;
  text-decoration: none;
}
.blk-button:hover {
  background: var(--brand-dark);
}
.blk-button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
@media (max-width: 600px) {
  .blk-columns {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  .blk-image-inline {
    max-width: 100%;
  }
  .blk-image-full {
    margin-left: 0;
    margin-right: 0;
  }
}
@media print {
  .blk-break {
    display: block;
    break-after: page;
    page-break-after: always;
  }
  .blk-print-url {
    display: block;
    margin: 0.3rem 0 0;
    font-size: 0.8rem;
    color: #444;
    word-break: break-all;
  }
  .blk-video-play {
    display: none;
  }
  .blk-image,
  .blk-video,
  .blk-columns {
    break-inside: avoid;
  }
}

/* Canvas side panel for the content blocks (Milestone 11) */
.cv-palette-group {
  margin: 0.75rem 0 0.25rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.cv-palette-group:first-child {
  margin-top: 0;
}
.cv-image-summary {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0.25rem 0 0.6rem;
  font-size: 0.8rem;
  color: var(--muted);
}
.cv-image-summary img {
  width: 72px;
  height: 48px;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.cv-insp-warn {
  margin: 0.4rem 0 0.6rem;
  padding: 0.5rem 0.6rem;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
  background: var(--danger-soft);
  color: var(--text);
}
.cv-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.4rem 0 0.75rem;
}
.cv-col-child {
  position: relative;
  padding: 0.5rem 2rem 0.1rem 0.6rem;
  margin-bottom: 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.cv-col-child .cv-reason-remove {
  position: absolute;
  top: 0.4rem;
  right: 0.3rem;
}

/* ------------------------------------------------------------------ proposal blocks (Milestone 11)
 * New class names only, so documents made before these blocks look as before. */
/* Services (12.11): packages to choose from, or the one base service. */
.svc {
  border: 0;
  margin: 0 0 1rem;
  padding: 0;
  min-width: 0;
}
.svc-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-items: stretch;
}
.svc-desc {
  display: block;
  color: var(--body);
  margin-top: 0.2rem;
  font-size: 0.93rem;
}
.svc-includes {
  list-style: disc;
  margin: 0.35rem 0 0 1.1rem;
  padding: 0;
  font-size: 0.9rem;
  color: var(--body);
}
.svc-includes li {
  margin: 0.1rem 0;
}
.svc-lines {
  list-style: none;
  margin: 0.55rem 0 0;
  padding: 0;
  font-size: 0.93rem;
  color: var(--body);
}
.svc-line {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  column-gap: 1rem;
  padding: 0.3rem 0;
  border-top: 1px dashed var(--border);
}
.svc-line:first-child {
  border-top: 0;
}
.svc-line-name {
  font-weight: 600;
  color: var(--text);
}
.svc-line-amount {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--text);
}
.svc-line-desc,
.svc-line .svc-includes {
  flex-basis: 100%;
}
.svc-line-desc {
  font-size: 0.9rem;
  margin-top: 0.1rem;
}
.svc-name {
  font-weight: 700;
  color: var(--brand-text);
}
.svc-price {
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.svc-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--sans);
  font-size: 0.95rem;
}
.svc-table th,
.svc-table td {
  border: 1px solid var(--border);
  padding: 0.7rem 0.75rem;
  text-align: left;
  vertical-align: top;
}
.svc-head th {
  background: var(--brand);
  color: var(--brand-ink);
  border-color: var(--brand);
  font-weight: 700;
}
.svc-head .required-note {
  font-weight: 500;
}
.svc-table .svc-price-col,
.svc-table .svc-price {
  text-align: right;
  width: 1%;
}
.svc-table .svc-price {
  vertical-align: middle;
}
.svc-choose,
.svc-item-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
}
/* Only a choice the client made is highlighted, never the one base service. */
.svc-row:has(.option-input:checked:not([hidden])),
.svc-item:has(.option-input:checked:not([hidden])) {
  background: var(--brand-soft);
}
.svc-choose .option-check,
.svc-item-row .option-check {
  margin-top: 0;
}

.svc[data-mode="multi"] .option-check {
  border-radius: 6px;
}
.svc-choose:has(.option-input:checked) .option-check,
.svc-item-row:has(.option-input:checked) .option-check {
  border-color: var(--brand);
  background: var(--brand);
}
.svc-choose:has(.option-input:checked) .option-check::after,
.svc-item-row:has(.option-input:checked) .option-check::after {
  content: "";
  position: absolute;
  left: 0.42rem;
  top: 0.16rem;
  width: 0.32rem;
  height: 0.65rem;
  border: solid var(--brand-ink);
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
}
.svc-choose:has(.option-input:focus-visible),
.svc-item-row:has(.option-input:focus-visible) {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.svc-choose .badge,
.svc-item-row .badge {
  margin: 0 0 0 0.3rem;
}
.svc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: var(--sans);
}
.svc-item {
  padding: 0.7rem 0.4rem;
  border-top: 1px solid var(--border);
}
.svc-item:first-child {
  border-top: 0;
}
.svc-item-row .svc-name {
  flex: 1 1 auto;
}
/* Add-ons (12.11), rows or cards. */
.ad-block {
  margin: 1rem 0;
  font-family: var(--sans);
}
.ad-list {
  display: flex;
  flex-direction: column;
}
.ad-cards .ad-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.7rem;
}
.ad-item {
  border-top: 1px solid var(--border);
}
.ad-item:first-child {
  border-top: 0;
}
.ad-cards .ad-item {
  border: 2px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--paper);
}
.ad-row {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  padding: 0.75rem 0.4rem;
  cursor: pointer;
}
.ad-cards .ad-row {
  padding: 0.9rem;
}
.ad-control {
  flex: 0 0 auto;
  padding-top: 0.1rem;
}
.ad-main {
  flex: 1 1 auto;
  min-width: 0;
}
.ad-name {
  display: block;
  font-weight: 700;
  color: var(--brand-text);
}
.ad-desc,
.ad-note {
  display: block;
  font-size: 0.9rem;
  color: var(--body);
  margin-top: 0.15rem;
}
.ad-note {
  color: var(--muted);
}
.ad-includes {
  list-style: disc;
  margin: 0.3rem 0 0 1.1rem;
  padding: 0;
  font-size: 0.9rem;
  color: var(--body);
}
.ad-table {
  margin: 1rem 0;
}
.ad-table .ad-row {
  padding: 0;
}
.ad-trow:has(.addon-input:checked) {
  background: var(--brand-soft);
}
.ad-price {
  flex: 0 0 auto;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-align: right;
}
.blk-total {
  margin-top: 1rem;
}
.total-monthly {
  display: block;
  font-size: 0.9rem;
  color: var(--muted);
}
.blk-expiry {
  margin: 1rem 0;
  padding: 0.6rem 0.9rem;
  border-left: 3px solid var(--brand);
  background: var(--surface);
  border-radius: var(--radius-sm);
}
.blk-documents {
  display: grid;
  gap: 1rem;
  margin: 1.25rem 0;
}
.blk-document {
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.blk-document-title {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}
.blk-document-body {
  max-height: 16rem;
  overflow: auto;
  margin-bottom: 0.75rem;
  font-size: 0.92rem;
}
@media print {
  .blk-document-body {
    max-height: none;
    overflow: visible;
  }
  .blk-document {
    break-inside: avoid;
  }
}

/* A video's own thumbnail (Milestone 11, the video_block partial): when its host gives no poster,
   a dark frame in the business's color with the host and the title, under the play button. */
.blk-video-thumb {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 1rem 1.15rem;
  color: #ffffff;
  background:
    radial-gradient(circle at 78% 18%, rgba(255, 255, 255, 0.14), transparent 45%),
    linear-gradient(
      135deg,
      color-mix(in srgb, var(--brand, #1f3a5f) 72%, #0b1220),
      color-mix(in srgb, var(--brand, #1f3a5f) 28%, #05080f)
    );
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.blk-video-thumb-host {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.8;
}
.blk-video-thumb-title {
  max-width: 75%;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.3;
  text-wrap: balance;
}
/* On the dark thumbnail the play button is white, with the arrow in the business's color. */
.blk-video-thumb + .blk-video-play {
  background: rgba(255, 255, 255, 0.94);
}
.blk-video-thumb + .blk-video-play::after {
  border-color: transparent transparent transparent var(--brand, #1f3a5f);
}

/* A fieldset used only to disable a group of fields at once (Settings for staff). */
.plain-fieldset {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}

/* Settings > API keys: what a new key can do (ARCHITECTURE 24.3). */
.api-keys-table code,
.api-keys-table td:last-child {
  white-space: nowrap;
}
/* Integrations > MCP (ARCHITECTURE 36.9): scopes stay whole, and the tools read as a list. */
.mcp-setup code {
  white-space: nowrap;
}
.mcp-setup .embed-snippet {
  margin: 0.5rem 0 1rem;
}
.mcp-tools {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 1rem;
}
.mcp-tools li {
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--border);
}
.mcp-tools li .muted {
  display: block;
  font-size: 0.85rem;
}
.key-scopes > legend {
  padding: 0;
  margin: 0.75rem 0 0.25rem;
  font-weight: 600;
}

/* The help center (help.<APP_DOMAIN>, ARCHITECTURE 9e): a list of articles and one article. */
.help-nav {
  gap: 16px;
}
.help-wordmark-help {
  color: var(--muted);
  font-weight: 500;
  text-decoration: none;
}
.help-wordmark-help:hover {
  color: var(--body);
}
.help-back {
  color: var(--body);
  text-decoration: none;
  font-size: 0.95rem;
  white-space: nowrap;
}
.help-back:hover {
  text-decoration: underline;
}
@media (max-width: 560px) {
  /* The logo, the theme, and Sign in share the first line; Back to EngageCycle has its own. */
  .help-nav {
    flex-wrap: wrap;
    gap: 6px 12px;
  }
  /* The article list below already says this is Help. */
  .help-wordmark-help {
    display: none;
  }
  .help-back {
    order: 5;
    flex: 1 0 100%;
    font-size: 0.9rem;
  }
}
.help-layout {
  display: grid;
  gap: 24px;
  padding: 24px 0 48px;
  border-top: 1px solid var(--border);
}
.help-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  font-size: 0.95rem;
}
.help-toc a {
  color: var(--body);
  text-decoration: none;
  padding: 4px 0;
}
.help-toc a:hover,
.help-toc a.is-active {
  color: var(--brand-text);
}
.help-toc a.is-active {
  font-weight: 600;
}
.help-article {
  min-width: 0;
  max-width: 46rem;
  line-height: 1.65;
  color: var(--body);
}
.help-article h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  letter-spacing: -0.02em;
  color: var(--text);
}
.help-article h2 {
  margin: 2.25rem 0 0.75rem;
  font-size: 1.4rem;
  color: var(--text);
}
.help-article h3 {
  margin: 1.75rem 0 0.5rem;
  font-size: 1.1rem;
  color: var(--text);
}
.help-article h2,
.help-article h3 {
  scroll-margin-top: 16px;
}
.help-article img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1rem 0;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.help-article code {
  font-size: 0.9em;
  overflow-wrap: anywhere;
}
.help-article table {
  display: block;
  overflow-x: auto;
  border-collapse: collapse;
}
.help-article th,
.help-article td {
  padding: 6px 10px;
  border: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}
/* The API reference (/api/docs, ARCHITECTURE 24.11): the help center's look, plus code. */
.help-article pre {
  max-width: 100%;
  overflow-x: auto;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  line-height: 1.45;
}
.help-article pre code {
  overflow-wrap: normal;
}
.api-toc .api-toc-tag {
  margin-top: 6px;
  font-weight: 600;
  color: var(--text);
}
.api-toc .api-toc-op {
  padding: 2px 0 2px 10px;
  font-size: 0.82rem;
}
.api-op {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.api-op h3 code {
  overflow-wrap: anywhere;
}
@media (max-width: 859px) {
  .api-toc .api-toc-op {
    display: none;
  }
}
@media (min-width: 860px) {
  .help-layout {
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 40px;
  }
  .help-toc {
    flex-direction: column;
    flex-wrap: nowrap;
    position: sticky;
    top: 16px;
    align-self: start;
  }
  .api-toc {
    max-height: calc(100vh - 32px);
    overflow-y: auto;
  }
}

/* Continue with Google and Continue with Microsoft (ARCHITECTURE 34): each company's button
   guidelines (Google: white, #747775 border, #1f1f1f text, dark #131314 with #8e918f; Microsoft:
   white, #8c8c8c border, #5e5e5e text, dark #2f2f2f with white text), full width in the card. */
.sso {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}
.sso-or {
  margin: 0;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.sso-form {
  margin: 0;
}
.sso-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 4px;
  font:
    500 14px/1 "Segoe UI",
    Roboto,
    Arial,
    sans-serif;
  cursor: pointer;
}
.sso-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.sso-mark {
  width: 20px;
  height: 20px;
  flex: none;
}
.sso-google {
  background: #fff;
  border: 1px solid #747775;
  color: #1f1f1f;
}
.sso-microsoft {
  background: #fff;
  border: 1px solid #8c8c8c;
  color: #5e5e5e;
  font-weight: 600;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .sso-google {
    background: #131314;
    border-color: #8e918f;
    color: #e3e3e3;
  }
  :root:not([data-theme="light"]) .sso-microsoft {
    background: #2f2f2f;
    border-color: #2f2f2f;
    color: #fff;
  }
}
:root[data-theme="dark"] .sso-google {
  background: #131314;
  border-color: #8e918f;
  color: #e3e3e3;
}
:root[data-theme="dark"] .sso-microsoft {
  background: #2f2f2f;
  border-color: #2f2f2f;
  color: #fff;
}

/* "What's a credit?": a small popover with the shared definition (core/credit-words.ts). */
.credit-def {
  margin: 8px 0;
  font-size: 0.9rem;
}
.credit-def > summary {
  cursor: pointer;
  color: var(--brand-text, var(--link));
  width: fit-content;
}
.credit-def-body {
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2, transparent);
  font-weight: 400;
  text-align: left;
}
.credit-def-body p {
  margin: 0 0 6px;
}

/* The signed copy is still being made (ARCHITECTURE 41): one bar with a segment per real stage
   (Signed, In line, Making your copy, Ready), the stage as text, and the download at Ready.
   The fill's width is set by stage here and moved by /static/pdf-progress.js. */
.pdf-progress {
  display: grid;
  gap: 8px;
  margin: 20px 0 16px;
  text-align: left;
}
.pdf-progress p {
  margin: 0;
}
.pp-bar {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  overflow: hidden;
}
/* The three lines between the four segments. */
.pp-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    transparent calc(25% - 1px),
    var(--paper) calc(25% - 1px) 25%,
    transparent 25% calc(50% - 1px),
    var(--paper) calc(50% - 1px) 50%,
    transparent 50% calc(75% - 1px),
    var(--paper) calc(75% - 1px) 75%,
    transparent 75%
  );
  pointer-events: none;
}
.pp-fill {
  display: block;
  height: 100%;
  width: 25%;
  background: var(--brand-text, var(--brand));
  border-radius: 999px 0 0 999px;
  transition: width 0.4s ease-out;
}
.pdf-progress[data-stage="rendering"] .pp-fill {
  width: 50%;
}
.pdf-progress[data-stage="ready"] .pp-fill {
  width: 100%;
  background: var(--success);
  border-radius: 999px;
}
.pp-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  font-size: 0.8rem;
  color: var(--muted);
}
.pp-steps li {
  overflow-wrap: anywhere;
}
.pp-steps li.is-done {
  color: var(--text);
}
.pp-steps li.is-current {
  color: var(--brand-text, var(--text));
  font-weight: 700;
}
.pp-status {
  font-weight: 600;
  color: var(--text);
}
.pp-note,
.pp-slow {
  font-size: 0.9rem;
}
.pp-slow {
  color: var(--text);
}
.pdf-progress .btn {
  justify-self: start;
  margin-top: 4px;
}
.pdf-progress [hidden] {
  display: none;
}
@media (prefers-reduced-motion: reduce) {
  .pp-fill {
    transition: none;
  }
}

/* The preview bar's "Preview as:" (pages/preview-bar.tsx): in the template editor and on the
   full-page Preview, never in anything a client sees. It sticks under the top bar. */
.pb {
  --pb-ink: var(--ed-ink, var(--text));
  --pb-muted: var(--ed-muted, var(--muted));
  --pb-line: var(--ed-line, var(--border));
  --pb-paper: var(--ed-paper, var(--paper));
  --pb-sunken: var(--ed-sunken, var(--surface));
  --pb-accent: var(--ed-primary, var(--brand-text, var(--brand)));
  --pb-accent-soft: var(--ed-primary-soft, var(--brand-soft));
  --pb-bg: var(--ed-desk, var(--bg));
  position: sticky;
  top: 0;
  z-index: 8;
  width: min(52rem, 100%);
  padding: 6px 0;
  background: var(--pb-bg);
  color: var(--pb-muted);
  font-size: 13px;
}
.pb[data-pb="page"] {
  top: var(--topbar-h);
  width: auto;
  padding: 6px 0.75rem;
  background: var(--paper);
  border-bottom: 1px solid var(--border);
}
.pb-wide {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
}
.pb-narrow {
  display: none;
}
.pb-label {
  font-weight: 600;
  color: var(--pb-ink);
  white-space: nowrap;
}
.pb-switch {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  background: var(--pb-sunken);
  border: 1px solid var(--pb-line);
  border-radius: 8px;
}
.pb-opt {
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--pb-muted);
  text-decoration: none;
  white-space: nowrap;
}
.pb-opt:hover {
  color: var(--pb-ink);
}
.pb-opt[aria-current="true"] {
  background: var(--pb-paper);
  color: var(--pb-ink);
  box-shadow: 0 0 0 1px var(--pb-accent);
}
.pb-saved {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}
.pb-saved label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.pb-saved select {
  max-width: 14rem;
  padding: 5px 8px;
  border-radius: 8px;
  border: 1px solid var(--pb-line);
  background: var(--pb-paper);
  color: var(--pb-ink);
  font: inherit;
}
.pb-go {
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid var(--pb-line);
  background: var(--pb-paper);
  color: var(--pb-ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.pb.has-js .pb-go {
  display: none;
}
@media (max-width: 699px) {
  .pb-wide {
    display: none;
  }
  .pb-narrow {
    display: block;
    position: relative;
  }
  .pb-narrow > summary {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 36px;
    padding: 0 10px;
    border: 1px solid var(--pb-line);
    border-radius: 8px;
    background: var(--pb-paper);
    color: var(--pb-ink);
    cursor: pointer;
    list-style: none;
    white-space: nowrap;
    overflow: hidden;
  }
  .pb-narrow > summary::-webkit-details-marker {
    display: none;
  }
  .pb-narrow > summary b {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .pb-chevron {
    flex: none;
    color: var(--pb-muted);
  }
  .pb-narrow[open] .pb-chevron {
    transform: rotate(180deg);
  }
  .pb-panel {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    z-index: 9;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px;
    background: var(--pb-paper);
    border: 1px solid var(--pb-line);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
  }
  .pb-panel .pb-switch {
    flex-direction: column;
  }
  .pb-panel .pb-opt {
    display: flex;
    align-items: center;
    min-height: 40px;
    padding: 0 12px;
    font-size: 14px;
  }
  .pb-panel .pb-saved,
  .pb-panel .pb-saved label {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
  }
  .pb-panel .pb-saved select {
    max-width: none;
    min-height: 40px;
  }
  .pb[data-pb="page"] {
    padding-inline: 0.75rem;
  }
}
/* On the full-page Preview the table of contents sits below the bar too. */
.doc.has-pb {
  --pb-h: 52px;
}
.doc.has-pb .toc {
  top: calc(var(--topbar-h) + var(--pb-h));
}
@media (min-width: 1024px) {
  .doc.has-pb .toc {
    top: calc(var(--topbar-h) + var(--pb-h) + 1.5rem);
  }
}

/* Packets (ARCHITECTURE 40.7): the walk-through. A step rail beside one page at a time;
   on a phone the rail sits above the page. Colours come from the theme tokens. */
.pw {
  display: grid;
  gap: 1rem;
  padding: 0.75rem 0.75rem 4rem;
}
.pw-aside {
  min-width: 0;
}
.pw-main {
  min-width: 0;
  display: grid;
  gap: 1rem;
  align-content: start;
}
.pw-rail {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}
.pw-rail-title {
  margin: 0;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}
.pw-rail-hint {
  margin: 0.15rem 0 0.6rem;
  font-size: 0.85rem;
  color: var(--muted);
}
.pw-prog {
  height: 8px;
  border-radius: 999px;
  background: var(--surface);
  overflow: hidden;
  margin-bottom: 0.6rem;
}
.pw-prog i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--success);
}
.pw-prog i.pw-prog-5 {
  width: 5%;
}
.pw-prog i.pw-prog-10 {
  width: 10%;
}
.pw-prog i.pw-prog-15 {
  width: 15%;
}
.pw-prog i.pw-prog-20 {
  width: 20%;
}
.pw-prog i.pw-prog-25 {
  width: 25%;
}
.pw-prog i.pw-prog-30 {
  width: 30%;
}
.pw-prog i.pw-prog-35 {
  width: 35%;
}
.pw-prog i.pw-prog-40 {
  width: 40%;
}
.pw-prog i.pw-prog-45 {
  width: 45%;
}
.pw-prog i.pw-prog-50 {
  width: 50%;
}
.pw-prog i.pw-prog-55 {
  width: 55%;
}
.pw-prog i.pw-prog-60 {
  width: 60%;
}
.pw-prog i.pw-prog-65 {
  width: 65%;
}
.pw-prog i.pw-prog-70 {
  width: 70%;
}
.pw-prog i.pw-prog-75 {
  width: 75%;
}
.pw-prog i.pw-prog-80 {
  width: 80%;
}
.pw-prog i.pw-prog-85 {
  width: 85%;
}
.pw-prog i.pw-prog-90 {
  width: 90%;
}
.pw-prog i.pw-prog-95 {
  width: 95%;
}
.pw-prog i.pw-prog-100 {
  width: 100%;
}
.pw-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.15rem;
}
.pw-step a,
.pw-step-locked {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  padding: 0.55rem 0.5rem;
  border-radius: var(--radius-sm);
  color: var(--body);
  text-decoration: none;
}
.pw-step a:hover {
  background: var(--surface);
}
.pw-step.is-on a {
  background: var(--brand-soft);
}
.pw-step-locked {
  opacity: 0.75;
}
.pw-dot {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.78rem;
  font-weight: 700;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
}
.pw-dot.is-done {
  background: var(--success);
  border-color: var(--success);
  color: var(--paper);
}
.pw-step.is-on .pw-dot {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--brand-ink);
}
.pw-step-text {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
}
.pw-step-text b {
  color: var(--text);
  font-size: 0.9rem;
}
.pw-step-title {
  font-size: 0.85rem;
  color: var(--body);
  overflow-wrap: anywhere;
}
.pw-step-line {
  font-size: 0.8rem;
  color: var(--muted);
}
.pw-kind {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.pw-opt {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0 0.4rem;
}
.pw-card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
}
.pw-eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brand-text);
}
.pw-prose {
  color: var(--body);
  font-size: 1.02rem;
  line-height: 1.6;
}
.pw-prose h2,
.pw-prose h3 {
  color: var(--text);
  margin: 0 0 0.5rem;
}
.pw-prose p {
  margin: 0 0 0.75rem;
}
.pw-prose a {
  color: var(--brand-text);
}
.pw-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  margin-top: 1rem;
}
.pw-foot-center {
  justify-content: center;
}
.pw-skip-form {
  display: inline;
  margin: 0;
}
.pw-skip {
  background: none;
  border: 0;
  padding: 0.5rem 0.25rem;
  font: inherit;
  font-weight: 600;
  color: var(--brand-text);
  text-decoration: underline;
  cursor: pointer;
}
.pw-dochead {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
  flex-wrap: wrap;
}
.pw-dochead h1,
.pw-notice h1,
.pw-done h1 {
  margin: 0;
  font-size: 1.35rem;
  color: var(--text);
}
.pw-note {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}
.pw-notice p,
.pw-done p {
  margin: 0.5rem 0 0;
}
.pw-notice.is-success {
  border-left: 4px solid var(--success);
}
.pw-notice.is-stopped {
  border-left: 4px solid var(--border-strong);
}
.pw-done {
  text-align: center;
  display: grid;
  gap: 0.5rem;
  justify-items: center;
  padding-block: 2rem;
}
.pw-big-check {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.8rem;
  font-weight: 800;
  background: var(--success-soft);
  color: var(--success);
}
.pw-copies {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
  width: 100%;
  max-width: 32rem;
  text-align: left;
}
.pw-copies li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.8rem;
}
.pw-copies li > span {
  display: grid;
  min-width: 0;
}
.pw-copies b {
  color: var(--text);
  overflow-wrap: anywhere;
}
.pw-making {
  color: var(--muted);
}
/* All done's one bar for the set (ARCHITECTURE 41), as wide as the list of copies. */
.pw-progress {
  width: 100%;
  max-width: 32rem;
}
.pw-progress .pdf-progress {
  margin: 0.5rem 0 0;
}
@media (min-width: 1024px) {
  .pw {
    grid-template-columns: 17rem minmax(0, 52rem);
    gap: 2rem;
    justify-content: center;
    padding: 2rem 2rem 5rem;
  }
  .pw-aside {
    position: sticky;
    top: calc(var(--topbar-h) + 1.5rem);
    align-self: start;
  }
  .pw-card {
    padding: 1.75rem 2rem;
  }
}
@media print {
  .pw-aside,
  .pw-dochead,
  .pw-foot {
    display: none;
  }
  .pw {
    display: block;
    padding: 0;
  }
}

/* Preview as a client (ARCHITECTURE 40.17): staff's own bar above the page. */
.pw-preview-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  font-size: 0.9rem;
}
.pw-preview-nav a {
  color: var(--brand-text);
  font-weight: 600;
}
.pw-send {
  display: inline-flex;
  gap: 0.5rem;
  margin-left: auto;
}
