/* Shared phone/tablet ergonomics. Desktop presentation remains unchanged. */
@media (max-width:999px) {
  body { padding-top:64px; }
  .tsinglan-navbar { min-height:64px; padding-top:.4rem; padding-bottom:.4rem; }
  .tsinglan-navbar .container { padding-inline:18px; }
  .tsinglan-brand { min-height:44px; }
  .tsinglan-toggler { min-width:44px; min-height:44px; }
  .tsinglan-navbar .navbar-collapse { max-height:calc(100svh - 86px); max-height:calc(var(--mobile-viewport,100dvh) - 86px); overflow-y:auto; overscroll-behavior:contain; }
  .tsinglan-nav-link,.tsinglan-dropdown .dropdown-item { min-height:44px; display:flex; align-items:center; }
  .tsinglan-nav-search input { min-height:44px; font-size:16px; }
  .tsinglan-nav-search button { min-height:44px; }
  .scroll-logo,.tsinglan-brand__slot { display:none!important; }
  /* Search remains available in the menu; keep the article itself clear. */
  .wiki-assistant { display:none; }
  .theme-switcher { position:static; display:flex; flex-wrap:wrap; align-items:center; gap:12px; margin:12px 0 4px; pointer-events:auto; }
  .mobile-theme-slot { border-top:1px solid rgba(245,235,196,.2); margin-top:10px; }
  .mobile-theme-label { color:#f5ebc4; font-size:15px; margin-right:auto; }
  .theme-switcher .theme-palette { position:static; order:3; flex-basis:100%; width:100%; flex-direction:row; justify-content:space-between; transform:none; margin:0; padding:6px; }
  .theme-switcher .theme-swatch { width:44px; height:44px; }
  .theme-toggle,.back-to-top { width:44px; height:44px; min-width:44px; min-height:44px; }
  .theme-toggle__icon { width:30px; height:34px; }
  .back-to-top { right:14px; bottom:calc(14px + env(safe-area-inset-bottom,0px)); }
  .wiki-toc-fab { left:14px; bottom:calc(14px + env(safe-area-inset-bottom,0px)); min-height:44px; }
  .wiki-toc__close,.wiki-toc__collapse { min-width:44px; min-height:44px; }
  .wiki-toc__nav a { min-height:40px; }
  body.mobile-menu-open :is(.back-to-top,.wiki-toc-fab),
  body.modal-open :is(.theme-switcher,.back-to-top,.wiki-toc-fab) { visibility:hidden; pointer-events:none; }
  .page-article { min-width:0; overflow-wrap:anywhere; }
  .page-article img { max-width:100%; height:auto; }
  .page-article pre { max-width:100%; overflow-x:auto; }
  .page-article .science-grid { grid-template-columns:minmax(0,1fr); gap:1rem; }
  .page-article .science-card { padding:1.2rem; }
  .page-article .science-story h2 { font-size:clamp(1.7rem,5.8vw,2.5rem); }
  .page-article .science-story h3 { font-size:1.3rem; overflow-wrap:break-word; }
  .site-footer { position:relative; z-index:30; padding:3rem 0 calc(6rem + env(safe-area-inset-bottom,0px)); background:#0d2544; color:#f5ebc4; }
  .site-footer :is(h4,p,li,a,small) { color:#f5ebc4; }
  .site-footer p { line-height:1.7; }
  .site-footer li a { display:inline-flex; align-items:center; min-height:44px; }
  .site-footer .license-block { overflow-wrap:anywhere; line-height:1.75; }
  .site-footer hr { border-color:rgba(245,235,196,.25); }
  .site-footer .scroll-animate { opacity:1; transform:none; }
  .page-members .member-modal__header { grid-template-columns:62px minmax(0,1fr) 44px; }
  .page-members .member-modal__header .member-modal__close { box-sizing:border-box; width:44px; height:44px; min-width:44px; min-height:44px; margin:0; padding:12px; background-size:16px; }
  .page-members .member-modal__footer .btn,.page-members .member-modal__nav { min-height:44px; }
  .student-loader__label { top:calc(1.5rem + env(safe-area-inset-top,0px)); }
  .student-loader__controls { bottom:calc(1.25rem + env(safe-area-inset-bottom,0px)); }
  .colour-library__dialog button { width:44px; height:44px; min-width:44px; }
}
.mobile-theme-label { display:none; }
@media (max-width:999px) { .mobile-theme-label { display:inline; } }
@media (max-width:575px) {
  .site-main .container { padding-inline:18px; }
  .hero__title { font-size:clamp(2.1rem,9vw,3.2rem); }
  .hero__lead { font-size:1rem; }
}
