/* Recent tickets (GitHub issue 601, the owner's U7; docs/adr/0356-recent-tickets.md; public/js/app/
   ticket-recent.js). "Recent tickets ▾" sits in the ticket page's header row after the pager, as quiet as Shortcuts
   beside it. Its list opens under it, its right edge on the button's, toward the page: the button is at the right end
   of the row, and the ticket's panel clips what leaves it (ticket-record.css). Where the window or that panel leaves
   less room, the page's script narrows or shortens it (ticket-recent.js rtFit). Each ticket's number, its title (two
   lines at most, with a fade: components.css .title-cap), then its state and when it was opened, all wrapping, nothing
   cut. The one open now is marked and isn't a button. Search's "Recent" heading is the Actions heading's look. Colors
   are the palette's tokens, so the dark theme follows. On a phone the list is the row's full width and every row is a
   44 px target; the keys' line is left out, as there is no keyboard. */

.rt { position:relative; display:inline-flex; }
.rt-button { display:inline-flex; align-items:center; gap:var(--space-50); padding:var(--space-50) var(--space-75); border:0; border-radius:var(--radius-md); background:none; color:var(--muted); font-size:var(--text-sm); cursor:pointer; }
.rt-button:hover, .rt-button[aria-expanded="true"] { background:var(--hover-bg); color:var(--ink); }
.rt-caret { font-size:var(--text-xs); }

.rt-panel[hidden] { display:none; }
/* While the list is open, the header band it opens from (a layer of its own: ticket-record.css) is a menu's layer, so
   the side panel's pinned tabs and the grip that widens the panel are under the list, not drawn over its rows. */
.tp.rw .rw-band:has(.rt-panel:not([hidden])) { z-index:var(--z-menu); }
.rt-panel {
  position:absolute; top:calc(100% + var(--space-75)); right:0; left:auto; z-index:calc(var(--z-page, 15) + 30);
  width:26rem; max-width:calc(100vw - 2rem); max-height:min(32rem, calc(100vh - 10rem)); overflow-y:auto; overscroll-behavior:contain;
  padding:var(--space-75) 0; border:1px solid var(--line-strong, var(--line)); border-radius:var(--radius-xl); background:var(--surface); box-shadow:var(--shadow-pop);
}
.rt-head { margin:var(--space-50) var(--space-200) var(--space-75); color:var(--muted); font-size:var(--text-xs); font-weight:var(--weight-semibold); text-transform:uppercase; }
.rt-list { margin:0; padding:0; list-style:none; }
.rt-recent-row { display:grid; grid-template-columns:auto minmax(0, 1fr); align-items:baseline; gap:var(--space-25) var(--space-100); width:100%; padding:var(--space-100) var(--space-200); border:0; background:transparent; color:var(--ink); font:inherit; font-size:var(--text-md); text-align:left; white-space:normal; overflow-wrap:anywhere; }
button.rt-recent-row { cursor:pointer; }
button.rt-recent-row:hover, button.rt-recent-row:focus-visible { background:var(--hover-bg); outline:none; box-shadow:inset 3px 0 0 var(--spruce); }
.rt-recent-row.is-current { background:var(--hover-bg-subtle, var(--surface-2)); box-shadow:inset 3px 0 0 var(--line-strong, var(--line)); }
.rt-number { color:var(--muted); font-size:var(--text-sm); font-weight:var(--weight-semibold); font-variant-numeric:tabular-nums; white-space:nowrap; }
.rt-title { min-width:0; font-weight:var(--weight-medium, 500); }
.rt-meta { grid-column:2; color:var(--muted); font-size:var(--text-sm); }
.rt-empty { padding:var(--space-100) var(--space-200); color:var(--muted); font-size:var(--text-sm); }
.rt-keys { margin:var(--space-75) 0 0; padding:var(--space-100) var(--space-200) var(--space-50); border-top:1px solid var(--line); color:var(--muted); font-size:var(--text-xs); }
.rt-keys kbd { padding:0 var(--space-50); border:1px solid var(--line-strong, var(--line)); border-radius:var(--radius-sm, 4px); font-size:var(--text-xs); }

/* Search: "Recent" first when nothing is typed. */
.rt-search-heading { margin:var(--space-100) var(--space-150) var(--space-50); color:var(--muted); font-size:var(--text-xs); font-weight:var(--weight-semibold); text-transform:uppercase; }

@media (forced-colors:active) { button.rt-recent-row:focus-visible { outline:2px solid CanvasText; } }

/* A phone: the list is as wide as the row it opens from, every row a 44 px target, and no keys to tell of. */
@media (max-width:767px) {
  .rt { position:static; }
  .rt-panel { left:0; right:0; width:auto; max-width:none; }
  .rt-keys { display:none; }
  .rt-button, .rt-recent-row { min-height:44px; }
}
