/* QLM enterprise readability layer
   Loaded last on public pages so product, SEO, and legacy pages share the
   same 9.5+ usability baseline without rewriting each page by hand. */

:root {
  --qlm-enterprise-bg: #f7f3ec;
  --qlm-enterprise-surface: #fffdf9;
  --qlm-enterprise-surface-strong: #ffffff;
  --qlm-enterprise-ink: #081827;
  --qlm-enterprise-muted: #415064;
  --qlm-enterprise-soft: #667085;
  --qlm-enterprise-border: rgba(11, 25, 41, 0.14);
  --qlm-enterprise-border-strong: rgba(0, 168, 150, 0.34);
  --qlm-enterprise-shadow: 0 18px 55px rgba(11, 25, 41, 0.10);
  --qlm-enterprise-shadow-hover: 0 26px 75px rgba(11, 25, 41, 0.15);
  --qlm-enterprise-radius: 22px;
  --qlm-enterprise-radius-sm: 14px;
  --qlm-enterprise-focus: 0 0 0 4px rgba(0, 168, 150, 0.22);
  --qlm-enterprise-measure: 72ch;
}

html {
  scroll-padding-top: 96px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  min-width: 320px;
  overflow-x: hidden;
}

body,
body :is(p, li, td, th, summary, label, input, textarea, select, button) {
  text-rendering: optimizeLegibility;
}

body :is(p, li, td, summary) {
  line-height: 1.68;
}

body :is(p, li) {
  color: inherit;
}

body :is(h1, h2, h3) {
  text-wrap: balance;
}

body :is(p, .hero-sub, .hero-deck, .section-sub, .section-prose, .seo-deck, .seo-section p, .card p, .surface-card p) {
  text-wrap: pretty;
}

body :is(a, button, input, textarea, select, summary):focus-visible {
  outline: none;
  box-shadow: var(--qlm-enterprise-focus);
}

body :is(button, input, textarea, select) {
  font: inherit;
}

body :is(input, textarea, select) {
  min-height: 46px;
  border-radius: 12px;
}

body :is(textarea) {
  min-height: 128px;
}

body :is(.btn, .cta-btn, .qlm-btn, .qlm-btn-primary, .seo-cta, .btn-primary, .btn-ghost, .btn-outline, .btn-white, .btn-teal, .nav-cta) {
  min-height: 44px;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
}

body :is(.btn, .cta-btn, .qlm-btn, .qlm-btn-primary, .seo-cta, .btn-primary, .btn-teal) {
  font-weight: 700;
}

body :is(.btn-ghost, .btn-outline, .qlm-btn-ghost) {
  border-color: rgba(11, 25, 41, 0.24);
}

body :is(.card, .surface-card, .seo-card, .seo-panel, .persona-card, .exam-card, .step-card, .oss-stat, .feature-card, .product-card, .tool-card, .resource-card, .outcome-card, .metric-card, .stat-card, .price-card, .pricing-card) {
  border-radius: var(--qlm-enterprise-radius-sm);
}

body :is(.card, .surface-card, .seo-card, .seo-panel, .persona-card, .exam-card, .step-card, .feature-card, .product-card, .tool-card, .resource-card, .outcome-card, .price-card, .pricing-card) {
  background-clip: padding-box;
}

body :is(.seo-card, .seo-panel, .seo-problem-grid article, .qlm-tool-form, .qlm-tool-output) {
  border-color: var(--qlm-enterprise-border);
  border-radius: var(--qlm-enterprise-radius);
  box-shadow: var(--qlm-enterprise-shadow);
}

body :is(.seo-card, .seo-problem-grid article, .qlm-tool-form, .qlm-tool-output):hover {
  box-shadow: var(--qlm-enterprise-shadow-hover);
}

body :is(table) {
  border-spacing: 0;
}

body :is(th, td) {
  font-size: 0.96rem;
}

body :is(details) {
  border-radius: var(--qlm-enterprise-radius-sm);
}

body :is(summary) {
  min-height: 44px;
  display: list-item;
  cursor: pointer;
  padding-block: 10px;
  padding-inline-end: 12px;
}

body :is(summary)::marker {
  color: var(--qlm-teal, #00a896);
  font-size: 0.92em;
}

body :is(summary)::-webkit-details-marker {
  color: var(--qlm-teal, #00a896);
  font-size: 0.92em;
}

body :is(.qlm-site-header, .nav) {
  box-shadow: 0 10px 32px rgba(11, 25, 41, 0.06);
}

.qlm-site-inner,
.nav-inner {
  min-height: 72px;
}

.qlm-primary-item,
.nav-link,
.nav-dd-trigger,
.qlm-signin {
  min-height: 42px;
}

/* Generated SEO/category pages */
body[data-seo-generated="true"] {
  background:
    radial-gradient(circle at 12% 8%, rgba(0, 168, 150, 0.10), transparent 30%),
    linear-gradient(180deg, #fdfbf8 0%, var(--qlm-enterprise-bg) 100%);
  color: var(--qlm-enterprise-ink);
}

body[data-seo-generated="true"] .seo-wrap {
  max-width: 1180px;
}

body[data-seo-generated="true"] .seo-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(88px, 10vw, 136px) 0 clamp(58px, 7vw, 86px);
  background:
    linear-gradient(135deg, rgba(253, 251, 248, 0.96), rgba(248, 245, 240, 0.92)),
    radial-gradient(circle at 82% 18%, rgba(0, 168, 150, 0.16), transparent 28%);
}

body[data-seo-generated="true"] .seo-hero::after {
  content: "";
  position: absolute;
  inset: auto -8% -42% auto;
  width: 420px;
  height: 420px;
  border: 1px solid rgba(0, 168, 150, 0.24);
  border-radius: 50%;
  pointer-events: none;
}

body[data-seo-generated="true"] .seo-breadcrumb {
  font-size: 0.88rem;
  color: var(--qlm-enterprise-muted);
}

body[data-seo-generated="true"] .seo-hero h1 {
  max-width: 980px;
  color: var(--qlm-enterprise-ink);
}

body[data-seo-generated="true"] .seo-deck {
  max-width: 820px;
  color: #2d3848;
  font-size: clamp(1.25rem, 2.2vw, 1.65rem);
}

body[data-seo-generated="true"] .seo-kicker {
  font-weight: 700;
}

body[data-seo-generated="true"] .seo-section {
  padding: clamp(62px, 8vw, 92px) 0;
}

body[data-seo-generated="true"] .seo-section h2 {
  color: var(--qlm-enterprise-ink);
}

body[data-seo-generated="true"] .seo-section p,
body[data-seo-generated="true"] .seo-section li {
  color: var(--qlm-enterprise-muted);
  font-size: 1.05rem;
}

body[data-seo-generated="true"] .seo-two {
  gap: clamp(28px, 5vw, 58px);
}

body[data-seo-generated="true"] .seo-panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(253, 251, 248, 0.96));
  border-left-width: 5px;
  padding: clamp(24px, 4vw, 34px);
}

body[data-seo-generated="true"] .seo-card-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

body[data-seo-generated="true"] .seo-card,
body[data-seo-generated="true"] .seo-problem-grid article {
  padding: clamp(24px, 4vw, 34px);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

body[data-seo-generated="true"] .seo-card:hover,
body[data-seo-generated="true"] .seo-problem-grid article:hover {
  border-color: var(--qlm-enterprise-border-strong);
  transform: translateY(-3px);
}

body[data-seo-generated="true"] .seo-card strong {
  color: var(--qlm-enterprise-ink);
  font-size: clamp(1.28rem, 2.2vw, 1.62rem);
}

body[data-seo-generated="true"] .seo-card small {
  color: var(--qlm-enterprise-muted);
  font-size: 0.98rem;
}

body[data-seo-generated="true"] .seo-definition {
  max-width: var(--qlm-enterprise-measure);
  color: var(--qlm-enterprise-ink);
}

body[data-seo-generated="true"] .seo-table {
  display: block;
  overflow-x: auto;
  border-radius: var(--qlm-enterprise-radius);
  box-shadow: var(--qlm-enterprise-shadow);
}

body[data-seo-generated="true"] .seo-table th,
body[data-seo-generated="true"] .seo-table td {
  min-width: 220px;
}

body[data-seo-generated="true"] .seo-faq {
  max-width: 920px;
}

body[data-seo-generated="true"] .seo-faq details {
  box-shadow: 0 10px 30px rgba(11, 25, 41, 0.06);
}

body[data-seo-generated="true"] .seo-final {
  background:
    radial-gradient(circle at 72% 16%, rgba(0, 168, 150, 0.20), transparent 32%),
    linear-gradient(135deg, #081827 0%, #0b1929 100%);
}

body[data-seo-generated="true"] .seo-final p {
  color: rgba(253, 251, 248, 0.78);
}

body[data-seo-generated="true"] .seo-cta {
  min-height: 50px;
  padding-inline: 28px;
  border-radius: 999px;
  box-shadow: 0 16px 42px rgba(0, 168, 150, 0.25);
}

body[data-seo-generated="true"] .seo-footer {
  border-top: 1px solid rgba(11, 25, 41, 0.10);
}

/* Public demo tools */
.qlm-tool-shell {
  gap: clamp(18px, 3vw, 30px);
}

.qlm-tool-form,
.qlm-tool-output {
  background: var(--qlm-enterprise-surface-strong);
}

.qlm-tool-form label {
  color: var(--qlm-enterprise-ink);
}

.qlm-tool-form input,
.qlm-tool-form select,
.qlm-tool-form textarea {
  border-color: rgba(11, 25, 41, 0.18);
  border-radius: 14px;
  padding: 13px 14px;
}

.qlm-tool-actions {
  align-items: center;
}

.qlm-tool-primary,
.qlm-tool-secondary,
.qlm-tool-copy,
.qlm-tool-examples button {
  min-height: 44px;
}

/* Hand-authored public pages */
.wrap,
.container,
.qlm-wrap {
  width: min(100%, var(--qlm-page-max, 1200px));
}

.hero-ctas,
.hero-actions,
.ph-actions,
.cta-row,
.button-row {
  gap: 14px;
}

.section-sub,
.hero-sub,
.hero-deck,
.ph-sub,
.head-prose,
.section-prose {
  max-width: 760px;
  color: var(--qlm-enterprise-muted);
}

.stats-row,
.persona-grid,
.exam-grid,
.steps-grid,
.oss-stats,
.card-grid,
.feature-grid,
.product-grid,
.resource-grid {
  align-items: stretch;
}

.footer a,
.seo-footer a {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
}

.footer-links {
  flex-wrap: wrap;
  max-width: 100%;
}

@media (max-width: 980px) {
  .qlm-site-inner,
  .nav-inner {
    padding-inline: 20px;
  }

  .wrap,
  .container,
  .qlm-wrap,
  .seo-wrap {
    padding-inline: 22px;
  }

  .stats-row,
  .persona-grid,
  .exam-grid,
  .steps-grid,
  .oss-inner,
  .oss-stats,
  .split,
  .seo-two,
  .seo-problem-grid,
  .qlm-tool-shell,
  .qlm-tool-row {
    grid-template-columns: 1fr;
  }

  .hero,
  .product-hero,
  .seo-hero {
    padding-top: 78px;
  }
}

@media (max-width: 680px) {
  body :is(.hero-ctas, .hero-actions, .ph-actions, .cta-row, .button-row) {
    align-items: stretch;
  }

  body :is(.hero-ctas, .hero-actions, .ph-actions, .cta-row, .button-row) > a,
  body :is(.hero-ctas, .hero-actions, .ph-actions, .cta-row, .button-row) > button {
    width: 100%;
  }

  body :is(.btn, .cta-btn, .qlm-btn, .qlm-btn-primary, .seo-cta, .btn-primary, .btn-ghost, .btn-outline, .btn-white, .btn-teal) {
    width: 100%;
    min-height: 48px;
    padding-inline: 18px;
  }

  body :is(.card, .surface-card, .seo-card, .seo-panel, .persona-card, .exam-card, .step-card, .feature-card, .product-card, .tool-card, .resource-card, .outcome-card, .price-card, .pricing-card) {
    padding: clamp(20px, 6vw, 28px);
  }

  body [style*="grid-template-columns:1fr 1fr"],
  body [style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  .qlm-wordmark-sub {
    display: none;
  }
}
