.audit-history {
  --hist-surface: var(--panel-raised, var(--panel));
  --hist-conflict: var(--coral, #efa797);
  --hist-track: var(--line);
  --hist-code: var(--mono, ui-monospace, SFMono-Regular, Consolas, monospace);
  margin: 1.2rem 0 0;
}
.audit-history .history-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(15rem, 0.85fr);
  align-items: start;
  gap: clamp(1rem, 3vw, 2.5rem);
}
.audit-history .history-layout > section {
  margin: 0;
  min-width: 0;
}
.audit-history h3,
.audit-history h4,
.audit-history h5 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.35;
  letter-spacing: -0.015em;
}
.audit-history h3 {
  font-size: 1.1rem;
}
.history-group-head,
.history-diff-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.history-count,
.history-period,
.history-note,
.history-outcomes,
.history-change-count,
.history-side time {
  color: var(--muted);
}
.history-count,
.history-outcomes,
.history-change-count,
.history-row-actions,
.history-gap,
.history-viewing,
.history-legend,
.history-period,
.history-side time {
  font-size: 0.85rem;
}
.history-choice {
  background: var(--hist-surface);
  padding: 1.05rem 1.2rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
}
.history-choice label {
  display: block;
  font-size: 0.9rem;
  margin: 0.95rem 0 0.2rem;
}
.audit-history .history-choice select {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0.4rem 0 0.85rem;
}
.history-choice .history-note,
.history-period,
.history-note {
  font-size: 0.9rem;
  line-height: 1.5;
}
.history-note:empty {
  display: none;
}
.history-choice .history-note {
  margin: 0.75rem 0 0;
}
.history-legend {
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
  color: var(--muted);
  margin: 0.5rem 0 0.8rem;
}
.history-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.history-legend i {
  width: 0.5rem;
  height: 0.5rem;
  display: inline-block;
  border-radius: 1px;
}
.history-legend .hist-listed {
  background: var(--green);
}
.history-legend .hist-conflict {
  background: var(--hist-conflict);
}
.history-legend .hist-unknown {
  background: var(--amber);
}
.history-timeline {
  margin: 0;
  padding: 0;
  list-style: none;
}
.history-event {
  margin: 0;
  position: relative;
  padding: 0.65rem 0 0.85rem 1.2rem;
  border-inline-start: 1px solid var(--hist-track);
  margin-inline-start: 0.25rem;
}
.history-event::before {
  content: "";
  display: block;
  width: 7px;
  height: 7px;
  background: var(--bg);
  border: 1px solid var(--muted);
  border-radius: 50%;
  position: absolute;
  left: -5px;
  top: 1.12rem;
}
.history-event.is-viewed::before {
  background: var(--blue);
  border-color: var(--blue);
}
.history-when,
.history-row-actions {
  display: flex;
  align-items: center;
  gap: 0.3rem 0.75rem;
  flex-wrap: wrap;
}
.history-when time {
  font: 600 0.9rem/1.4 var(--hist-code);
  color: var(--ink);
}
.history-viewing {
  color: var(--blue);
}
.history-change-count {
  margin-left: auto;
}
.history-rowbar {
  display: block;
  width: 100%;
  height: 6px;
  margin: 0.55rem 0 0.3rem;
  background: var(--hist-track);
  border-radius: 2px;
  overflow: hidden;
}
.history-rowbar .hist-listed {
  fill: var(--green);
}
.history-rowbar .hist-conflict {
  fill: var(--hist-conflict);
}
.history-rowbar .hist-unknown {
  fill: var(--amber);
}
.history-outcomes {
  margin: 0.3rem 0;
  line-height: 1.5;
}
.history-gap {
  color: var(--amber);
}
.history-row-actions {
  min-height: 1.65rem;
}
.history-text-button {
  font: inherit;
  font-weight: 400;
  background: none;
  border: 0;
  padding: 0.1rem 0;
  min-height: 0;
  border-radius: 0;
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}
.history-pager {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}
.history-pager:not(:empty) {
  margin: 0.8rem 0;
}
.history-comparison:not(:empty) {
  margin: 1.25rem 0;
}
.history-diff {
  border-top: 1px solid var(--line);
  padding: 1.25rem 0;
}
.history-diff h4 {
  font-size: 1.15rem;
}
.history-period,
.history-caution {
  margin: 0.5rem 0;
}
.history-caution {
  color: var(--amber);
  font-size: 0.92rem;
}
.history-kind {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.9rem;
}
.audit-history .history-change {
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 0.65rem 0;
  margin: 0;
}
.history-change-list {
  margin: 0.8rem 0;
}
.history-change summary {
  cursor: pointer;
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}
.history-change-id,
.history-change-kind {
  display: inline;
}
.history-change-id code {
  margin-inline-start: 0.5rem;
  font-size: 0.9rem;
  color: var(--ink);
}
.history-change-kind {
  margin-inline-start: 1rem;
  color: var(--muted);
}
.history-sides {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.8rem;
  margin: 0.85rem 0;
}
.history-side {
  padding: 1rem;
  background: var(--hist-surface);
  border: 1px solid var(--line);
  border-radius: 0.35rem;
  overflow-wrap: anywhere;
}
.history-side time {
  display: block;
  margin: 0.25rem 0;
}
.history-side dl {
  margin: 0.75rem 0;
  display: grid;
  grid-template-columns: minmax(5rem, 0.8fr) minmax(0, 1.2fr);
  gap: 0.3rem 0.5rem;
  font-size: 0.85rem;
}
.history-side dt {
  color: var(--muted);
}
.history-side dd {
  margin: 0;
}
.history-evidence-links {
  display: flex;
  gap: 0.3rem 0.65rem;
  flex-wrap: wrap;
  margin: 0.45rem 0;
}
.history-side a {
  font-size: 0.9rem;
}
@media (max-width: 760px) {
  .audit-history .history-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .history-choice {
    padding: 0.95rem;
  }
  .history-sides {
    grid-template-columns: minmax(0, 1fr);
  }
  .history-change-count {
    margin-left: 0;
  }
}
@media (max-width: 440px) {
  .history-change-kind {
    display: block;
    margin-inline-start: 1rem;
  }
  .history-choice select {
    min-width: 0;
  }
}
.history-axis-note,
.history-pin-separator {
  color: var(--muted);
  font-size: 0.85rem;
}
.history-axis-note {
  margin: 0.25rem 0 0;
}
.history-pin-separator {
  padding: 0.4rem 0 0.35rem 1.45rem;
}
