/* Shared responsive refinements, loaded after each page's own styles. */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
.wrap, .header-inner, .product-grid > *, .decision-layout > *,
.performance-grid > *, .docs-layout > *, .legal-layout > * { min-width: 0; }
.footer-bottom nav, .footer-legal nav { min-width: 0; flex-wrap: wrap; }
.footer-bottom a, .footer-legal a { overflow-wrap: anywhere; }
.footer-bottom nav a, .footer-legal nav a, .legal-home {
  display: inline-flex; align-items: center; min-height: 44px;
}
.docs-toc > summary, .legal-toc-disclosure > summary { display: none; }
.docs-code, .docs-table-scroll, .legal-table-scroll {
  overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch;
}
.docs-sidebar { max-height: calc(100dvh - 145px); overflow-y: auto; }

@media screen and (min-width: 701px) and (max-width: 800px) {
  .legal-toc-disclosure { border: 0 !important; border-radius: 0 !important; background: none !important; }
  .legal-toc-disclosure > summary { display: none !important; }
}

@media screen and (max-width: 900px) {
  html { scroll-padding-top: 88px; }
  .header, .legal-page .header { height: 72px; }
  .header-inner, .docs-page .header-inner { padding: 0 24px; gap: 16px; }
  .header .brand { flex-shrink: 0; font-size: 26px; }
  .header-cta, .docs-page .header-cta { display: none; }
  .menu-button {
    display: flex; flex-shrink: 0; margin-left: auto;
    flex-direction: column; justify-content: center; align-items: center;
    gap: 6px; width: 48px; height: 48px; padding: 0;
    border: 1px solid var(--line); border-radius: 6px;
    background: #fff; cursor: pointer;
  }
  .menu-button span { width: 20px; height: 2px; background: var(--ink); transition: transform .2s; }
  .menu-button[aria-expanded=true] span:first-child { transform: translateY(4px) rotate(45deg); }
  .menu-button[aria-expanded=true] span:last-child { transform: translateY(-4px) rotate(-45deg); }
  .nav, .docs-page .nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    margin: 0; padding: 12px 24px 20px; gap: 0;
    max-height: calc(100vh - 72px); max-height: calc(100dvh - 72px);
    overflow-y: auto; background: #fff; border-bottom: 1px solid var(--line);
    box-shadow: 0 14px 22px #191d1b0a;
  }
  .nav.open { display: flex; flex-direction: column; }
  .nav a { display: flex; align-items: center; min-height: 48px; padding: 12px 4px; font-size: 1rem; }
  .header .brand, .legal-home { min-height: 44px; }
  .product-grid { grid-template-columns: 1fr; gap: 20px; }
  .product-card { padding: 25px 25px 0; }
  .card-top { font-size: .75rem; line-height: 1.5; }
  .card-index { display: block; }
  .product-card h3 { font-size: 2.25rem; }
  .product-tagline { min-height: 0; font-size: 1rem; }
  .product-description { min-height: 0; font-size: 1rem; }
  .card-diagram { margin-left: -25px; margin-right: -25px; height: 190px; }
  .product-link { font-size: 1rem; min-height: 56px; }
}

@media screen and (max-width: 800px) {
  .focus-intro, .focus-panel, .decision-copy { min-width: 0; }
  .product-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .product-tab { min-width: 0; min-height: 48px; white-space: normal; overflow-wrap: anywhere; font-size: 1rem; }
  .key-specs dd { overflow-wrap: anywhere; }
  .key-specs dd span { display: block; }
  .docs-layout { gap: 28px; padding-top: 24px; }
  .docs-sidebar { position: static; max-height: none; overflow: visible; }
  .docs-sidebar > p { display: none; }
  .docs-toc, .legal-toc-disclosure { border: 1px solid var(--line); border-radius: 7px; background: #f7f9f5; }
  .docs-toc > summary, .legal-toc-disclosure > summary {
    display: flex; justify-content: space-between; align-items: center;
    gap: 16px; min-height: 48px; padding: 14px 16px;
    list-style: none; font-size: 1rem; font-weight: 500; cursor: pointer;
  }
  .docs-toc > summary::-webkit-details-marker, .legal-toc-disclosure > summary::-webkit-details-marker { display: none; }
  .docs-toc > summary::after, .legal-toc-disclosure > summary::after { content: '+'; font-size: 1.25rem; }
  .docs-toc[open] > summary::after, .legal-toc-disclosure[open] > summary::after { content: '−'; }
  .docs-toc > summary:focus-visible, .legal-toc-disclosure > summary:focus-visible { outline: 3px solid #56810a; outline-offset: 3px; }
  .docs-sidebar nav { grid-template-columns: repeat(2, minmax(0, 1fr)); border: 0; padding: 0 16px 12px; gap: 0 16px; }
  .docs-sidebar nav a { display: flex; align-items: center; min-height: 44px; font-size: .875rem; }
  .docs-content .docs-code { font-size: .875rem; }
  .docs-content .docs-note { font-size: .875rem; }
  .docs-table-scroll { margin: 22px 0; border: 1px solid #dce4d6; border-radius: 6px; }
  .docs-table-scroll .docs-table { min-width: 460px; }
  .docs-table caption { padding: 12px; margin: 0; }
  .docs-section, .docs-type-section { scroll-margin-top: 16px; }
}

@media screen and (max-width: 700px) {
  .wrap { padding-left: 24px; padding-right: 24px; }
  .hero-main { padding-top: 36px; }
  .hero-eyebrow { font-size: .75rem; letter-spacing: .04em; line-height: 1.5; }
  .hero h1 { font-size: clamp(2.75rem, 11.7vw, 5rem); letter-spacing: -.055em; overflow-wrap: anywhere; }
  .hero-support { font-size: 1rem; line-height: 1.8; }
  .button { font-size: 1rem; min-height: 48px; }
  .hero-art { height: clamp(225px, 62vw, 340px); margin: 0 -24px; background-position: 55% 50%; }
  .hero-art-caption { bottom: 18px; font-size: .75rem; }
  .hero-bottom { margin: 0 24px; padding: 12px 0; }
  .hero-bottom > div { flex-wrap: wrap; gap: 8px 12px; }
  .hero-bottom a { display: inline-flex; align-items: center; min-height: 44px; }
  .hero-bottom .scroll-cue { display: none; }
  .section-label { font-size: .75rem; line-height: 1.6; letter-spacing: .035em; }
  .section-number { flex-shrink: 0; }
  .section-heading > p, .approach-copy { font-size: 1rem; }
  .focus-panel .panel-description { font-size: 1rem; }
  .flow-row { font-size: .875rem; }
  .flow-step { font-size: .75rem; width: auto; min-width: 65px; }
  .flow-highlight strong { font-size: .875rem; }
  .flow-token { font-size: .75rem; }
  .focus-section, .performance-section, .product-card { scroll-margin-top: 16px; }
  .example-context blockquote, .mode-panel h4 { overflow-wrap: anywhere; }
  .example-topline { flex-wrap: wrap; }
  .performance-chart figcaption, .performance-footer { flex-wrap: wrap; }
  .performance-note, .performance-summary, .performance-context { overflow-wrap: anywhere; }
  .performance-number { font-size: clamp(2.75rem, 14.5vw, 4.25rem); letter-spacing: -.04em; }
  .performance-number > span { letter-spacing: 0; }
  .benchmark-label { align-items: flex-start; }
  .benchmark-label strong { flex-shrink: 0; }
  .benchmark-label small { display: block; margin-left: 0; text-align: right; }
  .performance-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .performance-tabs button { font-size: .875rem; padding: 12px 6px; word-break: keep-all; }
  .footer-top, .footer-bottom, .footer-legal { row-gap: 12px; }
  .footer-bottom { align-items: flex-start; }
  .footer-bottom > span { flex-basis: 100%; }
  .footer-bottom nav, .footer-bottom .legal-links { gap: 0 20px; }
  .footer-bottom nav a, .footer-legal a { font-size: .875rem; }
  .legal-highlights > div { flex-wrap: wrap; }
  .legal-highlights span { font-size: .875rem; text-align: left; }
  .legal-switch a { min-height: 44px; display: flex; align-items: center; }
  .legal-toc { grid-template-columns: 1fr; padding: 0 16px 12px; gap: 0; }
  .legal-toc a { font-size: .875rem; min-height: 44px; display: flex; align-items: center; }
  .legal-section { scroll-margin-top: 16px; }
  .legal-home { font-size: .875rem; gap: 6px; }
}

@media screen and (max-width: 600px) {
  .mode-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
  .mode-tab { flex-direction: column; gap: 8px; padding: 14px 5px; border-left: 0; border-bottom: 2px solid #424e3b; text-align: center; justify-content: center; }
  .mode-tab.active { border-bottom-color: var(--lime); }
  .mode-tab strong { font-size: .875rem; line-height: 1.5; word-break: keep-all; overflow-wrap: anywhere; }
  .mode-tab small { display: none; }
  .mode-tab code { font-size: .75rem; }
  .example-stage { padding: 22px; }
  .mode-panel { min-height: 0; }
  .key-specs { gap: 24px 16px; }
  .key-specs > div { padding: 0; border: 0; }
  .key-specs > div:first-child { grid-column: 1 / -1; padding-bottom: 20px; border-bottom: 1px solid #45513e; }
  .key-specs > div:last-child { grid-column: 1 / -1; }
  .key-specs dd span { display: inline; white-space: normal; }
  .docs-endpoint { align-items: flex-start; }
  .docs-endpoint > span { flex-shrink: 0; }
  .docs-endpoint code { min-width: 0; }
  .docs-types { gap: 8px; }
  .docs-types a { min-width: 0; min-height: 64px; }
  .docs-types span { font-size: .875rem; line-height: 1.6; }
}

@media screen and (max-width: 380px) {
  .wrap { padding-left: 20px; padding-right: 20px; }
  .header-inner, .docs-page .header-inner { padding: 0 20px; gap: 12px; }
  .header .brand, .legal-page .brand { font-size: 24px; }
  .hero-eyebrow { font-size: .75rem; gap: 8px; letter-spacing: 0; }
  .small-mark { flex-shrink: 0; }
  .hero-art { margin-left: -20px; margin-right: -20px; }
  .hero-bottom { margin: 0 20px; }
  .focus-intro h2, .focus-panel h3 { font-size: 1.75rem; letter-spacing: -.04em; }
  .product-tab { padding: 12px 4px; font-size: .875rem; }
  .example-stage { padding: 18px; }
  .example-context blockquote { font-size: 1rem; }
  .legal-home span { display: none; }
  .legal-home { white-space: nowrap; }
}
