/* Shared small-screen adaptations. Desktop styles remain in their original files. */
@media (max-width: 900px) {
  :root { --nav-height: var(--mobile-header-height, 80px); scroll-padding-top: calc(var(--nav-height) + var(--mobile-subnav-height, 0px) + 12px); }
  main :is(section,article,div)[id] { scroll-margin-top: 8px !important; }
  :is(.about-grid,.pc-split,.pc-three,.pc-two,.pf-three,.pf-two,.sp-flow,.os-contributions,.os-repo-list article,.legal-layout,.license-layout,.news-story,.footer-top)>* { min-width: 0; }
  main :is(p,h1,h2,h3,h4,li,dd,a), .contact-email { overflow-wrap: anywhere; }
  main img { max-width: 100%; }
  :is(.pc-terminal,.pf-start,.sp-install,.pf-table-wrap,.comparison-wrap) { min-width: 0; max-width: 100%; }
  :is(pre,.pf-table-wrap,.comparison-wrap,.pc-subnav .container,.pf-nav .container) { overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
  :is(.pc-subnav,.pf-nav) a { min-height: 44px; display: inline-flex; align-items: center; }
  .pc-subnav .container,.pf-nav .container { scrollbar-width: thin; }
  .products-dropdown { max-width: calc(100vw - 48px); }
  .footer-meta>div { flex-wrap: wrap; }
  .footer-top a,.footer-meta a,.footer-meta button { min-height: 44px; display: inline-flex; align-items: center; }
  .footer-top nav { gap: 6px; }
  dialog { max-height: calc(100dvh - 32px); overflow-y: auto; }
  .dialog-heading { align-items: flex-start; }
  .dialog-heading button { min-width: 44px; min-height: 44px; flex-shrink: 0; }
  .license-index a,.legal-layout>nav a { min-height: 44px; display: flex; align-items: center; }
}
@media (max-width: 700px) {
  .footer-top { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
  .footer-top section { grid-column: 1 / -1; }
  .pc-laptop { width: 100%; max-width: 100%; margin-inline: auto; }
  .pf-three { grid-template-columns: 1fr; }
  .pc-hero h1 { font-size: clamp(2.125rem, 8.2vw, 3.6875rem); }
  .pf-hero h1 { font-size: clamp(2.5rem, 9.5vw, 3.625rem); }
}
@media (max-width: 600px) {
  :root { --nav-height: var(--mobile-header-height, 109px); }
  .nav { height: auto; min-height: 106px; display: grid; grid-template-columns: minmax(0,1fr) auto; grid-template-rows: auto auto; }
  .nav .brand { grid-column: 1; grid-row: 1; }
  .brand-image { width: 62px; height: 62px; }
  .nav .github-nav { grid-column: 2; grid-row: 1; display: inline-flex; min-height: 44px; align-items: center; font-size: 14px; gap: 10px; }
  .nav .nav-links { grid-column: 1 / -1; grid-row: 2; display: flex; justify-content: space-between; align-items: center; gap: 8px; min-width: 0; font-size: 14px; }
  .nav .nav-links>a { display: inline-flex; min-height: 44px; align-items: center; white-space: nowrap; }
  .products-menu summary { min-height: 44px; gap: 8px; padding: 10px 0; }
  .products-dropdown { left: 0; right: auto; width: min(320px, calc(100vw - 48px)); max-height: calc(100dvh - var(--nav-height) - 16px); top: 100%; }
  .nav-links .products-dropdown a { min-height: 44px; }
  .product-tabs { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .product-tab { min-height: 48px; padding-inline: 5px; }
  .tab-line { font-size: 16px; }
  .playback-button { width: 44px; height: 44px; }
  .sp-hero h1 { font-size: clamp(2.5rem, 10vw, 4rem); }
  .os-hero h1,.about-hero h1 { font-size: clamp(2.125rem, 9vw, 2.875rem); }
  .contact-hero h1 { font-size: clamp(2.5rem, 10vw, 3.625rem); }
  .legal-title h1 { font-size: clamp(2.125rem, 9vw, 2.875rem); }
  .pc-lead,.pf-lead,.sp-intro { font-size: 18px; }
  .button { max-width: 100%; min-height: 44px; justify-content: center; }
  .pf-edit-heading { gap: 16px; }
  .pf-edit-heading>kbd { flex-shrink: 0; font-size: 38px; padding: 8px 16px; }
  .pf-edit-heading h2 { font-size: clamp(1.75rem, 7vw, 2.125rem); }
  .pf-shell { padding: 18px 14px; gap: 14px; }
  .pf-shell>div { min-width: 0; }
  .pf-shell>kbd { flex-shrink: 0; }
  .pc-requirements>div { grid-template-columns: 75px minmax(0,1fr); gap: 10px; }
  .license-layout { display: block; }
  .license-paper .license-index { position: static; max-height: none; display: flex; flex-wrap: wrap; gap: 0 18px; padding-bottom: 28px; }
  .license-index .eyebrow { width: 100%; }
  .footer-meta>div { gap: 5px 18px; }
  .contact-email { max-width: 100%; }
  .support-links { gap: 8px 20px; }
  .support-links a,.os-links a { min-height: 44px; display: inline-flex; align-items: center; }
}
@media (max-width: 420px) {
  .container { width: calc(100% - 32px); }
  .about-facts { grid-template-columns: 1fr; gap: 18px; }
  .about-facts>div { border-left: 0; padding-left: 0; }
  .about-facts span { margin-bottom: 5px; }
  .pc-actions,.pf-actions,.sp-actions,.os-actions { align-items: stretch; }
  .pc-actions .button,.pf-actions .button,.sp-actions .button,.os-actions .button { flex: 1 1 200px; }
  .products-dropdown { width: calc(100vw - 48px); }
}
