/* Change feed (/changes/, tools/changes/build-feed.py) and the "Change history" box on reviews
   (tools/reviews/history-box.py). Uses the colour, type and spacing tokens from main.css. */
.ch-main { padding: calc(var(--header-height) + 32px) 0 72px; }
.ch-wrap { max-width: 860px; margin: 0 auto; padding: 0 24px; }
.ch-head { margin: 8px 0 24px; }
.ch-head h1 { font-family: var(--font-display); font-size: var(--fs-2xl); line-height: 1.15; margin: 0 0 12px; color: var(--text-primary); }
.ch-lead { font-size: var(--fs-md); color: var(--text-secondary); line-height: 1.6; margin: 0 0 10px; }
.ch-meta { font-size: var(--fs-sm); color: var(--text-tertiary); margin: 0; }
.ch-main a, .rv-hist a { color: var(--link); }
.ch-main a:hover, .rv-hist a:hover { color: var(--link-hover); }
.ch-stats { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 20px 0 0; padding: 0; }
.ch-stats li { background: var(--bg-card); border: 1px solid var(--border-light); border-radius: 12px; padding: 12px 16px; color: var(--text-secondary); font-size: var(--fs-sm); line-height: 1.4; }
.ch-stats b { display: block; font-family: var(--font-display); font-size: var(--fs-xl); font-weight: 700; color: var(--text-primary); line-height: 1.1; margin-bottom: 2px; font-variant-numeric: tabular-nums; }
.ch-stats-note { font-size: var(--fs-xs); color: var(--text-tertiary); margin: 8px 0 0; line-height: 1.5; }
.ch-note { font-size: var(--fs-sm); color: var(--text-secondary); line-height: 1.6; margin: 0 0 18px; padding: 12px 16px; border-left: 3px solid var(--data); background: var(--bg-elevated); border-radius: 0 10px 10px 0; }
.ch-filter { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; }
.ch-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 12px; font: inherit; font-size: var(--fs-sm); color: var(--text-primary);
  background: var(--bg-card); border: 1px solid var(--border-light); border-radius: 999px; cursor: pointer; }
.ch-chip:hover { border-color: var(--text-tertiary); }
.ch-chip[aria-pressed="true"] { background: rgba(56, 189, 248, .14); border-color: var(--data); }
.ch-chip:focus-visible, .ch-more > summary:focus-visible, .rv-hist summary:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.ch-n { color: var(--text-tertiary); font-variant-numeric: tabular-nums; }
.ch-chip[aria-pressed="true"] .ch-n { color: var(--text-primary); }
.ch-day { margin: 28px 0 0; }
.ch-date { font-family: var(--font-display); font-size: var(--fs-lg); color: var(--text-primary); margin: 0 0 4px; padding-bottom: 8px; border-bottom: 1px solid var(--border-light); }
.ch-list { list-style: none; margin: 0; padding: 0; }
.ch-item { padding: 14px 0; border-bottom: 1px solid var(--border-subtle); scroll-margin-top: calc(var(--header-height) + 16px); }
.ch-item:target { background: rgba(56, 189, 248, .06); box-shadow: -12px 0 0 rgba(56, 189, 248, .06), 12px 0 0 rgba(56, 189, 248, .06); }
.ch-item p { margin: 0 0 6px; line-height: 1.6; }
.ch-item p:last-child { margin-bottom: 0; }
.ch-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.ch-kind { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs); font-weight: 600; color: var(--text-secondary);
  padding: 2px 9px 2px 7px; border: 1px solid var(--border-medium); border-radius: 999px; white-space: nowrap; }
.ch-kind .ico { width: 13px; height: 13px; color: var(--data); }
.ch-firm { font-weight: 600; color: var(--text-primary); }
.ch-main a.ch-firm { color: var(--text-primary); text-decoration: underline; text-decoration-color: var(--border-medium); text-underline-offset: 3px; }
.ch-main a.ch-firm:hover { text-decoration-color: var(--link); }
.ch-when { font-size: var(--fs-sm); color: var(--text-tertiary); }
.ch-sum { color: var(--text-secondary); }
.ch-ba { font-size: var(--fs-sm); color: var(--text-secondary); }
.ch-k { color: var(--text-tertiary); margin-right: 4px; }
.ch-k::after { content: ":"; }
.ch-q { margin: 6px 0 8px; padding: 8px 12px; border-left: 2px solid var(--border-medium); background: var(--bg-elevated); border-radius: 0 8px 8px 0; }
.ch-q p { margin: 0; font-size: var(--fs-sm); color: var(--text-primary); line-height: 1.55; overflow-wrap: anywhere; }
.ch-links { font-size: var(--fs-sm); display: flex; flex-wrap: wrap; gap: 4px 16px; }
.ch-src { overflow-wrap: anywhere; }
.ch-more > summary { cursor: pointer; color: var(--link); font-size: var(--fs-sm); padding: 4px 0; width: max-content; max-width: 100%; }
.ch-glist { list-style: none; margin: 8px 0 0; padding: 0; columns: 2; column-gap: 28px; }
.ch-glist li { break-inside: avoid; padding: 5px 0; font-size: var(--fs-sm); line-height: 1.5; color: var(--text-secondary); }
.ch-gn { color: var(--text-primary); }
.ch-gd { display: block; color: var(--text-tertiary); overflow-wrap: anywhere; }
.ch-group .ch-glist:has(.ch-gd) { columns: 1; }
.ch-glead { list-style: none; margin: 4px 0 6px; padding: 0; }
.ch-glead li { color: var(--text-secondary); line-height: 1.6; margin: 0 0 4px; }
.ch-glead b { color: var(--text-primary); font-variant-numeric: tabular-nums; margin-right: 4px; }
.ch-none { color: var(--text-secondary); margin: 20px 0 0; }
.ch-how { margin: 40px 0 0; }
.ch-how h2 { font-family: var(--font-display); font-size: var(--fs-md); color: var(--text-primary); }
.ch-how p { color: var(--text-secondary); line-height: 1.7; margin: 0 0 10px; font-size: var(--fs-sm); }
.ch-day[hidden], .ch-item[hidden] { display: none; }

@media (max-width: 768px) {
  .ch-main { padding: calc(var(--header-height) + 20px) 0 56px; }
  .ch-wrap { padding: 0 16px; }
  .ch-head h1 { font-size: var(--fs-xl); }
  .ch-stats { gap: 8px; }
  .ch-stats li { padding: 10px 12px; font-size: var(--fs-xs); }
  .ch-stats b { font-size: var(--fs-lg); }
  .ch-glist { columns: 1; }
}

/* Review page: "Change history" (tools/reviews/history-box.py) */
.rv-hist-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border-subtle); }
.rv-hist-list > li { display: grid; grid-template-columns: 104px 1fr; gap: 4px 16px; padding: 12px 0; border-bottom: 1px solid var(--border-subtle); }
.rv-hist-list time { font-size: var(--fs-sm); font-weight: 600; color: var(--text-primary); white-space: nowrap; }
.rv-hist-list p { margin: 0 0 4px; line-height: 1.6; color: var(--text-secondary); }
.rv-hist-list p:last-child { margin-bottom: 0; }
.rv-hist-list .ch-kind { margin-right: 8px; }
.rv-hist-foot { font-size: var(--fs-sm); color: var(--text-tertiary); margin: 12px 0 0; line-height: 1.6; }
.rv-hist-empty { color: var(--text-secondary); margin: 0; }
.rv-hist .ch-more { margin-top: 4px; }
@media (max-width: 600px) { .rv-hist-list > li { grid-template-columns: 1fr; } }
