:root {
  --bg: #070b12;
  --paper: #101824;
  --paper-2: #152232;
  --ink: #edf7ff;
  --muted: #93a8ba;
  --line: rgba(125, 202, 255, 0.18);
  --line-soft: rgba(125, 202, 255, 0.1);
  --red: #ff4d5a;
  --teal: #2fe6d0;
  --amber: #f4b647;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.36);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(90deg, rgba(184, 51, 45, 0.035) 1px, transparent 1px) 0 0 / 48px 48px,
    linear-gradient(0deg, rgba(46, 133, 133, 0.028) 1px, transparent 1px) 0 0 / 48px 48px,
    var(--bg);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.topbar {
  height: 76px;
  display: grid;
  grid-template-columns: minmax(210px, 0.9fr) minmax(360px, 1.4fr) minmax(240px, 0.8fr);
  align-items: center;
  gap: 22px;
  padding: 0 26px;
  background: rgba(255, 253, 248, 0.88);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.brand h1 {
  margin: 0;
  font-family: Georgia, "Songti SC", "Noto Serif CJK SC", serif;
  font-size: 30px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0;
}

.brand span {
  color: var(--red);
  font-size: 12px;
  white-space: nowrap;
}

nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-item,
.filter-button,
.timeline-meta button,
.favorite-action {
  border: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.86);
  color: var(--ink);
  border-radius: 7px;
  min-height: 34px;
  padding: 0 13px;
  transition:
    background 140ms ease,
    border-color 140ms ease,
    color 140ms ease,
    transform 140ms ease;
}

.nav-item {
  border-color: transparent;
  background: transparent;
}

.nav-item.is-active,
.filter-button.is-active {
  color: #fff;
  background: var(--red);
  border-color: var(--red);
}

.nav-item:hover,
.filter-button:hover,
.timeline-meta button:hover,
.favorite-action:hover {
  transform: translateY(-1px);
  border-color: rgba(184, 51, 45, 0.38);
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 7px;
  min-height: 40px;
  padding: 0 12px;
}

.search-box span {
  color: var(--muted);
  font-size: 13px;
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  min-width: 0;
}

.control-deck {
  display: grid;
  grid-template-columns: 260px minmax(330px, 1fr) minmax(330px, 1fr) 120px;
  gap: 14px;
  align-items: end;
  padding: 14px 26px;
  background: rgba(248, 244, 236, 0.92);
  border-bottom: 1px solid var(--line);
}

.infographic-strip {
  display: grid;
  grid-template-columns: 180px 86px minmax(260px, 1fr) 110px 130px minmax(260px, 1.1fr);
  gap: 12px;
  align-items: stretch;
  padding: 12px 26px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(184, 51, 45, 0.08), transparent 34%),
    rgba(255, 253, 248, 0.78);
}

.year-stage,
.metric-card,
.story-text,
.activity-bars {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 253, 248, 0.86);
}

.year-stage,
.metric-card {
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 10px 13px;
}

.year-stage span,
.metric-card span,
.scrubber-wrap span {
  color: var(--muted);
  font-size: 12px;
}

.year-stage strong {
  color: var(--red);
  font-family: Georgia, "Songti SC", serif;
  font-size: 25px;
  line-height: 1;
  letter-spacing: 0;
}

.metric-card strong {
  font-size: 22px;
  line-height: 1;
}

.play-button {
  border: 0;
  border-radius: 7px;
  color: #fff;
  background: var(--ink);
  font-weight: 700;
  box-shadow: 0 12px 28px rgba(36, 31, 26, 0.18);
}

.scrubber-wrap {
  display: grid;
  align-content: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 253, 248, 0.86);
}

.scrubber-wrap input {
  width: 100%;
  accent-color: var(--red);
}

.story-text {
  margin: 0;
  padding: 10px 13px;
  color: #3c332c;
  font-size: 13px;
  line-height: 1.55;
}

.activity-bars {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(7, minmax(110px, 1fr));
  gap: 8px;
  padding: 10px;
}

.activity-row {
  display: grid;
  grid-template-columns: 38px 1fr 18px;
  gap: 7px;
  align-items: center;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--ink);
  font-size: 12px;
}

.activity-row span {
  text-align: right;
  color: var(--muted);
}

.activity-row b {
  height: 8px;
  border-radius: 99px;
  background: rgba(120, 104, 88, 0.14);
  overflow: hidden;
}

.activity-row i {
  display: block;
  height: 100%;
  min-width: 0;
  border-radius: inherit;
  background: var(--region-color);
  animation: barPulse 900ms ease;
}

.activity-row em {
  font-style: normal;
  font-variant-numeric: tabular-nums;
}

.category-mix-wrap {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 72px 1fr;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 253, 248, 0.86);
  padding: 9px 10px;
}

.category-mix-wrap > span {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.category-mix {
  display: flex;
  width: 100%;
  height: 20px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(120, 104, 88, 0.12);
}

.category-mix span {
  display: grid;
  place-items: center;
  min-width: 0;
  color: #fff;
  font-size: 11px;
  white-space: nowrap;
  animation: mixGrow 460ms ease both;
}

.category-mix span:nth-child(1) {
  background: #b8332d;
}

.category-mix span:nth-child(2) {
  background: #6f3f8f;
}

.category-mix span:nth-child(3) {
  background: #2e8585;
}

.category-mix span:nth-child(4) {
  background: #4777a8;
}

.category-mix span:nth-child(5) {
  background: #b78b23;
}

.story-stage {
  display: grid;
  grid-template-columns: minmax(230px, 0.72fr) minmax(330px, 1.05fr) 150px minmax(260px, 0.85fr) minmax(300px, 1fr);
  gap: 14px;
  padding: 14px 26px;
  border-bottom: 1px solid var(--line);
  background: rgba(250, 247, 240, 0.72);
}

.chapter-card,
.dominant-card,
.insight-card,
.milestone-wrap,
.region-pulse-map,
.event-flow {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 253, 248, 0.9);
  box-shadow: 0 10px 30px rgba(66, 49, 31, 0.07);
}

.chapter-card {
  padding: 16px;
}

.chapter-card span,
.dominant-card span,
.insight-card span,
.milestone-wrap > span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
}

.chapter-card h2 {
  margin: 0 0 8px;
  font-family: Georgia, "Songti SC", serif;
  font-size: 26px;
  line-height: 1.05;
  color: var(--red);
  letter-spacing: 0;
}

.chapter-card p {
  margin: 0;
  color: #3c332c;
  font-size: 13px;
  line-height: 1.65;
}

.region-pulse-map {
  position: relative;
  min-height: 150px;
  overflow: hidden;
  background:
    radial-gradient(circle at 24% 28%, rgba(184, 51, 45, 0.12), transparent 24%),
    radial-gradient(circle at 72% 65%, rgba(46, 133, 133, 0.12), transparent 25%),
    linear-gradient(135deg, rgba(255, 253, 248, 0.95), rgba(242, 237, 227, 0.68));
}

.region-pulse-map::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px dashed rgba(116, 107, 96, 0.28);
  border-radius: 50%;
}

.pulse-node {
  position: absolute;
  left: var(--x);
  top: var(--y);
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 1px solid color-mix(in srgb, var(--region-color), #fff 28%);
  border-radius: 50%;
  color: var(--ink);
  background: rgba(255, 253, 248, 0.92);
  box-shadow: 0 10px 24px rgba(66, 49, 31, 0.1);
}

.pulse-node span {
  font-size: 11px;
  color: var(--muted);
}

.pulse-node b {
  font-size: 16px;
  color: var(--region-color);
}

.pulse-node.is-hot::after {
  content: "";
  position: absolute;
  inset: -8px;
  border: 2px solid var(--region-color);
  border-radius: inherit;
  animation: pulseRing 1.4s ease-out infinite;
}

.dominant-card {
  display: grid;
  align-content: center;
  padding: 16px;
}

.dominant-card strong {
  font-family: Georgia, "Songti SC", serif;
  font-size: 24px;
  line-height: 1.1;
}

.insight-card {
  display: grid;
  align-content: center;
  padding: 14px;
}

.insight-card p {
  margin: 0;
  color: #3c332c;
  font-size: 13px;
  line-height: 1.6;
}

.event-flow {
  display: grid;
  gap: 8px;
  padding: 10px;
  align-content: start;
  max-height: 174px;
  overflow: auto;
}

.milestone-wrap {
  grid-column: 1 / -1;
  padding: 12px 14px 14px;
}

.milestone-rail {
  position: relative;
  height: 132px;
  border-top: 1px solid var(--line);
}

.milestone-marker {
  position: absolute;
  top: calc(-6px + var(--level, 0) * 42px);
  transform: translateX(-50%);
  display: grid;
  justify-items: center;
  gap: 6px;
  width: 96px;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 0;
}

.milestone-marker::before {
  content: "";
  width: 11px;
  height: 11px;
  border: 2px solid var(--red);
  border-radius: 50%;
  background: var(--paper);
  box-shadow: 0 0 0 4px rgba(184, 51, 45, 0.08);
}

.milestone-marker b {
  font-size: 11px;
  color: var(--red);
  font-variant-numeric: tabular-nums;
  opacity: 0;
  transform: translateY(-2px);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.milestone-marker span {
  max-width: 92px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
  white-space: normal;
  opacity: 0;
  transform: translateY(-2px);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
  pointer-events: none;
}

.milestone-marker:hover span,
.milestone-marker:focus-visible span,
.milestone-marker.is-near span {
  opacity: 1;
  transform: translateY(0);
}

.milestone-marker:hover b,
.milestone-marker:focus-visible b,
.milestone-marker.is-near b {
  opacity: 1;
  transform: translateY(0);
}

.milestone-marker.is-near::before {
  background: var(--red);
  animation: pulseRing 1.5s ease-out infinite;
}

.flow-event {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  min-height: 34px;
  border: 1px solid rgba(130, 113, 94, 0.24);
  border-left: 3px solid var(--region-color);
  border-radius: 6px;
  background: rgba(255, 253, 248, 0.7);
  color: var(--ink);
  padding: 6px 8px;
  text-align: left;
  animation: flowIn 360ms ease both;
}

.flow-event span,
.flow-event em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  white-space: nowrap;
}

.flow-event strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.flow-event.is-selected {
  border-color: var(--red);
  background: rgba(184, 51, 45, 0.06);
}

.range-control,
.control-deck > div {
  min-width: 0;
}

.range-control label,
.control-label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--muted);
}

select {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: #fff;
  padding: 0 10px;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-button {
  min-height: 32px;
  padding: 0 12px;
  font-size: 13px;
}

.category-all.is-active {
  background: #9f1f21;
  border-color: #9f1f21;
}

.switch {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-height: 36px;
  color: var(--muted);
  font-size: 13px;
}

.switch input {
  position: absolute;
  opacity: 0;
}

.switch span {
  width: 34px;
  height: 20px;
  border-radius: 99px;
  background: #d7cec1;
  position: relative;
}

.switch span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.22);
  transition: transform 160ms ease;
}

.switch input:checked + span {
  background: var(--red);
}

.switch input:checked + span::after {
  transform: translateX(14px);
}

.workbench {
  min-height: 0;
  display: grid;
  grid-template-columns: 118px minmax(680px, 1fr) 330px;
  border-bottom: 1px solid var(--line);
}

.year-pane,
.detail-panel {
  background: rgba(255, 253, 248, 0.74);
}

.year-pane {
  border-right: 1px solid var(--line);
  position: relative;
  min-height: 590px;
}

.pane-title {
  height: 48px;
  display: flex;
  align-items: center;
  padding-left: 18px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}

.year-ruler {
  position: relative;
  height: var(--timeline-height, 980px);
  min-height: 560px;
}

.year-tick {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--line-soft);
}

.year-tick span {
  position: absolute;
  top: -10px;
  right: 16px;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  color: var(--ink);
}

.timeline-card {
  min-width: 0;
  background: rgba(255, 253, 248, 0.42);
}

.timeline-meta {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.timeline-meta div {
  display: flex;
  gap: 8px;
}

.timeline-meta button {
  min-height: 30px;
  padding: 0 10px;
  font-size: 13px;
}

.timeline-scroll {
  min-height: 590px;
  max-height: calc(100vh - 246px);
  overflow: auto;
}

.timeline {
  --timeline-height: 980px;
  min-width: 860px;
  height: var(--timeline-height);
  position: relative;
}

.lanes {
  display: grid;
  grid-template-columns: repeat(var(--lane-count), minmax(144px, 1fr));
  height: 100%;
}

.lane {
  position: relative;
  border-right: 1px solid var(--line);
  background:
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 92px,
      rgba(120, 104, 88, 0.16) 93px
    );
}

.lane header {
  position: sticky;
  top: 0;
  z-index: 5;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  background: linear-gradient(90deg, color-mix(in srgb, var(--region-color), #2a221c 14%), var(--region-color));
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
}

.selected-band,
.playhead-band {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 4;
  border-top: 1px dashed var(--red);
  pointer-events: none;
}

.selected-band span,
.playhead-band span {
  position: absolute;
  left: 12px;
  top: -16px;
  background: var(--red);
  color: #fff;
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.playhead-band {
  z-index: 3;
  border-top: 2px solid var(--teal);
  animation: scanGlow 900ms ease;
}

.playhead-band span {
  left: auto;
  right: 12px;
  background: var(--teal);
}

.event-card {
  position: absolute;
  left: 10px;
  right: 10px;
  min-height: 58px;
  text-align: left;
  border: 1px solid rgba(130, 113, 94, 0.25);
  border-left: 3px solid var(--region-color);
  border-radius: 7px;
  background: rgba(255, 253, 248, 0.94);
  box-shadow: 0 9px 22px rgba(59, 45, 27, 0.08);
  padding: 9px 28px 8px 10px;
  color: var(--ink);
}

.event-card strong {
  display: block;
  font-size: 13px;
  line-height: 1.25;
  margin-bottom: 5px;
}

.event-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.event-card i {
  position: absolute;
  top: 8px;
  right: 9px;
  font-style: normal;
  color: #c9a047;
}

.event-card.is-selected {
  border-color: var(--red);
  box-shadow:
    0 0 0 1px rgba(184, 51, 45, 0.18),
    0 14px 30px rgba(184, 51, 45, 0.16);
}

.event-card.is-live {
  animation: livePulse 1200ms ease;
  border-color: color-mix(in srgb, var(--region-color), #ffffff 20%);
}

.empty-state {
  grid-column: 1 / -1;
  align-self: start;
  margin: 90px auto;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 7px;
  padding: 18px 22px;
  background: rgba(255, 253, 248, 0.86);
}

.detail-panel {
  border-left: 1px solid var(--line);
  padding: 24px;
  overflow: auto;
}

.detail-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}

.detail-head h2 {
  margin: 0 0 8px;
  font-family: Georgia, "Songti SC", "Noto Serif CJK SC", serif;
  font-size: 25px;
  line-height: 1.18;
  letter-spacing: 0;
}

.detail-head p {
  margin: 0;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.favorite-action {
  width: 38px;
  min-width: 38px;
  height: 38px;
  padding: 0;
  color: #c88a12;
}

.detail-tags,
.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.detail-tags {
  margin: 18px 0;
}

.detail-tags span {
  color: var(--red);
  border: 1px solid rgba(184, 51, 45, 0.28);
  background: rgba(184, 51, 45, 0.06);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 13px;
}

.detail-summary {
  margin: 0 0 20px;
  color: #3c332c;
  line-height: 1.8;
  font-size: 15px;
}

.meta-list {
  display: grid;
  gap: 12px;
  padding: 18px 0;
  margin: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.meta-list div {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 14px;
}

.meta-list dt {
  color: var(--muted);
}

.meta-list dd {
  margin: 0;
}

.chip-list {
  margin: 18px 0 22px;
}

.chip-list span {
  background: #f2ede3;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 5px 9px;
  font-size: 13px;
}

.detail-panel h3 {
  margin: 0 0 12px;
  font-size: 15px;
}

.related-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.related-list li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--region-color);
  border-radius: 7px;
  padding: 9px 10px;
  background: rgba(255, 253, 248, 0.72);
  font-size: 13px;
}

.related-list em {
  color: var(--muted);
  font-style: normal;
  white-space: nowrap;
}

.overview-pane {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 20px;
  padding: 14px 22px 18px;
  background: rgba(255, 253, 248, 0.82);
}

.overview-pane > div:first-child {
  display: grid;
  align-content: start;
  gap: 4px;
}

.overview-pane strong {
  font-size: 14px;
}

.overview-pane span {
  color: var(--muted);
  font-size: 12px;
}

.overview {
  display: grid;
  gap: 5px;
}

.overview-row {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 10px;
  align-items: center;
}

.overview-row > span {
  color: var(--ink);
  font-size: 12px;
  text-align: right;
}

.overview-row > div {
  height: 14px;
  position: relative;
  border-bottom: 1px solid var(--line);
}

.overview-row i {
  position: absolute;
  top: 6px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  transform: translateX(-50%);
}

@media (max-width: 1120px) {
  .topbar {
    grid-template-columns: 1fr;
    height: auto;
    gap: 12px;
    padding: 16px;
  }

  nav {
    overflow-x: auto;
  }

  .control-deck {
    grid-template-columns: 1fr;
    padding: 14px 16px;
  }

  .infographic-strip {
    grid-template-columns: 1fr 92px;
    padding: 12px 16px;
  }

  .story-stage {
    grid-template-columns: 1fr;
    padding: 12px 16px;
  }

  .category-mix-wrap {
    grid-template-columns: 1fr;
  }

  .category-mix-wrap > span {
    text-align: left;
  }

  .scrubber-wrap,
  .story-text,
  .activity-bars {
    grid-column: 1 / -1;
  }

  .activity-bars {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }

  .workbench {
    grid-template-columns: 86px minmax(0, 1fr);
  }

  .detail-panel {
    grid-column: 1 / -1;
    border-left: 0;
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 720px) {
  .brand {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .brand h1 {
    font-size: 26px;
  }

  .workbench {
    grid-template-columns: 1fr;
  }

  .year-pane {
    display: none;
  }

  .timeline-scroll {
    max-height: 560px;
  }

  .timeline {
    min-width: 760px;
  }

  .overview-pane {
    grid-template-columns: 1fr;
  }
}

@keyframes livePulse {
  0% {
    transform: translateY(-2px);
    box-shadow: 0 0 0 0 rgba(46, 133, 133, 0.2);
  }
  100% {
    transform: translateY(0);
    box-shadow: 0 9px 22px rgba(59, 45, 27, 0.08);
  }
}

@keyframes scanGlow {
  0% {
    box-shadow: 0 0 0 rgba(46, 133, 133, 0);
  }
  50% {
    box-shadow: 0 0 22px rgba(46, 133, 133, 0.28);
  }
  100% {
    box-shadow: 0 0 0 rgba(46, 133, 133, 0);
  }
}

@keyframes barPulse {
  from {
    transform: scaleX(0.4);
    transform-origin: left;
  }
  to {
    transform: scaleX(1);
    transform-origin: left;
  }
}

@keyframes pulseRing {
  from {
    opacity: 0.55;
    transform: scale(0.8);
  }
  to {
    opacity: 0;
    transform: scale(1.35);
  }
}

@keyframes flowIn {
  from {
    opacity: 0;
    transform: translateX(8px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes mixGrow {
  from {
    transform: scaleX(0);
    transform-origin: left;
  }
  to {
    transform: scaleX(1);
    transform-origin: left;
  }
}

/* Liquid Glass visual layer */
:root {
  --bg: #eef5ff;
  --paper: rgba(255, 255, 255, 0.52);
  --paper-2: rgba(245, 250, 255, 0.42);
  --ink: #152033;
  --muted: #657386;
  --line: rgba(92, 130, 170, 0.22);
  --line-soft: rgba(92, 130, 170, 0.14);
  --red: #ff4d68;
  --teal: #00b8d9;
  --amber: #ffb84d;
  --shadow: 0 22px 70px rgba(61, 92, 130, 0.18);
}

body {
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 255, 255, 0.95), transparent 18%),
    radial-gradient(circle at 80% 0%, rgba(0, 184, 217, 0.2), transparent 28%),
    radial-gradient(circle at 72% 76%, rgba(255, 77, 104, 0.16), transparent 24%),
    linear-gradient(135deg, #f7fbff 0%, #e9f3ff 42%, #f9f7ff 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(115deg, transparent 0 36%, rgba(255, 255, 255, 0.28) 42%, transparent 48%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.22) 1px, transparent 1px) 0 0 / 52px 52px,
    linear-gradient(0deg, rgba(255, 255, 255, 0.2) 1px, transparent 1px) 0 0 / 52px 52px;
  mix-blend-mode: soft-light;
}

.topbar,
.control-deck,
.infographic-strip,
.story-stage,
.overview-pane,
.timeline-meta,
.pane-title {
  background: rgba(255, 255, 255, 0.48);
  backdrop-filter: blur(28px) saturate(1.45);
  -webkit-backdrop-filter: blur(28px) saturate(1.45);
}

.year-stage,
.metric-card,
.story-text,
.activity-bars,
.category-mix-wrap,
.chapter-card,
.dominant-card,
.insight-card,
.milestone-wrap,
.region-pulse-map,
.event-flow,
.search-box,
select,
.nav-item,
.filter-button,
.timeline-meta button,
.favorite-action,
.detail-panel,
.year-pane,
.timeline-card,
.overview-pane,
.scrubber-wrap {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.74), rgba(255, 255, 255, 0.34)),
    rgba(255, 255, 255, 0.36);
  border: 1px solid rgba(255, 255, 255, 0.58);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    inset 0 -1px 0 rgba(42, 84, 130, 0.08),
    0 18px 48px rgba(48, 82, 120, 0.13);
  backdrop-filter: blur(26px) saturate(1.55);
  -webkit-backdrop-filter: blur(26px) saturate(1.55);
}

.brand h1 {
  color: #111827;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

.brand span,
.year-stage strong,
.chapter-card h2 {
  color: #007aff;
}

.nav-item.is-active,
.filter-button.is-active,
.category-all.is-active {
  color: #fff;
  background:
    linear-gradient(145deg, rgba(0, 122, 255, 0.92), rgba(0, 184, 217, 0.72)),
    rgba(0, 122, 255, 0.72);
  border-color: rgba(255, 255, 255, 0.72);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    0 14px 30px rgba(0, 122, 255, 0.22);
}

.play-button {
  color: #fff;
  background:
    linear-gradient(145deg, rgba(0, 122, 255, 0.96), rgba(88, 86, 214, 0.78)),
    rgba(0, 122, 255, 0.8);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    0 16px 36px rgba(0, 122, 255, 0.22);
}

.workbench {
  background: rgba(255, 255, 255, 0.2);
}

.timeline-scroll {
  max-height: calc(100vh - 246px);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.3), transparent 30%),
    rgba(255, 255, 255, 0.18);
}

.lane {
  border-right: 1px solid rgba(92, 130, 170, 0.18);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.24), transparent 44%),
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 92px,
      rgba(92, 130, 170, 0.13) 93px
    );
}

.lane header {
  color: #fff;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--region-color), #ffffff 18%), var(--region-color));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.34),
    0 6px 18px rgba(61, 92, 130, 0.12);
}

.event-card {
  min-height: 62px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.48)),
    rgba(255, 255, 255, 0.52);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-left: 4px solid var(--region-color);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    0 12px 30px rgba(48, 82, 120, 0.16);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
}

.event-card.is-offset::before {
  content: "";
  position: absolute;
  left: 11px;
  bottom: 100%;
  width: 1px;
  height: var(--stem-offset, 18px);
  background: linear-gradient(to top, color-mix(in srgb, var(--region-color), transparent 18%), transparent);
}

.event-card.is-selected {
  border-color: rgba(0, 122, 255, 0.72);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 0 0 2px rgba(0, 122, 255, 0.16),
    0 18px 42px rgba(0, 122, 255, 0.22);
}

.selected-band {
  border-top-color: rgba(255, 77, 104, 0.7);
}

.selected-band span {
  background: rgba(255, 77, 104, 0.9);
  box-shadow: 0 10px 24px rgba(255, 77, 104, 0.24);
}

.playhead-band {
  border-top-color: rgba(0, 184, 217, 0.85);
}

.playhead-band span {
  background: rgba(0, 184, 217, 0.92);
  box-shadow: 0 10px 24px rgba(0, 184, 217, 0.24);
}

.detail-summary,
.chapter-card p,
.insight-card p,
.story-text {
  color: #2f3b4f;
}

.detail-tags span,
.chip-list span {
  background: rgba(255, 255, 255, 0.5);
  border-color: rgba(255, 255, 255, 0.72);
}

.related-list li,
.flow-event {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.38)),
    rgba(255, 255, 255, 0.44);
  border-color: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.pulse-node {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.42)),
    rgba(255, 255, 255, 0.48);
  border-color: rgba(255, 255, 255, 0.72);
}

/* Liquid Glass v2: cleaner, denser, more Apple-like */
body {
  background:
    radial-gradient(circle at 18% -10%, rgba(255, 255, 255, 0.95), transparent 22%),
    radial-gradient(circle at 78% 6%, rgba(111, 202, 255, 0.28), transparent 28%),
    radial-gradient(circle at 40% 104%, rgba(123, 97, 255, 0.12), transparent 34%),
    linear-gradient(135deg, #f8fbff 0%, #edf6ff 45%, #f7faff 100%);
}

.app-shell {
  gap: 12px;
  padding-bottom: 18px;
}

.topbar {
  height: 70px;
  grid-template-columns: 270px minmax(340px, 1fr) 340px;
  margin: 0;
  border-bottom-color: rgba(117, 151, 190, 0.18);
  box-shadow: 0 10px 40px rgba(67, 112, 160, 0.08);
}

.brand h1 {
  font-size: 28px;
}

.brand span {
  font-weight: 650;
}

nav {
  justify-content: center;
}

.nav-item {
  min-width: 70px;
  font-weight: 700;
}

.search-box {
  min-height: 42px;
  border-radius: 12px;
}

.control-deck,
.infographic-strip,
.story-stage,
.workbench,
.overview-pane {
  margin-inline: 18px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 18px;
  overflow: hidden;
}

.control-deck {
  grid-template-columns: 260px minmax(360px, 1fr) minmax(360px, 1fr) 118px;
  margin-top: 0;
  padding: 14px 18px;
  box-shadow: 0 18px 60px rgba(67, 112, 160, 0.1);
}

.filter-button,
select,
.timeline-meta button,
.favorite-action,
.play-button {
  border-radius: 10px;
}

.filter-button {
  min-height: 34px;
  font-weight: 650;
}

.infographic-strip {
  grid-template-columns: 178px 86px minmax(250px, 1fr) 110px 130px minmax(340px, 1.2fr);
  padding: 12px 18px;
  gap: 12px;
  box-shadow: 0 18px 60px rgba(67, 112, 160, 0.1);
}

.year-stage,
.metric-card,
.story-text,
.activity-bars,
.category-mix-wrap,
.chapter-card,
.dominant-card,
.insight-card,
.milestone-wrap,
.region-pulse-map,
.event-flow,
.scrubber-wrap {
  border-radius: 14px;
}

.year-stage strong {
  font-size: 26px;
  letter-spacing: 0;
}

.play-button {
  font-size: 15px;
}

.activity-bars {
  padding: 9px 12px;
}

.category-mix-wrap {
  padding: 8px 12px;
}

.story-stage {
  grid-template-columns: 270px minmax(360px, 1fr) 160px minmax(260px, 0.86fr) minmax(300px, 1fr);
  padding: 14px 18px;
  gap: 12px;
  box-shadow: 0 18px 60px rgba(67, 112, 160, 0.1);
}

.chapter-card {
  padding: 16px 18px;
}

.chapter-card h2 {
  font-size: 25px;
}

.region-pulse-map {
  min-height: 128px;
}

.pulse-node {
  width: 54px;
  height: 54px;
}

.dominant-card,
.insight-card {
  min-height: 128px;
}

.event-flow {
  max-height: 128px;
}

.milestone-wrap {
  padding: 10px 14px 12px;
}

.milestone-rail {
  height: 100px;
}

.milestone-marker {
  top: calc(-6px + var(--level, 0) * 31px);
}

.workbench {
  grid-template-columns: 120px minmax(680px, 1fr) 330px;
  box-shadow: 0 24px 80px rgba(67, 112, 160, 0.14);
}

.year-pane,
.timeline-card,
.detail-panel {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.64), rgba(255, 255, 255, 0.34)),
    rgba(255, 255, 255, 0.34);
  backdrop-filter: blur(28px) saturate(1.55);
  -webkit-backdrop-filter: blur(28px) saturate(1.55);
}

.timeline-scroll {
  max-height: calc(100vh - 360px);
}

.timeline {
  min-width: 980px;
}

.lane header {
  height: 38px;
  font-size: 15px;
}

.event-card {
  left: 12px;
  right: 12px;
  min-height: 64px;
  border-radius: 12px;
  padding: 10px 30px 9px 12px;
}

.event-card strong {
  font-size: 13.5px;
  line-height: 1.22;
}

.event-card span {
  font-size: 12px;
}

.detail-panel {
  padding: 24px 24px 28px;
}

.detail-head h2 {
  font-size: 25px;
}

.detail-summary {
  font-size: 15px;
}

.overview-pane {
  padding: 14px 18px 16px;
  box-shadow: 0 18px 60px rgba(67, 112, 160, 0.1);
}

@media (max-width: 1120px) {
  .topbar,
  .control-deck,
  .infographic-strip,
  .story-stage,
  .workbench,
  .overview-pane {
    margin-inline: 12px;
  }

  .topbar {
    grid-template-columns: 1fr;
  }
}

/* Designer pass: timeline-first Apple-style composition */
.app-shell {
  gap: 10px;
}

.topbar {
  height: 64px;
  grid-template-columns: 260px minmax(340px, 1fr) 380px;
  padding-inline: 22px;
}

.control-deck {
  grid-template-columns: 260px minmax(420px, 1fr) minmax(420px, 1fr) 130px;
  padding: 10px 18px;
}

.range-control label,
.control-label {
  margin-bottom: 6px;
}

.infographic-strip {
  grid-template-columns: 178px 86px minmax(360px, 1fr) 110px 130px minmax(360px, 1.2fr);
  padding: 10px 18px;
  align-items: stretch;
}

.activity-bars,
.category-mix-wrap {
  display: none;
}

.year-stage,
.metric-card,
.story-text,
.scrubber-wrap {
  min-height: 70px;
}

.story-text {
  display: flex;
  align-items: center;
  font-size: 13.5px;
}

.story-stage {
  display: none;
}

.workbench {
  grid-template-columns: 128px minmax(760px, 1fr) 330px;
}

.timeline-scroll {
  max-height: calc(100vh - 236px);
}

.timeline-meta {
  height: 46px;
}

.overview-pane {
  display: none;
}

.event-card {
  border-radius: 10px;
}

.detail-panel {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.42)),
    rgba(255, 255, 255, 0.48);
}

.detail-head h2 {
  font-size: 24px;
  line-height: 1.15;
}

@media (max-width: 1120px) {
  .infographic-strip {
    grid-template-columns: 1fr 92px;
  }

  .story-text {
    grid-column: 1 / -1;
  }
}

/* Cyber command-center redesign */
:root {
  --bg: #030711;
  --paper: rgba(9, 18, 33, 0.78);
  --paper-2: rgba(12, 28, 48, 0.68);
  --ink: #eaf8ff;
  --muted: #82a0b7;
  --line: rgba(73, 214, 255, 0.24);
  --line-soft: rgba(73, 214, 255, 0.12);
  --red: #ff315f;
  --teal: #20f6d2;
  --amber: #ffd166;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.46);
}

body {
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 12%, rgba(32, 246, 210, 0.16), transparent 28%),
    radial-gradient(circle at 78% 8%, rgba(255, 49, 95, 0.15), transparent 24%),
    radial-gradient(circle at 52% 88%, rgba(78, 129, 255, 0.16), transparent 30%),
    linear-gradient(135deg, #030711 0%, #06111f 46%, #070a18 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(73, 214, 255, 0.075) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(0deg, rgba(73, 214, 255, 0.055) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(115deg, transparent 0 42%, rgba(32, 246, 210, 0.11) 45%, transparent 49%);
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.2));
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.025) 0,
    rgba(255, 255, 255, 0.025) 1px,
    transparent 1px,
    transparent 5px
  );
  opacity: 0.5;
}

.app-shell {
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
}

.topbar,
.control-deck,
.infographic-strip,
.workbench {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(73, 214, 255, 0.22);
  border-radius: 14px;
  background:
    linear-gradient(145deg, rgba(14, 29, 49, 0.9), rgba(5, 12, 24, 0.74)),
    rgba(7, 16, 30, 0.72);
  box-shadow:
    inset 0 1px 0 rgba(156, 233, 255, 0.16),
    0 0 0 1px rgba(32, 246, 210, 0.04),
    0 24px 90px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(24px) saturate(1.35);
  -webkit-backdrop-filter: blur(24px) saturate(1.35);
}

.topbar::before,
.control-deck::before,
.infographic-strip::before,
.workbench::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(32, 246, 210, 0.22), transparent 22%, transparent 78%, rgba(255, 49, 95, 0.16)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), transparent 38%);
  opacity: 0.62;
}

.topbar > *,
.control-deck > *,
.infographic-strip > *,
.workbench > * {
  position: relative;
  z-index: 1;
}

.topbar {
  height: 70px;
  grid-template-columns: 282px minmax(300px, 1fr) 360px;
  border-bottom: 1px solid rgba(73, 214, 255, 0.22);
  padding-inline: 20px;
}

.brand h1 {
  font-family: Inter, ui-sans-serif, system-ui, "PingFang SC", sans-serif;
  font-size: 28px;
  letter-spacing: 0;
  color: #ffffff;
  text-shadow: 0 0 24px rgba(32, 246, 210, 0.28);
}

.brand span {
  color: var(--teal);
  font-weight: 700;
}

.nav-item,
.filter-button,
.timeline-meta button,
.favorite-action {
  color: #ccecff;
  border-color: rgba(73, 214, 255, 0.22);
  background: rgba(7, 18, 32, 0.62);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.nav-item.is-active,
.filter-button.is-active,
.category-all.is-active {
  color: #04131f;
  border-color: rgba(32, 246, 210, 0.9);
  background: linear-gradient(135deg, #20f6d2, #54b7ff);
  box-shadow:
    0 0 18px rgba(32, 246, 210, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.38);
}

.nav-item:hover,
.filter-button:hover,
.timeline-meta button:hover,
.favorite-action:hover {
  border-color: rgba(32, 246, 210, 0.68);
  box-shadow: 0 0 18px rgba(32, 246, 210, 0.18);
}

.search-box,
select,
.year-stage,
.metric-card,
.story-text,
.scrubber-wrap,
.detail-panel,
.year-pane,
.timeline-card {
  color: var(--ink);
  border: 1px solid rgba(73, 214, 255, 0.22);
  background:
    linear-gradient(145deg, rgba(12, 28, 48, 0.82), rgba(5, 12, 24, 0.64)),
    rgba(7, 16, 30, 0.66);
  box-shadow:
    inset 0 1px 0 rgba(156, 233, 255, 0.14),
    0 18px 44px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(22px) saturate(1.3);
  -webkit-backdrop-filter: blur(22px) saturate(1.3);
}

.search-box input,
select {
  color: var(--ink);
}

.search-box input::placeholder {
  color: rgba(130, 160, 183, 0.72);
}

select {
  color-scheme: dark;
}

.control-deck {
  grid-template-columns: 220px minmax(360px, 1fr) minmax(360px, 1fr) 122px;
  padding: 12px 16px;
  gap: 12px;
}

.range-control label,
.control-label,
.year-stage span,
.metric-card span,
.scrubber-wrap span,
.pane-title,
.timeline-meta,
.detail-head p,
.meta-list dt,
.related-list em,
.chip-list span {
  color: var(--muted);
}

.filter-row {
  max-height: 76px;
  overflow: auto;
  padding-bottom: 2px;
}

.filter-button {
  min-height: 30px;
  border-radius: 8px;
  font-size: 12.5px;
}

.switch {
  color: #ccecff;
}

.switch span {
  background: rgba(73, 214, 255, 0.18);
  border: 1px solid rgba(73, 214, 255, 0.28);
}

.switch input:checked + span {
  background: var(--teal);
}

.infographic-strip {
  grid-template-columns: 178px 86px minmax(360px, 1.05fr) 108px 128px minmax(340px, 1fr);
  padding: 12px 16px;
  gap: 12px;
}

.year-stage,
.metric-card,
.story-text,
.scrubber-wrap {
  min-height: 72px;
  border-radius: 12px;
}

.year-stage strong {
  color: #ffffff;
  font-family: Inter, ui-sans-serif, system-ui, "PingFang SC", sans-serif;
  font-size: 26px;
  text-shadow: 0 0 22px rgba(32, 246, 210, 0.45);
}

.metric-card strong {
  color: var(--teal);
  text-shadow: 0 0 18px rgba(32, 246, 210, 0.45);
}

.play-button {
  border: 1px solid rgba(32, 246, 210, 0.55);
  border-radius: 12px;
  color: #021018;
  background:
    linear-gradient(135deg, rgba(32, 246, 210, 1), rgba(84, 183, 255, 0.95));
  box-shadow:
    0 0 22px rgba(32, 246, 210, 0.35),
    0 16px 36px rgba(0, 0, 0, 0.28);
}

.scrubber-wrap input {
  accent-color: var(--teal);
}

.story-text {
  color: #cfefff;
}

.story-stage,
.overview-pane,
.activity-bars,
.category-mix-wrap {
  display: none;
}

.workbench {
  grid-template-columns: 118px minmax(820px, 1fr) 340px;
  min-height: 0;
}

.year-pane,
.timeline-card,
.detail-panel {
  border-radius: 0;
  box-shadow: none;
}

.year-pane {
  min-height: 640px;
  border-right: 1px solid rgba(73, 214, 255, 0.2);
  overflow: hidden;
}

.pane-title,
.timeline-meta {
  height: 48px;
  border-bottom: 1px solid rgba(73, 214, 255, 0.18);
  background: rgba(3, 11, 21, 0.58);
}

.timeline-scroll {
  min-height: 642px;
  max-height: calc(100vh - 256px);
  scrollbar-color: rgba(32, 246, 210, 0.55) rgba(5, 12, 24, 0.7);
}

.year-ruler {
  will-change: transform;
}

.timeline {
  min-width: 1060px;
}

.lane {
  border-right: 1px solid rgba(73, 214, 255, 0.16);
  background:
    linear-gradient(90deg, rgba(32, 246, 210, 0.045), transparent 26%, transparent 74%, rgba(255, 49, 95, 0.035)),
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 104px,
      rgba(73, 214, 255, 0.13) 105px,
      transparent 106px
    );
}

.lane header {
  height: 40px;
  color: #ffffff;
  background:
    linear-gradient(90deg, rgba(3, 11, 21, 0.92), color-mix(in srgb, var(--region-color), #06111f 56%)),
    rgba(6, 18, 30, 0.9);
  border-bottom: 1px solid color-mix(in srgb, var(--region-color), transparent 35%);
  box-shadow:
    inset 0 -1px 0 rgba(255, 255, 255, 0.08),
    0 10px 28px rgba(0, 0, 0, 0.24);
  text-shadow: 0 0 14px color-mix(in srgb, var(--region-color), #ffffff 15%);
}

.selected-band {
  border-top: 1px dashed rgba(255, 49, 95, 0.88);
}

.playhead-band {
  border-top: 2px solid var(--teal);
  box-shadow: 0 0 24px rgba(32, 246, 210, 0.38);
}

.selected-band span,
.playhead-band span {
  border-radius: 8px;
  background: rgba(255, 49, 95, 0.92);
  box-shadow: 0 0 18px rgba(255, 49, 95, 0.3);
}

.playhead-band span {
  color: #04131f;
  background: var(--teal);
  box-shadow: 0 0 18px rgba(32, 246, 210, 0.45);
}

.event-card {
  left: 12px;
  right: 12px;
  min-height: 78px;
  border-radius: 12px;
  border: 1px solid rgba(73, 214, 255, 0.18);
  border-left: 3px solid var(--region-color);
  color: #eaf8ff;
  background:
    linear-gradient(145deg, rgba(14, 32, 52, 0.95), rgba(5, 12, 24, 0.86)),
    rgba(8, 20, 34, 0.9);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 0 1px rgba(32, 246, 210, 0.03),
    0 14px 28px rgba(0, 0, 0, 0.32);
  padding: 12px 30px 10px 12px;
}

.event-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(90deg, color-mix(in srgb, var(--region-color), transparent 72%), transparent 45%);
  opacity: 0.42;
}

.event-card strong,
.event-card span,
.event-card i {
  position: relative;
  z-index: 1;
}

.event-card strong {
  font-size: 13.5px;
  line-height: 1.28;
}

.event-card span {
  color: #91b4c9;
}

.event-card i {
  color: var(--amber);
}

.event-card.is-selected {
  border-color: var(--teal);
  box-shadow:
    0 0 0 1px rgba(32, 246, 210, 0.44),
    0 0 26px rgba(32, 246, 210, 0.25),
    0 18px 36px rgba(0, 0, 0, 0.38);
}

.event-card.is-live {
  border-color: color-mix(in srgb, var(--region-color), #ffffff 16%);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--region-color), transparent 52%),
    0 0 22px color-mix(in srgb, var(--region-color), transparent 66%),
    0 14px 28px rgba(0, 0, 0, 0.32);
}

.detail-panel {
  border-left: 1px solid rgba(73, 214, 255, 0.2);
  padding: 24px;
}

.detail-head h2 {
  color: #ffffff;
  font-family: Inter, ui-sans-serif, system-ui, "PingFang SC", sans-serif;
  font-size: 24px;
  line-height: 1.18;
  text-shadow: 0 0 18px rgba(32, 246, 210, 0.18);
}

.detail-tags span {
  color: #06111f;
  border-color: rgba(32, 246, 210, 0.55);
  background: linear-gradient(135deg, rgba(32, 246, 210, 0.92), rgba(84, 183, 255, 0.86));
}

.detail-summary,
.meta-list dd,
.related-list li {
  color: #d7efff;
}

.detail-summary {
  line-height: 1.75;
}

.meta-list {
  border-color: rgba(73, 214, 255, 0.18);
}

.chip-list span,
.related-list li,
.empty-state {
  color: #ccecff;
  border-color: rgba(73, 214, 255, 0.2);
  background: rgba(8, 22, 38, 0.68);
}

.related-list li {
  border-left-color: var(--region-color);
}

.year-tick {
  background: rgba(73, 214, 255, 0.12);
}

.year-tick span {
  color: #b7d9ee;
}

@media (max-width: 1120px) {
  .app-shell {
    padding: 10px;
  }

  .topbar,
  .control-deck,
  .infographic-strip,
  .workbench {
    margin-inline: 0;
  }

  .topbar,
  .control-deck,
  .infographic-strip {
    grid-template-columns: 1fr;
    height: auto;
  }

  .workbench {
    grid-template-columns: 88px minmax(0, 1fr);
  }

  .detail-panel {
    grid-column: 1 / -1;
  }
}

/* Image Gen inspired cinematic sci-fi pass */
:root {
  --cyan-glow: 0 0 22px rgba(32, 246, 210, 0.42), 0 0 72px rgba(32, 246, 210, 0.14);
  --pink-glow: 0 0 22px rgba(255, 49, 95, 0.34), 0 0 72px rgba(255, 49, 95, 0.12);
}

body {
  background:
    radial-gradient(circle at 50% -10%, rgba(65, 190, 255, 0.28), transparent 34%),
    radial-gradient(circle at 12% 20%, rgba(32, 246, 210, 0.2), transparent 26%),
    radial-gradient(circle at 88% 18%, rgba(255, 49, 95, 0.2), transparent 24%),
    radial-gradient(circle at 50% 110%, rgba(93, 88, 255, 0.2), transparent 34%),
    linear-gradient(135deg, #02040c 0%, #061321 45%, #030611 100%);
}

.app-shell {
  gap: 10px;
}

.brand::before {
  content: "";
  width: 34px;
  height: 34px;
  border: 1px solid rgba(32, 246, 210, 0.72);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(32, 246, 210, 0.95), transparent 46%),
    radial-gradient(circle at 70% 72%, rgba(255, 49, 95, 0.9), transparent 28%),
    rgba(8, 22, 38, 0.9);
  box-shadow: var(--cyan-glow);
}

.topbar,
.control-deck,
.infographic-strip,
.workbench,
.jump-dock {
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(13, 37, 61, 0.92), rgba(2, 7, 16, 0.78) 54%, rgba(18, 10, 28, 0.72)),
    rgba(3, 9, 18, 0.86);
  box-shadow:
    inset 0 1px 0 rgba(194, 246, 255, 0.18),
    inset 0 0 48px rgba(32, 246, 210, 0.045),
    0 26px 90px rgba(0, 0, 0, 0.54);
}

.topbar::after,
.control-deck::after,
.infographic-strip::after,
.workbench::after,
.jump-dock::after {
  content: "";
  position: absolute;
  inset: 1px;
  pointer-events: none;
  border-radius: inherit;
  background:
    linear-gradient(90deg, rgba(32, 246, 210, 0.2), transparent 16%, transparent 84%, rgba(255, 49, 95, 0.18)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), transparent 24%);
  mask: linear-gradient(#000, transparent 46%);
}

.topbar {
  height: 66px;
}

.control-deck {
  padding-block: 10px;
}

.infographic-strip {
  grid-template-columns: 180px 92px minmax(390px, 1.1fr) 116px 132px minmax(360px, 1fr);
  padding-block: 10px;
}

.year-stage,
.metric-card,
.story-text,
.scrubber-wrap,
.search-box,
select {
  border-radius: 14px;
  background:
    linear-gradient(145deg, rgba(18, 45, 70, 0.76), rgba(4, 11, 22, 0.62)),
    rgba(8, 20, 34, 0.78);
}

.year-stage {
  border-color: rgba(32, 246, 210, 0.46);
  box-shadow: var(--cyan-glow), inset 0 0 32px rgba(32, 246, 210, 0.06);
}

.play-button {
  text-transform: uppercase;
  letter-spacing: 0;
  box-shadow:
    0 0 26px rgba(32, 246, 210, 0.54),
    0 0 80px rgba(32, 246, 210, 0.16),
    0 16px 38px rgba(0, 0, 0, 0.34);
}

.workbench {
  grid-template-columns: 124px minmax(860px, 1fr) 360px;
  border-color: rgba(73, 214, 255, 0.3);
}

.year-pane {
  background:
    linear-gradient(180deg, rgba(32, 246, 210, 0.08), transparent 22%),
    rgba(3, 10, 20, 0.74);
}

.year-ruler::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  width: 2px;
  background: linear-gradient(to bottom, transparent, var(--teal), transparent);
  box-shadow: var(--cyan-glow);
}

.year-tick {
  background: linear-gradient(90deg, transparent 0, rgba(32, 246, 210, 0.52) 100%);
}

.year-tick span {
  right: 22px;
  color: #dffaff;
  text-shadow: 0 0 12px rgba(32, 246, 210, 0.48);
}

.timeline-card {
  position: relative;
  background:
    radial-gradient(circle at 50% 12%, rgba(32, 246, 210, 0.11), transparent 28%),
    linear-gradient(145deg, rgba(5, 16, 30, 0.9), rgba(3, 8, 16, 0.72));
}

.timeline-card::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 48px;
  bottom: 0;
  z-index: 0;
  width: 2px;
  transform: translateX(-50%);
  pointer-events: none;
  background: linear-gradient(to bottom, transparent, rgba(32, 246, 210, 0.86), rgba(255, 49, 95, 0.48), transparent);
  box-shadow: 0 0 28px rgba(32, 246, 210, 0.42);
}

.timeline-meta {
  position: relative;
  z-index: 3;
}

.timeline-scroll {
  position: relative;
  z-index: 1;
}

.lane {
  background:
    linear-gradient(90deg, rgba(32, 246, 210, 0.065), transparent 30%, transparent 70%, rgba(255, 49, 95, 0.045)),
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 96px,
      rgba(73, 214, 255, 0.18) 97px,
      transparent 99px
    ),
    radial-gradient(circle at 50% var(--scan-y, 20%), rgba(32, 246, 210, 0.09), transparent 20%);
}

.lane header {
  height: 42px;
  letter-spacing: 0;
}

.event-card {
  min-height: 88px;
  overflow: hidden;
  border-color: rgba(120, 230, 255, 0.28);
  background:
    radial-gradient(circle at 12% 22%, color-mix(in srgb, var(--region-color), transparent 58%), transparent 26%),
    linear-gradient(145deg, rgba(16, 42, 65, 0.94), rgba(3, 10, 20, 0.9)),
    rgba(8, 20, 34, 0.95);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 0 28px rgba(32, 246, 210, 0.035),
    0 18px 34px rgba(0, 0, 0, 0.42);
}

.event-card::after {
  content: "";
  position: absolute;
  top: -40%;
  right: -24%;
  width: 92px;
  height: 92px;
  border: 1px solid color-mix(in srgb, var(--region-color), transparent 38%);
  border-radius: 50%;
  background:
    linear-gradient(90deg, transparent 49%, rgba(255, 255, 255, 0.12) 50%, transparent 51%),
    linear-gradient(0deg, transparent 49%, rgba(255, 255, 255, 0.12) 50%, transparent 51%);
  opacity: 0.6;
}

.event-card em {
  position: relative;
  z-index: 1;
  display: inline-flex;
  width: fit-content;
  margin-bottom: 6px;
  padding: 2px 6px;
  border: 1px solid color-mix(in srgb, var(--region-color), #ffffff 22%);
  border-radius: 999px;
  color: color-mix(in srgb, var(--region-color), #ffffff 26%);
  background: rgba(255, 255, 255, 0.045);
  font-size: 10.5px;
  font-style: normal;
}

.event-card.is-selected {
  transform: translateX(2px);
  box-shadow:
    0 0 0 1px rgba(32, 246, 210, 0.64),
    0 0 34px rgba(32, 246, 210, 0.36),
    0 22px 44px rgba(0, 0, 0, 0.5);
}

.event-card.is-live {
  animation: livePulse 1.8s ease infinite alternate;
}

.detail-panel {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 16%, color-mix(in srgb, var(--region-color), transparent 72%), transparent 30%),
    linear-gradient(145deg, rgba(12, 31, 52, 0.9), rgba(3, 8, 16, 0.8));
}

.detail-orbit {
  position: relative;
  height: 148px;
  margin-bottom: 20px;
  border: 1px solid rgba(73, 214, 255, 0.2);
  border-radius: 16px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--region-color), transparent 64%), transparent 28%),
    linear-gradient(90deg, rgba(73, 214, 255, 0.06) 1px, transparent 1px) 0 0 / 26px 26px,
    linear-gradient(0deg, rgba(73, 214, 255, 0.05) 1px, transparent 1px) 0 0 / 26px 26px,
    rgba(2, 8, 16, 0.5);
}

.detail-orbit::before,
.detail-orbit::after,
.detail-orbit span,
.detail-orbit b {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.detail-orbit::before {
  width: 108px;
  height: 108px;
  border: 1px solid color-mix(in srgb, var(--region-color), #ffffff 12%);
  box-shadow: 0 0 28px color-mix(in srgb, var(--region-color), transparent 58%);
}

.detail-orbit::after {
  width: 62px;
  height: 62px;
  border: 1px dashed rgba(32, 246, 210, 0.7);
  animation: orbitSpin 8s linear infinite;
}

.detail-orbit span {
  width: 16px;
  height: 16px;
  background: var(--teal);
  box-shadow: var(--cyan-glow);
}

.detail-orbit b {
  width: 170px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--teal), transparent);
  animation: orbitSweep 3.6s ease-in-out infinite;
}

.detail-head h2 {
  font-size: 25px;
}

.jump-dock {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 160px repeat(8, minmax(74px, 1fr));
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid rgba(73, 214, 255, 0.22);
}

.dock-title {
  display: grid;
  gap: 2px;
}

.dock-title span {
  color: var(--muted);
  font-size: 11px;
}

.dock-title strong {
  color: #ffffff;
  font-size: 13px;
  text-transform: uppercase;
}

.jump-year {
  min-height: 34px;
  border: 1px solid rgba(73, 214, 255, 0.22);
  border-radius: 10px;
  color: #dffaff;
  background: rgba(7, 18, 32, 0.66);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.jump-year:hover {
  color: #04131f;
  border-color: rgba(32, 246, 210, 0.8);
  background: linear-gradient(135deg, rgba(32, 246, 210, 0.95), rgba(84, 183, 255, 0.9));
  box-shadow: var(--cyan-glow);
}

@keyframes orbitSpin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

@keyframes orbitSweep {
  0%,
  100% {
    transform: translate(-50%, -50%) rotate(-18deg);
    opacity: 0.45;
  }
  50% {
    transform: translate(-50%, -50%) rotate(24deg);
    opacity: 1;
  }
}

@media (max-width: 1120px) {
  .jump-dock {
    grid-template-columns: repeat(4, 1fr);
  }

  .dock-title {
    grid-column: 1 / -1;
  }
}

/* Concept fidelity pass: cinematic cockpit layout */
body {
  overflow: hidden;
}

body::before {
  background:
    linear-gradient(90deg, rgba(32, 246, 210, 0.09) 1px, transparent 1px) 0 0 / 72px 72px,
    linear-gradient(0deg, rgba(32, 246, 210, 0.06) 1px, transparent 1px) 0 0 / 72px 72px,
    url("./concept-cyber-timeline.png") center / cover no-repeat;
  opacity: 0.18;
  mix-blend-mode: screen;
  mask-image: radial-gradient(circle at 50% 48%, #000 0 42%, transparent 82%);
}

.app-shell {
  height: 100vh;
  min-height: 760px;
  grid-template-rows: 58px 74px minmax(0, 1fr) 70px;
  padding: 0;
  gap: 0;
  background:
    linear-gradient(180deg, rgba(2, 7, 15, 0.5), transparent 18%, rgba(2, 5, 12, 0.82)),
    radial-gradient(circle at 52% 44%, rgba(32, 246, 210, 0.13), transparent 28%);
}

.topbar,
.control-deck,
.infographic-strip,
.workbench,
.jump-dock {
  margin: 0;
  border-radius: 0;
  border-left: 0;
  border-right: 0;
}

.topbar {
  height: 58px;
  grid-template-columns: 310px minmax(520px, 1fr) 360px;
  padding-inline: 28px;
  border-top: 0;
  background:
    linear-gradient(90deg, rgba(2, 10, 20, 0.98), rgba(7, 20, 34, 0.86), rgba(2, 10, 20, 0.98));
}

.brand h1 {
  font-size: 31px;
  color: #78faff;
  text-shadow:
    0 0 12px rgba(32, 246, 210, 0.7),
    0 0 34px rgba(32, 246, 210, 0.35);
}

.brand span {
  color: rgba(188, 229, 255, 0.7);
}

nav {
  justify-content: center;
}

.nav-item {
  min-width: 112px;
  min-height: 42px;
  border-radius: 0;
  border-color: rgba(73, 214, 255, 0.18);
  clip-path: polygon(12px 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 12px 100%, 0 50%);
}

.search-box {
  min-height: 38px;
  border-radius: 8px;
}

.control-deck {
  grid-template-columns: 230px minmax(380px, 1fr) minmax(380px, 1fr) 130px;
  padding: 8px 28px;
  background: rgba(3, 10, 20, 0.74);
  border-bottom-color: rgba(73, 214, 255, 0.18);
}

.range-control label,
.control-label {
  margin-bottom: 5px;
  font-size: 11px;
  text-transform: uppercase;
}

.filter-row {
  max-height: 34px;
  flex-wrap: nowrap;
}

.filter-button {
  flex: 0 0 auto;
  min-height: 28px;
  border-radius: 7px;
}

.infographic-strip {
  position: absolute;
  left: 148px;
  right: 386px;
  top: 136px;
  z-index: 6;
  display: grid;
  grid-template-columns: 150px 78px minmax(260px, 1fr) 100px 118px;
  padding: 0;
  gap: 12px;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.infographic-strip::before,
.infographic-strip::after {
  display: none;
}

.story-text {
  grid-column: 1 / -1;
  min-height: 38px;
  padding: 8px 12px;
  border-color: rgba(32, 246, 210, 0.22);
  color: rgba(215, 244, 255, 0.72);
  font-size: 12px;
}

.year-stage,
.metric-card,
.scrubber-wrap {
  min-height: 58px;
  border-radius: 4px;
  background: rgba(2, 12, 24, 0.68);
}

.year-stage strong {
  font-size: 22px;
}

.play-button {
  min-height: 58px;
  border-radius: 999px;
  font-size: 0;
}

.play-button::before {
  content: "";
  width: 18px;
  height: 18px;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
  background: #021018;
}

.workbench {
  grid-row: 3;
  grid-template-columns: 134px minmax(760px, 1fr) 380px;
  min-height: 0;
  border-top: 1px solid rgba(73, 214, 255, 0.12);
  border-bottom: 1px solid rgba(73, 214, 255, 0.22);
  background:
    radial-gradient(circle at 10% 50%, rgba(32, 246, 210, 0.14), transparent 22%),
    radial-gradient(circle at 76% 50%, rgba(255, 49, 95, 0.08), transparent 24%),
    rgba(1, 7, 16, 0.72);
}

.year-pane {
  min-height: 0;
  padding-top: 48px;
  background:
    linear-gradient(90deg, rgba(32, 246, 210, 0.1), rgba(3, 10, 20, 0.72));
}

.pane-title {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 4;
  height: 48px;
  padding-left: 28px;
  color: #8dfaff;
  background: rgba(2, 8, 16, 0.82);
}

.year-ruler {
  height: var(--timeline-height, 980px);
}

.year-ruler::before {
  right: 22px;
  width: 5px;
  background:
    radial-gradient(circle, #e9ffff 0 18%, var(--teal) 22% 48%, transparent 54%),
    linear-gradient(to bottom, transparent, var(--teal), transparent);
  background-size: 100% 92px, 100% 100%;
}

.year-tick {
  width: calc(100% - 22px);
}

.year-tick span {
  right: 44px;
  font-size: 14px;
}

.timeline-card {
  min-height: 0;
  border-left: 1px solid rgba(73, 214, 255, 0.12);
  border-right: 1px solid rgba(73, 214, 255, 0.18);
}

.timeline-meta {
  height: 48px;
  padding-inline: 18px;
  background: rgba(1, 8, 17, 0.86);
}

.timeline-meta span {
  color: #7dfaff;
  font-size: 18px;
  font-weight: 800;
}

.timeline-scroll {
  height: calc(100vh - 202px);
  min-height: 548px;
  max-height: none;
}

.timeline {
  min-width: 1060px;
}

.lanes {
  gap: 0;
}

.lane {
  border-right-color: rgba(73, 214, 255, 0.14);
  background:
    linear-gradient(90deg, transparent, rgba(32, 246, 210, 0.04) 50%, transparent),
    repeating-linear-gradient(to bottom, transparent 0, transparent 112px, rgba(73, 214, 255, 0.16) 113px, transparent 115px);
}

.lane header {
  top: 0;
  height: 52px;
  color: color-mix(in srgb, var(--region-color), #ffffff 50%);
  font-size: 19px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--region-color), transparent 58%), rgba(2, 8, 16, 0.92)),
    rgba(2, 8, 16, 0.88);
}

.event-card {
  left: 16px;
  right: 16px;
  min-height: 96px;
  border-radius: 7px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.055), transparent 34%),
    radial-gradient(circle at 80% 22%, rgba(255, 255, 255, 0.12), transparent 28%),
    url("./concept-cyber-timeline.png") center / 1800px auto no-repeat,
    linear-gradient(145deg, rgba(10, 34, 54, 0.96), rgba(3, 9, 18, 0.9));
  background-blend-mode: screen, screen, soft-light, normal;
  opacity: 0.94;
}

.event-card strong {
  font-size: 15px;
}

.event-card span {
  color: #75daf4;
  font-size: 13px;
}

.selected-band,
.playhead-band {
  z-index: 6;
}

.selected-band {
  border-top-color: rgba(255, 49, 95, 0.95);
  box-shadow: var(--pink-glow);
}

.playhead-band {
  border-top-width: 3px;
}

.detail-panel {
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(3, 15, 28, 0.9), rgba(2, 7, 15, 0.94)),
    rgba(2, 7, 15, 0.94);
}

.detail-orbit {
  height: 186px;
  background:
    radial-gradient(circle at 64% 44%, color-mix(in srgb, var(--region-color), transparent 44%), transparent 18%),
    url("./concept-cyber-timeline.png") 84% 36% / 1120px auto no-repeat,
    linear-gradient(90deg, rgba(73, 214, 255, 0.08) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(0deg, rgba(73, 214, 255, 0.06) 1px, transparent 1px) 0 0 / 24px 24px,
    rgba(2, 8, 16, 0.8);
  background-blend-mode: screen, soft-light, normal, normal, normal;
}

.detail-head h2 {
  font-size: 31px;
  color: #ffffff;
}

.detail-summary {
  font-size: 14px;
}

.jump-dock {
  grid-row: 4;
  grid-template-columns: 260px repeat(8, minmax(86px, 1fr));
  padding: 12px 52px;
  border-top: 1px solid rgba(73, 214, 255, 0.26);
  background:
    linear-gradient(90deg, rgba(2, 8, 16, 0.96), rgba(6, 20, 34, 0.9), rgba(2, 8, 16, 0.96));
}

.dock-title strong {
  color: #7dfaff;
}

.jump-year {
  clip-path: polygon(12px 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 12px 100%, 0 50%);
  border-radius: 0;
}

@media (max-width: 1120px) {
  body {
    overflow: auto;
  }

  .app-shell {
    height: auto;
    min-height: 100vh;
    grid-template-rows: auto auto auto auto;
  }

  .infographic-strip {
    position: relative;
    left: auto;
    right: auto;
    top: auto;
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .workbench {
    grid-template-columns: 90px minmax(0, 1fr);
  }

  .timeline-scroll {
    height: 620px;
  }

  .jump-dock {
    grid-template-columns: repeat(2, 1fr);
    padding: 12px;
  }
}

/* Overlap fix: keep the HUD console in layout flow */
.app-shell {
  grid-template-rows: 58px 74px 76px minmax(0, 1fr) 70px;
}

.infographic-strip {
  position: relative;
  left: auto;
  right: auto;
  top: auto;
  z-index: 3;
  grid-row: 3;
  grid-template-columns: 164px 74px minmax(320px, 1fr) 104px 122px minmax(240px, 0.8fr);
  align-items: stretch;
  padding: 8px 28px;
  border-top: 1px solid rgba(73, 214, 255, 0.16);
  border-bottom: 1px solid rgba(73, 214, 255, 0.16);
  background:
    linear-gradient(90deg, rgba(2, 8, 16, 0.94), rgba(7, 22, 38, 0.76), rgba(2, 8, 16, 0.94));
  box-shadow:
    inset 0 1px 0 rgba(194, 246, 255, 0.12),
    0 12px 40px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
}

.infographic-strip::before,
.infographic-strip::after {
  display: block;
}

.year-stage,
.metric-card,
.scrubber-wrap,
.story-text {
  min-height: 58px;
}

.story-text {
  grid-column: auto;
  display: flex;
  align-items: center;
  overflow: hidden;
  max-height: 58px;
  margin: 0;
}

.workbench {
  grid-row: 4;
}

.timeline-scroll {
  height: calc(100vh - 336px);
  min-height: 420px;
}

.jump-dock {
  grid-row: 5;
}

@media (max-width: 1120px) {
  .app-shell {
    grid-template-rows: auto auto auto auto auto;
  }

  .infographic-strip {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .story-text {
    grid-column: 1 / -1;
  }

  .timeline-scroll {
    height: 620px;
  }
}

/* Country bazi and epic event background pass */
.detail-panel {
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(32, 246, 210, 0.55) rgba(2, 8, 16, 0.6);
}

.detail-panel::-webkit-scrollbar {
  width: 8px;
}

.detail-panel::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(32, 246, 210, 0.8), rgba(255, 49, 95, 0.55));
}

.epic-panel,
.country-chart-panel {
  position: relative;
  margin: 16px 0;
  padding: 14px;
  border: 1px solid rgba(73, 214, 255, 0.22);
  border-radius: 8px;
  overflow: hidden;
  background:
    radial-gradient(circle at 88% 12%, color-mix(in srgb, var(--region-color), transparent 58%), transparent 26%),
    linear-gradient(135deg, rgba(7, 25, 42, 0.92), rgba(2, 8, 16, 0.82));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 14px 34px rgba(0, 0, 0, 0.28);
}

.epic-panel::before,
.country-chart-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(32, 246, 210, 0.06) 1px, transparent 1px) 0 0 / 18px 18px,
    linear-gradient(0deg, rgba(32, 246, 210, 0.04) 1px, transparent 1px) 0 0 / 18px 18px;
  mask-image: linear-gradient(120deg, #000 0 34%, transparent 78%);
}

.epic-panel > *,
.country-chart-panel > * {
  position: relative;
  z-index: 1;
}

.epic-panel > span,
.country-chart-head span {
  display: block;
  color: #7dfaff;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.epic-panel h3 {
  margin: 7px 0 8px;
  color: #fff;
  font-size: 18px;
  line-height: 1.2;
}

.epic-panel p {
  margin: 0 0 10px;
  color: rgba(219, 244, 255, 0.78);
  font-size: 13px;
  line-height: 1.55;
}

.epic-panel div {
  display: grid;
  gap: 8px;
  padding-left: 12px;
  border-left: 2px solid color-mix(in srgb, var(--region-color), #20f6d2 42%);
}

.epic-panel strong,
.epic-panel em {
  display: block;
  color: rgba(242, 250, 255, 0.86);
  font-size: 12.5px;
  font-style: normal;
  font-weight: 600;
  line-height: 1.5;
}

.epic-panel em {
  color: rgba(161, 213, 232, 0.8);
  font-weight: 500;
}

.country-chart-head {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
}

.country-chart-head strong {
  color: #fff;
  font-size: 24px;
  line-height: 1;
  text-shadow: 0 0 18px rgba(32, 246, 210, 0.35);
}

.country-chart-head em {
  color: rgba(188, 229, 255, 0.76);
  font-size: 12px;
  font-style: normal;
}

.country-rail {
  display: flex;
  gap: 8px;
  margin: 0 -2px 12px;
  padding: 2px 2px 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.country-rail::-webkit-scrollbar {
  display: none;
}

.country-mini-card {
  flex: 0 0 88px;
  min-height: 54px;
  padding: 7px 8px;
  border: 1px solid rgba(73, 214, 255, 0.18);
  border-radius: 7px;
  color: rgba(218, 242, 255, 0.82);
  text-align: left;
  background: rgba(2, 12, 24, 0.72);
}

.country-mini-card span {
  display: block;
  color: rgba(125, 250, 255, 0.74);
  font-size: 11px;
}

.country-mini-card strong {
  display: block;
  margin-top: 5px;
  color: #fff;
  font-size: 13px;
}

.country-mini-card.is-active,
.country-mini-card:hover {
  border-color: rgba(32, 246, 210, 0.8);
  background: linear-gradient(135deg, rgba(32, 246, 210, 0.2), rgba(84, 183, 255, 0.1));
  box-shadow: 0 0 22px rgba(32, 246, 210, 0.2);
}

.bazi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.bazi-card {
  min-width: 0;
  padding: 10px 6px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 7px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 0, rgba(32, 246, 210, 0.18), transparent 58%),
    rgba(4, 16, 29, 0.78);
}

.bazi-card span {
  color: rgba(188, 229, 255, 0.76);
  font-size: 10px;
}

.bazi-card strong {
  display: block;
  margin: 4px 0;
  color: #fff;
  font-size: 22px;
  line-height: 1;
}

.bazi-card em {
  display: block;
  overflow-wrap: anywhere;
  color: #7dfaff;
  font-size: 10px;
  font-style: normal;
}

.element-matrix {
  display: grid;
  gap: 7px;
  margin: 13px 0;
}

.element-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 8px;
  color: rgba(226, 246, 255, 0.82);
  font-size: 12px;
}

.element-row b {
  height: 7px;
  border-radius: 999px;
  background:
    linear-gradient(90deg, rgba(32, 246, 210, 0.95), rgba(255, 49, 95, 0.72)) left / calc(var(--size) * 100%) 100% no-repeat,
    rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 14px rgba(32, 246, 210, 0.22);
}

.element-row em {
  color: #fff;
  font-style: normal;
  text-align: right;
}

.country-attrs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 10px 0;
}

.country-attrs div {
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(73, 214, 255, 0.14);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.035);
}

.country-attrs dt {
  color: rgba(188, 229, 255, 0.64);
  font-size: 10.5px;
}

.country-attrs dd {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
  color: #fff;
  font-size: 12px;
}

.country-reading {
  margin: 10px 0 12px;
  color: rgba(219, 244, 255, 0.82);
  font-size: 12.5px;
  line-height: 1.55;
}

@media (max-width: 1120px) {
  .bazi-grid,
  .country-attrs {
    grid-template-columns: 1fr 1fr;
  }
}

/* Final responsive layer: keep the sci-fi composition readable on every viewport. */
html {
  overflow-x: hidden;
}

.app-shell,
.topbar,
.control-deck,
.infographic-strip,
.story-stage,
.workbench,
.jump-dock,
.overview-pane {
  width: 100%;
  max-width: 100vw;
}

.brand,
nav,
.search-box,
.range-control,
.control-deck > div,
.scrubber-wrap,
.story-text,
.timeline-card,
.detail-panel,
.chapter-card,
.dominant-card,
.insight-card,
.milestone-wrap,
.event-flow,
.overview-pane {
  min-width: 0;
}

.brand h1,
.brand span,
.nav-item,
.filter-button,
.timeline-meta,
.timeline-meta button,
.story-text,
.chapter-card p,
.insight-card p,
.detail-panel,
.event-card strong,
.event-card span,
.country-reading {
  overflow-wrap: anywhere;
}

.timeline-scroll,
.event-flow,
.detail-panel,
.overview {
  -webkit-overflow-scrolling: touch;
}

@media (min-width: 1440px) {
  .topbar,
  .control-deck,
  .infographic-strip,
  .story-stage,
  .jump-dock,
  .overview-pane {
    padding-left: clamp(28px, 4vw, 72px);
    padding-right: clamp(28px, 4vw, 72px);
  }

  .workbench {
    grid-template-columns: 128px minmax(760px, 1fr) minmax(340px, 24vw);
  }

  .timeline {
    min-width: min(1180px, calc(100vw - 560px));
  }
}

@media (max-width: 1280px) {
  .topbar {
    grid-template-columns: minmax(190px, 0.8fr) minmax(300px, 1fr) minmax(220px, 0.9fr);
    gap: 14px;
    padding-inline: 18px;
  }

  nav {
    flex-wrap: wrap;
    justify-content: center;
  }

  .control-deck {
    grid-template-columns: minmax(220px, 0.8fr) minmax(300px, 1fr) minmax(300px, 1fr) auto;
    gap: 12px;
    padding-inline: 18px;
  }

  .infographic-strip {
    grid-template-columns: minmax(170px, 0.7fr) 84px minmax(280px, 1.1fr) repeat(2, minmax(112px, 0.55fr));
    padding-inline: 18px;
  }

  .story-text {
    grid-column: 1 / -1;
  }

  .story-stage {
    grid-template-columns: minmax(220px, 0.9fr) minmax(330px, 1.25fr) minmax(150px, 0.55fr) minmax(260px, 1fr);
    padding-inline: 18px;
  }

  .event-flow {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(240px, 1fr));
    max-height: none;
  }

  .workbench {
    grid-template-columns: 104px minmax(620px, 1fr) minmax(300px, 0.44fr);
  }
}

@media (max-width: 1120px) {
  body {
    overflow-x: hidden;
  }

  .topbar {
    height: auto;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    gap: 12px;
    padding: 16px;
  }

  .brand {
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .brand h1 {
    font-size: clamp(26px, 4vw, 34px);
  }

  nav {
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .nav-item {
    flex: 0 0 auto;
  }

  .search-box {
    width: 100%;
  }

  .control-deck {
    grid-template-columns: minmax(220px, 0.8fr) minmax(0, 1fr);
    align-items: start;
    padding: 14px 16px;
  }

  .switch {
    justify-content: flex-start;
  }

  .filter-row {
    max-height: 86px;
    overflow: auto;
    padding-bottom: 2px;
  }

  .infographic-strip {
    grid-template-columns: minmax(160px, 0.7fr) 84px minmax(260px, 1fr) minmax(110px, 0.45fr);
    padding: 14px 16px;
  }

  .metric-card:nth-of-type(3) {
    grid-column: span 1;
  }

  .story-text {
    grid-column: 1 / -1;
  }

  .activity-bars {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
    max-height: 158px;
    overflow: auto;
  }

  .story-stage {
    grid-template-columns: minmax(230px, 0.8fr) minmax(320px, 1.2fr) minmax(230px, 0.8fr);
    padding: 14px 16px;
  }

  .dominant-card,
  .insight-card {
    min-height: 132px;
  }

  .event-flow {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }

  .milestone-rail {
    overflow-x: auto;
    min-width: 760px;
  }

  .milestone-wrap {
    overflow: hidden;
  }

  .workbench {
    grid-template-columns: 92px minmax(0, 1fr);
  }

  .detail-panel {
    grid-column: 1 / -1;
    border-top: 1px solid var(--line);
    border-left: 0;
    max-height: none;
  }

  .timeline-scroll {
    max-height: min(68vh, 760px);
  }

  .timeline {
    min-width: max(780px, calc(var(--lane-count, 7) * 132px));
  }
}

@media (max-width: 820px) {
  .topbar,
  .control-deck,
  .infographic-strip,
  .story-stage,
  .jump-dock,
  .overview-pane {
    padding-left: 12px;
    padding-right: 12px;
  }

  .brand {
    display: grid;
    justify-items: start;
  }

  .brand span {
    white-space: normal;
  }

  nav {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    justify-content: start;
  }

  .control-deck {
    grid-template-columns: 1fr;
  }

  .filter-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    max-height: none;
  }

  .filter-button {
    flex: 0 0 auto;
  }

  .infographic-strip {
    grid-template-columns: 1fr 96px;
  }

  .year-stage,
  .scrubber-wrap,
  .story-text,
  .activity-bars,
  .category-mix-wrap {
    grid-column: 1 / -1;
  }

  .metric-card {
    min-height: 72px;
  }

  .play-button {
    min-height: 72px;
  }

  .activity-bars {
    grid-template-columns: 1fr;
  }

  .category-mix-wrap {
    grid-template-columns: 1fr;
  }

  .category-mix-wrap > span {
    text-align: left;
  }

  .story-stage {
    grid-template-columns: 1fr;
  }

  .region-pulse-map {
    min-height: 210px;
  }

  .event-flow {
    grid-template-columns: 1fr;
    max-height: 260px;
  }

  .milestone-wrap {
    overflow-x: auto;
  }

  .workbench {
    grid-template-columns: minmax(0, 1fr);
  }

  .year-pane {
    display: none;
  }

  .timeline-meta {
    height: auto;
    min-height: 52px;
    align-items: flex-start;
    gap: 10px;
    flex-direction: column;
    padding: 10px 12px;
  }

  .timeline-meta div {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
  }

  .timeline-meta button {
    width: 100%;
    padding-inline: 6px;
    white-space: normal;
  }

  .timeline-scroll {
    min-height: 560px;
    max-height: 66vh;
  }

  .timeline {
    min-width: max(720px, calc(var(--lane-count, 7) * 118px));
  }

  .lanes {
    grid-template-columns: repeat(var(--lane-count), minmax(118px, 1fr));
  }

  .event-card {
    left: 7px;
    right: 7px;
    min-height: 62px;
    padding: 8px 24px 8px 8px;
  }

  .event-card strong {
    font-size: 12px;
  }

  .event-card span {
    font-size: 11px;
  }

  .detail-panel {
    padding: 16px 14px;
  }

  .detail-head {
    display: grid;
  }

  .country-attrs,
  .bazi-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  body {
    min-width: 320px;
  }

  .topbar {
    padding-top: 12px;
  }

  .brand h1 {
    font-size: 27px;
  }

  .nav-item,
  .filter-button,
  .timeline-meta button,
  .favorite-action {
    min-height: 36px;
    padding-inline: 10px;
    font-size: 12px;
  }

  .search-box {
    min-height: 42px;
  }

  .infographic-strip {
    grid-template-columns: 1fr;
  }

  .play-button {
    min-height: 46px;
  }

  .year-stage strong {
    font-size: 24px;
  }

  .metric-card strong {
    font-size: 20px;
  }

  .timeline-meta div {
    grid-template-columns: 1fr 1fr;
  }

  .timeline-scroll {
    min-height: 540px;
    max-height: 64vh;
  }

  .timeline {
    min-width: max(660px, calc(var(--lane-count, 7) * 106px));
  }

  .lanes {
    grid-template-columns: repeat(var(--lane-count), minmax(106px, 1fr));
  }

  .selected-band span,
  .playhead-band span {
    max-width: 128px;
    white-space: normal;
    line-height: 1.2;
  }

  .jump-dock {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dock-title {
    grid-column: 1 / -1;
  }

  .overview-pane {
    display: grid;
    gap: 12px;
  }
}

:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
}

.detail-layers {
  display: grid;
  gap: 10px;
  margin: 16px 0;
}

.detail-layers article,
.connection-card,
.same-era-card {
  border: 1px solid rgba(73, 214, 255, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(9, 31, 49, 0.9), rgba(3, 12, 24, 0.78)),
    rgba(3, 12, 24, 0.88);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.detail-layers article {
  padding: 12px;
}

.detail-layers span,
.connection-panel h3,
.same-era-panel h3 {
  color: #7dfaff;
  font-size: 12px;
  letter-spacing: 0;
}

.detail-layers p {
  margin: 7px 0 0;
  color: #d7ecf4;
  font-size: 13px;
  line-height: 1.7;
}

.people-layer ul {
  display: grid;
  gap: 8px;
  padding: 0;
  margin: 9px 0 0;
  list-style: none;
}

.people-layer li {
  display: grid;
  gap: 3px;
}

.people-layer strong {
  color: #ffffff;
  font-size: 13px;
}

.people-layer em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.5;
}

.connection-panel,
.same-era-panel {
  display: grid;
  gap: 10px;
  margin: 18px 0;
}

.connection-list,
.same-era-list {
  display: grid;
  gap: 8px;
}

.connection-card,
.same-era-card {
  display: grid;
  width: 100%;
  min-width: 0;
  gap: 5px;
  padding: 11px;
  color: #eafaff;
  text-align: left;
}

.connection-card:not(:disabled):hover,
.same-era-card:hover {
  border-color: rgba(32, 246, 210, 0.65);
  transform: translateY(-1px);
}

.connection-card:disabled {
  cursor: default;
  opacity: 0.78;
}

.connection-card span,
.same-era-card span {
  color: var(--muted);
  font-size: 11px;
}

.connection-card strong,
.same-era-card strong {
  color: #ffffff;
  font-size: 13px;
}

.connection-card em {
  color: #c9dce6;
  font-size: 12px;
  font-style: normal;
  line-height: 1.5;
}

@media (max-width: 820px) {
  .detail-layers article,
  .connection-card,
  .same-era-card {
    padding: 10px;
  }

  .detail-layers p,
  .connection-card em {
    font-size: 12px;
  }
}

/* Dark historical atlas layer */
:root {
  color-scheme: dark;
  --bg: #08090b;
  --paper: #111316;
  --paper-2: #181a1e;
  --ink: #f5f5f7;
  --muted: #92949b;
  --line: rgba(255, 255, 255, .12);
  --line-soft: rgba(255, 255, 255, .07);
  --red: #2997ff;
  --teal: #9ca8b7;
  --amber: #aeb5bf;
  --shadow: 0 20px 60px rgba(0, 0, 0, .3);
}

body {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, .025) 1px, transparent 1px) 0 0 / 56px 56px,
    linear-gradient(0deg, rgba(255, 255, 255, .018) 1px, transparent 1px) 0 0 / 56px 56px,
    #08090b;
}

body::before {
  background:
    radial-gradient(circle at 80% 0%, rgba(132, 153, 181, .1), transparent 22%),
    linear-gradient(90deg, rgba(255, 255, 255, .02) 1px, transparent 1px) 0 0 / 56px 56px,
    linear-gradient(0deg, rgba(255, 255, 255, .015) 1px, transparent 1px) 0 0 / 56px 56px;
  mix-blend-mode: normal;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 64px;
  padding: 0 28px;
  background: rgba(8, 9, 11, .82);
  border-bottom-color: var(--line);
  backdrop-filter: saturate(160%) blur(20px);
}

.brand h1 {
  color: var(--ink);
  font-family: Georgia, "Songti SC", "Noto Serif CJK SC", serif;
  font-size: 25px;
}

.brand span,
.control-label,
.range-control label,
.scrubber-wrap span,
.year-stage span,
.metric-card span,
.chapter-card span,
.dominant-card span,
.insight-card span,
.milestone-wrap > span,
.overview-pane span,
.pane-title,
.timeline-meta,
.detail-head p,
.meta-list dt,
.event-card span,
.flow-event span,
.flow-event em,
.country-attrs span,
.country-reading span,
.bazi-card span {
  color: var(--muted);
}

nav { gap: 2px; }
.nav-item,
.filter-button,
.timeline-meta button,
.favorite-action,
.jump-year {
  min-height: 32px;
  border-color: transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
}
.nav-item {
  width: 112px;
  min-width: 112px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-color: rgba(255, 255, 255, .1);
  background: rgba(255, 255, 255, .035);
  line-height: 1;
  text-align: center;
  text-decoration: none;
}
.nav-item.is-active,
.filter-button.is-active,
.category-all.is-active {
  color: #fff;
  background: var(--red);
  border-color: var(--red);
}
.nav-item:hover,
.filter-button:hover,
.timeline-meta button:hover,
.favorite-action:hover,
.jump-year:hover {
  color: #fff;
  border-color: rgba(41, 151, 255, .5);
  background: rgba(41, 151, 255, .12);
}

.search-box,
.control-deck,
.infographic-strip,
.story-stage,
.overview-pane {
  background: rgba(17, 19, 22, .86);
  border-color: var(--line);
}
.search-box { min-height: 38px; border-radius: 999px; }
.clear-search {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--muted);
  background: rgba(255, 255, 255, .08);
  line-height: 1;
}
.clear-search:hover { color: var(--ink); background: rgba(255, 255, 255, .16); }
.search-box input,
select,
input[type="search"] {
  color: var(--ink);
  background: transparent;
}
select { background: var(--paper-2); }

.control-deck {
  grid-template-columns: 220px minmax(280px, 1fr) minmax(280px, 1fr) 112px;
  padding: 14px 28px;
}
.filter-row { gap: 6px; }
.filter-button { font-size: 12px; padding: 0 11px; }
.switch { color: var(--muted); }
.switch span { background: #373a40; }
.switch input:checked + span { background: var(--red); }

.infographic-strip {
  grid-template-columns: 180px 86px minmax(260px, 1fr) 110px 130px minmax(260px, 1.1fr);
  background:
    linear-gradient(90deg, rgba(132, 153, 181, .08), transparent 36%),
    rgba(17, 19, 22, .78);
}
.year-stage,
.metric-card,
.story-text,
.activity-bars,
.scrubber-wrap,
.category-mix-wrap,
.chapter-card,
.dominant-card,
.insight-card,
.milestone-wrap,
.region-pulse-map,
.event-flow,
.empty-state,
.year-pane,
.detail-panel,
.timeline-card,
.lane,
.detail-layers article,
.connection-card,
.same-era-card,
.bazi-card,
.country-chart-panel,
.country-mini-card,
.connection-panel,
.same-era-panel,
.overview-pane {
  border-color: var(--line);
  background: rgba(17, 19, 22, .88);
  box-shadow: none;
}
.year-stage strong,
.chapter-card h2,
.milestone-marker b,
.milestone-marker.is-near b { color: var(--amber); }
.play-button { color: #fff; background: var(--red); box-shadow: 0 10px 24px rgba(41, 151, 255, .18); }
.story-text,
.chapter-card p,
.insight-card p,
.detail-summary,
.detail-layers p,
.connection-card em { color: #c3c5ca; }
.activity-row b,
.category-mix { background: rgba(255, 255, 255, .09); }
.activity-row i { background: var(--region-color); }
.category-mix span:nth-child(1) { background: #638fca; }
.category-mix span:nth-child(2) { background: #738092; }
.category-mix span:nth-child(3) { background: #62a4af; }
.category-mix span:nth-child(4) { background: #8b9099; }
.category-mix span:nth-child(5) { background: #9a927f; }
.category-mix-wrap > span { color: var(--muted); }

.region-pulse-map {
  background:
    radial-gradient(circle at 24% 28%, rgba(198, 164, 107, .12), transparent 24%),
    radial-gradient(circle at 72% 65%, rgba(41, 151, 255, .12), transparent 25%),
    #111316;
}
.region-pulse-map::before { border-color: rgba(255, 255, 255, .14); }
.pulse-node { color: var(--ink); background: #181a1e; box-shadow: 0 10px 24px rgba(0, 0, 0, .22); }

.milestone-rail { border-color: var(--line); }
.milestone-marker::before { border-color: var(--red); background: var(--paper); box-shadow: 0 0 0 4px rgba(41, 151, 255, .1); }
.milestone-marker.is-near::before { background: var(--red); }
.flow-event { background: #181a1e; color: var(--ink); }
.flow-event.is-selected { border-color: var(--red); background: rgba(41, 151, 255, .1); }

.workbench { border-color: var(--line); }
.year-pane,
.detail-panel { background: #0f1114; }
.timeline-card { background: #111316; }
.timeline-meta { background: #111316; }
.year-tick { background: var(--line-soft); }
.year-tick span { color: var(--muted); }
.lanes { background: #111316; }
.lane {
  background: repeating-linear-gradient(to bottom, transparent 0, transparent 92px, rgba(255, 255, 255, .05) 93px);
}
.lane header { color: #fff; background: linear-gradient(90deg, color-mix(in srgb, var(--region-color), #101114 20%), var(--region-color)); }
.selected-band { border-color: var(--red); }
.selected-band span { background: var(--red); }
.playhead-band { border-color: var(--teal); }
.playhead-band span { background: var(--teal); color: #0b0d0f; }
.event-card {
  border-color: rgba(255, 255, 255, .12);
  background: #1a1c20;
  box-shadow: 0 9px 22px rgba(0, 0, 0, .2);
}
.event-card strong { color: var(--ink); }
.event-card i { color: var(--amber); }
.event-card.is-selected { border-color: var(--red); box-shadow: 0 0 0 1px rgba(41, 151, 255, .18), 0 14px 30px rgba(0, 0, 0, .24); }
.empty-state { color: var(--muted); }
.detail-panel { color: var(--ink); }
.detail-head h2,
.detail-panel h3,
.overview-pane strong { color: var(--ink); }
.favorite-action { color: var(--amber); }
.detail-tags span { color: #8dc6ff; border-color: rgba(41, 151, 255, .3); background: rgba(41, 151, 255, .1); }
.meta-list,
.related-list li { border-color: var(--line); }
.meta-list dd { color: #d6d7da; }
.chip-list span { color: #c8cbd0; background: #1a1c20; border-color: var(--line); }
.related-list li { background: #181a1e; }
.related-list em { color: var(--muted); }

.jump-dock { background: #111316; border-color: var(--line); }
.dock-title strong { color: var(--amber); }
.overview-row > span { color: var(--muted); }
.overview-row > div { border-color: var(--line); }

@media (max-width: 1120px) {
  .topbar { padding: 14px 18px; }
  .control-deck,
  .infographic-strip,
  .story-stage { padding-left: 18px; padding-right: 18px; }
}

@media (max-width: 520px) {
  .topbar { padding: 12px 14px; }
  .brand h1 { font-size: 26px; }
}
