/* Shared mobile drawer — tool pages + content pages */
.nav-hamburger {
  display: none;
  background: transparent; border: 0;
  width: 44px; height: 44px; border-radius: 10px;
  align-items: center; justify-content: center;
  color: #0f172a; cursor: pointer;
}
.nav-hamburger:hover { background: #f1f5f9; }
.nav-hamburger svg { width: 22px; height: 22px; }

.mobile-drawer { position: fixed; inset: 0; z-index: 9999; display: none; }
.mobile-drawer.open { display: flex; }
.md-backdrop {
  position: absolute; inset: 0;
  background: rgba(15,23,42,.45); backdrop-filter: blur(3px);
  animation: mdFade .2s ease;
}
.md-panel {
  position: relative; margin-left: auto;
  width: 88%; max-width: 380px; height: 100%;
  background: #fff; display: flex; flex-direction: column;
  box-shadow: -24px 0 48px rgba(15,23,42,.18);
  animation: mdSlide .25s ease; overflow-y: auto;
}
@keyframes mdFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes mdSlide { from { transform: translateX(100%); } to { transform: translateX(0); } }

.md-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px; border-bottom: 1px solid #e2e8f0;
  position: sticky; top: 0; background: #fff; z-index: 2;
}
.md-head img { height: 26px; display: block; }
.md-close {
  width: 40px; height: 40px; border-radius: 10px;
  background: transparent; border: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #0f172a;
}
.md-close:hover { background: #f1f5f9; }
.md-close svg { width: 20px; height: 20px; }

.md-body { padding: 16px 10px; flex: 1; }
.md-section { margin-bottom: 18px; }
.md-section-label {
  font-size: 11px; font-weight: 800; letter-spacing: .09em;
  color: #94a3b8; text-transform: uppercase;
  padding: 0 12px 6px;
}
.md-link {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; border-radius: 10px;
  font-size: 15px; font-weight: 600; color: #0f172a;
  text-decoration: none; transition: background .12s;
}
.md-link:hover, .md-link:focus { background: #f1f5f9; color: #493ee5; }
.md-link .material-symbols-outlined {
  font-size: 20px; color: #493ee5; flex-shrink: 0;
}

.md-cta {
  padding: 16px 20px calc(16px + env(safe-area-inset-bottom));
  border-top: 1px solid #e2e8f0;
  display: flex; flex-direction: column; gap: 10px;
  background: #fff; position: sticky; bottom: 0;
}
.md-cta a {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 16px; border-radius: 10px;
  font-size: 15px; font-weight: 700; text-decoration: none;
}
.md-cta a .material-symbols-outlined { font-size: 18px; color: #493ee5; flex-shrink: 0; }
.md-cta-primary .material-symbols-outlined { color: #fff !important; }
.md-cta-ghost { border: 1.5px solid #e2e8f0; color: #0f172a; background: #fff; }
.md-cta-ghost:hover { background: #f1f5f9; }
.md-cta-primary { background: #493ee5; color: #fff; }
.md-cta-primary:hover { background: #3d33c9; }

/* ── Drawer — language selector (Sign-in is handled in the sticky footer) ──
   The language selector renders as a full-width button matching the bottom
   CTA styling. `!important` used to beat any cached or later-loaded rule
   from the component stylesheet (i18n-selector.css). */

/* Language selector — stretch wrapper + button to full width */
.md-body .md-section [data-i18n-selector],
.md-body .md-section .i18n-sel {
  display: block !important;
  width: auto !important;
  margin: 0 12px !important;
}
.md-body .md-section .i18n-sel .i18n-sel-btn {
  display: flex !important;
  width: 100% !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 13px 16px !important;
  border: 1.5px solid #e2e8f0 !important;
  border-radius: 10px !important;
  background: #fff !important;
  color: #0f172a !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  box-sizing: border-box !important;
}
.md-body .md-section .i18n-sel .i18n-sel-btn:hover {
  background: #f1f5f9 !important;
  border-color: #c7d2fe !important;
}
.md-body .md-section .i18n-sel .i18n-sel-current { max-width: none !important; }
.md-body .md-section .i18n-sel .i18n-sel-globe svg { width: 16px !important; height: 16px !important; }
.md-body .md-section .i18n-sel .i18n-sel-chev svg { width: 13px !important; height: 13px !important; }
.md-body .md-section .i18n-sel .i18n-sel-menu {
  left: 0 !important;
  right: 0 !important;
  min-width: 0 !important;
}

/* Hide desktop nav + nav-cta earlier (1100px) so the tablet / narrow-laptop
   range doesn't land in the broken zone where 8+ nav items fight for space
   and wrap to multiple lines. Hamburger takes over from 1100px downward. */
@media (max-width: 1100px) {
  .nav-hamburger { display: inline-flex !important; }
  .nav-cta { display: none !important; }
  .nav-links { display: none !important; }
  .nav-inner { gap: 12px !important; }
  .nav-logo-full { height: 28px !important; }
}

/* Prevent individual nav-link text from wrapping if anything slips through
   (e.g. "How it works" should be one line regardless of viewport). */
.nav-link,
.nav-link-tools,
.btn-ghost,
.btn-primary,
.nav-ext-btn { white-space: nowrap; }

/* Content padding polish on small screens */
@media (max-width: 640px) {
  .container { padding-left: 16px !important; padding-right: 16px !important; }
}

/* ── Content pages (privacy, terms, cookies, whitepapers) mobile typography ── */
@media (max-width: 768px) {
  .policy-hero { padding: 44px 0 28px !important; }
  .policy-hero h1 {
    font-size: clamp(24px, 6.5vw, 32px) !important;
    line-height: 1.2 !important;
    letter-spacing: -0.02em;
  }
  .policy-hero .subtitle {
    font-size: 15px !important;
    line-height: 1.65 !important;
  }
  .policy-meta { gap: 14px !important; font-size: 12px !important; }

  .policy-content {
    padding: 36px 16px 56px !important;
    max-width: 100% !important;
  }
  .policy-content h2 {
    font-size: 19px !important;
    margin-top: 32px !important;
    padding-bottom: 8px !important;
  }
  .policy-content h3 {
    font-size: 16px !important;
    margin-top: 22px !important;
  }
  .policy-content p,
  .policy-content li {
    font-size: 15px !important;
    line-height: 1.7 !important;
  }
  .policy-content ul,
  .policy-content ol { padding-left: 20px !important; }

  /* Callouts — reduce padding on mobile */
  .callout, .callout-green, .callout-amber {
    padding: 14px 16px !important;
    margin: 18px 0 !important;
  }
  .callout p, .callout-green p, .callout-amber p { font-size: 13.5px !important; }

  /* TOC — more compact */
  .toc { padding: 18px 20px !important; margin-bottom: 28px !important; }
  .toc h3 { font-size: 14px !important; }
  .toc li { font-size: 13px !important; line-height: 1.9 !important; }

  /* Tables — allow horizontal scroll so they don't break layout */
  .data-table {
    display: block !important;
    overflow-x: auto !important;
    white-space: nowrap;
    font-size: 13px !important;
    -webkit-overflow-scrolling: touch;
  }
  .data-table th, .data-table td { padding: 10px 12px !important; }
}

@media (max-width: 420px) {
  .policy-hero h1 { font-size: 22px !important; }
  .policy-content h2 { font-size: 17px !important; }
}


/* ── Tool / landing page medium-width: stack multi-column inline grids ──
   Many tool pages use inline `grid-template-columns: 1fr 1fr` (hero: text + mock).
   Below 1100px (tablet / narrow laptop) the two-column layout squeezes each
   column too tightly, so we drop to single column and let the mock flow below. */
@media (max-width: 1100px) {
  div[style*="grid-template-columns:1fr 1fr"],
  div[style*="grid-template-columns: 1fr 1fr"],
  div[style*="grid-template-columns:repeat(2"],
  div[style*="grid-template-columns: repeat(2"],
  .hero-grid,
  .home-hero .hero-grid {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
  }
  /* Class-based grids used across tool pages */
  .how-grid,
  .compare-grid,
  .val-grid,
  .priv-grid,
  .preview-grid,
  .killer-grid {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }
  .uc-grid,
  .footer-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 24px !important;
  }
}

/* Extra-narrow viewport: fully stack any remaining 2-up grids */
@media (max-width: 640px) {
  .uc-grid,
  .footer-grid {
    grid-template-columns: 1fr !important;
  }
}
@media (max-width: 640px) {
  /* Stack 3+ column grids too on phones */
  div[style*="grid-template-columns:repeat(3"],
  div[style*="grid-template-columns: repeat(3"],
  div[style*="grid-template-columns:repeat(4"],
  div[style*="grid-template-columns: repeat(4"],
  div[style*="grid-template-columns:repeat(5"],
  div[style*="grid-template-columns: repeat(5"],
  div[style*="grid-template-columns:repeat(6"],
  div[style*="grid-template-columns: repeat(6"] {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }
}

/* Hero section tap targets + full-width CTAs on mobile */
@media (max-width: 640px) {
  section a[style*="display:inline-flex"][style*="padding:14px"],
  section a[style*="display: inline-flex"][style*="padding:14px"] {
    width: 100%;
    justify-content: center;
  }
  /* Hero headlines breathe */
  section h1 { letter-spacing: -0.02em; }
}
