/* Flat history views inherit the existing app/admin surfaces and tokens. */
.history-section { margin-top: 18px; min-width: 0; }
.history-nav { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 12px 0; }
.history-nav button { background: transparent; color: var(--muted); border: 0; border-radius: 6px; padding: 6px 0; }
.history-nav button[aria-pressed="true"] { color: var(--text); box-shadow: inset 0 -2px var(--accent); }
.history-facts { display: grid; grid-template-columns: minmax(120px, 1fr) 2fr; gap: 6px 12px; margin: 12px 0; }
.history-facts dt { color: var(--muted); }
.history-facts dd { margin: 0; overflow-wrap: anywhere; }
.history-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; margin: 12px 0; }
.history-filters label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); flex: 1 1 125px; min-width: 0; }
.history-filters input, .history-filters select { width: 100%; min-width: 0; border-radius: 8px; }
.history-filters button { border-radius: 8px; }
.history-coverage { font-size: 12px; line-height: 1.5; }
.history-row { display: grid; grid-template-columns: minmax(110px,.8fr) minmax(100px,.8fr) minmax(140px,1fr) minmax(180px,2fr); gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--border); font-size: 13px; overflow-wrap: anywhere; }
.history-row time { color: var(--muted); }
.history-row small, .history-row > div > span, .history-row > div > a { display: block; }
.history-row summary { cursor: pointer; margin-top: 6px; color: var(--muted); }
.history-row details p { margin: 6px 0; }
.history-change { margin-bottom: 4px; white-space: pre-wrap; }
.history-page > button { margin-top: 12px; border-radius: 8px; }
.history-section .history-row { grid-template-columns: 110px 1fr; }
.history-section .history-row > div:nth-child(3), .history-section .history-row > div:last-child { grid-column: 1 / -1; }
.history-target > strong { display: block; }
.history-record { padding: 10px 0; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; font-size: 13px; }
.history-record p { margin: 4px 0; }
.history-record table { width: 100%; }
.history-dialog { width: 720px; background: var(--bg-2); padding: 22px; border: 1px solid var(--border); border-radius: 12px; }
.history-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: grid; place-items: center; z-index: 400; padding: 16px; }
.history-heading { display: grid; grid-template-columns: .8fr .8fr 1fr 2fr; gap: 10px; color: var(--muted); font-size: 12px; }
@media (max-width: 800px) {
  .admin-page .admin-header { flex-wrap: wrap; }
  .history-row, .history-section .history-row { grid-template-columns: 1fr; gap: 5px; }
  .history-heading { display: none; }
  .history-facts { grid-template-columns: 1fr; gap: 4px; }
  .history-facts dd { margin-bottom: 8px; }
  .history-filters label { flex-basis: calc(50% - 8px); }
  .history-filters button { min-height: 40px; }
}

.admin-page #reportsReset { max-width: 100%; white-space: normal; }
.history-filters > button { max-width: 100%; white-space: normal; }

#auditHistory { scroll-margin-top: 76px; }
.history-status .history-coverage { margin: 8px 0; }
