/* A record's history as blocks (GitHub issue 595; docs/adr/0350-the-history-in-blocks.md): a ticket's Audit
   view, a change's Audit tab, a problem's History and an item's History. Colors are the palette's tokens, so the dark
   theme follows; long words and hashes wrap, so a phone never scrolls sideways. Its paragraphs are named under .at-trail, so
   a panel's own rule for paragraphs (.detail-action-panel p, on a ticket) doesn't change them. */
.at-trail .audit-integrity { font-size:var(--text-md); }
.at-trail { display:grid; gap:var(--space-150); min-width:0; }
.at-head { display:flex; flex-wrap:wrap; align-items:flex-end; justify-content:space-between; gap:var(--space-150) var(--space-250); }
.at-head > div { min-width:0; }
.at-title { margin:0; color:var(--ink); font-size:var(--text-lg); }
.at-trail .at-sub { max-width:640px; margin:var(--space-50) 0 0; color:var(--muted); font-size:var(--text-md); line-height:1.5; overflow-wrap:anywhere; }
.at-tools { display:flex; flex-wrap:wrap; align-items:center; gap:var(--space-100); }
.at-search input { width:220px; max-width:100%; min-height:36px; padding:var(--space-75) var(--space-150); border:1px solid var(--line); border-radius:var(--radius-lg); background:var(--surface); color:var(--ink); font:inherit; font-size:var(--text-md); }
.at-tools .outline-button[aria-pressed="true"] { border-color:var(--ink-2); background:var(--surface-2); color:var(--ink); }
.at-filters { display:flex; flex-wrap:wrap; justify-self:start; max-width:100%; }
.at-trail .at-sample { margin:0; padding:var(--space-100) var(--space-150); border-radius:var(--radius-lg); background:var(--surface-2); color:var(--ink-2); font-size:var(--text-md); }
.at-results { display:grid; gap:var(--space-200); min-width:0; }
.at-day { display:grid; gap:var(--space-75); min-width:0; }
.at-day-head { position:sticky; top:0; z-index:1; margin:0; padding:var(--space-75) 0; border-bottom:1px solid var(--line); background:var(--surface); color:var(--ink); font-size:var(--text-md); font-weight:var(--weight-semibold); }
.at-blocks { display:grid; gap:0; margin:0; padding:0; list-style:none; }
.at-block { display:grid; gap:var(--space-50); min-width:0; padding:var(--space-100) 0; border-bottom:1px solid var(--line); }
.at-block:last-child { border-bottom:0; }
.at-block.is-unverified { padding:var(--space-100) var(--space-150); border-radius:var(--radius-lg); background:var(--bad-soft); }
.at-trail .at-block-head { margin:0; color:var(--ink-2); font-size:var(--text-md); line-height:1.45; overflow-wrap:anywhere; }
.at-block-head time { display:inline-block; min-width:92px; margin-right:var(--space-100); color:var(--muted); font-size:var(--text-sm); font-variant-numeric:tabular-nums; }
.at-who { color:var(--ink); font-weight:var(--weight-semibold); }
.at-how { margin-left:var(--space-50); padding:1px var(--space-100); border-radius:var(--radius-pill); background:var(--surface-2); color:var(--ink-2); font-size:var(--text-xs); font-weight:var(--weight-semibold); white-space:nowrap; }
.at-block.is-line .at-line-text { color:var(--ink-2); }
.at-lines { display:grid; gap:var(--space-25); margin:0 0 0 calc(92px + var(--space-100)); padding:0; list-style:none; }
.at-lines li { min-width:0; color:var(--ink); font-size:var(--text-md); line-height:1.45; overflow-wrap:anywhere; }
.at-lines li.at-kind-messages, .at-lines li.at-kind-approvals { color:var(--ink-2); }
.at-more { margin:0 0 0 calc(92px + var(--space-100)); color:var(--muted); font-size:var(--text-sm); }
.at-more summary { cursor:pointer; color:var(--ink-2); }
.at-more ul { display:grid; gap:var(--space-25); margin:var(--space-50) 0 0; padding:0 0 0 var(--space-200); }
.at-more li { overflow-wrap:anywhere; }
.at-trail .at-bad { margin:0 0 0 calc(92px + var(--space-100)); color:var(--bad); font-size:var(--text-sm); font-weight:var(--weight-semibold); }
.at-trail .at-proof { margin:0 0 0 calc(92px + var(--space-100)); color:var(--muted); font-size:var(--text-xs); line-height:1.5; overflow-wrap:anywhere; font-variant-numeric:tabular-nums; }
.at-hash { font-family:ui-monospace, SFMono-Regular, Consolas, monospace; overflow-wrap:anywhere; word-break:break-all; }
@media (max-width:640px) {
  .at-tools { width:100%; }
  .at-search { flex:1 1 100%; }
  .at-search input { width:100%; }
  .at-lines, .at-more, .at-trail .at-bad, .at-trail .at-proof { margin-left:0; }
  .at-block-head time { display:block; min-width:0; margin:0 0 var(--space-25); }
}
/* The two places that hold a trail (a ticket's #auditLog, a change's #changeAuditLog) had a light rule of their own above
   the old list; the trail has its own heading, so the rule is the palette's line, which follows the dark theme. */
.audit-log:has(> .at-trail) { border-top-color:var(--line); }

/* Searching a ticket's audit log (ticket-audit-search.js; docs/adr/0423-ticket-audit-log-search.md): one box above the
   trail and Notifications sent, in the settings search's look, the kinds as the trail's own buttons, Filters for who and
   the days, and the line that says how many match. A match is marked in bold with a line under it as well as the
   color, so it never rests on color alone. On a phone every control is 44 px. */
.ta-bar { display:grid; gap:var(--space-100); min-width:0; padding-bottom:var(--space-150); border-bottom:1px solid var(--line); }
.ta-row { display:flex; align-items:center; gap:var(--space-100); min-width:0; }
.ta-search { display:flex; flex:1 1 auto; align-items:center; gap:var(--space-100); min-width:0; padding:0 var(--space-75) 0 var(--space-150); border:1px solid var(--line); border-radius:var(--radius-md); background:var(--surface); color:var(--muted); }
.ta-search:focus-within { border-color:var(--spruce); box-shadow:0 0 0 3px var(--spruce-pale); }
.ta-search-icon { flex:none; font-size:var(--text-md); line-height:1; }
.ta-bar .ta-search input[type="search"] { flex:1; min-width:0; min-height:var(--control-height, 38px); margin:0; padding:0; border:0; border-radius:0; background:transparent; box-shadow:none; color:var(--ink); font:inherit; font-size:var(--text-md); outline:none; }
.ta-search input::placeholder { color:var(--muted); opacity:1; }
.ta-key { flex:none; min-width:1.5em; padding:0 var(--space-50); border:1px solid var(--line); border-radius:var(--radius-sm); background:var(--surface-2, var(--paper)); color:var(--muted); font:inherit; font-size:var(--text-2xs); line-height:1.6; text-align:center; }
.ta-search:focus-within .ta-key { display:none; }
.ta-more-toggle { flex:none; min-height:var(--control-height, 38px); }
.ta-more-toggle[aria-expanded="true"] { border-color:var(--ink-2); background:var(--surface-2); color:var(--ink); }
.ta-kinds { justify-self:start; }
.ta-more { display:flex; flex-wrap:wrap; align-items:flex-end; gap:var(--space-100) var(--space-150); min-width:0; }
.ta-more[hidden] { display:none; }
.ta-field { display:grid; gap:var(--space-25); min-width:0; color:var(--ink-2); font-size:var(--text-sm); font-weight:var(--weight-semibold); }
.ta-field input[type="date"], .ta-field select { min-height:var(--control-height, 38px); padding:0 var(--space-100); border:1px solid var(--line); border-radius:var(--radius-md); background:var(--surface); color:var(--ink); font:inherit; font-size:var(--text-md); font-weight:400; }
.ta-status { display:flex; flex-wrap:wrap; align-items:center; gap:var(--space-50) var(--space-150); min-width:0; }
.ta-bar .ta-summary { margin:0; color:var(--ink); font-size:var(--text-md); font-weight:var(--weight-semibold); }
.ta-bar .ta-summary:empty { display:none; }
.ta-clear[hidden], .ta-all[hidden] { display:none; }
mark.ta-hit { padding:0 1px; border-radius:var(--radius-xs, 2px); background:var(--saffron-pale); color:inherit; font-weight:var(--weight-semibold, 600); text-decoration:underline; text-decoration-thickness:2px; text-underline-offset:2px; }
.ta-notes-note { display:flex; flex-wrap:wrap; align-items:center; gap:var(--space-50) var(--space-100); margin:var(--space-100) 0; }
.nopt-sent[hidden] { display:none; }
@media (max-width:700px) {
  .ta-bar .ta-search input[type="search"], .ta-more-toggle, .ta-kinds button, .ta-field input[type="date"], .ta-field select, .ta-field .custom-select-trigger { min-height:44px; }
  .ta-clear, .ta-all { display:inline-flex; align-items:center; min-height:44px; }
  .ta-more { display:grid; grid-template-columns:minmax(0, 1fr) minmax(0, 1fr); }
  .ta-more .ta-field:first-child { grid-column:1 / -1; }
  .ta-bar .ta-key { display:none; }
}
@media (hover:none) and (pointer:coarse) { .ta-bar .ta-key { display:none; } }
