/* Search events: inline decision actions, selection, bulk bar, keyboard row. */
.search-select { margin: 0 0 .25rem; }
.search-table .select-col, .search-table .select-cell { width: 2.75rem; padding-left: .2rem; padding-right: .2rem; }
.select-hit {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 2.75rem; min-height: 2.75rem; margin: -.4rem 0; cursor: pointer; border-radius: var(--radius-sm);
}
.select-hit:hover { background: var(--surface-2); }
.select-hit input { width: 1.2rem; height: 1.2rem; accent-color: var(--accent); margin: 0; }

.search-row { outline: none; }
.search-row.is-selected { background: var(--accent-soft); }
.search-row.is-current { box-shadow: inset 4px 0 0 var(--accent); }
.search-row.is-current td { background: color-mix(in srgb, var(--accent-soft) 45%, transparent); }
.search-row:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
.search-row[aria-busy="true"] { opacity: .75; }

.decision-cell { min-width: 12rem; }
.decision-cell .badges { margin: 0 0 .25rem; }
.decision-reason { margin-bottom: .35rem; overflow-wrap: anywhere; }
.badge-past { background: var(--surface-2); color: var(--muted); border-color: var(--border); }
.row-actions { display: flex; flex-wrap: wrap; gap: .35rem; align-items: flex-start; }
.row-actions .btn { white-space: nowrap; }
.row-more { position: relative; }
.row-more > summary { list-style: none; }
.row-more > summary::-webkit-details-marker { display: none; }
.row-more[open] > summary { margin-bottom: 0; background: var(--surface-2); }
.row-more-menu {
  display: flex; flex-direction: column; gap: .35rem; margin-top: .35rem; padding: .4rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow);
  min-width: 12rem; max-width: 18rem;
}
.row-error { margin: .35rem 0 0; }

.search-bulk-bar { top: 6.5rem; }
.search-bulk-bar[aria-busy="true"] { cursor: progress; }
.bulk-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.bulk-error { flex-basis: 100%; margin: 0; }

/* Touch: every action is at least 44 × 44 px; phones stack rows (components.css) so actions wrap, never scroll sideways. */
@media (max-width: 700px), (pointer: coarse) {
  .row-actions .btn, .row-more > summary, .row-more-menu .btn, .search-bulk-bar .btn, .search-select .btn { min-height: 2.75rem; min-width: 2.75rem; }
}
@media (max-width: 700px) {
  /* Checkbox in the card's top-right corner instead of a row of its own. */
  .search-table tr { position: relative; }
  .table-wrap .search-table td.select-cell { position: absolute; top: .2rem; right: .2rem; left: auto; width: auto; padding: 0; }
  .search-table .select-cell .select-hit { margin: 0; }
  .table-wrap .search-table td[data-label="When"] { padding-right: 3.25rem; }
  .decision-cell { min-width: 0; }
  .row-actions .btn { flex: 1 1 auto; }
  .row-more { flex: 1 1 100%; }
  .row-more > summary { width: 100%; }
  .row-more-menu { max-width: none; }
  .row-more-menu .btn { white-space: normal; }
  .search-bulk-bar { top: 7.5rem; }
  .bulk-actions { width: 100%; }
  .bulk-actions .btn { flex: 1 1 calc(50% - .4rem); }
}
