html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  font-family: 'Noto Sans', sans-serif;
}

.section-bayesian .strategy-card {
  opacity: 0;
  transform: scale(0.95);
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.6s ease-out;
  transition-delay: var(--strategy-card-delay, 0s);
  will-change: transform, opacity;
}

.section-bayesian .strategy-card.is-visible {
  opacity: 1;
  transform: scale(1);
}

@media (prefers-reduced-motion: reduce) {
  .section-bayesian .strategy-card {
    transition: none;
    opacity: 1;
    transform: none;
  }
}

:root {
  --color-primary: #304ed8;
  --color-on-primary: #ffffff;
}

.hero-main {
  background: linear-gradient(180deg, #ffffff 0%, #f6f8ff 100%);
  color: #172642;
}

.hero-main .title,
.hero-main .subtitle {
  color: #172642;
}

.hero-body .publication-title {
  font-family: 'Google Sans', sans-serif;
  font-weight: 700;
}

.subtitle.is-spaced {
  margin-bottom: 1.25rem;
}

.publication-authors {
  font-family: 'Google Sans', sans-serif;
}

.publication-authors a {
  color: #00c4a7 !important;
}

.publication-authors a:hover {
  text-decoration: underline;
}

.publication-links {
  margin-top: 1rem;
}

.link-block a {
  margin-top: 5px;
  margin-bottom: 5px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.link-block a:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.link-block a:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.placeholder-card {
  border: 1px dashed rgba(15, 31, 60, 0.25);
  border-radius: 12px;
  padding: 1.75rem;
  background: rgba(15, 31, 60, 0.04);
  min-height: 180px;
}

.placeholder-card p {
  margin-bottom: 0;
  color: #4a5770;
}

.hero.teaser {
  font-family: 'Google Sans', sans-serif;
  background: #f3f5ff;
}

.hero.teaser .hero-body {
  padding-top: 2.5rem;
  padding-bottom: 3.5rem;
}

.hero-trajectory {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr);
  gap: 1.75rem;
  align-items: stretch;
  background: linear-gradient(180deg, rgba(48, 78, 216, 0.14) 0%, rgba(4, 175, 112, 0.12) 100%);
  border-radius: 24px;
  padding: 1.75rem;
  box-shadow: 0 26px 60px rgba(17, 34, 68, 0.18);
}

.hero-trajectory-board {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.hero-board-header {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.hero-board-grid {
  box-shadow: 0 16px 36px rgba(23, 38, 66, 0.2);
  background: rgba(23, 38, 66, 0.12);
}

.hero-board-grid .board-cell,
.hero-board-grid .board-label-cell {
  min-height: 0;
  font-size: 1.05rem;
}

.hero-board-footer {
  font-size: 0.85rem;
  color: rgba(23, 38, 66, 0.75);
  background: rgba(255, 255, 255, 0.72);
  border-radius: 12px;
  padding: 0.55rem 0.8rem;
  box-shadow: inset 0 0 0 1px rgba(23, 38, 66, 0.08);
}

.hero-trajectory-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.hero-event-details {
  min-height: 280px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: inset 0 0 0 1px rgba(48, 78, 216, 0.18);
}

.hero-event-details .event-bubble {
  max-width: 100%;
}

@media (max-width: 1024px) {
  .hero-trajectory {
    grid-template-columns: 1fr;
  }

  .hero-board-grid .board-cell,
  .hero-board-grid .board-label-cell {
    min-height: 0;
    font-size: 0.95rem;
  }
}

@media (max-width: 600px) {
  .hero-trajectory {
    padding: 1.25rem;
    gap: 1.35rem;
  }

  .hero-event-details {
    min-height: 220px;
  }
}

.placeholder-media {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 20% 20%, rgba(58, 224, 175, 0.2), transparent 70%),
    #0f1a33;
  border-radius: 16px;
  border: 1px solid rgba(58, 224, 175, 0.2);
  min-height: 260px;
  color: #9fb8ff;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.placeholder-media::after {
  content: '';
  position: absolute;
  inset: 16px;
  border: 2px dashed rgba(63, 214, 203, 0.4);
  border-radius: 12px;
}

.placeholder-media span {
  position: relative;
  z-index: 2;
}

.results-carousel .placeholder-media {
  min-height: 220px;
}

.publication-video {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 56.25%;
  overflow: hidden;
  border-radius: 10px;
  box-shadow: 0 24px 60px rgba(10, 20, 40, 0.18);
}

.publication-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}


.trajectory-explorer {
  background: linear-gradient(180deg, #f8f9ff 0%, #eef2ff 100%);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: 0 24px 60px rgba(17, 34, 68, 0.12);
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.trajectory-layout {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.selection-panel {
  background: rgba(23, 38, 66, 0.03);
  border-radius: 18px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  box-shadow: inset 0 0 0 1px rgba(23, 38, 66, 0.05);
}

.game-browser-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.game-browser-toolbar {
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
}

.selection-panel h3 {
  margin-bottom: 0.25rem;
  color: #172642;
}

.selection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.filter-group .select select {
  background: #ffffff;
  border-radius: 999px;
  border: 1px solid rgba(23, 38, 66, 0.15);
  font-weight: 600;
  color: #172642;
}

.game-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.game-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  padding: 0.7rem 0.85rem;
  border-radius: 12px;
  background: rgba(15, 31, 60, 0.06);
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease, transform 0.15s ease;
}

.game-item:hover {
  background: rgba(48, 78, 216, 0.12);
  transform: translateY(-1px);
}

.game-item.is-active {
  background: rgba(48, 78, 216, 0.2);
  box-shadow: 0 10px 20px rgba(48, 78, 216, 0.25);
}

.game-item-title {
  font-weight: 700;
  color: #172642;
  font-size: 0.95rem;
}

.game-item-meta {
  font-size: 0.8rem;
  color: #5c6c8f;
}

.viewer-panel {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.viewer-content {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 1.5rem;
}

.trajectory-status {
  padding: 0.75rem 1rem;
  border-radius: 10px;
  background: rgba(15, 31, 60, 0.08);
  color: #304060;
  font-weight: 600;
}

.trajectory-status.has-error {
  background: rgba(220, 39, 39, 0.12);
  color: #821515;
}

.trajectory-top {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: flex-end;
}

.trajectory-selection {
  min-width: 220px;
  flex: 1 1 240px;
}

.trajectory-view-toggle {
  display: inline-flex;
  border-radius: 999px;
  background: rgba(15, 31, 60, 0.08);
  padding: 0.3rem;
  gap: 0.25rem;
  flex: 0 0 auto;
}

.view-toggle-button {
  border: none;
  border-radius: 999px;
  padding: 0.65rem 1.4rem;
  background: transparent;
  color: #172642;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.view-toggle-button:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.view-toggle-button.is-active {
  background: var(--color-primary);
  color: var(--color-on-primary);
  box-shadow: 0 10px 18px rgba(48, 78, 216, 0.25);
}

.view-toggle-button.is-active:hover,
.view-toggle-button.is-active:focus-visible {
  color: var(--color-on-primary);
}

.view-toggle-button .icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: currentColor;
}

.view-toggle-button .label {
  font-weight: 600;
  color: currentColor;
}

.trajectory-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  width: 100%;
  align-items: stretch;
}

#trajectory-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  max-width: 100%;
  display: block;
  height: 12px;
  background: transparent;
  cursor: pointer;
  margin: 0;
  padding: 1rem 0;
  --slider-track-bg: #d6dbea;
  --slider-track-fill: var(--color-primary);
  --slider-progress: 0%;
}

#trajectory-slider::-webkit-slider-runnable-track {
  height: 12px;
  background: linear-gradient(to right,
      var(--slider-track-fill) 0%,
      var(--slider-track-fill) var(--slider-progress),
      var(--slider-track-bg) var(--slider-progress),
      var(--slider-track-bg) 100%);
  border-radius: 999px;
}

#trajectory-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid var(--color-primary);
  margin-top: -6px;
  transition: box-shadow 0.2s ease, transform 0.15s ease;
}

#trajectory-slider:focus-visible {
  outline: none;
}

#trajectory-slider:hover::-webkit-slider-thumb {
  transform: scale(1.05);
}

#trajectory-slider:active::-webkit-slider-thumb {
  transform: scale(1.1);
}

#trajectory-slider::-moz-range-track {
  height: 12px;
  background: var(--slider-track-bg);
  border-radius: 999px;
}

#trajectory-slider::-moz-range-progress {
  height: 12px;
  background: var(--slider-track-fill);
  border-radius: 999px;
}

#trajectory-slider::-ms-fill-lower {
  background: var(--slider-track-fill);
  border-radius: 999px;
}

#trajectory-slider::-ms-fill-upper {
  background: var(--slider-track-bg);
  border-radius: 999px;
}

.metric-card {
  background: #ffffff;
  border-radius: 14px;
  padding: 0.9rem 1.1rem;
  box-shadow: 0 14px 30px rgba(17, 34, 68, 0.12);
  min-width: 150px;
}

.metric-card span {
  display: block;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #5c6c8f;
  margin-bottom: 0.35rem;
}

.metric-card strong {
  display: block;
  font-size: 1.35rem;
  color: #172642;
}

.trajectory-grid {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 1.5rem;
}

.board-card,
.side-card {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(17, 34, 68, 0.12);
  padding: 1.5rem;
}

.board-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.board-caption {
  color: #5c6c8f;
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.board-grid {
  --board-columns: 9;
  display: grid;
  gap: 4px;
  background: rgba(23, 38, 66, 0.08);
  padding: 6px;
  border-radius: 12px;
  position: relative;
  grid-template-columns: repeat(var(--board-columns, 9), minmax(36px, 1fr));
  grid-auto-rows: minmax(36px, 1fr);
}

.board-cell,
.board-label-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: #172642;
  border-radius: 6px;
  min-height: 2.4rem;
}

.board-label-cell {
  background: transparent;
  color: #5c6c8f;
  font-size: 0.85rem;
}

.board-cell {
  background: var(--cell-bg, #dbe4ff);
  position: relative;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  transition: transform 0.08s ease;
  aspect-ratio: 1 / 1;
}

.board-label-cell {
  aspect-ratio: 1 / 1;
}

.board-cell:hover {
  transform: translateY(-1px);
}

.board-cell::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 6px;
  pointer-events: none;
}

.board-cell[data-hidden="true"]::after {
  background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.72) 0, rgba(255, 255, 255, 0.72) 6px, rgba(255, 255, 255, 0.05) 6px, rgba(255, 255, 255, 0.05) 12px);
}

.board-cell.is-current::after {
  border: 2px solid rgba(23, 38, 66, 0.9);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.6);
}

.empty-state {
  background: rgba(23, 38, 66, 0.05);
  border-radius: 12px;
  padding: 1.25rem;
  color: #5c6c8f;
  text-align: center;
  font-weight: 600;
}

.side-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.side-card+.side-card {
  margin-top: 0;
}

.ship-tracker {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.ship-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
}

.ship-info {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex: 1 1 auto;
  min-width: 0;
}

.ship-icon {
  color: #9b9c97;
  font-size: 0.95rem;
  flex: 0 0 auto;
  transition: color 0.2s ease;
}

.ship-label {
  font-weight: 600;
  color: #172642;
  flex: 0 0 auto;
  white-space: nowrap;
}

.ship-segments {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}

.ship-segment {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  display: inline-block;
  flex: 0 0 12px;
}

.ship-status {
  font-size: 0.85rem;
  color: #5c6c8f;
  min-width: 80px;
  text-align: right;
  flex: 0 0 auto;
  white-space: nowrap;
}

.ship-status.is-hidden {
  visibility: hidden;
}

.event-card {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-height: 320px;
}

.event-card .title {
  margin-bottom: 0;
}

.motivation-content {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.motivation-timeline {
  background: linear-gradient(180deg, rgba(48, 78, 216, 0.14) 0%, rgba(4, 175, 112, 0.1) 100%);
  border-radius: 20px;
  padding: 1.65rem 1.75rem;
  box-shadow: 0 18px 40px rgba(17, 34, 68, 0.16);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.motivation-timeline-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.motivation-timeline-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
  position: relative;
}

.motivation-timeline-list::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 26px;
  width: 3px;
  background: linear-gradient(180deg, rgba(48, 78, 216, 0.45), rgba(4, 175, 112, 0.35));
  border-radius: 999px;
}

.motivation-timeline-item {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 1rem;
  position: relative;
  align-items: start;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.45s ease, transform 0.45s ease;
  transition-delay: var(--timeline-delay, 0s);
}

.motivation-timeline-item::before {
  content: "";
  position: absolute;
  top: 28px;
  left: 26px;
  width: 3px;
  height: calc(100% - 28px);
  background: rgba(48, 78, 216, 0.18);
}

.motivation-timeline-item.is-reveal-pending {
  opacity: 0;
  transform: translateY(24px);
}

.motivation-timeline-item.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.motivation-timeline-item:last-child::before {
  display: none;
}

.motivation-timeline-icon {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  box-sizing: border-box;
  background: linear-gradient(135deg, #304ed8, #04af70);
  color: #ffffff;
  border: 3px solid rgba(245, 248, 255, 0.95);
  box-shadow: 0 10px 24px rgba(23, 38, 66, 0.22);
  font-size: 1.15rem;
}

.motivation-timeline-icon .fas,
.motivation-timeline-icon .far,
.motivation-timeline-icon .ai,
.motivation-timeline-icon .fab {
  font-size: 1.2rem;
}

.motivation-timeline-body {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  background: rgba(255, 255, 255, 0.88);
  border-radius: 16px;
  padding: 1rem 1.1rem;
  box-shadow: inset 0 0 0 1px rgba(48, 78, 216, 0.16);
  color: #172642;
}

.motivation-timeline-kicker {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  color: rgba(23, 38, 66, 0.62);
}

.motivation-timeline-copy {
  margin: 0;
  font-size: 1rem;
  line-height: 1.55;
}

.motivation-accordion {
  background: linear-gradient(180deg, rgba(23, 38, 66, 0.1) 0%, rgba(48, 78, 216, 0.14) 100%);
  border-radius: 20px;
  padding: 1.5rem 1.75rem;
  box-shadow: 0 18px 40px rgba(17, 34, 68, 0.14);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.motivation-accordion-items {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.motivation-accordion-actions {
  display: flex;
  justify-content: center;
  margin-top: 0.75rem;
}

.motivation-accordion-item {
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: inset 0 0 0 1px rgba(48, 78, 216, 0.14);
}

.motivation-accordion-button {
  all: unset;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  box-sizing: border-box;
  padding: 1rem 1.25rem;
  cursor: pointer;
  font-weight: 700;
  color: #172642;
  transition: background 0.18s ease, color 0.18s ease;
}

.motivation-accordion-button:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}

.motivation-accordion-button:hover {
  background: rgba(48, 78, 216, 0.08);
}

.motivation-accordion-label {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 1rem;
}

.motivation-accordion-indicator {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(48, 78, 216, 0.12);
  color: var(--color-primary);
  transition: transform 0.18s ease;
}

.motivation-accordion-button[aria-expanded="true"] .motivation-accordion-indicator {
  transform: rotate(180deg);
}

.motivation-accordion-panel {
  padding: 0 1.25rem 1.15rem;
  color: #304060;
  font-size: 0.95rem;
  line-height: 1.6;
}

.motivation-accordion-panel[hidden] {
  display: none;
}

.motivation-action-button {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: none;
  border-radius: 999px;
  background: var(--color-primary);
  color: var(--color-on-primary);
  font-weight: 600;
  padding: 0.58rem 1.25rem;
  box-shadow: 0 14px 28px rgba(48, 78, 216, 0.28);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.motivation-action-button:not(.is-secondary):hover,
.motivation-action-button:not(.is-secondary):focus-visible {
  color: var(--color-on-primary);
}

.motivation-action-button .icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.motivation-action-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 32px rgba(48, 78, 216, 0.32);
}

.motivation-action-button:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 3px;
}

.motivation-action-button.is-secondary {
  background: rgba(255, 255, 255, 0.92);
  color: #172642;
  box-shadow: 0 12px 26px rgba(23, 38, 66, 0.16);
  border: 1px solid rgba(23, 38, 66, 0.12);
}

.motivation-action-button.is-secondary:hover {
  background: #ffffff;
  box-shadow: 0 16px 30px rgba(23, 38, 66, 0.2);
}

.motivation-action-button[disabled],
.motivation-action-button[aria-disabled="true"] {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: 0 10px 20px rgba(48, 78, 216, 0.18);
}

.motivation-abstract {
  background: linear-gradient(180deg, rgba(23, 38, 66, 0.12) 0%, rgba(48, 78, 216, 0.18) 100%);
  border-radius: 20px;
  padding: 1.75rem;
  box-shadow: 0 20px 44px rgba(17, 34, 68, 0.2);
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  width: 100%;
  color: #172642;
  opacity: 0;
  transform: translateY(-12px);
  pointer-events: none;
  transition: opacity 220ms ease, transform 220ms ease;
  will-change: opacity, transform;
}

.motivation-abstract[hidden] {
  display: none;
}

.motivation-abstract.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.motivation-abstract-header {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.motivation-abstract .content {
  background: rgba(255, 255, 255, 0.82);
  border-radius: 16px;
  padding: 1.2rem 1.4rem;
  box-shadow: inset 0 0 0 1px rgba(48, 78, 216, 0.18);
}

.motivation-abstract-actions {
  display: flex;
  justify-content: flex-end;
}

@media (prefers-reduced-motion: reduce) {
  .motivation-timeline-item {
    transition: none;
  }

  .motivation-timeline-item.is-reveal-pending {
    opacity: 1;
    transform: none;
  }

  .motivation-abstract {
    transition: none;
    transform: none;
    opacity: 1;
    pointer-events: auto;
  }

  .motivation-abstract.is-visible {
    transform: none;
  }
}

.motivation-noscript-abstract {
  margin-top: 1.5rem;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 14px 28px rgba(17, 34, 68, 0.12);
  color: #172642;
}

.section-codegen {
  background: linear-gradient(180deg, rgba(17, 34, 68, 0.05) 0%, rgba(48, 78, 216, 0.08) 100%);
}

.section-codegen .section-heading {
  margin-bottom: 2.5rem;
  color: #172642;
}

.section-codegen .section-heading .title {
  margin-bottom: 0.75rem;
}


.section-information-gain {
  background: linear-gradient(180deg, rgba(16, 24, 38, 0.04) 0%, rgba(48, 78, 216, 0.06) 55%, rgba(4, 175, 112, 0.08) 100%);
  color: #172642;
}

.section-information-gain .section-heading {
  margin-bottom: 2.75rem;
}

.information-gain-layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  align-items: stretch;
}

.information-gain-card {
  background: rgba(255, 255, 255, 0.96);
  border-radius: 18px;
  padding: 1.6rem 1.5rem;
  box-shadow: 0 20px 44px rgba(17, 34, 68, 0.16);
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  min-height: 100%;
}

.information-gain-chat .event-chat-log {
  min-height: 260px;
}

.information-gain-note {
  color: #55658c;
  font-size: 0.92rem;
  line-height: 1.55;
  margin: 0;
}

.information-gain-sorting {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}


.information-gain-sample-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.eig-sample-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 76px;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  overflow: hidden;
  background: #ffffff;
  border: 2px solid rgba(23, 38, 66, 0.18);
  box-shadow: 0 14px 28px rgba(17, 34, 68, 0.15);
  transition: transform 0.25s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  cursor: default;
  will-change: transform;
}

.eig-sample-chip::after {
  content: '';
  position: absolute;
  inset: 0;
  background: transparent;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.eig-sample-chip.is-processing {
  transform: translateY(-6px);
  box-shadow: 0 22px 44px rgba(48, 78, 216, 0.24);
}

.eig-sample-chip.is-assigned {
  box-shadow: 0 16px 32px rgba(17, 34, 68, 0.18);
}

.eig-sample-chip.is-moving {
  box-shadow: 0 24px 48px rgba(17, 34, 68, 0.22);
}

.eig-sample-chip[data-target="pending"] {
  border-color: rgba(23, 38, 66, 0.25);
}

.eig-sample-chip[data-target="true"] {
  border-color: rgba(4, 175, 112, 0.65);
  box-shadow: 0 22px 44px rgba(4, 175, 112, 0.26);
}

.eig-sample-chip[data-target="true"]::after {
  background: rgba(4, 175, 112, 0.18);
  opacity: 1;
}

.eig-sample-chip[data-target="false"] {
  border-color: rgba(172, 32, 40, 0.6);
  box-shadow: 0 22px 44px rgba(172, 32, 40, 0.22);
}

.eig-sample-chip[data-target="false"]::after {
  background: rgba(172, 32, 40, 0.16);
  opacity: 1;
}

.eig-sample-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.information-gain-buckets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.information-gain-bucket {
  background: rgba(247, 249, 255, 0.94);
  border-radius: 16px;
  padding: 1rem 1.15rem;
  border: 1px dashed rgba(48, 78, 216, 0.28);
  box-shadow: inset 0 0 0 1px rgba(48, 78, 216, 0.08);
  min-height: 124px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.information-gain-bucket[data-result="true"] {
  border-color: rgba(4, 175, 112, 0.32);
  box-shadow: inset 0 0 0 1px rgba(4, 175, 112, 0.12);
}

.information-gain-bucket[data-result="false"] {
  border-color: rgba(172, 32, 40, 0.32);
  box-shadow: inset 0 0 0 1px rgba(172, 32, 40, 0.12);
}

.information-gain-bucket-body {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-start;
  min-height: 72px;
}

.information-gain-plot-wrapper {
  position: relative;
  border-radius: 16px;
  padding: 1rem 1.25rem;
  background: radial-gradient(circle at 18% 22%, rgba(48, 78, 216, 0.12), rgba(255, 255, 255, 0.94));
  box-shadow: inset 0 0 0 1px rgba(48, 78, 216, 0.12);
}

.information-gain-plot {
  width: 100%;
  height: auto;
  display: block;
}

.information-gain-plot .axis-line {
  stroke: rgba(23, 38, 66, 0.35);
  stroke-width: 1.5;
}

.information-gain-plot .tick-line {
  stroke: rgba(23, 38, 66, 0.25);
  stroke-width: 1;
}

.information-gain-plot .tick-label {
  fill: #4e5d7a;
  font-size: 0.82rem;
  font-weight: 500;
  text-anchor: middle;
  dominant-baseline: hanging;
}

.information-gain-plot .tick-label--y {
  text-anchor: end;
  dominant-baseline: middle;
}

.axis-title {
  fill: #172642;
  font-size: 0.94rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.eig-curve {
  fill: none;
  stroke: rgba(48, 78, 216, 0.9);
  stroke-width: 3;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.eig-curve-fill {
  fill: rgba(48, 78, 216, 0.14);
}

.eig-highlight-line {
  stroke: rgba(4, 175, 112, 0.6);
  stroke-width: 1.5;
  stroke-dasharray: 6 6;
}

.eig-highlight-point {
  fill: #04af70;
  stroke: #ffffff;
  stroke-width: 2;
}

.eig-highlight-label {
  fill: #0b5941;
  font-size: 0.85rem;
  font-weight: 600;
  text-anchor: start;
  dominant-baseline: hanging;
}

.eig-axis-labels text {
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

.information-gain-plot-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin: 0;
}

.information-gain-plot-meta div {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.9rem;
  color: #4e5d7a;
}

.information-gain-plot-meta dt {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  color: rgba(23, 38, 66, 0.7);
}

.information-gain-plot-meta dd {
  margin: 0;
  font-weight: 600;
  color: #172642;
}

@media (max-width: 1023px) {
  .information-gain-layout {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  }

  .information-gain-card {
    padding: 1.4rem 1.3rem;
  }
}

@media (max-width: 768px) {
  .information-gain-buckets {
    grid-template-columns: 1fr;
  }
}

.codegen-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.75rem;
  color: #172642;
}

.codegen-example-label {
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.8rem;
  color: rgba(23, 38, 66, 0.7);
}

.codegen-example-switch {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.codegen-example-button {
  border: none;
  border-radius: 999px;
  background: rgba(23, 38, 66, 0.08);
  color: #172642;
  padding: 0.5rem 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
  min-width: 110px;
}

.codegen-example-button:hover {
  background: rgba(48, 78, 216, 0.18);
  transform: translateY(-1px);
}

.codegen-example-button.is-active {
  background: var(--color-primary);
  color: var(--color-on-primary);
  box-shadow: 0 12px 28px rgba(48, 78, 216, 0.26);
}

.codegen-layout {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 2rem;
  align-items: stretch;
}

.codegen-chat-panel {
  display: flex;
  flex-direction: column;
}

.codegen-chat-box {
  min-height: 460px;
  max-width: 720px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 22px 44px rgba(17, 34, 68, 0.18);
}

.codegen-chat-box .event-chat-log {
  max-width: 100%;
}

.codegen-board-panel {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.codegen-board-card {
  background: rgba(255, 255, 255, 0.96);
  border-radius: 18px;
  padding: 1.25rem 1.35rem 1.5rem;
  box-shadow: 0 20px 42px rgba(17, 34, 68, 0.16);
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.codegen-board-caption {
  margin: 0;
  color: #5c6c8f;
  font-size: 0.85rem;
}


.codegen-board-card .board-cell,
.codegen-board-card .board-label-cell {
  min-height: 2.2rem;
}

.event-message.is-spotter .event-bubble.is-code-snippet {
  background: #101826 !important;
  color: #e9eefc !important;
  box-shadow: 0 18px 40px rgba(10, 20, 40, 0.45) !important;
  border: 1px solid rgba(117, 132, 168, 0.35) !important;
  padding: 0.85rem 1rem;
  max-width: min(100%, 640px);
}

.event-bubble.is-code-snippet {
  background: #101826;
  color: #e9eefc;
  box-shadow: 0 18px 40px rgba(10, 20, 40, 0.45);
  border: 1px solid rgba(117, 132, 168, 0.35);
  padding: 0.85rem 1rem;
  max-width: min(100%, 640px);
}

.event-bubble.is-code-snippet .event-speaker {
  color: rgba(188, 204, 255, 0.85);
}

.event-bubble pre {
  margin: 0;
  background: transparent;
  color: inherit;
  font-family: 'Source Code Pro', 'Fira Code', Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
  font-size: 0.9rem;
  line-height: 1.55;
  overflow-x: auto;
  padding: 0;
}

.event-bubble pre code {
  background: transparent;
  color: inherit;
  padding: 0;
  font-size: inherit;
}

.codegen-evaluating-icon {
  margin-right: 0.5rem;
}

.codegen-evaluating-icon.fa-cog {
  animation: fa-spin 2s infinite linear;
}

.codegen-evaluating-icon.fa-check-circle,
.codegen-evaluating-icon.fa-times-circle {
  animation: none !important;
}

.codegen-evaluating-message {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.codegen-evaluating-message .fas {
  color: #304ed8;
}

.codegen-evaluating-message .fa-check-circle {
  color: #04af70;
}

.codegen-evaluating-message .fa-times-circle {
  color: #ac2028;
}

.codegen-chat-box .event-message.is-system .event-bubble {
  max-width: min(100%, 420px);
}

.codegen-chat-box .event-message.is-captain .event-bubble,
.codegen-chat-box .event-message.is-spotter .event-bubble {
  max-width: min(100%, 640px);
}

.codegen-code-block {
  margin: 0;
  background: transparent;
  padding: 0;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 220ms ease, transform 220ms ease;
  min-height: 3.25rem;
  display: flex;
  align-items: stretch;
  position: relative;
  width: 100%;
}

.codegen-code-block.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.codegen-code-block.is-pending::after {
  content: 'Generating code…';
  position: absolute;
  inset: 0;
  padding: 0.65rem 0.85rem;
  display: flex;
  align-items: center;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(233, 238, 252, 0.62);
  pointer-events: none;
}

.codegen-code-block.is-revealed::after {
  content: none;
}

.codegen-code-block code {
  background: transparent;
  padding: 0;
  white-space: pre-wrap;
  width: 100%;
  display: block;
  line-height: 1.45;
  overflow-x: auto;
  opacity: 0;
  transition: opacity 200ms ease;
}

.codegen-code-block.is-revealed code {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .codegen-code-block {
    transition: none;
    transform: none;
    opacity: 1;
  }

  .codegen-code-block code {
    transition: none;
    opacity: 1;
  }
}

@media (max-width: 1200px) {
  .codegen-layout {
    grid-template-columns: 1fr;
  }

  .codegen-chat-box {
    max-width: 100%;
  }

  .codegen-board-card {
    padding: 1.1rem 1.2rem 1.35rem;
  }
}

@media (max-width: 768px) {
  .codegen-controls {
    flex-direction: column;
    align-items: flex-start;
  }

  .codegen-board-card .board-cell,
  .codegen-board-card .board-label-cell {
    min-height: 1.9rem;
  }
}

.event-details {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  color: #172642;
  background: linear-gradient(180deg, rgba(48, 78, 216, 0.12) 0%, rgba(48, 78, 216, 0.03) 100%);
  border-radius: 18px;
  padding: 1.1rem;
  box-shadow: inset 0 0 0 1px rgba(48, 78, 216, 0.12);
  min-height: 240px;
  position: relative;
  overflow: hidden;
}

.event-chat-log {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 0.25rem;
}

.event-message {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  max-width: 100%;
}

.event-message.is-captain {
  justify-content: flex-start;
}

.event-message.is-spotter {
  justify-content: flex-end;
  flex-direction: row-reverse;
}

.event-message.is-spotter .event-bubble {
  order: 1;
}

.event-message.is-spotter .event-avatar {
  order: 2;
}

.event-message.is-system {
  justify-content: center;
}

.event-avatar {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3a58d6, #6f88ff);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 10px 20px rgba(48, 78, 216, 0.25);
}

.event-avatar i {
  font-size: 1.05rem;
}

.event-message.is-spotter .event-avatar {
  background: linear-gradient(135deg, #04af70, #55d69c);
  box-shadow: 0 10px 20px rgba(4, 175, 112, 0.25);
}

.event-bubble {
  flex: 1 1 auto;
  background: rgba(48, 78, 216, 0.18);
  border-radius: 16px;
  padding: 0.75rem 1rem;
  box-shadow: 0 14px 28px rgba(23, 38, 66, 0.24);
  color: #ffffff;
  position: relative;
  max-width: min(100%, 460px);
}

.event-message.is-spotter .event-bubble {
  background: #ffffff;
  color: #172642;
  box-shadow: 0 12px 24px rgba(4, 175, 112, 0.2);
  border: 1px solid rgba(4, 175, 112, 0.2);
}

.event-message.is-spotter .event-bubble.is-code-snippet {
  background: #101826;
  color: #e9eefc;
  box-shadow: 0 18px 40px rgba(10, 20, 40, 0.45);
  border: 1px solid rgba(117, 132, 168, 0.35);
}

.event-message.is-spotter .event-bubble .event-speaker {
  color: #04af70;
}

.event-message.is-system .event-bubble {
  background: rgba(23, 38, 66, 0.08);
  color: #172642;
  box-shadow: none;
  border: 1px dashed rgba(23, 38, 66, 0.2);
  max-width: 100%;
}

.event-speaker {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.85;
  margin-bottom: 0.35rem;
}

.event-message-text {
  display: inline;
  font-size: 0.95rem;
  line-height: 1.5;
  word-break: break-word;
}

.event-typing-caret {
  display: inline-block;
  width: 8px;
  height: 1.2em;
  margin-left: 0.2rem;
  background: currentColor;
  opacity: 0;
  transform: translateY(2px);
}

.event-typing-caret.is-visible {
  opacity: 1;
  animation: typingCaretBlink 1s steps(2, start) infinite;
}

@keyframes typingCaretBlink {

  0%,
  49% {
    opacity: 1;
  }

  50%,
  100% {
    opacity: 0;
  }
}

@keyframes eventThinkingBlink {

  0%,
  80%,
  100% {
    opacity: 0.25;
    transform: translateY(0);
  }

  40% {
    opacity: 1;
    transform: translateY(-2px);
  }
}

@keyframes eventResultReveal {
  0% {
    opacity: 0;
    transform: translateY(8px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.event-details .empty-state {
  margin: auto;
  background: none;
  box-shadow: none;
  color: #5c6c8f;
}

.event-thinking {
  display: inline-flex;
  gap: 0.25rem;
  align-items: center;
}

.event-thinking-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.2;
  animation: eventThinkingBlink 1s infinite ease-in-out;
}

.event-thinking-dot:nth-child(2) {
  animation-delay: 0.15s;
}

.event-thinking-dot:nth-child(3) {
  animation-delay: 0.3s;
}

.event-result {
  margin-top: 0.4rem;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  background: rgba(23, 38, 66, 0.08);
  color: #172642;
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 600;
  opacity: 0;
  transform: translateY(8px);
  animation: eventResultReveal 0.4s ease-out forwards;
}

.event-result .result-icon {
  font-size: 1.1rem;
  color: inherit;
}

.event-result.is-hit {
  background: rgba(4, 175, 112, 0.16);
  color: #036347;
}

.event-result.is-hit .result-icon {
  color: #04af70;
}

.event-result.is-miss {
  background: rgba(172, 32, 40, 0.16);
  color: #8f1c24;
}

.event-result.is-miss .result-icon {
  color: #ac2028;
}

/* Final board status styles */
.event-result.is-final {
  /* override the default reveal with a soft fade/slide that doesn't change width */
  animation: finalFadeSlide 500ms ease-out forwards;
}

.event-result.is-final.is-complete {
  /* orange-yellow celebratory background */
  background: rgba(255, 193, 7, 0.25); /* ~#FFC107 with transparency */
  color: #7a4e00;
  box-shadow: 0 12px 26px rgba(255, 193, 7, 0.25);
  border: 1px solid rgba(255, 193, 7, 0.4);
}

.event-result.is-final.is-complete .result-icon {
  color: #ff9800; /* slightly deeper orange for the trophy */
  animation: trophyPulse 1200ms ease-in-out 120ms 1 alternate;
}

/* Optional subtle wiggle for incomplete status */
.event-result.is-final:not(.is-complete) {
  animation: finalBob 600ms ease-out forwards;
}

@keyframes finalFadeSlide {
  0% {
    opacity: 0;
    transform: translateY(8px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes trophyPulse {
  0% { color: #ff9800; }
  50% { color: #ffc107; }
  100% { color: #ff9800; }
}

@keyframes finalBob {
  0% { opacity: 0; transform: translateY(8px); }
  40% { opacity: 1; transform: translateY(-2px); }
  70% { opacity: 1; transform: translateY(1px); }
  100% { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .event-result.is-final,
  .event-result.is-final.is-complete,
  .event-result.is-final:not(.is-complete) {
    animation: none !important;
  }
}

.progress-details {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  color: #172642;
}

.progress-chip {
  background: rgba(23, 38, 66, 0.07);
  border-radius: 999px;
  padding: 0.45rem 0.75rem;
  font-weight: 600;
  font-size: 0.85rem;
  color: #172642;
}

.progress-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.5rem;
}

.trajectory-timeline {
  background: #ffffff;
  border-radius: 16px;
  padding: 1.25rem 1.5rem 1.5rem;
  box-shadow: 0 18px 40px rgba(17, 34, 68, 0.12);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.timeline-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  color: #5c6c8f;
  font-size: 0.85rem;
  gap: 0.5rem;
}

.timeline-list {
  max-height: 260px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-right: 0.5rem;
}

.timeline-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  border: none;
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  background: rgba(15, 31, 60, 0.06);
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.timeline-item .timeline-index {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-primary);
  color: var(--color-on-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}

.timeline-item .timeline-summary {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.timeline-item .timeline-type {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #5c6c8f;
}

.timeline-item .timeline-text {
  font-size: 0.95rem;
  color: #172642;
}

.timeline-item:hover {
  background: rgba(48, 78, 216, 0.1);
  transform: translateY(-1px);
}

.timeline-item.is-active {
  background: rgba(48, 78, 216, 0.18);
  box-shadow: 0 12px 24px rgba(48, 78, 216, 0.25);
}

.timeline-item:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.timeline-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  width: 100%;
  position: relative;
  flex-wrap: wrap;
}

.timeline-primary-controls {
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}

.timeline-primary-controls .timeline-control-button {
  padding: 0.9rem 1.35rem;
  min-width: 70px;
  min-height: 64px;
  font-size: 1.15rem;
}

.timeline-primary-controls .timeline-control-button .playback-icon {
  font-size: 1.35rem;
}

.timeline-speed-select {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
}

.timeline-speed-select .select {
  margin: 0;
}

.timeline-speed-select select {
  min-width: 110px;
  font-weight: 600;
  text-align: center;
}

.timeline-control-button,
.timeline-nav-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  background: rgba(15, 31, 60, 0.08);
  color: #172642;
  border: none;
  border-radius: 999px;
  padding: 0.45rem 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
  min-width: 40px;
  min-height: 36px;
}

.timeline-control-button:hover,
.timeline-nav-button:hover {
  background: rgba(48, 78, 216, 0.14);
  transform: translateY(-1px);
}

.timeline-control-button:focus-visible,
.timeline-nav-button:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.timeline-control-button.is-paused {
  background: rgba(48, 78, 216, 0.12);
  color: var(--color-primary);
  box-shadow: none;
}

.timeline-control-button .playback-icon {
  font-size: 0.9rem;
  line-height: 1;
}

.timeline-nav-button[disabled],
.timeline-nav-button[aria-disabled="true"],
.timeline-nav-button[aria-disabled="true"]:hover {
  cursor: not-allowed;
  opacity: 0.45;
  background: rgba(15, 31, 60, 0.08);
  transform: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 1200px) {
  .viewer-content {
    grid-template-columns: 1fr;
  }

  .side-panel {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1.25rem;
  }

  .side-card {
    flex: 1 1 260px;
  }
}

@media (max-width: 1024px) {
  .trajectory-layout {
    grid-template-columns: 1fr;
  }

  .game-list {
    max-height: 240px;
  }

  .viewer-panel {
    gap: 1.25rem;
  }

  .trajectory-metrics {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }
}

@media (max-width: 768px) {
  .timeline-slider {
    width: 100%;
    margin: 0 0 0.65rem;
  }

  .timeline-header {
    flex-direction: column;
    align-items: center;
    padding-right: 0;
  }

  .timeline-primary-controls {
    flex: 0 0 auto;
  }

  .timeline-speed-select {
    position: static;
    transform: none;
    margin-left: 0;
    margin-top: 0.75rem;
  }

  .trajectory-explorer {
    padding: 1.5rem;
  }

  .game-list {
    max-height: none;
  }

  .selection-panel {
    padding: 1.25rem;
    gap: 1rem;
  }

  .board-card,
  .side-card {
    padding: 1.25rem;
  }

  .board-cell,
  .board-label-cell {
    min-height: 2rem;
    font-size: 0.85rem;
  }

  .timeline-list {
    max-height: 200px;
  }

  .motivation-content {
    gap: 1.5rem;
  }

  .motivation-timeline,
  .motivation-accordion {
    padding: 1.35rem 1.25rem;
  }

  .motivation-timeline-list::before {
    left: 22px;
  }

  .motivation-timeline-item {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 0.85rem;
  }

  .motivation-timeline-item::before {
    left: 22px;
  }

  .motivation-timeline-icon {
    width: 44px;
    height: 44px;
    font-size: 1rem;
  }
}

.footer .icon-link {
  font-size: 25px;
  color: #000;
}

.footer p {
  color: #4a4a4a;
}

.cc-license {
  font-size: 0.85rem;
}

/* Figure legend styles */
.legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1rem;
}
.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.legend-swatch {
  display: inline-block;
  width: 14px;
  height: 10px;
  border-radius: 2px;
}

/* Left-justify all figure captions site-wide */
.image figcaption,
figure figcaption {
  text-align: left !important;
}

/* Bottom-align the two Spotter subfigures in the codegen metrics section */
.codegen-spotter-figs {
  /* keep equal-height columns, then push figures to the bottom inside each column */
  align-items: stretch;
}
.codegen-spotter-figs .column {
  display: flex;
  flex-direction: column;
}
.codegen-spotter-figs .column > figure,
.codegen-spotter-figs .column > .image {
  margin-top: auto;
}

/* Align Captain key figures side-by-side while anchoring captions */
.captain-key-figures {
  align-items: stretch;
}
.captain-key-figures .column {
  display: flex;
  flex-direction: column;
}
.captain-key-figures .column > figure,
.captain-key-figures .column > .image {
  margin-top: auto;
}

.section-world-model {
  background: linear-gradient(180deg, rgba(9, 22, 52, 0.04) 0%, rgba(4, 175, 112, 0.08) 100%);
}

.section-world-model .section-heading {
  margin-bottom: 2.5rem;
  color: #172642;
}

.world-model-pipeline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 2.5rem;
  color: #172642;
  align-items: stretch;
}

.world-model-stage {
  display: flex;
  align-items: stretch;
  justify-content: center;
}

.world-model-card {
  background: rgba(255, 255, 255, 0.96);
  border-radius: 20px;
  padding: 1.5rem 1.65rem 1.65rem;
  box-shadow: 0 20px 44px rgba(17, 34, 68, 0.18);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  width: 100%;
  height: 100%;
}

.world-model-card--board,
.world-model-card--heatmap {
  background: radial-gradient(circle at 22% 24%, rgba(48, 78, 216, 0.12), rgba(255, 255, 255, 0.95));
}

.world-model-card-header {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.world-model-card-subtitle {
  margin: 0;
  color: #4e5d7a;
  font-size: 0.95rem;
  line-height: 1.55;
}

.world-model-card-media {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.world-model-board,
.world-model-heatmap {
  width: 100%;
  height: auto;
  border-radius: 14px;
  box-shadow: 0 20px 40px rgba(17, 34, 68, 0.16);
  border: 1px solid rgba(23, 38, 66, 0.08);
}

.world-model-heatmap {
  background: rgba(9, 22, 52, 0.06);
}

.world-model-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
}

.world-model-arrow-line {
  position: relative;
  display: inline-block;
  width: 100%;
  max-width: 110px;
  height: 2px;
  background: linear-gradient(90deg, rgba(48, 78, 216, 0.3) 0%, rgba(4, 175, 112, 0.55) 100%);
}

.world-model-arrow-line::after {
  content: '';
  position: absolute;
  top: 50%;
  right: -1px;
  width: 12px;
  height: 12px;
  border-right: 2px solid rgba(4, 175, 112, 0.7);
  border-bottom: 2px solid rgba(4, 175, 112, 0.7);
  transform: translateY(-50%) rotate(-45deg);
}

.world-model-stage--model {
  flex-direction: column;
  gap: 1.5rem;
  justify-content: flex-start;
  align-items: stretch;
}

.world-model-stage-stack {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: center;
  justify-content: flex-end;
  width: min(100%, 360px);
  margin: 0 auto;
}

.world-model-hypothesis {
  position: relative;
  width: 100%;
  min-height: 260px;
  border: 2px dashed rgba(48, 78, 216, 0.42);
  border-radius: 18px;
  padding: 2.35rem 1.5rem 1.85rem;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 36px rgba(17, 34, 68, 0.14);
  overflow: visible;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.world-model-hypothesis-label {
  position: absolute;
  top: -0.9rem;
  left: 1.5rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: #ffffff;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--color-primary);
  box-shadow: 0 10px 22px rgba(17, 34, 68, 0.18);
}

.world-model-samples {
  position: relative;
  width: min(100%, 300px);
  margin: 0 auto;
  min-height: 220px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.world-model-generator {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding-bottom: 0.35rem;
}

.world-model-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(48, 78, 216, 0.9), rgba(4, 175, 112, 0.85));
  color: #ffffff;
  font-size: 1.85rem;
  box-shadow: 0 18px 36px rgba(17, 34, 68, 0.24);
}

.world-model-caption {
  font-size: 0.95rem;
  color: #4e5d7a;
  margin: 0;
}

.world-model-caption--stage {
  text-align: center;
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
}

.world-model-sample {
  margin: 0;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 14px;
  padding: 0.6rem;
  box-shadow: 0 16px 32px rgba(17, 34, 68, 0.14);
}

.world-model-sample img {
  width: 120px;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 10px 22px rgba(17, 34, 68, 0.16);
}

.world-model-summary {
  margin-top: 2.75rem;
  display: flex;
  justify-content: center;
}

.world-model-bullets {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 1rem 1.5rem;
  background: rgba(255, 255, 255, 0.88);
  border-radius: 999px;
  box-shadow: 0 18px 36px rgba(17, 34, 68, 0.16);
}

.world-model-bullets li {
  font-weight: 600;
  color: #172642;
  font-size: 0.95rem;
}

.world-model-bullets li strong {
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.85rem;
  margin-right: 0.25rem;
}

.world-model-pipeline.is-animated .world-model-sample {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translate(-50%, 0);
  opacity: 0;
  pointer-events: none;
}

.world-model-pipeline.is-animated .world-model-samples {
  height: 230px;
}

.world-model-pipeline.is-animated .world-model-sample img {
  width: 150px;
}

.world-model-pipeline.is-complete .world-model-card--heatmap {
  box-shadow: 0 28px 56px rgba(4, 175, 112, 0.25);
}

@media (max-width: 1200px) {
  .world-model-pipeline {
    gap: 2rem;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
  }

  .world-model-card {
    padding: 1.35rem 1.45rem 1.5rem;
  }

  .world-model-pipeline.is-animated .world-model-sample img {
    width: 140px;
  }
}

@media (max-width: 1024px) {
  .world-model-pipeline {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
  }

  .world-model-arrow {
    min-height: 60px;
  }

  .world-model-arrow-line {
    width: 2px;
    height: 80px;
    background: linear-gradient(180deg, rgba(48, 78, 216, 0.3) 0%, rgba(4, 175, 112, 0.55) 100%);
  }

  .world-model-arrow-line::after {
    top: auto;
    bottom: -1px;
    right: 50%;
    transform: translate(50%, 0) rotate(135deg);
  }

  .world-model-stage-stack {
    gap: 1.25rem;
  }

  .world-model-pipeline.is-animated .world-model-samples {
    height: 220px;
  }
}

@media (max-width: 768px) {
  .world-model-card {
    padding: 1.15rem 1.25rem 1.35rem;
  }

  .world-model-sample img {
    width: 120px;
  }

  .world-model-bullets {
    border-radius: 24px;
    padding: 1.1rem;
    gap: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .world-model-pipeline.is-animated .world-model-sample {
    opacity: 1 !important;
    transform: none !important;
    position: static;
  }

  .world-model-pipeline.is-animated .world-model-samples {
    position: static;
    height: auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
  }
}