.timeline-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 20px;
  align-items: start;
}

.timeline-card,
.summary-card {
  padding: 20px;
}

.timeline-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.timeline-heading h3 {
  margin: 2px 0 0;
  font-family: var(--font-heading);
  font-size: 1.65rem;
  color: var(--text);
}

.timeline-kicker {
  color: var(--accent-cyan);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.13rem;
  line-height: 1.2;
  text-transform: uppercase;
}

.timeline-count {
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.05rem;
  text-transform: uppercase;
  white-space: nowrap;
}

.timeline-list {
  list-style: none;
  padding: 0;
  margin: 0 0 0 10px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 16px;
  padding: 0 0 24px;
}

.timeline-item:not(:last-child)::before {
  content: "";
  position: absolute;
  top: 20px;
  bottom: -10px;
  left: 6.5px;
  width: 1px;
  background: linear-gradient(180deg, rgba(77, 228, 247, 0.7), rgba(255, 126, 95, 0.3));
}

.timeline-node {
  position: relative;
  z-index: 1;
  width: 14px;
  height: 14px;
  margin-top: 7px;
  border: 3px solid var(--accent-cyan);
  border-radius: 50%;
  background: var(--panel-strong);
  box-shadow: 0 0 0 4px rgba(77, 228, 247, 0.1), 0 0 14px rgba(77, 228, 247, 0.45);
}

.timeline-card-content {
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: linear-gradient(120deg, rgba(255, 126, 95, 0.12), rgba(77, 228, 247, 0.08));
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.timeline-card-content:hover {
  transform: translateX(3px);
  border-color: rgba(255, 209, 102, 0.48);
  box-shadow: 0 10px 24px rgba(2, 2, 9, 0.25);
}

.timeline-item strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
  font-size: 1.12rem;
}

.timeline-choice {
  color: var(--muted);
  font-size: 1rem;
}

.timeline-item.is-major .timeline-node {
  width: 18px;
  height: 18px;
  margin-left: -2px;
  margin-top: 5px;
  border-color: var(--accent);
  box-shadow: 0 0 0 5px rgba(255, 126, 95, 0.12), 0 0 18px rgba(255, 126, 95, 0.58);
}

.timeline-item.is-major .timeline-card-content {
  border-color: rgba(255, 126, 95, 0.44);
  background: linear-gradient(120deg, rgba(255, 126, 95, 0.2), rgba(77, 228, 247, 0.08));
}

.timeline-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.timeline-chip {
  display: inline-flex;
  align-items: baseline;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid rgba(77, 228, 247, 0.3);
  border-radius: 999px;
  color: var(--accent-cyan);
  background: rgba(77, 228, 247, 0.08);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04rem;
  text-transform: uppercase;
}

.ending-archive-item {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid rgba(77, 228, 247, 0.3);
  border-radius: 999px;
  color: var(--accent-cyan);
  background: rgba(77, 228, 247, 0.08);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04rem;
  text-transform: uppercase;
}

.timeline-chip-direction {
  display: inline-flex;
  align-items: baseline;
  line-height: inherit;
  vertical-align: baseline;
  position: relative;
}

.status-chip {
  color: var(--muted);
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.05);
}

.timeline-ending {
  position: relative;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 16px;
  padding-bottom: 0;
}

.timeline-ending .timeline-node {
  width: 20px;
  height: 20px;
  margin-left: -3px;
  margin-top: 4px;
  border-color: var(--accent-strong);
  background: var(--accent);
  box-shadow: 0 0 0 5px rgba(255, 209, 102, 0.14), 0 0 22px rgba(255, 126, 95, 0.72);
}

.timeline-ending .timeline-card-content {
  border-color: rgba(255, 209, 102, 0.56);
  background: linear-gradient(145deg, rgba(255, 126, 95, 0.28), rgba(17, 15, 28, 0.86));
}

.timeline-branch-list {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.branch-button {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border);
  color: var(--text);
  text-align: left;
  border-radius: 10px;
}

.tree-node {
  margin: 0 0 8px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  border: 1px solid var(--border);
}

.tree-node .node-label {
  font-weight: 700;
}

.timeline-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}

.summary-stat {
  padding: 12px;
  border-radius: 10px;
  background: linear-gradient(160deg, rgba(255, 126, 95, 0.14), rgba(255, 255, 255, 0.04));
  border: 1px solid var(--border);
  color: var(--muted);
}

.summary-stat strong {
  display: block;
  font-size: 1.2rem;
  color: var(--text);
}

.summary-stat span,
.status-pill span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04rem;
}

.summary-stat-wide {
  grid-column: 1 / -1;
}

.summary-status {
  margin-top: 24px;
}

.summary-status .status-grid {
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  margin-top: 10px;
}

.ending-progress {
  margin-top: 24px;
}

.ending-progress > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
}

.ending-progress strong {
  color: var(--text);
}

.ending-progress-track {
  height: 7px;
  margin-top: 9px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.1);
}

.ending-progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent));
  box-shadow: 0 0 12px rgba(255, 126, 95, 0.45);
}

.ending-archive {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}

.ending-archive-item {
  color: var(--muted);
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.04);
}

.ending-archive-item.is-discovered {
  color: var(--accent-strong);
  border-color: rgba(255, 209, 102, 0.32);
}

.hidden-choice {
  opacity: 0.62;
}
