/* ============================================================
   CalculateMeasure.com — Global Design System
   Calculate anything. Measure everything.
   ============================================================ */

/* --- CSS Custom Properties (Design Tokens) --- */
:root {
  /* Primary palette */
  --cm-blue-600: #2563EB;
  --cm-blue-700: #1D4ED8;
  --cm-blue-800: #1E40AF;
  --cm-blue-50: #EFF6FF;
  --cm-blue-100: #DBEAFE;

  /* Result / success */
  --cm-emerald-600: #059669;
  --cm-emerald-700: #047857;
  --cm-emerald-50: #ECFDF5;
  --cm-emerald-100: #D1FAE5;

  /* Neutral / surface */
  --cm-slate-50: #F8FAFC;
  --cm-slate-100: #F1F5F9;
  --cm-slate-200: #E2E8F0;
  --cm-slate-300: #CBD5E1;
  --cm-slate-400: #94A3B8;
  --cm-slate-500: #64748B;
  --cm-slate-600: #475569;
  --cm-slate-700: #334155;
  --cm-slate-800: #1E293B;
  --cm-slate-900: #0F172A;

  /* Warning / error */
  --cm-red-500: #EF4444;
  --cm-red-50: #FEF2F2;
  --cm-amber-500: #F59E0B;
  --cm-amber-50: #FFFBEB;

  /* Semantic aliases */
  --color-primary: var(--cm-blue-600);
  --color-primary-hover: var(--cm-blue-700);
  --color-primary-active: var(--cm-blue-800);
  --color-primary-light: var(--cm-blue-50);
  --color-result: var(--cm-emerald-600);
  --color-result-bg: var(--cm-emerald-50);
  --color-text: var(--cm-slate-900);
  --color-text-secondary: var(--cm-slate-600);
  --color-text-muted: var(--cm-slate-500);
  --color-surface: #FFFFFF;
  --color-surface-alt: var(--cm-slate-50);
  --color-border: var(--cm-slate-200);
  --color-border-light: var(--cm-slate-100);
  --color-error: var(--cm-red-500);
  --color-error-bg: var(--cm-red-50);

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Fira Mono', 'Roboto Mono', 'Courier New', monospace;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;

  --leading-tight: 1.25;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;

  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;

  /* Border radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);

  /* Layout */
  --container-max: 1200px;
  --container-narrow: 800px;
  --header-height: 64px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
}

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-text);
  background-color: var(--color-surface-alt);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg { display: block; max-width: 100%; }
a { color: var(--color-primary); text-decoration: none; }
a:hover { color: var(--color-primary-hover); text-decoration: underline; }

/* Focus styles */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* --- Container --- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-4);
}

.container--narrow {
  max-width: var(--container-narrow);
}

/* --- Header --- */
.site-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

/* Logo / Brand */
.site-brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  color: var(--color-text);
  flex-shrink: 0;
}

.site-brand:hover { text-decoration: none; color: var(--color-text); }

.site-brand__icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.site-brand__text {
  font-size: var(--text-lg);
  font-weight: var(--font-bold);
  letter-spacing: -0.01em;
  line-height: 1;
}

.site-brand__text span {
  color: var(--color-primary);
}

/* Desktop nav */
.site-nav {
  display: none;
  align-items: center;
  gap: var(--space-6);
}

.site-nav a {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.site-nav a:hover { color: var(--color-primary); text-decoration: none; }

/* Mobile menu toggle */
.menu-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text);
  border-radius: var(--radius-md);
}

.menu-toggle:hover { background: var(--color-surface-alt); }

.menu-toggle svg { width: 24px; height: 24px; }

/* Mobile nav overlay */
.mobile-nav {
  display: none;
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--color-surface);
  z-index: 99;
  padding: var(--space-4);
  overflow-y: auto;
}

.mobile-nav.is-open { display: block; }

.mobile-nav a {
  display: block;
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-lg);
  color: var(--color-text);
  text-decoration: none;
  border-radius: var(--radius-md);
}

.mobile-nav a:hover {
  background: var(--color-surface-alt);
  text-decoration: none;
}

.mobile-nav__section {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: var(--space-4);
}

/* --- Hero --- */
.hero {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-10) 0 var(--space-12);
  text-align: center;
}

.hero__title {
  font-size: var(--text-3xl);
  font-weight: var(--font-bold);
  line-height: var(--leading-tight);
  color: var(--color-text);
  margin-bottom: var(--space-1);
}

.hero__title span { color: var(--color-primary); }

.hero__subtitle {
  font-size: var(--text-2xl);
  font-weight: var(--font-semibold);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-4);
}

.hero__description {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  max-width: 600px;
  margin: 0 auto var(--space-8);
  line-height: var(--leading-relaxed);
}

/* Search box */
.search-box {
  max-width: 560px;
  margin: 0 auto;
  position: relative;
}

.search-box__label {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-2);
}

.search-box__input-wrap {
  position: relative;
}

.search-box__icon {
  position: absolute;
  left: var(--space-4);
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: var(--color-text-muted);
  pointer-events: none;
}

.search-box__input {
  width: 100%;
  padding: var(--space-4) var(--space-4) var(--space-4) 48px;
  font-size: var(--text-base);
  font-family: var(--font-sans);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  color: var(--color-text);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.search-box__input::placeholder { color: var(--color-text-muted); }
.search-box__input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Search results dropdown */
.search-results {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-height: 360px;
  overflow-y: auto;
  z-index: 50;
}

.search-results.is-open { display: block; }

.search-results__item {
  display: block;
  padding: var(--space-3) var(--space-4);
  text-decoration: none;
  color: var(--color-text);
  border-bottom: 1px solid var(--color-border-light);
  transition: background var(--transition-fast);
}

.search-results__item:last-child { border-bottom: none; }
.search-results__item:hover,
.search-results__item.is-active {
  background: var(--color-primary-light);
  text-decoration: none;
}

.search-results__item-name {
  font-weight: var(--font-medium);
  font-size: var(--text-sm);
}

.search-results__item-category {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: 2px;
}

.search-results__empty {
  padding: var(--space-6) var(--space-4);
  text-align: center;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

/* --- Section --- */
.section {
  padding: var(--space-10) 0;
}

.section--alt { background: var(--color-surface); }

.section__header {
  margin-bottom: var(--space-6);
}

.section__title {
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  color: var(--color-text);
}

.section__subtitle {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-top: var(--space-1);
}

.section__link {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
}

/* --- Card Grid --- */
.card-grid {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: 1fr;
}

/* --- Calculator Card (on homepage / listing) --- */
.calc-card {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--color-text);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.calc-card:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
  text-decoration: none;
  color: var(--color-text);
}

.calc-card__icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-lg);
}

.calc-card__icon--blue { background: var(--cm-blue-50); color: var(--cm-blue-600); }
.calc-card__icon--emerald { background: var(--cm-emerald-50); color: var(--cm-emerald-600); }
.calc-card__icon--amber { background: var(--cm-amber-50); color: var(--cm-amber-500); }

.calc-card__body { flex: 1; min-width: 0; }

.calc-card__name {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  line-height: var(--leading-tight);
}

.calc-card__desc {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: 2px;
  line-height: var(--leading-normal);
}

/* --- Category Card --- */
.category-card {
  display: block;
  padding: var(--space-5);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--color-text);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.category-card:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
  text-decoration: none;
  color: var(--color-text);
}

.category-card--planned:hover {
  border-color: var(--color-border);
  box-shadow: none;
}

.category-card__icon {
  font-size: var(--text-2xl);
  margin-bottom: var(--space-3);
}

.category-card__name {
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  margin-bottom: var(--space-1);
}

.category-card__desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: var(--leading-relaxed);
}

.category-card__count {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-2);
}

/* --- Breadcrumbs --- */
.breadcrumb {
  padding: var(--space-3) 0;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.breadcrumb a { color: var(--color-text-secondary); }
.breadcrumb a:hover { color: var(--color-primary); }
.breadcrumb__sep { margin: 0 var(--space-2); color: var(--color-text-muted); }

/* --- CTA Banner --- */
.cta-banner {
  background: var(--color-primary-light);
  border: 1px solid var(--cm-blue-100);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  text-align: center;
}

.cta-banner__title {
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  margin-bottom: var(--space-2);
}

.cta-banner__desc {
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-4);
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  line-height: 1;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition-fast), box-shadow var(--transition-fast);
  min-height: 44px;
}

.btn:hover { text-decoration: none; }

.btn--primary {
  background: var(--color-primary);
  color: #fff;
}
.btn--primary:hover { background: var(--color-primary-hover); color: #fff; }

.btn--secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}
.btn--secondary:hover { background: var(--color-surface-alt); border-color: var(--cm-slate-300); }

.btn--outline {
  background: transparent;
  color: var(--color-primary);
  border: 1px solid var(--color-primary);
}
.btn--outline:hover { background: var(--color-primary-light); }

.btn--sm { padding: var(--space-2) var(--space-3); font-size: var(--text-xs); min-height: 36px; }
.btn--lg { padding: var(--space-4) var(--space-6); font-size: var(--text-base); min-height: 48px; }
.btn--full { width: 100%; }

/* --- Ad Placeholder --- */
.ad-slot {
  /* Placeholder for future AdSense units */
  min-height: 0;
  display: none; /* Hidden until ads are active */
}

.ad-slot--active {
  display: block;
  background: var(--color-surface-alt);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  text-align: center;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* --- Footer --- */
.site-footer {
  background: var(--cm-slate-900);
  color: var(--cm-slate-300);
  padding: var(--space-12) 0 var(--space-6);
}

.footer-grid {
  display: grid;
  gap: var(--space-8);
  grid-template-columns: 1fr;
  margin-bottom: var(--space-8);
}

.footer-col__title {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: #fff;
  margin-bottom: var(--space-3);
}

.footer-col a {
  display: block;
  font-size: var(--text-sm);
  color: var(--cm-slate-400);
  text-decoration: none;
  padding: 2px 0;
  transition: color var(--transition-fast);
}

.footer-col a:hover { color: #fff; text-decoration: none; }

.footer-bottom {
  border-top: 1px solid var(--cm-slate-700);
  padding-top: var(--space-6);
  font-size: var(--text-xs);
  color: var(--cm-slate-500);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.footer-bottom a { color: var(--cm-slate-400); }
.footer-bottom a:hover { color: #fff; }

/* --- Utilities --- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.text-center { text-align: center; }
.text-muted { color: var(--color-text-muted); }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }

/* ============================================================
   RESPONSIVE BREAKPOINTS — Mobile First
   ============================================================ */

/* 640px+ — Larger phones, small tablets */
@media (min-width: 640px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }

  .hero__title { font-size: var(--text-4xl); }
  .hero__subtitle { font-size: var(--text-2xl); }
}

/* 768px+ — Tablets */
@media (min-width: 768px) {
  .container { padding: 0 var(--space-6); }

  .menu-toggle { display: none; }
  .site-nav { display: flex; }

  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-bottom { flex-direction: row; justify-content: space-between; }
}

/* 1024px+ — Laptops */
@media (min-width: 1024px) {
  .card-grid { grid-template-columns: repeat(3, 1fr); }
  .card-grid--4 { grid-template-columns: repeat(4, 1fr); }

  .footer-grid { grid-template-columns: repeat(4, 1fr); }
}

/* 1280px+ — Large desktops */
@media (min-width: 1280px) {
  .container { padding: 0 var(--space-8); }
}


/* Stage 2A.1 category hubs */
.site-brand__icon{width:38px;height:38px;object-fit:contain;display:block}
.category-hero{padding:3.25rem 0 2.25rem;background:linear-gradient(180deg,#f7fbff 0%,#fff 100%);border-bottom:1px solid var(--color-border,#e5e7eb)}
.breadcrumbs{display:flex;gap:.55rem;align-items:center;flex-wrap:wrap;font-size:.9rem;margin-bottom:1.5rem;color:var(--color-text-muted,#64748b)}
.breadcrumbs a{color:var(--color-primary,#2563eb);text-decoration:none}
.category-hero__content{display:flex;align-items:center;gap:1.35rem;max-width:820px}
.category-hero__icon{width:72px;height:72px;flex:0 0 72px;border-radius:20px;display:grid;place-items:center;font-size:2rem;font-weight:800;color:#1264e8;background:#eaf4ff;border:1px solid #d8eaff}
.category-hero h1{font-size:clamp(2rem,5vw,3.25rem);line-height:1.08;margin:.2rem 0 .7rem}
.category-hero p:last-child{font-size:1.08rem;line-height:1.7;color:var(--color-text-muted,#64748b);margin:0}
.eyebrow{text-transform:uppercase;letter-spacing:.09em;font-size:.76rem;font-weight:800;color:#1264e8;margin:0}
.section-heading{display:flex;align-items:end;justify-content:space-between;gap:1rem;margin-bottom:1.4rem}
.section-heading h2{margin:.2rem 0 0}
.published-count{font-size:.86rem;font-weight:700;color:#475569;background:#f1f5f9;border-radius:999px;padding:.4rem .7rem;white-space:nowrap}
.tool-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1rem}
.tool-card{display:block;padding:1.35rem;border:1px solid #e2e8f0;border-radius:16px;background:#fff;text-decoration:none;color:inherit;transition:transform .16s ease,box-shadow .16s ease,border-color .16s ease}
a.tool-card:hover{transform:translateY(-2px);box-shadow:0 10px 30px rgba(15,23,42,.08);border-color:#bfdbfe}
.tool-card h2,.tool-card h3{font-size:1.08rem;margin:.6rem 0 .45rem}
.tool-card p{color:#64748b;line-height:1.55;margin:0}
.tool-card__badge{display:inline-flex;font-size:.72rem;font-weight:800;text-transform:uppercase;letter-spacing:.06em;color:#1264e8;background:#eff6ff;padding:.28rem .5rem;border-radius:999px}
.tool-card__link{display:inline-block;margin-top:.9rem;color:#1264e8;font-weight:700;font-size:.9rem}
.tool-card--planned{background:#f8fafc;border-style:dashed}
.tool-card--planned .tool-card__badge{color:#64748b;background:#e2e8f0}
.section--soft{background:#f8fafc}
.related-category-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem}
.related-category{display:flex;flex-direction:column;gap:.3rem;padding:1.15rem 1.25rem;border:1px solid #e2e8f0;border-radius:14px;text-decoration:none;color:inherit}
.related-category strong{color:#0f172a}
.related-category span{color:#64748b;font-size:.9rem}
@media(max-width:800px){.tool-grid{grid-template-columns:1fr 1fr}.category-hero__content{align-items:flex-start}.site-nav{display:none}}
@media(max-width:560px){.tool-grid,.related-category-grid{grid-template-columns:1fr}.category-hero{padding-top:2rem}.category-hero__icon{width:58px;height:58px;flex-basis:58px;border-radius:16px}.section-heading{align-items:flex-start}.published-count{margin-top:.2rem}}


/* Stage 2A.2 global header */
:root {
  --cm-brand-navy: #071B4A;
  --cm-brand-blue: #1264E8;
  --cm-brand-cyan: #08C7E8;
  --header-height: 72px;
}
.site-header {
  height: var(--header-height);
  background: rgba(255,255,255,.97);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 rgba(15,23,42,.07);
}
.site-header .header-inner {
  display: flex;
  align-items: center;
  height: 100%;
  gap: 1.75rem;
}
.site-brand {
  gap: .65rem;
  min-width: max-content;
}
.site-brand__icon {
  width: 40px !important;
  height: 40px !important;
  object-fit: contain;
}
.site-brand__text {
  color: var(--cm-brand-navy);
  font-size: 1.16rem;
  letter-spacing: -.025em;
}
.site-brand__text span { color: var(--cm-brand-blue); }

.site-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.55rem;
  margin-left: auto;
}
.site-nav > a,
.nav-dropdown__trigger {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  border: 0;
  background: transparent;
  color: #334155;
  font: inherit;
  font-size: .9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.site-nav > a:hover,
.nav-dropdown__trigger:hover,
.nav-dropdown__trigger[aria-expanded="true"] {
  color: var(--cm-brand-blue);
  text-decoration: none;
}
.nav-dropdown { position: relative; }
.nav-dropdown__trigger { gap: .35rem; }
.nav-dropdown__trigger svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  transition: transform var(--transition-fast);
}
.nav-dropdown__trigger[aria-expanded="true"] svg { transform: rotate(180deg); }

.nav-dropdown__menu {
  position: absolute;
  top: calc(100% + .55rem);
  right: 0;
  width: 330px;
  padding: .6rem;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  box-shadow: 0 18px 45px rgba(15,23,42,.13);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-5px);
  transition: opacity var(--transition-fast), transform var(--transition-fast), visibility var(--transition-fast);
}
.nav-dropdown.is-open .nav-dropdown__menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.nav-dropdown__menu a,
.nav-dropdown__coming {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  padding: .75rem .85rem;
  border-radius: 10px;
}
.nav-dropdown__menu a {
  color: var(--color-text);
  text-decoration: none;
}
.nav-dropdown__menu a:hover {
  color: var(--color-text);
  background: var(--cm-blue-50);
  text-decoration: none;
}
.nav-dropdown__menu strong { font-size: .9rem; }
.nav-dropdown__menu span {
  color: var(--color-text-muted);
  font-size: .78rem;
  line-height: 1.4;
}
.nav-dropdown__coming {
  border-top: 1px solid var(--color-border-light);
  margin-top: .25rem;
  color: var(--color-text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: .35rem;
}
.header-search-trigger {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: 0 .7rem;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #334155;
  font: inherit;
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
}
.header-search-trigger:hover,
.header-search-trigger[aria-expanded="true"] {
  background: var(--cm-blue-50);
  color: var(--cm-brand-blue);
}
.header-search-trigger svg,
.header-search-box__icon {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.header-search-panel {
  position: absolute;
  z-index: 101;
  top: 100%;
  left: 0;
  right: 0;
  padding: .8rem 0 1rem;
  background: #fff;
  border-top: 1px solid var(--color-border-light);
  border-bottom: 1px solid var(--color-border);
  box-shadow: 0 12px 24px rgba(15,23,42,.07);
}
.header-search-panel[hidden] { display: none; }
.header-search-box {
  position: relative;
  max-width: 760px;
  margin: 0 auto;
}
.header-search-box__icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
}
.header-search-input {
  width: 100%;
  min-height: 52px;
  padding: .8rem 3.2rem .8rem 3rem;
  border: 1px solid var(--cm-slate-300);
  border-radius: 12px;
  background: #fff;
  color: var(--color-text);
  font: inherit;
  font-size: 1rem;
}
.header-search-input:focus {
  border-color: var(--cm-brand-blue);
  outline: 3px solid rgba(18,100,232,.12);
}
.header-search-close {
  position: absolute;
  top: 50%;
  right: .75rem;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--color-text-muted);
  font-size: 1.55rem;
  cursor: pointer;
}
.header-search-close:hover { background: var(--cm-slate-100); color: var(--color-text); }
.header-search-results {
  top: calc(100% + .4rem);
  left: 0;
  right: 0;
  z-index: 110;
}

.menu-toggle { display: none; }

.mobile-nav {
  position: fixed;
  z-index: 99;
  top: var(--header-height);
  left: 0;
  right: 0;
  bottom: 0;
  display: none;
  background: rgba(255,255,255,.99);
  overflow-y: auto;
}
.mobile-nav.is-open { display: block; }
.mobile-nav__inner {
  padding: 1rem max(1rem, calc((100vw - var(--container-max))/2 + 1rem)) 2rem;
}
.mobile-nav__inner > a,
.mobile-nav__group > a {
  display: block;
  padding: .9rem .6rem;
  border-bottom: 1px solid var(--color-border-light);
  color: var(--color-text);
  font-weight: 650;
  text-decoration: none;
}
.mobile-nav__group {
  margin-top: .55rem;
  padding-top: .55rem;
}
.mobile-nav__label {
  display: block;
  padding: .65rem .6rem .25rem;
  color: var(--color-text-muted);
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.mobile-nav__coming {
  display: block;
  padding: .65rem .6rem;
  color: var(--color-text-muted);
  font-size: .84rem;
}

@media (max-width: 930px) {
  .site-nav { display: none; }
  .header-search-trigger span { display: none; }
  .header-search-trigger { width: 44px; justify-content: center; padding: 0; }
  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}
@media (max-width: 480px) {
  :root { --header-height: 66px; }
  .site-header .header-inner { gap: .5rem; }
  .site-brand__icon { width: 34px !important; height: 34px !important; }
  .site-brand__text { font-size: 1.02rem; }
  .header-search-panel { padding-left: .1rem; padding-right: .1rem; }
}
@media (max-width: 350px) {
  .site-brand__text { font-size: .93rem; }
}


/* Publisher/support layer */
.support-breadcrumbs { padding-top: var(--space-5); }
.support-hero {
  padding: 3rem 0 1.6rem;
  background: linear-gradient(180deg,#f7fbff 0%,#fff 100%);
}
.support-hero--policy { padding-bottom: 1.1rem; }
.support-hero h1 {
  margin: .3rem 0 .85rem;
  font-size: clamp(2rem,5vw,3rem);
  line-height: 1.08;
}
.support-lead {
  max-width: 760px;
  color: var(--color-text-secondary);
  font-size: 1.1rem;
  line-height: 1.7;
}
.policy-date { color: var(--color-text-muted); font-size: .9rem; }
.support-section { padding: 2rem 0 4rem; }
.support-prose { line-height: 1.75; }
.support-prose h2 {
  margin: 2rem 0 .65rem;
  font-size: 1.35rem;
  line-height: 1.25;
}
.support-prose h2:first-child { margin-top: 0; }
.support-prose p + p { margin-top: .85rem; }
.support-prose ul { margin: .65rem 0 0 1.25rem; }
.support-cta { display:flex; gap:.75rem; flex-wrap:wrap; margin-top:2rem; }

.principle-grid {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:.85rem;
  margin-top:1rem;
}
.principle-card,
.contact-card {
  padding:1.15rem;
  border:1px solid var(--color-border);
  border-radius:14px;
  background:#fff;
}
.principle-card { display:flex; flex-direction:column; gap:.3rem; }
.principle-card strong { color:var(--cm-brand-navy,#071B4A); }
.principle-card span,
.contact-card p { color:var(--color-text-secondary); font-size:.92rem; line-height:1.55; }
.contact-card h2 { margin:0 0 .5rem; font-size:1.05rem; }
.contact-grid,
.embed-info-grid {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:1rem;
  margin-bottom:1.5rem;
}
.embed-info-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }

.support-form {
  padding:1.35rem;
  border:1px solid var(--color-border);
  border-radius:16px;
  background:#fff;
  box-shadow:var(--shadow-sm);
}
.form-grid {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:1rem;
}
.form-field { margin-bottom:1rem; }
.form-field label {
  display:block;
  margin-bottom:.4rem;
  color:var(--color-text);
  font-size:.9rem;
  font-weight:650;
}
.form-field input,
.form-field textarea,
.form-field select {
  width:100%;
  min-height:44px;
  padding:.72rem .8rem;
  border:1px solid var(--cm-slate-300);
  border-radius:9px;
  background:#fff;
  color:var(--color-text);
  font:inherit;
}
.form-field textarea { resize:vertical; line-height:1.5; }
.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
  outline:3px solid rgba(18,100,232,.12);
  border-color:var(--cm-brand-blue,#1264E8);
}
.optional { color:var(--color-text-muted); font-weight:400; }
.form-note {
  padding:.85rem 1rem;
  border-radius:10px;
  background:var(--cm-slate-50);
  color:var(--color-text-secondary);
  font-size:.86rem;
  line-height:1.55;
}
.form-actions { display:flex; gap:.75rem; flex-wrap:wrap; margin-top:1rem; }
.form-status { min-height:1.4rem; margin-top:.7rem; color:var(--color-text-secondary); font-size:.85rem; }

.embed-directory-grid {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:1rem;
  margin-top:1.5rem;
}
.embed-directory-card {
  min-width:0;
  padding:1.25rem;
  border:1px solid var(--color-border);
  border-radius:16px;
  background:#fff;
  box-shadow:var(--shadow-sm);
}
.embed-directory-card h2 { margin:.45rem 0 .5rem; font-size:1.1rem; }
.embed-directory-card p { color:var(--color-text-secondary); font-size:.9rem; line-height:1.5; }
.embed-category {
  display:inline-flex;
  padding:.25rem .48rem;
  border-radius:999px;
  background:var(--cm-blue-50);
  color:var(--cm-brand-blue,#1264E8);
  font-size:.7rem;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.05em;
}
.embed-code-wrap { margin-top:1rem; }
.embed-code {
  overflow:auto;
  max-height:145px;
  padding:.8rem;
  border-radius:9px;
  background:#0f172a;
  color:#e2e8f0;
  font-size:.73rem;
  line-height:1.5;
  white-space:pre-wrap;
  word-break:break-word;
}
.embed-code-wrap .btn { margin-top:.65rem; margin-right:.4rem; }
.btn--ghost {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:44px;
  padding:.65rem 1rem;
  color:var(--cm-brand-blue,#1264E8);
  background:transparent;
  border:1px solid transparent;
  border-radius:var(--radius-md);
  font-weight:600;
  font-size:.9rem;
}
.btn--ghost:hover { background:var(--cm-blue-50); text-decoration:none; }

.footer-grid--support {
  grid-template-columns:repeat(3,minmax(0,1fr));
}

@media(max-width:760px) {
  .principle-grid,
  .contact-grid,
  .embed-info-grid,
  .embed-directory-grid,
  .form-grid,
  .footer-grid--support {
    grid-template-columns:1fr;
  }
}


/* Stage 3B discovery layer */
.directory-hero {
  padding: 2.8rem 0 2rem;
  background: linear-gradient(180deg,#f6faff 0%,#fff 100%);
}
.directory-hero__copy { max-width: 760px; margin-top: 1.5rem; }
.directory-hero h1 {
  margin:.3rem 0 .75rem;
  font-size:clamp(2.2rem,5vw,3.35rem);
  line-height:1.05;
}
.directory-hero__copy > p:last-child {
  color:var(--color-text-secondary);
  font-size:1.08rem;
  line-height:1.65;
}
.directory-section { padding:1rem 0 4rem; }
.directory-toolbar {
  display:grid;
  grid-template-columns:minmax(260px,2fr) repeat(3,minmax(145px,1fr));
  gap:.8rem;
  align-items:end;
  padding:1rem;
  border:1px solid var(--color-border);
  border-radius:16px;
  background:#fff;
  box-shadow:var(--shadow-sm);
}
.directory-search label,.directory-filter label {
  display:block;
  margin-bottom:.35rem;
  font-size:.76rem;
  font-weight:750;
  color:var(--color-text-secondary);
}
.directory-search input,.directory-filter select {
  width:100%;
  min-height:44px;
  padding:.65rem .75rem;
  border:1px solid var(--cm-slate-300);
  border-radius:9px;
  background:#fff;
  color:var(--color-text);
  font:inherit;
}
.directory-search input:focus,.directory-filter select:focus {
  outline:3px solid rgba(18,100,232,.12);
  border-color:var(--cm-brand-blue,#1264E8);
}
.directory-summary {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:1rem;
  padding:.9rem .15rem .65rem;
  color:var(--color-text-secondary);
  font-size:.86rem;
}
.directory-clear {
  border:0;
  background:transparent;
  color:var(--cm-brand-blue,#1264E8);
  font:inherit;
  font-weight:650;
  cursor:pointer;
}
.directory-grid {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:1rem;
}
.directory-card {
  display:flex;
  min-height:220px;
  flex-direction:column;
  padding:1.15rem;
  border:1px solid var(--color-border);
  border-radius:15px;
  background:#fff;
  color:inherit;
  box-shadow:var(--shadow-sm);
  transition:transform .16s ease,box-shadow .16s ease,border-color .16s ease;
}
.directory-card:hover {
  transform:translateY(-2px);
  border-color:var(--cm-blue-200);
  box-shadow:var(--shadow-md);
  text-decoration:none;
}
.directory-card__top {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:.75rem;
}
.directory-card__icon {
  display:grid;
  width:38px;
  height:38px;
  place-items:center;
  border-radius:10px;
  background:var(--cm-blue-50);
  color:var(--cm-brand-blue,#1264E8);
  font-weight:800;
}
.directory-card__badge {
  max-width:70%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  padding:.24rem .48rem;
  border-radius:999px;
  background:var(--cm-slate-50);
  color:var(--color-text-secondary);
  font-size:.68rem;
  font-weight:750;
}
.directory-card h2 { margin:.9rem 0 .45rem; font-size:1.04rem; line-height:1.3; }
.directory-card p { margin:0; color:var(--color-text-secondary); font-size:.86rem; line-height:1.55; }
.directory-card__open {
  margin-top:auto;
  padding-top:1rem;
  color:var(--cm-brand-blue,#1264E8);
  font-size:.83rem;
  font-weight:700;
}
.directory-empty,.directory-noscript {
  padding:2rem;
  border:1px dashed var(--color-border);
  border-radius:14px;
  text-align:center;
  background:var(--cm-slate-50);
}
.directory-empty h2 { margin:0 0 .4rem; font-size:1.15rem; }
.directory-empty p { margin:0 0 1rem; color:var(--color-text-secondary); }

.recent-grid {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:1rem;
}
.recent-card {
  display:block;
  padding:1rem;
  border:1px solid var(--color-border);
  border-radius:14px;
  background:#fff;
  color:inherit;
}
.recent-card:hover { text-decoration:none; border-color:var(--cm-blue-200); }
.recent-card__meta { color:var(--cm-brand-blue,#1264E8); font-size:.7rem; font-weight:750; text-transform:uppercase; letter-spacing:.04em; }
.recent-card h3 { margin:.4rem 0 .35rem; font-size:1rem; }
.recent-card p { margin:0; color:var(--color-text-secondary); font-size:.83rem; line-height:1.5; }

.error-page {
  min-height:65vh;
  display:flex;
  align-items:center;
  padding:4rem 0;
  background:linear-gradient(180deg,#f6faff 0%,#fff 100%);
}
.error-page__inner { max-width:760px; text-align:center; margin:auto; }
.error-code {
  display:inline-block;
  margin-bottom:.4rem;
  color:var(--cm-brand-blue,#1264E8);
  font-size:clamp(4rem,14vw,8rem);
  font-weight:800;
  line-height:.9;
  letter-spacing:-.06em;
}
.error-page h1 { margin:.5rem 0; font-size:clamp(1.8rem,5vw,2.8rem); }
.error-page__lead { color:var(--color-text-secondary); font-size:1.05rem; line-height:1.65; }
.error-actions { display:flex; justify-content:center; gap:.7rem; flex-wrap:wrap; margin:1.4rem 0 2rem; }
.error-search {
  max-width:620px;
  margin:0 auto;
  padding:1rem;
  border:1px solid var(--color-border);
  border-radius:14px;
  background:#fff;
  box-shadow:var(--shadow-sm);
  text-align:left;
}
.error-search label { display:block; margin-bottom:.4rem; font-size:.8rem; font-weight:700; }
.error-search input { width:100%; min-height:46px; padding:.7rem .8rem; border:1px solid var(--cm-slate-300); border-radius:9px; font:inherit; }
.error-search .search-results { position:relative; top:auto; left:auto; right:auto; margin-top:.4rem; }

@media(max-width:900px) {
  .directory-toolbar { grid-template-columns:1fr 1fr; }
  .directory-grid,.recent-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media(max-width:620px) {
  .directory-toolbar,.directory-grid,.recent-grid { grid-template-columns:1fr; }
  .directory-summary { align-items:flex-start; }
}


/* Locked CalculateMeasure category icon family */
.category-hero__icon--locked {
  overflow: hidden;
  padding: 6px;
  background: #f7fbff;
}
.category-hero__icon--locked img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.category-card__icon--locked {
  height: 58px;
  display: flex;
  align-items: center;
  margin-bottom: var(--space-3);
}
.category-card__icon--locked img {
  display: block;
  width: 58px;
  height: 58px;
  object-fit: contain;
}


/* Stage 4F directory category artwork */
.directory-card__icon--locked {
  overflow:hidden;
  padding:2px;
  background:#f7fbff;
}
.directory-card__icon--locked img {
  width:100%;
  height:100%;
  display:block;
  object-fit:contain;
}


/* Stage 4G search discovery */
.search-results__all {
  display:block;
  padding:.8rem 1rem;
  border-top:1px solid var(--color-border);
  color:var(--cm-brand-blue,#1264E8);
  font-size:.82rem;
  font-weight:750;
  text-align:center;
  background:#f8fbff;
}
.search-results__all:hover { background:var(--cm-blue-50); }
.hero-search-shortcuts {
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  align-items:center;
  gap:.45rem;
  margin-top:.8rem;
  font-size:.78rem;
  color:var(--color-text-secondary);
}
.hero-search-shortcuts span { font-weight:700; }
.hero-search-shortcuts a {
  display:inline-flex;
  padding:.28rem .58rem;
  border:1px solid rgba(18,100,232,.18);
  border-radius:999px;
  background:rgba(255,255,255,.75);
  color:var(--cm-brand-blue,#1264E8);
  font-weight:650;
  text-decoration:none;
}
.hero-search-shortcuts a:hover {
  background:#fff;
  border-color:rgba(18,100,232,.38);
}


/* Stage 4H homepage polish */
.hero-proof {
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:.7rem;
  max-width:900px;
  margin:1.25rem auto 0;
}
.hero-proof > div {
  padding:.8rem .7rem;
  border:1px solid rgba(18,100,232,.12);
  border-radius:12px;
  background:rgba(255,255,255,.72);
  text-align:center;
}
.hero-proof strong {
  display:block;
  color:var(--cm-brand-navy,#071B4A);
  font-size:1rem;
}
.hero-proof span {
  display:block;
  margin-top:.15rem;
  color:var(--color-text-secondary);
  font-size:.72rem;
}

.section__header {
  gap:1rem;
}
.section-link {
  flex:0 0 auto;
  color:var(--cm-brand-blue,#1264E8);
  font-size:.86rem;
  font-weight:750;
  text-decoration:none;
}
.section-link:hover { text-decoration:underline; }

.featured-tool-grid {
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:1rem;
}
.featured-tool-card {
  display:flex;
  min-height:235px;
  flex-direction:column;
  padding:1.1rem;
  border:1px solid var(--color-border);
  border-radius:16px;
  background:#fff;
  color:inherit;
  box-shadow:var(--shadow-sm);
  text-decoration:none;
  transition:transform .16s ease,box-shadow .16s ease,border-color .16s ease;
}
.featured-tool-card:hover {
  transform:translateY(-2px);
  border-color:var(--cm-blue-200);
  box-shadow:var(--shadow-md);
  text-decoration:none;
}
.featured-tool-card__icon {
  width:54px;
  height:54px;
  margin-bottom:.8rem;
}
.featured-tool-card__icon img {
  width:100%;
  height:100%;
  object-fit:contain;
  display:block;
}
.featured-tool-card__body {
  display:flex;
  flex:1;
  flex-direction:column;
}
.featured-tool-card__body > span {
  color:var(--cm-brand-blue,#1264E8);
  font-size:.68rem;
  font-weight:800;
  letter-spacing:.05em;
  text-transform:uppercase;
}
.featured-tool-card h3 {
  margin:.35rem 0 .45rem;
  font-size:1rem;
  line-height:1.3;
}
.featured-tool-card p {
  margin:0;
  color:var(--color-text-secondary);
  font-size:.83rem;
  line-height:1.55;
}
.featured-tool-card strong {
  margin-top:auto;
  padding-top:.9rem;
  color:var(--cm-brand-blue,#1264E8);
  font-size:.8rem;
}

.value-section {
  padding-top:1rem;
}
.value-grid {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:1rem;
}
.value-card {
  position:relative;
  padding:1.25rem;
  border:1px solid var(--color-border);
  border-radius:16px;
  background:linear-gradient(180deg,#fff 0%,#fbfdff 100%);
}
.value-card__mark {
  display:inline-flex;
  margin-bottom:.75rem;
  color:var(--cm-brand-blue,#1264E8);
  font-size:.72rem;
  font-weight:850;
  letter-spacing:.08em;
}
.value-card h2 {
  margin:0 0 .45rem;
  font-size:1.05rem;
}
.value-card p {
  margin:0;
  color:var(--color-text-secondary);
  font-size:.86rem;
  line-height:1.6;
}

@media(max-width:900px){
  .featured-tool-grid{grid-template-columns:repeat(2,minmax(0,1fr));}
  .hero-proof{grid-template-columns:repeat(2,minmax(0,1fr));}
}
@media(max-width:700px){
  .value-grid{grid-template-columns:1fr;}
  .section__header{align-items:flex-start;}
}
@media(max-width:560px){
  .featured-tool-grid{grid-template-columns:1fr;}
  .hero-proof{grid-template-columns:1fr 1fr;}
}


/* Stage 4I category hub polish */
.category-hero__actions {
  display:flex;
  align-items:center;
  gap:.9rem;
  margin-top:1rem;
}
.btn--sm {
  padding:.58rem .9rem;
  font-size:.8rem;
}
.category-hero__all {
  color:var(--cm-brand-blue,#1264E8);
  font-size:.82rem;
  font-weight:750;
  text-decoration:none;
}
.category-hero__all:hover { text-decoration:underline; }

.tool-card {
  position:relative;
  transition:transform .16s ease,box-shadow .16s ease,border-color .16s ease;
}
.tool-card:hover {
  transform:translateY(-2px);
  border-color:var(--cm-blue-200);
  box-shadow:var(--shadow-md);
}
.tool-card__badge {
  display:inline-flex;
  align-self:flex-start;
  color:var(--cm-brand-blue,#1264E8);
  background:var(--cm-blue-50);
}

.related-category {
  position:relative;
  padding-left:4.7rem;
  min-height:82px;
}
.related-category__icon {
  position:absolute;
  left:1rem;
  top:50%;
  width:46px;
  height:46px;
  object-fit:contain;
  transform:translateY(-50%);
}

@media(max-width:560px){
  .category-hero__actions{align-items:flex-start;flex-direction:column;gap:.65rem;}
  .related-category{padding-left:4.4rem;}
}


/* Stage 4L launch readiness */
.skip-link {
  position:fixed;
  left:1rem;
  top:.75rem;
  z-index:9999;
  padding:.65rem .9rem;
  border-radius:8px;
  background:#071B4A;
  color:#fff;
  font-weight:750;
  transform:translateY(-180%);
  transition:transform .15s ease;
}
.skip-link:focus {
  transform:translateY(0);
  outline:3px solid #fff;
  outline-offset:2px;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline:3px solid rgba(18,100,232,.28);
  outline-offset:3px;
}

button,
.btn,
.header-search-trigger,
.menu-toggle,
.nav-dropdown__trigger {
  touch-action:manipulation;
}

img {
  max-width:100%;
  height:auto;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior:auto !important;
    animation-duration:.001ms !important;
    animation-iteration-count:1 !important;
    transition-duration:.001ms !important;
  }
}

@media(max-width:420px) {
  .container { padding-left:16px; padding-right:16px; }
  .hero__title { overflow-wrap:anywhere; }
  .header-search-box { min-width:0; }
}


/* Stage 4O product UX polish */
.directory-quick-filters {
  display:flex;
  gap:.5rem;
  overflow-x:auto;
  padding:.2rem 0 .85rem;
  scrollbar-width:thin;
}
.directory-quick-filters button {
  flex:0 0 auto;
  min-height:38px;
  padding:.45rem .75rem;
  border:1px solid var(--color-border);
  border-radius:999px;
  background:#fff;
  color:var(--color-text-secondary);
  font:inherit;
  font-size:.78rem;
  font-weight:700;
  cursor:pointer;
}
.directory-quick-filters button:hover,
.directory-quick-filters button.is-active {
  border-color:var(--cm-brand-blue,#1264E8);
  background:var(--cm-blue-50,#eff6ff);
  color:var(--cm-brand-blue,#1264E8);
}
.directory-card {
  transition:transform .16s ease,box-shadow .16s ease,border-color .16s ease;
}
.directory-card:hover {
  transform:translateY(-2px);
  border-color:var(--cm-blue-200);
  box-shadow:var(--shadow-md);
}

/* Stage 4S organic distribution */
.embed-discovery {
  max-width:680px;
  margin:1.5rem 0;
}
.embed-discovery label { display:block; font-weight:800; margin-bottom:.45rem; }
.embed-discovery input {
  width:100%; min-height:48px; padding:.75rem .9rem;
  border:1px solid var(--color-border); border-radius:10px; font:inherit;
}
.embed-discovery p { margin:.45rem 0 0; color:var(--color-text-secondary); font-size:.9rem; }
.embed-standards {
  margin:1rem 0 1.5rem; padding:1rem 1.15rem;
  border:1px solid var(--cm-blue-200,#bfdbfe); border-radius:14px; background:var(--cm-blue-50,#eff6ff);
}
.embed-standards h2 { margin-top:0; font-size:1.05rem; }
.embed-standards p { margin-bottom:0; }
.embed-directory-card[hidden] { display:none !important; }

/* ===== Scalable category hubs (Stage 5A) ===== */
.category-subcategory-nav{
  display:flex;
  flex-wrap:wrap;
  gap:.65rem;
  margin-top:1.35rem;
}
.category-subcategory-nav a{
  display:inline-flex;
  align-items:center;
  gap:.45rem;
  padding:.55rem .8rem;
  border:1px solid var(--color-border);
  border-radius:999px;
  background:var(--color-surface);
  color:var(--color-text-secondary);
  font-size:.88rem;
  font-weight:650;
  text-decoration:none;
}
.category-subcategory-nav a:hover{
  border-color:var(--color-primary);
  color:var(--color-primary);
}
.category-subcategory-nav a span{
  min-width:1.45rem;
  padding:.08rem .38rem;
  border-radius:999px;
  background:var(--color-surface-alt);
  color:var(--color-text-muted);
  text-align:center;
  font-size:.75rem;
}
.category-subcategory{scroll-margin-top:5.5rem;}


/* Facts & Figures product area */
.facts-hero {
  padding: clamp(3.5rem, 7vw, 6rem) 0 3rem;
  background:
    radial-gradient(circle at 85% 20%, rgba(18,100,232,.12), transparent 34%),
    linear-gradient(180deg,#f8fbff 0%,#fff 100%);
}
.facts-hero__grid {
  display:grid;
  grid-template-columns:minmax(0,1.25fr) minmax(280px,.75fr);
  gap:2rem;
  align-items:center;
}
.facts-hero h1 {
  margin:.25rem 0 .8rem;
  font-size:clamp(2.3rem,5vw,4.25rem);
  line-height:1.02;
  letter-spacing:-.04em;
}
.facts-hero__lead {
  max-width:760px;
  margin:0;
  color:var(--color-text-secondary);
  font-size:clamp(1rem,2vw,1.18rem);
  line-height:1.7;
}
.facts-hero__actions {
  display:flex;
  flex-wrap:wrap;
  gap:.75rem;
  margin-top:1.4rem;
}
.facts-visual {
  padding:1.4rem;
  border:1px solid rgba(18,100,232,.16);
  border-radius:22px;
  background:rgba(255,255,255,.92);
  box-shadow:var(--shadow-md);
}
.facts-visual__stat {
  display:flex;
  justify-content:space-between;
  gap:1rem;
  color:var(--color-text-secondary);
  font-size:.82rem;
}
.facts-visual__stat strong {
  color:var(--cm-brand-navy,#071B4A);
}
.facts-visual__bars {
  display:flex;
  height:150px;
  align-items:flex-end;
  gap:.65rem;
  padding:1rem 0;
}
.facts-visual__bars i {
  flex:1;
  min-width:24px;
  border-radius:8px 8px 3px 3px;
  background:linear-gradient(180deg,#35b9ff 0%,#1264e8 100%);
}
.facts-visual__bars i:nth-child(1){height:38%}
.facts-visual__bars i:nth-child(2){height:58%}
.facts-visual__bars i:nth-child(3){height:46%}
.facts-visual__bars i:nth-child(4){height:78%}
.facts-visual__bars i:nth-child(5){height:92%}

.facts-topic-grid {
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:1rem;
}
.facts-topic-card {
  min-height:220px;
  padding:1.15rem;
  border:1px solid var(--color-border);
  border-radius:16px;
  background:#fff;
  box-shadow:var(--shadow-sm);
}
.facts-topic-card > span {
  display:inline-flex;
  color:var(--cm-brand-blue,#1264E8);
  font-size:.68rem;
  font-weight:800;
  letter-spacing:.06em;
  text-transform:uppercase;
}
.facts-topic-card h3 {
  margin:.5rem 0;
  font-size:1.02rem;
}
.facts-topic-card p {
  margin:0;
  color:var(--color-text-secondary);
  font-size:.84rem;
  line-height:1.55;
}
.facts-topic-card em {
  display:block;
  margin-top:1rem;
  color:var(--color-text-muted,#64748b);
  font-size:.72rem;
  font-style:normal;
}
.facts-principles {
  padding:1.5rem;
  border:1px solid var(--color-border);
  border-radius:20px;
  background:#fff;
  box-shadow:var(--shadow-sm);
}
.facts-principle-grid {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:1rem;
  margin-top:1rem;
}
.facts-principle-grid > div {
  padding:1rem;
  border-radius:14px;
  background:#f8fbff;
}
.facts-principle-grid strong {
  display:block;
  color:var(--cm-brand-navy,#071B4A);
}
.facts-principle-grid p {
  margin:.45rem 0 0;
  color:var(--color-text-secondary);
  font-size:.86rem;
  line-height:1.6;
}
.facts-connect {
  display:flex;
  justify-content:space-between;
  gap:2rem;
  align-items:center;
  padding:1.4rem;
  border:1px solid rgba(18,100,232,.14);
  border-radius:18px;
  background:#fff;
}
.facts-connect > div { max-width:780px; }
.facts-connect h2 { margin:.25rem 0 .55rem; }
.facts-connect p { margin:0; color:var(--color-text-secondary); line-height:1.65; }

@media(max-width:900px){
  .facts-hero__grid{grid-template-columns:1fr}
  .facts-topic-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:640px){
  .facts-topic-grid,.facts-principle-grid{grid-template-columns:1fr}
  .facts-connect{align-items:flex-start;flex-direction:column}
}

/* Facts & Figures homepage feature */
.facts-home-section { padding-top:1rem; }
.facts-home-card {
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:2rem;
  align-items:center;
  padding:1.5rem;
  border:1px solid rgba(18,100,232,.16);
  border-radius:20px;
  background:
    radial-gradient(circle at 92% 8%,rgba(53,185,255,.13),transparent 30%),
    linear-gradient(135deg,#fff 0%,#f7fbff 100%);
  box-shadow:var(--shadow-sm);
}
.facts-home-card h2 { margin:.25rem 0 .5rem; font-size:clamp(1.5rem,3vw,2rem); }
.facts-home-card p { max-width:780px; margin:0; color:var(--color-text-secondary); line-height:1.65; }
.facts-home-card__tags { display:flex; flex-wrap:wrap; gap:.45rem; margin-top:1rem; }
.facts-home-card__tags span {
  padding:.28rem .55rem;
  border:1px solid rgba(18,100,232,.14);
  border-radius:999px;
  background:#fff;
  color:var(--cm-brand-blue,#1264E8);
  font-size:.72rem;
  font-weight:700;
}
.facts-home-card__action { max-width:260px; text-align:center; }
.facts-home-card__action small { display:block; margin-top:.65rem; color:var(--color-text-secondary); line-height:1.45; }
@media(max-width:760px){
  .facts-home-card{grid-template-columns:1fr;align-items:start}
  .facts-home-card__action{max-width:none;text-align:left}
}

/* Stage 5AH Facts embeds */
.facts-connect--embed { align-items:flex-start; }
.facts-embed-rules {
  margin:1rem 0 0;
  padding-left:1.15rem;
  color:var(--color-text-secondary);
}
.facts-embed-rules li { margin:.35rem 0; line-height:1.5; }

/* Stage 5AI suggestion vetting */
.facts-suggestion-review,.facts-suggest-cta {
  padding:1.15rem 1.25rem;border:1px solid rgba(18,100,232,.18);border-radius:16px;background:#f8fbff;
}
.facts-suggestion-review { margin-bottom:1.4rem; }
.facts-suggestion-review strong { color:var(--cm-brand-navy,#071B4A); }
.facts-suggestion-review p { margin:.45rem 0 0; }
.facts-suggest-cta { display:flex;align-items:center;justify-content:space-between;gap:1.5rem; }
.facts-suggest-cta h2 { margin:.2rem 0 .4rem; }
.facts-suggest-cta p { margin:0;max-width:700px;color:var(--color-text-secondary); }
@media(max-width:700px){.facts-suggest-cta{align-items:flex-start;flex-direction:column}}


/* Stage 5AJ AdSense architecture */
.ad-zone[hidden] { display:none !important; }
.ad-zone.is-active {
  width:min(100%,1200px);
  min-height:110px;
  margin:1.25rem auto;
  padding:.45rem 1rem 1rem;
  overflow:hidden;
  text-align:center;
  background:#fff;
}
.ad-zone__label {
  display:block;
  margin-bottom:.35rem;
  color:#64748b;
  font-size:.62rem;
  font-weight:600;
  letter-spacing:.06em;
  text-transform:uppercase;
}
.ad-zone--post-result.is-active,
.ad-zone--content-mid.is-active,
.ad-zone--facts-after-summary.is-active {
  min-height:130px;
}
@media(min-width:900px){
  .ad-zone.is-active { min-height:140px; }
}
@media(max-width:640px){
  .ad-zone.is-active {
    min-height:100px;
    margin:1rem auto;
    padding-left:.5rem;
    padding-right:.5rem;
  }
}

/* Facts & Figures product pilot */
.ff-product-hero{padding:3.5rem 0 2rem;background:linear-gradient(180deg,#f4fbff 0%,#fff 100%)}.ff-product-hero h1{font-size:clamp(2.3rem,6vw,4.2rem);margin:.3rem 0 .8rem}.ff-meta{display:flex;flex-wrap:wrap;gap:.65rem;margin-top:1.4rem}.ff-meta span{background:#fff;border:1px solid #dce7f0;border-radius:999px;padding:.5rem .8rem;font-size:.9rem}.ff-stat-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:1rem;margin-bottom:1.5rem}.ff-stat,.ff-panel,.ff-method{background:#fff;border:1px solid #dce7f0;border-radius:18px;box-shadow:0 10px 28px rgba(7,27,74,.06)}.ff-stat{padding:1.25rem}.ff-stat span,.ff-stat small{display:block;color:var(--color-text-secondary)}.ff-stat strong{display:block;font-size:1.65rem;color:var(--cm-brand-navy,#071B4A);margin:.25rem 0}.ff-panel,.ff-method{padding:1.5rem;margin:1.5rem 0}.ff-bars{display:grid;gap:.65rem}.ff-bar-row{display:grid;grid-template-columns:130px 1fr 55px;gap:.7rem;align-items:center;font-size:.9rem}.ff-bar-row>div{height:12px;background:#edf3f7;border-radius:99px;overflow:hidden}.ff-bar-row i{display:block;height:100%;background:linear-gradient(90deg,#1264e8,#21b8c7);border-radius:99px}.ff-table-head{display:flex;justify-content:space-between;align-items:end;gap:1rem}.ff-table-head input{display:block;margin-top:.35rem;padding:.65rem .8rem;border:1px solid #bdcad6;border-radius:10px}.ff-table-wrap{overflow:auto}.ff-table{width:100%;border-collapse:collapse;margin-top:1rem}.ff-table th,.ff-table td{text-align:left;padding:.7rem;border-bottom:1px solid #e6edf3}.ff-table th{font-size:.8rem;text-transform:uppercase;letter-spacing:.04em;color:var(--color-text-secondary)}.ff-method p{line-height:1.7}.facts-topic-card--live{border-color:#a9d9d5}.facts-topic-card--live>span{background:#e5f8f5;color:#0f766e}.facts-topic-card h3 a{color:inherit;text-decoration:none}.facts-topic-card h3 a:hover{text-decoration:underline}@media(max-width:700px){.ff-stat-grid{grid-template-columns:1fr}.ff-bar-row{grid-template-columns:90px 1fr 48px}.ff-table-head{align-items:flex-start;flex-direction:column}}

.ff-snapshot-list{list-style:none;padding:0;margin:1.25rem 0;display:grid;gap:.65rem}.ff-snapshot-list li{display:flex;justify-content:space-between;gap:1rem;padding:.8rem 0;border-bottom:1px solid var(--color-border,#e5e7eb)}.ff-snapshot-list li span{color:var(--color-text-muted,#64748b);font-size:.875rem}

.ff-stat-grid--four{grid-template-columns:repeat(4,1fr)}.ff-table-head select{display:block;margin-top:.35rem;padding:.65rem .8rem;border:1px solid #bdcad6;border-radius:10px;background:#fff}.ff-panel-note{color:var(--color-text-secondary);line-height:1.6;margin:.35rem 0 0}.ff-sector-grid,.ff-insight-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:1rem;margin-top:1.2rem}.ff-sector-grid>div,.ff-insight-grid>div{padding:1.1rem;border:1px solid #e1e9ef;border-radius:14px;background:#f8fbfd}.ff-sector-grid span,.ff-sector-grid small,.ff-insight-grid span{display:block;color:var(--color-text-secondary)}.ff-sector-grid strong,.ff-insight-grid strong{display:block;font-size:1.45rem;color:var(--cm-brand-navy,#071B4A);margin:.25rem 0}.ff-table--sortable th[data-key]{cursor:pointer;user-select:none}.ff-table--sortable th[data-key]:hover{color:#1264e8}@media(max-width:900px){.ff-stat-grid--four,.ff-sector-grid,.ff-insight-grid{grid-template-columns:repeat(2,1fr)}}@media(max-width:600px){.ff-stat-grid--four,.ff-sector-grid,.ff-insight-grid{grid-template-columns:1fr}.ff-bar-row{grid-template-columns:105px 1fr 62px}.ff-table{min-width:820px}}
