.history-cover { grid-template-columns: minmax(0, 1fr); }
.history-lead { max-width: calc(var(--body-size) * 40); }
[data-whitepaper="history"] { min-width: 0; }
[data-whitepaper="history"] [data-product-panel] {
  min-width: 0;
  scroll-margin-top: calc(var(--space-8) + var(--space-8) + var(--space-5));
}
[data-whitepaper="history"] .product-tabs { max-width: 100%; }
.history-counts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-5);
  padding: 0;
  margin-block: var(--space-5) var(--space-7);
  list-style: none;
}
.history-counts li { display: flex; align-items: center; gap: var(--space-2); }
.history-type {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-round);
  color: var(--text-muted);
  font-size: var(--tag-size);
  font-weight: var(--tag-weight);
  line-height: var(--tag-line);
  letter-spacing: var(--tag-tracking);
  white-space: nowrap;
}
.history-type .status-glyph { width: var(--space-3); height: var(--space-3); flex: none; }
.history-count { font-family: var(--font-mono); font-size: var(--small-size); }
.history-line {
  list-style: none;
  border-left: 1px solid var(--line-strong);
  margin: 0 0 0 var(--space-1);
  padding: 0 0 0 var(--space-5);
}
.history-event { position: relative; min-width: 0; padding-bottom: var(--space-7); overflow-wrap: anywhere; }
.history-event::before {
  content: "";
  position: absolute;
  width: var(--space-2);
  height: var(--space-2);
  left: calc(0px - var(--space-5) - var(--space-1) - 1px);
  top: var(--space-2);
  border-radius: 0;
  background: var(--text-muted);
}
.history-event time { display: block; color: var(--text-muted); font-size: var(--small-size); margin-bottom: var(--space-3); }
.history-event p { margin-block: var(--space-4) var(--space-3); max-width: calc(var(--body-size) * 40); }
.history-event figure { margin: var(--space-5) 0 var(--space-3); max-width: 100%; }
.history-event img { display: block; width: 100%; max-width: 100%; height: auto; border: 1px solid var(--line); }
.history-ref { color: var(--text-muted); font-family: var(--font-mono); font-size: var(--trace-size); white-space: nowrap; }
.history-never { border-top: 1px solid var(--line-strong); margin-top: var(--space-8); padding-top: var(--space-7); overflow-wrap: anywhere; }
.history-never h3 { margin-top: var(--space-6); }
.history-never ul { padding-left: var(--space-5); }
.history-never li { max-width: calc(var(--body-size) * 40); margin-top: var(--space-4); }
@media (min-width: 768px) {
  [data-whitepaper="history"] [data-product-panel] { scroll-margin-top: calc(var(--space-8) + var(--space-7)); }
  .history-line { padding-left: var(--space-7); }
  .history-event::before { left: calc(0px - var(--space-7) - var(--space-1) - 1px); }
}

.history-acts {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-6);
  margin: 0 0 var(--space-7);
  padding-block: var(--space-5);
  border-block: 1px solid var(--line);
  overflow-wrap: anywhere;
}
.history-axis { min-width: 0; }
.history-axis dt { font-size: var(--body-size); font-weight: var(--title-weight); margin-bottom: var(--space-4); }
.history-axis dd { margin: var(--space-3) 0 0; font-size: var(--small-size); }
.history-axis .history-act { display: flex; margin-bottom: var(--space-2); }
.history-act {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  color: var(--text-muted);
  font-size: var(--tag-size);
  font-weight: var(--tag-weight);
  line-height: var(--tag-line);
  letter-spacing: var(--tag-tracking);
  white-space: nowrap;
}
.history-act svg { width: var(--space-4); height: var(--space-4); flex: none; }
.history-stage, .history-pace { color: var(--text-muted); font-size: var(--small-size); margin-block: var(--space-3); }
.history-act-counts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-5);
  padding: 0;
  margin-block: var(--space-5);
  list-style: none;
}
.history-act-counts li { display: flex; align-items: center; gap: var(--space-2); }
.history-subhead { font-weight: var(--title-weight); margin-block: var(--space-6) var(--space-4); }
.history-versions { display: grid; gap: var(--space-4); list-style: none; margin: 0; padding: 0; }
.history-version {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-square);
  padding: var(--space-4);
  overflow-wrap: anywhere;
}
.history-version time, .history-version-no { color: var(--text-muted); font-size: var(--small-size); }
.history-why { flex-basis: 100%; color: var(--text-muted); font-size: var(--small-size); }
.history-version .history-achieved, .history-version .history-changed {
  flex-basis: 100%;
  min-width: 0;
  max-width: calc(var(--body-size) * 40);
  margin: 0;
  font-size: var(--body-size);
}
.history-building { padding-left: var(--space-5); overflow-wrap: anywhere; }
.history-building li { margin-top: var(--space-2); max-width: calc(var(--body-size) * 40); }
.history-grid, .era-index { display: grid; grid-template-columns: minmax(0,1fr); gap: var(--space-5); }
.era-index { padding-left: var(--space-5); }
.era-index li { min-width: 0; overflow-wrap: anywhere; }
.era-index .small, .era-index a span { display: block; }
[data-whitepaper="history"] section { margin-block: var(--space-7); }
.today-card, .skill-card, .pack-card { min-width: 0; overflow-wrap: anywhere; background: var(--box-fill); border: 1px solid var(--box-frame); border-top: 2px solid var(--mod-shengxin); border-radius: var(--radius-square); padding: var(--space-5); }
.today-card { border-top-color: var(--product-color,var(--mod-shengxin)); }
.today-card h3, .skill-card h3, .pack-card h3 { font-family: var(--font-display); font-weight: 700; }
.history-product { color: var(--text-muted); font-size: var(--small-size); }
.history-filter { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-block: var(--space-7); }
.history-filter[hidden], .era[hidden], .era [hidden] { display: none !important; }
.history-filter p { flex-basis: 100%; }
.history-filter button, .skill-pay { min-height: 44px; max-width: 100%; padding: var(--space-2) var(--space-4); border: 1px solid var(--line-strong); border-radius: var(--radius-square); font: inherit; color: var(--text); background: var(--box-fill); }
.skill-pay { color: var(--text-muted); cursor: default; }
.history-filter button { cursor: pointer; transition: transform var(--motion-fast) var(--ease), color var(--motion-fast) var(--ease), background-color var(--motion-fast) var(--ease); }
.history-filter button[aria-pressed="true"] { background: var(--brass-tint); border-color: var(--brass); }
.history-filter button:active { transform: scale(var(--motion-press-scale)); }
.skill-sub { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); margin-block: var(--space-4); }
.skill-sub p { flex-basis: 100%; margin: 0; }
.skill-path .history-subhead { margin: 0; }
.era-rail.stations { position: relative; display: block; margin-block: var(--space-8); padding-left: var(--space-5); border-left: 1px solid var(--line); }
.era-rail .era.station { display: block; position: relative; padding: 0 0 var(--space-8); border: 0; opacity: 1; min-width: 0; overflow-wrap: anywhere; }
.era-rail .era-head { position: relative; }
.era-head::before { content: ""; width: var(--space-3); height: var(--space-3); position: absolute; left: calc(0px - var(--space-5) - var(--space-1)); top: var(--space-2); border: 1px solid var(--line-strong); background: var(--text-muted); }
.era.station-lit .era-head::before { background: var(--brass); }
.era-rail .era:last-of-type .era-head::before { background: var(--box-fill); }
.era-rail .era.station > * { opacity: 1; color: var(--text); }
.era-when { font-family: var(--font-mono); color: var(--text-muted); }
.era-rail .route-track { left: 0; top: 0; width: 1px; height: var(--route-length,100%); }
.era-rail .route-drawn { transform: scaleY(var(--route-progress,1)); transform-origin: top; }
.era-skills { display: grid; gap: var(--space-5); }
.era:target, .skill-card:target, .pack-card:target, .today-card:target { outline: 2px solid var(--brass); outline-offset: var(--space-2); }
.era, .skill-card, .pack-card, .today-card, .history-event, .history-version { scroll-margin-top: var(--space-8); }
.era-records summary, .today-card summary { cursor: pointer; min-height: 44px; padding-block: var(--space-3); }
.era-records[open] > :not(summary), .today-card details[open] > :not(summary) { animation: history-open var(--motion-fast) var(--ease); }
@keyframes history-open { from { opacity: 0; } to { opacity: 1; } }
@media (hover:hover) { .history-filter button:hover { border-color: var(--brass); } }
@media (prefers-reduced-motion:reduce) {
  .history-filter button { transition: none; transform: none; }
  .era-rail .route-drawn { transform: none; }
  .era-records[open] > :not(summary), .today-card details[open] > :not(summary) { animation: none; }
  .era-head, .skill-card, .today-card { opacity: 1 !important; transform: none !important; }
}
@media (min-width: 768px) {
  .history-grid, .era-index { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .history-acts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .history-version { padding: var(--space-5); }
}
