/* Keep grids and tables inside small viewports instead of widening the page. */
.main, #main, .section, .sub, .panel, .panel-b, .lane, .hero-side,
.grid > *, [class*="split-"] > * { min-width: 0; }
.panel-b, .tile-sub, .note, .foot, .join-name { overflow-wrap: anywhere; }
.tbl-wrap { max-width: 100%; overflow-x: auto; }
.provenance { margin-bottom: 18px; font-size: 12px; }
.note.demo { border: 2px solid #e2ac2b; color: #ffce76; }
#auth-button { margin-bottom: 10px; }
#auth-form input { width: 100%; margin-top: 10px; }
#auth-error { color: #ff7373; }
@media (max-width: 700px) {
  .shell, .main { width: 100%; max-width: 100%; }
  .hud { flex-wrap: wrap; gap: 12px; height: auto; min-width: 0; }
  .hud .grow { display: none; }
  .nav { max-width: 100%; flex-wrap: wrap; }
  .hero { display: flex; flex-direction: column; }
  .hero-side { width: 100%; }
  .hero-num { font-size: clamp(36px, 12vw, 72px); }
  .region-grid, .grid.g2, .grid.g3, .grid.g4, .split-2-1, .split-1-2,
  .split-3-2, .split-2-3 { grid-template-columns: minmax(0, 1fr); }
  .grid.tiles { grid-template-columns: repeat(auto-fit, minmax(min(145px, 100%), 1fr)); }
  .lane-head, .panel-h, .row, .btns { flex-wrap: wrap; }
  .lane-title { overflow-wrap: anywhere; }
  .modal { max-width: calc(100vw - 24px); }
  .code, pre { max-width: 100%; overflow-x: auto; }
  canvas, .viz, img { max-width: 100%; }
}
@media (max-width: 1000px) {
  .side { flex-direction: column; align-items: stretch; min-width: 0; }
  .brand { padding: 0 0 8px; }
  .nav { flex-direction: row; flex-wrap: nowrap; width: 100%; min-width: 0; overflow-x: auto; padding-bottom: 6px; }
  .nav a { flex: 0 0 auto; }
  .side-foot { display: flex; gap: 14px; align-items: center; padding-top: 8px; }
  .side-foot .tiny { display: none; }
  #auth-button { margin: 0; }
}
@media (max-width: 700px) {
  table.tbl { display: block; max-width: 100%; overflow-x: auto; }
  .filters { flex-wrap: wrap; min-width: 0; }
  input, select { max-width: 100%; min-width: 0; }
}
@media (max-width: 700px) {
  .panel-t, .panel-t small { min-width: 0; max-width: 100%; overflow-wrap: anywhere; white-space: normal; }
  .cards.md, .cards.lg, .cards.sm, .cards.xs, .roles, .ach { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 700px) {
  .lane-sub { min-width: 0; max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
}
