@media (max-width: 600px) {
  html, body { max-width: 100%; overflow-x: hidden; }
  *, *::before, *::after { box-sizing: border-box; }

  button, [role="button"] { min-height: 40px !important; }
  input, select, [role="combobox"] { min-height: 40px !important; }
  .search { min-height: 40px; }
  .search input { min-height: 40px !important; }

  .ranking-section, .provider-picker, .toolbar, .controls,
  #provider-dashboard, #openrouter-dashboard,
  .pd-section, .or-section, .pd-grid, .pd-card { min-width: 0; max-width: 100%; }

  .tabs, .controls {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  .tabs {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs button { flex: 0 0 auto; white-space: nowrap; }

  .controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
  }
  .controls .search {
    flex: 1 1 180px;
    min-width: 0 !important;
    max-width: 100%;
  }
  .controls .search input { width: 100%; min-width: 0; }

  .pd-card strong, .pd-card small,
  .or-bar-label strong, .or-bar-label small {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .or-source-badge, .or-derived-warning,
  .pd-section-head p, .or-section-head p {
    overflow-wrap: anywhere;
  }

  .table-wrap {
    max-width: 100%;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
  }

  .compare-bar {
    bottom: max(12px, env(safe-area-inset-bottom));
    max-width: calc(100vw - 24px);
  }
}
