/* Small screens and reduced motion (loaded last) */
@media (max-width: 1100px) {
  .env-chip { display: none; }
  .hero, .setup-grid, .train-grid { grid-template-columns: 1fr; }
  .hero { grid-template-areas: "text" "doors" "env" "stage"; }
  .player-body { grid-template-columns: 1fr; }
  .inspector { border-left: 0; border-top: 1px solid var(--graphite-3); max-height: 360px; }
  .net-stage { height: 480px; }
}
/* tablets: the top bar gets a second row for the app links */
@media (max-width: 960px) {
  .topbar { height: auto; flex-wrap: wrap; padding: 8px 20px; row-gap: 6px; }
  .nav-info { margin-right: 0; }
  .top-right { flex-basis: 100%; justify-content: space-between; gap: 12px;
    border-top: 1px solid var(--line-2); padding-top: 6px; }
}
/* phones */
@media (max-width: 720px) {
  main { padding: 16px 14px 72px; }
  .topbar { position: static; padding: 8px 14px; }
  .brand span { display: none; }
  .nav-info { margin-left: 12px; gap: 14px; }
  .nav-info #lang-slot { margin-right: 0; padding-right: 12px; }
  .nav-app { gap: 12px; }
  .nav-links a { font-size: 13px; padding: 8px 0; }
  .theme-switch button { padding: 4px 8px; font-size: 12px; }
  .doors { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .kpi { border-left: 0; border-top: 1px solid var(--line-2); }
  .dash-stats { grid-template-columns: 1fr 1fr; }
  .run-head { grid-template-columns: 1fr; }
  .transport { grid-template-columns: 1fr; }
  .form-grid, .sol-grid { grid-template-columns: 1fr; }
  .net-stage { height: 360px; }
  /* solve bar: the summary on its own line, the switch and the button below */
  .runbar { padding: 12px 14px; bottom: 10px; }
  .runbar .summary { flex-basis: 100%; }
  .runbar .opts { flex: 1; justify-content: space-between; }
  /* benchmarks: two small cards per row, tables scroll sideways and drop the less needed columns */
  .fam-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .fam-card { padding: 11px 12px; gap: 4px; }
  .fam-card h3 { font-size: 14px; }
  .fam-count, .fam-meta { font-size: 11.5px; }
  table.grid { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; font-size: 13px; }
  table.grid th, table.grid td { padding: 9px 10px; white-space: nowrap; }
  table.grid .opt { display: none; }
  .panel-head { flex-wrap: wrap; padding: 14px 16px; }
  .site-foot { padding: 18px 14px 26px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
