/* PathKEY v5 — history styles. Owner: WS-B2 (history). Colours only from tokens.css.
 * The History drawer (a list of changes, newest first, each with who, when,
 * a sentence and its actions), Compare's side-by-side table, Recently
 * deleted, and the Settings card that downloads all content. */

/* ================================================ the History drawer === */
.hist-tools { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3); border: 1px solid var(--line-soft); border-radius: var(--r-md); background: var(--bg-subtle); }
.hist-tools-text { margin: 0; font-size: var(--fs-12); line-height: var(--lh-12); color: var(--text-muted); }

.hist-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.hist-line { position: relative; display: flex; flex-direction: column; gap: var(--sp-1);
  padding: var(--sp-3) 0 var(--sp-3) var(--sp-5); border-left: 2px solid var(--line-soft); margin-left: 5px; }
.hist-line::before { content: ''; position: absolute; left: -6px; top: calc(var(--sp-3) + 3px); width: 10px; height: 10px;
  border-radius: var(--r-full); background: var(--bg-surface); border: 2px solid var(--line-strong); }
.hist-line.is-current::before { background: var(--accent); border-color: var(--accent); }
.hist-line:last-child { border-left-color: transparent; }

.hist-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1) var(--sp-2); }
.hist-when { font-size: var(--fs-12); line-height: var(--lh-12); color: var(--text-muted); font-variant-numeric: tabular-nums; }
.hist-who { font-size: var(--fs-12); line-height: var(--lh-12); font-weight: var(--fw-medium); color: var(--text-2); }
.hist-who::before { content: '·'; margin-right: var(--sp-2); color: var(--text-muted); font-weight: var(--fw-regular); }
.hist-text { margin: 0; font-size: var(--fs-14); line-height: var(--lh-14); color: var(--text); overflow-wrap: anywhere; }
.hist-note { margin: 0; font-size: var(--fs-13); line-height: var(--lh-13); color: var(--text-2); overflow-wrap: anywhere; }
.hist-note-label { font-weight: var(--fw-medium); }
.hist-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3); }
.hist-actions:empty { display: none; }
.hist-actions .checkbox { font-size: var(--fs-12); }
.hist-more { display: flex; justify-content: center; }

/* "What changes" in the Restore confirmation */
.hist-what { margin-bottom: 0; font-weight: var(--fw-medium); color: var(--text); }
.hist-extra { color: var(--text-muted); }

/* ========================================================== Compare === */
.hist-cmp-scroll { overflow-x: auto; }
.hist-cmp { width: 100%; border-collapse: collapse; font-size: var(--fs-13); line-height: var(--lh-13); }
.hist-cmp th, .hist-cmp td { text-align: left; vertical-align: top; padding: var(--sp-2) var(--sp-3); border-bottom: 1px solid var(--line-soft); overflow-wrap: anywhere; }
.hist-cmp thead th { position: sticky; top: 0; background: var(--bg-surface); font-weight: var(--fw-medium); color: var(--text-2); border-bottom-color: var(--line); }
.hist-cmp tbody th { width: 28%; font-weight: var(--fw-medium); color: var(--text-2); }
.hist-cmp tbody td { width: 36%; color: var(--text); }
.hist-cmp-when, .hist-cmp-who { display: block; }
.hist-cmp-who { font-weight: var(--fw-regular); color: var(--text-muted); }

/* ==================================================== your content === */
.hist-content-text { margin: 0 0 var(--sp-3); font-size: var(--fs-13); line-height: var(--lh-13); color: var(--text-2); max-width: 64ch; }

@media (max-width: 640px) {
  .hist-tools { flex-direction: column; align-items: stretch; }
  .hist-cmp tbody th { width: auto; }
}
