/* Version history + diff view for the legal pages. Loaded only by /terms/history/ and
   /privacy/history/; the shared tokens come from site.css. */

.hist-block { margin-bottom: 3rem; }
.hist-block h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--t1);
  margin: 0 0 1rem;
  letter-spacing: -0.01em;
}
.hist-status {
  color: var(--t3);
  font-size: 0.9rem;
  line-height: 1.6;
}
.hist-status--err { color: var(--t2); }
.hist-status a { color: var(--blue); }

/* ── compare bar ─────────────────────────────────────────── */
.cmp-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  padding: 0.9rem 1rem;
  background: var(--s1);
  border: 1px solid var(--b1);
  border-radius: var(--r-lg);
  margin-bottom: 1.25rem;
}
.cmp-bar label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--t3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.cmp-bar select {
  font: inherit;
  font-size: 0.85rem;
  color: var(--t1);
  background: var(--s2);
  border: 1px solid var(--b2);
  border-radius: 10px;
  padding: 0.45rem 0.7rem;
  max-width: 100%;
  cursor: pointer;
}
.cmp-bar select:focus-visible,
.cmp-mode:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}
.cmp-modes { display: flex; gap: 0.35rem; margin-left: auto; }
.cmp-mode {
  font: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--t2);
  background: transparent;
  border: 1px solid var(--b1);
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.cmp-mode:hover { color: var(--t1); background: var(--s2); }
.cmp-mode.is-on {
  color: var(--blue);
  background: var(--blue-d);
  border-color: rgba(10,132,255,0.3);
}

/* ── diff ────────────────────────────────────────────────── */
.diff-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.87rem;
  color: var(--t2);
  margin-bottom: 0.9rem;
}
.diff-summary strong { color: var(--t1); font-weight: 600; }
.diff-key { display: flex; gap: 0.5rem; margin-left: auto; }
.dk {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
}
.dk--del { color: #ff9a9a; background: rgba(255,69,58,0.12); }
.dk--add { color: #8fe3a6; background: rgba(48,209,88,0.12); }

.diff {
  border: 1px solid var(--b1);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--s1);
}
.dl {
  display: flex;
  gap: 0.7rem;
  padding: 0.5rem 0.9rem;
  font-size: 0.88rem;
  line-height: 1.6;
  border-bottom: 1px solid var(--b0);
  /* long unbroken strings (URLs, emails) must wrap, never scroll the page */
  overflow-wrap: anywhere;
}
.dl:last-child { border-bottom: none; }
.dl__s {
  flex: 0 0 auto;
  width: 0.9rem;
  font-weight: 700;
  color: var(--t4);
  user-select: none;
}
.dl__t { flex: 1 1 auto; min-width: 0; }
.dl--h .dl__t { font-weight: 700; color: var(--t1); }
.dl--same { color: var(--t3); }
.dl--del { background: rgba(255,69,58,0.07); color: var(--t2); }
.dl--del .dl__s { color: #ff9a9a; }
.dl--add { background: rgba(48,209,88,0.07); color: var(--t2); }
.dl--add .dl__s { color: #8fe3a6; }
.dl--gap {
  justify-content: center;
  font-size: 0.75rem;
  color: var(--t4);
  background: var(--s2);
  font-style: italic;
}

.dw {
  border-radius: 3px;
  padding: 0.05em 0.15em;
  background: transparent;
}
.dw--del { color: #ffbcbc; background: rgba(255,69,58,0.22); text-decoration: line-through; }
.dw--add { color: #a9edbb; background: rgba(48,209,88,0.22); }

/* ── single-version full text ────────────────────────────── */
.version-full {
  border: 1px solid var(--b1);
  border-radius: var(--r-lg);
  background: var(--s1);
  padding: 1.25rem 1.4rem;
}
.version-full h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--t1);
  margin: 1.5rem 0 0.6rem;
}
.version-full h3:first-child { margin-top: 0; }
.version-full p, .version-full li {
  font-size: 0.88rem;
  line-height: 1.7;
  color: var(--t2);
  margin: 0 0 0.6rem;
  overflow-wrap: anywhere;
}
.version-full li { margin-left: 1.1rem; list-style: disc; }

/* ── timeline ────────────────────────────────────────────── */
.tl { list-style: none; margin: 0; padding: 0; }
.tl__i {
  position: relative;
  padding: 0 0 1.4rem 1.4rem;
  border-left: 2px solid var(--b1);
}
.tl__i:last-child { border-left-color: transparent; padding-bottom: 0; }
.tl__i::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 0.3rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--s3);
  border: 2px solid var(--bg);
}
.tl__i--cur::before { background: var(--blue); }
.tl__v {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--t1);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.tl__b {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--blue);
  background: var(--blue-d);
  border-radius: 999px;
  padding: 0.15rem 0.5rem;
}
.tl__d { font-size: 0.8rem; color: var(--t3); margin-top: 0.15rem; }
.tl__n { font-size: 0.85rem; color: var(--t2); line-height: 1.6; margin: 0.45rem 0 0; }

@media (max-width: 640px) {
  .cmp-modes { margin-left: 0; width: 100%; }
  .diff-key { margin-left: 0; width: 100%; }
  .cmp-bar select { flex: 1 1 auto; }
}
