* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

/* html needs the same background as body — iOS/Android's elastic overscroll
   bounce (scrolling past the top/bottom) reveals area OUTSIDE body's own
   box, painted with the root element's background. Left unset, that
   defaults to white regardless of the funnel's actual theme, showing as a
   white flash "peeling" away from the top/bottom edge on every overscroll
   instead of the page staying visually glued to the color underneath it. */
html {
  background: var(--bg, #ffffff);
  /* Stops the elastic rubber-band bounce itself (not just the white behind
     it, fixed above) — without this, content visibly slides past the top/
     bottom edge before springing back on every overscroll, reading as
     "not glued" compared to apps that pin dead-still at the edge instead. */
  overscroll-behavior-y: none;
}

body {
  background: var(--bg, #ffffff);
  color: var(--text, #111827);
  font-family: var(--font, 'Inter', sans-serif);
  min-height: 100vh;
  overflow-x: hidden;
  overscroll-behavior-y: none;
}

/* Tiptap's Highlight mark, shaped like a hand-drawn marker stroke instead of
   a flat rectangle — asymmetric rounded corners instead of square ones, a
   touch of padding so the color runs slightly past the glyphs like a real
   highlighter does. box-decoration-break: clone is the part that actually
   fits it to line height: without it, a highlight that wraps across two
   lines paints as one rectangle spanning the gap between them; with it,
   each wrapped line gets its own independent shape hugging just that line.
   The color itself is untouched — it's still the sanitizer-scrubbed inline
   background-color Tiptap sets, this only changes the shape around it. */
mark {
  padding: 0.05em 0.32em 0.02em;
  border-radius: 0.45em 0.9em 0.5em 0.75em / 0.75em 0.4em 0.85em 0.5em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* Opt-in highlight style variants, set from the Tiptap toolbar's "Highlight
   style" control. Unset (no class) keeps the hand-drawn shape above — these
   only apply when a highlight explicitly picks one. */
mark.hl-flat {
  padding: 0 1px;
  border-radius: 2px;
}
mark.hl-pill {
  padding: 0.1em 0.5em;
  border-radius: 999px;
}
mark.hl-marker {
  opacity: var(--hl-opacity, 0.75);
  mix-blend-mode: var(--hl-blend, multiply);
}

#funnel-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- Steps ---------- */

/* Full-bleed: carries the step's own background edge-to-edge (see
   renderStep() in renderer.js, which sets stepEl.style.background here).
   Previously this same element also capped width at a flat 480px on every
   screen size — on anything wider than a phone, that meant a narrow 480px
   stripe of color down the middle of the page with plain white void on
   both sides, since the background was capped along with the content
   instead of filling the viewport. Width now lives on .step-content
   instead, mirroring the .lp-block / .lp-block-inner split in lp.css. */
.funnel-step {
  display: none;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
  padding: 16px 0 80px;
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
  box-sizing: border-box;
}

.funnel-step.active {
  display: flex;
}

/* Fixed 480px on every screen size, deliberately — quizzes keep one
   constant dimension regardless of viewport (an established, intentional
   product decision, unlike landing pages which do scale up). Only the
   background moved to the full-bleed .funnel-step above; the content
   column itself never widens. */
.step-content {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding-left: 0;
  padding-right: 0;
  box-sizing: border-box;
}

.funnel-step.align-center .step-content {
  flex: 1;
  justify-content: center;
}

.funnel-step.align-bottom .step-content {
  flex: 1;
  justify-content: flex-end;
}

.step-footer {
  width: 100%;
  margin-top: auto;
}

/* ---------- Sticky CTA ---------- */

/* Pinned to <body>, not any step element — see the comment in renderStep()
   in renderer.js for why it can't live inside .funnel-step. */
.funnel-sticky-cta {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  background: var(--bg, #ffffff);
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08);
  padding: 12px max(16px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  /* The bar itself stays full-bleed (matches the mobile "pinned bottom CTA"
     pattern), but the button inside it shouldn't stretch past the quiz's own
     480px content column on a wide desktop screen — on mobile the column is
     already narrower than 480px, so width:100% + this max-width behaves
     exactly as before there. */
  display: flex;
  justify-content: center;
}

.funnel-sticky-cta .funnel-btn {
  margin: 0;
  max-width: 480px;
}

/* Keeps the last bit of normal content from being hidden behind the fixed
   bar once a visitor scrolls all the way down. */
body.has-sticky-cta #funnel-container {
  padding-bottom: 84px;
}

/* ---------- Resume progress banner ---------- */

.funnel-resume-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 70;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--bg, #ffffff);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  font-size: 13px;
}

.funnel-resume-text {
  color: var(--theme-soft, #374151);
}

.funnel-resume-actions {
  display: flex;
  gap: 8px;
}

.funnel-resume-btn {
  border: none;
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.funnel-resume-continue {
  background: var(--primary);
  color: #ffffff;
}

.funnel-resume-restart {
  background: transparent;
  color: var(--theme-muted, #6b7280);
}

@media (max-width: 480px) {
  .funnel-resume-banner {
    justify-content: flex-start;
    text-align: left;
  }
}

/* ---------- Scratch to reveal ---------- */

.scratch-card {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
}

/* ---------- Transitions ---------- */

.funnel-step.slide-enter {
  animation: slideInRight 0.3s ease forwards;
}
.funnel-step.slide-enter-back {
  animation: slideInLeft 0.3s ease forwards;
}
.funnel-step.fade-enter {
  animation: fadeIn 0.3s ease forwards;
}

@keyframes slideInRight {
  from { transform: translateX(60px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes slideInLeft {
  from { transform: translateX(-60px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ---------- Blocks ---------- */

.funnel-block {
  width: 100%;
  box-sizing: border-box;
  max-width: 100%;
  overflow: hidden;
}

.block-headline {
  line-height: 1.3;
}

.block-text {
  line-height: 1.6;
}

.question-text {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
}

.question-description {
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--text);
  opacity: 0.7;
  margin: 4px 0 12px;
}

.selection-counter {
  font-size: 12px;
  color: var(--theme-muted, #6b7280);
}

/* ---------- Choice options ---------- */

.choice-option {
  display: block;
  width: 100%;
  margin: 0 0 10px;
  padding: 14px 18px;
  border: 2px solid var(--surface-border, #e5e7eb);
  border-radius: 50px;
  background: var(--choice-bg, var(--surface, white));
  font-size: 16px;
  color: var(--choice-text, var(--text));
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: var(--font);
  -webkit-appearance: none;
}

.choice-option:hover {
  border-color: var(--primary);
  background: var(--choice-hover-bg, var(--surface-hover, #f0f9ff));
}

.choice-option.selected {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
  transform: scale(0.98);
}

.choice-option.card-style {
  border-radius: 12px;
  padding: 16px 18px;
}

.choice-option.list-style {
  border-radius: 0;
  border: none;
  border-bottom: 1px solid var(--surface-border, #f1f5f9);
  padding: 14px 0;
  background: transparent;
}

.choice-option.list-style.selected {
  background: transparent;
  color: var(--primary);
  font-weight: 600;
  transform: none;
}

.multi-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin: 0 0 8px;
  padding: 14px 16px;
  border: 2px solid var(--multi-border, var(--surface-border, #e5e7eb));
  border-radius: var(--multi-radius, 10px);
  background: var(--multi-bg, var(--surface, white));
  color: var(--multi-text, var(--text));
  cursor: pointer;
  transition: all 0.15s;
}

.multi-option:hover {
  background: var(--multi-hover-bg, var(--surface-hover, #f9fafb));
}

.multi-option.selected {
  border-color: var(--primary);
  background: var(--surface-selected, #eff6ff);
}

.multi-option.selected:hover {
  background: var(--surface-selected, #eff6ff);
}

.multi-checkbox {
  width: 22px;
  height: 22px;
  border: 2px solid var(--surface-border, #d1d5db);
  border-radius: var(--multi-check-radius, 5px);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  background: var(--surface, white);
  font-size: 13px;
}

.multi-option.selected .multi-checkbox {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* Multi Choice's "Tag Pills" option style — mirrors .choice-option's pill
   look (full-primary-color fill when selected) rather than .multi-option's
   lighter tint, since a pill is meant to read as a chip, not a row. */
.multi-tags-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 8px;
}

.multi-tag {
  display: inline-flex;
  align-items: center;
  padding: 10px 18px;
  border: 2px solid var(--multi-border, var(--surface-border, #e5e7eb));
  border-radius: var(--multi-radius, 50px);
  background: var(--multi-bg, var(--surface, white));
  color: var(--multi-text, var(--text));
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: var(--font);
  -webkit-appearance: none;
}

.multi-tag:hover {
  border-color: var(--primary);
  background: var(--multi-hover-bg, var(--surface-hover, #f9fafb));
}

.multi-tag.selected {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
}

/* ---------- Image choice ---------- */

.image-choice-grid {
  display: grid;
  gap: 10px;
}

.image-choice-option {
  border: 2px solid var(--surface-border, #e5e7eb);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  text-align: center;
  background: var(--surface, white);
  transition: all 0.15s;
}

.image-choice-option.selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary);
}

.image-choice-option img {
  width: 100%;
  object-fit: cover;
  display: block;
}

.image-choice-label {
  padding: 8px;
  font-size: 13px;
  font-weight: 500;
}

/* ---------- Swipe yes/no, Likert, NPS ---------- */

.swipe-yesno-btn {
  flex: 1;
  padding: 18px;
  border: 2px solid var(--surface-border, #e5e7eb);
  border-radius: 14px;
  background: var(--surface, white);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: var(--font);
}

.swipe-yesno-btn.no {
  border-color: #fecaca;
  color: #dc2626;
}

.swipe-yesno-btn.yes {
  border-color: #bbf7d0;
  color: #16a34a;
}

.swipe-yesno-btn.selected.no {
  background: #fef2f2;
}

.swipe-yesno-btn.selected.yes {
  background: #f0fdf4;
}

.swipe-yesno-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.likert-star {
  font-size: 32px;
  cursor: pointer;
  opacity: 0.4;
  transition: opacity 0.15s, transform 0.1s;
}

.likert-star.selected {
  opacity: 1;
  transform: scale(1.1);
}

.likert-readout {
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  margin: 10px 0 0;
  min-height: 16px;
}

.nps-option {
  min-width: 32px;
  height: 32px;
  padding: 0 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--surface-border, #e5e7eb);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s;
}

.nps-option.selected {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
}

.nps-slider-wrap {
  padding: 4px 4px 0;
}

.nps-slider-readout {
  text-align: center;
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 10px;
}

.nps-slider {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--surface-border, #e5e7eb);
  outline: none;
  cursor: pointer;
  accent-color: var(--primary);
  -webkit-appearance: none;
  appearance: none;
}

.nps-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: 3px solid white;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.nps-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: 3px solid white;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

/* Custom dropdown_select widget — a native <select>'s <option> elements
   cannot render an icon in any browser, so options with an iconId need a
   real trigger+listbox instead. */
.dropdown-field {
  position: relative;
}

.dropdown-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  text-align: left;
}

.dropdown-trigger-label {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dropdown-trigger-caret {
  flex-shrink: 0;
  color: var(--theme-muted, #9ca3af);
  font-size: 13px;
}

.dropdown-option-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.dropdown-list {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 20;
  background: var(--surface, white);
  border: 2px solid var(--surface-border, #e5e7eb);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  max-height: 260px;
  overflow-y: auto;
  padding: 6px;
}

/* .funnel-block clips overflow by default (below) to contain images/video/
   backgrounds. The dropdown's open list is an absolutely-positioned child
   that renders below the block's own box, so it gets clipped to invisible
   unless this specific wrapper opts back into overflow: visible. */
.funnel-block:has(.dropdown-field) {
  overflow: visible;
}

.dropdown-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: 8px;
  background: none;
  color: var(--text);
  font-size: 15px;
  font-family: var(--font);
  text-align: left;
  cursor: pointer;
}

.dropdown-option:hover {
  background: var(--dropdown-hover-bg, #f3f4f6);
}

/* display:flex above would otherwise override the hidden attribute the
   search filter sets on non-matching rows. */
.dropdown-option[hidden],
.dropdown-no-match[hidden] {
  display: none;
}

.dropdown-trigger-label.is-placeholder {
  color: var(--theme-muted, #9ca3af);
}

/* Search box for long option lists (e.g. all 50 states). Sticky so it stays
   put while the list scrolls under it. */
.dropdown-search {
  position: sticky;
  top: -6px;
  z-index: 1;
  display: block;
  width: calc(100% + 12px);
  box-sizing: border-box;
  margin: -6px -6px 6px;
  padding: 10px 12px;
  border: none;
  border-bottom: 1px solid var(--surface-border, #e5e7eb);
  border-radius: 10px 10px 0 0;
  background: var(--surface, white);
  color: var(--text);
  font-size: 16px; /* 16px stops iOS Safari zooming the page on focus */
  font-family: var(--font);
  outline: none;
}

.dropdown-no-match {
  padding: 10px 12px;
  color: var(--theme-muted, #9ca3af);
  font-size: 14px;
}

/* Multi-select checkbox mark */
.dropdown-check {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border: 2px solid var(--surface-border, #d1d5db);
  border-radius: 5px;
  box-sizing: border-box;
  position: relative;
}

.dropdown-option.selected .dropdown-check {
  background: var(--primary);
  border-color: var(--primary);
}

.dropdown-option.selected .dropdown-check::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 0;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* ---------- File upload block ---------- */

.file-upload-dropzone {
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  padding: 28px 16px;
  text-align: center;
  cursor: pointer;
  background: var(--surface-alt, #f9fafb);
  transition: border-color 0.15s, background 0.15s;
}

.file-upload-dropzone:hover {
  border-color: var(--primary);
  background: var(--surface-muted, #f3f4f6);
}

.file-upload-icon {
  font-size: 26px;
  margin-bottom: 6px;
}

.file-upload-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  overflow-wrap: break-word;
}

.file-upload-meta {
  font-size: 12px;
  color: var(--theme-muted, #6b7280);
  margin-top: 4px;
}

.file-upload-dropzone.uploading {
  border-color: var(--primary);
  cursor: wait;
  opacity: 0.75;
}

.file-upload-dropzone.uploaded {
  border-style: solid;
  border-color: #16a34a;
  background: #f0fdf4;
}

.file-upload-dropzone.error {
  border-color: #ef4444;
  background: #fef2f2;
}

.file-upload-dropzone.error .file-upload-meta {
  color: #dc2626;
}

/* ---------- Video/audio question blocks ---------- */

.recorder-media-area {
  position: relative;
}

.recorder-placeholder {
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  padding: 32px 16px;
  text-align: center;
  background: var(--surface-alt, #f9fafb);
  transition: border-color 0.15s, background 0.15s;
}

.recorder-preview {
  width: 100%;
  border-radius: 12px;
  background: #000;
  display: none;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.recorder-success-badge {
  display: none;
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #16a34a;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.recorder-success-badge svg {
  width: 15px;
  height: 15px;
}

.recorder-success-badge.visible {
  display: flex;
  animation: recorder-badge-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes recorder-badge-pop {
  0% { transform: scale(0); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.recorder-icon {
  font-size: 26px;
  margin-bottom: 6px;
}

.recorder-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.recorder-meta {
  font-size: 12px;
  color: var(--theme-muted, #6b7280);
  margin-top: 4px;
}

.recorder-controls {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.recorder-btn {
  flex: 1;
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: var(--surface, white);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.recorder-btn:hover {
  border-color: var(--record-color, var(--primary));
  background: var(--surface-muted, #f3f4f6);
}

.recorder-btn.recorder-btn-record {
  border-color: var(--record-color, var(--primary));
  background: var(--record-color, var(--primary));
  color: white;
}

.recorder-status {
  margin-top: 8px;
  font-size: 13px;
  color: var(--theme-muted, #6b7280);
}

/* ---------- Payment block ---------- */

.payment-block-btn:hover {
  opacity: 0.92;
}

/* ---------- Inputs ---------- */

.funnel-input-wrap {
  width: 100%;
}

.funnel-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 6px;
}

.funnel-input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--surface-border, #e5e7eb);
  border-radius: 12px;
  font-size: 16px;
  color: var(--text);
  background: var(--surface, white);
  font-family: var(--font);
  transition: border-color 0.15s;
  -webkit-appearance: none;
}

.funnel-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.funnel-input.error {
  border-color: #ef4444;
}

textarea.funnel-input {
  resize: vertical;
}

.field-error {
  font-size: 12px;
  color: #ef4444;
  margin-top: 4px;
  display: none;
}

.field-error.visible {
  display: block;
}

/* ---------- intl-tel-input ---------- */

.iti {
  width: 100%;
  display: block;
}

.iti__flag-container {
  z-index: 10;
}

.iti__tel-input,
.iti input.funnel-input {
  padding-left: 90px !important;
  width: 100% !important;
  box-sizing: border-box !important;
  font-size: 16px;
  padding-top: 14px;
  padding-bottom: 14px;
  border: 2px solid var(--surface-border, #e5e7eb);
  border-radius: 12px;
  font-family: var(--font);
}

.iti--separate-dial-code .iti__selected-flag {
  background: transparent;
  border-right: 1px solid var(--surface-border, #e5e7eb);
  padding: 0 8px 0 12px;
}

.iti input.funnel-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* ---------- Buttons ---------- */

.funnel-btn {
  display: block;
  width: 100%;
  margin: 8px 0;
  padding: 16px 24px;
  /* --btn-bg (not a literal background) so :hover/:active below can win
     the cascade — an inline background style would always beat them
     regardless of pseudo-class. See case 'button' in renderer.js. */
  background: var(--btn-bg, var(--primary));
  color: white;
  border: none;
  border-radius: var(--btn-radius, 50px); /* theme Button Roundness */
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  transition: background 0.15s, opacity 0.15s, transform 0.1s;
  -webkit-appearance: none;
}

.funnel-btn:hover {
  background: var(--btn-hover-bg, var(--btn-bg, var(--primary)));
}

.funnel-btn:active {
  background: var(--btn-active-bg, var(--btn-hover-bg, var(--btn-bg, var(--primary))));
  transform: scale(0.97);
  opacity: 0.9;
}

.funnel-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.funnel-btn.small {
  font-size: 14px;
  padding: 12px 20px;
}

.funnel-btn.large {
  font-size: 19px;
  padding: 20px 32px;
}

/* ---------- Progress ---------- */

.progress-wrap {
  padding: 8px 20px;
}

.progress-bg {
  background: var(--surface-border, #e5e7eb);
  border-radius: 99px;
  overflow: hidden;
}

.progress-fill {
  background: var(--primary);
  border-radius: 99px;
  transition: width 0.4s ease;
}

/* ---------- Back button ---------- */

/* Per-block wrapper: keep padding inside the box so per-block backgrounds and
   min-height render predictably. */
.funnel-block {
  box-sizing: border-box;
  background-clip: padding-box;
}

/* Fix 6: form controls sit on a clean white card when a block background is on. */
.form-control-surface {
  background: var(--surface, white);
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* Feature 3: "Made with YES Funnel" badge on entry-tier published pages. */
.yf-badge {
  position: fixed;
  bottom: 12px;
  right: 12px;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  color: rgb(100, 100, 100);
  background: white;
  border: 1px solid rgb(230, 230, 230);
  padding: 5px 10px;
  border-radius: 6px;
  text-decoration: none;
  z-index: 999;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

/* Fix 8: the visitor "back" control is a proper icon button, top-left of the
   step content, no bare arrow characters mashed against a label.
   .quiz-restart-btn sits next to it — the explicit "start over" escape
   hatch (see restartQuiz() in renderer.js), same size/style so neither
   reads as more important than the other. */
.quiz-step-controls {
  display: flex;
  gap: 8px;
  align-self: flex-start;
  margin-bottom: 4px;
}

.quiz-back-btn,
.quiz-restart-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid rgb(230, 230, 230);
  background: white;
  color: rgb(100, 100, 100);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.quiz-back-btn:hover,
.quiz-restart-btn:hover {
  background: rgb(250, 250, 250);
  border-color: rgb(200, 200, 200);
  color: rgb(25, 25, 25);
}

/* ---------- Thank you ---------- */

.thankyou-wrap {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.thankyou-icon {
  width: 72px;
  height: 72px;
  background: #dcfce7;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin-bottom: 20px;
}

/* ---------- Confetti ---------- */

.confetti-piece {
  position: fixed;
  top: -20px;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  animation: confettiFall linear forwards;
  pointer-events: none;
  z-index: 9999;
}

@keyframes confettiFall {
  0% {
    transform: translateY(-20px) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

/* ---------- Video ---------- */

.video-wrap-9-16 {
  position: relative;
  padding-top: 177.78%;
  border-radius: 12px;
  overflow: hidden;
}

.video-wrap-16-9 {
  position: relative;
  padding-top: 56.25%;
  border-radius: 12px;
  overflow: hidden;
}

.video-wrap-9-16 iframe,
.video-wrap-16-9 iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* ---------- Calendar ---------- */

.calendar-wrap {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--surface-border, #e5e7eb);
}

.calendar-iframe {
  width: 100%;
  border: none;
  display: block;
}

/* ---------- Score Card ---------- */
/* Mirrors lp.css's identical .lp-score-* rules (the ring markup was reused
   from the landing page's score block) — quiz pages load this file, not
   lp.css, so without these the ring rendered with no sizing at all: a huge
   unconstrained circle with the number/label knocked out below it instead
   of centered inside, since .lp-score-ring had no `position: relative` or
   fixed width/height to anchor the absolutely-positioned label against. */

.lp-score-ring {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto 16px;
}

.lp-score-ring svg {
  transform: rotate(-90deg);
  width: 100%;
  height: 100%;
}

.lp-score-ring .ring-fill {
  transition: stroke-dashoffset 1.2s ease;
}

.lp-score-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.lp-score-number {
  font-size: 28px;
  font-weight: 800;
}

.lp-score-sub {
  font-size: 13px;
  color: var(--theme-muted, #6b7280);
  display: block;
}

.lp-grade-badge {
  display: inline-block;
  padding: 4px 16px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
}

/* ---------- Countdown ---------- */

.countdown-wrap {
  text-align: center;
}

.countdown-digits {
  font-size: 56px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  line-height: 1;
}

/* "Dd HH:MM:SS" is much wider than the default "MM:SS" — shown once the
   countdown spans a day or more (see formatCountdown in renderer.js) so it
   never overflows the phone-width canvas. */
.countdown-digits.long-format {
  font-size: 32px;
  letter-spacing: 0.02em;
}

.countdown-label {
  font-size: 13px;
  color: var(--theme-muted, #6b7280);
  margin-bottom: 10px;
}

/* ---------- Error shake ---------- */

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

.shake {
  animation: shake 0.4s ease;
}

/* ---------- Session 11B: consent, trust icons, rich text ---------- */

.consent-wrap.error {
  outline: 1px solid #ef4444;
  border-radius: 6px;
}

@keyframes trustPulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.9;
  }
}

.rt-highlight {
  background: var(--highlight, #fbbf24);
  color: inherit;
  border-radius: 3px;
  padding: 1px 3px;
}

/* Fix 7: highlight color also drives native checkboxes/radios and any link a
   visitor sees inside a text/headline block. Primary Color already covers
   buttons, the progress bar, and selected choice options. */
input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--highlight, #fbbf24);
}

.block-text a,
.block-headline a {
  color: var(--highlight, #fbbf24);
}

/* ---------- Submit loading ---------- */

.submit-loading {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.submit-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--surface-border, #e5e7eb);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.submit-loading p {
  margin-top: 16px;
  font-size: 15px;
  color: var(--theme-muted, #6b7280);
}

/* ---------- Mobile polish ---------- */

@media (max-width: 480px) {
  .funnel-step {
    padding-bottom: 100px;
  }

  .funnel-btn {
    min-height: 52px;
  }

  .choice-option {
    min-height: 52px;
    display: flex;
    align-items: center;
  }

  .countdown-digits {
    font-size: 44px;
  }

  .countdown-digits.long-format {
    font-size: 24px;
  }

  /* overflow: hidden (both axes), not just overflow-x — the CSS overflow
     spec force-changes overflow-y to a computed "auto" the moment
     overflow-x is non-visible and overflow-y is "visible" (even set
     explicitly), so overflow-x alone was silently making every block
     individually vertically-scrollable. Any block a hair taller than its
     own sub-pixel-rounded height (a wrapped multi-line headline, most
     often) then shows a native scrollbar as a stray grey bar down its
     right edge on mobile, even though only horizontal containment was
     ever intended here. Verified live: pairing with overflow-y: hidden
     is what actually resolves to "hidden", not overflow-y: visible.

     Scoped to headline/text specifically (not ".funnel-block > *") —
     the original bug never needed the blanket version, and applying
     overflow: hidden to every block's direct child clips ANY block whose
     content naturally exceeds its own box, which is normal and expected
     for a multi-select question with many options, not just "a hair"
     off on a wrapped headline. .funnel-block itself already gets
     overflow: hidden unconditionally further up this file. */
  .funnel-block > .block-headline,
  .funnel-block > .block-text {
    max-width: 100%;
    overflow: hidden;
  }

  .choice-option,
  .multi-option,
  .funnel-btn,
  .funnel-input-wrap,
  .image-choice-grid,
  .video-wrap-9-16,
  .video-wrap-16-9,
  .calendar-wrap,
  .progress-wrap,
  .countdown-wrap,
  .thankyou-wrap {
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .funnel-input {
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .image-choice-grid {
    padding: 8px 0 !important;
  }
}

/* ---------- Fix 6: customizable header ---------- */

.funnel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  gap: 16px;
  border-bottom: 1px solid rgb(230, 230, 230);
}

.funnel-header.sticky {
  position: sticky;
  top: 0;
  z-index: 900;
}

.fh-logo {
  display: block;
  width: auto;
  flex-shrink: 0;
}

.fh-nav {
  display: flex;
  gap: 16px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  flex: 1;
  justify-content: center;
}

.fh-nav a {
  color: inherit;
  text-decoration: none;
}

.fh-nav a:hover {
  text-decoration: underline;
}

.fh-nav a.active {
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.fh-btn {
  flex-shrink: 0;
  background: var(--highlight, #2563eb);
  color: #ffffff;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 6px;
  text-decoration: none;
  white-space: nowrap;
}

.fh-hamburger {
  display: none;
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: inherit;
}

@media (max-width: 480px) {
  .fh-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: inherit;
    padding: 12px 20px;
    gap: 10px;
    border-bottom: 1px solid rgb(230, 230, 230);
  }

  .fh-nav.open {
    display: flex;
  }

  .funnel-header {
    position: relative;
    flex-wrap: wrap;
  }

  .fh-hamburger {
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* Fix 9: text line replacing the floating badge inside an embed. */
.yf-embed-badge-line {
  text-align: center;
  padding: 12px 16px 20px;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
}

.yf-embed-badge-line a {
  color: rgb(150, 150, 150);
  text-decoration: none;
}

.yf-embed-badge-line a:hover {
  text-decoration: underline;
}

/* Text block set to "Quote" (Text Type). */
.block-quote {
  border-left: 4px solid var(--primary);
  padding: 4px 0 4px 16px;
  font-style: italic;
}

/* Lists, quotes and indents from the text editor toolbar. The global reset
   zeroes padding, which would hide list bullets without these. */
.block-text ul, .block-text ol, .block-headline ul, .block-headline ol, .score-card-message ul, .score-card-message ol {
  padding-left: 1.4em;
  margin: 4px 0;
}
.block-text li, .block-headline li, .score-card-message li {
  margin: 2px 0;
}
.block-text blockquote, .block-headline blockquote, .score-card-message blockquote {
  border-left: 4px solid var(--primary);
  padding: 2px 0 2px 14px;
  margin: 6px 0;
  font-style: italic;
}

/* Score card message lists stay readable when the message is centered. */
.score-card-message ul,
.score-card-message ol {
  display: inline-block;
  text-align: left;
}
.score-card-message p + p {
  margin-top: 8px;
}

/* "Appear After" block reveal (block-reveal.js). */
@keyframes yfRevealFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes yfRevealSlide { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.yf-reveal-fade { animation: yfRevealFade 0.6s ease both; }
.yf-reveal-slide { animation: yfRevealSlide 0.6s ease both; }
@media (prefers-reduced-motion: reduce) {
  .yf-reveal-fade, .yf-reveal-slide { animation: none; }
}
