/* KTS v1.5.4 — full-site contrast system and rhythm guard
   Loaded last on every HTML page. It corrects surface-specific color inheritance
   without changing data, JavaScript behavior, or page structure. */

:root {
  --kts-v154-dark-ink: #fff8ea;
  --kts-v154-dark-copy: rgba(255, 248, 234, .78);
  --kts-v154-dark-muted: rgba(255, 248, 234, .64);
  --kts-v154-light-ink: #1c160d;
  --kts-v154-light-copy: #4a4034;
  --kts-v154-gold-text: #2a1c08;
}

/* Home hero: copy added during paid-beta work must follow the dark hero surface. */
.home-v110 .product-hero .product-channel-main {
  color: var(--kts-v154-dark-ink) !important;
}

.home-v110 .product-hero .product-channel-note {
  color: var(--kts-v154-dark-copy) !important;
}

.home-v110 .product-hero .hero-price-link {
  color: #f5d996 !important;
}

.home-v110 .product-hero .btn.primary,
.home-v110 .product-hero a.btn.primary {
  color: #120f09 !important;
}

/* Preparation center: the global light-surface secondary rule must not darken
   a transparent button placed on this dark section. */
.home-v110 .preparation-section .product-section-head .btn.secondary {
  color: var(--kts-v154-dark-ink) !important;
  border-color: rgba(243, 214, 141, .42) !important;
  background: rgba(255, 255, 255, .07) !important;
}

.home-v110 .preparation-section .product-section-head .btn.secondary:hover {
  color: #fffdf8 !important;
  border-color: rgba(243, 214, 141, .68) !important;
  background: rgba(191, 143, 60, .18) !important;
}

/* Paid-beta dark card: heading had inherited the light-page heading color. */
.home-v110 .home-paid-beta-card h2,
.home-v110 .home-paid-beta-card .home-paid-beta-price strong,
.home-v110 .home-paid-beta-card .home-paid-beta-price span {
  color: var(--kts-v154-dark-ink) !important;
}

.home-v110 .home-paid-beta-card > div > p:not(.product-kicker),
.home-v110 .home-paid-beta-card .home-paid-beta-price small {
  color: var(--kts-v154-dark-copy) !important;
}

.home-v110 .home-paid-beta-card .btn.light {
  color: var(--kts-v154-light-ink) !important;
  background: #fffdf8 !important;
}

.home-v110 .home-paid-beta-card .btn.ghost {
  color: var(--kts-v154-dark-ink) !important;
  border-color: rgba(243, 214, 141, .34) !important;
  background: rgba(255, 255, 255, .065) !important;
}

.home-v110 .home-paid-beta-card .btn.ghost:hover {
  border-color: rgba(243, 214, 141, .58) !important;
  background: rgba(191, 143, 60, .16) !important;
}

/* Bottom dark CTA keeps one light button and one readable ghost button. */
.home-v110 .product-cta .btn.light {
  color: var(--kts-v154-light-ink) !important;
  background: #fffdf8 !important;
}

.home-v110 .product-cta .btn.ghost {
  color: var(--kts-v154-dark-ink) !important;
  border-color: rgba(243, 214, 141, .34) !important;
  background: rgba(255, 255, 255, .065) !important;
}

/* Policy center CTA: mint/gold action surfaces require dark text. */
.policy-page .policy-cta-panel .btn.primary {
  color: #08231f !important;
  background: #9fe3d8 !important;
  border-color: rgba(255, 255, 255, .55) !important;
}

.policy-page .policy-cta-panel .btn.primary:hover {
  color: #061a17 !important;
  background: #b4eee5 !important;
}

.policy-page .policy-cta-panel .btn.secondary {
  color: #0f211f !important;
  background: #fffdf8 !important;
}

/* Dashboard gold primary buttons: v1.5.2's generic white text rule reduced contrast. */
body.dashboard-v111 #nextActionBtn,
body.dashboard-v091 .command-actions .btn.primary {
  color: var(--kts-v154-gold-text) !important;
}

body.dashboard-v111 .workflow-actions-card .btn.secondary {
  color: var(--kts-v154-dark-ink) !important;
  border-color: rgba(243, 214, 141, .24) !important;
  background: rgba(255, 255, 255, .065) !important;
}

body.dashboard-v111 .workflow-actions-card .btn.secondary:hover {
  border-color: rgba(243, 214, 141, .45) !important;
  background: rgba(191, 143, 60, .14) !important;
}

/* Keep compact onboarding buttons readable and vertically balanced. */
body.dashboard-v111 .onboarding-step-v110 button {
  line-height: 1.35 !important;
}

/* Surface-aware heading/copy contracts used by the public/admin dark cards. */
:is(
  .home-v110 .preparation-section,
  .home-v110 .home-paid-beta-card,
  .home-v110 .product-cta,
  .policy-page .policy-cta-panel,
  body.dashboard-v111 .workflow-actions-card
) :is(h1, h2, h3) {
  text-wrap: balance;
}

:is(
  .home-v110 .preparation-section,
  .home-v110 .home-paid-beta-card,
  .home-v110 .product-cta,
  .policy-page .policy-cta-panel,
  body.dashboard-v111 .workflow-actions-card
) p {
  text-wrap: pretty;
}

/* Final form rhythm guard. */
:where(.check, .core-check, .question-item, .consent-line, .checkline, .checkbox-fieldset label, .setup-list label) {
  column-gap: 11px !important;
}

:where(.check, .core-check, .question-item, .consent-line, .checkline, .checkbox-fieldset label, .setup-list label) > input[type="checkbox"],
:where(.check, .core-check, .question-item, .consent-line, .checkline, .checkbox-fieldset label, .setup-list label) > input[type="radio"] {
  margin-top: .15em !important;
}

/* Focus visibility across light and dark surfaces. */
:where(a, button, input, select, textarea):focus-visible {
  outline: 3px solid rgba(191, 143, 60, .48);
  outline-offset: 3px;
}

@media (max-width: 640px) {
  .home-v110 .home-paid-beta-card h2 {
    line-height: 1.16 !important;
  }

  .home-v110 .home-paid-beta-actions,
  .home-v110 .product-cta-actions,
  .policy-page .policy-cta-panel .tool-actions {
    gap: 9px !important;
  }

  .home-v110 .home-paid-beta-actions .btn,
  .home-v110 .product-cta-actions .btn,
  .policy-page .policy-cta-panel .btn {
    min-height: 48px;
  }
}
