html {
  scroll-behavior: smooth;
  scroll-padding-top: 100px;
  overflow-x: clip !important;
}

body {
  overflow-x: clip !important;
}

/* ============================================================
   PREMIUM TRANSFORMATION SHARED SYSTEM v2.6 (2026-05-28)
   Principal UI/UX Quality Directive: Top 1% Grade (Responsive-First)
   ============================================================ */

:root {
  --hero-bg: var(--bg-deep);
  --h1-size-home: clamp(2.6rem, 7.5vw, 6.2rem);       
  --h1-size-product: clamp(2rem, 5vw, 3.2rem); 
  --sub-size: clamp(0.95rem, 1.8vw, 1.15rem);
  --font-mono: 'JetBrains Mono', monospace;
  --ease-premium: var(--ease-canonical);
  /* NOTE: do NOT redefine --teal here. --teal is the canonical brand constant owned by
     crowagent-brand-tokens.css (#0CC9A8). A former `--teal: var(--accent)` override only ever
     won on pages where brand-tokens loaded BEFORE this file (about/roadmap/security), where it
     collapsed --teal to empty (--accent → var(--brand-core), undefined on generic pages) and
     transparent-ised the nav + cookie CTAs. Per-product theming consumes --accent directly. */
}

/* ── PERMANENT HERO REBUILD (Responsive Stability) ── */
.ca-hero-title-premium,
.ca-hero-title {
  font-family: 'Plus Jakarta Sans', sans-serif !important;
  display: block !important;
  text-align: center !important;
  width: 100% !important;
  max-width: 1300px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  color: var(--white) !important;
  opacity: 1 !important; 
  visibility: visible !important;
}

/* Phrase Wrappers (Controlled Nowrap) */
.ca-hero-title-premium span,
.ca-hero-title span {
  display: inline-block !important; 
  white-space: nowrap !important;   
  background: linear-gradient(to bottom, var(--white) 30%, rgba(255, 255, 255, 0.5) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  opacity: 1 !important;
  visibility: visible !important;
  margin: 0 0.1em;
  will-change: transform, opacity;
}

/* FB-10: Prevent additive spacing on nested spans.
   LM-126: Ensure .word spans maintain inline-block to prevent mid-word breaks. */
.ca-hero-title-premium span span,
.ca-hero-title span span {
  margin: 0 !important;
  display: inline-block !important; /* Changed from inline to prevent mid-word breaks */
  white-space: nowrap !important;
}

/* LM-090: Force sub-nav stickiness */
nav[aria-label="Product suite navigation"] {
  display: none;
  position: sticky !important;
  top: 72px !important;
  z-index: var(--z-overlay) !important;
  background: rgba(4, 14, 26, 0.95) !important;
  backdrop-filter: blur(12px) !important;
}

@media (min-width: 1024px) {
  nav[aria-label="Product suite navigation"] {
    display: block !important;
  }
}

/* LM-090: Missing responsive display utilities */
@media (min-width: 1024px) {
  .lg\:block { display: block !important; }
  .lg\:flex { display: flex !important; }
  .lg\:grid { display: grid !important; }
  .lg\:hidden { display: none !important; }
}

/* LM-161: Tap Target Expansion (WCAG 2.5.8 + Premium UX) */
.ca-footer .footer-links a,
.ca-footer .footer-bottom-link {
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 4px 0;
}
.foot-social a {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
nav[aria-label="Breadcrumb"] a,
nav[aria-label="Breadcrumb"] span {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

/* LM-162: Button Overflow Prevention (regulatory-updates) */
.sv-btn {
  max-width: 100% !important;
  text-wrap: balance;
  white-space: normal !important;
  text-align: center;
}

/* LM-163: Glossary Search Input Constraints */
.glossary-search-input {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* LM-164: Hero Element Overflow Fixes (pricing/about) */
.ca-hero, .ca-main-transformation > section:first-of-type {
  overflow: hidden !important;
}
.ca-hero-glow {
  max-width: 100vw;
}
@media (max-width: 360px) {
  .ca-eyebrow {
    flex-wrap: wrap !important;
    max-width: 100% !important;
    height: auto !important;
    padding: 8px 16px !important;
  }
}

/* Mobile Typography Relaxing (Zero Horizontal Scroll) */
@media (max-width: 768px) {
  .ca-hero-title-premium span,
  .ca-hero-title span {
    white-space: normal !important; /* Allow wrapping on mobile */
    display: block !important;
  }
  .ca-hero-title-premium span span,
  .ca-hero-title span span {
    white-space: normal !important;
    display: inline !important; /* Allow natural wrapping within words if forced on mobile */
  }
}

.ca-hero-eyebrow {
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
  padding: 6px 16px !important;
  border-radius: 9999px !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  background: var(--white-05) !important;
  font-size: var(--text-xs) !important;
  font-weight: 900 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.2em !important;
}

.word { display: inline-block !important; white-space: nowrap !important; }
.char { display: inline-block !important; white-space: pre !important; opacity: 1 !important; }
.char--punct { margin-left: -0.1em !important; } /* LM-149: Tighten trailing punctuation */

/* ── CAROUSEL STABILITY (Cinematic Slab LM-152) ── */
[data-pcar] {
  opacity: 1 !important;
  visibility: visible !important;
  display: block !important;
  min-height: 250px;
  position: relative;
  z-index: var(--z-content);
  perspective: 2000px;
}

.ca-showcase-frame {
  transform-style: preserve-3d;
  transition: transform 0.1s ease-out;
}

.ca-viewport {
  overflow: hidden;
  position: relative;
  background: var(--bg);
  width: 100%;
  aspect-ratio: 16 / 10; /* Updated for taller slab */
  border-radius: 24px !important;
  border: 1px solid var(--white-05);
  box-shadow: inset 0 0 40px rgba(0,0,0,0.5);
}

.pcar__slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.9s var(--ease-premium), visibility 0.9s;
  transform: scale(1.05);
}

.pcar__slide.is-active {
  opacity: 1;
  visibility: visible;
  position: relative; 
  transform: scale(1);
}

/* Unified Context Bar (LM-152) */
.pcar__caption {
  font-family: 'Plus Jakarta Sans', sans-serif;
  color: var(--white) !important;
  margin: 0 !important;
  height: auto !important;
}

.ca-glass-premium {
  background: rgba(10, 31, 58, 0.8) !important;
  backdrop-filter: blur(20px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
}

.pcar__tab {
  cursor: pointer;
  border: none;
  padding: 0;
  outline: none;
}

.pcar__tab.on, .pcar__tab[aria-selected="true"] {
  background-color: var(--teal) !important;
  width: 12px !important;
  border-radius: 4px !important;
}

/* ── STRIPE-GRADE CARDS (Responsive Padding) ── */
.ca-card, .sv-block {
  background: rgba(255, 255, 255, 0.02) !important;
  border: 1px solid var(--white-08) !important;
  backdrop-filter: blur(16px) !important;
  box-shadow: 
    0 0 0 1px var(--white-05) inset,
    0 10px 30px -10px rgba(0, 0, 0, 0.5) !important;
  transition: all 0.5s var(--ease-premium) !important;
  border-radius: 20px !important;
  padding: clamp(1.5rem, 4vw, 3rem) !important;
}

@media (max-width: 480px) {
  .ca-card, .sv-block { padding: 1.5rem !important; }
}

.ca-card:hover {
  transform: translateY(-4px) scale(1.01) !important;
  border-color: rgba(12, 201, 168, 0.4) !important;
}

/* Force dark text on white-background cards (LM-005) */
.ca-card.\!bg-white, 
.ca-card[class*="!bg-white"]:not([class*="bg-white/"]) { 
  color: var(--bg) !important; 
}
.ca-card.\!bg-white *, 
.ca-card[class*="!bg-white"]:not([class*="bg-white/"]) * { 
  color: var(--bg) !important; 
}

/* ── BUTTONS (Touch Targets) ── (.sv-btn co-selected — unified primitive) ── */
.sv-btn, .sv-btn {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 32px !important;
  border-radius: 12px !important;
  font-weight: 700 !important;
  transition: all 0.3s var(--ease-premium);
}

@media (max-width: 480px) {
  .sv-btn, .sv-btn { width: 100% !important; max-width: 340px; margin-inline: auto; }
  .ca-hero-btns { flex-direction: column !important; gap: var(--space-3) !important; }
}

/* ── PRICING SWITCHER (Horizontal Scroll Mobile) ── */
.ptabs {
  background: var(--white-03);
  padding: 6px !important;
  border-radius: 100px;
  border: 1px solid var(--white-05);
  display: inline-flex !important;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}
.ptabs::-webkit-scrollbar { display: none; }

/* ── ACCESSIBILITY & CONTRAST ── */
.ca-hero-desc,
.ca-hero-desc-premium {
  font-size: var(--sub-size) !important;
  color: rgba(255, 255, 255, 0.55) !important;
  max-width: 750px;
  margin: 0 auto 48px;
  line-height: 1.7 !important;
  opacity: 1 !important;
}

.ca-section-light { background: var(--white) !important; color: var(--bg) !important; }
.ca-section-light * { color: var(--bg) !important; }

/* ── LM-041: Sitewide White-on-White Systemic Fix ── */

/* 1. Force dark text and clear transparent fills in all light contexts */
.ca-section-light,
section.ca-section-light,
section.bg-white,
section.\!bg-white,
.f8-resources section:nth-child(even),
[data-theme="light"] section {
  background-color: var(--white) !important;
  color: var(--bg) !important;
}

.ca-section-light *,
section.ca-section-light *,
section.bg-white *,
section.\!bg-white *,
.f8-resources section:nth-child(even) *,
[data-theme="light"] section * {
  color: var(--bg) !important;
  -webkit-text-fill-color: var(--bg) !important;
  background-clip: border-box !important;
  -webkit-background-clip: border-box !important;
}

/* 2. Special handling for Hero Title spans (gradients) in light contexts */
.ca-section-light .ca-hero-title span,
.ca-section-light .ca-hero-title-premium span,
section.bg-white .ca-hero-title span,
section.\!bg-white .ca-hero-title span {
  background: none !important;
  -webkit-text-fill-color: var(--bg) !important;
  color: var(--bg) !important;
}

/* 3. Force dark text on white-background cards (LM-005 extension) */
.ca-card.\!bg-white,
.ca-card[class*="!bg-white"]:not([class*="bg-white/"]),
.sv-block.\!bg-white {
  color: var(--bg) !important;
}

.ca-card.\!bg-white *,
.ca-card[class*="!bg-white"]:not([class*="bg-white/"]) *,
.sv-block.\!bg-white * {
  color: var(--bg) !important;
  -webkit-text-fill-color: var(--bg) !important;
}

/* 4. Restore visibility for faint/low-opacity text in light sections */
.ca-section-light .opacity-70,
.ca-section-light [class*="opacity-"],
.ca-section-light .text-white\/40,
.ca-section-light .text-white\/60,
.ca-section-light .text-slate-400,
.ca-section-light .text-slate-500,
section.bg-white .text-white\/40,
section.bg-white .text-white\/60 {
  color: var(--bg) !important;
  opacity: 1 !important;
}

/* 5. Scanner compatibility: Use opaque backgrounds for cards in light sections
   (Prevents the a11y scanner from seeing "black-on-black" due to its alpha bug) */
.ca-section-light .ca-card,
.ca-section-light .sv-block,
.ca-section-light div[class*="bg-black/"],
.ca-section-light div[class*="bg-white/"] {
  background-color: var(--ca-c-f8fafc) !important;
  backdrop-filter: none !important;
}

/* 6. Preservation: Ensure explicitly dark elements in light sections maintain white text (Fixes 1:1 contrast) */
.ca-section-light .bg-\[\var(--surface-background)\],
.ca-section-light .bg-black,
.ca-section-light .bg-slate-900,
section.bg-white [class*="bg-[var(--surface-background)]"],
section.bg-white .bg-black,
section.bg-white .bg-slate-900,
section.\!bg-white [class*="bg-[var(--surface-background)]"],
section.\!bg-white .bg-black,
section.\!bg-white .bg-slate-900,
.ca-section-light .sv-btn:not(.sv-btn-ghost):not(.sv-btn-outline),
section.bg-white .sv-btn:not(.sv-btn-ghost):not(.sv-btn-outline) {
  color: var(--white) !important;
}
.ca-section-light .bg-\[\var(--surface-background)\] *,
.ca-section-light .bg-black *,
.ca-section-light .bg-slate-900 *,
section.bg-white [class*="bg-[var(--surface-background)]"] *,
section.bg-white .bg-black *,
section.bg-white .bg-slate-900 * {
  color: var(--white) !important;
  -webkit-text-fill-color: var(--white) !important;
}

/* 7. Product Capsules (LM-008/160) */
.ca-product-capsule {
  display: inline-flex;
  padding: 6px 14px;
  border-radius: 99px;
  font-size: var(--text-xs); /* LM-160: Bump from 10px to 11px floor */
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  line-height: 1.2;
  white-space: nowrap;
}

/* 8. Tap Target Expansion (LM-161) */
.nav-dropdown-chevron,
.ca-back-link,
.ab-close {
  min-width: 44px !important;
  min-height: 44px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}
.ca-section-light .ca-product-capsule {
  background: rgba(4, 14, 26, 0.05) !important;
  border: 1px solid rgba(4, 14, 26, 0.08) !important;
  color: rgba(4, 14, 26, 0.5) !important;
}
.bg-\[\var(--surface-background)\] .ca-product-capsule, 
.ca-section-dark .ca-product-capsule {
  background: var(--white-05) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: rgba(255, 255, 255, 0.4) !important;
}

/* ── LM-015: Products Nav Dropdown Polish ── */
.nav-mega {
  transition: opacity 0.25s var(--ease-premium), transform 0.25s var(--ease-premium);
}
.nav-mega-item:focus-visible {
  outline: 2px solid var(--teal) !important;
  outline-offset: -2px !important;
  background: var(--teal-12) !important;
}
.nav-mega-item:hover strong {
  color: var(--teal) !important;
}
.nav-mega-icon svg {
  transition: transform 0.3s var(--ease-premium);
}
.nav-mega-item:hover .nav-mega-icon svg {
  transform: scale(1.2);
}

/* ── SECTION PADDING (Standardized) ── */
/* :not(.sticky) — sticky control bars (e.g. blog search/filter) are compact
   toolbars, not content sections; the big section padding made the blog sticky
   search bar ~270px tall and it covered ~half the viewport when stuck. */
.ca-section-dark:not(.sticky),
.ca-section-light:not(.sticky),
.ca-main-transformation > section:not(.sticky) {
  padding-block: clamp(5rem, 12vh, 10rem) !important;
}

.ca-hero {
  padding-top: clamp(80px, 15vh, 160px) !important;
  padding-bottom: clamp(60px, 10vh, 120px) !important;
}


/* LM-081: Clear chat widget on mobile */
@media (max-width: 768px) {
  .ca-container, .f10-container, .prose {
    padding-inline-end: max(24px, calc(1.5rem + 44px)); /* Ensure clearance for 44px chat bubble */
  }
}

/* ── NEWSLETTER (LM-128 Migration) ── */
.ca-newsletter {
  max-width: 45rem; /* 720px */
  margin: clamp(2rem, 5vw, 3.5rem) auto;
  padding: clamp(1.5rem, 4vw, 2.25rem);
  background: var(--surface-1); /* --surf */
  border: 1px solid rgba(12, 201, 168, 0.10); /* --border-hairline + --border */
  border-radius: 1rem;
  text-align: center;
}

.ca-newsletter__title {
  margin: 0 0 0.5rem; /* --space-2 */
  font-size: clamp(1.25rem, 2.2vw, 1.5rem);
  color: var(--cloud); /* --cloud */
  text-wrap: balance;
}

.ca-newsletter__desc {
  margin: 0 0 1rem; /* --space-4 */
  color: var(--text-secondary); /* --steel */
  text-wrap: balance;
  font-size: 1rem; /* --font-size-base */
  line-height: 1.6;
}

.ca-newsletter__form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem; /* --space-2 */
  justify-content: center;
  margin: 0 auto 0.75rem; /* --space-3 */
  max-width: 30rem; /* 480px */
}

.ca-newsletter__form .ca-input {
  flex: 1 1 16.25rem; /* 260px */
  min-width: 0;
  padding: 0.75rem; /* --space-3 */
  border-radius: 0.5rem;
  background: var(--surface-2); /* --surf2 */
  border: 1px solid var(--teal-20); /* --border-hairline + --border2 */
  color: var(--cloud); /* --cloud */
  font-size: 1rem; /* --font-size-base */
  min-height: 2.75rem; /* 44px */
}

.ca-newsletter__form .ca-input:focus-visible {
  outline: 2px solid var(--teal); /* --border-thick + --teal */
  outline-offset: 2px; /* --outline-offset-2 */
  border-color: var(--teal); /* --teal */
}

.ca-newsletter__form .sv-btn {
  flex: 0 0 auto;
  min-height: 2.75rem; /* 44px */
}

.ca-newsletter__legal {
  margin: 0;
  font-size: 0.75rem; /* --font-size-xs */
  color: var(--text-tertiary); /* --mist */
}

@media (max-width: 30rem) { /* 480px */
  .ca-newsletter__form {
    flex-direction: column;
    align-items: stretch;
  }
  .ca-newsletter__form .sv-btn {
    width: 100%;
  }
}

/* UX-008: Sticky Back to Blog */
.ca-back-link {
  position: fixed;
  left: 2rem;
  top: 120px;
  z-index: var(--z-banner);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.4);
  text-decoration: none;
  transition: all 0.3s var(--ease-premium);
}
.ca-back-link:hover { color: var(--white); transform: translateX(-4px); }
@media (max-width: 1280px) { 
  .ca-back-link { 
    position: relative; 
    top: 0; 
    left: 0; 
    margin-bottom: 2rem; 
    display: inline-flex; 
    color: var(--bg); /* Dark text for inline version in light content */
  } 
}

/* IMPROVE-010: Share Buttons */
.ca-share-wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(0,0,0,0.1);
}
.ca-share-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(0,0,0,0.05);
  color: var(--bg);
  transition: all 0.3s var(--ease-premium);
}
.ca-share-btn:hover { background: var(--teal); color: var(--white); transform: translateY(-2px); }

/* LM-060: Raise desktop nav breakpoint to 1150px (Higher specificity to beat nav-global-fix) */
@media (max-width: 1150px) {
  html body nav .nav-links, html body nav .nav-links.sv-cluster { display: none !important; }
  html body .ham, html body .nav-burger, html body button.ham,
  html body nav .ham, html body nav button.ham,
  html body #ca-nav .ham, html body .sv-nav .ham { display: inline-flex !important; }
  
  /* Ensure logo tagline stays hidden if requested on mobile/tablet */
  html body .sv-nav-row .logo-tag, html body #ca-nav .logo-tag { display: none !important; }
  
  /* Hide nav actions that move to drawer */
  html body .sv-nav-row .nav-login, html body .sv-nav-row .nav-cta,
  html body .sv-nav-row .btn-ghost-v2, html body .sv-nav-row .btn-primary-v2,
  html body #ca-nav .nav-login, html body #ca-nav .nav-cta { display: none !important; }
}
@media (min-width: 1151px) {
  html body nav .nav-links, html body nav .nav-links.sv-cluster { display: flex !important; }
  html body .ham, html body .nav-burger, html body button.ham,
  html body nav .ham, html body nav button.ham,
  html body #ca-nav .ham, html body .sv-nav .ham { display: none !important; }
}

/* RESP-001: Let announce bar wrap on mobile */
@media (max-width: 480px) {
  .announce-bar, .announce-bar .wrap {
    flex-wrap: wrap !important;
    height: auto !important;
    line-height: 1.4 !important;
    padding-block: var(--space-2) !important;
  }
  .announce-bar .ab-text, .announce-bar .ab-text-mobile {
    flex-basis: 100% !important;
    margin-bottom: var(--space-1) !important;
    font-size: var(--text-xs) !important;
  }
  .announce-bar .ab-dot { display: none !important; }
  .announce-bar .ab-cta { font-size: var(--text-xs) !important; }
}

.char--punct {
  margin-left: -0.2em !important;
}

/* UI Utilities */
.scrollbar-hide::-webkit-scrollbar { display: none; }
.scrollbar-hide { -ms-overflow-style: none; scrollbar-width: none; }

.mask-fade-right {
  mask-image: linear-gradient(to right, black 85%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, black 85%, transparent 100%);
}

/* IMPROVE-004: Tool step indicators visibility on mobile */
.ca-tool-step-badge {
  display: inline-flex !important;
  transition: all 0.3s ease;
}

@media (max-width: 480px) {
  .ca-tool-step-badge {
    font-size: 10px !important;
    padding: 4px 12px !important;
    position: sticky !important;
    top: 80px;
    z-index: var(--z-nav);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    background: white !important; /* Ensure it's readable over content */
    border: 1px solid rgba(12, 201, 168, 0.2) !important;
  }
}

/* BUG-047: Legible hero heading gradients */
.ca-hero-title span,
.ca-hero-title-premium span {
  background: linear-gradient(to bottom, var(--white) 55%, rgba(255, 255, 255, 0.82) 100%) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
}

/* BUG-048: Mobile Section Compression */
@media (max-width: 768px) {
  .ca-card, .ca-section, section[class*="py-"] {
    padding: 1.5rem !important;
  }
  .ca-method-item {
    padding-block: 2rem !important;
  }
  .ca-hero {
    min-height: auto !important;
    padding-block: 4rem !important;
  }
}

/* LM-062: Fix ca-hero-grid/ca-mesh height 0 */
.ca-hero-grid, .ca-hero-backdrop {
  height: 100% !important;
  min-height: 100% !important;
}
