:root {
  color-scheme: light;
  --ink: #14191e;
  --paper: #f2f5f3;
  --surface: #ffffff;
  --rail-blue: #174ea6;
  --fact: #0b6b3a;
  --inference: #b85c00;
  --hypothesis: #174ea6;
  --unknown: #616b73;
  --stop: #a62b2b;
  --muted: #56616a;
  --divider: #c8d0d3;
  --display: "DIN Condensed", "Avenir Next Condensed", sans-serif;
  --body: "Avenir Next", "Helvetica Neue", sans-serif;
  --page-padding: clamp(1rem, 4vw, 4rem);
  --content-width: 100rem;
  --focus: 3px solid #174ea6;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body.drawer-open {
  overflow: hidden;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: var(--rail-blue);
}

button {
  color: inherit;
}

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

.skip-link {
  position: fixed;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 100;
  min-height: 44px;
  padding: 0.65rem 1rem;
  background: var(--surface);
  color: var(--ink);
  transform: translateY(-150%);
}

.skip-link:focus {
  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;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  min-height: 4.5rem;
  display: grid;
  grid-template-columns: minmax(15rem, 1fr) auto auto;
  align-items: stretch;
  background: var(--ink);
  color: var(--surface);
  border-bottom: 1px solid #394047;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  min-height: 4.5rem;
  color: inherit;
  text-decoration: none;
  padding: 0 1rem;
}

.brand-mark {
  width: 2.7rem;
  height: 2.7rem;
  display: grid;
  place-items: center;
  background: var(--rail-blue);
  border: 1px solid #6f95d2;
  font-family: var(--display);
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 0.9rem;
}

.brand small {
  color: #c6cdd2;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
}

.section-nav {
  display: flex;
  align-items: stretch;
  overflow-x: auto;
}

.section-nav a,
.header-control {
  min-height: 4.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-inline-start: 1px solid #394047;
  background: transparent;
  color: #d7dce0;
  padding: 0 1rem;
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.05em;
  white-space: nowrap;
  cursor: pointer;
}

.section-nav a:hover,
.header-control:hover {
  background: #20272d;
  color: var(--surface);
}

.timetable-shell {
  background: var(--paper);
  border-bottom: 1px solid var(--ink);
}

.title-board {
  max-width: var(--content-width);
  margin: 0 auto;
  min-height: 18rem;
  display: grid;
  grid-template-columns: minmax(31rem, 0.85fr) minmax(34rem, 1.15fr);
  align-items: end;
  gap: clamp(2rem, 6vw, 7rem);
  padding: clamp(2.5rem, 7vw, 7rem) var(--page-padding) clamp(2rem, 4vw, 3.5rem);
}

.route-label {
  margin: 0 0 0.75rem;
  color: var(--rail-blue);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: break-word;
}

h1,
h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

h1 {
  max-width: 10ch;
  font-size: clamp(3.5rem, 7vw, 6rem);
  line-height: 0.84;
}

h1 span {
  white-space: nowrap;
}

h2 {
  max-width: 18ch;
  font-size: clamp(2.6rem, 5vw, 4.8rem);
  line-height: 0.92;
}

h3 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.2;
}

.verdict-board {
  display: grid;
  grid-template-columns: auto minmax(12rem, 1fr) 1px auto minmax(12rem, 1fr);
  align-items: center;
  gap: 1rem;
  border: 1px solid var(--ink);
  background: var(--surface);
  padding: 1.25rem;
}

.verdict-board strong,
.verdict-board span {
  display: block;
}

.verdict-board strong {
  font-family: var(--display);
  font-size: 1.5rem;
  line-height: 1;
}

.verdict-board div:last-of-type strong {
  color: var(--stop);
}

.verdict-board div span {
  margin-top: 0.45rem;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.verdict-separator {
  align-self: stretch;
  background: var(--divider);
}

.status-dot {
  width: 0.72rem;
  height: 0.72rem;
  display: inline-block;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--unknown);
}

.status-dot-fact {
  background: var(--fact);
}

.status-dot-inference {
  background: var(--inference);
}

.status-dot-hypothesis {
  background: var(--hypothesis);
}

.status-dot-unknown {
  background: var(--unknown);
}

.status-dot-stop {
  background: var(--stop);
}

.departures {
  display: grid;
  grid-template-columns: minmax(13rem, 0.7fr) minmax(0, 5fr);
  background: var(--ink);
  color: var(--surface);
  border-block: 1px solid #394047;
}

.departures-lead {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 8.5rem;
  padding: 1rem var(--page-padding);
  border-inline-end: 1px solid #647079;
}

.departures-lead > span {
  font-size: 1.6rem;
}

.departures-lead strong,
.departures-lead span {
  display: block;
}

.departures-lead strong {
  font-family: var(--display);
  font-size: 1.2rem;
}

.departures-lead div span {
  color: #b9c1c6;
  font-size: 0.75rem;
}

.departure-track {
  min-width: 0;
  display: grid;
  grid-auto-columns: minmax(9rem, 1fr);
  grid-auto-flow: column;
  overflow-x: auto;
}

.departure-button {
  position: relative;
  min-height: 8.5rem;
  display: grid;
  align-content: space-between;
  gap: 0.65rem;
  border: 0;
  border-inline-end: 1px solid #647079;
  background: transparent;
  color: #e6eaed;
  padding: 1rem 1.1rem 1.65rem;
  text-align: left;
  cursor: pointer;
}

.departure-button::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 1.5rem;
  left: 0;
  height: 1px;
  background: #647079;
}

.departure-button::before {
  content: "";
  position: absolute;
  z-index: 2;
  bottom: 1.17rem;
  left: 1.1rem;
  width: 0.65rem;
  height: 0.65rem;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--ink);
}

.departure-button:hover {
  background: #20272d;
}

.departure-button[aria-selected="true"] {
  background: var(--rail-blue);
  color: var(--surface);
}

.departure-button[aria-selected="true"]::after {
  height: 4px;
  background: var(--surface);
}

.departure-button[aria-selected="true"]::before {
  width: 0.9rem;
  height: 0.9rem;
  bottom: 1.04rem;
  background: var(--surface);
  border-color: var(--surface);
}

.departure-time,
.departure-code,
.departure-label {
  display: block;
}

.departure-time {
  font-size: 0.72rem;
  letter-spacing: 0.05em;
}

.departure-label {
  font-family: var(--display);
  font-size: 1.65rem;
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
}

.departure-code {
  color: #b9c1c6;
  font-size: 0.7rem;
}

.departure-button[aria-selected="true"] .departure-code {
  color: #dce8fa;
}

.evidence-workbench {
  position: relative;
  isolation: isolate;
  max-width: var(--content-width);
  margin: 0 auto;
  min-height: 33rem;
  display: grid;
  grid-template-columns: minmax(14rem, 0.72fr) minmax(34rem, 2.3fr) minmax(17rem, 0.8fr);
  gap: 1.5rem;
  padding: 2rem var(--page-padding) 3.5rem;
  background: var(--paper);
}

.topic-intro,
.evidence-table-wrap,
.decision-platform {
  position: relative;
  z-index: 2;
}

.topic-intro {
  padding-top: 1rem;
}

.topic-code {
  display: inline-flex;
  min-width: 3rem;
  min-height: 2rem;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--rail-blue);
  color: var(--rail-blue);
  font-size: 0.75rem;
  font-weight: 750;
  letter-spacing: 0.06em;
}

.topic-intro h2 {
  margin-top: 1rem;
  color: var(--rail-blue);
  font-size: clamp(2.4rem, 4vw, 4rem);
}

.topic-question {
  margin: 0.75rem 0;
  font-weight: 700;
  line-height: 1.4;
}

.topic-intro > p:last-of-type {
  color: var(--muted);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 0.9rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--divider);
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.legend i {
  width: 0.55rem;
  height: 0.55rem;
}

.evidence-table-wrap {
  overflow-x: auto;
  align-self: start;
  border: 1px solid var(--ink);
  background: var(--surface);
}

table {
  border-collapse: collapse;
}

.evidence-table {
  width: 100%;
  min-width: 45rem;
  table-layout: fixed;
}

.evidence-table th,
.evidence-table td {
  border-inline-end: 1px solid var(--divider);
  border-bottom: 1px solid var(--divider);
  vertical-align: top;
  text-align: left;
}

.evidence-table th:last-child,
.evidence-table td:last-child {
  border-inline-end: 0;
}

.evidence-table tbody tr:last-child td {
  border-bottom: 0;
}

.evidence-table th {
  background: #e6ebea;
  padding: 0.7rem;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.evidence-table th:nth-child(1) {
  width: 35%;
}

.evidence-table th:nth-child(2) {
  width: 18%;
}

.evidence-table th:nth-child(3) {
  width: 32%;
}

.evidence-table th:nth-child(4) {
  width: 15%;
}

.evidence-table td {
  padding: 0;
}

.claim-button,
.source-button {
  width: 100%;
  min-height: 4.7rem;
  display: block;
  border: 0;
  background: transparent;
  padding: 0.8rem;
  text-align: left;
  cursor: pointer;
}

.claim-button {
  font-size: 0.82rem;
  line-height: 1.4;
}

.claim-button strong {
  display: block;
  margin-bottom: 0.3rem;
  color: var(--rail-blue);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

.claim-button:hover,
.source-button:hover {
  background: #eef3fa;
}

.status-cell,
.limit-cell {
  min-height: 4.7rem;
  padding: 0.8rem;
  font-size: 0.74rem;
  line-height: 1.45;
}

.evidence-table .status-cell {
  padding-inline: 0.55rem;
}

.evidence-table .status-chip {
  gap: 0.3rem;
  padding-inline: 0.4rem;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 1.65rem;
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.status-chip-fact {
  color: var(--fact);
}

.status-chip-inference {
  color: #8a4500;
}

.status-chip-hypothesis {
  color: var(--hypothesis);
}

.status-chip-unknown {
  color: #4f5961;
}

.source-button {
  color: var(--rail-blue);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.decision-platform {
  align-self: center;
  border: 1px solid var(--ink);
  background: var(--surface);
  padding: 1.2rem;
}

.decision-platform > span {
  display: block;
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.07em;
}

.decision-platform > strong {
  display: block;
  margin-top: 0.5rem;
  color: var(--rail-blue);
  font-family: var(--display);
  font-size: 3.8rem;
  line-height: 0.9;
}

.decision-platform p {
  color: var(--muted);
  font-size: 0.85rem;
}

.primary-action,
.secondary-action {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  border: 1px solid var(--rail-blue);
  border-radius: 2px;
  padding: 0.75rem 1rem;
  font-size: 0.78rem;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
}

.primary-action {
  background: var(--rail-blue);
  color: var(--surface);
}

.primary-action:hover {
  border-color: var(--ink);
  background: var(--ink);
}

.secondary-action {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}

.secondary-action:hover {
  background: var(--ink);
  color: var(--surface);
}

.no-go {
  display: grid;
  gap: 0.15rem;
  margin-top: 0.8rem;
  border: 1px solid var(--stop);
  color: var(--stop);
  padding: 0.7rem;
}

.no-go strong {
  font-size: 0.78rem;
}

.no-go span {
  font-size: 0.68rem;
}

.route-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.22;
}

.route-overlay path {
  fill: none;
  stroke: var(--rail-blue);
  stroke-width: 6;
  stroke-linecap: square;
  stroke-linejoin: miter;
  stroke-dasharray: 1600;
  stroke-dashoffset: 0;
}

.route-overlay.is-routing path {
  animation: draw-route 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes draw-route {
  from {
    stroke-dashoffset: 1600;
  }
  to {
    stroke-dashoffset: 0;
  }
}
