.kdc-modal [data-native-legacy-consent][hidden],
.kdc-modal [data-native-legacy-hidden][hidden] {
  display: none !important;
}

/* Native participation composition is its own first step, with a pinned action row. */
.kdc-modal.is-native-summary {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  overflow: hidden;
  padding-bottom: 0;
}

.kdc-modal.is-native-summary > .kdc-native-modal-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.kdc-modal.is-native-summary > .kdc-native-modal-footer {
  flex: 0 0 auto;
  position: relative;
  z-index: 2;
  margin-top: 8px;
  padding: 10px 0 max(14px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--kdc-border, #d9dce2);
  background: var(--kdc-surface, #fff);
}

.kdc-native-checkout {
  display: grid;
  gap: 12px;
  margin: 12px 0 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.kdc-payment-modal.is-native-committed .kdc-payment-applications,
.kdc-payment-modal.is-native-committed .kdc-payment-total,
.kdc-payment-modal.is-native-committed .kdc-payment-buyer-fields,
.kdc-payment-modal.is-native-committed .kdc-payment-recipient,
.kdc-payment-modal.is-native-committed .kdc-payment-note,
.kdc-payment-modal.is-native-committed .kdc-native-checkout__frozen-summary,
.kdc-payment-modal.is-native-preparing .kdc-payment-applications,
.kdc-payment-modal.is-native-preparing .kdc-payment-total,
.kdc-payment-modal.is-native-preparing .kdc-payment-buyer-fields,
.kdc-payment-modal.is-native-preparing .kdc-payment-recipient,
.kdc-payment-modal.is-native-preparing .kdc-payment-note,
.kdc-payment-modal.is-native-preparing .kdc-modal-actions,
.kdc-payment-modal.is-native-preparing .kdc-native-checkout__frozen-summary,
.kdc-payment-modal.is-native-committed .kdc-modal-actions,
.kdc-payment-modal.is-native-committed [data-spectator-quantity],
.kdc-payment-modal.is-native-terminal-cancelled .kdc-payment-applications,
.kdc-payment-modal.is-native-terminal-cancelled .kdc-payment-total,
.kdc-payment-modal.is-native-terminal-cancelled .kdc-payment-buyer-fields,
.kdc-payment-modal.is-native-terminal-cancelled .kdc-payment-recipient,
.kdc-payment-modal.is-native-terminal-cancelled .kdc-payment-note,
.kdc-payment-modal.is-native-terminal-cancelled .kdc-native-checkout__frozen-summary,
.kdc-payment-modal.is-native-terminal-cancelled .kdc-modal-actions,
.kdc-payment-modal.is-native-terminal-cancelled [data-spectator-quantity] {
  display: none !important;
}

.kdc-spectator-payment-modal.is-native-committed .kdc-spectator-ticket-summary,
.kdc-spectator-payment-modal.is-native-committed .kdc-fields,
.kdc-spectator-payment-modal.is-native-committed .kdc-spectator-consent,
.kdc-spectator-payment-modal.is-native-committed .kdc-spectator-contest-name,
.kdc-spectator-payment-modal.is-native-committed .kdc-payment-total,
.kdc-spectator-payment-modal.is-native-committed .kdc-payment-recipient,
.kdc-spectator-payment-modal.is-native-committed .kdc-payment-note,
.kdc-spectator-payment-modal.is-native-committed .kdc-native-checkout__frozen-summary,
.kdc-spectator-payment-modal.is-native-preparing .kdc-spectator-ticket-summary,
.kdc-spectator-payment-modal.is-native-preparing .kdc-fields,
.kdc-spectator-payment-modal.is-native-preparing .kdc-spectator-consent,
.kdc-spectator-payment-modal.is-native-preparing .kdc-spectator-contest-name,
.kdc-spectator-payment-modal.is-native-preparing .kdc-payment-total,
.kdc-spectator-payment-modal.is-native-preparing .kdc-modal-actions,
.kdc-spectator-payment-modal.is-native-preparing .kdc-native-checkout__frozen-summary {
  display: none !important;
}

.kdc-spectator-payment-modal.is-native-terminal-cancelled .kdc-spectator-ticket-summary,
.kdc-spectator-payment-modal.is-native-terminal-cancelled .kdc-fields,
.kdc-spectator-payment-modal.is-native-terminal-cancelled .kdc-spectator-consent,
.kdc-spectator-payment-modal.is-native-terminal-cancelled .kdc-spectator-contest-name,
.kdc-spectator-payment-modal.is-native-terminal-cancelled .kdc-payment-total,
.kdc-spectator-payment-modal.is-native-terminal-cancelled .kdc-native-checkout__frozen-summary,
.kdc-spectator-payment-modal.is-native-terminal-cancelled .kdc-modal-actions {
  display: none !important;
}

/* Keep the native ticket buyer form compact: name first, then paired contacts. */
.kdc-spectator-payment-modal.has-native-checkout-layout [data-form="spectator-payment"] > .kdc-fields {
  align-items: start;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.kdc-spectator-payment-modal.has-native-checkout-layout [data-form="spectator-payment"] > .kdc-fields > label:first-child {
  grid-column: 1 / -1;
}

@media (max-width: 560px) {
  .kdc-spectator-payment-modal.has-native-checkout-layout [data-form="spectator-payment"] > .kdc-fields {
    grid-template-columns: minmax(0, 1fr);
  }

  .kdc-spectator-payment-modal.has-native-checkout-layout [data-form="spectator-payment"] > .kdc-fields > label:first-child {
    grid-column: auto;
  }
}

@media (max-width: 520px) {
  .kdc-spectator-payment-modal.has-native-checkout-layout .kdc-spectator-ticket-summary {
    gap: 12px;
    grid-template-columns: minmax(0, 1fr) minmax(140px, 1fr);
  }

  .kdc-spectator-payment-modal.has-native-checkout-layout .kdc-spectator-quantity .kdc-quantity-control {
    min-width: 0;
    width: 100%;
  }

  .kdc-spectator-payment-modal.has-native-checkout-layout .kdc-spectator-quantity .kdc-quantity-control input {
    flex: 1 1 0%;
    min-width: 24px;
    width: auto;
  }
}

/* Keep a semantic dialog name without a second checkout heading over the Yandex form. */
.kdc-modal.is-native-preparing > .kdc-native-modal-scroll > h2,
.kdc-modal.is-native-committed > .kdc-native-modal-scroll > h2 {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  min-width: 1px !important;
  min-height: 1px !important;
  max-width: 1px !important;
  max-height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.kdc-payment-modal.is-native-checkout .kdc-eyebrow {
  display: none !important;
}

.kdc-native-checkout__frozen-summary {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff;
}

.kdc-native-checkout__frozen-summary span {
  font-weight: 700;
}

.kdc-native-checkout__frozen-summary small {
  color: var(--kdc-text-muted, #626976);
}

.kdc-native-checkout__methods {
  margin: 0;
  padding: 0 !important;
  border: 0 !important;
}

.kdc-native-checkout__methods legend {
  margin: 0 0 8px;
  font-weight: 700;
}

.kdc-native-checkout__method-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.kdc-native-checkout__method-card {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 68px;
  padding: 10px;
  border: 1px solid var(--kdc-border, #d9dce2);
  border-radius: 13px;
  background: #fff;
  cursor: pointer;
  transition: border-color 120ms ease, box-shadow 120ms ease, background-color 120ms ease;
}

.kdc-native-checkout__method-card:hover {
  border-color: #9b8ad4;
}

.kdc-native-checkout__method-card.is-selected {
  border-color: var(--kdc-accent, #5f3dc4);
  background: #f8f6ff;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--kdc-accent, #5f3dc4) 14%, transparent);
}

.kdc-native-checkout__method-card input[type="radio"] {
  position: absolute !important;
  width: 1px !important;
  min-width: 1px !important;
  max-width: 1px !important;
  height: 1px !important;
  min-height: 1px !important;
  max-height: 1px !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  white-space: nowrap !important;
  border: 0 !important;
  clip: rect(0, 0, 0, 0) !important;
  clip-path: inset(50%) !important;
  opacity: 0 !important;
}

.kdc-native-checkout__method-card:focus-within {
  outline: 3px solid color-mix(in srgb, var(--kdc-accent, #5f3dc4) 35%, transparent);
  outline-offset: 2px;
}

.kdc-native-checkout__method-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 9px;
  color: var(--kdc-accent, #5f3dc4);
  background: #f0edfa;
}

.kdc-native-checkout__method-icon svg {
  display: block;
  width: 23px;
  height: 23px;
}

.kdc-native-checkout__method-icon .kdc-native-checkout__icon-card {
  fill: currentColor;
}

.kdc-native-checkout__method-icon .kdc-native-checkout__icon-sbp {
  width: 22px;
  height: 25px;
  flex: none;
  overflow: visible;
}

.kdc-native-checkout__method-copy {
  min-width: 0;
  line-height: 1.25;
}

.kdc-native-checkout__method-copy strong {
  display: block;
  font-size: 0.94rem;
}

.kdc-native-checkout__method-check {
  display: grid;
  width: 16px;
  height: 16px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--kdc-accent, #5f3dc4);
  font-size: 11px;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 120ms ease, transform 120ms ease;
}

.kdc-native-checkout__method-card.is-selected .kdc-native-checkout__method-check {
  opacity: 1;
  transform: scale(1);
}

.kdc-native-checkout .kdc-consent {
  align-items: flex-start;
}

.kdc-native-checkout .kdc-consent input[type="checkbox"] {
  flex: 0 0 20px;
  width: 20px !important;
  min-width: 20px !important;
  max-width: 20px !important;
  height: 20px !important;
  min-height: 20px !important;
  max-height: 20px !important;
  margin: -1px 0 0 !important;
  padding: 0 !important;
}

.kdc-native-checkout__consent-wrap {
  display: grid;
  gap: 4px;
}

.kdc-native-checkout__consent-error {
  margin: 0;
  color: #a62020;
  font-size: 12px;
  line-height: 1.3;
}

@media (max-width: 390px) {
  .kdc-native-checkout__method-card {
    grid-template-columns: 28px minmax(0, 1fr) 16px;
    grid-template-rows: auto auto;
    gap: 6px;
    min-height: 74px;
    padding: 8px;
  }

  .kdc-native-checkout__method-icon {
    grid-column: 1;
    grid-row: 1;
    width: 28px;
    height: 28px;
  }

  .kdc-native-checkout__method-copy {
    grid-column: 1 / -1;
    grid-row: 2;
    white-space: normal;
    overflow-wrap: normal;
    word-break: normal;
  }

  .kdc-native-checkout__method-check {
    grid-column: 3;
    grid-row: 1;
  }

  .kdc-native-checkout__method-copy strong {
    font-size: 0.88rem;
    word-break: normal;
    overflow-wrap: normal;
  }
}

.kdc-native-checkout__quote {
  display: grid;
  gap: 6px;
  padding: 12px;
  border-radius: 12px;
  background: #fff;
}

.kdc-native-checkout__quote > strong {
  font-size: 1.35rem;
}

.kdc-native-checkout__quote > small {
  color: var(--kdc-text-muted, #626976);
}

.kdc-native-checkout__items {
  display: grid;
  gap: 8px;
  margin: 8px 0 0;
  padding: 10px 0 0;
  border-top: 1px solid var(--kdc-border, #d9dce2);
  list-style: none;
}

.kdc-native-checkout__items li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.kdc-native-checkout__stage,
.kdc-native-checkout__notice,
.kdc-native-checkout__error,
.kdc-native-checkout__result p {
  margin: 0;
  line-height: 1.5;
}

.kdc-native-checkout__stage-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
}

.kdc-native-checkout__stage-row .kdc-native-checkout__stage {
  min-width: 0;
  overflow-wrap: anywhere;
}

.kdc-native-checkout__stage-row .kdc-native-checkout__spinner {
  flex: 0 0 24px;
}

.kdc-native-checkout__error,
.kdc-native-checkout__result.is-error {
  color: #a62020;
}

.kdc-native-checkout__notice {
  color: #73520b;
}

.kdc-native-checkout__result {
  display: grid;
  gap: 8px;
}

.kdc-native-checkout__result.is-success {
  color: #176b43;
}

.kdc-native-checkout__widget {
  width: 100%;
  min-height: 500px;
  overflow: hidden;
  border-radius: 12px;
  background: #fff;
}

.kdc-native-checkout [data-native-widget][hidden] {
  display: none !important;
}

.kdc-native-checkout__widget-loader {
  color: var(--kdc-text-muted, #626976);
}

.kdc-native-checkout__cancel-controls {
  display: grid;
  gap: 10px;
  justify-items: start;
  margin-top: 14px;
}

.kdc-native-checkout__cancel-open {
  min-height: 40px;
}

.kdc-native-checkout__cancel-confirm {
  display: grid;
  gap: 10px;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--kdc-border, #d9dce2);
  border-radius: 10px;
  background: #fff;
}

.kdc-native-checkout__cancel-confirm p,
.kdc-native-checkout__cancel-status {
  margin: 0;
}

.kdc-native-checkout__cancel-confirm > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.kdc-native-checkout__cancel-confirm .is-danger {
  color: #fff;
  border-color: #a72a32;
  background: #a72a32;
}

.kdc-native-checkout__cancel-confirm .is-danger:hover {
  background: #842129;
}

.kdc-native-checkout__spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid #d9dce2;
  border-top-color: var(--kdc-accent, #5f3dc4);
  border-radius: 50%;
  animation: kdc-native-spin 0.8s linear infinite;
}

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

@media (max-width: 640px) {
  .kdc-native-checkout__items li {
    align-items: flex-start;
  }

  .kdc-native-checkout__widget {
    min-height: 440px;
  }
}

/* Native checkout dark theme: keep our shell readable without recoloring the provider's SVG. */
html[data-kdc-theme="dark"] body.kdc-contests-body .kdc-native-checkout__method-card {
  border-color: var(--kdc-line-strong, rgba(255, 244, 226, 0.24));
  background: #202629;
  color: var(--kdc-ink, #f6efe5);
}

html[data-kdc-theme="dark"] body.kdc-contests-body .kdc-native-checkout__method-card:hover {
  border-color: var(--kdc-teal, #74cfc3);
  background: #252d30;
}

html[data-kdc-theme="dark"] body.kdc-contests-body .kdc-native-checkout__method-card.is-selected {
  border-color: var(--kdc-teal, #74cfc3);
  background: rgba(116, 207, 195, 0.13);
  color: var(--kdc-ink, #f6efe5);
  box-shadow: 0 0 0 2px rgba(116, 207, 195, 0.22);
}

html[data-kdc-theme="dark"] body.kdc-contests-body .kdc-native-checkout__method-icon {
  color: var(--kdc-teal, #74cfc3);
  background: rgba(116, 207, 195, 0.14);
}

html[data-kdc-theme="dark"] body.kdc-contests-body .kdc-native-checkout__method-card:focus-within {
  outline-color: rgba(116, 207, 195, 0.58);
}

html[data-kdc-theme="dark"] body.kdc-contests-body .kdc-native-checkout__frozen-summary,
html[data-kdc-theme="dark"] body.kdc-contests-body .kdc-native-checkout__quote,
html[data-kdc-theme="dark"] body.kdc-contests-body .kdc-native-checkout__cancel-confirm {
  border-color: var(--kdc-line-strong, rgba(255, 244, 226, 0.24));
  background: #202629;
  color: var(--kdc-ink, #f6efe5);
}

html[data-kdc-theme="dark"] body.kdc-contests-body .kdc-native-checkout__frozen-summary small,
html[data-kdc-theme="dark"] body.kdc-contests-body .kdc-native-checkout__quote > small,
html[data-kdc-theme="dark"] body.kdc-contests-body .kdc-native-checkout__widget-loader {
  color: var(--kdc-muted, #b9b5ae);
}

html[data-kdc-theme="dark"] body.kdc-contests-body .kdc-native-checkout__items {
  border-top-color: var(--kdc-line-strong, rgba(255, 244, 226, 0.24));
}

html[data-kdc-theme="dark"] body.kdc-contests-body .kdc-native-checkout__error,
html[data-kdc-theme="dark"] body.kdc-contests-body .kdc-native-checkout__result.is-error,
html[data-kdc-theme="dark"] body.kdc-contests-body .kdc-native-checkout__consent-error {
  color: var(--kdc-danger, #ff8b92);
}

html[data-kdc-theme="dark"] body.kdc-contests-body .kdc-native-checkout__notice {
  color: #ffd27a;
}

html[data-kdc-theme="dark"] body.kdc-contests-body .kdc-native-checkout__result.is-success {
  color: var(--kdc-success, #7bd5b2);
}

html[data-kdc-theme="dark"] body.kdc-contests-body .kdc-native-checkout__widget {
  background: var(--kdc-surface, #171b1e);
}

html[data-kdc-theme="dark"] body.kdc-contests-body .kdc-native-checkout__spinner {
  border-color: rgba(255, 244, 226, 0.22);
  border-top-color: var(--kdc-teal, #74cfc3);
}

html[data-kdc-theme="dark"] body.kdc-contests-body .kdc-native-modal-footer {
  border-top-color: var(--kdc-line-strong, rgba(255, 244, 226, 0.24));
}

html[data-kdc-theme="dark"] body.kdc-contests-body .kdc-native-checkout .kdc-button:disabled,
html[data-kdc-theme="dark"] body.kdc-contests-body .kdc-native-modal-footer .kdc-button:disabled {
  border-color: var(--kdc-line-strong, rgba(255, 244, 226, 0.24));
  background: rgba(255, 244, 226, 0.08);
  color: var(--kdc-muted, #b9b5ae);
  opacity: 1;
}

html[data-kdc-theme="dark"] body.kdc-contests-body .kdc-native-modal-footer .kdc-button.is-danger:disabled {
  border-color: #a72a32;
  background: #842129;
  color: #fff;
}

html[data-kdc-theme="dark"] body.kdc-contests-body .kdc-native-checkout :focus-visible,
html[data-kdc-theme="dark"] body.kdc-contests-body .kdc-native-modal-footer :focus-visible {
  outline-color: rgba(116, 207, 195, 0.72);
}

@media (prefers-reduced-motion: reduce) {
  .kdc-native-checkout__spinner {
    animation: none;
  }
}

/* Native checkout only: keep actions below the independently scrolling content. */
.kdc-modal.has-native-checkout-layout {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  overflow: hidden;
  padding-bottom: 0;
}

.kdc-native-modal-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.kdc-native-modal-footer {
  flex: 0 0 auto;
  position: relative;
  z-index: 2;
  margin-top: 8px;
  padding: 10px 0 max(14px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--kdc-border, #d9dce2);
  background: var(--kdc-surface, #fff);
}

.kdc-native-modal-footer[hidden] {
  display: none !important;
}

.kdc-native-checkout {
  gap: 8px;
  margin-top: 8px;
}

.kdc-native-checkout__footer-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.kdc-native-checkout__footer-actions > .kdc-button,
.kdc-native-modal-footer .kdc-native-checkout__cancel-controls > .kdc-button {
  min-height: 40px;
}

.kdc-native-modal-footer .kdc-native-checkout__cancel-controls {
  margin-top: 0;
}

.kdc-modal.has-native-checkout-layout h2 {
  margin-bottom: 12px;
}

@media (max-width: 640px) {
  .kdc-modal.is-native-summary {
    max-height: calc(100vh - 20px);
    max-height: calc(100dvh - 20px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    padding: 20px 14px 0;
  }

  .kdc-modal.is-native-summary > .kdc-native-modal-footer {
    padding-top: 8px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }

  .kdc-modal.has-native-checkout-layout {
    max-height: calc(100vh - 20px);
    max-height: calc(100dvh - 20px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    padding: 20px 14px 0;
  }

  .kdc-native-modal-footer {
    padding-top: 8px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }
}
