/* agent-history: styles for this screen only (docs/AGENT_VIEWS.md) */
.hi-wrap { display: flex; flex-direction: column; gap: 14px; padding: 18px 8px 24px; min-width: 0; }
.hi-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.hi-title { font-size: 24px; font-weight: 900; margin: 0; flex: 1 1 auto; color: var(--text); }
.hi-searchwrap { flex: 0 1 270px; min-width: 0; width: 100%; max-width: 270px; }
.hi-search { border-radius: var(--pill); min-height: 40px; padding: 6px 16px; font-size: 14px; }
.hi-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.hi-chip, .hi-outcome {
  width: auto; min-height: 40px; padding: 6px 16px; border-radius: var(--pill); font-size: 14px; font-weight: 800;
  background: var(--panel); border: 2px solid var(--border); color: var(--text);
}
.hi-chip.on, .hi-outcome.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-strong); font-weight: 900; }
.hi-outcome { cursor: pointer; }

.hi-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.hi-listcol { min-width: 0; }
.hi-list { padding: 10px 8px; display: flex; flex-direction: column; gap: 2px; max-height: calc(100vh - 250px); min-height: 160px; overflow-y: auto; transition: opacity .15s; }
.hi-list.hi-stale { opacity: .6; }
.hi-row {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 14px; min-height: 56px; text-align: left;
  border: 2px solid transparent; border-radius: var(--radius-md); background: transparent; font-weight: inherit;
}
.hi-row:hover { background: var(--panel-2); border-color: transparent; }
.hi-row.sel, .hi-row.sel:hover { background: var(--accent-soft); border-color: var(--accent); }
.hi-row:focus-visible, .hi-chip:focus-visible, .hi-outcome:focus-visible, .hi-detail button:focus-visible { outline: none; box-shadow: var(--focus); }
.hi-mid { flex: 1 1 auto; min-width: 0; }
.hi-name { font-weight: 800; font-size: 15px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hi-name.mono { font-weight: 500; font-size: 14px; }
.hi-meta { font-size: 12.5px; color: var(--muted); font-weight: 400; }
.hi-ds { display: none; }
.hi-pill { flex: 0 0 auto; font-size: 12.5px; padding: 3px 10px; }
.hi-av {
  flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 13px;
}
.hi-av.hi-coral { background: var(--coral-soft); color: var(--coral-text); }
.hi-av.hi-call { background: var(--call-soft); color: var(--call-text); }
.hi-av.hi-pause { background: var(--pause-soft); color: var(--pause-text); }
.hi-av-big { width: 44px; height: 44px; font-size: 15px; }
.hi-msg { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 28px 12px; color: var(--muted); font-weight: 700; text-align: center; }

.hi-detail { display: flex; flex-direction: column; gap: 12px; padding: 18px 20px; position: sticky; top: 16px; }
.hi-detail.hi-empty { min-height: 120px; align-items: center; justify-content: center; text-align: center; }
.hi-back { display: none; align-self: flex-start; }
.hi-dtop { display: flex; align-items: center; gap: 12px; }
.hi-dtext { min-width: 0; flex: 1 1 auto; }
.hi-dname { font-weight: 900; font-size: 18px; color: var(--text); overflow-wrap: anywhere; }
.hi-dname:focus { outline: none; }
.hi-dsub { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.hi-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.hi-label { font-size: 12.5px; font-weight: 800; color: var(--muted); letter-spacing: .04em; }
.hi-notes { font-size: 14.5px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); }
.hi-notes.sub { color: var(--muted); }
.hi-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.hi-actions button { min-height: 44px; }
.hi-cb { flex: 1 1 auto; font-weight: 900; }
.hi-wa, .hi-cu { border-color: var(--border-strong); }

.hi-rec { display: flex; align-items: center; gap: 10px; background: var(--bg); border-radius: var(--radius-md); padding: 10px 12px; }
.hi-play { flex: 0 0 auto; width: 40px; height: 40px; min-height: 40px; padding: 0; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-text); display: flex; align-items: center; justify-content: center; }
.hi-play:hover { background: var(--accent-strong); border: 0; }
.hi-seek {
  --p: 0%; flex: 1 1 auto; min-width: 0; width: auto; padding: 0; border: 0; height: 24px; background: transparent;
  -webkit-appearance: none; appearance: none; cursor: pointer; box-shadow: none;
}
.hi-seek:disabled { cursor: default; }
.hi-seek::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: linear-gradient(to right, var(--accent) var(--p), var(--border-strong) var(--p)); }
.hi-seek::-moz-range-track { height: 6px; border-radius: 3px; background: var(--border-strong); }
.hi-seek::-moz-range-progress { height: 6px; border-radius: 3px; background: var(--accent); }
.hi-seek::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: -4px; border-radius: 50%; background: var(--accent); border: 0; }
.hi-seek::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--accent); border: 0; }
.hi-time { flex: 0 0 auto; font-size: 12.5px; color: var(--muted); }

@media (max-width: 800px) {
  .hi-wrap { padding: 12px 0 16px; gap: 10px; }
  .hi-searchwrap { max-width: none; flex: 1 1 100%; }
  .hi-title { font-size: 22px; }
  .hi-grid { grid-template-columns: minmax(0, 1fr); }
  .hi-list { max-height: none; padding: 6px; border-radius: 22px; }
  .hi-row { padding: 10px; gap: 10px; }
  .hi-av { width: 38px; height: 38px; }
  .hi-chip, .hi-outcome { min-height: 36px; padding: 4px 13px; font-size: 13px; }
  .hi-chips { gap: 6px; }
  .hi-dl { display: none; }
  .hi-ds { display: inline; }
  .hi-pill { font-size: 12px; padding: 3px 9px; }
  .hi-detail { position: static; }
  .hi-back { display: inline-flex; align-items: center; }
  .hi-detail.hi-empty { display: none; }
  .hi-wrap[data-detail="closed"] .hi-detail { display: none; }
  .hi-wrap[data-detail="open"] .hi-listcol, .hi-wrap[data-detail="open"] .hi-head, .hi-wrap[data-detail="open"] .hi-chips { display: none; }
}
@media (prefers-reduced-motion: reduce) { .hi-list, .hi-chip { transition: none; } }
