/*
 * Authority: docs/ui-v3-remediation-authority.md
 * Phase R2 — browser-final shell and typography rules.
 * This static stylesheet is linked after Astro-generated bundles.
 */

:root {
  --sog-font-interface: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html {
  scroll-padding-top: 5rem;
}

html body {
  font-family: var(--sog-font-interface) !important;
  font-size: 16px !important;
  line-height: 1.62 !important;
}

html body :where(h1, h2, h3, h4, p, li, dt, dd, th, td, label, button, input, select, textarea, summary, a, span, strong, small) {
  font-family: var(--sog-font-interface) !important;
}

html body :where(code, pre, kbd, samp, .contract-address, .transaction-hash, [data-long-value]) {
  font-family: var(--sog-font-data) !important;
  overflow-wrap: anywhere !important;
  word-break: break-word !important;
}

html body a {
  overflow-wrap: normal !important;
  word-break: normal !important;
}

html body :where(h1, .editorial-page-title h1, .guide-index-title h1, .guide-article-masthead h1, .stablecoin-dossier-title-row h1, .stablecoin-register-header h1) {
  max-width: 24ch !important;
  font-size: clamp(2.5rem, 4vw, 3rem) !important;
  line-height: 1.12 !important;
  letter-spacing: -0.02em !important;
  overflow-wrap: normal !important;
  word-break: normal !important;
}

html body h2 {
  font-size: clamp(1.55rem, 2.6vw, 2rem) !important;
  line-height: 1.2 !important;
  letter-spacing: -0.015em !important;
}

html body h3 {
  font-size: clamp(1.08rem, 1.8vw, 1.35rem) !important;
  line-height: 1.28 !important;
  letter-spacing: -0.01em !important;
}

/* One-row shell. */
html body .site-header {
  min-height: 64px !important;
  padding: 0 !important;
  border-bottom: 1px solid var(--sog-line-subtle) !important;
  background: color-mix(in srgb, var(--sog-background) 97%, transparent) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18) !important;
  backdrop-filter: blur(14px) saturate(120%) !important;
}

html body .site-header-primary {
  border-bottom: 0 !important;
}

html body .site-header-inner {
  min-height: 64px !important;
  grid-template-columns: minmax(150px, 190px) minmax(240px, 1fr) auto auto !important;
  gap: clamp(0.65rem, 1.4vw, 1.25rem) !important;
}

html body .site-brand-cluster {
  display: block !important;
}

html body .site-brand-purpose {
  display: none !important;
}

html body .site-brand img {
  width: min(174px, 100%) !important;
}

html body .site-search-control {
  min-height: 42px !important;
  padding: 0.15rem !important;
  border-radius: 10px !important;
  box-shadow: none !important;
}

html body .site-search input,
html body .mobile-site-search input {
  min-height: 38px !important;
  font-size: 0.9375rem !important;
}

html body .site-search button,
html body .mobile-site-search button {
  min-height: 36px !important;
  border-radius: 7px !important;
}

html body .utility-navigation {
  gap: 0.2rem !important;
}

html body .utility-navigation a,
html body .mobile-navigation summary {
  min-height: 40px !important;
  padding-inline: 0.7rem !important;
  font-size: 0.875rem !important;
}

html body .site-navigation-bar {
  display: none !important;
}

html body .mobile-navigation {
  position: relative !important;
  display: block !important;
  margin: 0 !important;
}

html body .mobile-navigation-panel {
  top: calc(100% + 0.7rem) !important;
  right: 0 !important;
  left: auto !important;
  width: min(720px, calc(100vw - 2rem)) !important;
  max-height: calc(100vh - 5.5rem) !important;
  border-radius: 10px !important;
}

html body .mobile-navigation-links {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

html body .mobile-navigation-links a,
html body .mobile-navigation-utilities a {
  justify-content: flex-start !important;
  min-height: 40px !important;
  padding: 0.55rem 0.7rem !important;
  text-align: left !important;
}

html body .site-main {
  width: min(calc(100% - 2rem), 1240px) !important;
  padding-block: clamp(1.25rem, 2.2vw, 2rem) clamp(3rem, 5vw, 5rem) !important;
}

html body table,
html body table th,
html body table td {
  font-size: 14px !important;
  line-height: 1.48 !important;
}

html body table th,
html body table td {
  padding-block: 0.7rem !important;
}

/* Inline-size containment for generated disclosures and locally wide data. */
html body .site-footer-navigation,
html body .site-footer-disclosure,
html body .site-footer-disclosure > summary,
html body .site-footer-disclosure-panel {
  box-sizing: border-box !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
}

html body .site-footer-navigation,
html body .site-footer-disclosure {
  overflow: hidden !important;
}

html body .site-footer-disclosure-panel {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 0.1rem !important;
}

html body .site-footer-disclosure-panel a {
  box-sizing: border-box !important;
  display: flex !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  min-height: 34px !important;
  padding-block: 0.2rem !important;
  font-size: 0.8125rem !important;
  white-space: normal !important;
  overflow-wrap: normal !important;
  word-break: normal !important;
}

html body details.stablecoin-technical-disclosure,
html body article.editorial-page > section[id] {
  box-sizing: border-box !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  overflow-x: auto !important;
  overscroll-behavior-inline: contain !important;
}

html body details.stablecoin-technical-disclosure > table,
html body article.editorial-page > section[id] > table {
  max-width: none !important;
}

/* Compact Home entrypoint. */
html body .home-registry .home-entry {
  min-height: 0 !important;
  margin: 0 !important;
  padding: clamp(1.5rem, 3vw, 2.25rem) 0 !important;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 460px) !important;
  gap: clamp(1.5rem, 3vw, 2.75rem) !important;
  align-items: center !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: visible !important;
}

html body .home-registry .home-entry::before,
html body .home-registry .home-entry::after {
  display: none !important;
}

html body .home-registry .home-entry__copy,
html body .home-registry .home-search {
  padding: 0 !important;
}

html body .home-registry .home-entry .home-entry__copy h1 {
  max-width: 18ch !important;
  margin-bottom: 0.8rem !important;
  font-size: clamp(2.5rem, 4vw, 3rem) !important;
  line-height: 1.08 !important;
  letter-spacing: -0.025em !important;
}

html body .home-registry .home-entry__deck {
  max-width: 64ch !important;
  font-size: 1.0625rem !important;
  line-height: 1.6 !important;
}

html body .home-registry .home-search {
  border: 1px solid var(--sog-line-subtle) !important;
  border-radius: 10px !important;
  background: var(--sog-surface) !important;
  box-shadow: none !important;
}

html body .home-registry .home-registry-totals {
  gap: 1px !important;
  border: 1px solid var(--sog-line-subtle) !important;
  border-radius: 10px !important;
  overflow: hidden !important;
  background: var(--sog-line-subtle) !important;
}

html body .home-registry .home-registry-totals a {
  min-height: 76px !important;
  padding: 0.8rem 0.9rem !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

html body .home-registry .home-registry-totals strong {
  font-family: var(--sog-font-interface) !important;
  font-size: 1.45rem !important;
}

html body .home-registry .home-explore-card {
  min-height: 0 !important;
  padding: 1rem !important;
  border-radius: 10px !important;
  box-shadow: none !important;
}

html body .home-registry :where(.home-eyebrow, .home-search__popular > span, .home-search__popular button, .home-search__summary, .home-search__type, .home-explore-card > span, .home-material-list__meta, .home-status-ledger dd, .home-issue-list li > div span, .home-issue-list time, .home-publications time, .home-recent-grid > a > div span, .home-guide-grid article > div) {
  font-family: var(--sog-font-interface) !important;
}

/* Compact footer. */
html body .site-footer-inner {
  padding-block: 1.75rem 1.25rem !important;
  grid-template-columns: minmax(220px, 0.75fr) minmax(0, 2fr) !important;
  gap: clamp(1.5rem, 3vw, 2.5rem) !important;
}

html body .site-footer-principles,
html body .site-footer-meta {
  display: none !important;
}

html body .site-footer-navigation {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 1rem !important;
}

html body .site-footer-group a {
  min-height: 34px !important;
  padding-block: 0.2rem !important;
  font-size: 0.8125rem !important;
  overflow-wrap: normal !important;
  word-break: normal !important;
}

html body .mobile-record-list h3,
html body .mobile-card-grid h3 {
  font-family: var(--sog-font-interface) !important;
}

@media (max-width: 1120px) {
  html body .site-header-inner {
    min-height: 60px !important;
    grid-template-columns: minmax(150px, 190px) minmax(220px, 1fr) auto !important;
  }

  html body .utility-navigation {
    display: none !important;
  }
}

@media (max-width: 860px) {
  html body .site-header {
    min-height: 60px !important;
  }

  html body .site-header-inner {
    min-height: 60px !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
  }

  html body .site-search,
  html body .utility-navigation {
    display: none !important;
  }

  html body .site-footer-inner {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 719px) {
  html {
    scroll-padding-top: 4rem;
  }

  html body .site-header {
    min-height: 56px !important;
  }

  html body .site-header-inner,
  html body .site-main,
  html body .site-footer-inner {
    width: min(calc(100% - 1.5rem), 1240px) !important;
  }

  html body .site-header-inner {
    min-height: 56px !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    gap: 0.5rem !important;
  }

  html body .site-brand img {
    width: min(150px, 52vw) !important;
  }

  html body .mobile-navigation-panel {
    top: calc(100% + 0.45rem) !important;
    right: -0.125rem !important;
    width: calc(100vw - 1.25rem) !important;
    padding: 0.8rem !important;
  }

  html body .mobile-navigation-links,
  html body .mobile-navigation-utilities {
    grid-template-columns: 1fr 1fr !important;
  }

  html body :where(h1, .editorial-page-title h1, .guide-index-title h1, .guide-article-masthead h1, .stablecoin-dossier-title-row h1, .stablecoin-register-header h1) {
    max-width: none !important;
    font-size: clamp(1.875rem, 9vw, 2.25rem) !important;
    line-height: 1.12 !important;
    letter-spacing: -0.02em !important;
  }

  html body .home-registry .home-entry {
    grid-template-columns: 1fr !important;
    gap: 1.25rem !important;
    padding-block: 1.25rem !important;
  }

  html body .home-registry .home-entry .home-entry__copy h1 {
    max-width: none !important;
    font-size: clamp(2rem, 9vw, 2.25rem) !important;
    line-height: 1.1 !important;
  }

  html body .home-registry .home-registry-totals {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: hidden !important;
    scroll-snap-type: none !important;
  }

  html body .home-registry .home-registry-totals a {
    box-sizing: border-box !important;
    flex: none !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    min-height: 72px !important;
    scroll-snap-align: none !important;
  }

  html body .stablecoin-dossier-nav,
  html body .guide-index-nav {
    box-sizing: border-box !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    gap: 0.45rem !important;
    overflow: visible !important;
    scroll-snap-type: none !important;
  }

  html body .stablecoin-dossier-nav > a,
  html body .guide-index-nav > a {
    box-sizing: border-box !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    justify-content: center !important;
    text-align: center !important;
    white-space: normal !important;
    scroll-snap-align: none !important;
  }

  html body .site-footer-summary {
    display: none !important;
  }

  html body .site-footer-navigation {
    grid-template-columns: 1fr !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: hidden !important;
  }
}

@media (max-width: 420px) {
  html body .mobile-navigation-links,
  html body .mobile-navigation-utilities {
    grid-template-columns: 1fr !important;
  }
}