:root {
  --v80-line: color-mix(in srgb, var(--v50-line, #d8e3df) 84%, transparent);
  --v80-muted: var(--v50-muted, #66736f);
  --v80-surface: var(--v50-surface, #ffffff);
}

.trajectory-subnav,
.public-view-nav {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 8px 0 14px;
  scrollbar-width: none;
}

.trajectory-subnav::-webkit-scrollbar,
.public-view-nav::-webkit-scrollbar { display: none; }

.trajectory-subtab,
.public-view-tab,
.subject-chip,
.metric-chip {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 8px 14px;
  color: var(--v80-muted);
  background: transparent;
  text-decoration: none;
  white-space: nowrap;
  font: inherit;
  cursor: pointer;
}

.trajectory-subtab.active,
.public-view-tab.active,
.subject-chip.active,
.metric-chip.active {
  color: var(--v50-text, #24322e);
  border-color: var(--v80-line);
  background: var(--v50-position, #eef6f1);
}

.subject-picker,
.metric-picker {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 12px 0;
}

.metric-picker { border-bottom: 1px solid var(--v80-line); padding-bottom: 12px; }

.comparison-state {
  display: grid;
  gap: 4px;
  margin: 16px 0;
  padding: 14px 16px;
  border: 1px solid var(--v80-line);
  border-radius: 14px;
  background: var(--v80-surface);
}

.comparison-state span,
.subject-compare-row small,
.exam-detail-subject small,
.public-reading-section > p { color: var(--v80-muted); }

.subject-compare-list,
.exam-detail-subjects { display: grid; gap: 0; }

.subject-compare-row,
.exam-detail-subject {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--v80-line);
}

.subject-compare-row small,
.exam-detail-subject small { grid-column: 1 / -1; }

.subject-compare-row b,
.exam-detail-subject span { text-align: right; font-weight: 650; }

.timeline-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.timeline-row > span:first-child { min-width: 0; }
.timeline-row > span:first-child strong,
.timeline-row > span:first-child small { display: block; }
.timeline-row > span:first-child small { margin-top: 3px; color: var(--v80-muted); }
.timeline-row .row-chevron { font-size: 22px; color: var(--v80-muted); }

.exam-detail {
  margin: 8px 0 18px;
  padding: 18px;
}

.exam-detail-overall {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--v80-line);
}

.exam-detail-overall strong { font-size: 22px; }
.private-detail { margin-top: 14px; }

.public-reading-section { margin-top: 18px; }
.public-reading-section h2 { margin: 4px 0 12px; }
.public-subject-picker { margin-bottom: 14px; }

@media (max-width: 620px) {
  .timeline-row { grid-template-columns: minmax(0, 1fr) auto; }
  .timeline-row .history-coordinate { grid-column: 1 / -1; justify-content: flex-start; }
  .timeline-row .row-chevron { grid-column: 2; grid-row: 1; }
  .subject-compare-row b,
  .exam-detail-subject span { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  .trajectory-subtab,
  .public-view-tab,
  .subject-chip,
  .metric-chip { transition: none !important; }
}
