/* Existing desktop flex items retain their layout through the presentation wrapper. */
.dashboard-toolbar-content { display: contents; }
.mobile-toolbar-heading, .mobile-overview-toggle { display: none; }

@media screen and (max-width: 700px), screen and (max-width: 1000px) and (max-height: 500px) and (pointer: coarse) {
  .dashboard-topbar { display: block; padding: max(6px, env(safe-area-inset-top)) 0 8px; margin-bottom: 12px; }
  .mobile-toolbar-heading { display: flex; align-items: center; gap: 8px; min-width: 0; }
  #mobile-filter-toggle { flex: 0 0 auto; padding: 8px 10px; font-size: 12px; }
  #mobile-filter-toggle span { display: inline-block; font-size: 16px; margin-left: 3px; }
  #mobile-filter-toggle[aria-expanded="true"] span { transform: rotate(180deg); }
  .mobile-toolbar-summary { flex: 1 1 auto; min-width: 0; display: grid; gap: 4px; line-height: 1.4; }
  .mobile-toolbar-summary span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
  #mobile-filter-summary { color: var(--ink); font-weight: 700; }
  #mobile-version-summary { color: var(--muted); }
  #mobile-refresh { flex: 0 0 auto; min-width: 52px; padding: 8px 10px; font-size: 12px; }
  .dashboard-toolbar-content { display: block; max-height: min(70dvh, calc(100dvh - 90px)); overflow-y: auto; overscroll-behavior-y: contain; padding: 12px 2px 6px; }
  .dashboard-topbar[data-mobile-ready="true"][data-mobile-open="false"] .dashboard-toolbar-content { display: none; }
  .dashboard-filters { display: grid; grid-template-columns: minmax(0, 1fr) 94px; align-items: end; width: 100%; gap: 12px 8px; }
  .dashboard-filters .mod-release-filter { display: grid; grid-template-columns: 70px minmax(0, 1fr); align-items: center; grid-column: 1 / -1; width: 100%; gap: 8px; }
  .dashboard-filters .mod-release-filter select { width: 100%; min-height: 44px; font-size: 16px; }
  .dashboard-filters .version-filter { display: grid; gap: 6px; width: 100%; grid-column: 1; }
  .dashboard-filters .version-filter select { width: 100%; min-width: 0; min-height: 44px; font-size: 16px; }
  #name-build { grid-column: 2; width: 100%; min-height: 44px; padding-inline: 6px; font-size: 12px; }
  .dashboard-filters .activity-range, .dashboard-filters .activity-mode { display: grid; grid-column: 1 / -1; width: 100%; gap: 5px; }
  .dashboard-filters .activity-range { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .dashboard-filters .activity-mode { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dashboard-filters .activity-range button, .dashboard-filters .activity-mode button { min-width: 0; padding: 8px 3px; min-height: 44px; font-size: 12px; }
  .dashboard-toolbar-content .header-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; gap: 8px; margin: 14px 0 0; border-top: 1px solid var(--line); padding-top: 10px; }
  .header-actions #last-updated, .header-actions #storage-usage, .header-actions #cancel-load { grid-column: 1 / -1; width: 100%; }
  .header-actions #storage-usage { white-space: normal; overflow-wrap: anywhere; line-height: 1.6; }
  .mobile-overview-toggle { display: flex; justify-content: space-between; align-items: center; width: 100%; min-height: 44px; font-size: 13px; background: #f4f7ef; }
  .mobile-overview-toggle[aria-expanded="true"] span { transform: rotate(180deg); }
  #activity-panel[data-mobile-ready="true"][data-mobile-open="false"] > .activity-charts { display: none; }
}
