/* Public revisions: a quiet timeline, readable text, native disclosure. */
.reader .rfmb-resource-history {
  margin: 24px 0;
  padding: 0 20px;
  border: 1px solid #d5dfe4;
  border-radius: 12px;
  background: #fff;
}
.reader .rfmb-resource-history > summary {
  min-height: 56px;
  padding: 15px 0;
  color: #183448;
  font-size: 15px;
  line-height: 1.5;
}
.reader .rfmb-resource-history[open] > summary {
  border-bottom: 1px solid #e7ecef;
}
.history-timeline {
  margin: 0;
  padding: 4px 0 0;
  list-style: none;
  color: #183448;
}
.history-entry {
  position: relative;
  min-width: 0;
  margin: 0 0 0 5px;
  padding: 22px 0 24px 24px;
  border-left: 1px solid #d9e2e9;
}
.history-entry:last-child { padding-bottom: 5px; border-left-color: transparent; }
.history-entry::before {
  position: absolute;
  top: 28px;
  left: -5px;
  width: 9px;
  height: 9px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #235bea;
  box-shadow: 0 0 0 1px #b8cbef;
  content: "";
}
.history-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 13px;
  color: #576c79;
  font-size: 13px;
  line-height: 1.6;
}
.history-version { color: #214fbd; font-weight: 650; }
.history-current {
  padding: 2px 8px;
  border-radius: 5px;
  background: #edf3ff;
  color: #214fbd;
  font-size: 11px;
  font-weight: 600;
}
.history-timeline .history-title {
  margin: 11px 0 7px;
  color: #183448;
  font-family: inherit;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -.02em;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.history-title a { color: inherit; text-decoration: none; }
.history-title a:hover { color: #214fbd; text-decoration: underline; text-underline-offset: 4px; }
.history-timeline .history-summary {
  margin: 0 0 9px;
  color: #415867;
  font-size: 15px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}
.history-timeline .history-section {
  margin: 6px 0;
  color: #576c79;
  font-size: 13px;
  line-height: 1.6;
}
.history-timeline .history-credit {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 18px;
  margin: 8px 0 0;
  color: #576c79;
  font-size: 12px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.history-credit strong { font-weight: 500; color: #334f60; }
.history-compare { margin-top: 13px; }
.history-timeline .history-compare > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 10px 0;
  color: #214fbd;
  font-size: 14px;
  line-height: 1.5;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.history-compare > summary::-webkit-details-marker { display: none; }
.history-compare > summary::marker { content: ""; }
.history-timeline .history-compare > summary:hover { color: #173a8f; }
.history-chevron { flex: 0 0 20px; }
.history-compare[open] .history-chevron { transform: rotate(180deg); }
.history-comparison {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  margin: 6px 0 0;
}
.history-comparison > section {
  min-width: 0;
  padding: 18px;
  border: 1px solid #e0e5e9;
  border-radius: 9px;
  background: #f6f8f9;
}
.history-comparison > .history-after { border-color: #d6e1f5; background: #f3f7ff; }
.history-comparison h4 {
  margin: 0 0 12px;
  color: #415867;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.5;
}
.history-after h4 { color: #214fbd; }
.history-text {
  color: #254253;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.75;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.history-change-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 5px 0 12px;
  font-size: 12px;
  line-height: 1.6;
}
.history-change-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.history-key-removed { color: #8c3c31; }
.history-key-added { color: #235e45; }
.history-change-removed {
  background: #fce9e5;
  color: #7a3029;
  text-decoration: line-through;
  text-decoration-thickness: 1px;
  border-radius: 2px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.history-change-added {
  background: #e3f1e8;
  color: #1f563d;
  text-decoration: underline;
  text-decoration-color: #6a9d7f;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  border-radius: 2px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.history-comparison-note { color: #576c79; font-size: 13px; line-height: 1.6; margin: 8px 0; }
.history-comparison .history-text-empty, .history-timeline .history-detail-unavailable {
  margin: 0;
  color: #576c79;
  font-size: 14px;
  line-height: 1.7;
}
.history-timeline .history-detail-unavailable { margin-top: 14px; }
.history-empty { padding: 24px 0 8px; }
.history-empty .history-empty-title {
  margin: 0 0 7px;
  color: #183448;
  font-size: 16px;
  line-height: 1.5;
  font-weight: 600;
}
.history-empty p:not(.history-empty-title) {
  max-width: 65ch;
  margin: 0;
  color: #576c79;
  font-size: 15px;
  line-height: 1.75;
}
.history-timeline-compact {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
  padding-top: 20px;
}
.history-timeline-compact .history-entry {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 20px 0 0;
  border: 0;
  border-top: 1px solid #d5dfe4;
}
.history-timeline-compact .history-entry::before { display: none; }
.history-timeline-compact .history-title { font-size: 18px; }
.history-timeline-compact .history-credit { margin-bottom: 12px; }
.history-link {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 10px;
  min-height: 44px;
  margin-top: auto;
  padding: 12px 0 3px;
  color: #214fbd;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  text-decoration: none;
  text-underline-offset: 4px;
}
.history-link:hover { text-decoration: underline; }
.history-timeline a:focus-visible, .history-compare > summary:focus-visible,
.reader .rfmb-resource-history > summary:focus-visible {
  outline: 3px solid #235bea;
  outline-offset: 4px;
  border-radius: 3px;
}
.history-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
@media (max-width: 760px) {
  .history-timeline-compact { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .history-timeline-compact .history-entry { padding-top: 20px; }
}
@media (max-width: 600px) {
  .reader .rfmb-resource-history { padding: 0 14px; }
  .history-entry { padding-left: 17px; }
  .history-timeline .history-title { font-size: 17px; }
  .history-comparison { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .history-comparison > section { padding: 14px; }
  .history-meta { font-size: 12px; gap: 5px 10px; }
}
@media print {
  .history-timeline-compact { display: block; }
  .history-text, .history-comparison > section { break-inside: avoid; }
}
