/* Shared purchase flow: HTML owns the structure; provider events update existing values. */
html.telebugs:has(.checkout-flow) {
  background: light-dark(#f6f8fb, #171a20);
  scrollbar-gutter: stable;
}
html.telebugs body:has(.checkout-flow) { background: transparent; }
html.telebugs body:has(.checkout-flow) .checkout-flow {
  max-width: 64rem;
  margin-inline: auto;
  padding-block: 2rem;
}
.checkout-navigation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  max-width: 64rem;
  margin: 0 auto 1.5rem;
}
html.telebugs body:has(.checkout-flow) .comparison-story__brand {
  margin: 0;
  flex-shrink: 0;
}
html.telebugs body:has(.checkout-flow) .comparison-story__brand img { width: 8rem; }
html.telebugs body:has(.checkout-flow) .checkout-flow .checkout-page__back {
  color: light-dark(#526174, #b6bfcd);
  font-size: .875rem;
  text-decoration: none;
}
.checkout-flow .checkout-page__panel {
  padding: 0;
  border: 1px solid #e2e7ed;
  border-radius: 1rem;
  box-shadow: 0 12px 36px rgb(25 42 66 / .05), 0 2px 6px rgb(25 42 66 / .03);
}
.checkout-flow .checkout-page__body {
  grid-template-columns: minmax(0, .95fr) minmax(360px, 1.05fr);
  gap: 0;
}
.checkout-flow .checkout-page__order {
  min-width: 0;
  padding: 2.5rem;
  background: #f8fafc;
  border-right: 1px solid #e8edf2;
}
.checkout-flow .checkout-page__header { padding: 0 0 1.5rem; }
html.telebugs .checkout-flow .checkout-page__header h1 {
  margin: 0 0 .5rem;
  font-family: var(--font-sans);
  font-size: 1.875rem;
  line-height: 1.2;
  font-weight: 650;
  letter-spacing: -.025em;
  color: #172334;
}
html.telebugs .checkout-flow .checkout-page__header .checkout-page__subtitle {
  margin: 0;
  color: #526174;
  font-size: .9375rem;
  overflow-wrap: anywhere;
}
html.telebugs .checkout-flow .checkout-page__totals {
  color: #344256;
  font-size: 1rem;
  margin: 0 0 1rem;
}
.checkout-flow .checkout-page__totals > div { padding-block: .5rem; }
.checkout-flow .checkout-page__totals dd { color: #172334; font-weight: 500; }
.checkout-flow .checkout-page__totals small {
  display: block;
  color: #637083;
  font-size: .8125rem;
  line-height: 1.5;
  margin-top: .125rem;
}
.checkout-flow .checkout-page__total {
  margin-top: .75rem;
  border-color: #dfe5ed;
  align-items: center;
}
.checkout-flow .checkout-page__totals > .checkout-page__total { padding-block: 1rem .25rem; }
.checkout-flow .checkout-page__total dt { font-size: .9375rem; font-weight: 600; }
.checkout-flow .checkout-page__total dd {
  font-size: 1.75rem;
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -.025em;
}
.checkout-flow .checkout-page__totals .checkout-tax { color: #637083; font-size: .875rem; font-weight: 400; }
html.telebugs .checkout-flow .checkout-page__order .checkout-note {
  color: #637083;
  font-size: .875rem;
  margin: 0 0 .375rem;
}
.checkout-flow #price { margin-bottom: 1.75rem; }
html.telebugs .checkout-flow .checkout-page__order .checkout-next {
  margin: 0;
  color: #526174;
  font-size: .875rem;
  line-height: 1.6;
}
.checkout-next strong {
  display: block;
  color: #344256;
  font-weight: 600;
  margin-bottom: .25rem;
}
.checkout-next code {
  border: 1px solid #e2e7ed;
  border-radius: .25rem;
  background: #fff;
  color: #344256;
  font-size: .8125rem;
  padding: .0625rem .25rem;
}
.checkout-flow .checkout-page__payment { padding: 2.5rem 1.5rem 2rem; border-radius: 0; }
html.telebugs .checkout-flow .checkout-payment-title {
  color: #172334;
  font-family: var(--font-sans);
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -.01em;
  line-height: 1.5;
  margin: 0 10px 1.25rem;
}
.upgrade-checkout-frame { min-width: 0; }
html.telebugs .checkout-flow .checkout-page__payment :is(.checkout-page__status, .checkout-page__help, .checkout-page__business, #sandbox, #ready) {
  margin: 0 10px 1rem;
  font-size: .9375rem;
  line-height: 1.6;
  color: #526174;
}
.checkout-flow .managed-setup__retry {
  display: block;
  width: fit-content;
  max-width: calc(100% - 2rem);
  min-height: 2.5rem;
  padding: .5rem .875rem;
  margin: 0 10px .75rem;
  border: 1px solid #d9e0e9;
  border-radius: .375rem;
  background: #fff;
  color: #344256;
  font: 600 .875rem/1.5 var(--font-sans);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.checkout-flow .managed-setup__retry:not(#refresh) {
  background: #155eef;
  border-color: #155eef;
  color: #fff;
}
.checkout-flow .managed-setup__retry:not(#refresh):hover { background: #124dcb; border-color: #124dcb; }
.checkout-flow #refresh:hover { background: #f2f5f9; }
.checkout-flow .managed-setup__retry:disabled { opacity: .6; cursor: default; }
.checkout-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.125rem 2.5rem;
  border-top: 1px solid #e8edf2;
  background: #fff;
}
.checkout-footer nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }
html.telebugs body:has(.checkout-flow) .checkout-flow .checkout-footer a {
  color: #637083;
  font-size: .8125rem;
  line-height: 1.5;
  font-weight: 400;
  text-decoration: none;
}
html.telebugs body:has(.checkout-flow) .checkout-flow :is(.checkout-page__back, .checkout-footer a):hover {
  color: #155eef;
  text-decoration: underline;
  text-underline-offset: .2em;
}
.checkout-flow :is(a, button):focus-visible { outline: 2px solid #155eef; outline-offset: 4px; }
@media (max-width: 800px) {
html.telebugs body:has(.checkout-flow) { margin-inline: 0; max-width: 100%; width: 100%; }
html.telebugs body:has(.checkout-flow) .main.main--product { max-width: 100%; width: 100%; margin-inline: 0; padding-inline: 0; }
html.telebugs body:has(.checkout-flow) .checkout-flow { max-width: 100%; width: 100%; margin-inline: 0; padding-block: 1.25rem 0; }
  .checkout-navigation { padding-inline: 1.25rem; margin-bottom: 1.25rem; }
  .checkout-flow .checkout-page__panel { border: 0; border-radius: 0; box-shadow: none; }
  .checkout-flow .checkout-page__body { grid-template-columns: minmax(0, 1fr); }
  .checkout-flow .checkout-page__order { padding: 1.75rem 1.25rem; border-right: 0; border-bottom: 1px solid #e8edf2; }
  .checkout-flow .checkout-page__header { padding-bottom: 1rem; }
  html.telebugs .checkout-flow .checkout-page__header h1 { font-size: 1.625rem; }
  .checkout-flow .checkout-page__payment { padding: 1.5rem 0; }
  html.telebugs .checkout-flow .checkout-payment-title,
  html.telebugs .checkout-flow .checkout-page__payment :is(.checkout-page__status, .checkout-page__help, .checkout-page__business, #sandbox, #ready),
  .checkout-flow .managed-setup__retry { margin-inline: 10px; }
  .checkout-footer { padding: 1.125rem 1.25rem; }
  .checkout-footer nav { gap: 1rem; }
}
@media (max-width: 360px) {
  .checkout-flow .checkout-page__total dd { font-size: 1.5rem; }
  .checkout-footer { align-items: flex-start; flex-direction: column; gap: .75rem; }
}

/* Shared details and setup controls. The provider form is always light. */
.checkout-flow .checkout-page__panel { color-scheme: light; background: #fff; color: #172334; }
.checkout-flow .checkout-summary { margin: 0 0 1.75rem; }
.checkout-flow .checkout-page__status, .checkout-flow .checkout-page__help { padding-inline: 0 !important; }
.checkout-flow .checkout-page__subtitle { line-height: 1.6; }
html.telebugs .checkout-flow .checkout-page__header h2 {
  margin: 0 0 .5rem; color: #172334; font: 650 1.875rem/1.2 var(--font-sans); letter-spacing: -.025em;
}
html.telebugs .checkout-flow .checkout-page__order .checkout-trial-note { margin-top: 1rem; }
.checkout-flow .checkout-setup-form { min-width: 0; padding: 2.5rem; }
html.telebugs body[data-page="managed-setup"] .comparison-story.managed-setup .product__header.comparison-story__hero {
  display: block; padding: 0 0 1.5rem; text-align: left; max-width: none; margin: 0;
}
html.telebugs body[data-page="managed-setup"] .comparison-story.managed-setup .product__header.comparison-story__hero h1.product-name {
  color: #172334; font: 600 1.375rem/1.3 var(--font-sans); letter-spacing: -.02em; margin: 0;
}
html.telebugs body[data-page="managed-setup"] .comparison-story.managed-setup .product__header.comparison-story__hero > p {
  font: 400 .9375rem/1.6 var(--font-sans); color: #526174; margin: .5rem 0 0; max-width: none; min-block-size: 0; overflow-wrap: anywhere;
}
.checkout-flow .managed-signup > label { font-size: .9375rem; font-weight: 600; margin-bottom: 1.25rem; color: #344256; }
.checkout-flow .managed-signup :is(select, input[name="subdomain"]) {
  font: 400 1rem/1.5 var(--font-sans); border: 1px solid #cfd7e2; border-radius: .375rem;
  min-height: 2.75rem; padding: .625rem .75rem; background-color: #fff; color: #172334; box-shadow: 0 1px 2px rgb(25 42 66 / .03);
}
.checkout-flow .managed-signup select { padding-right: 2rem; }
.checkout-flow .managed-signup .managed-signup__hint { color: #637083; font-size: .8125rem; }
.checkout-flow .managed-signup .managed-signup__acceptance { font-size: .875rem; font-weight: 400; }
.checkout-flow .managed-signup__error { color: #b42318; }
.checkout-flow .managed-setup__message:empty { display: none; }
html.telebugs .checkout-flow .managed-setup__message { color: #526174; font: 400 .9375rem/1.6 var(--font-sans); margin: 0 0 1rem; }
.checkout-flow .managed-setup__progress { margin: 0 0 1.25rem; width: 3rem; height: 3rem; }
html.telebugs body[data-page="managed-setup"] .checkout-flow :is(.managed-signup, .managed-setup__form, .managed-setup__content) .btn {
  background: #155eef; border: 1px solid #155eef; color: #fff !important; border-radius: .375rem;
  font: 600 .9375rem/1.5 var(--font-sans); min-height: 2.75rem; padding: .625rem 1rem; box-shadow: 0 1px 2px rgb(25 42 66 / .1);
}
html.telebugs body[data-page="managed-setup"] .checkout-flow :is(.managed-signup, .managed-setup__form, .managed-setup__content) .btn:hover { background: #124dcb; }
.checkout-flow .managed-signup .btn:disabled { opacity: .5; cursor: default; }
.checkout-flow .managed-signup :is(input, select):focus-visible { outline: 2px solid #155eef; outline-offset: 2px; }
html.telebugs .checkout-flow .managed-setup__note { font-size: .875rem; color: #637083; }
.checkout-flow .managed-setup__regions { gap: .5rem; }
.checkout-flow .managed-setup__region { padding: .75rem; border-radius: .375rem; font-size: .9375rem; }
html.telebugs .checkout-flow .managed-setup__alternative { font-size: .875rem; margin-top: 1.25rem; }
html.telebugs .checkout-flow .checkout-setup-form a { color: #155eef; }
.checkout-flow noscript p { margin: 1rem 1.25rem; color: #526174; font-size: .9375rem; }
@media (max-width: 800px) {
  .checkout-flow .checkout-setup-form { padding: 1.75rem 1.25rem; }
  html.telebugs .checkout-flow .checkout-page__header h2 { font-size: 1.625rem; }
}

html.telebugs body[data-page="managed-setup"] .checkout-flow .managed-signup .btn { width: 100%; margin: 1.25rem 0 0; }
html.telebugs body[data-page="managed-setup"] .checkout-flow .comparison-story__hero :is(h1, p) { text-align: left; }
.checkout-flow .managed-setup__panel:is([data-view="status"], :has([data-setup-region]:not([hidden]))) { max-width: 38rem; }
.checkout-flow .managed-setup__panel:is([data-view="status"], :has([data-setup-region]:not([hidden]))) .checkout-page__body { grid-template-columns: minmax(0, 1fr); }
.checkout-flow .managed-setup__panel:is([data-view="status"], :has([data-setup-region]:not([hidden]))) .checkout-page__order { display: none; }

/* Reserve the asynchronous checkout layout before the quote and iframe arrive. */
.checkout-flow:not(.managed-setup) .checkout-page__header { min-block-size: 7rem; }
.checkout-flow:not(.managed-setup) .checkout-page__subtitle { min-block-size: 1.6em; }
.checkout-flow:not(.managed-setup) .checkout-page__order > :is(.checkout-summary, #price) { min-block-size: 20rem; }
.checkout-flow:not(.managed-setup):not([data-checkout-state="completed"]) .checkout-page__order :is(.checkout-page__subtitle, .checkout-summary, #price, .checkout-next)[hidden] {
  display: block !important;
  visibility: hidden;
}
.checkout-flow .checkout-page__payment .checkout-page__status,
.checkout-flow .checkout-page__payment .checkout-page__status:empty {
  display: block;
  min-block-size: 1.6em;
}
.checkout-flow :is(.self-hosted-checkout-frame, .managed-checkout-frame, .upgrade-checkout-frame) { min-block-size: 56rem; }
.checkout-flow .upgrade-checkout-frame[hidden] { display: block !important; visibility: hidden; }
@media (min-width: 801px) and (max-width: 1100px) {
  .checkout-flow:not(.managed-setup) .checkout-page__header { min-block-size: 8rem; }
  .checkout-flow:not(.managed-setup) .checkout-page__order > :is(.checkout-summary, #price) { min-block-size: 23rem; }
}
@media (max-width: 800px) {
  .checkout-flow :is(.self-hosted-checkout-frame, .managed-checkout-frame, .upgrade-checkout-frame) { min-block-size: 64rem; }
}
@media (max-width: 360px) {
  .checkout-flow:not(.managed-setup) .checkout-page__order > :is(.checkout-summary, #price) { min-block-size: 21rem; }
  .checkout-flow :is(.self-hosted-checkout-frame, .managed-checkout-frame, .upgrade-checkout-frame) { min-block-size: 68rem; }
}

/* Completion keeps Paddle's receipt, without reserving space for a payment form. */
html.telebugs body:has(.checkout-flow) .checkout-flow[data-checkout-state="completed"] { max-width: 40rem; }
.checkout-flow[data-checkout-state="completed"] .checkout-page__body { grid-template-columns: minmax(0, 1fr); }
.checkout-flow[data-checkout-state="completed"] .checkout-page__order {
  padding: 2.5rem 2.5rem 0;
  background: #fff;
  border: 0;
}
.checkout-flow[data-checkout-state="completed"] .checkout-page__header { min-block-size: 0; padding: 0; }
.checkout-flow[data-checkout-state="completed"] .checkout-page__payment { padding-top: .5rem; }
.checkout-flow[data-checkout-state="completed"] .self-hosted-checkout-frame { min-block-size: 0; }
@media (max-width: 800px) {
  .checkout-flow[data-checkout-state="completed"] .checkout-page__order { padding: 1.75rem 1.25rem 0; }
}
