/* Shared readability and touch behavior across the three documentation routes. */
[hidden] { display: none !important; }
.chapter-heading > div, .document-information, .page-hero > div:first-child { min-width: 0; }
.chapter-body a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: #b7b7b7; }
.chapter-body a:hover { text-decoration-color: currentColor; }
.chapter-body, .document-information, .chapter-heading h2 { overflow-wrap: break-word; }
.search-dialog { overscroll-behavior: contain; }
.search-dialog input { font-size: 16px; }
.search-footer { flex-wrap: wrap; }
.search-empty, .search-result strong { overflow-wrap: anywhere; }
.sidebar { padding-bottom: max(18px, env(safe-area-inset-bottom)); }
.mobile-contents nav { max-height: min(60vh,480px); overflow: auto; overscroll-behavior: contain; }
@media (max-width: 820px) {
  .sidebar { height: calc(100dvh - var(--header)); }
  .menu-toggle, .search-button { min-width: 44px; min-height: 44px; }
  .chapter-link, .nav-link, .mobile-contents nav > a { min-height: 44px; align-items: center; }
  .copy-section { opacity: 1; width: 44px; height: 44px; margin-top: -8px; margin-right: -9px; }
  .document-meta > button { min-height: 44px; }
  .back-top, .page-footer .text-link, .wallet-copy, .allocation-reset { min-height: 44px; }
  .page-footer { padding-bottom: max(27px, env(safe-area-inset-bottom)); }
  .search-dialog { max-height: calc(100dvh - 100px); }
  .search-results { max-height: min(45dvh,400px); }
  .search-dialog .icon-button { min-width: 44px; min-height: 44px; }
  .chapter-heading .eyebrow { line-height: 1.6; }
}
@media (max-width: 540px) {
  .site-header { padding-left: 16px; padding-right: 12px; gap: 10px; }
  .header-label { font-size: 9px; }
  .brand { font-size: 14px; gap: 6px; }
  .hero-index { max-width: 60px; }
  .document-meta { grid-template-columns: minmax(0,1fr) auto; }
  .document-meta > span { min-width: 0; }
  .document-meta > span > span { line-height: 1.7; }
  .toast { max-width: calc(100vw - 32px); white-space: normal; text-align: center; bottom: max(20px,env(safe-area-inset-bottom)); }
  .search-footer { gap: 10px; font-size: 9px; }
}
@media (max-width: 370px) {
  .site-header { gap: 8px; }
  .document-meta > button { font-size: 9px; }
  .chapter-heading { gap: 10px; }
}
@media (pointer: coarse) {
  .icon-button, .search-button, .text-link, .nav-link, .chapter-link { min-height: 44px; }
  .icon-button { min-width: 44px; }
  .copy-section { opacity: 1; }
}
