/* ==========================================================================
 * AI final visual QA layer
 * Loaded last. This file is intentionally additive and reversible: it unifies
 * the visual system without deleting earlier component, WooCommerce, account,
 * affiliate, support, or pricing code.
 * ========================================================================== */

:root {
  --mk-polish-bg-0: #02030a;
  --mk-polish-bg-1: #050716;
  --mk-polish-bg-2: #0a0f1f;
  --mk-polish-panel: rgba(8, 13, 28, .78);
  --mk-polish-panel-strong: rgba(11, 18, 38, .9);
  --mk-polish-edge: rgba(155, 196, 255, .18);
  --mk-polish-edge-strong: rgba(0, 229, 255, .34);
  --mk-polish-text: #eef3ff;
  --mk-polish-muted: rgba(201, 211, 232, .78);
  --mk-polish-soft: rgba(201, 211, 232, .62);
  --mk-polish-shadow: 0 26px 72px -34px rgba(0, 229, 255, .42), 0 34px 90px -46px rgba(0, 0, 0, .82);
  --mk-polish-card-radius: 20px;
}

/* AI unified fintech background system */
html,
body.mk-theme-shell,
body.mk-theme-shell.home,
body.mk-theme-shell.woocommerce,
body.mk-theme-shell.woocommerce-page {
  background-color: var(--mk-polish-bg-0);
}

body.mk-theme-shell {
  background-image:
    radial-gradient(circle at 12% -4%, rgba(0, 229, 255, .14), transparent min(44vw, 560px)),
    radial-gradient(circle at 86% 4%, rgba(20, 241, 149, .10), transparent min(40vw, 520px)),
    radial-gradient(circle at 50% 38%, rgba(139, 92, 246, .085), transparent min(46vw, 620px)),
    linear-gradient(rgba(255, 255, 255, .018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .018) 1px, transparent 1px),
    linear-gradient(180deg, var(--mk-polish-bg-1) 0%, var(--mk-polish-bg-0) 48%, var(--mk-polish-bg-1) 100%);
  background-size: auto, auto, auto, 64px 64px, 64px 64px, auto;
  background-attachment: scroll;
}

body.mk-theme-shell #mkpt-main-content {
  position: relative;
  background: transparent;
  overflow: clip;
}

body.mk-theme-shell .mk-home-page--v6,
body.mk-theme-shell .mk-shop-page,
body.mk-theme-shell .mk-single-product-page,
body.mk-theme-shell .mk-account,
body.mk-theme-shell .woocommerce,
body.mk-theme-shell .woocommerce-page {
  background: transparent;
}

/* AI duplicate background neutralizer */
body.mk-theme-shell .mk-home-page--v6,
body.mk-theme-shell .mk-pricing-section,
body.mk-theme-shell .mk-final-cta-v6,
body.mk-theme-shell .mk-premium-footer--v6,
body.mk-theme-shell .mk-page-hero,
body.mk-theme-shell .mk-section {
  background-color: transparent;
}

body.mk-theme-shell .mk-hero--v6,
body.mk-theme-shell .mk-pricing-section,
body.mk-theme-shell .mk-final-cta-v6 {
  background: transparent;
}

body.mk-theme-shell .mk-internal-hero::before {
  background:
    radial-gradient(circle at 12% 18%, rgba(0, 229, 255, .12), transparent 30%),
    radial-gradient(circle at 88% 8%, rgba(20, 241, 149, .09), transparent 28%),
    radial-gradient(circle at 52% 100%, rgba(139, 92, 246, .08), transparent 34%);
  opacity: .88;
}

body.mk-theme-shell .mk-hero-bg-grid {
  opacity: .52;
  background-size: 64px 64px;
}

body.mk-theme-shell .mk-hero-bg-glow,
body.mk-theme-shell .mk-pricing-bg-glow,
body.mk-theme-shell .mk-final-cta-bg-glow,
body.mk-theme-shell .mk-live-pairs-bg-glow,
body.mk-theme-shell .mk-product-preview-bg-glow,
body.mk-theme-shell .mk-security-bg-glow {
  opacity: .36;
  filter: blur(120px);
}

/* AI section rhythm normalizer */
body.mk-theme-shell .mk-section,
body.mk-theme-shell .mk-home-page--v6 .mk-section,
body.mk-theme-shell .mk-pricing-section {
  padding-block: clamp(62px, 7vw, 96px);
}

body.mk-theme-shell .mk-section-tight {
  padding-block: clamp(42px, 5vw, 70px);
}

body.mk-theme-shell .mk-page-hero,
body.mk-theme-shell .mk-internal-hero {
  padding-block: clamp(84px, 8vw, 124px) clamp(44px, 5vw, 74px);
}

body.mk-theme-shell .mk-hero--v6 {
  padding-block: clamp(92px, 11vw, 150px) clamp(58px, 7vw, 92px);
}

body.mk-theme-shell .mk-section-header,
body.mk-theme-shell .mk-home-page--v6 .mk-section-header,
body.mk-theme-shell .mk-pricing-header,
body.mk-theme-shell .mk-pricing-page-header {
  max-width: 820px;
  margin-bottom: clamp(26px, 4vw, 46px);
}

body.mk-theme-shell .mk-section-header h1,
body.mk-theme-shell .mk-section-header h2,
body.mk-theme-shell .mk-pricing-title,
body.mk-theme-shell .mk-hero-title,
body.mk-theme-shell .mk-internal-copy h1 {
  text-wrap: balance;
}

body.mk-theme-shell .mk-section-header p,
body.mk-theme-shell .mk-home-page--v6 .mk-section-header p,
body.mk-theme-shell .mk-pricing-intro,
body.mk-theme-shell .mk-internal-copy p {
  color: var(--mk-polish-muted);
  text-wrap: pretty;
}

/* AI card rhythm normalizer */
body.mk-theme-shell .mk-card,
body.mk-theme-shell .mk-card-premium,
body.mk-theme-shell .mk-tier-card,
body.mk-theme-shell .mk-bento-card,
body.mk-theme-shell .mk-pair-card,
body.mk-theme-shell .mk-security-card,
body.mk-theme-shell .mk-trust-card,
body.mk-theme-shell .mk-final-cta-card,
body.mk-theme-shell .mkpt-support-form,
body.mk-theme-shell .mk-account-card,
body.mk-theme-shell .woocommerce ul.products li.product,
body.mk-theme-shell .wc-block-cart,
body.mk-theme-shell .wc-block-checkout,
body.mk-theme-shell .woocommerce-checkout-review-order,
body.mk-theme-shell .woocommerce-MyAccount-content {
  min-width: 0;
  border-color: var(--mk-polish-edge);
  border-radius: var(--mk-polish-card-radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .072), rgba(255, 255, 255, .032)),
    linear-gradient(145deg, var(--mk-polish-panel), rgba(3, 5, 14, .86));
  box-shadow: var(--mk-polish-shadow);
}

body.mk-theme-shell .mk-tier-card.is-best-value,
body.mk-theme-shell .mk-tier-card--advanced,
body.mk-theme-shell .mk-final-cta-card {
  border-color: var(--mk-polish-edge-strong);
  box-shadow: 0 34px 90px -34px rgba(0, 229, 255, .5), 0 40px 110px -56px rgba(139, 92, 246, .48);
}

body.mk-theme-shell .mk-card,
body.mk-theme-shell .mk-card-premium,
body.mk-theme-shell .mk-tier-card,
body.mk-theme-shell .mk-bento-card,
body.mk-theme-shell .mk-pair-card,
body.mk-theme-shell .mk-security-card,
body.mk-theme-shell .mk-trust-card,
body.mk-theme-shell .mkpt-support-form {
  padding: clamp(22px, 2.8vw, 32px);
}

body.mk-theme-shell .mk-grid-2,
body.mk-theme-shell .mk-grid-3,
body.mk-theme-shell .mk-grid-4,
body.mk-theme-shell .mk-grid-6,
body.mk-theme-shell .mk-feature-grid,
body.mk-theme-shell .mk-benefit-grid,
body.mk-theme-shell .mk-proof-grid,
body.mk-theme-shell .mk-post-grid,
body.mk-theme-shell .mk-internal-card-grid,
body.mk-theme-shell .mk-internal-timeline,
body.mk-theme-shell .mk-pricing-grid,
body.mk-theme-shell .mk-pricing-grid--saas,
body.mk-theme-shell .woocommerce ul.products {
  gap: clamp(16px, 2vw, 24px);
  align-items: stretch;
}

body.mk-theme-shell .mk-card h2,
body.mk-theme-shell .mk-card-premium h2,
body.mk-theme-shell .mk-card h3,
body.mk-theme-shell .mk-card-premium h3,
body.mk-theme-shell .mk-tier-name,
body.mk-theme-shell .mk-bento-card-title,
body.mk-theme-shell .mk-security-title,
body.mk-theme-shell .woocommerce-loop-product__title {
  max-width: 100%;
  overflow-wrap: anywhere;
  line-height: 1.12;
  text-wrap: balance;
}

body.mk-theme-shell .mk-card p,
body.mk-theme-shell .mk-card-premium p,
body.mk-theme-shell .mk-tier-tagline,
body.mk-theme-shell .mk-tier-feature-text,
body.mk-theme-shell .mk-bento-card-body,
body.mk-theme-shell .mk-security-body,
body.mk-theme-shell .woocommerce ul.products li.product p {
  max-width: 68ch;
  color: var(--mk-polish-muted);
  line-height: 1.62;
  overflow-wrap: anywhere;
}

body.mk-theme-shell .mk-card-icon,
body.mk-theme-shell .mk-step-number,
body.mk-theme-shell .mk-product-icon {
  flex: 0 0 auto;
  box-shadow: 0 16px 36px -18px rgba(20, 241, 149, .7);
}

body.mk-theme-shell .mk-glass-button,
body.mk-theme-shell .mk-button-3d,
body.mk-theme-shell .mk-button-ghost-3d,
body.mk-theme-shell .mk-tier-cta,
body.mk-theme-shell .woocommerce a.button,
body.mk-theme-shell .woocommerce button.button,
body.mk-theme-shell .woocommerce input.button,
body.mk-theme-shell .wc-block-components-button {
  min-width: 0;
  white-space: normal;
  text-align: center;
  line-height: 1.16;
}

body.mk-theme-shell .mk-button-row,
body.mk-theme-shell .mk-hero-actions,
body.mk-theme-shell .mk-final-cta-actions,
body.mk-theme-shell .mk-section-actions {
  gap: clamp(10px, 1.8vw, 14px);
}

body.mk-theme-shell .mk-tier-duration-options {
  gap: 8px;
}

body.mk-theme-shell .mk-tier-duration-option {
  min-width: 0;
  min-height: 56px;
  line-height: 1.15;
}

/* AI reveal fail-safe */
body.mk-theme-shell [data-mk-reveal],
body.mk-theme-shell .mk-reveal,
body.mk-theme-shell [data-mk-reveal].is-visible,
body.mk-theme-shell .mk-reveal.is-visible {
  opacity: 1;
  transform: none;
}

body.mk-theme-shell [data-mk-reveal],
body.mk-theme-shell .mk-reveal {
  transition-property: border-color, box-shadow, transform, background-color;
}

body.mk-theme-shell .mk-card:hover,
body.mk-theme-shell .mk-tier-card:hover,
body.mk-theme-shell .mk-bento-card:hover,
body.mk-theme-shell .mk-pair-card:hover,
body.mk-theme-shell .mk-security-card:hover,
body.mk-theme-shell .mk-trust-card:hover,
body.mk-theme-shell .woocommerce ul.products li.product:hover {
  transform: translateY(-3px);
}

/* AI WooCommerce visual stabilizer */
body.mk-theme-shell.woocommerce-page .woocommerce,
body.mk-theme-shell.woocommerce .woocommerce {
  color: var(--mk-polish-text);
}

body.mk-theme-shell .woocommerce ul.products,
body.mk-theme-shell .woocommerce-page ul.products,
body.mk-theme-shell .woocommerce ul.products[class*="columns-"],
body.mk-theme-shell .woocommerce-page ul.products[class*="columns-"] {
  display: grid;
  width: 100%;
  margin: 0;
  padding: 0;
}

body.mk-theme-shell .woocommerce ul.products li.product,
body.mk-theme-shell .woocommerce-page ul.products li.product,
body.mk-theme-shell .woocommerce ul.products[class*="columns-"] li.product,
body.mk-theme-shell .woocommerce-page ul.products[class*="columns-"] li.product {
  float: none;
  clear: none;
  width: auto;
  margin: 0;
  list-style: none;
}

body.mk-theme-shell .woocommerce-notices-wrapper,
body.mk-theme-shell .woocommerce .woocommerce-error,
body.mk-theme-shell .woocommerce .woocommerce-info,
body.mk-theme-shell .woocommerce .woocommerce-message {
  margin-bottom: 18px;
}

body.mk-theme-shell .woocommerce-error,
body.mk-theme-shell .woocommerce-info,
body.mk-theme-shell .woocommerce-message,
body.mk-theme-shell .wc-block-components-notice-banner {
  border-radius: 16px;
  border-color: var(--mk-polish-edge);
  color: var(--mk-polish-text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .035)),
    rgba(8, 13, 28, .86);
}

body.mk-theme-shell .woocommerce form .form-row input.input-text,
body.mk-theme-shell .woocommerce form .form-row textarea,
body.mk-theme-shell .woocommerce form .form-row select,
body.mk-theme-shell .woocommerce input[type="text"],
body.mk-theme-shell .woocommerce input[type="email"],
body.mk-theme-shell .woocommerce input[type="tel"],
body.mk-theme-shell .woocommerce input[type="password"],
body.mk-theme-shell .woocommerce textarea,
body.mk-theme-shell .woocommerce select,
body.mk-theme-shell input,
body.mk-theme-shell textarea,
body.mk-theme-shell select {
  max-width: 100%;
}

/* AI mobile overlay clearance */
@media (max-width: 1180px) {
  body.mk-theme-shell .mk-nav {
    max-height: min(76vh, 680px);
    overflow-y: auto;
  }
}

@media (max-width: 760px) {
  body.mk-theme-shell {
    background-image:
      radial-gradient(circle at 10% 0%, rgba(0, 229, 255, .12), transparent 360px),
      radial-gradient(circle at 100% 8%, rgba(20, 241, 149, .085), transparent 320px),
      linear-gradient(rgba(255, 255, 255, .015) 1px, transparent 1px),
      linear-gradient(90deg, rgba(255, 255, 255, .015) 1px, transparent 1px),
      linear-gradient(180deg, var(--mk-polish-bg-1) 0%, var(--mk-polish-bg-0) 54%, var(--mk-polish-bg-1) 100%);
    background-size: auto, auto, 56px 56px, 56px 56px, auto;
  }

  body.mk-theme-shell .mk-section,
  body.mk-theme-shell .mk-home-page--v6 .mk-section,
  body.mk-theme-shell .mk-pricing-section {
    padding-block: 48px;
  }

  body.mk-theme-shell .mk-section-tight {
    padding-block: 38px;
  }

  body.mk-theme-shell .mk-page-hero,
  body.mk-theme-shell .mk-internal-hero {
    padding-block: 88px 42px;
  }

  body.mk-theme-shell .mk-hero--v6 {
    padding-block: 88px 50px;
  }

  body.mk-theme-shell .mk-section-header,
  body.mk-theme-shell .mk-home-page--v6 .mk-section-header,
  body.mk-theme-shell .mk-pricing-header,
  body.mk-theme-shell .mk-pricing-page-header {
    margin-bottom: 24px;
  }

  body.mk-theme-shell .mk-section-header h2,
  body.mk-theme-shell .mk-home-page--v6 .mk-section-header h2,
  body.mk-theme-shell .mk-pricing-title {
    font-size: clamp(1.85rem, 9vw, 2.7rem);
  }

  body.mk-theme-shell .mk-internal-copy h1,
  body.mk-theme-shell .mk-page-hero h1,
  body.mk-theme-shell .mk-hero-title {
    font-size: clamp(2.25rem, 12vw, 3.7rem);
    line-height: 1.04;
  }

  body.mk-theme-shell .mk-card,
  body.mk-theme-shell .mk-card-premium,
  body.mk-theme-shell .mk-tier-card,
  body.mk-theme-shell .mk-bento-card,
  body.mk-theme-shell .mk-pair-card,
  body.mk-theme-shell .mk-security-card,
  body.mk-theme-shell .mk-trust-card,
  body.mk-theme-shell .mkpt-support-form,
  body.mk-theme-shell .woocommerce ul.products li.product {
    padding: 20px;
    border-radius: 18px;
  }

  body.mk-theme-shell .mk-grid-2,
  body.mk-theme-shell .mk-grid-3,
  body.mk-theme-shell .mk-grid-4,
  body.mk-theme-shell .mk-grid-6,
  body.mk-theme-shell .mk-feature-grid,
  body.mk-theme-shell .mk-benefit-grid,
  body.mk-theme-shell .mk-proof-grid,
  body.mk-theme-shell .mk-post-grid,
  body.mk-theme-shell .mk-internal-card-grid,
  body.mk-theme-shell .mk-internal-timeline,
  body.mk-theme-shell .mk-pricing-grid,
  body.mk-theme-shell .mk-pricing-grid--saas,
  body.mk-theme-shell .woocommerce ul.products {
    gap: 16px;
  }

  body.mk-theme-shell .mk-button-row .mk-glass-button,
  body.mk-theme-shell .mk-hero-actions .mk-glass-button,
  body.mk-theme-shell .mk-final-cta-actions .mk-glass-button,
  body.mk-theme-shell .mk-section-actions .mk-glass-button,
  body.mk-theme-shell .mk-tier-cta,
  body.mk-theme-shell .woocommerce a.button,
  body.mk-theme-shell .woocommerce button.button,
  body.mk-theme-shell .woocommerce input.button,
  body.mk-theme-shell .wc-block-components-button {
    width: 100%;
  }

  body.mk-theme-shell .mk-header-actions .mk-account-link,
  body.mk-theme-shell .mk-header-actions .mk-cart-link {
    width: 42px;
    min-width: 42px;
    max-width: 42px;
  }

  body.mk-theme-shell .mk-pricing-bg,
  body.mk-theme-shell .mk-final-cta-bg,
  body.mk-theme-shell .mk-live-pairs-bg,
  body.mk-theme-shell .mk-product-preview-bg,
  body.mk-theme-shell .mk-security-bg {
    opacity: .55;
  }

  body.mk-theme-shell .mk-hero-bg-glow,
  body.mk-theme-shell .mk-pricing-bg-glow,
  body.mk-theme-shell .mk-final-cta-bg-glow,
  body.mk-theme-shell .mk-live-pairs-bg-glow,
  body.mk-theme-shell .mk-product-preview-bg-glow,
  body.mk-theme-shell .mk-security-bg-glow {
    opacity: .22;
    filter: blur(90px);
  }

  body.mk-theme-shell .mk-floating-support {
    right: 10px;
    bottom: 92px;
  }

  body.mk-theme-shell.woocommerce-checkout .mk-floating-support,
  body.mk-theme-shell.woocommerce-cart .mk-floating-support {
    display: none;
  }

  body.mk-theme-shell .mk-site-popup,
  body.mk-theme-shell .mkpt-site-popup,
  body.mk-theme-shell .mkpt-rb-floating-card {
    display: none !important;
  }
}

@media (max-width: 430px) {
  body.mk-theme-shell .mk-section,
  body.mk-theme-shell .mk-home-page--v6 .mk-section,
  body.mk-theme-shell .mk-pricing-section {
    padding-block: 42px;
  }

  body.mk-theme-shell .mk-card,
  body.mk-theme-shell .mk-card-premium,
  body.mk-theme-shell .mk-tier-card,
  body.mk-theme-shell .mk-bento-card,
  body.mk-theme-shell .mk-pair-card,
  body.mk-theme-shell .mk-security-card,
  body.mk-theme-shell .mk-trust-card,
  body.mk-theme-shell .mkpt-support-form,
  body.mk-theme-shell .woocommerce ul.products li.product {
    padding: 18px;
  }

  body.mk-theme-shell .mk-tier-duration-options {
    grid-template-columns: 1fr;
  }

  body.mk-theme-shell .mk-tier-price {
    flex-wrap: wrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.mk-theme-shell .mk-card:hover,
  body.mk-theme-shell .mk-tier-card:hover,
  body.mk-theme-shell .mk-bento-card:hover,
  body.mk-theme-shell .mk-pair-card:hover,
  body.mk-theme-shell .mk-security-card:hover,
  body.mk-theme-shell .mk-trust-card:hover,
  body.mk-theme-shell .woocommerce ul.products li.product:hover {
    transform: none;
  }
}

/* AI market data state badges */
.mk-market-state-last_session .mk-pair-live-dot,
.mk-market-state-delayed .mk-pair-live-dot,
.mk-market-state-reference .mk-pair-live-dot,
.mk-market-state-error_stale .mk-pair-live-dot {
  background: #f5b441;
  box-shadow: 0 0 16px rgba(245, 180, 65, .46);
}

.mk-market-state-preview .mk-pair-live-dot {
  background: rgba(186, 200, 230, .7);
  box-shadow: none;
}

.mk-market-source {
  display: inline-flex;
  margin-left: .45rem;
  color: var(--mk-cyan, #00e5ff);
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 760px) {
  .mk-market-source {
    display: table;
    margin: 6px auto 0;
  }
}
