/* Path layout - structure only.
 * Spacing / color / type come from Design (inline). Do not add presentation here.
 */

.survey-page,
.survey-main {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  /* Path system typeface - Design Font overrides per seat via inline style. */
  font-family: Poppins, system-ui, -apple-system, sans-serif;
}

.survey-main {
  width: 100%;
}

.survey-page:has(.survey-page-blocks--sections),
.survey-main:has(.survey-page-blocks--sections) {
  align-items: stretch;
}

.survey-page:not(:has(.survey-page-blocks--sections)),
.survey-main:not(:has(.survey-page-blocks--sections)) {
  align-items: center;
}

.survey-card {
  width: 100%;
  max-width: none;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
}

.survey-step:has(.survey-page-blocks--sections),
.survey-step:has(.bp-el) {
  padding: 0;
  /* Design owns type on seats - don't scale children from legacy .survey-step 1.08rem. */
  font-size: inherit;
}

html[data-path-ui] .survey-step {
  font-size: inherit;
}

.survey-step.active:has(.survey-page-blocks--sections) {
  min-height: 0;
}

.bp-survey-form:has(.survey-page-blocks--sections),
#survey-steps:has(.survey-page-blocks--sections),
.survey-step:has(.survey-page-blocks--sections) {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}

.survey-page-blocks--sections {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  width: 100%;
  box-sizing: border-box;
}

.bp-section,
.bp-row,
.bp-col {
  box-sizing: border-box;
  /* auto - not 100%: side margins from Design must inset, not overflow */
  width: auto;
  max-width: 100%;
  min-width: 0;
}

.bp-container {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 0;
  align-items: stretch;
  /* auto + stretch = fill available space (margins inset). width:100% would overflow with side margins. */
  width: auto;
  height: auto;
  max-width: 100%;
  /* Do not set max-height:100% here - it collapses tall seats (calendar) when the parent height is content-sized. */
  align-self: stretch;
  /* Hit target floor so empty / zeroed seats stay selectable in the visual editor. */
  min-width: 20px;
  min-height: 20px;
}

.bp-el {
  box-sizing: border-box;
  width: auto;
  height: auto;
  max-width: 100%;
  /* Design may set max-height inline; avoid a CSS 100% floor that collapses calendars/media. */
  align-self: stretch;
  /* Hit target floor so empty / zeroed seats stay selectable in the visual editor. */
  min-width: 20px;
  min-height: 20px;
  /* Default typeface when Design Font is unset; inline font-family wins. */
  font-family: Poppins, system-ui, -apple-system, sans-serif;
}

.bp-container.is-empty {
  min-height: 20px;
}

.bp-container--stack {
  flex-direction: column;
}

.bp-container--row {
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: stretch;
}

.bp-container--row > .bp-el:not([data-bp-sized="1"]):not([data-bp-align]) {
  width: auto;
  flex: 1 1 0;
  min-width: 20px;
}

.bp-container--row > .bp-container:not([data-bp-sized="1"]):not([data-bp-align]),
.bp-container--row > .bp-section:not([data-bp-sized="1"]):not([data-bp-align]) {
  width: auto;
  flex: 1 1 0;
  min-width: 20px;
}

.bp-container--row > [data-bp-sized="1"],
.bp-container--row > [data-bp-align] {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
}

.bp-section-inner {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}

.bp-section--narrow > .bp-section-inner,
.bp-section[data-bp-width="narrow"] > .bp-section-inner {
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.bp-row {
  display: grid;
  gap: 0;
  align-items: start;
}

.bp-row--0 {
  display: flex;
  align-items: center;
  justify-content: center;
}

.bp-row--1 {
  grid-template-columns: 1fr;
}

.bp-row--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.bp-row--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.bp-col {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}

.bp-el--code,
.bp-el[data-bp-el="html"],
.bp-el[data-bp-el="javascript"] {
  width: auto;
  height: auto;
  max-width: 100%;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.bp-el--hidden-marker {
  display: none !important;
}

/* Incoming-call seat: hidden on live paths; stub visible in the path editor. */
.bp-el[data-bp-el="incoming_call"] {
  display: none !important;
}
.pb-layout-edit .bp-el[data-bp-el="incoming_call"],
.pb-palette-tile-preview .bp-el[data-bp-el="incoming_call"] {
  display: block !important;
}
.bp-incoming-call-stub {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.85rem 1rem;
  border: 1px dashed color-mix(in srgb, var(--c-border, #d1d5db) 80%, transparent);
  border-radius: 0.75rem;
  background: color-mix(in srgb, var(--c-surface, #fff) 92%, var(--c-primary, #5050ff) 8%);
  color: var(--c-text, #111827);
  font-size: 0.875rem;
  line-height: 1.35;
}
.bp-incoming-call-stub-title {
  font-weight: 600;
}
.bp-incoming-call-stub-meta {
  color: var(--c-text-muted, #6b7280);
  font-size: 0.8125rem;
}

.bp-el[data-bp-el="play_audio"] {
  display: none !important;
}
.pb-layout-edit .bp-el[data-bp-el="play_audio"],
.pb-palette-tile-preview .bp-el[data-bp-el="play_audio"] {
  display: block !important;
}
.bp-play-audio-stub {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.85rem 1rem;
  border: 1px dashed color-mix(in srgb, var(--c-border, #d1d5db) 80%, transparent);
  border-radius: 0.75rem;
  background: color-mix(in srgb, var(--c-surface, #fff) 92%, var(--c-primary, #5050ff) 8%);
  color: var(--c-text, #111827);
  font-size: 0.875rem;
  line-height: 1.35;
}
.bp-play-audio-stub-title {
  font-weight: 600;
}
.bp-play-audio-stub-meta {
  color: var(--c-text-muted, #6b7280);
  font-size: 0.8125rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bp-el.is-preview-hidden {
  filter: grayscale(1);
  opacity: .45;
  pointer-events: none;
  user-select: none;
}

.survey-page.is-preview-page-hidden {
  filter: grayscale(1);
  opacity: .45;
}

/* Authored copy only - exclude .pb-el-edit-body (editor WYSIWYG wrap).
 * All text-like seats inherit Design / RTE type (never UA h1 bold or survey theme). */
.bp-el[data-bp-el="text"] > :is(p, div, h1, h2, h3, h4, h5, h6, ul, ol, blockquote):not(.pb-el-edit-body),
.bp-el[data-bp-el="text"] > .pb-el-edit-body > :is(p, div, h1, h2, h3, h4, h5, h6, ul, ol, blockquote),
.bp-el[data-bp-el="heading"] > :is(p, div, h1, h2, h3, h4, h5, h6):not(.pb-el-edit-body),
.bp-el[data-bp-el="heading"] > .pb-el-edit-body > :is(p, div, h1, h2, h3, h4, h5, h6),
.bp-el[data-bp-el="subheading"] > :is(p, div, h1, h2, h3, h4, h5, h6):not(.pb-el-edit-body),
.bp-el[data-bp-el="subheading"] > .pb-el-edit-body > :is(p, div, h1, h2, h3, h4, h5, h6),
.bp-el[data-bp-el="body"] > :is(p, div):not(.pb-el-edit-body),
.bp-el[data-bp-el="body"] > .pb-el-edit-body > :is(p, div),
.bp-el[data-bp-el="badge"] > :is(p, div, span):not(.pb-el-edit-body),
.bp-el[data-bp-el="badge"] > .pb-el-edit-body > :is(p, div, span),
.bp-el[data-bp-el="disclaimer"] > :is(p, div):not(.pb-el-edit-body),
.bp-el[data-bp-el="disclaimer"] > .pb-el-edit-body > :is(p, div),
.bp-el[data-bp-el="information"] > :is(p, div):not(.pb-el-edit-body),
.bp-el[data-bp-el="information"] > .pb-el-edit-body > :is(p, div),
.bp-el[data-bp-el="info"] > :is(p, div):not(.pb-el-edit-body),
.bp-el[data-bp-el="info"] > .pb-el-edit-body > :is(p, div) {
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  /* Kill UA margins - spacing belongs on the seat via Design padding. */
  margin: 0;
  padding: 0;
  /* Design / RTE own type - never inherit forced survey theme. */
  font-size: inherit;
  font-weight: inherit;
  font-family: inherit;
  line-height: inherit;
  color: inherit;
}

/*
 * Theme / legacy class names inside seats (preview + live). Editor live-canvas
 * already forced these to inherit; without this, Preview keeps survey.css sizes
 * (e.g. .agent-page-title clamp, .survey-step-title 30px) over Design.
 */
.bp-el :is(
  .survey-step-supertitle,
  .survey-step-title,
  .survey-step-subtitle,
  .survey-page-heading,
  .survey-page-subheading,
  .survey-page-body,
  .survey-page-disclaimer,
  .survey-page-badge,
  .agent-page-title,
  .agent-page-subtitle,
  .text-muted,
  .form-question
) {
  font-size: inherit;
  font-weight: inherit;
  font-family: inherit;
  line-height: inherit;
  color: inherit;
}

/* Position L/C/R shrink-wraps the seat - children must not force width:100%
 * or the host cannot shrink (editor already had this; keep live in sync). */
.bp-el[data-bp-align="left"] > :is(p, div, h1, h2, h3, h4, h5, h6, ul, ol, blockquote):not(.bp-el-code-console):not(.pb-el-edit-body),
.bp-el[data-bp-align="center"] > :is(p, div, h1, h2, h3, h4, h5, h6, ul, ol, blockquote):not(.bp-el-code-console):not(.pb-el-edit-body),
.bp-el[data-bp-align="right"] > :is(p, div, h1, h2, h3, h4, h5, h6, ul, ol, blockquote):not(.bp-el-code-console):not(.pb-el-edit-body),
.bp-el[data-bp-align="left"] > .pb-el-edit-body > :is(p, div, h1, h2, h3, h4, h5, h6, ul, ol, blockquote),
.bp-el[data-bp-align="center"] > .pb-el-edit-body > :is(p, div, h1, h2, h3, h4, h5, h6, ul, ol, blockquote),
.bp-el[data-bp-align="right"] > .pb-el-edit-body > :is(p, div, h1, h2, h3, h4, h5, h6, ul, ol, blockquote) {
  width: auto;
  max-width: 100%;
}

/* Global survey.css resets list markers - restore them inside rich-text seats. */
.bp-el :is(ul, ol) {
  list-style: revert;
  padding-left: 1.25em;
}
.bp-el ul {
  list-style-type: disc;
}
.bp-el ol {
  list-style-type: decimal;
}

.bp-el[data-bp-el="question"] > .form-group {
  width: 100%;
}

/* Default radius matches form chrome; Design Corners override via inline longhands. */
.bp-el[data-bp-el="question"] {
  border-radius: var(--radius);
}

/* Pass seat corners through field wrappers — inputs sit inside .form-group, so a
 * bare `inherit` on .form-input would pick up 0 from the wrapper, not the seat. */
.bp-el[data-bp-el="question"] .form-group,
.bp-el[data-bp-el="question"] .survey-address-fields,
.bp-el[data-bp-el="question"] .survey-other-wrap,
.bp-el[data-bp-el="question"] .form-input,
.bp-el[data-bp-el="question"] .form-textarea,
.bp-el[data-bp-el="question"] .form-select,
.bp-el[data-bp-el="question"] .survey-other-input {
  border-radius: inherit;
  border-top-left-radius: inherit;
  border-top-right-radius: inherit;
  border-bottom-right-radius: inherit;
  border-bottom-left-radius: inherit;
}

.bp-el[data-bp-el="button"] {
  display: flex;
  align-items: center;
  justify-content: center;
  /* Width/Height come from Design (inline). Default shrink-wrap is via
   * Position align (fit-content) or flex/grid auto sizing - do not pin
   * width/height here or Design values are ignored. */
  max-height: none;
  /* Fill / chrome live on the host so Design (inline styles) owns them.
   * Fallback is path blue - not dashboard agency --c-primary. */
  background: var(--bp-btn-fill, #5050ff);
  color: #fff;
  overflow: hidden;
  box-sizing: border-box;
}

.bp-el[data-bp-el="button"][data-bp-action="continue"] {
  max-width: 100%;
}

.bp-el[data-bp-el="button"] > .btn,
.bp-el[data-bp-el="button"] > a.btn,
.bp-el[data-bp-el="button"] > button,
.bp-el[data-bp-el="button"] > .survey-page-cta,
.bp-el[data-bp-el="button"] > a.survey-page-cta {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  min-height: 0;
  border: 0;
  border-radius: inherit;
  box-shadow: none;
  background: transparent;
  color: inherit;
  /* Beat .btn / .btn-sm / .survey-page-cta theme sizes (Preview + live). */
  font: inherit;
  font-size: inherit;
  font-weight: inherit;
  font-family: inherit;
  line-height: inherit;
  box-sizing: border-box;
}

/* Design Color → booking widget accents; seat fills host (margins inset).
 * Fallback is path blue - not dashboard / page agency --c-primary. */
.bp-el[data-bp-el="booking"] {
  --c-primary: var(--bp-btn-fill, #5050ff);
  --c-primary-hover: color-mix(in srgb, var(--c-primary) 85%, #000);
  --c-primary-light: color-mix(in srgb, var(--c-primary) 14%, #fff);
  box-sizing: border-box;
  /* Calendars must grow with widget content - beat Design max-height:100% inline. */
  max-height: none !important;
  height: auto !important;
  overflow: visible;
  align-self: stretch;
  width: auto;
  max-width: 100%;
}

/* Calendar chrome fills the Design seat (not the legacy ~30rem widget cap). */
.bp-el[data-bp-el="booking"] .survey-page-booking,
.bp-el[data-bp-el="booking"] .survey-page-booking-widget,
.bp-el[data-bp-el="booking"] [data-booking-widget],
.bp-el[data-bp-el="booking"] #ty-booking-widget {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 0;
  box-sizing: border-box;
}

/* Align = place the selected seat in its parent (not text-align).
 * Shrink-wrap aligned seats so left/center/right are visible when Width is auto
 * and Max Width is still the soft default (100%). An explicit Max Width cap
 * (e.g. 500px) is paired with inline width:100% in the editor so the seat fills
 * up to that cap while staying aligned - Design width still wins via inline
 * (and data-bp-fill-width when Width is 100% with no Position). */
.bp-el[data-bp-align="left"]:not([data-bp-sized="1"]),
.bp-col[data-bp-align="left"]:not([data-bp-sized="1"]),
.bp-row[data-bp-align="left"]:not([data-bp-sized="1"]),
.bp-container[data-bp-align="left"]:not([data-bp-sized="1"]),
.bp-section[data-bp-align="left"]:not([data-bp-sized="1"]) {
  align-self: flex-start;
  justify-self: start;
  width: fit-content;
  max-width: 100%;
}

/* No Position → stretch with base .bp-el (fill host). Do not center-shrink
 * unaligned seats - that made Width "auto" look different per content length. */

/* Design Width 100% fills the parent (not content width), even with Position set.
 * Soft max-width:100% prevents overflow; author max-width (e.g. 50%) must still win. */
[data-bp-fill-width="1"] {
  align-self: stretch !important;
  justify-self: stretch !important;
  width: auto !important;
  max-width: 100%;
  box-sizing: border-box;
}

/* Spacer seats - Height in Design owns the gap. */
.bp-el[data-bp-el="spacer"] {
  min-height: 0.5rem;
}

/*
 * Fold seat - collapsed by default (path-builder canvas paints a slim marker).
 * Live + path-preview/draft set html[data-bp-fold-live]; survey JS sets
 * min-height so the seat fills down to the bottom of the viewport.
 */
.bp-el[data-bp-el="fold"] {
  display: block;
  flex: 0 0 auto;
  align-self: stretch;
  width: 100%;
  height: 0;
  min-height: 0;
  max-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  pointer-events: none;
  overflow: hidden;
}

html[data-bp-fold-live] .bp-el[data-bp-el="fold"] {
  height: auto;
  max-height: none;
  overflow: hidden;
  /* min-height is set by engine.js / agent-page.js to reach the viewport bottom */
}

/*
 * Hold first paint until fold min-height is applied. Without this, below-the-fold
 * content flashes in the first viewport for a frame (fold starts at height 0).
 * visibility:hidden still lays out so getBoundingClientRect works while sizing.
 */
html[data-bp-fold-live]:not([data-bp-fold-ready]) body {
  visibility: hidden;
}

/* Marker chrome never paints on public / path-preview pages. */
html[data-bp-fold-live] .bp-el[data-bp-el="fold"]::before,
html[data-bp-fold-live] .bp-el[data-bp-el="fold"]::after,
body.pb-preview-embed .bp-el[data-bp-el="fold"]::before,
body.pb-preview-embed .bp-el[data-bp-el="fold"]::after,
body.pb-preview-standalone .bp-el[data-bp-el="fold"]::before,
body.pb-preview-standalone .bp-el[data-bp-el="fold"]::after {
  content: none !important;
  display: none !important;
}

/* Divider seats - line sits in the middle of Design Height. */
.bp-el[data-bp-el="divider"] {
  display: flex;
  align-items: center;
  min-height: 0.5rem;
}

.bp-el[data-bp-el="divider"] > .bp-el-divider {
  flex: 1 1 auto;
  width: 100%;
  align-self: center;
}

.bp-el[data-bp-align="center"]:not([data-bp-sized="1"]),
.bp-col[data-bp-align="center"]:not([data-bp-sized="1"]),
.bp-row[data-bp-align="center"]:not([data-bp-sized="1"]),
.bp-container[data-bp-align="center"]:not([data-bp-sized="1"]),
.bp-section[data-bp-align="center"]:not([data-bp-sized="1"]) {
  align-self: center;
  justify-self: center;
  width: fit-content;
  max-width: 100%;
}

.bp-el[data-bp-align="right"]:not([data-bp-sized="1"]),
.bp-col[data-bp-align="right"]:not([data-bp-sized="1"]),
.bp-row[data-bp-align="right"]:not([data-bp-sized="1"]),
.bp-container[data-bp-align="right"]:not([data-bp-sized="1"]),
.bp-section[data-bp-align="right"]:not([data-bp-sized="1"]) {
  align-self: flex-end;
  justify-self: end;
  width: fit-content;
  max-width: 100%;
}

/* Concrete Width + Position: place without fit-content (keep authored width). */
.bp-el[data-bp-align="left"][data-bp-sized="1"],
.bp-col[data-bp-align="left"][data-bp-sized="1"],
.bp-row[data-bp-align="left"][data-bp-sized="1"],
.bp-container[data-bp-align="left"][data-bp-sized="1"],
.bp-section[data-bp-align="left"][data-bp-sized="1"] {
  align-self: flex-start;
  justify-self: start;
}

.bp-el[data-bp-align="center"][data-bp-sized="1"],
.bp-col[data-bp-align="center"][data-bp-sized="1"],
.bp-row[data-bp-align="center"][data-bp-sized="1"],
.bp-container[data-bp-align="center"][data-bp-sized="1"],
.bp-section[data-bp-align="center"][data-bp-sized="1"] {
  align-self: center;
  justify-self: center;
}

.bp-el[data-bp-align="right"][data-bp-sized="1"],
.bp-col[data-bp-align="right"][data-bp-sized="1"],
.bp-row[data-bp-align="right"][data-bp-sized="1"],
.bp-container[data-bp-align="right"][data-bp-sized="1"],
.bp-section[data-bp-align="right"][data-bp-sized="1"] {
  align-self: flex-end;
  justify-self: end;
}

/* Beside (row) hosts: place with margins; don't force equal flex grow. */
.bp-container--row > [data-bp-align="left"],
.bp-container--row > [data-bp-align="center"],
.bp-container--row > [data-bp-align="right"] {
  flex: 0 1 auto;
}

.bp-container--row > [data-bp-align="left"] {
  margin-right: auto;
  margin-left: 0;
}

.bp-container--row > [data-bp-align="center"] {
  margin-left: auto;
  margin-right: auto;
}

.bp-container--row > [data-bp-align="right"] {
  margin-left: auto;
  margin-right: 0;
}

/* Text align = content inside the seat (synced from style.textAlign → data-bp-text-align). */
.bp-el[data-bp-text-align="left"],
.bp-col[data-bp-text-align="left"],
.bp-row[data-bp-text-align="left"],
.bp-container[data-bp-text-align="left"],
.bp-section[data-bp-text-align="left"] {
  text-align: left;
}

.bp-el:not([data-bp-text-align]),
.bp-el[data-bp-text-align="center"],
.bp-col[data-bp-text-align="center"],
.bp-row[data-bp-text-align="center"],
.bp-container[data-bp-text-align="center"],
.bp-section[data-bp-text-align="center"] {
  text-align: center;
}

.bp-el[data-bp-text-align="right"],
.bp-col[data-bp-text-align="right"],
.bp-row[data-bp-text-align="right"],
.bp-container[data-bp-text-align="right"],
.bp-section[data-bp-text-align="right"] {
  text-align: right;
}

.bp-el[data-bp-text-align="justify"],
.bp-col[data-bp-text-align="justify"],
.bp-row[data-bp-text-align="justify"],
.bp-container[data-bp-text-align="justify"],
.bp-section[data-bp-text-align="justify"] {
  text-align: justify;
}

/* Media / block objects inside a seat - honor Text align. */
.bp-el-image-wrap {
  text-align: inherit;
  overflow: hidden;
  border-radius: inherit;
  border-top-left-radius: inherit;
  border-top-right-radius: inherit;
  border-bottom-right-radius: inherit;
  border-bottom-left-radius: inherit;
}

.bp-el-image {
  display: block;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: inherit;
  border-top-left-radius: inherit;
  border-top-right-radius: inherit;
  border-bottom-right-radius: inherit;
  border-bottom-left-radius: inherit;
}
.bp-el[data-bp-text-align="left"] .bp-el-image,
.bp-el[data-bp-text-align="left"] .bp-el-image-wrap,
.bp-el[data-bp-text-align="left"] .bp-el-video-placeholder,
.bp-el[data-bp-text-align="left"] iframe,
.bp-el[data-bp-text-align="left"] video {
  margin-left: 0;
  margin-right: auto;
}

.bp-el:not([data-bp-text-align]) .bp-el-image,
.bp-el:not([data-bp-text-align]) .bp-el-image-wrap,
.bp-el:not([data-bp-text-align]) .bp-el-video-placeholder,
.bp-el:not([data-bp-text-align]) iframe,
.bp-el:not([data-bp-text-align]) video,
.bp-el[data-bp-text-align="center"] .bp-el-image,
.bp-el[data-bp-text-align="center"] .bp-el-image-wrap,
.bp-el[data-bp-text-align="center"] .bp-el-video-placeholder,
.bp-el[data-bp-text-align="center"] iframe,
.bp-el[data-bp-text-align="center"] video {
  margin-left: auto;
  margin-right: auto;
}

.bp-el[data-bp-text-align="right"] .bp-el-image,
.bp-el[data-bp-text-align="right"] .bp-el-image-wrap,
.bp-el[data-bp-text-align="right"] .bp-el-video-placeholder,
.bp-el[data-bp-text-align="right"] iframe,
.bp-el[data-bp-text-align="right"] video {
  margin-left: auto;
  margin-right: 0;
}

.bp-el[data-bp-text-align="left"] .bp-el-image,
.bp-el[data-bp-text-align="center"] .bp-el-image,
.bp-el[data-bp-text-align="right"] .bp-el-image {
  display: block;
}

/* Buttons: Align places the pill; Text align styles the label. */
.bp-el[data-bp-el="button"][data-bp-text-align="left"],
.bp-el[data-bp-el="button"][data-bp-text-align="left"] > .btn,
.bp-el[data-bp-el="button"][data-bp-text-align="left"] > a.btn,
.bp-el[data-bp-el="button"][data-bp-text-align="left"] > button {
  text-align: left;
  justify-content: flex-start;
}

.bp-el[data-bp-el="button"]:not([data-bp-text-align]),
.bp-el[data-bp-el="button"][data-bp-text-align="center"],
.bp-el[data-bp-el="button"]:not([data-bp-text-align]) > .btn,
.bp-el[data-bp-el="button"]:not([data-bp-text-align]) > a.btn,
.bp-el[data-bp-el="button"]:not([data-bp-text-align]) > button,
.bp-el[data-bp-el="button"][data-bp-text-align="center"] > .btn,
.bp-el[data-bp-el="button"][data-bp-text-align="center"] > a.btn,
.bp-el[data-bp-el="button"][data-bp-text-align="center"] > button {
  text-align: center;
  justify-content: center;
}

.bp-el[data-bp-el="button"][data-bp-text-align="right"],
.bp-el[data-bp-el="button"][data-bp-text-align="right"] > .btn,
.bp-el[data-bp-el="button"][data-bp-text-align="right"] > a.btn,
.bp-el[data-bp-el="button"][data-bp-text-align="right"] > button {
  text-align: right;
  justify-content: flex-end;
}

/* Empty image seat - black stage fills the authored seat box (no forced min size). */
.bp-el[data-bp-el="image"]:has(> .bp-el-image-wrap--empty) {
  display: flex;
  align-items: stretch;
}

.bp-el-image-wrap--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  align-self: stretch;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  box-sizing: border-box;
  margin: 0;
  background: #000;
  border-radius: inherit;
  color: rgba(255, 255, 255, 0.55);
}

.bp-el-image-wrap--empty .bp-el-image-empty-icon {
  display: block;
  width: 2.75rem;
  height: 2.75rem;
  flex: 0 0 auto;
  background-color: currentColor;
  -webkit-mask: url('/static/img/icons/image.svg') no-repeat center / contain;
  mask: url('/static/img/icons/image.svg') no-repeat center / contain;
}

/* Empty video seat - same black stage + icon treatment as empty image. */
.bp-el[data-bp-el="video"]:has(> .bp-el-video-wrap--empty) {
  display: flex;
  align-items: stretch;
}

.bp-el-video-wrap--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  align-self: stretch;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  box-sizing: border-box;
  margin: 0;
  background: #000;
  border-radius: inherit;
  color: rgba(255, 255, 255, 0.55);
}

.bp-el-video-wrap--empty .bp-el-video-empty-icon {
  display: block;
  width: 2.75rem;
  height: 2.75rem;
  flex: 0 0 auto;
  background-color: currentColor;
  -webkit-mask: url('/static/img/icons/video-camera.svg') no-repeat center / contain;
  mask: url('/static/img/icons/video-camera.svg') no-repeat center / contain;
}

/* Video seats - path-unique accent (not dashboard / page agency primary). */
.bp-el[data-bp-el="video"] {
  --c-primary: #5050ff;
  --c-primary-color: #5050ff;
  --c-primary-hover: color-mix(in srgb, #5050ff 86%, #000);
  --c-primary-light: color-mix(in srgb, #5050ff 14%, #fff);
}

/* Video seats - shared BP media player / embed fills the seat width.
 * Corners come from Design on the host (.bp-el); the player inherits them. */
.bp-el[data-bp-el="video"] .bp-el-video-player,
.bp-el[data-bp-el="video"] .bp-media,
.bp-el[data-bp-el="video"] .bp-media-enhance,
.bp-el[data-bp-el="video"] .bp-el-video-embed {
  width: 100%;
  max-width: 100%;
  margin: 0;
  box-sizing: border-box;
  overflow: hidden;
  border-radius: inherit;
  border-top-left-radius: inherit;
  border-top-right-radius: inherit;
  border-bottom-right-radius: inherit;
  border-bottom-left-radius: inherit;
}

.bp-el[data-bp-el="video"] .bp-media-el,
.bp-el[data-bp-el="video"] .bp-el-video-embed iframe {
  border-radius: inherit;
  border-top-left-radius: inherit;
  border-top-right-radius: inherit;
  border-bottom-right-radius: inherit;
  border-bottom-left-radius: inherit;
}

.bp-el[data-bp-el="video"] .bp-el-video-player--empty,
.bp-el[data-bp-el="video"] .bp-el-video-player--empty.bp-media--video {
  width: 100%;
  background: #0b1220;
}

.bp-el[data-bp-el="video"] .bp-el-video-embed {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
}

.bp-el[data-bp-el="video"] .bp-el-video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.bp-el-divider {
  display: block;
  width: 100%;
  margin: 0;
  border: 0;
  border-top: 2px solid var(--bp-divider-color, color-mix(in srgb, currentColor 35%, transparent));
}

.bp-el-divider--dashed {
  border-top-style: dashed;
}

.bp-el-divider--dotted {
  border-top-style: dotted;
  border-top-width: 3px;
}

.bp-checklist {
  list-style: none;
  padding-left: 0;
}

.bp-checklist > li {
  position: relative;
  padding-left: 1.45em;
}

.bp-checklist > li::before {
  content: '✓';
  position: absolute;
  left: 0;
  top: 0;
  font-weight: 700;
}

@media (max-width: 640px) {
  .bp-row--2,
  .bp-row--3 {
    grid-template-columns: 1fr;
  }
}


/* ── Path runtime essentials (engine tokens - not seat theme) ─────────── */

.survey-step {
  display: none;
  box-sizing: border-box;
}

.survey-step.active {
  display: block;
  min-height: 0;
  animation: none;
}

.survey-step:has(.survey-page-blocks--sections),
.survey-step:has(.bp-el) {
  padding: 0;
}

/* Preview/live path UI: kill legacy .survey-step { font-size: 1.08rem } so Design rem sizes match the editor. */
.survey-step:has(.survey-page-blocks--sections),
.survey-step:has(.bp-el),
html[data-path-ui] .survey-step {
  font-size: inherit;
}

.form-question {
  display: block;
  /* Inherit seat Design defaults (1rem / 400 / black / center). */
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  text-align: inherit;
  color: inherit;
}

.form-question:empty {
  display: none;
}

.survey-step-progress {
  --bp-progress-thickness: 8px;
  height: var(--bp-progress-thickness, 8px);
  min-height: var(--bp-progress-thickness, 8px);
  background: var(--bp-progress-track, var(--c-border, #e5e7eb));
  border-radius: 999px;
  overflow: hidden;
}

.survey-progress-bar {
  height: 100%;
  background: var(--bp-progress-fill, var(--c-primary, #5050ff));
}

.survey-progress-text {
  /* Typography comes from Design rich-text markup - don't force color/weight. */
  margin: 0;
}

.survey-progress-text p {
  margin: 0;
}

.survey-progress-text p + p {
  margin-top: .25rem;
}

/* Progress seats - bar stroke from --bp-progress-thickness (Setup → Line thickness). */
.bp-el[data-bp-el="progress"] {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: .35rem;
  box-sizing: border-box;
}

.bp-el[data-bp-el="progress"] .survey-step-progress {
  width: 100%;
  flex: 0 0 auto;
  height: var(--bp-progress-thickness, 8px);
  min-height: var(--bp-progress-thickness, 8px);
  align-self: stretch;
  background: var(--bp-progress-track, var(--c-border, #e5e7eb));
}

.bp-el[data-bp-el="progress"] .survey-progress-bar {
  background: var(--bp-progress-fill, var(--c-primary, #5050ff));
}

.bp-el[data-bp-el="progress"] .survey-progress-text {
  flex: 0 0 auto;
}

.survey-choice-list {
  display: grid;
  gap: .65rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.survey-choice-list-1 { grid-template-columns: 1fr; }
.survey-choice-list-2 { grid-template-columns: repeat(2, 1fr); }
.survey-choice-list-3 { grid-template-columns: repeat(3, 1fr); }
.survey-choice-list-4 { grid-template-columns: repeat(4, 1fr); }

/* Keep authored column counts on small viewports (match editor / survey.css). */
@media (max-width: 640px) {
  .survey-choice-list-2 { grid-template-columns: repeat(2, 1fr); }
  .survey-choice-list-3 { grid-template-columns: repeat(3, 1fr); }
  .survey-choice-list-4 { grid-template-columns: repeat(2, 1fr); }
}

.survey-choice {
  position: relative;
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Native radio is input-only - never show dashboard radio chrome on path choices. */
.survey-choice-input,
.survey-star-input {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  min-width: 0 !important;
  min-height: 0 !important;
  margin: -1px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  opacity: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  pointer-events: none !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  background: transparent !important;
  box-shadow: none !important;
}

.survey-choice-input::before,
.survey-star-input::before {
  content: none !important;
  display: none !important;
}

.survey-choice-btn {
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  border: 0;
  /* Padding / fill / color / radius / type / shadow are authored inline (Button defaults). */
  text-align: center;
  cursor: pointer;
}

.survey-choice-btn:hover {
  filter: brightness(0.96);
}

.survey-other-wrap {
  margin-top: .5rem;
  grid-column: 1 / -1;
}

.survey-other-input {
  width: 100%;
  box-sizing: border-box;
}

.survey-page-cta {
  margin-inline: auto;
}

.survey-field-subtext {
  text-align: center;
  color: var(--c-text-muted, #6b7280);
  font-size: .95rem;
}

.spinner,
.bp-spinner {
  display: inline-block;
  width: 1.5rem;
  height: 1.5rem;
  border: 2px solid color-mix(in srgb, var(--bp-spinner-color, var(--c-primary, #5050ff)) 20%, transparent);
  border-top-color: var(--bp-spinner-color, var(--c-primary, #5050ff));
  border-radius: 50%;
  animation: bp-path-spin .7s linear infinite;
}

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

.survey-loading-step {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 1rem;
  padding: 2rem 1rem;
  margin: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-height: 8rem;
}

.survey-loading-step .spinner {
  width: 2.75rem;
  height: 2.75rem;
  border-width: 3px;
  align-self: center;
  flex-shrink: 0;
}

.survey-loading-message {
  margin: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  /* Inherit Design Text align on the host seat. */
  text-align: inherit;
}

.survey-loading-message p {
  margin: 0;
}

.survey-loading-message p + p {
  margin-top: 0.35em;
}
