/* ah/history.css — AH browser responsive rules + accessible row buttons.
   (2026-07-01 P4 sweep: the old in-container item-view styles that used to live here —
   market table, linked-realm chips, selected-market callouts — served the retired
   pre-embed detail panel and were removed with the embed. Load AFTER ah/base.css.) */

@media (max-width: 768px) {
  .ah-toolbar {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2);
    padding: var(--space-2);
  }

  .ah-realm-wrap {
    grid-column: 1 / -1;
  }

  .ah-searchbox,
  .ah-sort-select,
  .ah-filter-button,
  .ah-search-button {
    grid-column: 1 / -1;
  }

  .ah-sidebar-toggle {
    display: inline-flex;
    align-items: center;
  }

  .ah-sidebar.is-collapsed .ah-category-tree,
  .ah-sidebar.is-collapsed .wgf-ad-slot--sidebar {
    display: none;
  }

  .ah-sidebar.is-collapsed {
    max-height: none;
  }

  .ah-category-tree {
    height: 220px;
    overflow-y: auto;
    scrollbar-width: thin;
  }

  .ah-statusbar {
    padding: var(--space-1) var(--space-2);
    font-size: 11px;
  }

  .ah-empty {
    padding: var(--space-4) var(--space-2) !important;
    font-size: 16px;
  }
}

@media (max-width: 375px) {
  .ah-toolbar {
    grid-template-columns: 1fr;
  }

  .ah-table {
    min-width: 560px;
    font-size: 13px;
  }
}

/* === WGF accessible item rows (audit 2026-06-07) ===
   The item name is a focusable <button> that opens the item page
   (works by keyboard). === */
.ah-item-open {
  -webkit-appearance: none;
  appearance: none;
  background: none;
  border: 0;
  margin: 0;
  padding: 0;
  font: inherit;
  font-weight: 800;
  line-height: inherit;
  text-align: left;
  cursor: pointer;
  min-width: 0;
  flex: 0 1 auto;
}

.ah-item-open:hover {
  text-decoration: underline;
}

/* ── Phone recut (owner 2026-07-07): the stacked toolbar buried the auctions ~2.5
   screens down and felt nothing like the in-game AH. Chrome compacts to 3 rows
   (realm / search+Search / sort+tools) and the category tree starts as a closed
   drawer (ah-game-ui.js adds is-collapsed on phones), so price rows land on
   screen one. Lives here, after the 768px block, so it wins the cascade. */
@media (max-width: 700px) {
  .ah-toolbar {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .ah-realm-wrap {
    grid-column: 1 / -1;
  }

  .ah-searchbox {
    grid-column: 1 / 3;
  }

  .ah-search-button {
    grid-column: 3 / -1;
  }

  .ah-sort-select,
  .ah-filter-button {
    grid-column: auto;
  }

  /* Disabled "soon" affordance doesn't earn prime phone space */
  #ahTrackedButton {
    display: none;
  }
}
